pleroma/priv/static/adminfe/static/js/chunk-0e2d.04760e2c.js

25 lines
290 KiB
JavaScript
Raw Normal View History

2022-12-21 13:03:32 +01:00
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0e2d"],{"+/fp":function(e,t){e.exports=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}},"49oK":function(e,t,n){"use strict";n.d(t,"a",function(){return g}),n.d(t,"b",function(){return m});for(var r={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:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=s||o&&+o[1]<57,c=0;c<10;c++)r[48+c]=r[96+c]=String(c);for(c=1;c<=24;c++)r[c+111]="F"+c;for(c=65;c<=90;c++)r[c]=String.fromCharCode(c+32),i[c]=String.fromCharCode(c);for(var h in r)i.hasOwnProperty(h)||(i[h]=r[h]);var d=n("b/sn");const u="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function p(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let l=0;l<o.length-1;l++){let e=o[l];if(/^(cmd|meta|m)$/i.test(e))i=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);u?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function f(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function m(e){return new d.d({props:{handleKeyDown:g(e)}})}function g(e){let t=function(e){let t=Object.create(null);for(let n in e)t[p(n)]=e[n];return t}(e);return function(e,n){let o,s=function(e){var t=!(a&&(e.ctrlKey||e.altKey||e.metaKey)||l&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?i:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),c=1==s.length&&" "!=s,h=t[f(s,n,!c)];if(h&&h(e.state,e.dispatch,e))return!0;if(c&&(n.shiftKey||n.altKey||n.metaKey||s.charCodeAt(0)>127)&&(o=r[n.keyCode])&&o!=s){let r=t[f(o,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}else if(c&&n.shiftKey){let r=t[f(s,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}},"4MG8":function(e,t,n){const r=n("T9Ld"),i=n("66f7"),o=n("SbYC"),s=n("+/fp"),l=n("hyX7"),a=n("J7Ao"),{merge:c,checkSanitizeDeprecation:h,escape:d}=n("rUJ1"),{getDefaults:u,changeDefaults:p,defaults:f}=n("vbtb");function m(e,t,n){if(void 0===e||null===e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(n||"function"==typeof t){n||(n=t,t=null),t=c({},m.defaults,t||{}),h(t);const o=t.highlight;let s,l,a=0;try{s=r.lex(e,t)}catch(e){return n(e)}l=s.length;const d=function(e){if(e)return t.highlight=o,n(e);let r;try{r=i.parse(s,t)}catch(t){e=t}return t.highlight=o,e?n(e):n(null,r)};if(!o||o.length<3)return d();if(delete t.highlight,!l)return d();for(;a<s.length;a++)!function(e){"code"!==e.type?--l||d():o(e.text,e.lang,function(t,n){return t?d(t):null==n||n===e.text?--l||d()
/*!
* tiptap-extensions v1.35.1
* (c) 2021 überdosis GbR (limited liability)
* @license MIT
*/
class ne extends r.f{get name(){return"blockquote"}get schema(){return{content:"block*",group:"block",defining:!0,draggable:!1,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}}commands({type:e}){return()=>Object(i.s)(e)}keys({type:e}){return{"Ctrl->":Object(i.s)(e)}}inputRules({type:e}){return[Object(i.u)(/^\s*>\s$/,e)]}}class re extends r.f{get name(){return"bullet_list"}get schema(){return{content:"list_item+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}commands({type:e,schema:t}){return()=>Object(i.q)(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-8":Object(i.q)(e,t.nodes.list_item)}}inputRules({type:e}){return[Object(i.u)(/^\s*([-+*])\s$/,e)]}}class ie extends r.f{get name(){return"code_block"}get schema(){return{content:"text*",marks:"",group:"block",code:!0,defining:!0,draggable:!1,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:()=>["pre",["code",0]]}}commands({type:e,schema:t}){return()=>Object(i.p)(e,t.nodes.paragraph)}keys({type:e}){return{"Shift-Ctrl-\\":Object(i.k)(e)}}inputRules({type:e}){return[Object(i.o)(/^```$/,e)]}}class oe extends r.f{get name(){return"heading"}get defaultOptions(){return{levels:[1,2,3,4,5,6]}}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}})),toDOM:e=>[`h${e.attrs.level}`,0]}}commands({type:e,schema:t}){return n=>Object(i.p)(e,t.nodes.paragraph,n)}keys({type:e}){return this.options.levels.reduce((t,n)=>({...t,...{[`Shift-Ctrl-${n}`]:Object(i.k)(e,{level:n})}}),{})}inputRules({type:e}){return this.options.levels.map(t=>Object(i.o)(new RegExp(`^(#{1,${t}})\\s$`),e,()=>({level:t})))}}class se extends r.f{get name(){return"horizontal_rule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}commands({type:e}){return()=>(t,n)=>n(t.tr.replaceSelectionWith(e.create()))}inputRules({type:e}){return[Object(i.g)(/^(?:---|___\s|\*\*\*\s)$/,e)]}}class le extends r.f{get name(){return"list_item"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}keys({type:e}){return{Enter:Object(i.m)(e),Tab:Object(i.l)(e),"Shift-Tab":Object(i.d)(e)}}}class ae extends r.f{get name(){return"ordered_list"}get schema(){return{attrs:{order:{default:1}},content:"list_item+",group:"block",parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1===e.attrs.order?["ol",0]:["ol",{start:e.attrs.order},0]}}commands({type:e,schema:t}){return()=>Object(i.q)(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-9":Object(i.q)(e,t.nodes.list_item)}}inputRules({type:e}){return[Object(i.u)(/^(\d+)\.\s$/,e,e=>({order:+e[1]}),(e,t)=>t.childCount+t.attrs.order===+e[1])]}}!function(e){let t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(let r in t)n[r]={default:t[r].default};e.tableGroup,e.cellContent,e.cellContent}({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{default:null,getFromDOM:e=>e.style.backgroundColor||null,setDOMAttr(e,t){if(e){const n={style:`${t.style||""}background-color: ${e};`};Object.assign(t,n)}}}}});class ce extends r.e{get name(){return"bold"}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:()=>["strong",0]}}keys({type:e}){return{"Mod-b":Object(i.r)(e)}}commands({type:e}){return()=>Object(i.r)(e)}inputRules({type:e}){return[Object(i.e)(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,e)]}pasteRules({type:e}){return[Object(i.f)(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,e)]}}class he extends r.e{get name(){return"italic"}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}keys({type:e}){return{"Mod-i":Object(i.r)(e)}}commands({type:e}){return()=>Object(i.r)(e)}inputRules({type:e}){return[Object(i.e)(/(?:^|[^_])(_([^_]+)_)$/,e),Object(i.e)(/(?:^|[^*])(\*([^*]+)\*)$/,e)]}pasteRules({type:e
/*!
* tiptap-utils v1.13.0
* (c) 2021 überdosis GbR (limited liability)
* @license MIT
*/function i(e,t){return t?e.createChecked(null,t):e.createAndFill()}function o(e,t,n,r,o){const s=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}(e),l=[],a=[];for(let h=0;h<n;h+=1){const e=i(s.cell,o);if(e&&a.push(e),r){const e=i(s.header_cell,o);e&&l.push(e)}}const c=[];for(let i=0;i<t;i+=1)c.push(s.row.createChecked(null,r&&0===i?l:a));return s.table.createChecked(null,c)}function s(e,t,n){if(!e)throw new Error('Invalid "node" parameter');if(!t)throw new Error('Invalid "predicate" parameter');return function(e){const t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw new Error('Invalid "node" parameter');const n=[];return e.descendants((e,r)=>{if(n.push({node:e,pos:r}),!t)return!1}),n}(e,n).filter(e=>t(e.node))}function l(e,t){return s(e,e=>e.isBlock,t)}function a(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function c(e){return function(t){if(function(e){return e instanceof r.c}(t)){const{node:n}=t,{$from:r}=t;if(function(e,t){return Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e}(e,n))return{node:n,pos:r.pos,depth:r.depth}}}}function h(e,t){const{from:n,to:r}=e.selection;let i=[];e.doc.nodesBetween(n,r,e=>{i=[...i,...e.marks]});const o=i.find(e=>e.type.name===t.name);return o?o.attrs:{}}function d(e=null,t=null){if(!e||!t)return!1;const n=e.parent.childAfter(e.parentOffset);if(!n.node)return!1;const r=n.node.marks.find(e=>e.type===t);if(!r)return!1;let i=e.index(),o=e.start()+n.offset,s=i+1,l=o+n.node.nodeSize;for(;i>0&&r.isInSet(e.parent.child(i-1).marks);)i-=1,o-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&r.isInSet(e.parent.child(s).marks);)l+=e.parent.child(s).nodeSize,s+=1;return{from:o,to:l}}function u(e,t){const{from:n,to:r}=e.selection;let i=[];e.doc.nodesBetween(n,r,e=>{i=[...i,e]});const o=i.reverse().find(e=>e.type.name===t.name);return o?o.attrs:{}}function p(e,t){const{from:n,$from:r,to:i,empty:o}=e.selection;return o?!!t.isInSet(e.storedMarks||r.marks()):!!e.doc.rangeHasMark(n,i,t)}function f({types:e,node:t}){return Array.isArray(e)&&e.includes(t.type)||t.type===e}function m(e,t,n={}){const r=c(t)(e.selection)||a(e=>e.type===t)(e.selection);return Object.keys(n).length&&r?r.node.hasMarkup(t,{...r.node.attrs,...n}):!!r}},"qd4/":function(e,t,n){"use strict";n.d(t,"a",function(){return r.b}),n.d(t,"b",function(){return r.c}),n.d(t,"k",function(){return r.e}),n.d(t,"r",function(){return r.f}),n.d(t,"d",function(){return c}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return a}),n.d(t,"o",function(){return d.c}),n.d(t,"u",function(){return d.e}),n.d(t,"c",function(){return p}),n.d(t,"e",function(){return f}),n.d(t,"f",function(){return y}),n.d(t,"g",function(){return m}),n.d(t,"h",function(){return g}),n.d(t,"i",function(){return v}),n.d(t,"j",function(){return b}),n.d(t,"n",function(){return w}),n.d(t,"p",function(){return x}),n.d(t,"q",function(){return S}),n.d(t,"s",function(){return C}),n.d(t,"t",function(){return O});var r=n("RCw7"),i=n("uSMm"),o=n("MEpN"),s=n("b/sn");function l(e,t=null){return function(n,r){let{$from:s,$to:l}=n.selection,a=s.blockRange(l),c=!1,h=a;if(!a)return!1;if(a.depth>=2&&s.node(a.depth-1).type.compatibleContent(e)&&0==a.startIndex){if(0==s.index(a.depth-1))return!1;let e=n.doc.resolve(a.start-2);h=new o.g(e,e,a.depth),a.endIndex<a.parent.childCount&&(a=new o.g(s,n.doc.resolve(l.end(a.depth)),a.depth)),c=!0}let d=Object(i.i)(h,e,t,a);return!!d&&(r&&r(function(e,t,n,r,s){let l=o.c.empty;for(let i=n.length-1;i>=0;i--)l=o.c.from(n[i].type.create(n[i].attrs,l));e.step(new i.b(t.start-(r?2:0),t.end,t.start,t.end,new o.j(l,0,0),n.length,!0));let a=0;for(let i=0;i<n.length;i++)n[i].type==s&&(a=i+1);let c=n.length-a,h=t.start+n.length-(r?2:0),d=t.parent;for(let o=t.startIndex,u=t.endIndex,p=!0;o<u;o++,p=!1)!p&&Object(i.g)(e.doc,h,c)&&(e.split(h,c),h+=2*c),h+=d.ch
/*!
* tiptap-commands v1.17.0
* (c) 2021 überdosis GbR (limited liability)
* @license MIT
*/
function p(e=""){return(t,n)=>{const{$from:r}=t.selection,{pos:i}=r.pos;return n(t.tr.insertText(e,i)),!0}}function f(e,t,n){return new d.a(e,(e,r,i,o)=>{const s=n instanceof Function?n(r):n,{tr:l}=e,a=r.length-1;let c=o,h=i;if(r[a]){const n=i+r[0].indexOf(r[a-1]),s=n+r[a-1].length-1,d=n+r[a-1].lastIndexOf(r[a]),u=d+r[a].length;if(function(e,t,n){let r=[];return n.doc.nodesBetween(e,t,(e,t)=>{r=[...r,...e.marks.map(n=>({start:t,end:t+e.nodeSize,mark:n}))]}),r}(i,o,e).filter(e=>{const{excluded:n}=e.mark.type;return n.find(e=>e.name===t.name)}).filter(e=>e.end>n).length)return!1;u<s&&l.delete(u,s),d>n&&l.delete(n,d),c=(h=n)+r[a].length}return l.addMark(h,c,t.create(s)),l.removeStoredMark(t),l})}function m(e,t,n){return new d.a(e,(e,r,i,o)=>{const s=n instanceof Function?n(r):n,{tr:l}=e;return r[0]&&l.replaceWith(i-1,o,t.create(s)),l})}function g(e,t,n){const r=i=>{const s=[];return i.forEach(i=>{if(i.isText){const{text:r}=i;let o,l=0;do{if(o=e.exec(r)){const e=o.index,r=e+o[0].length,a=n instanceof Function?n(o[0]):n;e>0&&s.push(i.cut(l,e)),s.push(i.cut(e,r).mark(t.create(a).addToSet(i.marks))),l=r}}while(o);l<r.length&&s.push(i.cut(l))}else s.push(i.copy(r(i.content)))}),o.c.fromArray(s)};return new s.d({props:{transformPasted:e=>new o.j(r(e.content),e.openStart,e.openEnd)}})}function y(e,t,n){const r=(i,s)=>{const l=[];return i.forEach(i=>{if(i.isText){const{text:r,marks:o}=i;let a,c=0;const h=!!o.filter(e=>"link"===e.type.name)[0];for(;!h&&null!==(a=e.exec(r));)if(s&&s.type.allowsMarkType(t)&&a[1]){const e=a.index,r=e+a[0].length,o=e+a[0].indexOf(a[1]),s=o+a[1].length,h=n instanceof Function?n(a):n;e>0&&l.push(i.cut(c,e)),l.push(i.cut(o,s).mark(t.create(h).addToSet(i.marks))),c=r}c<r.length&&l.push(i.cut(c))}else l.push(i.copy(r(i.content,i)))}),o.c.fromArray(l)};return new s.d({props:{transformPasted:e=>new o.j(r(e.content),e.openStart,e.openEnd)}})}function v(e){return(t,n)=>{const{tr:r,selection:i}=t;let{from:o,to:s}=i;const{$from:l,empty:a}=i;if(a){const t=Object(u.e)(l,e);o=t.from,s=t.to}return r.removeMark(o,s,e),n(r)}}function b(e=null,t,n={},r=o.c.empty){return(i,o)=>{const{$from:s,$to:l}=i.selection,a=s.index(),c=e?e.from:s.pos,h=e?e.to:l.pos;return!!s.parent.canReplaceWith(a,a,t)&&(o&&o(i.tr.replaceWith(c,h,t.create(n,r))),!0)}}function w(e){return function(t,n){const{$from:r,$to:i,node:s}=t.selection;if(s&&s.isBlock||r.depth<2||!r.sameParent(i))return!1;const l=r.node(-1);if(l.type!=e)return!1;if(0==r.parent.content.size){if(2==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let i=o.c.empty;const s=r.index(-1)>0;for(let e=r.depth-(s?1:2);e>=r.depth-3;e--)i=o.c.from(r.node(e).copy(i));i=i.append(o.c.from(e.createAndFill()));const l=t.tr.replace(r.before(s?null:-1),r.after(-3),new o.j(i,s?3:2,2));l.setSelection(t.selection.constructor.near(l.doc.resolve(r.pos+(s?3:2)))),n(l.scrollIntoView())}return!0}const a=i.pos==r.end()?l.contentMatchAt(r.indexAfter(-1)).defaultType:null,c=t.tr.delete(r.pos,i.pos);let h=a&&[{type:e},{type:a}];return h||(h=[{type:e},null]),!!function(e,t,n=1,r){const i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,h=n-2;c>o;c--,h--){const e=i.node(c),t=i.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount);const o=r&&r[h]||e;if(o!=e&&(n=n.replaceChild(0,o.type.create(o.attrs))),!e.canReplace(t+1,e.childCount))return!1}const l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}(c.doc,r.pos,2,h)&&(n&&n(c.split(r.pos,2,h).scrollIntoView()),!0)}}function x(e,t,n={}){return(i,o,s)=>{return Object(u.i)(i,e,n)?Object(r.e)(t)(i,o,s):Object(r.e)(e,n)(i,o,s)}}function k(e,t){return e.type===t.nodes.bullet_list||e.type===t.nodes.ordered_list||e.type===t.nodes.todo_list}function S(e,t){return(n,r,i)=>{const{schema:o,selection:s}=n,{$from:a,$to:h}=s,d=a.blockRange(h);if(!d)return!1;const p=Object(
/*!
* tiptap v1.32.1
* (c) 2021 überdosis GbR (limited liability)
* @license MIT
*/
function(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===t?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,"")}(`on ${e}`)]||(()=>{}))}),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view}setOptions(e){this.options={...this.options,...e},this.view&&this.state&&this.view.updateState(this.state)}get builtInExtensions(){return this.options.useBuiltInExtensions?[new E,new D,new A]:[]}get state(){return this.view?this.view.state:null}createExtensions(){return new C([...this.builtInExtensions,...this.options.extensions],this)}createPlugins(){return this.extensions.plugins}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createNodes(){return this.extensions.nodes}createMarks(){return this.extensions.marks}createSchema(){return new o.i({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return r.b.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,Object(y.b)({rules:this.inputRules}),...this.pasteRules,...this.keymaps,Object(a.b)({Backspace:y.d}),Object(a.b)(g.a),...this.options.enableDropCursor?[function(e={}){return new r.d({view:t=>new l(t,e)})}(this.options.dropCursor)]:[],...this.options.enableGapCursor?[new r.d({props:{decorations:m,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&c.valid(n)?new c(n):null,handleClick:p,handleKeyDown:d,handleDOMEvents:{beforeinput:f}}})]:[],new r.d({key:new r.e("editable"),props:{editable:()=>this.options.editable}}),new r.d({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,t)=>{this.focused=!0,this.emit("focus",{event:t,state:e.state,view:e});const n=this.state.tr.setMeta("focused",!0);this.view.dispatch(n)},blur:(e,t)=>{this.focused=!1,this.emit("blur",{event:t,state:e.state,view:e});const n=this.state.tr.setMeta("focused",!1);this.view.dispatch(n)}}}}),new r.d({props:this.options.editorProps})]})}createDocument(e,t=this.options.parseOptions){if(null===e)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof e)try{return this.schema.nodeFromJSON(e)}catch(t){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",t),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof e){const n=`<div>${e}</div>`,r=(new window.DOMParser).parseFromString(n,"text/html").body.firstElementChild;return o.a.fromSchema(this.schema).parse(r,t)}return!1}createView(){return new i.c(this.element,{state:this.createState(),handlePaste:(...e)=>{this.emit("paste",...e)},handleDrop:(...e)=>{this.emit("drop",...e)},dispatchTransaction:this.dispatchTransaction.bind(this)})}setParentComponent(e=null){e&&this.view.setProps({nodeViews:this.initNodeViews({parent:e,extensions:[...this.builtInExtensions,...this.options.extensions]})})}initNodeViews({parent:e,extensions:t}){return t.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.view).reduce((t,n)=>{return{...t,[n.name]:(t,r,i,o)=>{const s=n.view;return new x(s,{editor:this,extension:n,parent:e,node:t,view:r,getPos:i,decorations:o})}}},{})}dispatchTransaction(e){const t=this.state.apply(e);this.view.updateState(t),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks(),this.emit("transaction",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emitUpdate(e)}emitUpdate(e){this.emit("update",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:e})}resolveSelection(e=null){if(this.selection&&null===e)return this.selection;if("start"===e||!0===e)return{from:0,to:0};if("end"===e){const{doc:e}=this.state;return{from:e.content.size,to:e.content.size}}return{from:e,
//# sourceMappingURL=chunk-0e2d.04760e2c.js.map