PageSourceSearch

https://naemo.ai/_next/static/chunks/1597.f4467a41c7d545d5.js

js naemo.ai collected 2026-09-24 14:30:38 UTC 307,347 bytes, 13 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1597],{58310:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("AlignCenter",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"17",x2:"7",y1:"12",y2:"12",key:"rsh8ii"}],["line",{x1:"19",x2:"5",y1:"18",y2:"18",key:"1t0tuv"}]])},31734:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("AlignLeft",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}],["line",{x1:"17",x2:"3",y1:"18",y2:"18",key:"1awlsn"}]])},17881:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("AlignRight",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}],["line",{x1:"21",x2:"7",y1:"18",y2:"18",key:"1g9eri"}]])},81328:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]])},35224:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]])},52264:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]])},64935:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]])},93807:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]])},48736:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},63439:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]])},29747:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]])},79022:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]])},6387:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Highlighter",[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]])},53113:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},19680:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]])},28645:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]])},7586:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]])},21047:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},76980:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]])},74656:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Quote",[["path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z",ke
1y:"4rm80e"}],["path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",key:"10za9r"}]])},48959:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Rows2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]])},70933:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("SquareCheckBig",[["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}],["path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11",key:"1jnkn4"}]])},18778:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]])},82029:function(e,n,r){r.d(n,{Z:function(){return i}});let i=(0,r(79205).Z)("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]])},24369:function(e,n,r){var i=r(2265),o="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},s=i.useState,l=i.useEffect,a=i.useLayoutEffect,h=i.useDebugValue;function c(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!o(e,r)}catch(e){return!0}}var d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,n){return n()}:function(e,n){var r=n(),i=s({inst:{value:r,getSnapshot:n}}),o=i[0].inst,d=i[1];return a(function(){o.value=r,o.getSnapshot=n,c(o)&&d({inst:o})},[e,r,n]),l(function(){return c(o)&&d({inst:o}),e(function(){c(o)&&d({inst:o})})},[e]),h(r),r};n.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:d},92860:function(e,n,r){var i=r(2265),o=r(82558),s="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},l=o.useSyncExternalStore,a=i.useRef,h=i.useEffect,c=i.useMemo,d=i.useDebugValue;n.useSyncExternalStoreWithSelector=function(e,n,r,i,o){var u=a(null);if(null===u.current){var p={hasValue:!1,value:null};u.current=p}else p=u.current;var f=l(e,(u=c(function(){function e(e){if(!h){if(h=!0,l=e,e=i(e),void 0!==o&&p.hasValue){var n=p.value;if(o(n,e))return a=n}return a=e}if(n=a,s(l,e))return n;var r=i(e);return void 0!==o&&o(n,r)?(l=e,n):(l=e,a=r)}var l,a,h=!1,c=void 0===r?null:r;return[function(){return e(n())},null===c?void 0:function(){return e(c())}]},[n,r,i,o]))[0],u[1]);return h(function(){p.hasValue=!0,p.value=f},[f]),d(f),f}},82558:function(e,n,r){e.exports=r(24369)},35195:function(e,n,r){e.exports=r(92860)},98542:function(e,n,r){r.d(n,{tZ:function(){return i}});var i=(e,n)=>{if("slot"===e)return 0;if(e instanceof Function)return e(n);let{children:r,...i}=null!=n?n:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,i,r]}},23694:function(e,n,r){r.d(n,{V6:function(){return l}});var i=r(94725),o=r(98542),s=/^\s*>\s$/,l=i.NB.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return(0,o.tZ)("blockquote",{...(0,i.P1)(this.options.HTMLAttributes,e),children:(0,o.tZ)("slot",{})})},parseMarkdown:(e,n)=>n.createNode("blockquote",void 0,n.parseChildren(e.tokens||[])),renderMarkdown:(e,n)=>{if(!e.content)return"";let r=[];return e.content.forEach(e=>{let i=n.renderChildren([e]).split("\n").map(e=>""===e.trim()?">":`> ${e}`);r.push(i.join("\n"))}),r.join(`
2>
3`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}}
3,addInputRules(){return[(0,i.S0)({find:s,type:this.type})]}})},71190:function(e,n,r){r.d(n,{y$:function(){return l}});var i=r(94725),o=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,s=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,l=i.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,i.P1)(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,n)=>`==${n.renderChildren(e)}==`,parseMarkdown:(e,n)=>n.applyMark("highlight",n.parseInline(e.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:e=>e.indexOf("=="),tokenize(e,n,r){let i=/^(==)([^=]+)(==)/.exec(e);if(i){let e=i[2].trim(),n=r.inlineTokens(e);return{type:"highlight",raw:i[0],text:e,tokens:n}}}},addCommands(){return{setHighlight:e=>({commands:n})=>n.setMark(this.name,e),toggleHighlight:e=>({commands:n})=>n.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}}
3,addInputRules(){return[(0,i.Cf)({find:o,type:this.type})]},addPasteRules(){return[(0,i.K9)({find:s,type:this.type})]}})},27123:function(e,n,r){r.d(n,{DY:function(){return a},GS:function(){return S},HC:function(){return h},Uf:function(){return E},ax:function(){return T},ev:function(){return b}});var i=r(94725),o=Object.defineProperty,s="textStyle",l=/^\s*([-+*])\s$/,a=i.NB.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",(0,i.P1)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,n)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?n.parseChildren(e.items):[]},renderMarkdown:(e,n)=>e.content?n.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(s)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=(0,i.S0)({find:l,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,i.S0)({find:l,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(s),editor:this.editor})),[e]}}),h=i.NB.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,i.P1)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,n)=>{if("list_item"!==e.type)return[];let r=[];if(e.tokens&&e.tokens.length>0){if(e.tokens.some(e=>"paragraph"===e.type))r=n.parseChildren(e.tokens);else{let i=e.tokens[0];if(i&&"text"===i.type&&i.tokens&&i.tokens.length>0){if(r=[{type:"paragraph",content:n.parseInline(i.tokens)}],e.tokens.length>1){let i=e.tokens.slice(1),o=n.parseChildren(i);r.push(...o)}}else r=n.parseChildren(e.tokens)}}return 0===r.length&&(r=[{type:"paragraph",content:[]}]),{type:"listItem",content:r}},renderMarkdown:(e,n,r)=>(0,i.wm)(e,n,e=>{var n,r;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){let i=(null==(r=null==(n=e.meta)?void 0:n.parentAttrs)?void 0:r.start)||1;return`${i+e.index}. `}return"- "},r),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((e,n)=>{for(var r in n)o(e,r,{get:n[r],enumerable:!0})})({},{findListItemPos:()=>c,getNextListDepth:()=>d,handleBackspace:()=>m,handleDelete:()=>w,hasListBefore:()=>u,hasListItemAfter:()=>v,hasListItemBefore:()=>p,listItemHasSubList:()=>f,nextListIsDeeper:()=>g,nextListIsHigher:()=>y});var c=(e,n)=>{let{$from:r}=n.selection,o=(0,i.jo)(e,n.schema),s=r.depth,l=r.pos,a=null;for(;s>0&&null===a;)r.node(s).type===o?a=s:(s-=1,l-=1);return null===a?null:{$pos:n.doc.resolve(l),depth:a}},d=(e,n)=>{let r=c(e,n);if(!r)return!1;let[,o]=(0,i.NY)(n,e,r.$pos.pos+4);return o},u=(e,n,r)=>{let{$anchor:i}=e.selection,o=Math.max(0,i.pos-2),s=e.doc.resolve(o).node();return!!(s&&r.includes(s.type.name))},p=(e,n)=>{var r;let{$anchor:i}=n.selection,o=n.doc.resolve(i.pos-2);return 0!==o.index()&&(null==(r=o.nodeBefore)?void 0:r.type.name)===e},f=(e,n,r)=>{if(!r)return!1;let o=(0,i.jo)(e,n.schema),s=!1;return r.descendants(e=>{e.type===o&&(s=!0)}),s},m=(e,n,r)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!(0,i.Ig)(e.state,n)&&u(e.state,n,r)){let{$anchor:r}=e.state.selection,i=e.state.doc.resolve(r.before()-1),o=[];i.node().descendants((e,r)=>{e.type.name===n&&o.push({node:e,pos:r})});let s=o.at(-1);if(!s)return!1;let l=e.state.doc.resolve(i.start()+s.pos+1);return e.chain().cut({from:r.start()-1,to:r.end()+1},l.end()).joinForward().run()}if(!(0,i.Ig)(e.state,n)||!(0,i.Sz)(e.state))return!1;let o=c(n,e.state);if(!o)return!1;let s=e.state.doc.resolve(o.$pos.pos-2).node(o.depth),l=f(n,e.state,s);return p(n,e.state)&&!l?e.commands.joinItemBackward():e.chain().liftListItem(n).run()},g=(e,n)=>{let r=d(e,n),i=c(e,n);return!!i&&!!r&&r>i.depth},y=(e,n)=>{let r=d(e,n),i=c(e,n);return!!i&&!!r&&r<i.depth},w=(e,n)=>{if(!(0,i.Ig)(e.state,n)||!(0,i.rI)(e.state,n))return!1;let{selection:r}=e.state,{$from:o,$to:s}=r;
3return!(!r.empty&&o.sameParent(s))&&(g(n,e.state)?e.chain().focus(e.state.selection.from+4).lift(n).joinBackward().run():y(n,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},v=(e,n)=>{var r;let{$anchor:i}=n.selection,o=n.doc.resolve(i.pos-i.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(r=o.nodeAfter)?void 0:r.type.name)===e},b=i.hj.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let n=!1;return this.options.listTypes.forEach(({itemName:r})=>{void 0!==e.state.schema.nodes[r]&&w(e,r)&&(n=!0)}),n},"Mod-Delete":({editor:e})=>{let n=!1;return this.options.listTypes.forEach(({itemName:r})=>{void 0!==e.state.schema.nodes[r]&&w(e,r)&&(n=!0)}),n},Backspace:({editor:e})=>{let n=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:i})=>{void 0!==e.state.schema.nodes[r]&&m(e,r,i)&&(n=!0)}),n},"Mod-Backspace":({editor:e})=>{let n=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:i})=>{void 0!==e.state.schema.nodes[r]&&m(e,r,i)&&(n=!0)}),n}}}}),k=/^(\s*)(\d+)\.\s+(.*)$/,A=/^\s/,x="textStyle",C=/^(\d+)\.\s$/,S=i.NB.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:n,...r}=e;return 1===n?["ol",(0,i.P1)(this.options.HTMLAttributes,r),0]:["ol",(0,i.P1)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,n)=>{if("list"!==e.type||!e.ordered)return[];let r=e.start||1,i=e.items?e.items.map(e=>{if("list_item"!==e.type)return n.parseChildren([e])[0];let r=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)r.push(...n.parseChildren([e]));else if("text"===e.type&&e.tokens){let i=n.parseChildren([e]);r.push({type:"paragraph",content:i})}else{let i=n.parseChildren([e]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}}):[];return 1!==r?{type:"orderedList",attrs:{start:r},content:i}:{type:"orderedList",content:i}},renderMarkdown:(e,n)=>e.content?n.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{let n=e.match(/^(\s*)(\d+)\.\s+/),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize:(e,n,r)=>{var i;let o=e.split("\n"),[s,l]=function(e){let n=[],r=0,i=0;for(;r<e.length;){let o=e[r],s=o.match(k);if(!s)break;let[,l,a,h]=s,c=l.length,d=h,u=r+1,p=[o];for(;u<e.length;){let n=e[u];if(n.match(k))break;if(""===n.trim())p.push(n),d+="\n",u+=1;else if(n.match(A))p.push(n),d+=`
4${n.slice(c+2)}`,u+=1;else break}n.push({indent:c,number:parseInt(a,10),content:d.trim(),raw:p.join("\n")}),i=u,r=u}return[n,i]}(o);if(0===s.length)return;let a=function e(n,r,i){var o;let s=[],l=0;for(;l<n.length;){let a=n[l];if(a.indent===r){let h=a.content.split("\n"),c=(null==(o=h[0])?void 0:o.trim())||"",d=[];c&&d.push({type:"paragraph",raw:c,tokens:i.inlineTokens(c)});let u=h.slice(1).join("\n").trim();if(u){let e=i.blockTokens(u);d.push(...e)}let p=l+1,f=[];for(;p<n.length&&n[p].indent>r;)f.push(n[p]),p+=1;if(f.length>0){let n=Math.min(...f.map(e=>e.indent)),r=e(f,n,i);d.push({type:"list",ordered:!0,start:f[0].number,items:r,raw:f.map(e=>e.raw).join("\n")})}s.push({type:"list_item",raw:a.raw,tokens:d}),l=p}else l+=1}return s}(s,0,r);if(0!==a.length)return{type:"list",ordered:!0,start:(null==(i=s[0])?void 0:i.number)||1,items:a,raw:o.slice(0,l).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(x)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}
4,addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=(0,i.S0)({find:C,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,i.S0)({find:C,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(x)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[e]}}),M=/^\s*(\[([( |x])?\])\s$/,E=i.NB.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let n=e.getAttribute("data-checked");return""===n||"true"===n},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:n}){return["li",(0,i.P1)(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,n)=>{let r=[];if(e.tokens&&e.tokens.length>0?r.push(n.createNode("paragraph",{},n.parseInline(e.tokens))):e.text?r.push(n.createNode("paragraph",{},[n.createNode("text",{text:e.text})])):r.push(n.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){let i=n.parseChildren(e.nestedTokens);r.push(...i)}return n.createNode("taskItem",{checked:e.checked||!1},r)},renderMarkdown:(e,n)=>{var r;let o=(null==(r=e.attrs)?void 0:r.checked)?"x":" ",s=`- [${o}] `;return(0,i.wm)(e,n,s)},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:n,getPos:r,editor:o})=>{let s=document.createElement("li"),l=document.createElement("label"),a=document.createElement("span"),h=document.createElement("input"),c=document.createElement("div"),d=e=>{var n,r;h.ariaLabel=(null==(r=null==(n=this.options.a11y)?void 0:n.checkboxLabel)?void 0:r.call(n,e,h.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};d(e),l.contentEditable="false",h.type="checkbox",h.addEventListener("mousedown",e=>e.preventDefault()),h.addEventListener("change",n=>{if(!o.isEditable&&!this.options.onReadOnlyChecked){h.checked=!h.checked;return}let{checked:i}=n.target;o.isEditable&&"function"==typeof r&&o.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let n=r();if("number"!=typeof n)return!1;let o=e.doc.nodeAt(n);return e.setNodeMarkup(n,void 0,{...null==o?void 0:o.attrs,checked:i}),!0}).run(),o.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,i)||(h.checked=!h.checked)}),Object.entries(this.options.HTMLAttributes).forEach(([e,n])=>{s.setAttribute(e,n)}),s.dataset.checked=e.attrs.checked,h.checked=e.attrs.checked,l.append(h,a),s.append(l,c),Object.entries(n).forEach(([e,n])=>{s.setAttribute(e,n)});let u=new Set(Object.keys(n));return{dom:s,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;s.dataset.checked=e.attrs.checked,h.checked=e.attrs.checked,d(e);let n=o.extensionManager.attributes,r=(0,i.m7)(e,n),l=new Set(Object.keys(r)),a=this.options.HTMLAttributes;return u.forEach(e=>{l.has(e)||(e in a?s.setAttribute(e,a[e]):s.removeAttribute(e))}),Object.entries(r).forEach(([e,n])=>{null==n?e in a?s.setAttribute(e,a[e]):s.removeAttribute(e):s.setAttribute(e,n)}),u=l,!0}}}}
4,addInputRules(){return[(0,i.S0)({find:M,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),T=i.NB.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",(0,i.P1)(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,n)=>n.createNode("taskList",{},n.parseChildren(e.items||[])),renderMarkdown:(e,n)=>e.content?n.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var n;let r=null==(n=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){let o=e=>{let n=(0,i.NI)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,n)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:r.inlineTokens(e.mainContent),nestedTokens:n}),customNestedParser:o},r);return n?[{type:"taskList",raw:n.raw,items:n.items}]:r.blockTokens(e)},s=(0,i.NI)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,n)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:r.inlineTokens(e.mainContent),nestedTokens:n}),customNestedParser:o},r);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});i.hj.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(a.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(h.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(b.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(S.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(E.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(T.configure(this.options.taskList)),e}})},5172:function(e,n,r){r.d(n,{V:function(){return i.Vm}});var i=r(74922)},36750:function(e,n,r){r.d(n,{p:function(){return i.pj}});var i=r(76879)},67966:function(e,n,r){r.d(n,{x:function(){return i.xD}});var i=r(76879)},84110:function(e,n,r){r.d(n,{S:function(){return i.SC}});var i=r(76879)},76879:function(e,n,r){let i,o;r.d(n,{iA:function(){return eg},pj:function(){return el},xD:function(){return ea},SC:function(){return eh}});var s=r(94725),l=r(17213),a=r(10121),h=r(79006),c=r(10258),d=r(94536);if("undefined"!=typeof WeakMap){let e=new WeakMap;i=n=>e.get(n),o=(n,r)=>(e.set(n,r),r)}else{let e=[],n=0;i=n=>{for(let r=0;r<e.length;r+=2)if(e[r]==n)return e[r+1]},o=(r,i)=>(10==n&&(n=0),e[n++]=r,e[n++]=i)}var u=class{constructor(e,n,r,i){this.width=e,this.height=n,this.map=r,this.problems=i}findCell(e){for(let n=0;n<this.map.length;n++){let r=this.map[n];if(r!=e)continue;let i=n%this.width,o=n/this.width|0,s=i+1,l=o+1;for(let e=1;s<this.width&&this.map[n+e]==r;e++)s++;for(let e=1;l<this.height&&this.map[n+this.width*e]==r;e++)l++;return{left:i,top:o,right:s,bottom:l}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let n=0;n<this.map.length;n++)if(this.map[n]==e)return n%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,n,r){let{left:i,right:o,top:s,bottom:l}=this.findCell(e);return"horiz"==n?(r<0?0==i:o==this.width)?null:this.map[s*this.width+(r<0?i-1:o)]:(r<0?0==s:l==this.height)?null:this.map[i+this.width*(r<0?s-1:l)]}rectBetween(e,n){let{left:r,right:i,top:o,bottom:s}=this.findCell(e),{left:l,right:a,top:h,bottom:c}=this.findCell(n);return{left:Math.min(r,l),top:Math.min(o,h),right:Math.max(i,a),bottom:Math.max(s,c)}}cellsInRect(e){let n=[],r={};for(let i=e.top;i<e.bottom;i++)for(let o=e.left;o<e.right;o++){let s=i*this.width+o,l=this.map[s];!r[l]&&(r[l]=!0,o==e.left&&o&&this.map[s-1]==l||i==e.top&&i&&this.map[s-this.width]==l||n.push(l))}return n}positionAt(e,n,r){for(let i=0,o=0;;i++){let s=o+r.child(i).nodeSize;if(i==e){let r=n+e*this.width,i=(e+1)*this.width;for(;r<i&&this.map[r]<o;)r++;return r==i?s-1:this.map[r]}o=s}}static get(e){return i(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw RangeError("Not a table node: "+e.type.n
4ame);let n=function(e){let n=-1,r=!1;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=0;if(r)for(let n=0;n<i;n++){let r=e.child(n);for(let e=0;e<r.childCount;e++){let o=r.child(e);n+o.attrs.rowspan>i&&(s+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){let n=o.child(e);s+=n.attrs.colspan,n.attrs.rowspan>1&&(r=!0)}-1==n?n=s:n!=s&&(n=Math.max(n,s))}return n}(e),r=e.childCount,i=[],o=0,s=null,l=[];for(let e=0,o=n*r;e<o;e++)i[e]=0;for(let a=0,h=0;a<r;a++){let c=e.child(a);h++;for(let e=0;;e++){for(;o<i.length&&0!=i[o];)o++;if(e==c.childCount)break;let d=c.child(e),{colspan:u,rowspan:p,colwidth:f}=d.attrs;for(let e=0;e<p;e++){if(e+a>=r){(s||(s=[])).push({type:"overlong_rowspan",pos:h,n:p-e});break}let c=o+e*n;for(let e=0;e<u;e++){0==i[c+e]?i[c+e]=h:(s||(s=[])).push({type:"collision",row:a,pos:h,n:u-e});let r=f&&f[e];if(r){let i=(c+e)%n*2,o=l[i];null==o||o!=r&&1==l[i+1]?(l[i]=r,l[i+1]=1):o==r&&l[i+1]++}}}o+=u,h+=d.nodeSize}let d=(a+1)*n,u=0;for(;o<d;)0==i[o++]&&u++;u&&(s||(s=[])).push({type:"missing",row:a,n:u}),h++}(0===n||0===r)&&(s||(s=[])).push({type:"zero_sized"});let a=new u(n,r,i,s),h=!1;for(let e=0;!h&&e<l.length;e+=2)null!=l[e]&&l[e+1]<r&&(h=!0);return h&&function(e,n,r){e.problems||(e.problems=[]);let i={};for(let o=0;o<e.map.length;o++){let s=e.map[o];if(i[s])continue;i[s]=!0;let l=r.nodeAt(s);if(!l)throw RangeError(`No cell with offset ${s} found`);let a=null,h=l.attrs;for(let r=0;r<h.colspan;r++){let i=n[(o+r)%e.width*2];null==i||h.colwidth&&h.colwidth[r]==i||((a||(a=function(e){if(e.colwidth)return e.colwidth.slice();let n=[];for(let r=0;r<e.colspan;r++)n.push(0);return n}(h)))[r]=i)}a&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}(a,l,e),a}(e))}};function p(e){let n=e.cached.tableNodeTypes;if(!n)for(let r in n=e.cached.tableNodeTypes={},e.nodes){let i=e.nodes[r],o=i.spec.tableRole;o&&(n[o]=i)}return n}let f=new l.H$("selectingCells");function m(e){for(let n=e.depth-1;n>0;n--)if("row"==e.node(n).type.spec.tableRole)return e.node(0).resolve(e.before(n+1));return null}function g(e){let n=e.selection.$head;for(let e=n.depth;e>0;e--)if("row"==n.node(e).type.spec.tableRole)return!0;return!1}function y(e){let n=e.selection;if("$anchorCell"in n&&n.$anchorCell)return n.$anchorCell.pos>n.$headCell.pos?n.$anchorCell:n.$headCell;if("node"in n&&n.node&&"cell"==n.node.type.spec.tableRole)return n.$anchor;let r=m(n.$head)||function(e){for(let n=e.nodeAfter,r=e.pos;n;n=n.firstChild,r++){let i=n.type.spec.tableRole;if("cell"==i||"header_cell"==i)return e.doc.resolve(r)}for(let n=e.nodeBefore,r=e.pos;n;n=n.lastChild,r--){let i=n.type.spec.tableRole;if("cell"==i||"header_cell"==i)return e.doc.resolve(r-n.nodeSize)}}(n.$head);if(r)return r;throw RangeError(`No cell found around position ${n.head}`)}function w(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function v(e,n){return e.depth==n.depth&&e.pos>=n.start(-1)&&e.pos<=n.end(-1)}function b(e,n,r){let i=e.node(-1),o=u.get(i),s=e.start(-1),l=o.nextCell(e.pos-s,n,r);return null==l?null:e.node(0).resolve(s+l)}function k(e,n,r=1){let i={...e,colspan:e.colspan-r};return i.colwidth&&(i.colwidth=i.colwidth.slice(),i.colwidth.splice(n,r),i.colwidth.some(e=>e>0)||(i.colwidth=null)),i}function A(e,n,r=1){let i={...e,colspan:e.colspan+r};if(i.colwidth){i.colwidth=i.colwidth.slice();for(let e=0;e<r;e++)i.colwidth.splice(n,0,0)}return i}var x=class e extends l.Y1{constructor(e,n=e){let r=e.node(-1),i=u.get(r),o=e.start(-1),s=i.rectBetween(e.pos-o,n.pos-o),a=e.node(0),h=i.cellsInRect(s).filter(e=>e!=n.pos-o);h.unshift(n.pos-o);let c=h.map(e=>{let n=r.nodeAt(e);if(!n)throw RangeError(`No cell with offset ${e} found`);let i=o+e+1;return new l.xm(a.resolve(i),a.resolve(i+n.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(n,r){let i=n.resolve(r.map(this.$anchorCell.pos)),o=n.resolve(r.map(this.$headCell.pos));if(w(i)&&w(o)&&v(i,o)){let n=this.$anchorCell.node(-1)!=i.node(-1);return n&&this.isRowSelection()?e.rowSelection(i,o):n&&this.isColSelection()?e.colSelection(i,o):new e(i,o)}return l.Bs.between(i,o)}content(){let e=this.$anchorCell.node(-1),n=u.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let r=i.top;r<i.bottom;r++){let l=[];for(let s=r*n.width+i.left,a=i.left;a<i.right;a++,s++){let r=n.map[s];if(o[r])continue;o[r]=!0;let a=n.findCell(r),h=e.nodeAt(r);
4if(!h)throw RangeError(`No cell with offset ${r} found`);let c=i.left-a.left,d=a.right-i.right;if(c>0||d>0){let e=h.attrs;if(c>0&&(e=k(e,0,c)),d>0&&(e=k(e,e.colspan-d,d)),a.left<i.left){if(!(h=h.type.createAndFill(e)))throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else h=h.type.create(e,h.content)}if(a.top<i.top||a.bottom>i.bottom){let e={...h.attrs,rowspan:Math.min(a.bottom,i.bottom)-Math.max(a.top,i.top)};h=a.top<i.top?h.type.createAndFill(e):h.type.create(e,h.content)}l.push(h)}s.push(e.child(r).copy(a.HY.from(l)))}let l=this.isColSelection()&&this.isRowSelection()?e:s;return new a.p2(a.HY.from(l),1,1)}replace(e,n=a.p2.empty){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:l}=i[o],h=e.mapping.slice(r);e.replace(h.map(s.pos),h.map(l.pos),o?a.p2.empty:n)}let o=l.Y1.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,n){this.replace(e,new a.p2(a.HY.from(n),0,0))}forEachCell(e){let n=this.$anchorCell.node(-1),r=u.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let r=0;r<o.length;r++)e(n.nodeAt(o[r]),i+o[r])}isColSelection(){let e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);return!(Math.min(e,n)>0)&&Math.max(e+this.$anchorCell.nodeAfter.attrs.rowspan,n+this.$headCell.nodeAfter.attrs.rowspan)==this.$headCell.node(-1).childCount}static colSelection(n,r=n){let i=n.node(-1),o=u.get(i),s=n.start(-1),l=o.findCell(n.pos-s),a=o.findCell(r.pos-s),h=n.node(0);return l.top<=a.top?(l.top>0&&(n=h.resolve(s+o.map[l.left])),a.bottom<o.height&&(r=h.resolve(s+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(r=h.resolve(s+o.map[a.left])),l.bottom<o.height&&(n=h.resolve(s+o.map[o.width*(o.height-1)+l.right-1]))),new e(n,r)}isRowSelection(){let e=this.$anchorCell.node(-1),n=u.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);return!(Math.min(i,o)>0)&&Math.max(i+this.$anchorCell.nodeAfter.attrs.colspan,o+this.$headCell.nodeAfter.attrs.colspan)==n.width}eq(n){return n instanceof e&&n.$anchorCell.pos==this.$anchorCell.pos&&n.$headCell.pos==this.$headCell.pos}static rowSelection(n,r=n){let i=n.node(-1),o=u.get(i),s=n.start(-1),l=o.findCell(n.pos-s),a=o.findCell(r.pos-s),h=n.node(0);return l.left<=a.left?(l.left>0&&(n=h.resolve(s+o.map[l.top*o.width])),a.right<o.width&&(r=h.resolve(s+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(r=h.resolve(s+o.map[a.top*o.width])),l.right<o.width&&(n=h.resolve(s+o.map[o.width*(l.top+1)-1]))),new e(n,r)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(n,r){return new e(n.resolve(r.anchor),n.resolve(r.head))}static create(n,r,i=r){return new e(n.resolve(r),n.resolve(i))}getBookmark(){return new C(this.$anchorCell.pos,this.$headCell.pos)}};x.prototype.visible=!1,l.Y1.jsonID("cell",x);
4var C=class e{constructor(e,n){this.anchor=e,this.head=n}map(n){return new e(n.map(this.anchor),n.map(this.head))}resolve(e){let n=e.resolve(this.anchor),r=e.resolve(this.head);return"row"==n.parent.type.spec.tableRole&&"row"==r.parent.type.spec.tableRole&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&v(n,r)?new x(n,r):l.Y1.near(r,1)}};function S(e){if(!(e.selection instanceof x))return null;let n=[];return e.selection.forEachCell((e,r)=>{n.push(h.p.node(r,r+e.nodeSize,{class:"selectedCell"}))}),h.EH.create(e.doc,n)}let M=new l.H$("fix-tables");function E(e,n){let r;let i=(n,i)=>{"table"==n.type.spec.tableRole&&(r=function(e,n,r,i){let o,s;let l=u.get(n);if(!l.problems)return i;i||(i=e.tr);let a=[];for(let e=0;e<l.height;e++)a.push(0);for(let e=0;e<l.problems.length;e++){let o=l.problems[e];if("collision"==o.type){let e=n.nodeAt(o.pos);if(!e)continue;let s=e.attrs;for(let e=0;e<s.rowspan;e++)a[o.row+e]+=o.n;i.setNodeMarkup(i.mapping.map(r+1+o.pos),null,k(s,s.colspan-o.n,o.n))}else if("missing"==o.type)a[o.row]+=o.n;else if("overlong_rowspan"==o.type){let e=n.nodeAt(o.pos);if(!e)continue;i.setNodeMarkup(i.mapping.map(r+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if("colwidth mismatch"==o.type){let e=n.nodeAt(o.pos);if(!e)continue;i.setNodeMarkup(i.mapping.map(r+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if("zero_sized"==o.type){let e=i.mapping.map(r);i.delete(e,e+n.nodeSize)}}for(let e=0;e<a.length;e++)a[e]&&(null==o&&(o=e),s=e);for(let h=0,c=r+1;h<l.height;h++){let r=n.child(h),l=c+r.nodeSize,d=a[h];if(d>0){let n="cell";r.firstChild&&(n=r.firstChild.type.spec.tableRole);let a=[];for(let r=0;r<d;r++){let r=p(e.schema)[n].createAndFill();r&&a.push(r)}let u=(0==h||o==h-1)&&s==h?c+1:l-1;i.insert(i.mapping.map(u),a)}c=l}return i.setMeta(M,{fixTables:!0})}(e,n,i,r))};return n?n.doc!=e.doc&&function e(n,r,i,o){let s=n.childCount,l=r.childCount;e:for(let a=0,h=0;a<l;a++){let l=r.child(a);for(let e=h,r=Math.min(s,a+3);e<r;e++)if(n.child(e)==l){h=e+1,i+=l.nodeSize;continue e}o(l,i),h<s&&n.child(h).sameMarkup(l)?e(n.child(h),l,i+1,o):l.nodesBetween(0,l.content.size,o,i+1),i+=l.nodeSize}}(n.doc,e.doc,0,i):e.doc.descendants(i),r}
4function T(e){let n=e.selection,r=y(e),i=r.node(-1),o=r.start(-1),s=u.get(i);return{...n instanceof x?s.rectBetween(n.$anchorCell.pos-o,n.$headCell.pos-o):s.findCell(r.pos-o),tableStart:o,map:s,table:i}}function R(e,{map:n,tableStart:r,table:i},o){let s=o>0?-1:0;(function(e,n,r){let i=p(n.type.schema).header_cell;for(let o=0;o<e.height;o++)if(n.nodeAt(e.map[r+o*e.width]).type!=i)return!1;return!0})(n,i,o+s)&&(s=0==o||o==n.width?null:0);for(let l=0;l<n.height;l++){let a=l*n.width+o;if(o>0&&o<n.width&&n.map[a-1]==n.map[a]){let s=n.map[a],h=i.nodeAt(s);e.setNodeMarkup(e.mapping.map(r+s),null,A(h.attrs,o-n.colCount(s))),l+=h.attrs.rowspan-1}else{let h=null==s?p(i.type.schema).cell:i.nodeAt(n.map[a+s]).type,c=n.positionAt(l,o,i);e.insert(e.mapping.map(r+c),h.createAndFill())}}return e}function I(e,{map:n,tableStart:r,table:i},o){let s=r;for(let e=0;e<o;e++)s+=i.child(e).nodeSize;let l=[],a=o>0?-1:0;(function(e,n,r){var i;let o=p(n.type.schema).header_cell;for(let s=0;s<e.width;s++)if((null===(i=n.nodeAt(e.map[s+r*e.width]))||void 0===i?void 0:i.type)!=o)return!1;return!0})(n,i,o+a)&&(a=0==o||o==n.height?null:0);for(let s=0,c=n.width*o;s<n.width;s++,c++)if(o>0&&o<n.height&&n.map[c]==n.map[c-n.width]){let o=n.map[c],l=i.nodeAt(o).attrs;e.setNodeMarkup(r+o,null,{...l,rowspan:l.rowspan+1}),s+=l.colspan-1}else{var h;let e=null==a?p(i.type.schema).cell:null===(h=i.nodeAt(n.map[c+a*n.width]))||void 0===h?void 0:h.type,r=null==e?void 0:e.createAndFill();r&&l.push(r)}return e.insert(s,p(i.type.schema).row.create(null,l)),e}function O(e){let n=e.content;return 1==n.childCount&&n.child(0).isTextblock&&0==n.child(0).childCount}function N(e,n){let r=e.selection;if(!(r instanceof x)||r.$anchorCell.pos==r.$headCell.pos)return!1;let i=T(e),{map:o}=i;if(function({width:e,height:n,map:r},i){let o=i.top*e+i.left,s=o,l=(i.bottom-1)*e+i.left,a=o+(i.right-i.left-1);for(let n=i.top;n<i.bottom;n++){if(i.left>0&&r[s]==r[s-1]||i.right<e&&r[a]==r[a+1])return!0;s+=e,a+=e}for(let s=i.left;s<i.right;s++){if(i.top>0&&r[o]==r[o-e]||i.bottom<n&&r[l]==r[l+e])return!0;o++,l++}return!1}(o,i))return!1;if(n){let r,s;let l=e.tr,h={},c=a.HY.empty;for(let e=i.top;e<i.bottom;e++)for(let n=i.left;n<i.right;n++){let a=o.map[e*o.width+n],d=i.table.nodeAt(a);if(!h[a]&&d){if(h[a]=!0,null==r)r=a,s=d;else{O(d)||(c=c.append(d.content));let e=l.mapping.map(a+i.tableStart);l.delete(e,e+d.nodeSize)}}}if(null==r||null==s)return!0;if(l.setNodeMarkup(r+i.tableStart,null,{...A(s.attrs,s.attrs.colspan,i.right-i.left-s.attrs.colspan),rowspan:i.bottom-i.top}),c.size>0){let e=r+1+s.content.size,n=O(s)?r+1:e;l.replaceWith(n+i.tableStart,e+i.tableStart,c)}l.setSelection(new x(l.doc.resolve(r+i.tableStart))),n(l)}return!0}function L(e,n){var r;let i=p(e.schema);return(r=({node:e})=>i[e.type.spec.tableRole],(e,n)=>{let i,o;let s=e.selection;if(s instanceof x){if(s.$anchorCell.pos!=s.$headCell.pos)return!1;i=s.$anchorCell.nodeAfter,o=s.$anchorCell.pos}else{var l;if(!(i=function(e){for(let n=e.depth;n>0;n--){let r=e.node(n).type.spec.tableRole;if("cell"===r||"header_cell"===r)return e.node(n)}return null}(s.$from)))return!1;o=null===(l=m(s.$from))||void 0===l?void 0:l.pos}if(null==i||null==o||1==i.attrs.colspan&&1==i.attrs.rowspan)return!1;if(n){let l,a=i.attrs,h=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});let d=T(e),u=e.tr;for(let e=0;e<d.right-d.left;e++)h.push(c?{...a,colwidth:c&&c[e]?[c[e]]:null}:a);for(let e=d.top;e<d.bottom;e++){let n=d.map.positionAt(e,d.left,d.table);e==d.top&&(n+=i.nodeSize);for(let o=d.left,s=0;o<d.right;o++,s++)(o!=d.left||e!=d.top)&&u.insert(l=u.mapping.map(n+d.tableStart,1),r({node:i,row:e,col:o}).createAndFill(h[s]))}u.setNodeMarkup(o,r({node:i,row:d.top,col:d.left}),h[0]),s instanceof x&&u.setSelection(new x(u.doc.resolve(s.$anchorCell.pos),l?u.doc.resolve(l):void 0)),n(u)}return!0})(e,n)}function H(e,n,r){let i=n.map.cellsInRect({left:0,top:0,right:"row"==e?n.map.width:1,bottom:"column"==e?n.map.height:1});for(let e=0;e<i.length;e++){let o=n.table.nodeAt(i[e]);if(o&&o.type!==r.header_cell)return!1}return!0}function z(e,n){return(n=n||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(n,r){if(!g(n))return!1;if(r){let i=p(n.schema),o=T(n),s=n.tr,l=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=l.map(e=>o.table.nodeAt(e));for(let e=0;e<l.length;e++)a[e].type==i.header_cell&&s.setNodeMarkup(o.tableStart+l[e],i.cell,a[e].attrs);if(0===s.steps.length)for(let e=0;e<l.length;e++)s.setNodeMarkup(o.tableStart+l[e],i.header_cell,a[e].attrs);r(s)}return!0}:function(n,r){if(!g(n))return!1;if(r){let i=p(n.schema),o=T(n),s=n.tr,l=H("row",o,i),a=H("column",o,i),h=("column"===e?l:"row"===e&&a)?1:0,c="column"==e?{left:0,top:h,right:1,bottom:o.map.height}:"row"==e?{left:h,top:0,right:o.map.width,bottom:1}:o,d="column"==e?a?i.cell:i.header_cell:"row"==e?l?i.cell:i.header_cell:i.cell;
4o.map.cellsInRect(c).forEach(e=>{let n=e+o.tableStart,r=s.doc.nodeAt(n);r&&s.setNodeMarkup(n,d,r.attrs)}),r(s)}return!0}}z("row",{useDeprecatedLogic:!0}),z("column",{useDeprecatedLogic:!0});let B=z("cell",{useDeprecatedLogic:!0});function F(e){return function(n,r){if(!g(n))return!1;let i=function(e,n){if(n<0){let n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let n=e.index(-1)-1,r=e.before();n>=0;n--){let i=e.node(-1).child(n),o=i.lastChild;if(o)return r-1-o.nodeSize;r-=i.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let n=e.node(-1);for(let r=e.indexAfter(-1),i=e.after();r<n.childCount;r++){let e=n.child(r);if(e.childCount)return i+1;i+=e.nodeSize}}return null}(y(n),e);if(null==i)return!1;if(r){let e=n.doc.resolve(i);r(n.tr.setSelection(l.Bs.between(e,e.node(0).resolve(e.pos+e.nodeAfter.nodeSize))).scrollIntoView())}return!0}}function $(e,n){let r=e.selection;if(!(r instanceof x))return!1;if(n){let i=e.tr,o=p(e.schema).cell.createAndFill().content;r.forEachCell((e,n)=>{e.content.eq(o)||i.replace(i.mapping.map(n+1),i.mapping.map(n+e.nodeSize-1),new a.p2(o,0,0))}),i.docChanged&&n(i)}return!0}function D(e,n){let r=e.createAndFill();return new d.wx(r).replace(0,r.content.size,n).doc}function P(e,n,r,i,o,s,l,a){if(0==l||l==n.height)return!1;let h=!1;for(let c=o;c<s;c++){let o=l*n.width+c,s=n.map[o];if(n.map[o-n.width]==s){h=!0;let o=r.nodeAt(s),{top:d,left:u}=n.findCell(s);e.setNodeMarkup(e.mapping.slice(a).map(s+i),null,{...o.attrs,rowspan:l-d}),e.insert(e.mapping.slice(a).map(n.positionAt(l,u,r)),o.type.createAndFill({...o.attrs,rowspan:d+o.attrs.rowspan-l})),c+=o.attrs.colspan-1}}return h}function j(e,n,r,i,o,s,l,a){if(0==l||l==n.width)return!1;let h=!1;for(let c=o;c<s;c++){let o=c*n.width+l,s=n.map[o];if(n.map[o-1]==s){h=!0;let o=r.nodeAt(s),d=n.colCount(s),u=e.mapping.slice(a).map(s+i);e.setNodeMarkup(u,null,k(o.attrs,l-d,o.attrs.colspan-(l-d))),e.insert(u+o.nodeSize,o.type.createAndFill(k(o.attrs,0,l-d))),c+=o.attrs.rowspan-1}}return h}function U(e,n,r,i,o){let s=r?e.doc.nodeAt(r-1):e.doc;if(!s)throw Error("No table found");let l=u.get(s),{top:h,left:c}=i,d=c+o.width,f=h+o.height,m=e.tr,g=0;function y(){if(!(s=r?m.doc.nodeAt(r-1):m.doc))throw Error("No table found");l=u.get(s),g=m.mapping.maps.length}(function(e,n,r,i,o,s,l){let h,c;let d=p(e.doc.type.schema);if(o>n.width)for(let s=0,l=0;s<n.height;s++){let a;let u=r.child(s);l+=u.nodeSize;let p=[];a=null==u.lastChild||u.lastChild.type==d.cell?h||(h=d.cell.createAndFill()):c||(c=d.header_cell.createAndFill());for(let e=n.width;e<o;e++)p.push(a);e.insert(e.mapping.slice(0).map(l-1+i),p)}if(s>n.height){let l=[];for(let e=0,i=(n.height-1)*n.width;e<Math.max(n.width,o);e++){let o=!(e>=n.width)&&r.nodeAt(n.map[i+e]).type==d.header_cell;l.push(o?c||(c=d.header_cell.createAndFill()):h||(h=d.cell.createAndFill()))}let u=d.row.create(null,a.HY.from(l)),p=[];for(let e=n.height;e<s;e++)p.push(u);e.insert(e.mapping.slice(0).map(i+r.nodeSize-2),p)}return!!(h||c)})(m,l,s,r,d,f,0)&&y(),P(m,l,s,r,c,d,h,g)&&y(),P(m,l,s,r,c,d,f,g)&&y(),j(m,l,s,r,h,f,c,g)&&y(),j(m,l,s,r,h,f,d,g)&&y();for(let e=h;e<f;e++){let n=l.positionAt(e,c,s),i=l.positionAt(e,d,s);m.replace(m.mapping.slice(g).map(n+r),m.mapping.slice(g).map(i+r),new a.p2(o.rows[e-h],0,0))}y(),m.setSelection(new x(m.doc.resolve(r+l.positionAt(h,c,s)),m.doc.resolve(r+l.positionAt(f-1,d-1,s)))),n(m)}let _=(0,c.$)({ArrowLeft:q("horiz",-1),ArrowRight:q("horiz",1),ArrowUp:q("vert",-1),ArrowDown:q("vert",1),"Shift-ArrowLeft":V("horiz",-1),"Shift-ArrowRight":V("horiz",1),"Shift-ArrowUp":V("vert",-1),"Shift-ArrowDown":V("vert",1),Backspace:$,"Mod-Backspace":$,Delete:$,"Mod-Delete":$});function W(e,n,r){return!r.eq(e.selection)&&(n&&n(e.tr.setSelection(r).scrollIntoView()),!0)}function q(e,n){return(r,i,o)=>{if(!o)return!1;let s=r.selection;if(s instanceof x)return W(r,i,l.Y1.near(s.$headCell,n));if("horiz"!=e&&!s.empty)return!1;let a=Q(o,e,n);if(null==a)return!1;if("horiz"==e)return W(r,i,l.Y1.near(r.doc.resolve(s.head+n),n));{let o;let s=r.doc.resolve(a),h=b(s,e,n);return o=h?l.Y1.near(h,1):n<0?l.Y1.near(r.doc.resolve(s.before(-1)),-1):l.Y1.near(r.doc.resolve(s.after(-1)),1),W(r,i,o)}}}
4function V(e,n){return(r,i,o)=>{let s;if(!o)return!1;let l=r.selection;if(l instanceof x)s=l;else{let i=Q(o,e,n);if(null==i)return!1;s=new x(r.doc.resolve(i))}let a=b(s.$headCell,e,n);return!!a&&W(r,i,new x(s.$anchorCell,a))}}function J(e,n){let r=m(e.state.doc.resolve(n));return!!r&&(e.dispatch(e.state.tr.setSelection(new x(r))),!0)}function Y(e,n,r){if(!g(e.state))return!1;let i=function(e){if(0===e.size)return null;let{content:n,openStart:r,openEnd:i}=e;for(;1==n.childCount&&(r>0&&i>0||"table"==n.child(0).type.spec.tableRole);)r--,i--,n=n.child(0).content;let o=n.child(0),s=o.type.spec.tableRole,l=o.type.schema,h=[];if("row"==s)for(let e=0;e<n.childCount;e++){let o=n.child(e).content,s=e?0:Math.max(0,r-1),c=e<n.childCount-1?0:Math.max(0,i-1);(s||c)&&(o=D(p(l).row,new a.p2(o,s,c)).content),h.push(o)}else{if("cell"!=s&&"header_cell"!=s)return null;h.push(r||i?D(p(l).row,new a.p2(n,r,i)).content:n)}return function(e,n){let r=[];for(let e=0;e<n.length;e++){let i=n[e];for(let n=i.childCount-1;n>=0;n--){let{rowspan:o,colspan:s}=i.child(n).attrs;for(let n=e;n<e+o;n++)r[n]=(r[n]||0)+s}}let i=0;for(let e=0;e<r.length;e++)i=Math.max(i,r[e]);for(let o=0;o<r.length;o++)if(o>=n.length&&n.push(a.HY.empty),r[o]<i){let s=p(e).cell.createAndFill(),l=[];for(let e=r[o];e<i;e++)l.push(s);n[o]=n[o].append(a.HY.from(l))}return{height:n.length,width:i,rows:n}}(l,h)}(r),o=e.state.selection;if(o instanceof x){i||(i={width:1,height:1,rows:[a.HY.from(D(p(e.state.schema).cell,r))]});let n=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),l=u.get(n).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return i=function({width:e,height:n,rows:r},i,o){if(e!=i){let n=[],o=[];for(let e=0;e<r.length;e++){let s=r[e],l=[];for(let r=n[e]||0,o=0;r<i;o++){let a=s.child(o%s.childCount);r+a.attrs.colspan>i&&(a=a.type.createChecked(k(a.attrs,a.attrs.colspan,r+a.attrs.colspan-i),a.content)),l.push(a),r+=a.attrs.colspan;for(let r=1;r<a.attrs.rowspan;r++)n[e+r]=(n[e+r]||0)+a.attrs.colspan}o.push(a.HY.from(l))}r=o,e=i}if(n!=o){let e=[];for(let i=0,s=0;i<o;i++,s++){let l=[],h=r[s%n];for(let e=0;e<h.childCount;e++){let n=h.child(e);i+n.attrs.rowspan>o&&(n=n.type.create({...n.attrs,rowspan:Math.max(1,o-n.attrs.rowspan)},n.content)),l.push(n)}e.push(a.HY.from(l))}r=e,n=o}return{width:e,height:n,rows:r}}(i,l.right-l.left,l.bottom-l.top),U(e.state,e.dispatch,s,l,i),!0}if(!i)return!1;{let n=y(e.state),r=n.start(-1);return U(e.state,e.dispatch,r,u.get(n.node(-1)).findCell(n.pos-r),i),!0}}function K(e,n){var r;let i;if(0!=n.button||n.ctrlKey||n.metaKey)return;let o=Z(e,n.target);if(n.shiftKey&&e.state.selection instanceof x)s(e.state.selection.$anchorCell,n),n.preventDefault();else if(n.shiftKey&&o&&null!=(i=m(e.state.selection.$anchor))&&(null===(r=G(e,n))||void 0===r?void 0:r.pos)!=i.pos)s(i,n),n.preventDefault();else if(!o)return;function s(n,r){let i=G(e,r),o=null==f.getState(e.state);if(!i||!v(n,i)){if(!o)return;i=n}let s=new x(n,i);if(o||!e.state.selection.eq(s)){let r=e.state.tr.setSelection(s);o&&r.setMeta(f,n.pos),e.dispatch(r)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",a),null!=f.getState(e.state)&&e.dispatch(e.state.tr.setMeta(f,-1))}function a(r){let i;let a=f.getState(e.state);if(null!=a)i=e.state.doc.resolve(a);else if(Z(e,r.target)!=o&&!(i=G(e,n)))return l();i&&s(i,r)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",a)}function Q(e,n,r){if(!(e.state.selection instanceof l.Bs))return null;let{$head:i}=e.state.selection;for(let o=i.depth-1;o>=0;o--){let s=i.node(o);if((r<0?i.index(o):i.indexAfter(o))!=(r<0?0:s.childCount))break;if("cell"==s.type.spec.tableRole||"header_cell"==s.type.spec.tableRole){let s=i.before(o),l="vert"==n?r>0?"down":"up":r>0?"right":"left";return e.endOfTextblock(l)?s:null}}return null}function Z(e,n){for(;n&&n!=e.dom;n=n.parentNode)if("TD"==n.nodeName||"TH"==n.nodeName)return n;return null}function G(e,n){let r=e.posAtCoords({left:n.clientX,top:n.clientY});if(!r)return null;let{inside:i,pos:o}=r;return i>=0&&m(e.state.doc.resolve(i))||m(e.state.doc.resolve(o))}var X=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,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",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ee(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,ee(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function ee(e,n,r,i,o,s){let l=0,a=!0,h=n.firstChild,c=e.firstChild;if(c){for(let e=0,r=0;e<c.childCount;e++){let{colspan:d,colwidth:u}=c.child(e).attrs;for(let e=0;e<d;e++,r++){let c=o==r?s:u&&u[e],d=c?c+"px":"";if(l+=c||i,c||(a=!1),h)h.style.width!=d&&(h.style.width=d),h=h.nextSibling;else{let e=document.createElement("col");e.style.width=d,n.appendChild(e)}}}for(;h;){var d;let e=h.nextSibling;null===(d=h.parentNode)||void 0===d||d.removeChild(h),h=e}a?(r.style.width=l+"px",r.style.minWidth=""):(r.style.width="",r.style.minWidth=l+"px")}}let et=new l.H$("tableColumnResizing");var en=class e{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(n){let r=n.getMeta(et);if(r&&null!=r.setHandle)return new e(r.setHandle,!1);if(r&&void 0!==r.setDragging)return new e(this.activeHandle,r.setDragging);if(this.activeHandle>-1&&n.docChanged){let r=n.mapping.map(this.activeHandle,-1);return w(n.doc.resolve(r))||(r=-1),new e(r,this.dragging)}return this}};function er(e,n,r,i){let o=e.posAtCoords({left:n.clientX+("right"==r?-i:i),top:n.
4clientY});if(!o)return -1;let{pos:s}=o,l=m(e.state.doc.resolve(s));if(!l)return -1;if("right"==r)return l.pos;let a=u.get(l.node(-1)),h=l.start(-1),c=a.map.indexOf(l.pos-h);return c%a.width==0?-1:h+a.map[c-1]}function ei(e,n,r){let i=n.clientX-e.startX;return Math.max(r,e.startWidth+i)}function eo(e,n){e.dispatch(e.state.tr.setMeta(et,{setHandle:n}))}function es(e,n,r,i){let o=e.state.doc.resolve(n),s=o.node(-1),l=o.start(-1),a=u.get(s).colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,h=e.domAtPos(o.start(-1)).node;for(;h&&"TABLE"!=h.nodeName;)h=h.parentNode;h&&ee(s,h.firstChild,h,i,a,r)}var el=s.NB.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{var n,r;let i=e.getAttribute("colwidth"),o=i?i.split(",").map(e=>parseInt(e,10)):null;if(!o){let i=null==(n=e.closest("table"))?void 0:n.querySelectorAll("colgroup > col"),o=Array.from((null==(r=e.parentElement)?void 0:r.children)||[]).indexOf(e);if(o&&o>-1&&i&&i[o]){let e=i[o].getAttribute("width");return e?[parseInt(e,10)]:null}}return o}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:e}){return["td",(0,s.P1)(this.options.HTMLAttributes,e),0]}}),ea=s.NB.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let n=e.getAttribute("colwidth");return n?n.split(",").map(e=>parseInt(e,10)):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:e}){return["th",(0,s.P1)(this.options.HTMLAttributes,e),0]}}),eh=s.NB.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:e}){return["tr",(0,s.P1)(this.options.HTMLAttributes,e),0]}});function ec(e,n){return n?["width",`${Math.max(n,e)}px`]:["min-width",`${e}px`]}function ed(e,n,r,i,o,s){var l;let a=0,h=!0,c=n.firstChild,d=e.firstChild;if(null!==d)for(let e=0,r=0;e<d.childCount;e+=1){let{colspan:l,colwidth:u}=d.child(e).attrs;for(let e=0;e<l;e+=1,r+=1){let l=o===r?s:u&&u[e],d=l?`${l}px`:"";if(a+=l||i,l||(h=!1),c){if(c.style.width!==d){let[e,n]=ec(i,l);c.style.setProperty(e,n)}c=c.nextSibling}else{let e=document.createElement("col"),[r,o]=ec(i,l);e.style.setProperty(r,o),n.appendChild(e)}}}for(;c;){let e=c.nextSibling;null==(l=c.parentNode)||l.removeChild(c),c=e}let u=e.attrs.style&&"string"==typeof e.attrs.style&&/\bwidth\s*:/i.test(e.attrs.style);h&&!u?(r.style.width=`${a}px`,r.style.minWidth=""):(r.style.width="",r.style.minWidth=`${a}px`)}var eu=class{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ed(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type===this.node.type&&(this.node=e,ed(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){let n=e.target,r=this.dom.contains(n),i=this.contentDOM.contains(n);return!!r&&!i&&("attributes"===e.type||"childList"===e.type||"characterData"===e.type)}};function ep(e,n){return n?e.createChecked(null,n):e.createAndFill()}var ef=({editor:e})=>{let{selection:n}=e.state;if(!(n instanceof x))return!1;let r=0,i=(0,s.qv)(n.ranges[0].$from,e=>"table"===e.type.name);return null==i||i.node.descendants(e=>{if("table"===e.type.name)return!1;["tableCell","tableHeader"].includes(e.type.name)&&(r+=1)}),r===n.ranges.length&&(e.commands.deleteTable(),!0)},em=function(e,n,r={}){var i;let o=null!=(i=r.cellLineSeparator)?i:"\x1f";if(!e||!e.content||0===e.content.length)return"";let s=[];e.content.forEach(e=>{let r=[];e.content&&e.content.forEach(e=>{let i=((e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>n.renderChildren(e)).join(o):e.content?n.renderChildren(e.content):"")||"").replace(/\s+/g," ").trim(),s="tableHeader"===e.type;r.push({text:i,isHeader:s})}),s.push(r)});let l=s.reduce((e,n)=>Math.max(e,n.length),0);if(0===l)return"";let a=Array(l).fill(0);
4s.forEach(e=>{var n;for(let r=0;r<l;r+=1){let i=((null==(n=e[r])?void 0:n.text)||"").length;i>a[r]&&(a[r]=i),a[r]<3&&(a[r]=3)}});let h=(e,n)=>e+" ".repeat(Math.max(0,n-e.length)),c=s[0],d=c.some(e=>e.isHeader),u="\n",p=Array(l).fill(0).map((e,n)=>d&&c[n]&&c[n].text||"");return u+=`| ${p.map((e,n)=>h(e,a[n])).join(" | ")} |
5| ${a.map(e=>"-".repeat(Math.max(3,e))).join(" | ")} |
6`,(d?s.slice(1):s).forEach(e=>{u+=`| ${Array(l).fill(0).map((n,r)=>h(e[r]&&e[r].text||"",a[r])).join(" | ")} |
7`}),u},eg=s.NB.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:eu,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({node:e,HTMLAttributes:n}){let{colgroup:r,tableWidth:i,tableMinWidth:o}=function(e,n,r,i){let o=0,s=!0,l=[],a=e.firstChild;if(!a)return{};for(let e=0,r=0;e<a.childCount;e+=1){let{colspan:i,colwidth:h}=a.child(e).attrs;for(let e=0;e<i;e+=1,r+=1){let i=void 0===r?void 0:h&&h[e];o+=i||n,i||(s=!1);let[a,c]=ec(n,i);l.push(["col",{style:`${a}: ${c}`}])}}return{colgroup:["colgroup",{},...l],tableWidth:s?`${o}px`:"",tableMinWidth:s?"":`${o}px`}}(e,this.options.cellMinWidth),l=n.style,a=["table",(0,s.P1)(this.options.HTMLAttributes,n,{style:l||(i?`width: ${i}`:`min-width: ${o}`)}),r,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},parseMarkdown:(e,n)=>{let r=[];if(e.header){let i=[];e.header.forEach(e=>{i.push(n.createNode("tableHeader",{},[{type:"paragraph",content:n.parseInline(e.tokens)}]))}),r.push(n.createNode("tableRow",{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach(e=>{i.push(n.createNode("tableCell",{},[{type:"paragraph",content:n.parseInline(e.tokens)}]))}),r.push(n.createNode("tableRow",{},i))}),n.createNode("table",void 0,r)},renderMarkdown:(e,n)=>em(e,n),addCommands:()=>({insertTable:({rows:e=3,cols:n=3,withHeaderRow:r=!0}={})=>({tr:i,dispatch:o,editor:s})=>{let a=function(e,n,r,i,o){let s=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let n={};return Object.keys(e.nodes).forEach(r=>{let i=e.nodes[r];i.spec.tableRole&&(n[i.spec.tableRole]=i)}),e.cached.tableNodeTypes=n,n}(e),l=[],a=[];for(let e=0;e<r;e+=1){let e=ep(s.cell,void 0);if(e&&a.push(e),i){let e=ep(s.header_cell,void 0);e&&l.push(e)}}let h=[];for(let e=0;e<n;e+=1)h.push(s.row.createChecked(null,i&&0===e?l:a));return s.table.createChecked(null,h)}
7(s.schema,e,n,r);if(o){let e=i.selection.from+1;i.replaceSelectionWith(a).scrollIntoView().setSelection(l.Bs.near(i.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:n})=>(function(e,n){if(!g(e))return!1;if(n){let r=T(e);n(R(e.tr,r,r.left))}return!0})(e,n),addColumnAfter:()=>({state:e,dispatch:n})=>(function(e,n){if(!g(e))return!1;if(n){let r=T(e);n(R(e.tr,r,r.right))}return!0})(e,n),deleteColumn:()=>({state:e,dispatch:n})=>(function(e,n){if(!g(e))return!1;if(n){let r=T(e),i=e.tr;if(0==r.left&&r.right==r.map.width)return!1;for(let e=r.right-1;!function(e,{map:n,table:r,tableStart:i},o){let s=e.mapping.maps.length;for(let l=0;l<n.height;){let a=l*n.width+o,h=n.map[a],c=r.nodeAt(h),d=c.attrs;if(o>0&&n.map[a-1]==h||o<n.width-1&&n.map[a+1]==h)e.setNodeMarkup(e.mapping.slice(s).map(i+h),null,k(d,o-n.colCount(h)));else{let n=e.mapping.slice(s).map(i+h);e.delete(n,n+c.nodeSize)}l+=d.rowspan}}(i,r,e),e!=r.left;e--){let e=r.tableStart?i.doc.nodeAt(r.tableStart-1):i.doc;if(!e)throw RangeError("No table found");r.table=e,r.map=u.get(e)}n(i)}return!0})(e,n),addRowBefore:()=>({state:e,dispatch:n})=>(function(e,n){if(!g(e))return!1;if(n){let r=T(e);n(I(e.tr,r,r.top))}return!0})(e,n),addRowAfter:()=>({state:e,dispatch:n})=>(function(e,n){if(!g(e))return!1;if(n){let r=T(e);n(I(e.tr,r,r.bottom))}return!0})(e,n),deleteRow:()=>({state:e,dispatch:n})=>(function(e,n){if(!g(e))return!1;if(n){let r=T(e),i=e.tr;if(0==r.top&&r.bottom==r.map.height)return!1;for(let e=r.bottom-1;!function(e,{map:n,table:r,tableStart:i},o){let s=0;for(let e=0;e<o;e++)s+=r.child(e).nodeSize;let l=s+r.child(o).nodeSize,a=e.mapping.maps.length;e.delete(s+i,l+i);let h=new Set;for(let s=0,l=o*n.width;s<n.width;s++,l++){let c=n.map[l];if(!h.has(c)){if(h.add(c),o>0&&c==n.map[l-n.width]){let n=r.nodeAt(c).attrs;e.setNodeMarkup(e.mapping.slice(a).map(c+i),null,{...n,rowspan:n.rowspan-1}),s+=n.colspan-1}else if(o<n.height&&c==n.map[l+n.width]){let l=r.nodeAt(c),h=l.attrs,d=l.type.create({...h,rowspan:l.attrs.rowspan-1},l.content),u=n.positionAt(o+1,s,r);e.insert(e.mapping.slice(a).map(i+u),d),s+=h.colspan-1}}}}(i,r,e),e!=r.top;e--){let e=r.tableStart?i.doc.nodeAt(r.tableStart-1):i.doc;if(!e)throw RangeError("No table found");r.table=e,r.map=u.get(r.table)}n(i)}return!0})(e,n),deleteTable:()=>({state:e,dispatch:n})=>(function(e,n){let r=e.selection.$anchor;for(let i=r.depth;i>0;i--)if("table"==r.node(i).type.spec.tableRole)return n&&n(e.tr.delete(r.before(i),r.after(i)).scrollIntoView()),!0;return!1})(e,n),mergeCells:()=>({state:e,dispatch:n})=>N(e,n),splitCell:()=>({state:e,dispatch:n})=>L(e,n),toggleHeaderColumn:()=>({state:e,dispatch:n})=>z("column")(e,n),toggleHeaderRow:()=>({state:e,dispatch:n})=>z("row")(e,n),toggleHeaderCell:()=>({state:e,dispatch:n})=>B(e,n),mergeOrSplit:()=>({state:e,dispatch:n})=>!!N(e,n)||L(e,n),setCellAttribute:(e,n)=>({state:r,dispatch:i})=>(function(r,i){if(!g(r))return!1;let o=y(r);if(o.nodeAfter.attrs[e]===n)return!1;if(i){let s=r.tr;r.selection instanceof x?r.selection.forEachCell((r,i)=>{r.attrs[e]!==n&&s.setNodeMarkup(i,null,{...r.attrs,[e]:n})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[e]:n}),i(s)}return!0})(r,i),goToNextCell:()=>({state:e,dispatch:n})=>F(1)(e,n),goToPreviousCell:()=>({state:e,dispatch:n})=>F(-1)(e,n),fixTables:()=>({state:e,dispatch:n})=>(n&&E(e),!0),setCellSelection:e=>({tr:n,dispatch:r})=>{if(r){let r=x.create(n.doc,e.anchorCell,e.headCell);n.setSelection(r)}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:ef,"Mod-Backspace":ef,Delete:ef,"Mod-Delete":ef}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[function({handleWidth:e=5,cellMinWidth:n=25,defaultCellMinWidth:r=100,View:i=X,lastColumnResizable:o=!0}={}){let s=new l.Sy({key:et,state:{init(e,n){var o;let l=null===(o=s.spec)||void 0===o||null===(o=o.props)||void 0===o?void 0:o.nodeViews,a=p(n.schema).table.name;return i&&l&&(l[a]=(e,n)=>new i(e,r,n)),new en(-1,!1)},apply:(e,n)=>n.apply(e)},props:{attributes:e=>{let n=et.getState(e);return n&&n.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(n,r)=>{!function(e,n,r,i){if(!e.editable)return;let o=et.getState(e.state);if(o&&!o.dragging){let s=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(n.target),l=-1;if(s){let{left:i,right:o}=s.getBoundingClientRect();n.clientX-i<=r?l=er(e,n,"left",r):o-n.clientX<=r&&(l=er(e,n,"right",r))}if(l!=o.activeHandle){if(!i&&-1!==l){let n=e.state.doc.resolve(l),r=n.node(-1),i=u.get(r),o=n.start(-1);if(i.colCount(n.pos-o)+n.nodeAfter.attrs.colspan-1==i.width-1)return}eo(e,l)}}}(n,r,e,o)},mouseleave:e=>{!function(e){if(!e.editable)return;let n=et.getState(e.state);n&&n.activeHandle>-1&&!n.dragging&&eo(e,-1)}(e)},mousedown:(e,i)=>{!function(e,n,r,i){var o;if(!e.editable)return;let s=null!==(o=e.dom.ownerDocument.defaultView)&&void 0!==o?o:window,l=et.getState(e.state);if(!l||-1==l.activeHandle||l.dragging)return;let a=e.state.doc.nodeAt(l.activeHandle),h=function(e,n,{colspan:r,colwidth:i}){let o=i&&i[i.length-1];if(o)return o;let s=e.domAtPos(n),l=s.node.childNodes[s.offset].offsetWidth,a=r;if(i)for(let e=0;e<r;e++)i[e]&&(l-=i[e],a--);return l/a}(e,l.activeHandle,a.attrs);function c(n){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",d);let i=et.getState(e.state);(null==i?void 0:i.dragging)&&(function(e,n,r){let i=e.state.doc.resolve(n),o=i.node(-1),s=u.get(o),l=i.start(-1),a=s.colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1,h=e.state.tr;for(let e=0;e<s.height;e++){let n=e*s.width+a;if(e&&s.map[n]==s.map[n-s.width])continue;let i=s.map[n],c=o.nodeAt(i).attrs,d=1==c.colspan?0:a-s.colCount(i);if(c.colwidth&&c.colwidth[d]==r)continue;let u=c.colwidth?c.colwidth.slice():Array(c.colspan).fill(0);u[d]=r,h.setNodeMarkup(l+i,null,{...c,colwidth:u})}h.docChanged&&e.dispatch(h)}(e,i.activeHandle,ei(i.dragging,n,r)),e.dispatch(e.state.tr.setMeta(et,{setDragging:null})))}function d(n){if(!n.which)return c(n);let o=et.getState(e.state);if(o&&o.dragging){let s=ei(o.dragging,n,r);es(e,o.activeHandle,s,i)}}e.dispatch(e.state.tr.setMeta(et,{setDragging:{startX:n.clientX,startWidth:h}})),es(e,l.activeHandle,h,i),s.addEventListener("mouseup",c),s.addEventListener("mousemove",d),n.preventDefault()}(e,i,n,r)}},decorations:e=>{let n=et.getState(e);if(n&&n.activeHandle>-1)return function(e,n){let r=[],i=e.doc.resolve(n),o=i.node(-1);if(!o)return h.EH.empty;let s=u.get(o),l=i.start(-1),a=s.colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;for(let n=0;n<s.height;n++){let i=a+n*s.width;if((a==s.width-1||s.map[i]!=s.map[i+1])&&(0==n||s.map[i]!=s.map[i-s.width])){var c;let n=s.map[i],a=l+n+o.nodeAt(n).nodeSize-1,d=document.createElement("div");
7d.className="column-resize-handle",(null===(c=et.getState(e))||void 0===c?void 0:c.dragging)&&r.push(h.p.node(l+n,l+n+o.nodeAt(n).nodeSize,{class:"column-resize-dragging"})),r.push(h.p.widget(a,d))}}return h.EH.create(e.doc,r)}(e,n.activeHandle)},nodeViews:{}}});return s}({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],function({allowTableNodeSelection:e=!1}={}){return new l.Sy({key:f,state:{init:()=>null,apply(e,n){let r=e.getMeta(f);if(null!=r)return -1==r?null:r;if(null==n||!e.docChanged)return n;let{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:S,handleDOMEvents:{mousedown:K},createSelectionBetween:e=>null!=f.getState(e.state)?e.state.selection:null,handleTripleClick:J,handleKeyDown:_,handlePaste:Y},appendTransaction:(n,r,i)=>(function(e,n,r){let i,o;let s=(n||e).selection,a=(n||e).doc;if(s instanceof l.qv&&(o=s.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)i=x.create(a,s.from);else if("row"==o){let e=a.resolve(s.from+1);i=x.rowSelection(e,e)}else if(!r){let e=u.get(s.node),n=s.from+1,r=n+e.map[e.width*e.height-1];i=x.create(a,n+1,r)}}else s instanceof l.Bs&&function({$from:e,$to:n}){if(e.pos==n.pos||e.pos<n.pos-6)return!1;let r=e.pos,i=n.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,r++);for(let e=n.depth;e>=0&&!(n.before(e+1)>n.start(e));e--,i--);return r==i&&/row|table/.test(e.node(o).type.spec.tableRole)}(s)?i=l.Bs.create(a,s.from):s instanceof l.Bs&&function({$from:e,$to:n}){let r,i;for(let n=e.depth;n>0;n--){let i=e.node(n);if("cell"===i.type.spec.tableRole||"header_cell"===i.type.spec.tableRole){r=i;break}}for(let e=n.depth;e>0;e--){let r=n.node(e);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){i=r;break}}return r!==i&&0===n.parentOffset}(s)&&(i=l.Bs.create(a,s.$from.start(),s.$from.end()));return i&&(n||(n=e.tr)).setSelection(i),n})(i,E(i,r),e)})}({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){let n={name:e.name,options:e.options,storage:e.storage};return{tableRole:(0,s.nU)((0,s.Nl)(e,"tableRole",n))}}});s.hj.create({name:"tableKit",addExtensions(){let e=[];return!1!==this.options.table&&e.push(eg.configure(this.options.table)),!1!==this.options.tableCell&&e.push(el.configure(this.options.tableCell)),!1!==this.options.tableHeader&&e.push(ea.configure(this.options.tableHeader)),!1!==this.options.tableRow&&e.push(eh.configure(this.options.tableRow)),e}})},64313:function(e,n,r){r.d(n,{U:function(){return i.Uf}});var i=r(27123)},48904:function(e,n,r){r.d(n,{a:function(){return i.ax}});var i=r(27123)},65318:function(e,n,r){r.d(n,{Z:function(){return i}});var i=r(94725).hj.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let n=e.style.textAlign;return this.options.alignments.includes(n)?n:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:n})=>!!this.options.alignments.includes(e)&&this.options.types.map(r=>n.updateAttributes(r,{textAlign:e})).some(e=>e),unsetTextAlign:()=>({commands:e})=>this.options.types.map(n=>e.resetAttributes(n,"textAlign")).some(e=>e),toggleTextAlign:e=>({editor:n,commands:r})=>!!this.options.alignments.includes(e)&&(n.isActive({textAlign:e})?r.unsetTextAlign():r.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}})},74922:function(e,n,r){r.d(n,{m$:function(){return B},fj:function(){return F},Vm:function(){return D},eh:function(){return j},QA:function(){return U}});var i=r(94725),o=r(17213),s=r(94536);class l{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(r=n.width)&&void 0!==r?r:1,this.color=!1===n.color?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(n=>{let r=e=>{this[n](e)};return e.dom.addEventListener(n,r),{name:n,handler:r}})}
7destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){null!=this.cursorPos&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,n,r=this.editorView.state.doc.resolve(this.cursorPos),i=!r.parent.inlineContent,o,s=this.editorView.dom,l=s.getBoundingClientRect(),a=l.width/s.offsetWidth,h=l.height/s.offsetHeight;if(i){let e=r.nodeBefore,n=r.nodeAfter;if(e||n){let r=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(r){let i=r.getBoundingClientRect(),s=e?i.bottom:i.top;e&&n&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let l=this.width/2*h;o={left:i.left,right:i.right,top:s-l,bottom:s+l}}}}if(!o){let e=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*a;o={left:e.left-n,right:e.left+n,top:e.top,bottom:e.bottom}}let c=this.editorView.dom.offsetParent;if(!this.element&&(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",i),this.element.classList.toggle("prosemirror-dropcursor-inline",!i),c&&(c!=document.body||"static"!=getComputedStyle(c).position)){let r=c.getBoundingClientRect(),i=r.width/c.offsetWidth,o=r.height/c.offsetHeight;e=r.left-c.scrollLeft*i,n=r.top-c.scrollTop*o}else e=-pageXOffset,n=-pageYOffset;this.element.style.left=(o.left-e)/a+"px",this.element.style.top=(o.top-n)/h+"px",this.element.style.width=(o.right-o.left)/a+"px",this.element.style.height=(o.bottom-o.top)/h+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o="function"==typeof i?i(this.editorView,n,e):i;if(n&&!o){let e=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let n=(0,s.nj)(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=n&&(e=n)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}var a=r(79006),h=r(10258),c=r(10121);class d extends o.Y1{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return d.valid(r)?new d(r):o.Y1.near(r)}content(){return c.p2.empty}eq(e){return e instanceof d&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new d(e.resolve(n.pos))}getBookmark(){return new u(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!function(e){for(let n=e.depth;n>=0;n--){let r=e.index(n),i=e.node(n);if(0==r){if(i.type.spec.isolating)return!0;continue}for(let e=i.child(r-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||p(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let n=e.depth;n>=0;n--){let r=e.indexAfter(n),i=e.node(n);if(r==i.childCount){if(i.type.spec.isolating)return!0;continue}for(let e=i.child(r);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||p(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let r=n.type.spec.allowGapCursor;if(null!=r)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){t:for(;;){if(!r&&d.valid(e))return e;let i=e.pos,s=null;for(let r=e.depth;;r--){let o=e.node(r);if(n>0?e.indexAfter(r)<o.childCount:e.index(r)>0){s=o.child(n>0?e.indexAfter(r):e.index(r)-1);break}if(0==r)return null;i+=n;let l=e.doc.resolve(i);if(d.valid(l))return l}for(;;){let l=n>0?s.firstChild:s.lastChild;if(!l){if(s.isAtom&&!s.isText&&!o.qv.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue t}break}s=l,i+=n;let a=e.doc.resolve(i);if(d.valid(a))return a}return null}}}d.prototype.visible=!1,d.findFrom=d.findGapCursorFrom,o.Y1.jsonID("gapcursor",d);class u{constructor(e){this.pos=e}map(e){return new u(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return d.valid(n)?new d(n):o.Y1.near(n)}}function p(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let f=(0,h.$)({ArrowLeft:m("horiz",-1),ArrowRight:m("horiz",1),ArrowUp:m("vert",
7-1),ArrowDown:m("vert",1)});function m(e,n){let r="vert"==e?n>0?"down":"up":n>0?"right":"left";return function(e,i,s){let l=e.selection,a=n>0?l.$to:l.$from,h=l.empty;if(l instanceof o.Bs){if(!s.endOfTextblock(r)||0==a.depth)return!1;h=!1,a=e.doc.resolve(n>0?a.after():a.before())}let c=d.findGapCursorFrom(a,n,h);return!!c&&(i&&i(e.tr.setSelection(new d(c))),!0)}}function g(e,n,r){if(!e||!e.editable)return!1;let i=e.state.doc.resolve(n);if(!d.valid(i))return!1;let s=e.posAtCoords({left:r.clientX,top:r.clientY});return!(s&&s.inside>-1&&o.qv.isSelectable(e.state.doc.nodeAt(s.inside)))&&(e.dispatch(e.state.tr.setSelection(new d(i))),!0)}function y(e,n){if("insertCompositionText"!=n.inputType||!(e.state.selection instanceof d))return!1;let{$from:r}=e.state.selection,i=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!i)return!1;let s=c.HY.empty;for(let e=i.length-1;e>=0;e--)s=c.HY.from(i[e].createAndFill(null,s));let l=e.state.tr.replace(r.pos,r.pos,new c.p2(s,0,0));return l.setSelection(o.Bs.near(l.doc.resolve(r.pos+1))),e.dispatch(l),!1}function w(e){if(!(e.selection instanceof d))return null;let n=document.createElement("div");return n.className="ProseMirror-gapcursor",a.EH.create(e.doc,[a.p.widget(e.selection.head,n,{key:"gapcursor"})])}var v=function(){};v.prototype.append=function(e){return e.length?(e=v.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},v.prototype.prepend=function(e){return e.length?v.from(e).append(this):this},v.prototype.appendInner=function(e){return new k(this,e)},v.prototype.slice=function(e,n){return(void 0===e&&(e=0),void 0===n&&(n=this.length),e>=n)?v.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},v.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},v.prototype.forEach=function(e,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},v.prototype.map=function(e,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length);var i=[];return this.forEach(function(n,r){return i.push(e(n,r))},n,r),i},v.from=function(e){return e instanceof v?e:e&&e.length?new b(e):v.empty};var b=function(e){function n(n){e.call(this),this.values=n}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var r={length:{configurable:!0},depth:{configurable:!0}};return n.prototype.flatten=function(){return this.values},n.prototype.sliceInner=function(e,r){return 0==e&&r==this.length?this:new n(this.values.slice(e,r))},n.prototype.getInner=function(e){return this.values[e]},n.prototype.forEachInner=function(e,n,r,i){for(var o=n;o<r;o++)if(!1===e(this.values[o],i+o))return!1},n.prototype.forEachInvertedInner=function(e,n,r,i){for(var o=n-1;o>=r;o--)if(!1===e(this.values[o],i+o))return!1},n.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new n(this.values.concat(e.flatten()))},n.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new n(e.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(n.prototype,r),n}(v);v.empty=new b([]);var k=function(e){function n(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},n.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},n.prototype.forEachInner=function(e,n,r,i){var o=this.left.length;if(n<o&&!1===this.left.forEachInner(e,n,Math.min(r,o),i)||r>o&&!1===this.right.forEachInner(e,Math.max(n-o,0),Math.min(this.length,r)-o,i+o))return!1},n.prototype.forEachInvertedInner=function(e,n,r,i){var o=this.left.length;if(n>o&&!1===this.right.forEachInvertedInner(e,n-o,Math.max(r,o)-o,i+o)||r<o&&!1===this.left.forEachInvertedInner(e,Math.min(n,o),r,i))return!1},n.prototype.sliceInner=function(e,n){if(0==e&&n==this.length)return this;var r=this.left.length;return n<=r?this.left.slice(e,n):e>=r?this.right.slice(e-r,n-r):this.left.slice(e,r).append(this.right.slice(0,n-r))},n.prototype.leafAppend=function(e){var r=this.right.leafAppend(e);if(r)return new n(this.left,r)},n.prototype.leafPrepend=function(e){var r=this.left.leafPrepend(e);if(r)return new n(r,this.right)},n.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new n(this.left,new n(this.right,e)):new n(this,e)},n}(v);class A{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){let r,i,o,s;if(0==this.eventCount)return null;let l=this.items.length;for(;;l--)if(this.items.get(l-1).selection){--l;break}n&&(i=(r=this.remapping(l,this.items.length)).maps.length);let a=e.tr,h=[],c=[];
7return this.items.forEach((e,n)=>{if(!e.step){r||(i=(r=this.remapping(l,n+1)).maps.length),i--,c.push(e);return}if(r){c.push(new x(e.map));let n=e.step.map(r.slice(i)),o;n&&a.maybeStep(n).doc&&(o=a.mapping.maps[a.mapping.maps.length-1],h.push(new x(o,void 0,void 0,h.length+c.length))),i--,o&&r.appendMap(o,i)}else a.maybeStep(e.step);if(e.selection)return o=r?e.selection.map(r.slice(i)):e.selection,s=new A(this.items.slice(0,l).append(c.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,n,r,i){var o,s;let l,a=[],h=this.eventCount,c=this.items,d=!i&&c.length?c.get(c.length-1):null;for(let r=0;r<e.steps.length;r++){let o=e.steps[r].invert(e.docs[r]),s=new x(e.mapping.maps[r],o,n),l;(l=d&&d.merge(s))&&(s=l,r?a.pop():c=c.slice(0,c.length-1)),a.push(s),n&&(h++,n=void 0),i||(d=s)}let u=h-r.depth;return u>S&&(o=c,s=u,o.forEach((e,n)=>{if(e.selection&&0==s--)return l=n,!1}),c=o.slice(l),h-=u),new A(c.append(a),h)}remapping(e,n){let r=new s.vs;return this.items.forEach((n,i)=>{let o=null!=n.mirrorOffset&&i-n.mirrorOffset>=e?r.maps.length-n.mirrorOffset:void 0;r.appendMap(n.map,o)},e,n),r}addMaps(e){return 0==this.eventCount?this:new A(this.items.append(e.map(e=>new x(e))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(e=>{e.selection&&l--},i);let a=n;this.items.forEach(n=>{let i=o.getMirror(--a);if(null==i)return;s=Math.min(s,i);let h=o.maps[i];if(n.step){let s=e.steps[i].invert(e.docs[i]),c=n.selection&&n.selection.map(o.slice(a+1,i));c&&l++,r.push(new x(h,s,c))}else r.push(new x(h))},i);let h=[];for(let e=n;e<s;e++)h.push(new x(o.maps[e]));let c=new A(this.items.slice(0,i).append(h).append(r),l);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-r.length)),c}emptyItemCount(){let e=0;return this.items.forEach(n=>{!n.step&&e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let e=s.step.map(n.slice(r)),l=e&&e.getMap();if(r--,l&&n.appendMap(l,r),e){let a=s.selection&&s.selection.map(n.slice(r));a&&o++;let h=new x(l.invert(),e,a),c,d=i.length-1;(c=i.length&&i[d].merge(h))?i[d]=c:i.push(h)}}else s.map&&r--},this.items.length,0),new A(v.from(i.reverse()),o)}}A.empty=new A(v.empty,0);class x{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new x(n.getMap().invert(),n,this.selection)}}}class C{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}let S=20;function M(e){let n=[];for(let r=e.length-1;r>=0&&0==n.length;r--)e[r].forEach((e,r,i,o)=>n.push(i,o));return n}function E(e,n){if(!e)return null;let r=[];for(let i=0;i<e.length;i+=2){let o=n.map(e[i],1),s=n.map(e[i+1],-1);o<=s&&r.push(o,s)}return r}let T=!1,R=null;function I(e){let n=e.plugins;if(R!=n){T=!1,R=n;for(let e=0;e<n.length;e++)if(n[e].spec.historyPreserveItems){T=!0;break}}return T}let O=new o.H$("history"),N=new o.H$("closeHistory");function L(e,n){return(r,i)=>{let o=O.getState(r);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(i){let s=function(e,n,r){let i=I(n),o=O.get(n).spec.config,s=(r?e.undone:e.done).popEvent(n,i);if(!s)return null;let l=s.selection.resolve(s.transform.doc),a=(r?e.done:e.undone).addTransform(s.transform,n.selection.getBookmark(),o,i),h=new C(r?a:s.remaining,r?s.remaining:a,null,0,-1);return s.transform.setSelection(l).setMeta(O,{redo:r,historyState:h})}(o,r,e);s&&i(n?s.scrollIntoView():s)}return!0}}let H=L(!1,!0),z=L(!0,!0);L(!1,!1),L(!0,!1),i.hj.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let n=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=n.textBetween(0,n.content.size,void 0," ");return this.options.textCounter(e)}return n.nodeSize},this.storage.words=e=>{let n=(null==e?void 0:e.node)||this.editor.state.doc,r=n.textBetween(0,n.content.size," "," ");return this.options.wordCounter(r)}},addProseMirrorPlugins(){let e=!1;return[new o.Sy({key:new o.H$("characterCount"),appendTransaction:(n,r,i)=>{if(e)return;let o=this.options.limit;if(null==o||0===o){e=!0;return}let s=this.storage.characters({node:i.doc});if(s>o){console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);let n=i.tr.deleteRange(0,s-o);return e=!0,n}e=!0},filterTransaction:(e,n)=>{let r=this.options.limit;if(!e.docChanged||0===r||null==r)return!0;let i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;
7if(i>r&&o>r&&o>i||!e.getMeta("paste"))return!1;let s=e.selection.$head.pos;return e.deleteRange(s-(o-r),s),!(this.storage.characters({node:e.doc})>r)}})]}});var B=i.hj.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new o.Sy({view:n=>new l(n,e)})}(this.options)]}});i.hj.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("focus"),props:{decorations:({doc:e,selection:n})=>{let{isEditable:r,isFocused:i}=this.editor,{anchor:o}=n,s=[];if(!r||!i)return a.EH.create(e,[]);let l=0;"deepest"===this.options.mode&&e.descendants((e,n)=>{if(!e.isText){if(!(o>=n&&o<=n+e.nodeSize-1))return!1;l+=1}});let h=0;return e.descendants((e,n)=>!e.isText&&!!(o>=n&&o<=n+e.nodeSize-1)&&((h+=1,"deepest"===this.options.mode&&l-h>0||"shallowest"===this.options.mode&&h>1)?"deepest"===this.options.mode:void s.push(a.p.node(n,n+e.nodeSize,{class:this.options.className})))),a.EH.create(e,s)}}})]}});var F=i.hj.create({name:"gapCursor",addProseMirrorPlugins:()=>[new o.Sy({props:{decorations:w,createSelectionBetween:(e,n,r)=>n.pos==r.pos&&d.valid(r)?new d(r):null,handleClick:g,handleKeyDown:f,handleDOMEvents:{beforeinput
7:y}}})],extendNodeSchema(e){var n;let r={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(n=(0,i.nU)((0,i.Nl)(e,"allowGapCursor",r)))?n:null}}}),$="placeholder",D=i.hj.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:$,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${this.options.dataAttribute.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${$}`;return[new o.Sy({key:new o.H$("placeholder"),props:{decorations:({doc:n,selection:r})=>{let o=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:s}=r,l=[];if(!o)return null;let h=this.editor.isEmpty;return n.descendants((n,r)=>{let o=s>=r&&s<=r+n.nodeSize,c=!n.isLeaf&&(0,i.bR)(n);if((o||!this.options.showOnlyCurrent)&&c){let i=[this.options.emptyNodeClass];h&&i.push(this.options.emptyEditorClass);let s=a.p.node(r,r+n.nodeSize,{class:i.join(" "),[e]:"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:n,pos:r,hasAnchor:o}):this.options.placeholder});l.push(s)}return this.options.includeChildren}),a.EH.create(n,l)}}})]}});function P({types:e,node:n}){return n&&Array.isArray(e)&&e.includes(n.type)||(null==n?void 0:n.type)===e}i.hj.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:n}=this;return[new o.Sy({key:new o.H$("selection"),props:{decorations:r=>r.selection.empty||e.isFocused||!e.isEditable||(0,i.EG)(r.selection)||e.view.dragging?null:a.EH.create(r.doc,[a.p.inline(r.selection.from,r.selection.to,{class:n.className})])}})]}});var j=i.hj.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;let n=new o.H$(this.name),r=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",i=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(r).includes(e.name));return[new o.Sy({key:n,appendTransaction:(e,i,o)=>{let{doc:s,tr:l,schema:a}=o,h=n.getState(o),c=s.content.size,d=a.nodes[r];if(h)return l.insert(c,d.create())},state:{init:(e,n)=>!P({node:n.tr.doc.lastChild,types:i}),apply:(e,n)=>!e.docChanged||e.getMeta("__uniqueIDTransaction")?n:!P({node:e.doc.lastChild,types:i})}})]}}),U=i.hj.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:n})=>H(e,n),redo:()=>({state:e,dispatch:n})=>z(e,n)}),addProseMirrorPlugins(){return[function(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new o.Sy({key:O,state:{init:()=>new C(A.empty,A.empty,null,0,-1),apply:(n,r,i)=>(function(e,n,r,i){let o=r.getMeta(O),s;if(o)return o.historyState;r.getMeta(N)&&(e=new C(e.done,e.undone,null,0,-1));let l=r.getMeta("appendedTransaction");if(0==r.steps.length)return e;if(l&&l.getMeta(O))return l.getMeta(O).redo?new C(e.done.addTransform(r,void 0,i,I(n)),e.undone,M(r.mapping.maps),e.prevTime,e.prevComposition):new C(e.done,e.undone.addTransform(r,void 0,i,I(n)),null,e.prevTime,e.prevComposition);if(!1===r.getMeta("addToHistory")||l&&!1===l.getMeta("addToHistory"))return(s=r.getMeta("rebased"))?new C(e.done.rebased(r,s),e.undone.rebased(r,s),E(e.prevRanges,r.mapping),e.prevTime,e.prevComposition):new C(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),E(e.prevRanges,r.mapping),e.prevTime,e.prevComposition);{let o=r.getMeta("composition"),s=0==e.prevTime||!l&&e.prevComposition!=o&&(e.prevTime<(r.time||0)-i.newGroupDelay||!function(e,n){if(!n)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((e,i)=>{for(let o=0;o<n.length;o+=2)e<=n[o+1]&&i>=n[o]&&(r=!0)}),r}(r,e.prevRanges)),a=l?E(e.prevRanges,r.mapping):M(r.mapping.maps);return new C(e.done.addTransform(r,s?n.selection.getBookmark():void 0,i,I(n)),A.empty,a,r.time,null==o?e.prevComposition:o)}})(r,i,n,e)},config:e,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i="historyUndo"==r?H:"historyRedo"==r?z:null;return!!i&&!!e.editable&&(n.preventDefault(),i(e.state,e.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}})},46938:function(e,n,r){r.d(n,{kg:function(){return _},T5:function(){return X},fW:function(){return ei},jE:function(){return K}});var i=r(2265),o=r(54887),s=r(82558),l=r(57437),a=r(94725);let{getOwnPropertyNames:h,getOwnPropertySymbols:c}=Object,{hasOwnProperty:d}=Object.prototype;function u(e,n){return function(r,i,o){return e(r,i,o)&&n(r,i,o)}}function p(e){return function(n,r,i){if(!n||!r||"object"!=typeof n||"object"!=typeof r)return e(n,r,i);let{cache:o}=i,s=o.get(n),l=o.get(r);if(s&&l)return s===r&&l===n;o.set(n,r),o.set(r,n);let a=e(n,r,i);return o.delete(n),o.delete(r),a}}function f(e){return h(e).concat(c(e))}let m=Object.hasOwn||((e,n)=>d.call(e,n));function g(e,n){return e===n||!e&&!n&&e!=e&&n!=n}let{getOwnPropertyDescriptor:y,keys:w}=Object;function v(e,n){return e.byteLength===n.byteLength&&O(new Uint8Array(e),new Uint8Array(n))}function b(e,n,r){let i=e.length;if(n.length!==i)return!1;for(;i-- >0;)if(!r.equals(e[i],n[i],i,i,e,n,r))return!1;return!0}function k(e,n){return e.byteLength===n.byteLength&&O(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}function A(e,n){return g(e.getTime(),n.getTime())}function x(e,n){return e.name===n.name&&e.message===n.message&&e.cause===n.cause&&e.stack===n.stack}function C(e,n){return e===n}function S(e,n,r){let i,o;let s=e.size;if(s!==n.size)return!1;if(!s)return!0;let l=Array(s),a=e.entries(),h=0;for(;(i=a.next())&&!i.done;){let s=n.entries(),a=!1,c=0;for(;(o=s.next())&&!o.done;){if(l[c]){c++;continue}let s=i.value,d=o.value;if(r.equals(s[0],d[0],h,c,e,n,r)&&r.equals(s[1],d[1],s[0],d[0],e,n,r)){a=l[c]=!0;break}c++}if(!a)return!1;h++}return!0}function M(e,n,r){let i=w(e),o=i.length;if(w(n).length!==o)return!1;for(;o-- >0;)if(!L(e,n,r,i[o]))return!1;return!0}function E(e,n,r){let i,o,s;let l=f(e),a=l.length;if(f(n).length!==a)return!1;for(;a-- >0;)if(!L(e,n,r,i=l[a])||(o=y(e,i),s=y(n,i),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function T(e,n){return g(e.valueOf(),n.valueOf())}function R(e,n){return e.source===n.source&&e.flags===n.flags}function I(e,n,r){let i,o;let s=e.size;if(s!==n.size)return!1;if(!s)return!0;let l=Array(s),a=e.values();for(;(i=a.next())&&!i.done;){let s=n.values(),a=!1,h=0;for(;(o=s.next())&&!o.done;){if(!l[h]&&r.equals(i.value,o.value,i.value,o.value,e,n,r)){a=l[h]=!0;break}h++}if(!a)return!1}return!0}function O(e,n){let r=e.byteLength;if(n.byteLength!==r||e.byteOffset!==n.byteOffset)return!1;for(;r-- >0;)if(e[r]!==n[r])return!1;return!0}function N(e,n){return e.hostname===n.hostname&&e.pathname===n.pathname&&e.protocol===n.protocol&&e.port===n.port&&e.hash===n.hash&&e.username===n.username&&e.password===n.password}function L(e,n,r,i){return("_owner"===i||"__o"===i||"__v"===i)&&(!!e.$$typeof||!!n.$$typeof)||m(n,i)&&r.equals(e[i],n[i],i,i,e,n,r)}let H={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array
7]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},z=Object.prototype.toString,B=F();function F(e={}){let{circular:n=!1,createInternalComparator:r,createState:i,strict:o=!1}=e,s=function({areArrayBuffersEqual:e,areArraysEqual:n,areDataViewsEqual:r,areDatesEqual:i,areErrorsEqual:o,areFunctionsEqual:s,areMapsEqual:l,areNumbersEqual:a,areObjectsEqual:h,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:p,areUrlsEqual:f,unknownTagComparators:m}){return function(g,y,w){if(g===y)return!0;if(null==g||null==y)return!1;let v=typeof g;if(v!==typeof y)return!1;if("object"!==v)return"number"===v?a(g,y,w):"function"===v&&s(g,y,w);let b=g.constructor;if(b!==y.constructor)return!1;if(b===Object)return h(g,y,w);if(Array.isArray(g))return n(g,y,w);if(b===Date)return i(g,y,w);if(b===RegExp)return d(g,y,w);if(b===Map)return l(g,y,w);if(b===Set)return u(g,y,w);let k=z.call(g);if("[object Date]"===k)return i(g,y,w);if("[object RegExp]"===k)return d(g,y,w);if("[object Map]"===k)return l(g,y,w);if("[object Set]"===k)return u(g,y,w);if("[object Object]"===k)return"function"!=typeof g.then&&"function"!=typeof y.then&&h(g,y,w);if("[object URL]"===k)return f(g,y,w);if("[object Error]"===k)return o(g,y,w);if("[object Arguments]"===k)return h(g,y,w);if(H[k])return p(g,y,w);if("[object ArrayBuffer]"===k)return e(g,y,w);if("[object DataView]"===k)return r(g,y,w);if("[object Boolean]"===k||"[object Number]"===k||"[object String]"===k)return c(g,y,w);if(m){let e=m[k];if(!e){let n=null!=g?g[Symbol.toStringTag]:void 0;n&&(e=m[n])}if(e)return e(g,y,w)}return!1}}(function({circular:e,createCustomConfig:n,strict:r}){let i={areArrayBuffersEqual:v,areArraysEqual:r?E:b,areDataViewsEqual:k,areDatesEqual:A,areErrorsEqual:x,areFunctionsEqual:C,areMapsEqual:r?u(S,E):S,areNumbersEqual:g,areObjectsEqual:r?E:M,arePrimitiveWrappersEqual:T,areRegExpsEqual:R,areSetsEqual:r?u(I,E):I,areTypedArraysEqual:r?u(O,E):O,areUrlsEqual:N,unknownTagComparators:void 0};if(n&&(i=Object.assign({},i,n(i))),e){let e=p(i.areArraysEqual),n=p(i.areMapsEqual),r=p(i.areObjectsEqual),o=p(i.areSetsEqual);i=Object.assign({},i,{areArraysEqual:e,areMapsEqual:n,areObjectsEqual:r,areSetsEqual:o})}return i}(e)),l=r?r(s):function(e,n,r,i,o,l,a){return s(e,n,a)};return function({circular:e,comparator:n,createState:r,equals:i,strict:o}){if(r)return function(s,l){let{cache:a=e?new WeakMap:void 0,meta:h}=r();return n(s,l,{cache:a,equals:i,meta:h,strict:o})};if(e)return function(e,r){return n(e,r,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};let s={cache:void 0,equals:i,meta:void 0,strict:o};return function(e,r){return n(e,r,s)}}({circular:n,comparator:s,createState:i,equals:l,strict:o})}F({strict:!0}),F({circular:!0}),F({circular:!0,strict:!0}),F({createInternalComparator:()=>g}),F({strict:!0,createInternalComparator:()=>g}),F({circular:!0,createInternalComparator:()=>g}),F({circular:!0,createInternalComparator:()=>g,strict:!0});var $=r(35195),D=(...e)=>n=>{e.forEach(e=>{"function"==typeof e?e(n):e&&(e.current=n)})},P=({contentComponent:e})=>{let n=(0,s.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,l.jsx)(l.Fragment,{children:Object.values(n)})},j=class extends i.Component{constructor(e){var n;super(e),this.editorContentRef=i.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null==(n=e.editor)?void 0:n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;let n=this.props.editor;if(n&&!n.isDestroyed&&(null==(e=n.view.dom)?void 0:e.parentNode)){if(n.contentComponent)return;let e=this.editorContentRef.current;e.append(...n.view.dom.parentNode.childNodes),n.setOptions({element:e}),n.contentComponent=function(){let e=new Set,n={};return{subscribe:n=>(e.add(n),()=>{e.delete(n)}),getSnapshot:()=>n,getServerSnapshot:()=>n,setRenderer(r,i){n={...n,[r]:o.createPortal(i.reactElement,i.element,r)},e.forEach(e=>e())},removeRenderer(r){let i={...n};delete i[r],n=i,e.forEach(e=>e())}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=n.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),n.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;let n=this.props.editor;if(n){this.initialized=!1,n.isDestroyed||n.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),n.contentComponent=null;try{if(!(null==(e=n.view.dom)?void 0:e.parentNode))return;let r=document.createElement("div");r.append(...n.view.dom.parentNode.childNodes),n.setOptions({element:r})}catch{}}}render(){let{editor:e,innerRef:n,...r}=this.props;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{ref:D(n,this.editorContentRef),...r}),(null==e?void 0:e.contentComponent)&&(0,l.jsx)(P,{contentComponent:e.contentComponent})]})}},U=(0,i.forwardRef)((e,n)=>{let r=i.useMemo(()=>Math.floor(4294967295*Math.random()).toString(),[e.editor]);return i.createElement(j,{key:r,innerRef:n,...e})}),_=i.memo(U),W="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,q=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0}
7,this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}},V="undefined"==typeof window,J=V||!!("undefined"!=typeof window&&window.next),Y=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?V||J?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){let e={...this.options.current,onBeforeCreate:(...e)=>{var n,r;return null==(r=(n=this.options.current).onBeforeCreate)?void 0:r.call(n,...e)},onBlur:(...e)=>{var n,r;return null==(r=(n=this.options.current).onBlur)?void 0:r.call(n,...e)},onCreate:(...e)=>{var n,r;return null==(r=(n=this.options.current).onCreate)?void 0:r.call(n,...e)},onDestroy:(...e)=>{var n,r;return null==(r=(n=this.options.current).onDestroy)?void 0:r.call(n,...e)},onFocus:(...e)=>{var n,r;return null==(r=(n=this.options.current).onFocus)?void 0:r.call(n,...e)},onSelectionUpdate:(...e)=>{var n,r;return null==(r=(n=this.options.current).onSelectionUpdate)?void 0:r.call(n,...e)},onTransaction:(...e)=>{var n,r;return null==(r=(n=this.options.current).onTransaction)?void 0:r.call(n,...e)},onUpdate:(...e)=>{var n,r;return null==(r=(n=this.options.current).onUpdate)?void 0:r.call(n,...e)},onContentError:(...e)=>{var n,r;return null==(r=(n=this.options.current).onContentError)?void 0:r.call(n,...e)},onDrop:(...e)=>{var n,r;return null==(r=(n=this.options.current).onDrop)?void 0:r.call(n,...e)},onPaste:(...e)=>{var n,r;return null==(r=(n=this.options.current).onPaste)?void 0:r.call(n,...e)},onDelete:(...e)=>{var n,r;return null==(r=(n=this.options.current).onDelete)?void 0:r.call(n,...e)}};return new a.ML(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)||("extensions"===r&&e.extensions&&n.extensions?e.extensions.length===n.extensions.length&&e.extensions.every((e,r)=>{var i;return e===(null==(i=n.extensions)?void 0:i[r])}):e[r]===n[r]))}onRender(n){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===n.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(n),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,r)=>n===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))}
7,1)}};function K(e={},n=[]){let r=(0,i.useRef)(e);r.current=e;let[o]=(0,i.useState)(()=>new Y(r)),l=(0,s.useSyncExternalStore)(o.subscribe,o.getEditor,o.getServerSnapshot);return(0,i.useDebugValue)(l),(0,i.useEffect)(o.onRender(n)),!function(e){var n;let[r]=(0,i.useState)(()=>new q(e.editor)),o=(0,$.useSyncExternalStoreWithSelector)(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,null!=(n=e.equalityFn)?n:B);W(()=>r.watch(e.editor),[e.editor,r]),(0,i.useDebugValue)(o)}({editor:l,selector:({transactionNumber:n})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===n?0:n+1}),l}var Q=(0,i.createContext)({editor:null});Q.Consumer;var Z=(0,i.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),G=()=>(0,i.useContext)(Z),X=i.forwardRef((e,n)=>{let{onDragStart:r}=G(),i=e.as||"div";return(0,l.jsx)(i,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})});function ee(e){return!!("function"==typeof e&&e.prototype&&e.prototype.isReactComponent)}function et(e){return!!("object"==typeof e&&e.$$typeof&&("Symbol(react.forward_ref)"===e.$$typeof.toString()||"react.forward_ref"===e.$$typeof.description))}var en=class{constructor(e,{editor:n,props:r={},as:i="div",className:s=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isInitialized?(0,o.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let n=this.component,r=this.props,o=this.editor,s=function(){try{if(i.version)return parseInt(i.version.split(".")[0],10)>=19}catch{}return!1}(),a=function(e){if(ee(e)||et(e))return!0;if("object"==typeof e&&e.$$typeof&&("Symbol(react.memo)"===e.$$typeof.toString()||"react.memo"===e.$$typeof.description)){let n=e.type;if(n)return ee(n)||et(n)}return!1}(n),h={...r};h.ref&&!(s||a)&&delete h.ref,!h.ref&&(s||a)&&(h.ref=e=>{this.ref=e}),this.reactElement=(0,l.jsx)(n,{...h}),null==(e=null==o?void 0:o.contentComponent)||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;let n=this.editor;null==(e=null==n?void 0:n.contentComponent)||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(n=>{this.element.setAttribute(n,e[n])})}};i.createContext({markViewContentRef:()=>{}}),a.WR;var er=class extends a.DK{constructor(e,n,r){if(super(e,n,r),this.selectionRafId=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";let e=this.dom.querySelector("[data-node-view-content]");if(!e)return;e.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,n=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(n,{get(r,i,o){var s;return"storage"===i?null!=(s=e.storage[n.name])?s:{}:Reflect.get(r,i,o)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,i.createRef)()};if(!this.component.displayName){let e;this.component.displayName=(e=this.extension.name).charAt(0).toUpperCase()+e.substring(1)}let n={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute("data-node-view-wrapper")&&e.removeAttribute("data-node-view-wrapper"),e.appendChild(this.contentDOMElement))}},r=this.component,o=(0,i.memo)(e=>(0,l.jsx)(Z.Provider,{value:n,children:(0,i.createElement)(r,e)}));o.displayName="ReactNodeView";let s=this.node.isInline?"span":"div";this.options.as&&(s=this.options.as);let{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new en(o,{editor:this.editor,props:e,as:s,className:`node-${this.node.type.n
7ame} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null==(e=this.renderer.element.firstElementChild)?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let{from:e,to:n}=this.editor.state.selection,r=this.getPos();if("number"==typeof r){if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}})}update(e,n,r){let i=e=>{this.renderer.updateProps(e),"function"==typeof this.options.attrs&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){let o=this.node,s=this.decorations,l=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:o,oldDecorations:s,newNode:e,newDecorations:n,oldInnerDecorations:l,innerDecorations:r,updateProps:()=>i({node:e,decorations:n,innerDecorations:r,extension:this.extensionWithSyncedStorage})})}return e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,i({node:e,decorations:n,innerDecorations:r,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let e={};if("function"==typeof this.options.attrs){let n=this.editor.extensionManager.attributes,r=(0,a.m7)(this.node,n);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function ei(e,n){return r=>r.editor.contentComponent?new er(e,r,n):{}}var eo=(0,i.createContext)({get editor(){throw Error("useTiptap must be used within a <Tiptap> provider")}});eo.displayName="TiptapContext";var es=()=>(0,i.useContext)(eo);function el({editor:e,instance:n,children:r}){let o=null!=e?e:n;if(!o)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let s=(0,i.useMemo)(()=>({editor:o}),[o]),a=(0,i.useMemo)(()=>({editor:o}),[o]);return(0,l.jsx)(Q.Provider,{value:a,children:(0,l.jsx)(eo.Provider,{value:s,children:r})})}function ea({...e}){let{editor:n}=es();return(0,l.jsx)(_,{editor:n,...e})}el.displayName="Tiptap",ea.displayName="Tiptap.Content",Object.assign(el,{Content:ea})},29995:function(e,n,r){r.d(n,{Z:function(){return tf}});var i=r(94725),o=r(23694),s=r(98542),l=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,a=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,h=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,c=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,d=i.vc.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return(0,s.tZ)("strong",{...(0,i.P1)(this.options.HTMLAttributes,e),children:(0,s.tZ)("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,n)=>n.applyMark("bold",n.parseInline(e.tokens||[])),renderMarkdown:(e,n)=>`**${n.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
7,addInputRules(){return[(0,i.Cf)({find:l,type:this.type}),(0,i.Cf)({find:h,type:this.type})]},addPasteRules(){return[(0,i.K9)({find:a,type:this.type}),(0,i.K9)({find:c,type:this.type})]}}),u=/(^|[^`])`([^`]+)`(?!`)$/,p=/(^|[^`])`([^`]+)`(?!`)/g,f=i.vc.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",(0,i.P1)(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,n)=>n.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,n)=>e.content?`\`${n.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,i.Cf)({find:u,type:this.type})]},addPasteRules(){return[(0,i.K9)({find:p,type:this.type})]}}),m=r(17213),g=/^```([a-z]+)?[\s\n]$/,y=/^~~~([a-z]+)?[\s\n]$/,w=i.NB.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var n;let{languageClassPrefix:r}=this.options;return r&&[...(null==(n=e.firstElementChild)?void 0:n.classList)||[]].filter(e=>e.startsWith(r)).map(e=>e.replace(r,""))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:n}){return["pre",(0,i.P1)(this.options.HTMLAttributes,n),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,n)=>{var r;return(null==(r=e.raw)?void 0:r.startsWith("```"))===!1&&"indented"!==e.codeBlockStyle?[]:n.createNode("codeBlock",{language:e.lang||null},e.text?[n.createTextNode(e.text)]:[])},renderMarkdown:(e,n)=>{var r;let i=(null==(r=e.attrs)?void 0:r.language)||"";return e.content?[`\`\`\`${i}`,n.renderChildren(e.content),"```"].join("\n"):`\`\`\`${i}
8
9\`\`\``},addCommands(){return{setCodeBlock:e=>({commands:n})=>n.setNode(this.name,e),toggleCodeBlock:e=>({commands:n})=>n.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:n}=this.editor.state.selection,r=1===n.pos;return!!e&&n.parent.type.name===this.name&&(!!r||!n.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:e})=>{var n;if(!this.options.enableTabIndentation)return!1;let r=null!=(n=this.options.tabSize)?n:4,{state:i}=e,{selection:o}=i,{$from:s,empty:l}=o;if(s.parent.type!==this.type)return!1;let a=" ".repeat(r);return l?e.commands.insertContent(a):e.commands.command(({tr:e})=>{let{from:n,to:r}=o,s=i.doc.textBetween(n,r,"\n","\n").split("\n").map(e=>a+e).join("\n");return e.replaceWith(n,r,i.schema.text(s)),!0})},"Shift-Tab":({editor:e})=>{var n;if(!this.options.enableTabIndentation)return!1;let r=null!=(n=this.options.tabSize)?n:4,{state:i}=e,{selection:o}=i,{$from:s,empty:l}=o;return s.parent.type===this.type&&(l?e.commands.command(({tr:e})=>{var n;let{pos:o}=s,l=s.start(),a=s.end(),h=i.doc.textBetween(l,a,"\n","\n").split("\n"),c=0,d=0,u=o-l;for(let e=0;e<h.length;e+=1){if(d+h[e].length>=u){c=e;break}d+=h[e].length+1}let p=Math.min(((null==(n=h[c].match(/^ */))?void 0:n[0])||"").length,r);if(0===p)return!0;let f=l;for(let e=0;e<c;e+=1)f+=h[e].length+1;return e.delete(f,f+p),o-f<=p&&e.setSelection(m.Bs.create(e.doc,f)),!0}):e.commands.command(({tr:e})=>{let{from:n,to:s}=o,l=i.doc.textBetween(n,s,"\n","\n").split("\n").map(e=>{var n;let i=Math.min(((null==(n=e.match(/^ */))?void 0:n[0])||"").length,r);return e.slice(i)}).join("\n");return e.replaceWith(n,s,i.schema.text(l)),!0}))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:n}=e,{selection:r}=n,{$from:i,empty:o}=r;if(!o||i.parent.type!==this.type)return!1;let s=i.parentOffset===i.parent.nodeSize-2,l=i.parent.textContent.endsWith("\n\n");return!!s&&!!l&&e.chain().command(({tr:e})=>(e.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>
9{if(!this.options.exitOnArrowDown)return!1;let{state:n}=e,{selection:r,doc:i}=n,{$from:o,empty:s}=r;if(!s||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let l=o.after();return void 0!==l&&(i.nodeAt(l)?e.commands.command(({tr:e})=>(e.setSelection(m.Y1.near(i.resolve(l))),!0)):e.commands.exitCode())}}},addInputRules(){return[(0,i.zK)({find:g,type:this.type,getAttributes:e=>({language:e[1]})}),(0,i.zK)({find:y,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new m.Sy({key:new m.H$("codeBlockVSCodeHandler"),props:{handlePaste:(e,n)=>{if(!n.clipboardData||this.editor.isActive(this.type.name))return!1;let r=n.clipboardData.getData("text/plain"),i=n.clipboardData.getData("vscode-editor-data"),o=i?JSON.parse(i):void 0,s=null==o?void 0:o.mode;if(!r||!s)return!1;let{tr:l,schema:a}=e.state,h=a.text(r.replace(/\r\n?/g,"\n"));return l.replaceSelectionWith(this.type.create({language:s},h)),l.selection.$from.parent.type!==this.type&&l.setSelection(m.Bs.near(l.doc.resolve(Math.max(0,l.selection.from-2)))),l.setMeta("paste",!0),e.dispatch(l),!0}}})]}}),v=i.NB.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,n)=>e.content?n.renderChildren(e.content,"\n\n"):""}),b=i.NB.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",(0,i.P1)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>`  
10`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:n,state:r,editor:i})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:o}=r;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=i.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return n().insertContent({type:this.name}).command(({tr:e,dispatch:n})=>{if(n&&a&&s){let n=a.filter(e=>l.includes(e.type.name));e.ensureMarks(n)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),k=i.NB.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:n}){let r=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${r}`,(0,i.P1)(this.options.HTMLAttributes,n),0]},parseMarkdown:(e,n)=>n.createNode("heading",{level:e.depth||1},n.parseInline(e.tokens||[])),renderMarkdown:(e,n)=>{var r;let i=(null==(r=e.attrs)?void 0:r.level)?parseInt(e.attrs.level,10):1,o="#".repeat(i);return e.content?`${o} ${n.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:n})=>!!this.options.levels.includes(e.level)&&n.setNode(this.name,e),toggleHeading:e=>({commands:n})=>!!this.options.levels.includes(e.level)&&n.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,n)=>({...e,[`Mod-Alt-${n}`]:()=>this.editor.commands.toggleHeading({level:n})}),{})},addInputRules(){return this.options.levels.map(e=>(0,i.zK)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
10)\\s$`),type:this.type,getAttributes:{level:e}}))}}),A=i.NB.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",(0,i.P1)(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,n)=>n.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:n})=>{if(!(0,i.FZ)(n,n.schema.nodes[this.name]))return!1;let{selection:r}=n,{$to:o}=r,s=e();return(0,i.EG)(r)?s.insertContentAt(o.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:e,tr:n,dispatch:r})=>{if(r){let{$to:r}=n.selection,i=r.end();if(r.nodeAfter)r.nodeAfter.isTextblock?n.setSelection(m.Bs.create(n.doc,r.pos+1)):r.nodeAfter.isBlock?n.setSelection(m.qv.create(n.doc,r.pos)):n.setSelection(m.Bs.create(n.doc,r.pos));else{let o=e.schema.nodes[this.options.nextNodeType]||r.parent.type.contentMatch.defaultType,s=null==o?void 0:o.create();s&&(n.insert(i,s),n.setSelection(m.Bs.create(n.doc,i+1)))}n.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,i.x2)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
10ype})]}}),x=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,C=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,S=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,M=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,E=i.vc.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",(0,i.P1)(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,n)=>n.applyMark("italic",n.parseInline(e.tokens||[])),renderMarkdown:(e,n)=>`*${n.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,i.Cf)({find:x,type:this.t
10ype}),(0,i.Cf)({find:S,type:this.type})]},addPasteRules(){return[(0,i.K9)({find:C,type:this.type}),(0,i.K9)({find:M,type:this.type})]}});let T="numeric",R="ascii",I="alpha",O="asciinumeric",N="alphanumeric",L="domain",H="emoji",z="whitespace";function B(e,n,r){for(let i in n[T]&&(n[O]=!0,n[N]=!0),n[R]&&(n[O]=!0,n[I]=!0),n[O]&&(n[N]=!0),n[I]&&(n[N]=!0),n[N]&&(n[L]=!0),n[H]&&(n[L]=!0),n){let n=(i in r||(r[i]=[]),r[i]);0>n.indexOf(e)&&n.push(e)}}function F(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}F.groups={},F.prototype={accepts(){return!!this.t},go(e){let n=this.j[e];if(n)return n;for(let n=0;n<this.jr.length;n++){let r=this.jr[n][0],i=this.jr[n][1];if(i&&r.test(e))return i}return this.jd},has(e,n=!1){return n?e in this.j:!!this.go(e)},ta(e,n,r,i){for(let o=0;o<e.length;o++)this.tt(e[o],n,r,i)},tr(e,n,r,i){let o;return i=i||F.groups,n&&n.j?o=n:(o=new F(n),r&&i&&B(n,r,i)),this.jr.push([e,o]),o},ts(e,n,r,i){let o=this,s=e.length;if(!s)return o;for(let n=0;n<s-1;n++)o=o.tt(e[n]);return o.tt(e[s-1],n,r,i)},tt(e,n,r,i){if(i=i||F.groups,n&&n.j)return this.j[e]=n,n;let o,s=this.go(e);return s?(Object.assign((o=new F).j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new F,n&&(i&&(o.t&&"string"==typeof o.t?B(n,Object.assign(function(e,n){let r={};for(let i in n)n[i].indexOf(e)>=0&&(r[i]=!0);return r}(o.t,i),r),i):r&&B(n,r,i)),o.t=n),this.j[e]=o,o}};let $=(e,n,r,i,o)=>e.ta(n,r,i,o),D=(e,n,r,i,o)=>e.tr(n,r,i,o),P=(e,n,r,i,o)=>e.ts(n,r,i,o),j=(e,n,r,i,o)=>e.tt(n,r,i,o),U="WORD",_="UWORD",W="ASCIINUMERICAL",q="ALPHANUMERICAL",V="LOCALHOST",J="UTLD",Y="SCHEME",K="SLASH_SCHEME",Q="OPENBRACE",Z="CLOSEBRACE",G="OPENBRACKET",X="CLOSEBRACKET",ee="OPENPAREN",et="CLOSEPAREN",en="OPENANGLEBRACKET",er="CLOSEANGLEBRACKET",ei="FULLWIDTHLEFTPAREN",eo="FULLWIDTHRIGHTPAREN",es="LEFTCORNERBRACKET",el="RIGHTCORNERBRACKET",ea="LEFTWHITECORNERBRACKET",eh="RIGHTWHITECORNERBRACKET",ec="FULLWIDTHLESSTHAN",ed="FULLWIDTHGREATERTHAN",eu="AMPERSAND",ep="APOSTROPHE",ef="ASTERISK",em="BACKSLASH",eg="BACKTICK",ey="CARET",ew="COLON",ev="COMMA",eb="DOLLAR",ek="EQUALS",eA="EXCLAMATION",ex="HYPHEN",eC="PERCENT",eS="PIPE",eM="PLUS",eE="POUND",eT="QUERY",eR="QUOTE",eI="FULLWIDTHMIDDLEDOT",eO="SEMI",eN="SLASH",eL="TILDE",eH="UNDERSCORE",ez="EMOJI";var eB=Object.freeze({__proto__:null,ALPHANUMERICAL:q,AMPERSAND:eu,APOSTROPHE:ep,ASCIINUMERICAL:W,ASTERISK:ef,AT:"AT",BACKSLASH:em,BACKTICK:eg,CARET:ey,CLOSEANGLEBRACKET:er,CLOSEBRACE:Z,CLOSEBRACKET:X,CLOSEPAREN:et,COLON:ew,COMMA:ev,DOLLAR:eb,DOT:"DOT",EMOJI:ez,EQUALS:ek,EXCLAMATION:eA,FULLWIDTHGREATERTHAN:ed,FULLWIDTHLEFTPAREN:ei,FULLWIDTHLESSTHAN:ec,FULLWIDTHMIDDLEDOT:eI,FULLWIDTHRIGHTPAREN:eo,HYPHEN:ex,LEFTCORNERBRACKET:es,LEFTWHITECORNERBRACKET:ea,LOCALHOST:V,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:en,OPENBRACE:Q,OPENBRACKET:G,OPENPAREN:ee,PERCENT:eC,PIPE:eS,PLUS:eM,POUND:eE,QUERY:eT,QUOTE:eR,RIGHTCORNERBRACKET:el,RIGHTWHITECORNERBRACKET:eh,SCHEME:Y,SEMI:eO,SLASH:eN,SLASH_SCHEME:K,SYM:"SYM",TILDE:eL,TLD:"TLD",UNDERSCORE:eH,UTLD:J,UWORD:_,WORD:U,WS:"WS"});let eF=/[a-z]/,e$=/\p{L}/u,eD=/\p{Emoji}/u,eP=/\d/,ej=/\s/,eU=null,e_=null;function eW(e,n){let r=function(e){let n=[],r=e.length,i=0;for(;i<r;){let o,s=e.charCodeAt(i),l=s<55296||s>56319||i+1===r||(o=e.charCodeAt(i+1))<56320||o>57343?e[i]:e.slice(i,i+2);n.push(l),i+=l.length}return n}(n.replace(/[A-Z]/g,e=>e.toLowerCase())),i=r.length,o=[],s=0,l=0;for(;l<i;){let a=e,h=null,c=0,d=null,u=-1,p=-1;for(;l<i&&(h=a.go(r[l]));)(a=h).accepts()?(u=0,p=0,d=a):u>=0&&(u+=r[l].length,p++),c+=r[l].length,s+=r[l].length,l++;s-=u,l-=p,c-=u,o.push({t:d.t,v:n.slice(s-c,s),s:s-c,e:s})}return o}function eq(e,n,r,i,o){let s;let l=n.length;for(let r=0;r<l-1;r++){let l=n[r];e.j[l]?s=e.j[l]:((s=new F(i)).jr=o.slice(),e.j[l]=s),e=s}return(s=new F(r)).jr=o.slice(),e.j[n[l-1]]=s,s}function eV(e){let n=[],r=[],i=0;for(;i<e.length;){let o=0;for(;"0123456789".indexOf(e[i+o])>=0;)o++;if(o>0){n.push(r.join(""));for(let n=parseInt(e.substring(i,i+o),10);n>0;n--)r.pop();i+=o}else r.push(e[i]),i++}return n}let eJ={defaultProtocol:"http",events:null,format:eK,formatHref:eK,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function eY(e,n=null){let r=Object.assign({},eJ);e&&(r=Object.assign(r,e instanceof eY?e.o:e));let i=r.ignoreTags,o=[];for(let e=0;e<i.length;e++)o.push(i[e].toUpperCase());
10this.o=r,n&&(this.defaultRender=n),this.ignoreTags=o}function eK(e){return e}function eQ(e,n){this.t="token",this.v=e,this.tk=n}function eZ(e,n){class r extends eQ{constructor(n,r){super(n,r),this.t=e}}for(let e in n)r.prototype[e]=n[e];return r.t=e,r}eY.prototype={o:eJ,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,n,r){let i=null!=n,o=this.o[e];return o&&("object"==typeof o?"function"==typeof(o=r.t in o?o[r.t]:eJ[e])&&i&&(o=o(n,r)):"function"==typeof o&&i&&(o=o(n,r.t,r))),o},getObj(e,n,r){let i=this.o[e];return"function"==typeof i&&null!=n&&(i=i(n,r.t,r)),i},render(e){let n=e.render(this);return(this.get("render",null,e)||this.defaultRender)(n,e.t,e)}},eQ.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let n=this.toString(),r=e.get("truncate",n,this),i=e.get("format",n,this);return r&&i.length>r?i.substring(0,r)+"…":i},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=eJ.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,this),o=this.toFormattedString(e),s={},l=e.get("className",n,this),a=e.get("target",n,this),h=e.get("rel",n,this),c=e.getObj("attributes",n,this),d=e.getObj("events",n,this);return s.href=r,l&&(s.class=l),a&&(s.target=a),h&&(s.rel=h),c&&Object.assign(s,c),{tagName:i,attributes:s,content:o,eventListeners:d}}};let eG=eZ("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),eX=eZ("text"),e0=eZ("nl"),e1=eZ("url",{isLink:!0,toHref(e=eJ.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==V&&e[1].t===ew}}),e2=e=>new F(e);function e3(e,n,r){let i=r[0].s,o=r[r.length-1].e;return new e(n.slice(i,o),r)}let e5="undefined"!=typeof console&&console&&console.warn||(()=>{}),e4={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function e6(e,n=!1){if(e4.initialized&&e5(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
111. Must only contain digits, lowercase ASCII letters or "-"
122. Cannot start or end with "-"
133. "-" cannot repeat`);e4.customSchemes.push([e,n])}function e8(e){return e4.initialized||function(){e4.scanner=function(e=[]){let n={};F.groups=n;let r=new F;null==eU&&(eU=eV("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
13ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xf6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==e_&&(e_=eV("ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
13ºÐ´2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3Õ°Õ¡Õµ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1ì»´2삼성2한국2")),j(r,"'",ep),j(r,"{",Q),j(r,"}",Z),j(r,"[",G),j(r,"]",X),j(r,"(",ee),j(r,")",et),j(r,"<",en),j(r,">",er),j(r,"(",ei),j(r,")",eo),j(r,"「",es),j(r,"」",el),j(r,"『",ea),j(r,"』",eh),j(r,"<",ec),j(r,">",ed),j(r,"&",eu),j(r,"*",ef),j(r,"@","AT"),j(r,"`",eg),j(r,"^",ey),j(r,":",ew),j(r,",",ev),j(r,"$",eb),j(r,".","DOT"),j(r,"=",ek),j(r,"!",eA),j(r,"-",ex),j(r,"%",eC),j(r,"|",eS),j(r,"+",eM),j(r,"#",eE),j(r,"?",eT),j(r,'"',eR),j(r,"/",eN),j(r,";",eO),j(r,"~",eL),j(r,"_",eH),j(r,"\\",em),j(r,"・",eI);let i=D(r,eP,"NUM",{[T]:!0});D(i,eP,i);let o=D(i,eF,W,{[O]:!0}),s=D(i,e$,q,{[N]:!0}),l=D(r,eF,U,{[R]:!0});D(l,eP,o),D(l,eF,l),D(o,eP,o),D(o,eF,o);let a=D(r,e$,_,{[I]:!0});D(a,eF),D(a,eP,s),D(a,e$,a),D(s,eP,s),D(s,eF),D(s,e$,s);let h=j(r,"\n","NL",{[z]:!0}),c=j(r,"\r","WS",{[z]:!0}),d=D(r,ej,"WS",{[z]:!0});j(r,"",d),j(c,"\n",h),j(c,"",d),D(c,ej,d),j(d,"\r"),j(d,"\n"),D(d,ej,d),j(d,"",d);let u=D(r,eD,ez,{[H]:!0});j(u,"#"),D(u,eD,u),j(u,"️",u);let p=j(u,"‍");j(p,"#"),D(p,eD,u);let f=[[eF,l],[eP,o]],m=[[eF,null],[e$,a],[eP,s]];for(let e=0;e<eU.length;e++)eq(r,eU[e],"TLD",U,f);for(let e=0;e<e_.length;e++)eq(r,e_[e],J,_,m);B("TLD",{tld:!0,ascii:!0},n),B(J,{utld:!0,alpha:!0},n),eq(r,"file",Y,U,f),eq(r,"mailto",Y,U,f),eq(r,"http",K,U,f),eq(r,"https",K,U,f),eq(r,"ftp",K,U,f),eq(r,"ftps",K,U,f),B(Y,{scheme:!0,ascii:!0},n),B(K,{slashscheme:!0,ascii:!0},n),e=e.sort((e,n)=>e[0]>n[0]?1:-1);for(let n=0;n<e.length;n++){let i=e[n][0],o=e[n][1]?{scheme:!0}:{slashscheme:!0};i.indexOf("-")>=0?o[L]=!0:eF.test(i)?eP.test(i)?o[O]=!0:o[R]=!0:o[T]=!0,P(r,i,i,o)}return P(r,"localhost",V,{ascii:!0}),r.jd=new F("SYM"),{start:r,tokens:Object.assign({groups:n},eB)}}(e4.customSchemes);for(let e=0;e<e4.tokenQueue.length;e++)e4.tokenQueue[e][1]({scanner:e4.scanner});e4.parser=function({groups:e}){let n=e.domain.concat([eu,ef,"AT",em,eg,ey,eb,ek,ex,"NUM",eC,eS,eM,eE,eN,"SYM",eL,eH]),r=[ep,ew,ev,"DOT",eA,eC,eT,eR,eO,en,er,Q,Z,X,G,ee,et,ei,eo,es,el,ea,eh,ec,ed],i=[eu,ep,ef,em,eg,ey,eb,ek,ex,Q,Z,eC,eS,eM,eE,eT,eN,"SYM",eL,eH],o=e2(),s=j(o,eL);$(s,i,s),$(s,e.domain,s);let l=e2(),a=e2(),h=e2();$(o,e.domain,l),$(o,e.scheme,a),$(o,e.slashscheme,h),$(l,i,s),$(l,e.domain,l);let c=j(l,"AT");j(s,"AT",c),j(a,"AT",c),j(h,"AT",c);let d=j(s,"DOT");$(d,i,s),$(d,e.domain,s);let u=e2();$(c,e.domain,u),$(u,e.domain,u);let p=j(u,"DOT");$(p,e.domain,u);let f=e2(eG);$(p,e.tld,f),$(p,e.utld,f),j(c,V,f);let m=j(u,ex);j(m,ex,m),$(m,e.domain,u),$(f,e.domain,u),j(f,"DOT",p),j(f,ex,m),$(j(f,ew),e.numeric,eG);let g=j(l,ex),y=j(l,"DOT");j(g,ex,g),$(g,e.domain,l),$(y,i,s),$(y,e.domain,l);let w=e2(e1);$(y,e.tld,w),$(y,e.utld,w),$(w,e.domain,l),$(w,i,s),j(w,"DOT",y),j(w,ex,g),j(w,"AT",c);let v=j(w,ew),b=e2(e1);$(v,e.numeric,b);let k=e2(e1),A=e2();$(k,n,k),$(k,r,A),$(A,n,k),$(A,r,A),j(w,eN,k),j(b,eN,k);let x=j(a,ew),C=j(h,ew),S=j(C,eN),M=j(S,eN);$(a,e.domain,l),j(a,"DOT",y),j(a,ex,g),$(h,e.domain,l),j(h,"DOT",y),j(h,ex,g),$(x,e.domain,k),j(x,eN,k),j(x,eT,k),$(M,e.domain,k),$(M,n,k),j(M,eN,k);let E=[[Q,Z],[G,X],[ee,et],[en,er],[ei,eo],[es,el],[ea,eh],[ec,ed]];for(let e=0;e<E.length;e++){let[i,o]=E[e],s=j(k,i);j(A,i,s),j(s,o,k);let l=e2(e1);$(s,n,l);let a=e2();$(s,r),$(l,n,l),$(l,r,a),$(a,n,l),$(a,r,a),j(l,o,k),j(a,o,k)}return j(o,V,w),j(o,"NL",e0),{start:o,tokens:eB}}(e4.scanner.tokens);for(let e=0;e<e4.pluginQueue.length;e++)e4.pluginQueue[e][1]({scanner:e4.scanner,parser:e4.parser});e4.initialized=!0}(),function(e,n,r){let i=r.length,o=0,s=[],l=[];for(;o<i;){let a=e,h=null,c=null,d=0,u=null,p=-1;for(;o<i&&!(h=a.go(r[o].t));)l.push(r[o++]);for(;o<i&&(c=h||a.go(r[o].t));)h=null,(a=c).accepts()?(p=0,u=a):p>=0&&p++,o++,d++;if(p<0)(o-=d)<i&&(l.push(r[o]),o++);else{l.length>0&&(s.push(e3(eX,n,l)),l=[]),o-=p,d-=p;let e=u.t,i=r.slice(o-d,o);s.push(e3(e,n,i))}}return l.length>0&&s.push(e3(eX,n,l)),s}(e4.parser.start,e,eW(e4.scanner.start,e))}function e7(e,n=null,r=null){if(n&&"object"==typeof n){if(r)throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);r=n,n=null}let i=new eY(r),o=e8(e),s=[];for(let e=0;e<o.length;e++){let r=o[e];r.isLink&&(!n||r.t===n)&&i.check(r)&&s.push(r.toFormattedObject(i))}return s}e8.scan=eW;var e9="[\0- \xa0 ᠎ -\u2029  ]",te=new RegExp(e9),tt=RegExp(`${e9}$`),tn=RegExp(e9,"g");function tr(e,n){let r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];
13return n&&n.forEach(e=>{let n="string"==typeof e?e:e.scheme;n&&r.push(n)}),!e||e.replace(tn,"").match(RegExp(`^(?:(?:${r.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var ti=i.vc.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if("string"==typeof e){e6(e);return}e6(e.scheme,e.optionalSlashes)})},onDestroy(){F.groups={},e4.scanner=null,e4.parser=null,e4.tokenQueue=[],e4.pluginQueue=[],e4.customSchemes=[],e4.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,n)=>!!tr(e,n.protocols),validate:e=>!!e,shouldAutoLink:e=>{let n=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),r=/^[a-z][a-z0-9+.-]*:/i.test(e);if(n||r&&!e.includes("@"))return!0;let i=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(i)&&!!/\./.test(i)}}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let n=e.getAttribute("href");return!!(n&&this.options.isAllowedUri(n,{defaultValidate:e=>!!tr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!tr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,i.P1)(this.options.HTMLAttributes,e),0]:["a",(0,i.P1)(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,n)=>n.applyMark("link",n.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,n)=>{var r,i,o,s;let l=null!=(i=null==(r=e.attrs)?void 0:r.href)?i:"",a=null!=(s=null==(o=e.attrs)?void 0:o.title)?s:"",h=n.renderChildren(e);return a?`[${h}](${l} "${a}")`:`[${h}](${l})`},addCommands(){return{setLink:e=>({chain:n})=>{let{href:r}=e;return!!this.options.isAllowedUri(r,{defaultValidate:e=>!!tr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&n().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:n})=>{let{href:r}=e||{};return(!r||!!this.options.isAllowedUri(r,{defaultValidate:e=>!!tr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&n().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,i.K9)({find:e=>{let n=[];if(e){let{protocols:r,defaultProtocol:i}=this.options,o=e7(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!tr(e,r),protocols:r,defaultProtocol:i}));o.length&&o.forEach(e=>{this.options.shouldAutoLink(e.value)&&n.push({text:e.value,data:{href:e.href},index:e.start})})}return n}
13,type:this.type,getAttributes:e=>{var n;return{href:null==(n=e.data)?void 0:n.href}}})]},addProseMirrorPlugins(){var e,n,r;let o=[],{protocols:s,defaultProtocol:l}=this.options;return this.options.autolink&&o.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!tr(e,s),protocols:s,defaultProtocol:l}),shouldAutoLink:this.options.shouldAutoLink},new m.Sy({key:new m.H$("autolink"),appendTransaction:(n,r,o)=>{let s=n.some(e=>e.docChanged)&&!r.doc.eq(o.doc),l=n.some(e=>e.getMeta("preventAutolink"));if(!s||l)return;let{tr:a}=o,h=(0,i.XP)(r.doc,[...n]);if((0,i.QC)(h).forEach(({newRange:n})=>{let r,s;let l=(0,i.b5)(o.doc,n,e=>e.isTextblock);if(l.length>1)r=l[0],s=o.doc.textBetween(r.pos,r.pos+r.node.nodeSize,void 0," ");else if(l.length){let e=o.doc.textBetween(n.from,n.to," "," ");if(!tt.test(e))return;r=l[0],s=o.doc.textBetween(r.pos,n.to,void 0," ")}if(r&&s){let n=s.split(te).filter(Boolean);if(n.length<=0)return!1;let l=n[n.length-1],h=r.pos+s.lastIndexOf(l);if(!l)return!1;let c=e8(l).map(n=>n.toObject(e.defaultProtocol));if(!(1===c.length?c[0].isLink:3===c.length&&!!c[1].isLink&&["()","[]"].includes(c[0].value+c[2].value)))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:h+e.start+1,to:h+e.end+1})).filter(e=>!o.schema.marks.code||!o.doc.rangeHasMark(e.from,e.to,o.schema.marks.code)).filter(n=>e.validate(n.value)).filter(n=>e.shouldAutoLink(n.value)).forEach(n=>{(0,i.tI)(n.from,n.to,o.doc).some(n=>n.mark.type===e.type)||a.addMark(n.from,n.to,e.type.create({href:n.href}))})}}),a.steps.length)return a}}))),o.push((n={type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection},new m.Sy({key:new m.H$("handleClickLink"),props:{handleClick:(e,r,o)=>{var s,l;if(0!==o.button||!e.editable)return!1;let a=null;if(o.target instanceof HTMLAnchorElement)a=o.target;else{let e=o.target;if(!e)return!1;let r=n.editor.view.dom;(a=e.closest("a"))&&!r.contains(a)&&(a=null)}if(!a)return!1;let h=!1;if(n.enableClickSelection&&(h=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){let r=(0,i.u9)(e.state,n.type.name),o=null!=(s=a.href)?s:r.href,c=null!=(l=a.target)?l:r.target;o&&(window.open(o,c),h=!0)}return h}}}))),this.options.linkOnPaste&&o.push((r={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink},new m.Sy({key:new m.H$("handlePasteLink"),props:{handlePaste:(e,n,i)=>{let{shouldAutoLink:o}=r,{state:s}=e,{selection:l}=s,{empty:a}=l;if(a)return!1;let h="";i.content.forEach(e=>{h+=e.textContent});let c=e7(h,{defaultProtocol:r.defaultProtocol}).find(e=>e.isLink&&e.value===h);return!!(h&&c&&(void 0===o||o(c.value)))&&r.editor.commands.setMark(r.type,{href:c.href})}}}))),o}}),to=r(27123),ts="&nbsp;",tl=i.NB.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,i.P1)(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,n)=>{let r=e.tokens||[];if(1===r.length&&"image"===r[0].type)return n.parseChildren([r[0]]);let i=n.parseInline(r);return 1===i.length&&"text"===i[0].type&&(i[0].text===ts||"\xa0"===i[0].text)?n.createNode("paragraph",void 0,[]):n.createNode("paragraph",void 0,i)},renderMarkdown:(e,n)=>{if(!e)return"";let r=Array.isArray(e.content)?e.content:[];return 0===r.length?ts:n.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ta=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,th=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,tc=i.vc.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",(0,i.P1)(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,n)=>n.applyMark("strike",n.parseInline(e.tokens||[])),renderMarkdown:(e,n)=>`~~${n.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}}
13,addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,i.Cf)({find:ta,type:this.type})]},addPasteRules(){return[(0,i.K9)({find:th,type:this.type})]}}),td=i.NB.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),tu=i.vc.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",(0,i.P1)(this.options.HTMLAttributes,e),0]},parseMarkdown(e,n){return n.applyMark(this.name||"underline",n.parseInline(e.tokens||[]))},renderMarkdown:(e,n)=>`++${n.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,n,r){let i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!i)return;let o=i[2].trim();return{type:"underline",raw:i[0],text:o,tokens:r.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),tp=r(74922),tf=i.hj.create({name:"starterKit",addExtensions(){var e,n,r,i;let s=[];return!1!==this.options.bold&&s.push(d.configure(this.options.bold)),!1!==this.options.blockquote&&s.push(o.V6.configure(this.options.blockquote)),!1!==this.options.bulletList&&s.push(to.DY.configure(this.options.bulletList)),!1!==this.options.code&&s.push(f.configure(this.options.code)),!1!==this.options.codeBlock&&s.push(w.configure(this.options.codeBlock)),!1!==this.options.document&&s.push(v.configure(this.options.document)),!1!==this.options.dropcursor&&s.push(tp.m$.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&s.push(tp.fj.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&s.push(b.configure(this.options.hardBreak)),!1!==this.options.heading&&s.push(k.configure(this.options.heading)),!1!==this.options.undoRedo&&s.push(tp.QA.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&s.push(A.configure(this.options.horizontalRule)),!1!==this.options.italic&&s.push(E.configure(this.options.italic)),!1!==this.options.listItem&&s.push(to.HC.configure(this.options.listItem)),!1!==this.options.listKeymap&&s.push(to.ev.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&s.push(ti.configure(null==(n=this.options)?void 0:n.link)),!1!==this.options.orderedList&&s.push(to.GS.configure(this.options.orderedList)),!1!==this.options.paragraph&&s.push(tl.configure(this.options.paragraph)),!1!==this.options.strike&&s.push(tc.configure(this.options.strike)),!1!==this.options.text&&s.push(td.configure(this.options.text)),!1!==this.options.underline&&s.push(tu.configure(null==(r=this.options)?void 0:r.underline)),!1!==this.options.trailingNode&&s.push(tp.eh.configure(null==(i=this.options)?void 0:i.trailingNode)),s}})},24937:function(e,n,r){let i;function o(e,n){return new Promise(function(r,i){let o;return s(e).then(function(e){try{return o=e,r(new Blob([n.slice(0,2),o,n.slice(2)],{type:"image/jpeg"}))}catch(e){return i(e)}},i)})}r.d(n,{Z:function(){return F}});let s=e=>new Promise((n,r)=>{let i=new FileReader;i.addEventListener("load",({target:{result:e}})=>{let i=new DataView(e),o=0;if(65496!==i.getUint16(o))return r("not a valid JPEG");for(o+=2;;){let s=i.getUint16(o);if(65498===s)break;let l=i.getUint16(o+2);if(65505===s&&1165519206===i.getUint32(o+4)){let s;let a=o+10;switch(i.getUint16(a)){case 18761:s=!0;break;case 19789:s=!1;break;default:return r("TIFF header contains invalid endian")}if(42!==i.getUint16(a+2,s))return r("TIFF header contains invalid version");let h=i.getUint32(a+4,s),c=a+h+2+12*i.getUint16(a+h,s);for(let e=a+h+2;e<c;e+=12)if(274==i.getUint16(e,s)){if(3!==i.getUint16(e+2,s))return r("Orientation data type is invalid");if(1!==i.getUint32(e+4,s))return r("Orientation data count is invalid");i.setUint16(e+8,1,s);break}return n(e.slice(o,o+2+l))}o+=2+l}return n(new Blob)}),i.readAsArrayBuffer(e)});var l,a,h,c,d={};h={},({get exports(){return d},set exports(t){d=t}}).exports=h,h.parse=function(e,n){for(var r=h.bin.readUshort,i=h.bin.readUint,o=0,s={},l=new Uint8Array(e),a=l.length-4;101010256!=i(l,a);)a--;var c=r(l,o=a+4+4);r(l,o+=2);var d=i(l,o+=2),u=i(l,o+=4);o+=4,o=u;for(var p=0;p<c;p++){i(l,o),i(l,o+=16),d=i(l,o+=4);var f=i(l,o+=4),m=r(l,o+=4),g=r(l,o+2),y=r(l,o+4),w=i(l,o+=14);o+=4+(m+g+y),h._readLocal(l,w,s,d,f,n)}return s},h._readLocal=function(e,n,r,i,o,s){var l=h.bin.readUshort,a=h.bin.readUint;a(e,n),l(e,n+=4),l(e,n+=2);var c=l(e,n+=2);a(e,n+=2),a(e,n+=4);var d=l(e,n+=12),u=l(e,n+=2);n+=2;
vendor: 13,679 bytes, line 13
13var p=h.bin.readUTF8(e,n,d);if(n+=d+u,s)r[p]={size:o,csize:i};else{var f=new Uint8Array(e.buffer,n);if(0==c)r[p]=new Uint8Array(f.buffer.slice(n,n+i));else{if(8!=c)throw"unknown compression method: "+c;var m=new Uint8Array(o);h.inflateRaw(f,m),r[p]=m}}},h.inflateRaw=function(e,n){return h.F.inflate(e,n)},h.inflate=function(e,n){return e[0],e[1],h.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),n)},h.deflate=function(e,n){null==n&&(n={level:6});var r=0,i=new Uint8Array(50+Math.floor(1.1*e.length));i[r]=120,i[r+1]=156,r+=2,r=h.F.deflateRaw(e,i,r,n.level);var o=h.adler(e,0,e.length);return i[r+0]=o>>>24&255,i[r+1]=o>>>16&255,i[r+2]=o>>>8&255,i[r+3]=o>>>0&255,new Uint8Array(i.buffer,0,r+4)},h.deflateRaw=function(e,n){null==n&&(n={level:6});var r=new Uint8Array(50+Math.floor(1.1*e.length)),i=h.F.deflateRaw(e,r,i,n.level);return new Uint8Array(r.buffer,0,i)},h.encode=function(e,n){null==n&&(n=!1);var r=0,i=h.bin.writeUint,o=h.bin.writeUshort,s={};for(var l in e){var a=!h._noNeed(l)&&!n,c=e[l],d=h.crc.crc(c,0,c.length);s[l]={cpr:a,usize:c.length,crc:d,file:a?h.deflateRaw(c):c}}for(var l in s)r+=s[l].file.length+30+46+2*h.bin.sizeUTF8(l);var u=new Uint8Array(r+=22),p=0,f=[];for(var l in s){var m=s[l];f.push(p),p=h._writeHeader(u,p,l,m,0)}var g=0,y=p;for(var l in s)m=s[l],f.push(p),p=h._writeHeader(u,p,l,m,1,f[g++]);var w=p-y;return i(u,p,101010256),o(u,p+=8,g),o(u,p+=2,g),i(u,p+=2,w),i(u,p+=4,y),p+=6,u.buffer},h._noNeed=function(e){var n=e.split(".").pop().toLowerCase();return -1!="png,jpg,jpeg,zip".indexOf(n)},h._writeHeader=function(e,n,r,i,o,s){var l=h.bin.writeUint,a=h.bin.writeUshort,c=i.file;return l(e,n,0==o?67324752:33639248),n+=4,1==o&&(n+=2),a(e,n,20),a(e,n+=2,0),a(e,n+=2,i.cpr?8:0),l(e,n+=2,0),l(e,n+=4,i.crc),l(e,n+=4,c.length),l(e,n+=4,i.usize),a(e,n+=4,h.bin.sizeUTF8(r)),a(e,n+=2,0),n+=2,1==o&&(l(e,n+=10,s),n+=4),n+=h.bin.writeUTF8(e,n,r),0==o&&(e.set(c,n),n+=c.length),n},h.crc={table:function(){for(var e=new Uint32Array(256),n=0;n<256;n++){for(var r=n,i=0;i<8;i++)1&r?r=3988292384^r>>>1:r>>>=1;e[n]=r}return e}(),update:function(e,n,r,i){for(var o=0;o<i;o++)e=h.crc.table[255&(e^n[r+o])]^e>>>8;return e},crc:function(e,n,r){return 4294967295^h.crc.update(4294967295,e,n,r)}},h.adler=function(e,n,r){for(var i=1,o=0,s=n,l=n+r;s<l;){for(var a=Math.min(s+5552,l);s<a;)o+=i+=e[s++];i%=65521,o%=65521}return o<<16|i},h.bin={readUshort:function(e,n){return e[n]|e[n+1]<<8},writeUshort:function(e,n,r){e[n]=255&r,e[n+1]=r>>8&255},readUint:function(e,n){return 16777216*e[n+3]+(e[n+2]<<16|e[n+1]<<8|e[n])},writeUint:function(e,n,r){e[n]=255&r,e[n+1]=r>>8&255,e[n+2]=r>>16&255,e[n+3]=r>>24&255},readASCII:function(e,n,r){for(var i="",o=0;o<r;o++)i+=String.fromCharCode(e[n+o]);return i},writeASCII:function(e,n,r){for(var i=0;i<r.length;i++)e[n+i]=r.charCodeAt(i)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,n,r){for(var i,o="",s=0;s<r;s++)o+="%"+h.bin.pad(e[n+s].toString(16));try{i=decodeURIComponent(o)}catch(i){return h.bin.readASCII(e,n,r)}return i},writeUTF8:function(e,n,r){for(var i=r.length,o=0,s=0;s<i;s++){var l=r.charCodeAt(s);if(0==(4294967168&l))e[n+o]=l,o++;else if(0==(4294965248&l))e[n+o]=192|l>>6,e[n+o+1]=128|l>>0&63,o+=2;else if(0==(4294901760&l))e[n+o]=224|l>>12,e[n+o+1]=128|l>>6&63,e[n+o+2]=128|l>>0&63,o+=3;else{if(0!=(4292870144&l))throw"e";e[n+o]=240|l>>18,e[n+o+1]=128|l>>12&63,e[n+o+2]=128|l>>6&63,e[n+o+3]=128|l>>0&63,o+=4}}return o},sizeUTF8:function(e){for(var n=e.length,r=0,i=0;i<n;i++){var o=e.charCodeAt(i);if(0==(4294967168&o))r++;else if(0==(4294965248&o))r+=2;else if(0==(4294901760&o))r+=3;else{if(0!=(4292870144&o))throw"e";r+=4}}return r}},h.F={},h.F.deflateRaw=function(e,n,r,i){var o=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][i],s=h.F.U,l=h.F._goodIndex;h.F._hash;var a=h.F._putsE,c=0,d=r<<3,u=0,p=e.length;if(0==i){for(;c<p;)a(n,d,c+(S=Math.min(65535,p-c))==p?1:0),d=h.F._copyExact(e,c,S,n,d+8),c+=S;return d>>>3}var f=s.lits,m=s.strt,g=s.prev,y=0,w=0,v=0,b=0,k=0,A=0;for(p>2&&(m[A=h.F._hash(e,0)]=0),c=0;c<p;c++){if(k=A,c+1<p-2){A=h.F._hash(e,c+1);var x=c+1&32767;g[x]=m[A],m[A]=x}if(u<=c){(y>14e3||w>26697)&&p-c>100&&(u<c&&(f[y]=c-u,y+=2,u=c),d=h.F._writeBlock(c==p-1||u==p?1:0,f,y,b,e,v,c-v,n,d),y=w=b=0,v=c);var C=0;c<p-2&&(C=h.F._bestMatch(e,c,g,k,Math.min(o[2],p-c),o[3]));var S=C>>>16,M=65535&C;if(0!=C){M=65535&C;var E=l(S=C>>>16,s.of0);s.lhst[257+E]++;var T=l(M,s.df0);s.dhst[T]++,b+=s.exb[E]+s.dxb[T],f[y]=S<<23|c-u,f[y+1]=M<<16|E<<8|T,y+=2,u=c+S}else s.lhst[e[c]]++;w++}}for(v==c&&0!=e.length||(u<c&&(f[y]=c-u,y+=2,u=c),d=h.F._writeBlock(1,f,y,b,e,v,c-v,n,d),y=0,w=0,y=w=b=0,v=c);0!=(7&d);)d++;return d>>>3},h.F._bestMatch=function(e,n,r,i,o,s){var l=32767&n,a=r[l],c=l-a+32768&32767;if(a==l||i!=h.F._hash(e,n-c))return 0;for(var d=0,u=0,p=Math.min(32767,n);c<=p&&0!=--s&&a!=l;){if(0==d||e[n+d]==e[n+d-c]){var f=h.F._howLong(e,n,c);if(f>d){if(u=c,(d=f)>=o)break;c+2<f&&(f=c+2);for(var m=0,g=0;g<f-2;g++){var y=n-c+g+32768&32767,w=y-r[y]+32768&32767;w>m&&(m=w,a=y)}}}c+=(l=a)-(a=r[l])+32768&32767}return d<<16|u},h.F._howLong=function(e,n,r){if(e[n]!=e[n-r]||e[n+1]!=e[n+1-r]||e[n+2]!=e[n+2-r])return 0;var i=n,o=Math.min(e.length,n+258);for(n+=3;n<o&&e[n]==e[n-r];)n++;return n-i},h.F._hash=function(e,n){return(e[n]<<8|e[n+1])+(e[n+2]<<4)&65535},h.saved=0,h.F._writeBlock=function(e,n,r,i,o,s,l,a,c){var d,u,p,f,m,g,y,w,v,b,k,A=h.F.U,x=h.F._putsF,C=h.F._putsE;A.lhst[256]++,f=(p=h.F.getTrees())[0],m=p[1],g=p[2],y=p[3],w=p[4],v=p[5],b=p[6],k=p[7];var S=32+(0==(c+3&7)?0:8-(c+3&7))+(l<<3),M=i+h.F.contSize(A.fltree,A.lhst)+h.F.contSize(A.fdtree,A.dhst),E=i+h.F.contSize(A.ltree,A.lhst)+h.F.contSize(A.dtree,A.dhst);E+=14+3*v+h.F.contSize(A.itree,A.ihst)+(2*A.ihst[16]+3*A.ihst[17]+7*A.ihst[18]);for(var T=0;T<286;T++)A.lhst[T]=0;for(T=0;T<30;T++)A.dhst[T]=0;for(T=0;T<19;T++)A.ihst[T]=0;var R=S<M&&S<E?0:M<E?1:2;if(x(a,c,e),x(a,c+1,R),c+=3,0==R){for(;0!=(7&c);)c++;c=h.F._copyExact(o,s,l,a,c)}else{if(1==R&&(d=A.fltree,u=A.fdtree),2==R){h.F.makeCodes(A.ltree,f),h.F.revCodes(A.ltree,f),h.F.makeCodes(A.dtree,m),h.F.revCodes(A.dtree,m),h.F.makeCodes(A.itree,g),h.F.revCodes(A.itree,g),d=A.ltree,u=A.dtree,C(a,c,y-257),C(a,c+=5,w-1),C(a,c+=5,v-4),c+=4;for(var I=0;I<v;I++)C(a,c+3*I,A.itree[1+(A.ordr[I]<<1)]);c+=3*v,c=h.F._codeTiny(b,A.itree,a,c),c=h.F._codeTiny(k,A.itree,a,c)}for(var O=s,N=0;N<r;N+=2){for(var L=n[N],H=L>>>23,z=O+(8388607&L);O<z;)c=h.F._writeLit(o[O++],d,a,c);if(0!=H){var B=n[N+1],F=B>>16,$=B>>8&255,D=255&B;C(a,c=h.F._writeLit(257+$,d,a,c),H-A.of0[$]),c+=A.exb[$],x(a,c=h.F._writeLit(D,u,a,c),F-A.df0[D]),c+=A.dxb[D],O+=H}}c=h.F._writeLit(256,d,a,c)}return c},h.F._copyExact=function(e,n,r,i,o){var s=o>>>3;return i[s]=r,i[s+1]=r>>>8,i[s+2]=255-i[s],i[s+3]=255-i[s+1],s+=4,i.set(new Uint8Array(e.buffer,n,r),s),o+(r+4<<3)},h.F.getTrees=function(){for(var e=h.F.U,n=h.F._hufTree(e.lhst,e.ltree,15),r=h.F._hufTree(e.dhst,e.dtree,15),i=[],o=h.F._lenCodes(e.ltree,i),s=[],l=h.F._lenCodes(e.dtree,s),a=0;a<i.length;a+=2)e.ihst[i[a]]++;for(a=0;a<s.length;a+=2)e.ihst[s[a]]++;for(var c=h.F._hufTree(e.ihst,e.itree,7),d=19;d>4&&0==e.itree[1+(e.ordr[d-1]<<1)];)d--;return[n,r,c,o,l,d,i,s]},h.F.getSecond=function(e){for(var n=[],r=0;r<e.length;r+=2)n.push(e[r+1]);return n},h.F.nonZero=function(e){for(var n="",r=0;r<e.length;r+=2)0!=e[r+1]&&(n+=(r>>1)+",");return n},h.F.contSize=function(e,n){for(var r=0,i=0;i<n.length;i++)r+=n[i]*e[1+(i<<1)];return r},h.F._codeTiny=function(e,n,r,i){for(var o=0;o<e.length;o+=2){var s=e[o],l=e[o+1];i=h.F._writeLit(s,n,r,i);var a=16==s?2:17==s?3:7;s>15&&(h.F._putsE(r,i,l,a),i+=a)}return i},h.F._lenCodes=function(e,n){for(var r=e.length;2!=r&&0==e[r-1];)r-=2;for(var i=0;i<r;i+=2){var o=e[i+1],s=i+3<r?e[i+3]:-1,l=i+5<r?e[i+5]:-1,a=0==i?-1:e[i-1];if(0==o&&s==o&&l==o){for(var h=i+5;h+2<r&&e[h+2]==o;)h+=2;(c=Math.min(h+1-i>>>1,138))<11?n.push(17,c-3):n.push(18,c-11),i+=2*c-2}else if(o==a&&s==o&&l==o){for(h=i+5;h+2<r&&e[h+2]==o;)h+=2;var c=Math.min(h+1-i>>>1,6);n.push(16,c-3),i+=2*c-2}else n.push(o,0)}return r>>>1},h.F._hufTree=function(e,n,r){var i=[],o=e.length,s=n.length,l=0;for(l=0;l<s;l+=2)n[l]=0,n[l+1]=0;for(l=0;l<o;l++)0!=e[l]&&i.push({lit:l,f:e[l]});var a=i.length,c=i.slice(0);if(0==a)return 0;if(1==a){var d=i[0].lit;return c=0==d?1:0,n[1+(d<<1)]=1,n[1+(c<<1)]=1,1}i.sort(function(e,n){return e.f-n.f});var u=i[0],p=i[1],f=0,m=1,g=2;for(i[0]={lit:-1,f:u.f+p.f,l:u,r:p,d:0};m!=a-1;)u=f!=m&&(g==a||i[f].f<i[g].f)?i[f++]:i[g++],p=f!=m&&(g==a||i[f].f<i[g].f)?i[f++]:i[g++],i[m++]={lit:-1,f:u.f+p.f,l:u,r:p};var y=h.F.setDepth(i[m-1],0);for(y>r&&(h.F.restrictDepth(c,r,y),y=r),l=0;l<a;l++)n[1+(c[l].lit<<1)]=c[l].d;return y},h.F.setDepth=function(e,n){return -1!=e.lit?(e.d=n,n):Math.max(h.F.setDepth(e.l,n+1),h.F.setDepth(e.r,n+1))},h.F.restrictDepth=function(e,n,r){var i=0,o=1<<r-n,s=0;for(e.sort(function(e,n){return n.d==e.d?e.f-n.f:n.d-e.d}),i=0;i<e.length&&e[i].d>n;i++){var l=e[i].d;e[i].d=n,s+=o-(1<<r-l)}for(s>>>=r-n;s>0;)(l=e[i].d)<n?(e[i].d++,s-=1<<n-l-1):i++;for(;i>=0;i--)e[i].d==n&&s<0&&(e[i].d--,s++);0!=s&&console.log("debt left")},h.F._goodIndex=function(e,n){var r=0;return n[16]<=e&&(r|=16),n[8|r]<=e&&(r|=8),n[4|r]<=e&&(r|=4),n[2|r]<=e&&(r|=2),n[1|r]<=e&&(r|=1),r},h.F._writeLit=function(e,n,r,i){return h.F._putsF(r,i,n[e<<1]),i+n[1+(e<<1)]},h.F.inflate=function(e,n){var r=Uint8Array;if(3==e[0]&&0==e[1])return n||new r(0);var i=h.F,o=i._bitsF,s=i._bitsE,l=i._decodeTiny,a=i.makeCodes,c=i.codes2map,d=i._get17,u=i.U,p=null==n;p&&(n=new r(e.length>>>2<<3));for(var f,m,g=0,y=0,w=0,v=0,b=0,k=0,A=0,x=0,C=0;0==g;)if(g=o(e,C,1),y=o(e,C+1,2),C+=3,0!=y){if(p&&(n=h.F._check(n,x+131072)),1==y&&(f=u.flmap,m=u.fdmap,k=511,A=31),2==y){w=s(e,C,5)+257,v=s(e,C+5,5)+1,b=s(e,C+10,4)+4,C+=14;for(var S=0;S<38;S+=2)u.itree[S]=0,u.itree[S+1]=0;var M=1;for(S=0;S<b;S++){var E=s(e,C+3*S,3);u.itree[1+(u.ordr[S]<<1)]=E,E>M&&(M=E)}C+=3*b,a(u.itree,M),c(u.itree,M,u.imap),f=u.lmap,m=u.dmap,C=l(u.imap,(1<<M)-1,w+v,e,C,u.ttree);var T=i._copyOut(u.ttree,0,w,u.ltree);k=(1<<T)-1;var R=i._copyOut(u.ttree,w,v,u.dtree);A=(1<<R)-1,a(u.ltree,T),c(u.ltree,T,f),a(u.dtree,R),c(u.dtree,R,m)}for(;;){var I=f[d(e,C)&k];C+=15&I;var O=I>>>4;if(O>>>8==0)n[x++]=O;else{if(256==O)break;var N=x+O-254;if(O>264){var L=u.ldef[O-257];N=x+(L>>>3)+s(e,C,7&L),C+=7&L}var H=m[d(e,C)&A];C+=15&H;var z=H>>>4,B=u.ddef[z],F=(B>>>4)+o(e,C,15&B);for(C+=15&B,p&&(n=h.F._check(n,x+131072));x<N;)n[x]=n[x++-F],n[x]=n[x++-F],n[x]=n[x++-F],n[x]=n[x++-F];x=N}}}else{0!=(7&C)&&(C+=8-(7&C));var $=4+(C>>>3),D=e[$-4]|e[$-3]<<8;p&&(n=h.F._check(n,x+D)),n.set(new r(e.buffer,e.byteOffset+$,D),x),C=$+D<<3,x+=D}return n.length==x?n:n.slice(0,x)},h.F._check=function(e,n){var r=e.length;if(n<=r)return e;var i=new Uint8Array(Math.max(r<<1,n));return i.set(e,0),i},h.F._decodeTiny=function(e,n,r,i,o,s){for(var l=h.F._bitsE,a=h.F._get17,c=0;c<r;){var d=e[a(i,o)&n];o+=15&d;var u=d>>>4;if(u<=15)s[c]=u,c++;else{var p=0,f=0;16==u?(f=3+l(i,o,2),o+=2,p=s[c-1]):17==u?(f=3+l(i,o,3),o+=3):18==u&&(f=11+l(i,o,7),o+=7);for(var m=c+f;c<m;)s[c]=p,c++}}return o},h.F._copyOut=function(e,n,r,i){for(var o=0,s=0,l=i.length>>>1;s<r;){var a=e[s+n];i[s<<1]=0,i[1+(s<<1)]=a,a>o&&(o=a),s++}for(;s<l;)i[s<<1]=0,i[1+(s<<1)]=0,s++;return o},h.F.makeCodes=function(e,n){for(var r,i,o,s,l=h.F.U,a=e.length,c=l.bl_count,d=0;d<=n;d++)c[d]=0;for(d=1;d<a;d+=2)c[e[d]]++;var u=l.next_code;for(r=0,c[0]=0,i=1;i<=n;i++)r=r+c[i-1]<<1,u[i]=r;for(o=0;o<a;o+=2)0!=(s=e[o+1])&&(e[o]=u[s],u[s]++)},h.F.codes2map=function(e,n,r){for(var i=e.length,o=h.F.U.rev15,s=0;s<i;s+=2)if(0!=e[s+1])for(var l=s>>1,a=e[s+1],c=l<<4|a,d=n-a,u=e[s]<<d,p=u+(1<<d);u!=p;)r[o[u]>>>15-n]=c,u++},h.F.revCodes=function(e,n){for(var r=h.F.U.rev15,i=15-n,o=0;o<e.length;o+=2){var s=e[o]<<n-e[o+1];e[o]=r[s]>>>i}},h.F._putsE=function(e,n,r){r<<=7&n;var i=n>>>3;e[i]|=r,e[i+1]|=r>>>8},h.F._putsF=function(e,n,r){r<<=7&n;var i=n>>>3;e[i]|=r,e[i+1]|=r>>>8,e[i+2]|=r>>>16},h.F._bitsE=function(e,n,r){return(e[n>>>3]|e[1+(n>>>3)]<<8)>>>(7&n)&(1<<r)-1},h.F._bitsF=function(e,n,r){return(e[n>>>3]|e[1+(n>>>3)]<<8|e[2+(n>>>3)]<<16)>>>(7&n)&(1<<r)-1},h.F._get17=function(e,n){return(e[n>>>3]|e[1+(n>>>3)]<<8|e[2+(n>>>3)]<<16)>>>(7&n)},h.F._get25=function(e,n){return(e[n>>>3]|e[1+(n>>>3)]<<8|e[2+(n>>>3)]<<16|e[3+(n>>>3)]<<24)>>>(7&n)},h.F.U=(l=Uint16Array,a=Uint32Array,{next_code:new l(16),bl_count:new l(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new l(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new a(32),flmap:new l(512),fltree:[],fdmap:new l(32),fdtree:[],lmap:new l(32768),ltree:[],ttree:[],dmap:new l(32768),dtree:[],imap:new l(512),itree:[],rev15:new l(32768),lhst:new a(286),dhst:new a(30),ihst:new a(19),lits:new a(15e3),strt:new l(65536),prev:new l(32768)}),function(){for(var e=h.F.U,n=0;n<32768;n++){var r=n;r=(4278255360&(r=(4042322160&(r=(3435973836&(r=(2863311530&r)>>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8,e.rev15[n]=(r>>>16|r<<16)>>>17}function i(e,n,r){for(;0!=n--;)e.push(0,r)}for(n=0;n<32;n++)e.ldef[n]=e.of0[n]<<3|e.exb[n],e.ddef[n]=e.df0[n]<<4|e.dxb[n];i(e.fltree,144,8),i(e.fltree,112,9),i(e.fltree,24,7),i(e.fltree,8,8),h.F.makeCodes(e.fltree,9),h.F.codes2map(e.fltree,9,e.flmap),h.F.revCodes(e.fltree,9),i(e.fdtree,32,5),h.F.makeCodes(e.fdtree,5),h.F.co
13des2map(e.fdtree,5,e.fdmap),h.F.revCodes(e.fdtree,5),i(e.itree,19,0),i(e.ltree,286,0),i(e.dtree,30,0),i(e.ttree,320,0)}();var u=(c={__proto__:null,default:d},[d].forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(n){if("default"!==n&&!(n in c)){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(c,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})}),Object.freeze(c));let p=function(){var e={nextZero(e,n){for(;0!=e[n];)n++;return n},readUshort:(e,n)=>e[n]<<8|e[n+1],writeUshort(e,n,r){e[n]=r>>8&255,e[n+1]=255&r},readUint:(e,n)=>16777216*e[n]+(e[n+1]<<16|e[n+2]<<8|e[n+3]),writeUint(e,n,r){e[n]=r>>24&255,e[n+1]=r>>16&255,e[n+2]=r>>8&255,e[n+3]=255&r},readASCII(e,n,r){let i="";for(let o=0;o<r;o++)i+=String.fromCharCode(e[n+o]);return i},writeASCII(e,n,r){for(let i=0;i<r.length;i++)e[n+i]=r.charCodeAt(i)},readBytes(e,n,r){let i=[];for(let o=0;o<r;o++)i.push(e[n+o]);return i},pad:e=>e.length<2?`0${e}`:e,readUTF8(n,r,i){let o,s="";for(let o=0;o<i;o++)s+=`%${e.pad(n[r+o].toString(16))}`;try{o=decodeURIComponent(s)}catch(o){return e.readASCII(n,r,i)}return o}};function n(n,r,i,o){let l=r*i,a=Math.ceil(r*s(o)/8),h=new Uint8Array(4*l),c=new Uint32Array(h.buffer),{ctype:d}=o,{depth:u}=o,p=e.readUshort;if(6==d){let e=l<<2;if(8==u)for(var f=0;f<e;f+=4)h[f]=n[f],h[f+1]=n[f+1],h[f+2]=n[f+2],h[f+3]=n[f+3];if(16==u)for(f=0;f<e;f++)h[f]=n[f<<1]}else if(2==d){let e=o.tabs.tRNS;if(null==e){if(8==u)for(f=0;f<l;f++){var m=3*f;c[f]=-16777216|n[m+2]<<16|n[m+1]<<8|n[m]}if(16==u)for(f=0;f<l;f++)m=6*f,c[f]=-16777216|n[m+4]<<16|n[m+2]<<8|n[m]}else{var g=e[0];let r=e[1],i=e[2];if(8==u)for(f=0;f<l;f++){var y=f<<2;m=3*f,c[f]=-16777216|n[m+2]<<16|n[m+1]<<8|n[m],n[m]==g&&n[m+1]==r&&n[m+2]==i&&(h[y+3]=0)}if(16==u)for(f=0;f<l;f++)y=f<<2,m=6*f,c[f]=-16777216|n[m+4]<<16|n[m+2]<<8|n[m],p(n,m)==g&&p(n,m+2)==r&&p(n,m+4)==i&&(h[y+3]=0)}}else if(3==d){let e=o.tabs.PLTE,s=o.tabs.tRNS,c=s?s.length:0;if(1==u)for(var w,v=0;v<i;v++){var b=v*a,k=v*r;for(f=0;f<r;f++){y=k+f<<2;var A=3*(w=n[b+(f>>3)]>>7-((7&f)<<0)&1);h[y]=e[A],h[y+1]=e[A+1],h[y+2]=e[A+2],h[y+3]=w<c?s[w]:255}}if(2==u)for(v=0;v<i;v++)for(b=v*a,k=v*r,f=0;f<r;f++)y=k+f<<2,A=3*(w=n[b+(f>>2)]>>6-((3&f)<<1)&3),h[y]=e[A],h[y+1]=e[A+1],h[y+2]=e[A+2],h[y+3]=w<c?s[w]:255;if(4==u)for(v=0;v<i;v++)for(b=v*a,k=v*r,f=0;f<r;f++)y=k+f<<2,A=3*(w=n[b+(f>>1)]>>4-((1&f)<<2)&15),h[y]=e[A],h[y+1]=e[A+1],h[y+2]=e[A+2],h[y+3]=w<c?s[w]:255;if(8==u)for(f=0;f<l;f++)y=f<<2,A=3*(w=n[f]),h[y]=e[A],h[y+1]=e[A+1],h[y+2]=e[A+2],h[y+3]=w<c?s[w]:255}else if(4==d){if(8==u)for(f=0;f<l;f++){y=f<<2;var x,C=n[x=f<<1];h[y]=C,h[y+1]=C,h[y+2]=C,h[y+3]=n[x+1]}if(16==u)for(f=0;f<l;f++)y=f<<2,C=n[x=f<<2],h[y]=C,h[y+1]=C,h[y+2]=C,h[y+3]=n[x+2]}else if(0==d)for(g=o.tabs.tRNS?o.tabs.tRNS:-1,v=0;v<i;v++){let e=v*a,i=v*r;if(1==u)for(var S=0;S<r;S++){var M=(C=255*(n[e+(S>>>3)]>>>7-(7&S)&1))==255*g?0:255;c[i+S]=M<<24|C<<16|C<<8|C}else if(2==u)for(S=0;S<r;S++)M=(C=85*(n[e+(S>>>2)]>>>6-((3&S)<<1)&3))==85*g?0:255,c[i+S]=M<<24|C<<16|C<<8|C;else if(4==u)for(S=0;S<r;S++)M=(C=17*(n[e+(S>>>1)]>>>4-((1&S)<<2)&15))==17*g?0:255,c[i+S]=M<<24|C<<16|C<<8|C;else if(8==u)for(S=0;S<r;S++)M=(C=n[e+S])==g?0:255,c[i+S]=M<<24|C<<16|C<<8|C;else if(16==u)for(S=0;S<r;S++)C=n[e+(S<<1)],M=p(n,e+(S<<1))==g?0:255,c[i+S]=M<<24|C<<16|C<<8|C}return h}function r(e,n,r,a){let h=new Uint8Array((Math.ceil(r*s(e)/8)+1+e.interlace)*a);return n=e.tabs.CgBI?o(n,h):i(n,h),0==e.interlace?n=l(n,e,0,r,a):1==e.interlace&&(n=function(e,n){let r=n.width,i=n.height,o=s(n),a=o>>3,h=Math.ceil(r*o/8),c=new Uint8Array(i*h),d=0,u=[0,0,4,0,2,0,1],p=[0,4,0,2,0,1,0],f=[8,8,8,4,4,2,2],m=[8,8,4,4,2,2,1],g=0;for(;g<7;){let s=f[g],w=m[g],v=0,b=0,k=u[g];for(;k<i;)k+=s,b++;let A=p[g];for(;A<r;)A+=w,v++;let x=Math.ceil(v*o/8);l(e,n,d,v,b);let C=0,S=u[g];for(;S<i;){let n=p[g],i=d+C*x<<3;for(;n<r;){var y;if(1==o&&(y=(y=e[i>>3])>>7-(7&i)&1,c[S*h+(n>>3)]|=y<<7-((7&n)<<0)),2==o&&(y=(y=e[i>>3])>>6-(7&i)&3,c[S*h+(n>>2)]|=y<<6-((3&n)<<1)),4==o&&(y=(y=e[i>>3])>>4-(7&i)&15,c[S*h+(n>>1)]|=y<<4-((1&n)<<2)),o>=8){let r=S*h+n*a;for(let n=0;n<a;n++)c[r+n]=e[(i>>3)+n]}i+=o,n+=w}C++,S+=s}v*b!=0&&(d+=b*(1+x)),g+=1}return c}(n,e)),n}function i(e,n){return o(new Uint8Array(e.buffer,2,e.length-6),n)}var o=function(){let e={H:{}};return e.H.N=function(n,r){let i=Uint8Array,o,s,l=0,a=0,h=0,c=0,d=0,u=0,p=0,f=0,m=0;if(3==n[0]&&0==n[1])return r||new i(0);let g=e.H,y=g.b,w=g.e,v=g.R,b=g.n,k=g.A,A=g.Z,x=g.m,C=null==r;for(C&&(r=new i(n.length>>>2<<5));0==l;
13)if(l=y(n,m,1),a=y(n,m+1,2),m+=3,0!=a){if(C&&(r=e.H.W(r,f+131072)),1==a&&(o=x.J,s=x.h,u=511,p=31),2==a){h=w(n,m,5)+257,c=w(n,m+5,5)+1,d=w(n,m+10,4)+4,m+=14;let e=1;for(var S=0;S<38;S+=2)x.Q[S]=0,x.Q[S+1]=0;for(S=0;S<d;S++){let r=w(n,m+3*S,3);x.Q[1+(x.X[S]<<1)]=r,r>e&&(e=r)}m+=3*d,b(x.Q,e),k(x.Q,e,x.u),o=x.w,s=x.d,m=v(x.u,(1<<e)-1,h+c,n,m,x.v);let r=g.V(x.v,0,h,x.C);u=(1<<r)-1;let i=g.V(x.v,h,c,x.D);p=(1<<i)-1,b(x.C,r),k(x.C,r,o),b(x.D,i),k(x.D,i,s)}for(;;){let e=o[A(n,m)&u];m+=15&e;let i=e>>>4;if(i>>>8==0)r[f++]=i;else{if(256==i)break;{let e=f+i-254;if(i>264){let r=x.q[i-257];e=f+(r>>>3)+w(n,m,7&r),m+=7&r}let o=s[A(n,m)&p];m+=15&o;let l=o>>>4,a=x.c[l],h=(a>>>4)+y(n,m,15&a);for(m+=15&a;f<e;)r[f]=r[f++-h],r[f]=r[f++-h],r[f]=r[f++-h],r[f]=r[f++-h];f=e}}}}else{0!=(7&m)&&(m+=8-(7&m));let o=4+(m>>>3),s=n[o-4]|n[o-3]<<8;C&&(r=e.H.W(r,f+s)),r.set(new i(n.buffer,n.byteOffset+o,s),f),m=o+s<<3,f+=s}return r.length==f?r:r.slice(0,f)},e.H.W=function(e,n){let r=e.length;if(n<=r)return e;let i=new Uint8Array(r<<1);return i.set(e,0),i},e.H.R=function(n,r,i,o,s,l){let a=e.H.e,h=e.H.Z,c=0;for(;c<i;){let e=n[h(o,s)&r];s+=15&e;let i=e>>>4;if(i<=15)l[c]=i,c++;else{let e=0,n=0;16==i?(n=3+a(o,s,2),s+=2,e=l[c-1]):17==i?(n=3+a(o,s,3),s+=3):18==i&&(n=11+a(o,s,7),s+=7);let r=c+n;for(;c<r;)l[c]=e,c++}}return s},e.H.V=function(e,n,r,i){let o=0,s=0,l=i.length>>>1;for(;s<r;){let r=e[s+n];i[s<<1]=0,i[1+(s<<1)]=r,r>o&&(o=r),s++}for(;s<l;)i[s<<1]=0,i[1+(s<<1)]=0,s++;return o},e.H.n=function(n,r){let i,o,s,l;let a=e.H.m,h=n.length,c=a.j;for(var d=0;d<=r;d++)c[d]=0;for(d=1;d<h;d+=2)c[n[d]]++;let u=a.K;for(i=0,c[0]=0,o=1;o<=r;o++)i=i+c[o-1]<<1,u[o]=i;for(s=0;s<h;s+=2)0!=(l=n[s+1])&&(n[s]=u[l],u[l]++)},e.H.A=function(n,r,i){let o=n.length,s=e.H.m.r;for(let e=0;e<o;e+=2)if(0!=n[e+1]){let o=e>>1,l=n[e+1],a=o<<4|l,h=r-l,c=n[e]<<h,d=c+(1<<h);for(;c!=d;)i[s[c]>>>15-r]=a,c++}},e.H.l=function(n,r){let i=e.H.m.r,o=15-r;for(let e=0;e<n.length;e+=2){let s=n[e]<<r-n[e+1];n[e]=i[s]>>>o}},e.H.M=function(e,n,r){r<<=7&n;let i=n>>>3;e[i]|=r,e[i+1]|=r>>>8},e.H.I=function(e,n,r){r<<=7&n;let i=n>>>3;e[i]|=r,e[i+1]|=r>>>8,e[i+2]|=r>>>16},e.H.e=function(e,n,r){return(e[n>>>3]|e[1+(n>>>3)]<<8)>>>(7&n)&(1<<r)-1},e.H.b=function(e,n,r){return(e[n>>>3]|e[1+(n>>>3)]<<8|e[2+(n>>>3)]<<16)>>>(7&n)&(1<<r)-1},e.H.Z=function(e,n){return(e[n>>>3]|e[1+(n>>>3)]<<8|e[2+(n>>>3)]<<16)>>>(7&n)},e.H.i=function(e,n){return(e[n>>>3]|e[1+(n>>>3)]<<8|e[2+(n>>>3)]<<16|e[3+(n>>>3)]<<24)>>>(7&n)},e.H.m=function(){let e=Uint16Array,n=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new n(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new n(286),Y:new n(30),a:new n(19),t:new n(15e3),k:new e(65536),g:new e(32768)}}(),function(){let n=e.H.m;for(var r=0;r<32768;r++){let e=r;e=(4278255360&(e=(4042322160&(e=(3435973836&(e=(2863311530&e)>>>1|(1431655765&e)<<1))>>>2|(858993459&e)<<2))>>>4|(252645135&e)<<4))>>>8|(16711935&e)<<8,n.r[r]=(e>>>16|e<<16)>>>17}function i(e,n,r){for(;0!=n--;)e.push(0,r)}for(r=0;r<32;r++)n.q[r]=n.S[r]<<3|n.T[r],n.c[r]=n.p[r]<<4|n.z[r];i(n._,144,8),i(n._,112,9),i(n._,24,7),i(n._,8,8),e.H.n(n._,9),e.H.A(n._,9,n.J),e.H.l(n._,9),i(n.$,32,5),e.H.n(n.$,5),e.H.A(n.$,5,n.h),e.H.l(n.$,5),i(n.Q,19,0),i(n.C,286,0),i(n.D,30,0),i(n.v,320,0)}(),e.H.N}();function s(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth}function l(e,n,r,i,o){let l,h,c=s(n),d=Math.ceil(i*c/8);c=Math.ceil(c/8);let u=e[r],p=0;if(u>1&&(e[r]=[0,0,1][u-2]),3==u)for(p=c;p<d;p++)e[p+1]=e[p+1]+(e[p+1-c]>>>1)&255;for(let n=0;n<o;n++)if(u=e[(h=(l=r+n*d)+n+1)-1],p=0,0==u)for(;p<d;p++)e[l+p]=e[h+p];else if(1==u){for(;p<c;p++)e[l+p]=e[h+p];for(;p<d;p++)e[l+p]=e[h+p]+e[l+p-c]}else if(2==u)for(;p<d;p++)e[l+p]=e[h+p]+e[l+p-d];else if(3==u){for(;p<c;p++)e[l+p]=e[h+p]+(e[l+p-d]>>>1);for(;p<d;p++)e[l+p]=e[h+p]+(e[l+p-d]+e[l+p-c]>>>1)}else{for(;p<c;p++)e[l+p]=e[h+p]+a(0,e[l+p-d],0);for(;p<d;p++)e[l+p]=e[h+p]+a(e[l+p-c],e[l+p-d],e[l+p-c-d])}return e}function a(e,n,r){let i=e+n-r,o=i-e,s=i-n,l=i-r;return o*o<=s*s&&o*o<=l*l?e:s*s<=l*l?n:r}function h(e,n,r,i,o,s,l,a,h){let c=Math.min(n,o),d=Math.min(r,s),u=0,p=0;for(let r=0;r<d;r++)for(let s=0;s<c;s++)if(l>=0&&a>=0?(u=r*n+s<<2,p=(a+r)*o+l+s<<2):(u=(-a+r)*n-l+s<<2,p=r*o+s<<2),0==h)i[p]=e[u],i[p+1]=e[u+1],i[p+2]=e[u+2],i[p+3]=e[u+3];else if(1==h){var f=e[u+3]*(1/255),m=e[u]*f,g=e[u+1]*f,y=e[u+2]*f,w=i[p+3]*(1/255),v=i[p]*w,b=i[p+1]*w,k=i[p+2]*w;let n=1-f,r=f+w*n,o=0==r?0:1/r;i[p+3]=255*r,i[p+0]=(m+v*n)*o,i[p+1]=(g+b*n)*o,i[p+2]=(y+k*n)*o}else if(2==h)f=e[u+3],m=e[u],g=e[u+1],y=e[u+2],w=i[p+3],v=i[p],b=i[p+1],k=i[p+2],f==w&&m==v&&g==b&&y==k?(i[p]=0,i[p+1]=0,i[p+2]=0,i[p+3]=0):(i[p]=m,i[p+1]=g,i[p+2]=y,i[p+3]=f);else if(3==h){if(f=e[u+3],m=e[u],g=e[u+1],y=e[u+2],w=i[p+3],v=i[p],b=i[p+1],k=i[p+2],f==w&&m==v&&g==b&&y==k)continue;if(f<220&&w>20)return!1}return!0}return{decode:function(n){let s=new Uint8Array(n),l=8,a=e.readUshort,h=e.readUint,c={tabs:{},frames:[]},d=new Uint8Array(s.length),u,p=0,f=0,m=[137,80,78,71,13,10,26,10];for(var g,y=0;y<8;y++)if(s[y]!=m[y])throw"The input is not a PNG file!";for(;
13l<s.length;){let n=e.readUint(s,l);l+=4;let m=e.readASCII(s,l,4);if(l+=4,"IHDR"==m)w=l,c.width=e.readUint(s,w),w+=4,c.height=e.readUint(s,w),w+=4,c.depth=s[w],w++,c.ctype=s[w],w++,c.compress=s[w],w++,c.filter=s[w],w++,c.interlace=s[w],w++;else if("iCCP"==m){for(var w,v,b=l;0!=s[b];)b++;e.readASCII(s,l,b-l),s[b+1];let r=s.slice(b+2,l+n),a=null;try{a=i(r)}catch(e){a=o(r)}c.tabs[m]=a}else if("CgBI"==m)c.tabs[m]=s.slice(l,l+4);else if("IDAT"==m){for(y=0;y<n;y++)d[p+y]=s[l+y];p+=n}else if("acTL"==m)c.tabs[m]={num_frames:h(s,l),num_plays:h(s,l+4)},u=new Uint8Array(s.length);else if("fcTL"==m){0!=f&&((g=c.frames[c.frames.length-1]).data=r(c,u.slice(0,f),g.rect.width,g.rect.height),f=0);let e={x:h(s,l+12),y:h(s,l+16),width:h(s,l+4),height:h(s,l+8)},n=a(s,l+22),i={rect:e,delay:Math.round(1e3*(n=a(s,l+20)/(0==n?100:n))),dispose:s[l+24],blend:s[l+25]};c.frames.push(i)}else if("fdAT"==m){for(y=0;y<n-4;y++)u[f+y]=s[l+y+4];f+=n-4}else if("pHYs"==m)c.tabs[m]=[e.readUint(s,l),e.readUint(s,l+4),s[l+8]];else if("cHRM"==m)for(y=0,c.tabs[m]=[];y<8;y++)c.tabs[m].push(e.readUint(s,l+4*y));else if("tEXt"==m||"zTXt"==m){null==c.tabs[m]&&(c.tabs[m]={});var k=e.nextZero(s,l),A=e.readASCII(s,l,k-l),x=l+n-k-1;
13if("tEXt"==m)v=e.readASCII(s,k+1,x);else{var C=i(s.slice(k+2,k+2+x));v=e.readUTF8(C,0,C.length)}c.tabs[m][A]=v}else if("iTXt"==m){null==c.tabs[m]&&(c.tabs[m]={}),k=0,b=l,k=e.nextZero(s,b),A=e.readASCII(s,b,k-b);let r=s[b=k+1];s[b+1],b+=2,k=e.nextZero(s,b),e.readASCII(s,b,k-b),b=k+1,k=e.nextZero(s,b),e.readUTF8(s,b,k-b),x=n-((b=k+1)-l),0==r?v=e.readUTF8(s,b,x):(C=i(s.slice(b,b+x)),v=e.readUTF8(C,0,C.length)),c.tabs[m][A]=v}else if("PLTE"==m)c.tabs[m]=e.readBytes(s,l,n);else if("hIST"==m){let e=c.tabs.PLTE.length/3;for(y=0,c.tabs[m]=[];y<e;y++)c.tabs[m].push(a(s,l+2*y))}else if("tRNS"==m)3==c.ctype?c.tabs[m]=e.readBytes(s,l,n):0==c.ctype?c.tabs[m]=a(s,l):2==c.ctype&&(c.tabs[m]=[a(s,l),a(s,l+2),a(s,l+4)]);else if("gAMA"==m)c.tabs[m]=e.readUint(s,l)/1e5;else if("sRGB"==m)c.tabs[m]=s[l];else if("bKGD"==m)0==c.ctype||4==c.ctype?c.tabs[m]=[a(s,l)]:2==c.ctype||6==c.ctype?c.tabs[m]=[a(s,l),a(s,l+2),a(s,l+4)]:3==c.ctype&&(c.tabs[m]=s[l]);else if("IEND"==m)break;l+=n,e.readUint(s,l),l+=4}return 0!=f&&((g=c.frames[c.frames.length-1]).data=r(c,u.slice(0,f),g.rect.width,g.rect.height)),c.data=r(c,d,c.width,c.height),delete c.compress,delete c.interlace,delete c.filter,c},toRGBA8:function(e){let r=e.width,i=e.height;if(null==e.tabs.acTL)return[n(e.data,r,i,e).buffer];let o=[];null==e.frames[0].data&&(e.frames[0].data=e.data);let s=r*i*4,l=new Uint8Array(s),a=new Uint8Array(s),c=new Uint8Array(s);for(let u=0;u<e.frames.length;u++){let p=e.frames[u],f=p.rect.x,m=p.rect.y,g=p.rect.width,y=p.rect.height,w=n(p.data,g,y,e);if(0!=u)for(var d=0;d<s;d++)c[d]=l[d];if(0==p.blend?h(w,g,y,l,r,i,f,m,0):1==p.blend&&h(w,g,y,l,r,i,f,m,1),o.push(l.buffer.slice(0)),0==p.dispose);else if(1==p.dispose)h(a,g,y,l,r,i,f,m,0);else if(2==p.dispose)for(d=0;d<s;d++)l[d]=c[d]}return o},_paeth:a,_copyTile:h,_bin:e}}();!function(){let{_copyTile:e}=p,{_bin:n}=p,r=p._paeth;var i={table:function(){let e=new Uint32Array(256);for(let n=0;n<256;n++){let r=n;for(let e=0;e<8;e++)1&r?r=3988292384^r>>>1:r>>>=1;e[n]=r}return e}(),update(e,n,r,o){for(let s=0;s<o;s++)e=i.table[255&(e^n[r+s])]^e>>>8;return e},crc:(e,n,r)=>4294967295^i.update(4294967295,e,n,r)};function o(e,n,r,i){n[r]+=e[0]*i>>4,n[r+1]+=e[1]*i>>4,n[r+2]+=e[2]*i>>4,n[r+3]+=e[3]*i>>4}function s(e){return Math.max(0,Math.min(255,e))}function l(e,n){let r=e[0]-n[0],i=e[1]-n[1],o=e[2]-n[2],s=e[3]-n[3];return r*r+i*i+o*o+s*s}function a(e,n,r,i,a,h,c){null==c&&(c=1);let d=i.length,u=[];for(var p,f=0;f<d;f++){let e=i[f];u.push([e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255])}for(f=0;f<d;f++){let e=4294967295;for(var m=0,g=0;g<d;g++){var y=l(u[f],u[g]);g!=f&&y<e&&(e=y,m=g)}}let w=new Uint32Array(a.buffer),v=new Int16Array(n*r*4),b=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(f=0;f<b.length;f++)b[f]=255*((b[f]+.5)/16-.5);for(let a=0;a<r;a++)for(let k=0;k<n;k++){f=4*(a*n+k),2!=c?p=[s(e[f]+v[f]),s(e[f+1]+v[f+1]),s(e[f+2]+v[f+2]),s(e[f+3]+v[f+3])]:(y=b[4*(3&a)+(3&k)],p=[s(e[f]+y),s(e[f+1]+y),s(e[f+2]+y),s(e[f+3]+y)]),m=0;let A=16777215;for(g=0;g<d;g++){let e=l(p,u[g]);e<A&&(A=e,m=g)}let x=u[m],C=[p[0]-x[0],p[1]-x[1],p[2]-x[2],p[3]-x[3]];1==c&&(k!=n-1&&o(C,v,f+4,7),a!=r-1&&(0!=k&&o(C,v,f+4*n-4,3),o(C,v,f+4*n,5),k!=n-1&&o(C,v,f+4*n+4,1))),h[f>>2]=m,w[f>>2]=i[m]}}function h(e,r,o,s,l){null==l&&(l={});let{crc:a}=i,h=n.writeUint,c=n.writeUshort,d=n.writeASCII,u=8,p=e.frames.length>1,f,m=!1,g=33+(p?20:0);if(null!=l.sRGB&&(g+=13),null!=l.pHYs&&(g+=21),null!=l.iCCP&&(g+=21+(f=pako.deflate(l.iCCP)).length+4),3==e.ctype){for(var y=e.plte.length,w=0;w<y;w++)e.plte[w]>>>24!=255&&(m=!0);g+=8+3*y+4+(m?8+1*y+4:0)}for(var v=0;v<e.frames.length;v++)p&&(g+=38),g+=(x=e.frames[v]).cimg.length+12,0!=v&&(g+=4);let b=new Uint8Array(g+=12),k=[137,80,78,71,13,10,26,10];for(w=0;w<8;w++)b[w]=k[w];if(h(b,u,13),d(b,u+=4,"IHDR"),h(b,u+=4,r),h(b,u+=4,o),b[u+=4]=e.depth,b[++u]=e.ctype,b[++u]=0,b[++u]=0,b[++u]=0,h(b,++u,a(b,u-17,17)),u+=4,null!=l.sRGB&&(h(b,u,1),d(b,u+=4,"sRGB"),b[u+=4]=l.sRGB,h(b,++u,a(b,u-5,5)),u+=4),null!=l.iCCP){let e=13+f.length;h(b,u,e),d(b,u+=4,"iCCP"),d(b,u+=4,"ICC profile"),u+=13,b.set(f,u),h(b,u+=f.length,a(b,u-(e+4),e+4)),u+=4}if(null!=l.pHYs&&(h(b,u,9),d(b,u+=4,"pHYs"),h(b,u+=4,l.pHYs[0]),h(b,u+=4,l.pHYs[1]),b[u+=4]=l.pHYs[2],h(b,++u,a(b,u-13,13)),u+=4),p&&(h(b,u,8),d(b,u+=4,"acTL"),h(b,u+=4,e.frames.length),h(b,u+=4,null!=l.loop?l.loop:0),h(b,u+=4,a(b,u-12,12)),u+=4),3==e.ctype){for(h(b,u,3*(y=e.plte.length)),d(b,u+=4,"PLTE"),u+=4,w=0;w<y;w++){let n=3*w,r=e.plte[w],i=255&r,o=r>>>8&255,s=r>>>16&255;b[u+n+0]=i,b[u+n+1]=o,b[u+n+2]=s}if(h(b,u+=3*y,a(b,u-3*y-4,3*y+4)),u+=4,m){for(h(b,u,y),d(b,u+=4,"tRNS"),u+=4,w=0;w<y;w++)b[u+w]=e.plte[w]>>>24&255;h(b,u+=y,a(b,u-y-4,y+4)),u+=4}}let A=0;for(v=0;v<e.frames.length;v++){var x=e.frames[v];p&&(h(b,u,26),d(b,u+=4,"fcTL"),h(b,u+=4,A++),h(b,u+=4,x.rect.width),h(b,u+=4,x.rect.height),h(b,u+=4,x.rect.x),h(b,u+=4,x.rect.y),c(b,u+=4,s[v]),c(b,u+=2,1e3),b[u+=2]=x.dispose,b[++u]=x.blend,h(b,++u,a(b,u-30,30)),u+=4);let n=x.cimg;h(b,u,(y=n.length)+(0==v?0:4));let r=u+=4;d(b,u,0==v?"IDAT":"fdAT"),u+=4,0!=v&&(h(b,u,A++),u+=4),b.set(n,u),h(b,u+=y,a(b,r,u-r)),u+=4}return h(b,u,0),d(b,u+=4,"IEND"),h(b,u+=4,a(b,u-4,4)),u+=4,b.buffer}function c(e,n,i){for(let o=0;o<e.frames.length;o++){let s=e.frames[o];s.rect.width;let l=s.rect.height,a=new Uint8Array(l*s.bpl+l);s.cimg=function(e,n,i,o,s,l,a){let h=[],c,d=[0,1,2,3,4];-1!=l?d=[l]:(n*o>5e5||1==i)&&(d=[0]),a&&(c={level:0});for(var p=0;p<d.length;p++){for(let l=0;l<n;l++)!function(e,n,i,o,s,l){let a=i*o,h=a+i;if(e[h]=l,h++,0==l){if(o<500)for(var c=0;c<o;c++)e[h+c]=n[a+c];else e.set(new Uint8Array(n.buffer,a,o),h)}else if(1==l){for(c=0;c<s;c++)e[h+c]=n[a+c];for(c=s;c<o;c++)e[h+c]=n[a+c]-n[a+c-s]+256&255}else if(0==i){for(c=0;c<s;c++)e[h+c]=n[a+c];if(2==l)for(c=s;c<o;c++)e[h+c]=n[a+c];if(3==l)for(c=s;c<o;c++)e[h+c]=n[a+c]-(n[a+c-s]>>1)+256&255;if(4==l)for(c=s;c<o;c++)e[h+c]=n[a+c]-r(n[a+c-s],0,0)+256&255}else{if(2==l)for(c=0;c<o;c++)e[h+c]=n[a+c]+256-n[a+c-o]&255;if(3==l){for(c=0;c<s;c++)e[h+c]=n[a+c]+256-(n[a+c-o]>>1)&255;for(c=s;c<o;c++)e[h+c]=n[a+c]+256-(n[a+c-o]+n[a+c-s]>>1)&255}if(4==l){for(c=0;c<s;
13c++)e[h+c]=n[a+c]+256-r(0,n[a+c-o],0)&255;for(c=s;c<o;c++)e[h+c]=n[a+c]+256-r(n[a+c-s],n[a+c-o],n[a+c-s-o])&255}}}(s,e,l,o,i,d[p]);h.push(u.deflate(s,c))}let f,m=1e9;for(p=0;p<h.length;p++)h[p].length<m&&(f=p,m=h[p].length);return h[f]}(s.img,l,s.bpp,s.bpl,a,n,i)}}function d(n,r,i,o,s){let l=s[0],h=s[1],c=s[2],d=s[3],u=s[4],p=s[5],y=6,w=8,v=255;for(var b=0;b<n.length;b++){let e=new Uint8Array(n[b]);for(var k=e.length,A=0;A<k;A+=4)v&=e[A+3]}let x=255!=v,C=function(n,r,i,o,s,l){let a=[];for(var h,c=0;c<n.length;c++){let h=new Uint8Array(n[c]),f=new Uint32Array(h.buffer),g=0,y=0,w=r,v=i,b=o?1:0;if(0!=c){let k=l||o||1==c||0!=a[c-2].dispose?1:2,A=0,x=1e9;for(let e=0;e<k;e++){var d,u=new Uint8Array(n[c-1-e]);let o=new Uint32Array(n[c-1-e]),l=r,a=i,h=-1,m=-1;for(let e=0;e<i;e++)for(let n=0;n<r;n++)f[p=e*r+n]!=o[p]&&(n<l&&(l=n),n>h&&(h=n),e<a&&(a=e),e>m&&(m=e));-1==h&&(l=a=h=m=0),s&&(1==(1&l)&&l--,1==(1&a)&&a--);let b=(h-l+1)*(m-a+1);b<x&&(x=b,A=e,g=l,y=a,w=h-l+1,v=m-a+1)}u=new Uint8Array(n[c-1-A]),1==A&&(a[c-1].dispose=2),e(u,r,i,d=new Uint8Array(w*v*4),w,v,-g,-y,0),1==(b=e(h,r,i,d,w,v,-g,-y,3)?1:0)?m(h,r,i,d,{x:g,y:y,width:w,height:v}):e(h,r,i,d,w,v,-g,-y,0)}else d=h.slice(0);a.push({rect:{x:g,y:y,width:w,height:v},img:d,blend:b,dispose:0})}if(o)for(c=0;c<a.length;c++){if(1==(h=a[c]).blend)continue;let e=h.rect,o=a[c-1].rect,l=Math.min(e.x,o.x),d=Math.min(e.y,o.y),u={x:l,y:d,width:Math.max(e.x+e.width,o.x+o.width)-l,height:Math.max(e.y+e.height,o.y+o.height)-d};a[c-1].dispose=1,c-1!=0&&f(n,r,i,a,c-1,u,s),f(n,r,i,a,c,u,s)}if(1!=n.length)for(var p=0;p<a.length;p++)(h=a[p]).rect.width,h.rect.height;return a}(n,r,i,l,h,c),S={},M=[],E=[];if(0!=o){let e=[];for(A=0;A<C.length;A++)e.push(C[A].img.buffer);let n=g(function(e){let n=0;for(var r=0;r<e.length;r++)n+=e[r].byteLength;let i=new Uint8Array(n),o=0;for(r=0;r<e.length;r++){let n=new Uint8Array(e[r]),s=n.length;for(let e=0;e<s;e+=4){let r=n[e],s=n[e+1],l=n[e+2],a=n[e+3];0==a&&(r=s=l=0),i[o+e]=r,i[o+e+1]=s,i[o+e+2]=l,i[o+e+3]=a}o+=s}return i.buffer}(e),o);for(A=0;A<n.plte.length;A++)M.push(n.plte[A].est.rgba);let r=0;for(A=0;A<C.length;A++){let e=(R=C[A]).img.length;var T=new Uint8Array(n.inds.buffer,r>>2,e>>2);E.push(T);let i=new Uint8Array(n.abuf,r,e);p&&a(R.img,R.rect.width,R.rect.height,M,i,T),R.img.set(i),r+=e}}else for(b=0;b<C.length;b++){var R=C[b];let e=new Uint32Array(R.img.buffer);var I=R.rect.width;for(T=new Uint8Array(k=e.length),E.push(T),A=0;A<k;A++){let n=e[A];if(0!=A&&n==e[A-1])T[A]=T[A-1];else if(A>I&&n==e[A-I])T[A]=T[A-I];else{let e=S[n];if(null==e&&(S[n]=e=M.length,M.push(n),M.length>=300))break;T[A]=e}}}let O=M.length;for(O<=256&&0==u&&(w=Math.max(w=O<=2?1:O<=4?2:O<=16?4:8,d)),b=0;b<C.length;b++){(R=C[b]).rect.x,R.rect.y,I=R.rect.width;let e=R.rect.height,n=R.img;new Uint32Array(n.buffer);let r=4*I,i=4;if(O<=256&&0==u){var N=new Uint8Array((r=Math.ceil(w*I/8))*e);let o=E[b];for(let n=0;n<e;n++){A=n*r;let e=n*I;if(8==w)for(var L=0;L<I;L++)N[A+L]=o[e+L];else if(4==w)for(L=0;L<I;L++)N[A+(L>>1)]|=o[e+L]<<4-4*(1&L);else if(2==w)for(L=0;L<I;L++)N[A+(L>>2)]|=o[e+L]<<6-2*(3&L);else if(1==w)for(L=0;L<I;L++)N[A+(L>>3)]|=o[e+L]<<7-1*(7&L)}n=N,y=3,i=1}else if(0==x&&1==C.length){N=new Uint8Array(I*e*3);let o=I*e;for(A=0;A<o;A++){let e=3*A,r=4*A;N[e]=n[r],N[e+1]=n[r+1],N[e+2]=n[r+2]}n=N,y=2,i=3,r=3*I}R.img=n,R.bpl=r,R.bpp=i}return{ctype:y,depth:w,plte:M,frames:C}}function f(n,r,i,o,s,l,a){let h=Uint8Array,c=Uint32Array,d=new h(n[s-1]),u=new c(n[s-1]),p=s+1<n.length?new h(n[s+1]):null,f=new h(n[s]),g=new c(f.buffer),y=r,w=i,v=-1,b=-1;for(let e=0;e<l.height;e++)for(let n=0;n<l.width;n++){let i=l.x+n,a=l.y+e,h=a*r+i,c=g[h];0==c||0==o[s-1].dispose&&u[h]==c&&(null==p||0!=p[4*h+3])||(i<y&&(y=i),i>v&&(v=i),a<w&&(w=a),a>b&&(b=a))}-1==v&&(y=w=v=b=0),a&&(1==(1&y)&&y--,1==(1&w)&&w--),l={x:y,y:w,width:v-y+1,height:b-w+1};let k=o[s];k.rect=l,k.blend=1,k.img=new Uint8Array(l.width*l.height*4),0==o[s-1].dispose?(e(d,r,i,k.img,l.width,l.height,-l.x,-l.y,0),m(f,r,i,k.img,l)):e(f,r,i,k.img,l.width,l.height,-l.x,-l.y,0)}function m(n,r,i,o,s){e(n,r,i,o,s.width,s.height,-s.x,-s.y,2)}function g(e,n){let r;let i=new Uint8Array(e),o=i.slice(0),s=new Uint32Array(o.buffer),l=y(o,n),a=l[0],h=l[1],c=i.length,d=new Uint8Array(c>>2);if(i.length<2e7)for(var u=0;u<c;u+=4)r=w(a,p=i[u]*(1/255),f=i[u+1]*(1/255),m=i[u+2]*(1/255),g=i[u+3]*(1/255)),d[u>>2]=r.ind,s[u>>2]=r.est.rgba;else for(u=0;
13u<c;u+=4){var p=i[u]*(1/255),f=i[u+1]*(1/255),m=i[u+2]*(1/255),g=i[u+3]*(1/255);for(r=a;r.left;)r=0>=v(r.est,p,f,m,g)?r.left:r.right;d[u>>2]=r.ind,s[u>>2]=r.est.rgba}return{abuf:o.buffer,inds:d,plte:h}}function y(e,n,r){null==r&&(r=1e-4);let i=new Uint32Array(e.buffer),o={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};o.bst=k(e,o.i0,o.i1),o.est=A(o.bst);let s=[o];for(;s.length<n;){let n=0,o=0;for(var l=0;l<s.length;l++)s[l].est.L>n&&(n=s[l].est.L,o=l);if(n<r)break;let a=s[o],h=function(e,n,r,i,o,s){for(i-=4;r<i;){for(;b(e,r,o)<=s;)r+=4;for(;b(e,i,o)>s;)i-=4;if(r>=i)break;let l=n[r>>2];n[r>>2]=n[i>>2],n[i>>2]=l,r+=4,i-=4}for(;b(e,r,o)>s;)r-=4;return r+4}(e,i,a.i0,a.i1,a.est.e,a.est.eMq255);if(a.i0>=h||a.i1<=h){a.est.L=0;continue}let c={i0:a.i0,i1:h,bst:null,est:null,tdst:0,left:null,right:null};c.bst=k(e,c.i0,c.i1),c.est=A(c.bst);let d={i0:h,i1:a.i1,bst:null,est:null,tdst:0,left:null,right:null};for(l=0,d.bst={R:[],m:[],N:a.bst.N-c.bst.N};l<16;l++)d.bst.R[l]=a.bst.R[l]-c.bst.R[l];for(l=0;l<4;l++)d.bst.m[l]=a.bst.m[l]-c.bst.m[l];d.est=A(d.bst),a.left=c,a.right=d,s[o]=c,s.push(d)}for(s.sort((e,n)=>n.bst.N-e.bst.N),l=0;l<s.length;l++)s[l].ind=l;return[o,s]}function w(e,n,r,i,o){if(null==e.left)return e.tdst=function(e,n,r,i,o){let s=n-e[0],l=r-e[1],a=i-e[2],h=o-e[3];return s*s+l*l+a*a+h*h}(e.est.q,n,r,i,o),e;let s=v(e.est,n,r,i,o),l=e.left,a=e.right;s>0&&(l=e.right,a=e.left);let h=w(l,n,r,i,o);if(h.tdst<=s*s)return h;let c=w(a,n,r,i,o);return c.tdst<h.tdst?c:h}function v(e,n,r,i,o){let{e:s}=e;return s[0]*n+s[1]*r+s[2]*i+s[3]*o-e.eMq}function b(e,n,r){return e[n]*r[0]+e[n+1]*r[1]+e[n+2]*r[2]+e[n+3]*r[3]}function k(e,n,r){let i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=[0,0,0,0];for(let s=n;s<r;s+=4){let n=e[s]*(1/255),r=e[s+1]*(1/255),l=e[s+2]*(1/255),a=e[s+3]*(1/255);o[0]+=n,o[1]+=r,o[2]+=l,o[3]+=a,i[0]+=n*n,i[1]+=n*r,i[2]+=n*l,i[3]+=n*a,i[5]+=r*r,i[6]+=r*l,i[7]+=r*a,i[10]+=l*l,i[11]+=l*a,i[15]+=a*a}return i[4]=i[1],i[8]=i[2],i[9]=i[6],i[12]=i[3],i[13]=i[7],i[14]=i[11],{R:i,m:o,N:r-n>>2}}function A(e){let{R:n}=e,{m:r}=e,{N:i}=e,o=r[0],s=r[1],l=r[2],a=r[3],h=0==i?0:1/i,c=[n[0]-o*o*h,n[1]-o*s*h,n[2]-o*l*h,n[3]-o*a*h,n[4]-s*o*h,n[5]-s*s*h,n[6]-s*l*h,n[7]-s*a*h,n[8]-l*o*h,n[9]-l*s*h,n[10]-l*l*h,n[11]-l*a*h,n[12]-a*o*h,n[13]-a*s*h,n[14]-a*l*h,n[15]-a*a*h],d=[Math.random(),Math.random(),Math.random(),Math.random()],u=0,p=0;if(0!=i)for(let e=0;e<16&&(d=x.multVec(c,d),p=Math.sqrt(x.dot(d,d)),d=x.sml(1/p,d),!(0!=e&&1e-9>Math.abs(p-u)));e++)u=p;let f=[o*h,s*h,l*h,a*h];return{Cov:c,q:f,e:d,L:u,eMq255:x.dot(x.sml(255,f),d),eMq:x.dot(d,f),rgba:(Math.round(255*f[3])<<24|Math.round(255*f[2])<<16|Math.round(255*f[1])<<8|Math.round(255*f[0])<<0)>>>0}}var x={multVec:(e,n)=>[e[0]*n[0]+e[1]*n[1]+e[2]*n[2]+e[3]*n[3],e[4]*n[0]+e[5]*n[1]+e[6]*n[2]+e[7]*n[3],e[8]*n[0]+e[9]*n[1]+e[10]*n[2]+e[11]*n[3],e[12]*n[0]+e[13]*n[1]+e[14]*n[2]+e[15]*n[3]],dot:(e,n)=>e[0]*n[0]+e[1]*n[1]+e[2]*n[2]+e[3]*n[3],sml:(e,n)=>[e*n[0],e*n[1],e*n[2],e*n[3]]};p.encode=function(e,n,r,i,o,s,l){null==i&&(i=0),null==l&&(l=!1);let a=d(e,n,r,i,[!1,!1,!1,0,l,!1]);return c(a,-1),h(a,n,r,o,s)},p.encodeLL=function(e,n,r,i,o,s,l,a){let d={ctype:0+(1==i?0:2)+(0==o?0:4),depth:s,frames:[]},u=(i+o)*s,p=u*n;for(let i=0;i<e.length;i++)d.frames.push({rect:{x:0,y:0,width:n,height:r},img:new Uint8Array(e[i]),blend:0,dispose:1,bpp:Math.ceil(u/8),bpl:Math.ceil(p/8)});return c(d,0,!0),h(d,n,r,l,a)},p.encode.compress=d,p.encode.dither=a,p.quantize=g,p.quantize.getKDtree=y,p.quantize.getNearest=w}();let f={toArrayBuffer(e,n){let r=e.width,i=e.height,o=r<<2,s=new Uint32Array(e.getContext("2d").getImageData(0,0,r,i).data.buffer),l=(32*r+31)/32<<2,a=l*i,h=122+a,c=new ArrayBuffer(h),d=new DataView(c),u,p,m,g,y=1048576,w=0,v=0,b=0;function k(e){d.setUint16(v,e,!0),v+=2}function A(e){d.setUint32(v,e,!0),v+=4}k(19778),A(h),v+=4,A(122),A(108),A(r),A(-i>>>0),k(1),k(32),A(3),A(a),A(2835),A(2835),v+=8,A(16711680),A(65280),A(255),A(4278190080),A(1466527264),function e(){for(;w<i&&y>0;){for(g=122+w*l,u=0;u<o;)y--,m=(p=s[b++])>>>24,d.setUint32(g+u,p<<8|m),u+=4;w++}b<s.length?(y=1048576,setTimeout(e,f._dly)):n(c)}()},toBlob(e,n){this.toArrayBuffer(e,e=>{n(new Blob([e],{type:"image/bmp"}))})},_dly:9};var m={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},g={[m.CHROME]:16384,[m.FIREFOX]:11180,[m.DESKTOP_SAFARI]:16384,[m.IE]:8192,[m.IOS]:4096,[m.ETC]:8192};let y="undefined"!=typeof window,w="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,v=y&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),b=(y||w)&&(v&&v.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),k=(y||w)&&(v&&v.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function A(e,n,r=Date.now()){return new Promise(i=>{let o=e.split(","),s=o[0].match(/:(.*?);/)[1],l=globalThis.atob(o[1]),a=l.length,h=new Uint8Array(a);for(;a--;)h[a]=l.charCodeAt(a);let c=new Blob([h],{type:s});c.name=n,c.lastModified=r,i(c)})}function x(e){return new Promise((n,r)=>{let i=new k;i.onload=()=>n(i.result),i.onerror=e=>r(e),i.readAsDataURL(e)})}function C(e){return new Promise((n,r)=>{let i=new Image;i.onload=()=>n(i),i.onerror=e=>r(e),i.src=e})}function S(){if(void 0!==S.cachedResult)return S.cachedResult;let e=m.ETC,{userAgent:n}=navigator;return/Chrom(e|ium)/i.test(n)?e=m.CHROME:/iP(ad|od|hone)/i.test(n)&&/WebKit/i.test(n)?e=m.IOS:/Safari/i.test(n)?e=m.DESKTOP_SAFARI:/Firefox/i.test(n)?e=m.FIREFOX:(/MSIE/i.test(n)||!0==!!document.documentMode)&&(e=m.IE),S.cachedResult=e,S.cachedResult}function M(e,n){let r=g[S()],i=e,o=n,s=i*o,l=i>o?o/i:i/o;for(;s>r*r;){let e=(r+i)/2,n=(r+o)/2;e<n?(o=n,i=n*l):(o=e*l,i=e),s=i*o}return{width:i,height:o}}function E(e,n){let r,i;try{if(i=(r=new OffscreenCanvas(e,n)).getContext("2d"),null===i)throw Error("getContext of OffscreenCanvas returns null")}catch(e){i=(r=document.createElement("canvas")).getContext("2d")}return r.width=e,r.height=n,[r,i]}function T(e,n){let{width:r,height:i}=M(e.width,e.height),[o,s]=E(r,i);return n&&/jpe?g/.test(n)&&(s.fillStyle="white",s.fillRect(0,0,o.width,o.height)),s.drawImage(e,0,0,o.width,o.height),o}function R(e,n={}){return new Promise(function(r,i){let o,s;var l=function(){try{return s=T(o,n.fileType||e.type),r([o,s])}catch(e){return i(e)}},a=function(n){try{var r=function(e){try{throw e}catch(e){return i(e)}};try{let n;return x(e).then(function(e){try{return n=e,C(n).then(function(e){try{return o=e,function(){try{return l()}catch(e){return i(e)}}()}catch(e){return r(e)}},r)}catch(e){return r(e)}},r)}catch(e){r(e)}}catch(e){return i(e)}};try{if(function e(){return void 0!==e.cachedResult||(e.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),e.cachedResult}()||[m.DESKTOP_SAFARI,m.MOBILE_SAFARI].includes(S()))throw Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then(function(e){try{return o=e,l()}catch(e){return a()}},a)}catch(e){a()}})}function I(e,n,r,i,o=1){return new Promise(function(s,l){let a;if("image/png"===n){let s,l;return s=e.getContext("2d"),{data:l}=s.getImageData(0,0,e.width,e.height),(a=new Blob([p.encode([l.buffer],e.width,e.height,4096*o)],{type:n})).name=r,a.lastModified=i,d.call(this)}if("image/bmp"===n)return new Promise(n=>f.toBlob(e,n)).then((function(e){try{return(a=e).name=r,a.lastModified=i,c.call(this)}catch(e){return l(e)}}).bind(this),l);if("function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return e.convertToBlob({type:n,qual
13ity:o}).then((function(e){try{return(a=e).name=r,a.lastModified=i,h.call(this)}catch(e){return l(e)}}).bind(this),l);return A(e.toDataURL(n,o),r,i).then((function(e){try{return a=e,h.call(this)}catch(e){return l(e)}}).bind(this),l);function h(){return c.call(this)}function c(){return d.call(this)}function d(){return s(a)}})}function O(e){e.width=0,e.height=0}function N(){return new Promise(function(e,n){let r,i,o,s;return void 0!==N.cachedResult?e(N.cachedResult):A("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(l){try{return r=l,R(r).then(function(l){try{return i=l[1],I(i,r.type,r.name,r.lastModified).then(function(r){try{return o=r,O(i),R(o).then(function(r){try{return s=r[0],N.cachedResult=1===s.width&&2===s.height,e(N.cachedResult)}catch(e){return n(e)}},n)}catch(e){return n(e)}},n)}catch(e){return n(e)}},n)}catch(e){return n(e)}},n)})}function L(e){return new Promise((n,r)=>{let i=new k;i.onload=e=>{let r=new DataView(e.target.result);if(65496!=r.getUint16(0,!1))return n(-2);let i=r.byteLength,o=2;for(;o<i&&!(8>=r.getUint16(o+2,!1));){let e=r.getUint16(o,!1);if(o+=2,65505==e){if(1165519206!=r.getUint32(o+=2,!1))return n(-1);let e=18761==r.getUint16(o+=6,!1);o+=r.getUint32(o+4,e);let i=r.getUint16(o,e);o+=2;for(let s=0;s<i;s++)if(274==r.getUint16(o+12*s,e))return n(r.getUint16(o+12*s+8,e))}else{if(65280!=(65280&e))break;o+=r.getUint16(o,!1)}}return n(-1)},i.onerror=e=>r(e),i.readAsArrayBuffer(e)})}function H(e,n){let{width:r}=e,{height:i}=e,{maxWidthOrHeight:o}=n,s,l=e;return isFinite(o)&&(r>o||i>o)&&([l,s]=E(r,i),r>i?(l.width=o,l.height=i/r*o):(l.width=r/i*o,l.height=o),s.drawImage(e,0,0,l.width,l.height),O(e)),l}function z(e,n){let{width:r}=e,{height:i}=e,[o,s]=E(r,i);switch(n>4&&n<9?(o.width=i,o.height=r):(o.width=r,o.height=i),n){case 2:s.transform(-1,0,0,1,r,0);break;case 3:s.transform(-1,0,0,-1,r,i);break;case 4:s.transform(1,0,0,-1,0,i);break;case 5:s.transform(0,1,1,0,0,0);break;case 6:s.transform(0,1,-1,0,i,0);break;case 7:s.transform(0,-1,-1,0,i,r);break;case 8:s.transform(0,-1,1,0,0,r)}return s.drawImage(e,0,0,r,i),O(e),o}function B(e,n,r=0){return new Promise(function(i,o){let s,l,a,h,c,d,u,p,f,m,g,y,w,v,b,k,A,x,C,S;function M(e=5){if(n.signal&&n.signal.aborted)throw n.signal.reason;s+=e,n.onProgress(Math.min(s,100))}function T(e){if(n.signal&&n.signal.aborted)throw n.signal.reason;s=Math.min(Math.max(e,s),100),n.onProgress(s)}return s=r,l=n.maxIteration||10,a=1024*n.maxSizeMB*1024,M(),R(e,n).then((function(r){try{return[,h]=r,M(),c=H(h,n),M(),new Promise(function(r,i){var o;if(!(o=n.exifOrientation))return L(e).then((function(e){try{return o=e,s.call(this)}catch(e){return i(e)}}).bind(this),i);function s(){return r(o)}return s.call(this)}).then((function(r){try{return d=r,M(),N().then((function(r){try{return u=r?c:z(c,d),M(),p=n.initialQuality||1,f=n.fileType||e.type,I(u,f,e.name,e.lastModified,p).then((function(r){try{var s;if(m=r,M(),g=m.size>a,y=m.size>e.size,!g&&!y)return T(100),i(m);function d(){if(l--&&(b>a||b>w)){let n,r;return n=S?.95*C.width:C.width,r=S?.95*C.height:C.height,[A,x]=E(n,r),x.drawImage(C,0,0,n,r),p*="image/png"===f?.85:.95,I(A,f,e.name,e.lastModified,p).then(function(e){try{return k=e,O(C),C=A,b=k.size,T(Math.min(99,Math.floor((v-b)/(v-a)*100))),d}catch(e){return o(e)}},o)}return[1]}return w=e.size,b=v=m.size,C=u,S=!n.alwaysKeepResolution&&g,(s=(function(e){for(;e;){if(e.then)return void e.then(s,o);try{if(e.pop){if(e.length)return e.pop()?R.call(this):e;e=d}else e=e.call(this)}catch(e){return o(e)}}}).bind(this))(d);function R(){return O(C),O(A),O(c),O(u),O(h),T(100),i(k)}}catch(e){return o(e)}}).bind(this),o)}catch(e){return o(e)}}).bind(this),o)}catch(e){return o(e)}}).bind(this),o)}catch(e){return o(e)}}).bind(this),o)})}function F(e,n){return new Promise(function(r,s){let l,a,h,c,d,u;if(l={...n},h=0,{onProgress:c}=l,l.maxSizeMB=l.maxSizeMB||Number.POSITIVE_INFINITY,d="boolean"!=typeof l.useWebWorker||l.useWebWorker,delete l.useWebWorker,l.onProgress=e=>{h=e,"function"==typeof c&&c(h)},!(e instanceof Blob||e instanceof b))return s(Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return s(Error("The file given is not an image"));if(u="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!d||"function"!=typeof Worker||u)return B(e,l).then((function(e){try{return a=e,m.call(this)}catch(e){return s(e)}}).bind(this),s);var p=(function(){try{return m.call(this)}catch(e){return s(e)}}).bind(this),f=function(n){try{return B(e,l).then(function(e){try{return a=e,p()}catch(e){return s(e)}},s)}catch(e){return s(e)}};try{return l.libURL=l.libURL||"https://cdn.jsdelivr.net/npm/[email protected]/dist/browser-image-compression.js",new Promise((n,r)=>{i||(i=function(e){let n=[];return"function"==typeof e?n.push(`(${e})()`):n.push(e),URL.createObjectURL(new Blob(n))}("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n  const { file, id, imageCompressionLibUrl, options } = e.data\n  options.onProgress = (progress) => self.postMessage({ progress, id })\n  try {\n    if (!scriptImported) {\n      // console.log('[worker] 
13importScripts', imageCompressionLibUrl)\n      self.importScripts(imageCompressionLibUrl)\n      scriptImported = true\n    }\n    // console.log('[worker] self', self)\n    const compressedFile = await imageCompression(file, options)\n    self.postMessage({ file: compressedFile, id })\n  } catch (e) {\n    // console.error('[worker] error', e)\n    self.postMessage({ error: e.message + '\\n' + e.stack, id })\n  }\n})\n"));let o=new Worker(i);o.addEventListener("message",function(e){if(l.signal&&l.signal.aborted)o.terminate();else if(void 0===e.data.progress){if(e.data.error)return r(Error(e.data.error)),void o.terminate();n(e.data.file),o.terminate()}else l.onProgress(e.data.progress)}),o.addEventListener("error",r),l.signal&&l.signal.addEventListener("abort",()=>{r(l.signal.reason),o.terminate()}),o.postMessage({file:e,imageCompressionLibUrl:l.libURL,options:{...l,onProgress:void 0,signal:void 0}})}).then(function(e){try{return a=e,p()}catch(e){return f()}},f)}catch(e){f()}function m(){try{a.name=e.name,a.lastModified=e.lastModified}catch(e){}try{l.preserveExif&&"image/jpeg"===e.type&&(!l.fileType||l.fileType&&l.fileType===e.type)&&(a=o(e,a))}catch(e){}return r(a)}})}F.getDataUrlFromFile=x,F.getFilefromDataUrl=A,F.loadImage=C,F.drawImageInCanvas=T,F.drawFileInCanvas=R,F.canvasToFile=I,F.getExifOrientation=L,F.handleMaxWidthOrHeight=H,F.followExifOrientation=z,F.cleanupCanvasMemory=O,F.isAutoOrientationInBrowser=N,F.approximateBelowMaximumCanvasSizeOfBrowser=M,F.copyExifWithoutOrientation=o,F.getBrowserName=S,F.version="2.0.2"},20946:function(e,n,r){r.d(n,{Ig:function(){return k},MI:function(){return b},N0:function(){return T},NE:function(){return l},QK:function(){return x},U9:function(){return O},X0:function(){return E},Y_:function(){return y},_M:function(){return f},al:function(){return h},cR:function(){return d},mD:function(){return M},nw:function(){return N},o:function(){return w},rr:function(){return c},uJ:function(){return H},uo:function(){return S},xb:function(){return A},ym:function(){return L}});var i=r(94536),o=r(10121),s=r(17213);let l=(e,n)=>!e.selection.empty&&(n&&n(e.tr.deleteSelection().scrollIntoView()),!0);function a(e,n){let{$cursor:r}=e.selection;return r&&(n?n.endOfTextblock("backward",e):!(r.parentOffset>0))?r:null}let h=(e,n,r)=>{let l=a(e,r);if(!l)return!1;let h=m(l);if(!h){let r=l.blockRange(),o=r&&(0,i.k9)(r);return null!=o&&(n&&n(e.tr.lift(r,o).scrollIntoView()),!0)}let c=h.nodeBefore;if(R(e,h,n,-1))return!0;if(0==l.parent.content.size&&(p(c,"end")||s.qv.isSelectable(c)))for(let r=l.depth;;r--){let a=(0,i.dR)(e.doc,l.before(r),l.after(r),o.p2.empty);if(a&&a.slice.size<a.to-a.from){if(n){let r=e.tr.step(a);r.setSelection(p(c,"end")?s.Y1.findFrom(r.doc.resolve(r.mapping.map(h.pos,-1)),-1):s.qv.create(r.doc,h.pos-c.nodeSize)),n(r.scrollIntoView())}return!0}if(1==r||l.node(r-1).childCount>1)break}return!!c.isAtom&&h.depth==l.depth-1&&(n&&n(e.tr.delete(h.pos-c.nodeSize,h.pos).scrollIntoView()),!0)},c=(e,n,r)=>{let i=a(e,r);if(!i)return!1;let o=m(i);return!!o&&u(e,o,n)},d=(e,n,r)=>{let i=g(e,r);if(!i)return!1;let o=v(i);return!!o&&u(e,o,n)};function u(e,n,r){let l=n.nodeBefore,a=n.pos-1;for(;!l.isTextblock;a--){if(l.type.spec.isolating)return!1;let e=l.lastChild;if(!e)return!1;l=e}let h=n.nodeAfter,c=n.pos+1;for(;!h.isTextblock;c++){if(h.type.spec.isolating)return!1;let e=h.firstChild;if(!e)return!1;h=e}let d=(0,i.dR)(e.doc,a,c,o.p2.empty);if(!d||d.from!=a||d instanceof i.Pu&&d.slice.size>=c-a)return!1;if(r){let n=e.tr.step(d);n.setSelection(s.Bs.create(n.doc,a)),r(n.scrollIntoView())}return!0}function p(e,n,r=!1){for(let i=e;i;i="start"==n?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(r&&1!=i.childCount)break}return!1}let f=(e,n,r)=>{let{$head:i,empty:o}=e.selection,l=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):i.parentOffset>0)return!1;l=m(i)}let a=l&&l.nodeBefore;return!!(a&&s.qv.isSelectable(a))&&(n&&n(e.tr.setSelection(s.qv.create(e.doc,l.pos-a.nodeSize)).scrollIntoView()),!0)};function m(e){if(!e.parent.type.spec.isolating)for(let n=e.depth-1;n>=0;n--){if(e.index(n)>0)return e.doc.resolve(e.before(n+1));if(e.node(n).type.spec.isolating)break}return null}function g(e,n){let{$cursor:r}=e.selection;return r&&(n?n.endOfTextblock("forward",e):!(r.parentOffset<r.parent.content.size))?r:null}let y=(e,n,r)=>{let l=g(e,r);if(!l)return!1;let a=v(l);if(!a)return!1;let h=a.nodeAfter;
13if(R(e,a,n,1))return!0;if(0==l.parent.content.size&&(p(h,"start")||s.qv.isSelectable(h))){let r=(0,i.dR)(e.doc,l.before(),l.after(),o.p2.empty);if(r&&r.slice.size<r.to-r.from){if(n){let i=e.tr.step(r);i.setSelection(p(h,"start")?s.Y1.findFrom(i.doc.resolve(i.mapping.map(a.pos)),1):s.qv.create(i.doc,i.mapping.map(a.pos))),n(i.scrollIntoView())}return!0}}return!!h.isAtom&&a.depth==l.depth-1&&(n&&n(e.tr.delete(a.pos,a.pos+h.nodeSize).scrollIntoView()),!0)},w=(e,n,r)=>{let{$head:i,empty:o}=e.selection,l=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;l=v(i)}let a=l&&l.nodeAfter;return!!(a&&s.qv.isSelectable(a))&&(n&&n(e.tr.setSelection(s.qv.create(e.doc,l.pos)).scrollIntoView()),!0)};function v(e){if(!e.parent.type.spec.isolating)for(let n=e.depth-1;n>=0;n--){let r=e.node(n);if(e.index(n)+1<r.childCount)return e.doc.resolve(e.after(n+1));if(r.type.spec.isolating)break}return null}let b=(e,n)=>{let r=e.selection,o=r instanceof s.qv,l;if(o){if(r.node.isTextblock||!(0,i.Mn)(e.doc,r.from))return!1;l=r.from}else if(null==(l=(0,i.GJ)(e.doc,r.from,-1)))return!1;if(n){let r=e.tr.join(l);o&&r.setSelection(s.qv.create(r.doc,l-e.doc.resolve(l).nodeBefore.nodeSize)),n(r.scrollIntoView())}return!0},k=(e,n)=>{let r=e.selection,o;if(r instanceof s.qv){if(r.node.isTextblock||!(0,i.Mn)(e.doc,r.to))return!1;o=r.to}else if(null==(o=(0,i.GJ)(e.doc,r.to,1)))return!1;return n&&n(e.tr.join(o).scrollIntoView()),!0},A=(e,n)=>{let{$from:r,$to:o}=e.selection,s=r.blockRange(o),l=s&&(0,i.k9)(s);return null!=l&&(n&&n(e.tr.lift(s,l).scrollIntoView()),!0)},x=(e,n)=>{let{$head:r,$anchor:i}=e.selection;return!!(r.parent.type.spec.code&&r.sameParent(i))&&(n&&n(e.tr.insertText("\n").scrollIntoView()),!0)};function C(e){for(let n=0;n<e.edgeCount;n++){let{type:r}=e.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}let S=(e,n)=>{let{$head:r,$anchor:i}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;let o=r.node(-1),l=r.indexAfter(-1),a=C(o.contentMatchAt(l));if(!a||!o.canReplaceWith(l,l,a))return!1;if(n){let i=r.after(),o=e.tr.replaceWith(i,i,a.createAndFill());o.setSelection(s.Y1.near(o.doc.resolve(i),1)),n(o.scrollIntoView())}return!0},M=(e,n)=>{let r=e.selection,{$from:i,$to:o}=r;if(r instanceof s.C1||i.parent.inlineContent||o.parent.inlineContent)return!1;let l=C(o.parent.contentMatchAt(o.indexAfter()));if(!l||!l.isTextblock)return!1;if(n){let r=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,a=e.tr.insert(r,l.createAndFill());a.setSelection(s.Bs.create(a.doc,r+1)),n(a.scrollIntoView())}return!0},E=(e,n)=>{let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let o=r.before();if((0,i.Ax)(e.doc,o))return n&&n(e.tr.split(o).scrollIntoView()),!0}let o=r.blockRange(),s=o&&(0,i.k9)(o);return null!=s&&(n&&n(e.tr.lift(o,s).scrollIntoView()),!0)},T=(e,n)=>{let{$from:r,to:i}=e.selection,o,l=r.sharedDepth(i);return 0!=l&&(o=r.before(l),n&&n(e.tr.setSelection(s.qv.create(e.doc,o))),!0)};function R(e,n,r,l){let a,h,c,d=n.nodeBefore,u=n.nodeAfter,f,m,g=d.type.spec.isolating||u.type.spec.isolating;if(!g&&(a=n.nodeBefore,h=n.nodeAfter,c=n.index(),a&&h&&a.type.compatibleContent(h.type)&&(!a.content.size&&n.parent.canReplace(c-1,c)?(r&&r(e.tr.delete(n.pos-a.nodeSize,n.pos).scrollIntoView()),!0):!!(n.parent.canReplace(c,c+1)&&(h.isTextblock||(0,i.Mn)(e.doc,n.pos)))&&(r&&r(e.tr.join(n.pos).scrollIntoView()),!0))))return!0;let y=!g&&n.parent.canReplace(n.index(),n.index()+1);if(y&&(f=(m=d.contentMatchAt(d.childCount)).findWrapping(u.type))&&m.matchType(f[0]||u.type).validEnd){if(r){let s=n.pos+u.nodeSize,l=o.HY.empty;for(let e=f.length-1;e>=0;e--)l=o.HY.from(f[e].create(null,l));l=o.HY.from(d.copy(l));let a=e.tr.step(new i.FC(n.pos-1,s,n.pos,s,new o.p2(l,1,0),f.length,!0)),h=a.doc.resolve(s+2*f.length);h.nodeAfter&&h.nodeAfter.type==d.type&&(0,i.Mn)(a.doc,h.pos)&&a.join(h.pos),r(a.scrollIntoView())}return!0}let w=u.type.spec.isolating||l>0&&g?null:s.Y1.findFrom(n,1),v=w&&w.$from.blockRange(w.$to),b=v&&(0,i.k9)(v);if(null!=b&&b>=n.depth)return r&&r(e.tr.lift(v,b).scrollIntoView()),!0;if(y&&p(u,"start",!0)&&p(d,"end")){let s=d,l=[];for(;l.push(s),!s.isTextblock;)s=s.lastChild;let a=u,h=1;for(;!a.isTextblock;a=a.firstChild)h++;if(s.canReplace(s.childCount,s.childCount,a.content)){if(r){let s=o.HY.empty;for(let e=l.length-1;e>=0;e--)s=o.HY.from(l[e].copy(s));r(e.tr.step(new i.FC(n.pos-l.length,n.pos+u.nodeSize,n.pos+h,n.pos+u.nodeSize-h,new o.p2(s,l.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function I(e){return function(n,r){let i=n.selection,o=e<0?i.$from:i.$to,l=o.depth;for(;o.node(l).isInline;){if(!l)return!1;l--}return!!o.node(l).isTextblock&&(r&&r(n.tr.setSelection(s.Bs.create(n.doc,e<0?o.start(l):o.end(l)))),!0)}}let O=I(-1),N=I(1);function L(e,n=null){return function(r,o){let{$from:s,$to:l}=r.selection,a=s.blockRange(l),h=a&&(0,i.nd)(a,e,n);return!!h&&(o&&o(r.tr.wrap(a,h).scrollIntoView()),!0)}}function H(e,n=null){return function(r,i){let o=!1;for(let i=0;i<r.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:l}}=r.selection.ranges[i];r.doc.nodesBetween(s,l,(i,s)=>{if(o)return!1;if(!(!i.isTextblock||i.hasMarkup(e,n))){if(i.type==e)o=!0;else{let n=r.doc.resolve(s),i=n.index();o=n.parent.canReplaceWith(i,i+1,e)}}})}if(!o)return!1;if(i){let o=r.tr;for(let i=0;i<r.selection.ranges.length;i++){let{$from:{pos:s},$to:{pos:l}}=r.selection.ranges[i];o.setBlockType(s,l,e,n)}i(o.scrollIntoView())}return!0}}function z(...e){return function(n,r,i){for(let o=0;o<e.length;o++)if(e[o](n,r,i))return!0;return!1}}let B=z(l,h,f),F=z(l,y,w),$={Enter:z(x,M,E,(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof s.qv&&e.selection.node.isBlock)return!!(r.parentOffset&&(0,i.Ax)(e.doc,r.pos))&&(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let l=[],a,h,c=!1,d=!1;for(let e=r.depth;;e--){if(r.node(e).isBlock){let n;c=r.end(e)==r.pos+(r.depth-e),d=r.start(e)==r.pos-(r.depth-e),h=C(r.node(e-1).contentMatchAt(r.indexAfter(e-1))),l.unshift(n||(c&&h?{type:h}:null)),a=e;break}if(1==e)return!1;l.unshift(null)}let u=e.tr;(e.selection instanceof s.Bs||e.selection instanceof s.C1)&&u.deleteSelection();let p=u.mapping.map(r.pos),f=(0,i.Ax)(u.doc,p,l.length,l);if(f||(l[0]=h?{type:h}:null,f=(0,i.Ax)(u.doc,p,l.length,l)),!f)return!1;if(u.split(p,l.length,l),!c&&d&&r.node(a).type!=h){let e=u.mapping.map(r.before(a)),n=u.doc.resolve(e);h&&r.node(a-1).canReplaceWith(n.index(),n.index()+1,h)&&u.setNodeMarkup(u.mapping.map(r.before(a)),h)}return n&&n(u.scrollIntoView()),!0}),"Mod-Enter":S,Backspace:B,"Mod-Backspace":B,"Shift-Backspace":B,Delete:F,"Mod-Delete":F,"Mod-a":(e,n)=>(n&&n(e.tr.setSelection(new s.C1(e.doc))),!0)},D={"Ctrl-h":$.Backspace,"Alt-Backspace":$["Mod-Backspace"],"Ctrl-d":$.Delete,"Ctrl-Alt-Backspace":$["Mod-Delete"],"Alt-Delete":$["Mod-Delete"],"Alt-d":$["Mod-Delete"],"Ctrl-a":O,"Ctrl-e":N};for(let e in $)D[e]=$[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform()},10258:function(e,n,r){r.d(n,{$:function(){return m},h:function(){return f}});for(var i={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=0;a<10;a++)i[48+a]=i[96+a]=String(a);for(var a=1;a<=24;a++)i[a+111]="F"+a;for(var a=65;a<=90;a++)i[a]=String.fromCharCode(a+32),o[a]=String.fromCharCode(a);for(var h in i)o.hasOwnProperty(h)||(o[h]=i[h]);var c=r(17213);let d="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),u="undefined"!=typeof navigator&&/Win/.test(navigator.platform);
13function p(e,n,r=!0){return n.altKey&&(e="Alt-"+e),n.ctrlKey&&(e="Ctrl-"+e),n.metaKey&&(e="Meta-"+e),r&&n.shiftKey&&(e="Shift-"+e),e}function f(e){return new c.Sy({props:{handleKeyDown:m(e)}})}function m(e){let n=function(e){let n=Object.create(null);for(let r in e)n[function(e){let n,r,i,o,s=e.split(/-(?!$)/),l=s[s.length-1];"Space"==l&&(l=" ");for(let e=0;e<s.length-1;e++){let l=s[e];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))d?o=!0:r=!0;else throw Error("Unrecognized modifier name: "+l)}return n&&(l="Alt-"+l),r&&(l="Ctrl-"+l),o&&(l="Meta-"+l),i&&(l="Shift-"+l),l}(r)]=e[r];return n}(e);return function(e,r){var a;let h=("Esc"==(a=!(s&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||l&&r.shiftKey&&r.key&&1==r.key.length||"Unidentified"==r.key)&&r.key||(r.shiftKey?o:i)[r.keyCode]||r.key||"Unidentified")&&(a="Escape"),"Del"==a&&(a="Delete"),"Left"==a&&(a="ArrowLeft"),"Up"==a&&(a="ArrowUp"),"Right"==a&&(a="ArrowRight"),"Down"==a&&(a="ArrowDown"),a),c,d=n[p(h,r)];if(d&&d(e.state,e.dispatch,e))return!0;if(1==h.length&&" "!=h){if(r.shiftKey){let i=n[p(h,r,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(u&&r.ctrlKey&&r.altKey)&&(c=i[r.keyCode])&&c!=h){let i=n[p(c,r)];if(i&&i(e.state,e.dispatch,e))return!0}}return!1}}},10121:function(e,n,r){function i(e){this.content=e}r.d(n,{aw:function(){return j},PW:function(){return Q},HY:function(){return o},vc:function(){return h},ZU:function(){return $},NB:function(){return C},Ts:function(){return A},e4:function(){return c},V_:function(){return D},p2:function(){return d}}),i.prototype={constructor:i,find:function(e){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===e)return n;return -1},get:function(e){var n=this.find(e);return -1==n?void 0:this.content[n+1]},update:function(e,n,r){var o=r&&r!=e?this.remove(r):this,s=o.find(e),l=o.content.slice();return -1==s?l.push(r||e,n):(l[s+1]=n,r&&(l[s]=r)),new i(l)},remove:function(e){var n=this.find(e);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new i(r)},addToStart:function(e,n){return new i([e,n].concat(this.remove(e).content))},addToEnd:function(e,n){var r=this.remove(e).content.slice();return r.push(e,n),new i(r)},addBefore:function(e,n,r){var o=this.remove(n),s=o.content.slice(),l=o.find(e);return s.splice(-1==l?s.length:l,0,n,r),new i(s)},forEach:function(e){for(var n=0;n<this.content.length;n+=2)e(this.content[n],this.content[n+1])},prepend:function(e){return(e=i.from(e)).size?new i(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=i.from(e)).size?new i(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var n=this;e=i.from(e);for(var r=0;r<e.content.length;r+=2)n=n.remove(e.content[r]);return n},toObject:function(){var e={};return this.forEach(function(n,r){e[n]=r}),e},get size(){return this.content.length>>1}},i.from=function(e){if(e instanceof i)return e;var n=[];if(e)for(var r in e)n.push(r,e[r]);return new i(n)};class o{constructor(e,n){if(this.content=e,this.size=n||0,null==n)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,l=0;l<n;s++){let a=this.content[s],h=l+a.nodeSize;if(h>e&&!1!==r(a,i+l,o||null,s)&&a.content.size){let o=l+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,n-o),r,i+o)}l=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,a)=>{let h=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?"function"==typeof i?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&h||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=h},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new o(i,this.size+e.size)}cut(e,n=this.size){if(0==e&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let l=this.content[o],a=s+l.nodeSize;a>e&&((s<e||a>n)&&(l=l.isText?l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=a}return new o(r,i)}cutByIndex(e,n){return e==n?o.empty:0==e&&n==this.content.length?this:new o(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new o(i,s)}addToStart(e){return new o([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new o(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return function e(n,r,i){for(let o=0;;o++){if(o==n.childCount||o==r.childCount)return n.childCount==r.childCount?null:i;let s=n.child(o),l=r.child(o);if(s==l){i+=s.nodeSize;continue}if(!s.sameMarkup(l))return i;if(s.isText&&s.text!=l.text){for(let e=0;s.text[e]==l.text[e];e++)i++;return i}if(s.content.size||l.content.size){let n=e(s.content,l.content,i+1);if(null!=n)return n}i+=s.nodeSize}}(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return function e(n,r,i,o){for(let s=n.childCount,l=r.childCount;;
13){if(0==s||0==l)return s==l?null:{a:i,b:o};let a=n.child(--s),h=r.child(--l),c=a.nodeSize;if(a==h){i-=c,o-=c;continue}if(!a.sameMarkup(h))return{a:i,b:o};if(a.isText&&a.text!=h.text){let e=0,n=Math.min(a.text.length,h.text.length);for(;e<n&&a.text[a.text.length-e-1]==h.text[h.text.length-e-1];)e++,i--,o--;return{a:i,b:o}}if(a.content.size||h.content.size){let n=e(a.content,h.content,i-1,o-1);if(n)return n}i-=c,o-=c}}(this,e,n,r)}findIndex(e){if(0==e)return l(0,e);if(e==this.size)return l(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e){if(i==e)return l(n+1,i);return l(n,r)}r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return o.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new o(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return o.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new o(n||e,r)}static from(e){if(!e)return o.empty;if(e instanceof o)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new o([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}o.empty=new o([],0);let s={index:0,offset:0};function l(e,n){return s.index=e,s.offset=n,s}function a(e,n){if(e===n)return!0;if(!(e&&"object"==typeof e)||!(n&&"object"==typeof n))return!1;let r=Array.isArray(e);if(Array.isArray(n)!=r)return!1;if(r){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!a(e[r],n[r]))return!1}else{for(let r in e)if(!(r in n)||!a(e[r],n[r]))return!1;for(let r in n)if(!(r in e))return!1}return!0}class h{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&a(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return h.none;if(e instanceof h)return[e];let n=e.slice();return n.sort((e,n)=>e.type.rank-n.type.rank),n}}h.none=[];class c extends Error{}class d{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=function e(n,r,i,o){let{index:s,offset:l}=n.findIndex(r),a=n.maybeChild(s);if(l==r||a.isText)return o&&!o.canReplace(s,s,i)?null:n.cut(0,r).append(i).append(n.cut(r));let h=e(a.content,r-l-1,i,a);return h&&n.replaceChild(s,a.copy(h))}(this.content,e+this.openStart,n);return r&&new d(r,this.openStart,this.openEnd)}removeBetween(e,n){return new d(function e(n,r,i){let{index:o,offset:s}=n.findIndex(r),l=n.maybeChild(o),{index:a,offset:h}=n.findIndex(i);if(s==r||l.isText){if(h!=i&&!n.child(a).isText)throw RangeError("Removing non-flat range");return n.cut(0,r).append(n.cut(i))}if(o!=a)throw RangeError("Removing non-flat range");return n.replaceChild(o,l.copy(e(l.content,r-s-1,i-s-1)))}(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return d.empty;let r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new d(o.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let r=e.lastChild;r&&!r.isLeaf&&(n||!r.type.spec.isolating);r=r.lastChild)i++;return new d(e,r,i)}}
13function u(e,n){if(!n.type.compatibleContent(e.type))throw new c("Cannot join "+n.type.name+" onto "+e.type.name)}function p(e,n,r){let i=e.node(r);return u(i,n.node(r)),i}function f(e,n){let r=n.length-1;r>=0&&e.isText&&e.sameMarkup(n[r])?n[r]=e.withText(n[r].text+e.text):n.push(e)}function m(e,n,r,i){let o=(n||e).node(r),s=0,l=n?n.index(r):o.childCount;e&&(s=e.index(r),e.depth>r?s++:e.textOffset&&(f(e.nodeAfter,i),s++));for(let e=s;e<l;e++)f(o.child(e),i);n&&n.depth==r&&n.textOffset&&f(n.nodeBefore,i)}function g(e,n){return e.type.checkContent(n),e.copy(n)}function y(e,n,r){let i=[];return m(null,e,r,i),e.depth>r&&f(g(p(e,n,r+1),y(e,n,r+1)),i),m(n,null,r,i),new o(i)}d.empty=new d(o.empty,0,0);class w{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):0==e?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[3*n],i=0==n?0:this.path[3*n-1]+1;for(let n=0;n<e;n++)i+=r.child(n).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(0==e.content.size)return h.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let e=r;r=i,i=e}let o=r.marks;for(var s=0;s<o.length;s++)!1!==o[s].type.spec.inclusive||i&&o[s].isInSet(i.marks)||(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||i&&r[o].isInSet(i.marks)||(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new A(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let n=e;;){let{index:e,offset:s}=n.content.findIndex(o),l=o-s;if(r.push(n,e,i+s),!l||(n=n.child(e)).isText)break;o=l-1,i+=s+1}return new w(n,r,o)}static resolveCached(e,n){let r=k.get(e);if(r)for(let e=0;e<r.elts.length;e++){let i=r.elts[e];if(i.pos==n)return i}else k.set(e,r=new v);let i=r.elts[r.i]=w.resolve(e,n);return r.i=(r.i+1)%b,i}}class v{constructor(){this.elts=[],this.i=0}}let b=12,k=new WeakMap;class A{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let x=Object.create(null);class C{constructor(e,n,r,i=h.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||o.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}
13textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&a(this.attrs,n||e.defaultAttrs||x)&&h.sameSet(this.marks,r||h.none)}copy(e=null){return e==this.content?this:new C(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new C(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return 0==e&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return d.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s);return new d(i.node(s).content.cut(i.pos-l,o.pos-l),i.depth-s,o.depth-s)}replace(e,n,r){return function(e,n,r){if(r.openStart>e.depth)throw new c("Inserted content deeper than insertion position");if(e.depth-r.openStart!=n.depth-r.openEnd)throw new c("Inconsistent open depths");return function e(n,r,i,s){let l=n.index(s),a=n.node(s);if(l==r.index(s)&&s<n.depth-i.openStart){let o=e(n,r,i,s+1);return a.copy(a.content.replaceChild(l,o))}if(!i.content.size)return g(a,y(n,r,s));if(i.openStart||i.openEnd||n.depth!=s||r.depth!=s){let{start:e,end:l}=function(e,n){let r=n.depth-e.openStart,i=n.node(r).copy(e.content);for(let e=r-1;e>=0;e--)i=n.node(e).copy(o.from(i));return{start:i.resolveNoCache(e.openStart+r),end:i.resolveNoCache(i.content.size-e.openEnd-r)}}(i,n);return g(a,function e(n,r,i,s,l){let a=n.depth>l&&p(n,r,l+1),h=s.depth>l&&p(i,s,l+1),c=[];return m(null,n,l,c),a&&h&&r.index(l)==i.index(l)?(u(a,h),f(g(a,e(n,r,i,s,l+1)),c)):(a&&f(g(a,y(n,r,l+1)),c),m(r,i,l,c),h&&f(g(h,y(i,s,l+1)),c)),m(s,null,l,c),new o(c)}(n,e,l,r,s))}{let e=n.parent,o=e.content;return g(e,o.cut(0,n.parentOffset).append(i.content).append(o.cut(r.parentOffset)))}}(e,n,r,0)}(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(!(n=n.maybeChild(r)))return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return w.resolveCached(this,e)}resolveNoCache(e){return w.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,e=>(r.isInSet(e.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),M(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=o.empty,i=0,s=r.childCount){let l=this.contentMatchAt(e).matchFragment(r,i,s),a=l&&l.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let e=i;e<s;e++)if(!this.type.allowsMarks(r.child(e).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return!!s&&s.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=h.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!h.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>
13e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,n){let r;if(!n)throw RangeError("Invalid input for Node.fromJSON");if(n.marks){if(!Array.isArray(n.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if("text"==n.type){if("string"!=typeof n.text)throw RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=o.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}}C.prototype.text=void 0;class S extends C{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):M(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new S(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new S(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return 0==e&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function M(e,n){for(let r=e.length-1;r>=0;r--)n=e[r].type.name+"("+n+")";return n}class E{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){var r;let i,o=new T(e,n);if(null==o.next)return E.empty;let s=function e(n){let r=[];do r.push(function(n){let r=[];do r.push(function(n){let r=function(n){if(n.eat("(")){let r=e(n);return n.eat(")")||n.err("Missing closing paren"),r}if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=(function(e,n){let r=e.nodeTypes,i=r[n];if(i)return[i];let o=[];for(let e in r){let i=r[e];i.isInGroup(n)&&o.push(i)}return 0==o.length&&e.err("No node type or group '"+n+"' found"),o})(n,n.next).map(e=>(null==n.inline?n.inline=e.isInline:n.inline!=e.isInline&&n.err("Mixing inline and block content"),{type:"name",value:e}));return n.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(n);for(;;)if(n.eat("+"))r={type:"plus",expr:r};else if(n.eat("*"))r={type:"star",expr:r};else if(n.eat("?"))r={type:"opt",expr:r};else if(n.eat("{"))r=function(e,n){let r=R(e),i=r;return e.eat(",")&&(i="}"!=e.next?R(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}(n,r);else break;return r}(n));while(n.next&&")"!=n.next&&"|"!=n.next);return 1==r.length?r[0]:{type:"seq",exprs:r}}(n));while(n.eat("|"));return 1==r.length?r[0]:{type:"choice",exprs:r}}(o);o.next&&o.err("Unexpected trailing text");let l=(r=function(e){let n=[[]];
13return o(function e(n,s){if("choice"==n.type)return n.exprs.reduce((n,r)=>n.concat(e(r,s)),[]);if("seq"==n.type)for(let i=0;;i++){let l=e(n.exprs[i],s);if(i==n.exprs.length-1)return l;o(l,s=r())}else if("star"==n.type){let l=r();return i(s,l),o(e(n.expr,l),l),[i(l)]}else if("plus"==n.type){let l=r();return o(e(n.expr,s),l),o(e(n.expr,l),l),[i(l)]}else if("opt"==n.type)return[i(s)].concat(e(n.expr,s));else if("range"==n.type){let l=s;for(let i=0;i<n.min;i++){let i=r();o(e(n.expr,l),i),l=i}if(-1==n.max)o(e(n.expr,l),l);else for(let s=n.min;s<n.max;s++){let s=r();i(l,s),o(e(n.expr,l),s),l=s}return[i(l)]}else if("name"==n.type)return[i(s,void 0,n.value)];else throw Error("Unknown expr type")}(e,0),r()),n;function r(){return n.push([])-1}function i(e,r,i){let o={term:i,to:r};return n[e].push(o),o}function o(e,n){e.forEach(e=>e.to=n)}}(s),i=Object.create(null),function e(n){let o=[];n.forEach(e=>{r[e].forEach(({term:e,to:n})=>{let i;if(e){for(let n=0;n<o.length;n++)o[n][0]==e&&(i=o[n][1]);O(r,n).forEach(n=>{i||o.push([e,i=[]]),-1==i.indexOf(n)&&i.push(n)})}})});let s=i[n.join(",")]=new E(n.indexOf(r.length-1)>-1);for(let n=0;n<o.length;n++){let r=o[n][1].sort(I);s.next.push({type:o[n][0],next:i[r.join(",")]||e(r)})}return s}(O(r,0)));return function(e,n){for(let r=0,i=[e];r<i.length;r++){let e=i[r],o=!e.validEnd,s=[];for(let n=0;n<e.next.length;n++){let{type:r,next:l}=e.next[n];s.push(r.name),o&&!(r.isText||r.hasRequiredAttrs())&&(o=!1),-1==i.indexOf(l)&&i.push(l)}o&&n.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(l,o),l}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];return function s(l,a){let h=l.matchFragment(e,r);if(h&&(!n||h.validEnd))return o.from(a.map(e=>e.createAndFill()));for(let e=0;e<l.next.length;e++){let{type:n,next:r}=l.next[e];if(!(n.isText||n.hasRequiredAttrs())&&-1==i.indexOf(r)){i.push(r);let e=s(r,a.concat(n));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let e=[];for(let n=i;n.type;n=n.via)e.push(n.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:s,next:l}=o.next[e];s.isLeaf||s.hasRequiredAttrs()||s.name in n||i.type&&!l.validEnd||(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function n(r){e.push(r);for(let i=0;i<r.next.length;i++)-1==e.indexOf(r.next[i].next)&&n(r.next[i].next)}(this),e.map((n,r)=>{let i=r+(n.validEnd?"*":" ")+" ";for(let r=0;r<n.next.length;r++)i+=(r?", ":"")+n.next[r].type.name+"->"+e.indexOf(n.next[r].next);return i}).join("\n")}}E.empty=new E(!0);class T{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function R(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let n=Number(e.next);return e.pos++,n}function I(e,n){return n-e}function O(e,n){let r=[];return function n(i){let o=e[i];if(1==o.length&&!o[0].term)return n(o[0].to);r.push(i);for(let e=0;e<o.length;e++){let{term:i,to:s}=o[e];i||-1!=r.indexOf(s)||n(s)}}(n),r.sort(I)}function N(e){let n=Object.create(null);for(let r in e){let i=e[r];if(!i.hasDefault)return null;n[r]=i.default}return n}function L(e,n){let r=Object.create(null);for(let i in e){let o=n&&n[i];if(void 0===o){let n=e[i];if(n.hasDefault)o=n.default;else throw RangeError("No value supplied for attribute "+i)}r[i]=o}return r}function H(e,n,r,i){for(let i in n)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${r} of type ${i}`);for(let r in e){let i=e[r];i.validate&&i.validate(n[r])}}function z(e,n){let r=Object.create(null);if(n)for(let i in n)r[i]=new F(e,i,n[i]);return r}class B{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=z(e,r.attrs),this.defaultAttrs=N(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==E.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:L(this.attrs,e)}create(e=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new C(this,this.computeAttrs(e),o.from(n),h.setFrom(r))}createChecked(e=null,n,r){return n=o.from(n),this.checkContent(n),new C(this,this.computeAttrs(e),n,h.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),(n=o.from(n)).size){let e=this.contentMatch.fillBefore(n);if(!e)return null;n=e.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(o.empty,!0);return s?new C(this,e,n.append(s),h.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);
13if(!n||!n.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){H(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){let n;if(null==this.markSet)return e;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:h.none:e}static compile(e,n){let r=Object.create(null);e.forEach((e,i)=>r[e]=new B(e,n,i));let i=n.spec.topNode||"doc";if(!r[i])throw RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw RangeError("The text node type should not have attributes");return r}}class F{constructor(e,n,r){let i;this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate="string"==typeof r.validate?(i=r.validate.split("|"),r=>{let o=null===r?"null":typeof r;if(0>i.indexOf(o))throw RangeError(`Expected value of type ${i} for attribute ${n} on type ${e}, got ${o}`)}):r.validate}get isRequired(){return!this.hasDefault}}class ${constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=z(e,i.attrs),this.excluded=null;let o=N(this.attrs);this.instance=o?new h(this,o):null}create(e=null){return!e&&this.instance?this.instance:new h(this,L(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((e,o)=>r[e]=new $(e,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){H(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class D{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let r in e)n[r]=e[r];n.nodes=i.from(e.nodes),n.marks=i.from(e.marks||{}),this.nodes=B.compile(this.spec.nodes,this),this.marks=$.compile(this.spec.marks,this);let r=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let n=this.nodes[e],i=n.spec.content||"",o=n.spec.marks;if(n.contentMatch=r[i]||(r[i]=E.parse(i,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!n.isInline||!n.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=n}n.markSet="_"==o?null:o?P(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let e in this.marks){let n=this.marks[e],r=n.spec.excludes;n.excluded=null==r?[n]:""==r?[]:P(this,r.split(" "))}this.nodeFromJSON=e=>C.fromJSON(this,e),this.markFromJSON=e=>h.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof B){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new S(r,r.defaultAttrs,e,h.setFrom(n))}mark(e,n){return"string"==typeof e&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw RangeError("Unknown node type: "+e);return n}}function P(e,n){let r=[];for(let i=0;i<n.length;i++){let o=n[i],s=e.marks[o],l=s;if(s)r.push(s);else for(let n in e.marks){let i=e.marks[n];("_"==o||i.spec.group&&i.spec.group.split(" ").indexOf(o)>-1)&&r.push(l=i)}if(!l)throw SyntaxError("Unknown mark type: '"+n[i]+"'")}return r}class j{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let n=/[^=]*/.exec(e.style)[0];0>r.indexOf(n)&&r.push(n),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let r=e.nodes[n.node];return r.contentMatch.matchType(r)})}parse(e,n={}){let r=new J(this,n,!1);return r.addAll(e,h.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new J(this,n,!0);return r.addAll(e,h.none,n.from,n.to),d.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){var i;let r=this.tags[o];if(i=r.tag,(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,i)&&(void 0===r.namespace||e.namespaceURI==r.namespace)&&(!r.context||n.matchesContext(r.context))){if(r.getAttrs
13){let n=r.getAttrs(e);if(!1===n)continue;r.attrs=n||void 0}return r}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let i=this.styles[o],s=i.style;if(0==s.indexOf(e)&&(!i.context||r.matchesContext(i.context))&&(!(s.length>e.length)||61==s.charCodeAt(e.length)&&s.slice(e.length+1)==n)){if(i.getAttrs){let e=i.getAttrs(n);if(!1===e)continue;i.attrs=e||void 0}return i}}}static schemaRules(e){let n=[];function r(e){let r=null==e.priority?50:e.priority,i=0;for(;i<n.length;i++){let e=n[i];if((null==e.priority?50:e.priority)<r)break}n.splice(i,0,e)}for(let n in e.marks){let i=e.marks[n].spec.parseDOM;i&&i.forEach(e=>{r(e=Y(e)),e.mark||e.ignore||e.clearMark||(e.mark=n)})}for(let n in e.nodes){let i=e.nodes[n].spec.parseDOM;i&&i.forEach(e=>{r(e=Y(e)),e.node||e.ignore||e.mark||(e.node=n)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new j(e,j.schemaRules(e)))}}let U={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},W={ol:!0,ul:!0};function q(e,n,r){return null!=n?(n?1:0)|("full"===n?2:0):e&&"pre"==e.whitespace?3:-5&r}class V{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=h.none,this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(o.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let n=this.type.contentMatch,r;return(r=n.findWrapping(e.type))?(this.match=n,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],n;e&&e.isText&&(n=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==n[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-n[0].length)))}let n=o.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(o.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!U.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class J{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=q(null,n.preserveWhitespace,0)|(r?4:0);o=i?new V(i.type,i.attrs,h.none,!0,n.topMatch||i.type.contentMatch,s):r?new V(null,null,h.none,!0,null,s):new V(e.schema.topNodeType,null,h.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){3==e.nodeType?this.addTextNode(e,n):1==e.nodeType&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=2&i.options?"full":this.localPreserveWS||(1&i.options)>0,{schema:s}=this.parser;if("full"===o||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o){if("full"===o)r=r.replace(/\r\n?/g,"\n");else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let e=r.split(/\r?\n|\r/);for(let r=0;r<e.length;r++)r&&this.insertNode(s.linebreakReplacement.create(),n,!0),e[r]&&this.insertNode(s.text(e[r]),n,!/\S/.test(e[r]));r=""}else r=r.replace(/\r?\n|\r/g," ")}else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let n=i.content[i.content.length-1],o=e.previousSibling;(!n||o&&"BR"==o.nodeName||n.isText&&/[ \t\r\n\u000c]$/.test(n.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;W.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let n=e.firstChild,r=null;n;n=n.nextSibling){let e=1==n.nodeType?n.nodeName.toLowerCase():null;
13e&&W.hasOwnProperty(e)&&r?(r.appendChild(n),n=r):"li"==e?r=n:e&&(r=null)}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));n:if(a?a.ignore:_.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let r,i=this.needsBlock;if(U.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),r=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break n}let l=a&&a.skip?n:this.readStyles(e,n);l&&this.addAll(e,l),r&&this.sync(o),this.needsBlock=i}else{let r=this.readStyles(e,n);r&&this.addElementByRule(e,a,r,!1===a.consuming?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),n)}ignoreFallback(e,n){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let i=this.parser.matchedStyles[e],o=r.getPropertyValue(i);if(o)for(let e;;){let r=this.parser.matchStyle(i,o,this,e);if(!r)break;if(r.ignore)return null;if(n=r.clearMark?n.filter(e=>!r.clearMark(e)):n.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1===r.consuming)e=r;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node){if((s=this.parser.schema.nodes[n.node]).isLeaf)this.insertNode(s.create(n.attrs),r,"BR"==e.nodeName)||this.leafFallback(e,r);else{let e=this.enter(s,n.attrs||null,r,n.preserveWhitespace);e&&(o=!0,r=e)}}else{let e=this.parser.schema.marks[n.mark];r=r.concat(e.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,r,!1));else{let i=e;"string"==typeof n.contentElement?i=e.querySelector(n.contentElement):"function"==typeof n.contentElement?i=n.contentElement(e):n.contentElement&&(i=n.contentElement),this.findAround(e,i,!0),this.addAll(i,r),this.findAround(e,i,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=null==i?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n,r){let i,o;for(let n=this.open,s=0;n>=0;n--){let l=this.nodes[n],a=l.findWrapping(e);if(a&&(!i||i.length>a.length+s)&&(i=a,o=l,!a.length))break;if(l.solid){if(r)break;s+=2}}if(!i)return null;this.sync(o);for(let e=0;e<i.length;e++)n=this.enterInner(i[e],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(n=this.enterInner(e,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let n=this.top;n.match&&(n.match=n.match.matchType(e.type));let r=h.none;for(let o of i.concat(e.marks))(n.type?n.type.allowsMarkType(o.type):K(o.type,e.type))&&(r=o.addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r,!1);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=q(e,o,s.options);4&s.options&&0==s.content.length&&(l|=4);let a=h.none;return r=r.filter(n=>(s.type?!s.type.allowsMarkType(n.type):!K(n.type,e))||(a=n.addToSet(a),!1)),this.nodes.push(new V(e,n,a,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let n=r.length-1;n>=0;n--)e+=r[n].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)null==this.find[n].pos&&1==e.nodeType&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)null==this.find[i].pos&&1==e.nodeType&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(e,l)=>{for(;e>=0;e--){let a=n[e];
13if(""==a){if(e==n.length-1||0==e)continue;for(;l>=o;l--)if(s(e-1,l))return!0;return!1}{let e=l>0||0==l&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let e in this.parser.schema.nodes){let n=this.parser.schema.nodes[e];if(n.isTextblock&&n.defaultAttrs)return n}}}function Y(e){let n={};for(let r in e)n[r]=e[r];return n}function K(e,n){let r=n.schema.nodes;for(let i in r){let o=r[i];if(!o.allowsMarkType(e))continue;let s=[],l=e=>{s.push(e);for(let r=0;r<e.edgeCount;r++){let{type:i,next:o}=e.edge(r);if(i==n||0>s.indexOf(o)&&l(o))return!0}};if(l(o.contentMatch))return!0}}class Q{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=G(n).createDocumentFragment());let i=r,o=[];return e.forEach(e=>{if(o.length||e.marks.length){let r=0,s=0;for(;r<o.length&&s<e.marks.length;){let n=e.marks[s];if(!this.marks[n.type.name]){s++;continue}if(!n.eq(o[r][0])||!1===n.type.spec.spanning)break;r++,s++}for(;r<o.length;)i=o.pop()[1];for(;s<e.marks.length;){let r=e.marks[s++],l=this.serializeMark(r,e.isInline,n);l&&(o.push([r,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(e,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=ee(G(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&ee(G(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return ee(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Q(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Z(e.nodes);return n.text||(n.text=e=>e.text),n}static marksFromSchema(e){return Z(e.marks)}}function Z(e){let n={};for(let r in e){let i=e[r].spec.toDOM;i&&(n[r]=i)}return n}function G(e){return e.document||window.document}let X=new WeakMap;function ee(e,n,r,i){let o,s,l;if("string"==typeof n)return{dom:e.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;let a=n[0],h;if("string"!=typeof a)throw RangeError("Invalid array passed to renderSpec");if(i&&(void 0===(s=X.get(i))&&X.set(i,(l=null,function e(n){if(n&&"object"==typeof n){if(Array.isArray(n)){if("string"==typeof n[0])l||(l=[]),l.push(n);else for(let r=0;r<n.length;r++)e(n[r])}else for(let r in n)e(n[r])}}(i),s=l)),h=s)&&h.indexOf(n)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let c=a.indexOf(" ");c>0&&(r=a.slice(0,c),a=a.slice(c+1));let d=r?e.createElementNS(r,a):e.createElement(a),u=n[1],p=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u)){for(let e in p=2,u)if(null!=u[e]){let n=e.indexOf(" ");n>0?d.setAttributeNS(e.slice(0,n),e.slice(n+1),u[e]):"style"==e&&d.style?d.style.cssText=u[e]:d.setAttribute(e,u[e])}}for(let s=p;s<n.length;s++){let l=n[s];if(0===l){if(s<n.length-1||s>p)throw RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}{let{dom:n,contentDOM:s}=ee(e,l,r,i);if(d.appendChild(n),s){if(o)throw RangeError("Multiple content holes");o=s}}}return{dom:d,contentDOM:o}}},3452:function(e,n,r){r.d(n,{IB:function(){return l},KI:function(){return s},bw:function(){return a}});var i=r(94536),o=r(10121);function s(e,n=null){return function(r,s){let{$from:l,$to:a}=r.selection,h=l.blockRange(a);if(!h)return!1;let c=s?r.tr:null;return!!function(e,n,r,s=null){let l=!1,a=n,h=n.$from.doc;if(n.depth>=2&&n.$from.node(n.depth-1).type.compatibleContent(r)&&0==n.startIndex){
13if(0==n.$from.index(n.depth-1))return!1;let e=h.resolve(n.start-2);a=new o.Ts(e,e,n.depth),n.endIndex<n.parent.childCount&&(n=new o.Ts(n.$from,h.resolve(n.$to.end(n.depth)),n.depth)),l=!0}let c=(0,i.nd)(a,r,s,n);return!!c&&(e&&function(e,n,r,s,l){let a=o.HY.empty;for(let e=r.length-1;e>=0;e--)a=o.HY.from(r[e].type.create(r[e].attrs,a));e.step(new i.FC(n.start-(s?2:0),n.end,n.start,n.end,new o.p2(a,0,0),r.length,!0));let h=0;for(let e=0;e<r.length;e++)r[e].type==l&&(h=e+1);let c=r.length-h,d=n.start+r.length-(s?2:0),u=n.parent;for(let r=n.startIndex,o=n.endIndex,s=!0;r<o;r++,s=!1)!s&&(0,i.Ax)(e.doc,d,c)&&(e.split(d,c),d+=2*c),d+=u.child(r).nodeSize}(e,n,c,l,r),!0)}(c,h,e,n)&&(s&&s(c.scrollIntoView()),!0)}}function l(e){return function(n,r){let{$from:s,$to:l}=n.selection,a=s.blockRange(l,n=>n.childCount>0&&n.firstChild.type==e);return!!a&&(!r||(s.node(a.depth-1).type==e?function(e,n,r,s){let l=e.tr,a=s.end,h=s.$to.end(s.depth);a<h&&(l.step(new i.FC(a-1,h,a,h,new o.p2(o.HY.from(r.create(null,s.parent.copy())),1,0),1,!0)),s=new o.Ts(l.doc.resolve(s.$from.pos),l.doc.resolve(h),s.depth));let c=(0,i.k9)(s);if(null==c)return!1;l.lift(s,c);let d=l.doc.resolve(l.mapping.map(a,-1)-1);return(0,i.Mn)(l.doc,d.pos)&&d.nodeBefore.type==d.nodeAfter.type&&l.join(d.pos),n(l.scrollIntoView()),!0}(n,r,e,a):function(e,n,r){let s=e.tr,l=r.parent;for(let e=r.end,n=r.endIndex-1,i=r.startIndex;n>i;n--)e-=l.child(n).nodeSize,s.delete(e-1,e+1);let a=s.doc.resolve(r.start),h=a.nodeAfter;if(s.mapping.map(r.end)!=r.start+a.nodeAfter.nodeSize)return!1;let c=0==r.startIndex,d=r.endIndex==l.childCount,u=a.node(-1),p=a.index(-1);if(!u.canReplace(p+(c?0:1),p+1,h.content.append(d?o.HY.empty:o.HY.from(l))))return!1;let f=a.pos,m=f+h.nodeSize;return s.step(new i.FC(f-(c?1:0),m+(d?1:0),f+1,m-1,new o.p2((c?o.HY.empty:o.HY.from(l.copy(o.HY.empty))).append(d?o.HY.empty:o.HY.from(l.copy(o.HY.empty))),c?0:1,d?0:1),c?0:1)),n(s.scrollIntoView()),!0}(n,r,a)))}}function a(e){return function(n,r){let{$from:s,$to:l}=n.selection,a=s.blockRange(l,n=>n.childCount>0&&n.firstChild.type==e);if(!a)return!1;let h=a.startIndex;if(0==h)return!1;let c=a.parent,d=c.child(h-1);if(d.type!=e)return!1;if(r){let s=d.lastChild&&d.lastChild.type==c.type,l=o.HY.from(s?e.create():null),h=new o.p2(o.HY.from(e.create(null,o.HY.from(c.type.create(null,l)))),s?3:1,0),u=a.start,p=a.end;r(n.tr.step(new i.FC(u-(s?3:1),p,u,p,h,1,!0)).scrollIntoView())}return!0}}},17213:function(e,n,r){r.d(n,{Bs:function(){return d},C1:function(){return m},H$:function(){return T},Sy:function(){return S},Y1:function(){return l},qv:function(){return p},xm:function(){return a},yy:function(){return C}});var i=r(10121),o=r(94536);let s=Object.create(null);class l{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new a(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=i.p2.empty){let r=n.content.lastChild,o=null;for(let e=0;e<n.openEnd;e++)o=r,r=r.lastChild;let s=e.steps.length,l=this.ranges;for(let a=0;a<l.length;a++){let{$from:h,$to:c}=l[a],d=e.mapping.slice(s);e.replaceRange(d.map(h.pos),d.map(c.pos),a?i.p2.empty:n),0==a&&w(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:l}=i[o],a=e.mapping.slice(r),h=a.map(s.pos),c=a.map(l.pos);o?e.deleteRange(h,c):(e.replaceRangeWith(h,c,n),w(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new d(e):y(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let i=e.depth-1;i>=0;i--){let o=n<0?y(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):y(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new m(e.node(0))}static atStart(e){return y(e,e,0,0,1)||new m(e)}static atEnd(e){return y(e,e,e.content.size,e.childCount,-1)||new m(e)}static fromJSON(e,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=s[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in s)throw RangeError("Duplicate use of selection JSON ID "+e);return s[e]=n,n.prototype.jsonID=e,n}getBookmark(){return d.between(this.$anchor,this.$head).getBookmark()}}l.prototype.visible=!0;class a{constructor(e,n){this.$from=e,this.$to=n}}let h=!1;function c(e){h||e.parent.inlineContent||(h=!0,console.warn("TextSelection endpoint not pointing into a 
13node with inline content ("+e.parent.type.name+")"))}class d extends l{constructor(e,n=e){c(e),c(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return l.near(r);let i=e.resolve(n.map(this.anchor));return new d(i.parent.inlineContent?i:r,r)}replace(e,n=i.p2.empty){if(super.replace(e,n),n==i.p2.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof d&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new u(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new d(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=l.findFrom(n,r,!0)||l.findFrom(n,-r,!0);if(!e)return l.near(n,r);n=e.$head}return e.parent.inlineContent||(0==i?e=n:(e=(l.findFrom(e,-r,!0)||l.findFrom(e,r,!0)).$anchor).pos<n.pos==i<0||(e=n)),new d(e,n)}}l.jsonID("text",d);class u{constructor(e,n){this.anchor=e,this.head=n}map(e){return new u(e.map(this.anchor),e.map(this.head))}resolve(e){return d.between(e.resolve(this.anchor),e.resolve(this.head))}}class p extends l{constructor(e){let n=e.nodeAfter;super(e,e.node(0).resolve(e.pos+n.nodeSize)),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?l.near(o):new p(o)}content(){return new i.p2(i.HY.from(this.node),0,0)}eq(e){return e instanceof p&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new f(this.anchor)}static fromJSON(e,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new p(e.resolve(n.anchor))}static create(e,n){return new p(e.resolve(n))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}p.prototype.visible=!1,l.jsonID("node",p);class f{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new u(r,r):new f(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&p.isSelectable(r)?new p(n):l.near(n)}}class m extends l{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=i.p2.empty){if(n==i.p2.empty){e.delete(0,e.doc.content.size);let n=l.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new m(e)}map(e){return new m(e)}eq(e){return e instanceof m}getBookmark(){return g}}l.jsonID("all",m);let g={map(){return this},resolve:e=>new m(e)};function y(e,n,r,i,o,s=!1){if(n.inlineContent)return d.create(e,r);for(let l=i-(o>0?0:1);o>0?l<n.childCount:l>=0;l+=o){let i=n.child(l);if(i.isAtom){if(!s&&p.isSelectable(i))return p.create(e,r-(o<0?i.nodeSize:0))}else{let n=y(e,i,r+o,o<0?i.childCount:0,o,s);if(n)return n}r+=i.nodeSize*o}return null}function w(e,n,r){let i,s=e.steps.length-1;if(s<n)return;let a=e.steps[s];(a instanceof o.Pu||a instanceof o.FC)&&(e.mapping.maps[s].forEach((e,n,r,o)=>{null==i&&(i=o)}),e.setSelection(l.near(e.doc.resolve(i),r)))}class v extends o.wx{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return i.vc.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,n){super.addStep(e,n),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||i.vc.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(null==n)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(null==r&&(r=n),!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let e=this.doc.resolve(n);o=r==n?e.marks():e.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.selection.to!=n+e.length||this.setSelection(l.near(this.selection.$to)),this}}setMeta(e,n){return this.meta["string"==typeof e?e:e.key]=n,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function b(e,n){return n&&e?e.bind(n):e}class k{constructor(e,n,r){this.name=e,this.init=b(n.init,r),this.apply=b(n.apply,r)}}let A=[new k("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}
13),new k("selection",{init:(e,n)=>e.selection||l.atStart(n.doc),apply:e=>e.selection}),new k("storedMarks",{init:e=>e.storedMarks||null,apply:(e,n,r,i)=>i.selection.$cursor?e.storedMarks:null}),new k("scrollToSelection",{init:()=>0,apply:(e,n)=>e.scrolledIntoView?n+1:n})];class x{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=A.slice(),n&&n.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new k(e.key,e.spec.state,e))})}}class C{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let n=this.config.plugins[r];if(n.spec.filterTransaction&&!n.spec.filterTransaction.call(n,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let a=i?i[s].n:0,h=i?i[s].state:this,c=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,h,r);if(c&&r.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let e=0;e<this.config.plugins.length;e++)i.push(e<s?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let n=new C(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new v(this)}static create(e){let n=new x(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new C(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new x(this.schema,e.plugins),r=n.fields,i=new C(n);for(let n=0;n<r.length;n++){let o=r[n].name;i[o]=this.hasOwnProperty(o)?this[o]:r[n].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let r in e){if("doc"==r||"selection"==r)throw RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let o=new x(e.schema,e.plugins),s=new C(o);return o.fields.forEach(o=>{if("doc"==o.name)s.doc=i.NB.fromJSON(e.schema,n.doc);else if("selection"==o.name)s.selection=l.fromJSON(s.doc,n.selection);else if("storedMarks"==o.name)n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let i in r){let l=r[i],a=l.spec.state;if(l.key==o.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){s[o.name]=a.fromJSON.call(l,e,n[i],s);return}}s[o.name]=o.init(e,s)}}),s}}class S{constructor(e){this.spec=e,this.props={},e.props&&function e(n,r,i){for(let o in n){let s=n[o];s instanceof Function?s=s.bind(r):"handleDOMEvents"==o&&(s=e(s,r,{})),i[o]=s}return i}(e.props,this,this.props),this.key=e.key?e.key.key:E("plugin")}getState(e){return e[this.key]}}let M=Object.create(null);function E(e){return e in M?e+"$"+ ++M[e]:(M[e]=0,e+"$")}class T{constructor(e="key"){this.key=E(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},94536:function(e,n,r){r.d(n,{Ax:function(){return S},FC:function(){return y},GJ:function(){return T},Mn:function(){return M},Pu:function(){return g},dR:function(){return I},k9:function(){return b},nd:function(){return k},nj:function(){return R},vs:function(){return l},wx:function(){return j},xu:function(){return p}});var i=r(10121);class o{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class s{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&s.empty)return s.empty}recover(e){let n=0,r=65535&e;if(!this.inverted)for(let e=0;e<r;e++)n+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*r]+n+(e-(65535&e))/65536}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,l=this.inverted?1:2;
13for(let a=0;a<this.ranges.length;a+=3){let h=this.ranges[a]-(this.inverted?i:0);if(h>e)break;let c=this.ranges[a+s],d=this.ranges[a+l],u=h+c;if(e<=u){let s=c?e==h?-1:e==u?1:n:n,l=h+i+(s<0?0:d);if(r)return l;let p=e==(n<0?h:u)?null:a/3+(e-h)*65536,f=e==h?2:e==u?1:4;return(n<0?e!=h:e!=u)&&(f|=8),new o(l,f,p)}i+=d-c}return r?e+i:new o(e+i,0,null)}touches(e,n){let r=0,i=65535&n,o=this.inverted?2:1,s=this.inverted?1:2;for(let n=0;n<this.ranges.length;n+=3){let l=this.ranges[n]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[n+o];if(e<=l+a&&n==3*i)return!0;r+=this.ranges[n+s]-a}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),a=s+(this.inverted?0:o),h=this.ranges[i+n],c=this.ranges[i+r];e(l,l+h,a,a+c),o+=c-h}}invert(){return new s(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?s.empty:new s(e<0?[0,-e,0]:[0,0,e])}}s.empty=new s([]);class l{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new l(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=n&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],null!=i&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),null!=i&&i>n?r-i-1:void 0)}}invert(){let e=new l;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let r=this.from;r<this.to;r++){let o=this._maps[r].mapResult(e,n);if(null!=o.recover){let n=this.getMirror(r);if(null!=n&&n>r&&n<this.to){r=n,e=this._maps[n].recover(o.recover);continue}}i|=o.delInfo,e=o.pos}return r?e:new o(e,i,null)}}let a=Object.create(null);class h{getMap(){return s.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=a[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in a)throw RangeError("Duplicate use of step JSON ID "+e);return a[e]=n,n.prototype.jsonID=e,n}}class c{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new c(e,null)}static fail(e){return new c(null,e)}static fromReplace(e,n,r,o){try{return c.ok(e.replace(n,r,o))}catch(e){if(e instanceof i.e4)return c.fail(e.message);throw e}}}function d(e,n,r){let o=[];for(let i=0;i<e.childCount;i++){let s=e.child(i);s.content.size&&(s=s.copy(d(s.content,n,s))),s.isInline&&(s=n(s,r,i)),o.push(s)}return i.HY.fromArray(o)}class u extends h{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),s=new i.p2(d(n.content,(e,n)=>e.isAtom&&n.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,o),n.openStart,n.openEnd);return c.fromReplace(e,this.from,this.to,s)}invert(){return new p(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new u(n.pos,r.pos,this.mark)}merge(e){return e instanceof u&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new u(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new u(n.from,n.to,e.markFromJSON(n.mark))}}h.jsonID("addMark",u);class p extends h{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new i.p2(d(n.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),n.openStart,n.openEnd);return c.fromReplace(e,this.from,this.to,r)}invert(){return new u(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new p(n.pos,r.pos,this.mark)}merge(e){return e instanceof p&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new p(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new p(n.from,n.to,e.markFromJSON(n.mark))}}h.jsonID("removeMark",p);class f extends h{constructor(e,n){super(),this.pos=e,this.mark=n}
13apply(e){let n=e.nodeAt(this.pos);if(!n)return c.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return c.fromReplace(e,this.pos,this.pos+1,new i.p2(i.HY.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let e=this.mark.addToSet(n.marks);if(e.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(e))return new f(this.pos,n.marks[r]);return new f(this.pos,this.mark)}}return new m(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new f(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new f(n.pos,e.markFromJSON(n.mark))}}h.jsonID("addNodeMark",f);class m extends h{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return c.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return c.fromReplace(e,this.pos,this.pos+1,new i.p2(i.HY.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new f(this.pos,this.mark):this}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new m(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new m(n.pos,e.markFromJSON(n.mark))}}h.jsonID("removeNodeMark",m);class g extends h{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&w(e,this.from,this.to)?c.fail("Structure replace would overwrite content"):c.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new s([this.from,this.to-this.from,this.slice.size])}invert(e){return new g(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new g(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof g)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let n=this.slice.size+e.slice.size==0?i.p2.empty:new i.p2(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new g(e.from,this.to,n,this.structure)}}{let n=this.slice.size+e.slice.size==0?i.p2.empty:new i.p2(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new g(this.from,this.to+(e.to-e.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new g(n.from,n.to,i.p2.fromJSON(e,n.slice),!!n.structure)}}h.jsonID("replace",g);class y extends h{constructor(e,n,r,i,o,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(w(e,this.from,this.gapFrom)||w(e,this.gapTo,this.to)))return c.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return c.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?c.fromReplace(e,this.from,this.to,r):c.fail("Content does not fit in gap")}getMap(){return new s([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new y(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new y(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new y(n.from,n.to,n.gapFrom,n.gapTo,i.p2.fromJSON(e,n.slice),n.insert,!!n.structure)}}function w(e,n,r){let i=e.resolve(n),o=r-n,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let e=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function v(e,n,r,o=r.contentMatch,s=!0){let l=e.doc.nodeAt(n),a=[],h=n+1;for(let n=0;n<l.childCount;n++){let c=l.child(n),d=h+c.nodeSize,u=o.matchType(c.type);if(u){o=u;for(let n=0;n<c.marks.length;n++)r.allowsMarkType(c.marks[n].type)||e.step(new p(h,d,c.marks[n]));if(s&&c.isText&&"pre"!=r.whitespace){let e,n=/\r?\n|\r/g,o;for(;e=n.exec(c.text);)o||(o=new i.p2(i.HY.from(r.schema.text(" ",r.allowedMarks(c.marks))),0,0)),a.push(new g(h+e.index,h+e.index+e[0].length,o))}}else a.push(new g(h,d,i.p2.empty));h=d}
13if(!o.validEnd){let n=o.fillBefore(i.HY.empty,!0);e.replace(h,h,new i.p2(n,0,0))}for(let n=a.length-1;n>=0;n--)e.step(a[n])}function b(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,o=0;;--r){let s=e.$from.node(r),l=e.$from.index(r)+i,a=e.$to.indexAfter(r)-o;if(r<e.depth&&s.canReplace(l,a,n))return r;if(0==r||s.type.spec.isolating||!((0==l||s.canReplace(l,s.childCount))&&(a==s.childCount||s.canReplace(0,a))))break;l&&(i=1),a<s.childCount&&(o=1)}return null}function k(e,n,r=null,i=e){let o=function(e,n){let{parent:r,startIndex:i,endIndex:o}=e,s=r.contentMatchAt(i).findWrapping(n);if(!s)return null;let l=s.length?s[0]:n;return r.canReplaceWith(i,o,l)?s:null}(e,n),s=o&&function(e,n){let{parent:r,startIndex:i,endIndex:o}=e,s=r.child(i),l=n.contentMatch.findWrapping(s.type);if(!l)return null;let a=(l.length?l[l.length-1]:n).contentMatch;for(let e=i;a&&e<o;e++)a=a.matchType(r.child(e).type);return a&&a.validEnd?l:null}(i,n);return s?o.map(A).concat({type:n,attrs:r}).concat(s.map(A)):null}function A(e){return{type:e,attrs:null}}function x(e,n,r,i){n.forEach((o,s)=>{if(o.isText){let l,a=/\r?\n|\r/g;for(;l=a.exec(o.text);){let o=e.mapping.slice(i).map(r+1+s+l.index);e.replaceWith(o,o+1,n.type.schema.linebreakReplacement.create())}}})}function C(e,n,r,i){n.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(i).map(r+1+s);e.replaceWith(o,o+1,n.type.schema.text("\n"))}})}function S(e,n,r=1,i){let o=e.resolve(n),s=o.depth-r,l=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!l.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,n=r-2;e>s;e--,n--){let r=o.node(e),s=o.index(e);if(r.type.spec.isolating)return!1;let l=r.content.cutByIndex(s,r.childCount),a=i&&i[n+1];a&&(l=l.replaceChild(0,a.type.create(a.attrs)));let h=i&&i[n]||r;if(!r.canReplace(s+1,r.childCount)||!h.type.validContent(l))return!1}let a=o.indexAfter(s),h=i&&i[0];return o.node(s).canReplaceWith(a,a,h?h.type:o.node(s+1).type)}function M(e,n){let r=e.resolve(n),i=r.index();return E(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}
13function E(e,n){return!!(e&&n&&!e.isLeaf&&function(e,n){n.content.size||e.type.compatibleContent(n.type);let r=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o<n.childCount;o++){let s=n.child(o),l=s.type==i?e.type.schema.nodes.text:s.type;if(!(r=r.matchType(l))||!e.type.allowsMarks(s.marks))return!1}return r.validEnd}(e,n))}function T(e,n,r=-1){let i=e.resolve(n);for(let e=i.depth;;e--){let o,s,l=i.index(e);if(e==i.depth?(o=i.nodeBefore,s=i.nodeAfter):r>0?(o=i.node(e+1),l++,s=i.node(e).maybeChild(l)):(o=i.node(e).maybeChild(l-1),s=i.node(e+1)),o&&!o.isTextblock&&E(o,s)&&i.node(e).canReplace(l,l+1))return n;if(0==e)break;n=r<0?i.before(e):i.after(e)}}function R(e,n,r){let i=e.resolve(n);if(!r.content.size)return n;let o=r.content;for(let e=0;e<r.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==r.openStart&&r.size?2:1);e++)for(let n=i.depth;n>=0;n--){let r=n==i.depth?0:i.pos<=(i.start(n+1)+i.end(n+1))/2?-1:1,s=i.index(n)+(r>0?1:0),l=i.node(n),a=!1;if(1==e)a=l.canReplace(s,s,o);else{let e=l.contentMatchAt(s).findWrapping(o.firstChild.type);a=e&&l.canReplaceWith(s,s,e[0])}if(a)return 0==r?i.pos:r<0?i.before(n+1):i.after(n+1)}return null}function I(e,n,r=n,o=i.p2.empty){if(n==r&&!o.size)return null;let s=e.resolve(n),l=e.resolve(r);return O(s,l,o)?new g(n,r,o):new N(s,l,o).fit()}function O(e,n,r){return!r.openStart&&!r.openEnd&&e.start()==n.start()&&e.parent.canReplace(e.index(),n.index(),r.content)}h.jsonID("replaceAround",y);class N{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=i.HY.empty;for(let n=0;n<=e.depth;n++){let r=e.node(n);this.frontier.push({type:r.type,match:r.contentMatchAt(e.indexAfter(n))})}for(let n=e.depth;n>0;n--)this.placed=i.HY.from(e.node(n).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let s=this.placed,l=r.depth,a=o.depth;for(;l&&a&&1==s.childCount;)s=s.firstChild.content,l--,a--;let h=new i.p2(s,l,a);return e>-1?new y(r.pos,e,this.$to.pos,this.$to.end(),h,n):h.size||r.pos!=this.$to.pos?new g(r.pos,o.pos,h):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=1==n?e:this.unplaced.openStart;r>=0;r--){let e=null,o=(r?(e=z(this.unplaced.content,r-1).firstChild).content:this.unplaced.content).firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:a}=this.frontier[s],h,c=null;if(1==n&&(o?a.matchType(o.type)||(c=a.fillBefore(i.HY.from(o),!1)):e&&l.compatibleContent(e.type)))return{sliceDepth:r,frontierDepth:s,parent:e,inject:c};if(2==n&&o&&(h=a.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:s,parent:e,wrap:h};if(e&&a.matchType(e.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=z(e,n);return!!o.childCount&&!o.firstChild.isLeaf&&(this.unplaced=new i.p2(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=z(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new i.p2(L(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new i.p2(L(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let e=0;e<s.length;e++)this.openFrontierNode(s[e]);let l=this.unplaced,a=r?r.content:l.content,h=l.openStart-e,c=0,d=[],{match:u,type:p}=this.frontier[n];if(o){for(let e=0;e<o.childCount;e++)d.push(o.child(e));u=u.matchFragment(o)}let f=a.size+e-(l.content.size-l.openEnd);for(;c<a.childCount;){let e=a.child(c),n=u.matchType(e.type);if(!n)break;(++c>1||0==h||e.content.size)&&(u=n,d.push(function e(n,r,o){if(r<=0)return n;let s=n.content;return r>1&&(s=s.replaceChild(0,e(s.firstChild,r-1,1==s.childCount?o-1:0))),r>0&&(s=n.type.contentMatch.fillBefore(s).append(s),o<=0&&(s=s.append(n.t
vendor: 4,306 bytes, line 13
13ype.contentMatch.matchFragment(s).fillBefore(i.HY.empty,!0)))),n.copy(s)}(e.mark(p.allowedMarks(e.marks)),1==c?h:0,c==a.childCount?f:-1)))}let m=c==a.childCount;m||(f=-1),this.placed=H(this.placed,n,i.HY.from(d)),this.frontier[n].match=u,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,n=a;e<f;e++){let e=n.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),n=e.content}this.unplaced=m?0==e?i.p2.empty:new i.p2(L(l.content,e-1,1),e-1,f<0?l.openEnd:e-1):new i.p2(L(l.content,e,c),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!B(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return -1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){r:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=B(e,n,i,r,o);if(s){for(let r=n-1;r>=0;r--){let{match:n,type:i}=this.frontier[r],o=B(e,r,i,n,!0);if(!o||o.childCount)continue r}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=H(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let n=e.node(r),i=n.type.contentMatch.fillBefore(n.content,!0,e.index(r));this.openFrontierNode(n.type,n.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=H(this.placed,this.depth,i.HY.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(i.HY.empty,!0);e.childCount&&(this.placed=H(this.placed,this.frontier.length,e))}}function L(e,n,r){return 0==n?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(L(e.firstChild.content,n-1,r)))}function H(e,n,r){return 0==n?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(H(e.lastChild.content,n-1,r)))}function z(e,n){for(let r=0;r<n;r++)e=e.firstChild.content;return e}function B(e,n,r,i,o){let s=e.node(n),l=o?e.indexAfter(n):e.index(n);if(l==s.childCount&&!r.compatibleContent(s.type))return null;let a=i.fillBefore(s.content,!0,l);return a&&!function(e,n,r){for(let i=r;i<n.childCount;i++)if(!e.allowsMarks(n.child(i).marks))return!0;return!1}(r,s.content,l)?a:null}function F(e,n){let r=[],i=Math.min(e.depth,n.depth);for(let o=i;o>=0;o--){let i=e.start(o);if(i<e.pos-(e.depth-o)||n.end(o)>n.pos+(n.depth-o)||e.node(o).type.spec.isolating||n.node(o).type.spec.isolating)break;(i==n.start(o)||o==e.depth&&o==n.depth&&e.parent.inlineContent&&n.parent.inlineContent&&o&&n.start(o-1)==i-1)&&r.push(o)}return r}class $ extends h{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return c.fail("No node at attribute step's position");let r=Object.create(null);for(let e in n.attrs)r[e]=n.attrs[e];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return c.fromReplace(e,this.pos,this.pos+1,new i.p2(i.HY.from(o),0,n.isLeaf?0:1))}getMap(){return s.empty}invert(e){return new $(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new $(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new $(n.pos,n.attr,n.value)}}h.jsonID("attr",$);class D extends h{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let r in e.attrs)n[r]=e.attrs[r];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return c.ok(r)}getMap(){return s.empty}invert(e){return new D(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if("string"!=typeof n.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new D(n.attr,n.value)}}h.jsonID("docAttr",D);
13let P=class extends Error{};(P=function e(n){let r=Error.call(this,n);return r.__proto__=e.prototype,r}).prototype=Object.create(Error.prototype),P.prototype.constructor=P,P.prototype.name="TransformError";class j{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new l}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new P(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((r,i,o,s)=>{e=Math.min(e,o),n=Math.max(n,s)})}return 1e9==e?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=i.p2.empty){let o=I(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new i.p2(i.HY.from(r),0,0))}delete(e,n){return this.replace(e,n,i.p2.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return!function(e,n,r,o){if(!o.size)return e.deleteRange(n,r);let s=e.doc.resolve(n),l=e.doc.resolve(r);if(O(s,l,o))return e.step(new g(n,r,o));let a=F(s,l);0==a[a.length-1]&&a.pop();let h=-(s.depth+1);a.unshift(h);for(let e=s.depth,n=s.pos-1;e>0;e--,n--){let r=s.node(e).type.spec;if(r.defining||r.definingAsContext||r.isolating)break;a.indexOf(e)>-1?h=e:s.before(e)==n&&a.splice(1,0,-e)}let c=a.indexOf(h),d=[],u=o.openStart;for(let e=o.content,n=0;;n++){let r=e.firstChild;if(d.push(r),n==o.openStart)break;e=r.content}for(let e=u-1;e>=0;e--){var p;let n=d[e],r=(p=n.type).spec.defining||p.spec.definingForContent;if(r&&!n.sameMarkup(s.node(Math.abs(h)-1)))u=e;else if(r||!n.type.isTextblock)break}for(let n=o.openStart;n>=0;n--){let h=(n+u+1)%(o.openStart+1),p=d[h];if(p)for(let n=0;n<a.length;n++){let d=a[(n+c)%a.length],u=!0;d<0&&(u=!1,d=-d);let f=s.node(d-1),m=s.index(d-1);if(f.canReplaceWith(m,m,p.type,p.marks))return e.replace(s.before(d),u?l.after(d):r,new i.p2(function e(n,r,o,s,l){if(r<o){let i=n.firstChild;n=n.replaceChild(0,i.copy(e(i.content,r+1,o,s,i)))}if(r>s){let e=l.contentMatchAt(0),r=e.fillBefore(n).append(n);n=r.append(e.matchFragment(r).fillBefore(i.HY.empty,!0))}return n}(o.content,0,o.openStart,h),h,o.openEnd))}}let f=e.steps.length;for(let i=a.length-1;i>=0&&(e.replace(n,r,o),!(e.steps.length>f));i--){let e=a[i];e<0||(n=s.before(e),r=l.after(e))}}(this,e,n,r),this}replaceRangeWith(e,n,r){return!function(e,n,r,o){if(!o.isInline&&n==r&&e.doc.resolve(n).parent.content.size){let i=function(e,n,r){let i=e.resolve(n);if(i.parent.canReplaceWith(i.index(),i.index(),r))return n;if(0==i.parentOffset)for(let e=i.depth-1;e>=0;e--){let n=i.index(e);if(i.node(e).canReplaceWith(n,n,r))return i.before(e+1);if(n>0)return null}if(i.parentOffset==i.parent.content.size)for(let e=i.depth-1;e>=0;e--){let n=i.indexAfter(e);if(i.node(e).canReplaceWith(n,n,r))return i.after(e+1);if(n<i.node(e).childCount)break}return null}(e.doc,n,o.type);null!=i&&(n=r=i)}e.replaceRange(n,r,new i.p2(i.HY.from(o),0,0))}(this,e,n,r),this}deleteRange(e,n){return!function(e,n,r){let i=e.doc.resolve(n),o=e.doc.resolve(r),s=F(i,o);for(let n=0;n<s.length;n++){let r=s[n],l=n==s.length-1;if(l&&0==r||i.node(r).type.contentMatch.validEnd)return e.delete(i.start(r),o.end(r));if(r>0&&(l||i.node(r-1).canReplace(i.index(r-1),o.indexAfter(r-1))))return e.delete(i.before(r),o.after(r))}for(let s=1;s<=i.depth&&s<=o.depth;s++)if(n-i.start(s)==i.depth-s&&r>i.end(s)&&o.end(s)-r!=o.depth-s&&i.start(s-1)==o.start(s-1)&&i.node(s-1).canReplace(i.index(s-1),o.index(s-1)))return e.delete(i.before(s),r);e.delete(n,r)}(this,e,n),this}lift(e,n){return!function(e,n,r){let{$from:o,$to:s,depth:l}=n,a=o.before(l+1),h=s.after(l+1),c=a,d=h,u=i.HY.empty,p=0;for(let e=l,n=!1;e>r;e--)n||o.index(e)>0?(n=!0,u=i.HY.from(o.node(e).copy(u)),p++):c--;let f=i.HY.empty,m=0;for(let e=l,n=!1;e>r;e--)n||s.after(e+1)<s.end(e)?(n=!0,f=i.HY.from(s.node(e).copy(f)),m++):d++;e.step(new y(c,d,a,h,new i.p2(u.append(f),p,m),u.size-p,!0))}(this,e,n),this}join(e,n=1){return!function(e,n,r){let o=null,{linebreakReplacement:s}=e.doc.type.schema,l=e.doc.resolve(n-r),a=l.node().type;if(s&&a.inlineContent){let e="pre"==a.whitespace,n=!!a.contentMatch.matchType(s);e&&!n?o=!1:!e&&n&&(o=!0)}let h=e.steps.length;if(!1===o){let i=e.doc.resolve(n+r);C(e,i.node(),i.before(),h)}a.inlineContent&&v(e,n+r-1,a,l.node().contentMatchAt(l.index()),null==o);let c=e.mapping.slice(h),d=c.map(n-r);if(e.step(new g(d,c.map(n+r,-1),i.p2.empty,!0)),!0===o){let n=e.doc.resolve(d);x(e,n.node(),n.before(),e.steps.length)}}(this,e,n),this}wrap(e,n){return!function(e,n,r){let o=i.HY.empty;for(let e=r.length-1;e>=0;e--){if(o.size){let n=r[e].type.contentMatch.matchFragment(o);if(!n||!n.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=i.HY.from(r[e].type.create(r[e].attrs,o))}let s=n.start,l=n.end;e.step(new y(s,l,s,l,new i.p2(o,0,0),r.length,!0))}(this,e,n),this}setBlockType(e,n=e,r,o=null){return!function(e,n,r,o,s){if(!o.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let l=e.steps.length;e.doc.nodesBetween(n,r,(n,r)=>{var a,h;let c,d,u="function"==typeof s?s(n):s;
13if(n.isTextblock&&!n.hasMarkup(o,u)&&(a=e.doc,h=e.mapping.slice(l).map(r),d=(c=a.resolve(h)).index(),c.parent.canReplaceWith(d,d+1,o))){let s=null;if(o.schema.linebreakReplacement){let e="pre"==o.whitespace,n=!!o.contentMatch.matchType(o.schema.linebreakReplacement);e&&!n?s=!1:!e&&n&&(s=!0)}!1===s&&C(e,n,r,l),v(e,e.mapping.slice(l).map(r,1),o,void 0,null===s);let a=e.mapping.slice(l),h=a.map(r,1),c=a.map(r+n.nodeSize,1);return e.step(new y(h,c,h+1,c-1,new i.p2(i.HY.from(o.create(u,null,n.marks)),0,0),1,!0)),!0===s&&x(e,n,r,l),!1}})}(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return!function(e,n,r,o,s){let l=e.doc.nodeAt(n);if(!l)throw RangeError("No node at given position");r||(r=l.type);let a=r.create(o,null,s||l.marks);if(l.isLeaf)return e.replaceWith(n,n+l.nodeSize,a);if(!r.validContent(l.content))throw RangeError("Invalid content for node type "+r.name);e.step(new y(n,n+l.nodeSize,n+1,n+l.nodeSize-1,new i.p2(i.HY.from(a),0,0),1,!0))}(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new $(e,n,r)),this}setDocAttribute(e,n){return this.step(new D(e,n)),this}addNodeMark(e,n){return this.step(new f(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw RangeError("No node at position "+e);if(n instanceof i.vc)n.isInSet(r.marks)&&this.step(new m(e,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new m(e,o)),i=o.removeFromSet(i);for(let e=s.length-1;e>=0;e--)this.step(s[e])}return this}split(e,n=1,r){return!function(e,n,r=1,o){let s=e.doc.resolve(n),l=i.HY.empty,a=i.HY.empty;for(let e=s.depth,n=s.depth-r,h=r-1;e>n;e--,h--){l=i.HY.from(s.node(e).copy(l));let n=o&&o[h];a=i.HY.from(n?n.type.create(n.attrs,a):s.node(e).copy(a))}e.step(new g(n,n,new i.p2(l.append(a),r,r),!0))}(this,e,n,r),this}addMark(e,n,r){var i;let o,s,l,a;return i=this,l=[],a=[],i.doc.nodesBetween(e,n,(i,h,c)=>{if(!i.isInline)return;let d=i.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let c=Math.max(h,e),f=Math.min(h+i.nodeSize,n),m=r.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(m)||(o&&o.to==c&&o.mark.eq(d[e])?o.to=f:l.push(o=new p(c,f,d[e])));s&&s.to==c?s.to=f:a.push(s=new u(c,f,r))}}),l.forEach(e=>i.step(e)),a.forEach(e=>i.step(e)),this}removeMark(e,n,r){var o;let s,l;return o=this,s=[],l=0,o.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;l++;let h=null;if(r instanceof i.ZU){let e=o.marks,n;for(;n=r.isInSet(e);)(h||(h=[])).push(n),e=n.removeFromSet(e)}else r?r.isInSet(o.marks)&&(h=[r]):h=o.marks;if(h&&h.length){let r=Math.min(a+o.nodeSize,n);for(let n=0;n<h.length;n++){let i=h[n],o;for(let e=0;e<s.length;e++){let n=s[e];n.step==l-1&&i.eq(s[e].style)&&(o=n)}o?(o.to=r,o.step=l):s.push({style:i,from:Math.max(a,e),to:r,step:l})}}}),s.forEach(e=>o.step(new p(e.from,e.to,e.style))),this}clearIncompatible(e,n,r){return v(this,e,n,r),this}}}}]);

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.