card-mod-prosemirror_editor 0.14 → 0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba867bd64805b97f3fcac083b132dc4ba1e3afe76277f00e835f6f9c6a6a1bfe
4
- data.tar.gz: 9cd0bf17f0e8c4e2013343d18393f6869de44ef70e5adc57ce6dcf0cfd58641f
3
+ metadata.gz: 83724d6df56d4c324ffac562c5b0c0e11dced355215128ca813a339f340dcba5
4
+ data.tar.gz: 24bd6e22cdd59f2096e4887075b3ffb4e74ad8cede33643efcaf1cc2d71bfcf4
5
5
  SHA512:
6
- metadata.gz: a2f21e154f0687c855aba7069662c118c6132a48fe0da60d483c512db727083c51ba94ad9fb035311cbe1ac0e21912c902be27c25df52e9ff26c359c2eee18d0
7
- data.tar.gz: a12f6d1ac4a9fe122c95b55b30bf4f8ffd702e0f57b573bb3b7fab1867f4dd67af50cb801113d3b7b041e513381c05654e773e8b9acc82a34f6d61709ec43283
6
+ metadata.gz: 1737026058cbc0f1390ed8f62ac881e3d59d6ac2e53bcae553de02863485f4bcc319f622130a6a7de1489c651ff3e0d11687f93757406f87d85431b039d7d525
7
+ data.tar.gz: fc752ffa5d6ec6c79b563f5168e196c93338766fd50cab0adc48835c820cda4c91e7f0cc4f1ef345f9c61ab25e261d9088f92d857d17ea3fe6970f5b77b0479b
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-prosemirror_editor
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.14'
4
+ version: '0.15'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipp Kühl
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-26 00:00:00.000000000 Z
12
+ date: 2021-12-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: card
@@ -47,11 +47,8 @@ extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
49
  - README.md
50
- - file/mod_prosemirror_editor_script_local_machine_output/file.js
51
- - lib/stylesheets/style_prosemirror.scss
52
50
  - set/all/prosemirror_editor.rb
53
51
  - set/self/prose_mirror.rb
54
- - set/self/style_prosemirror.rb
55
52
  homepage: http://decko.org
56
53
  licenses:
57
54
  - GPL-3.0
@@ -72,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
69
  - !ruby/object:Gem::Version
73
70
  version: '0'
74
71
  requirements: []
75
- rubygems_version: 3.2.28
72
+ rubygems_version: 3.2.15
76
73
  signing_key:
77
74
  specification_version: 4
78
75
  summary: Prose Mirror editor
@@ -1,10 +0,0 @@
1
- // script_prosemirror.js
2
- !function(p){function l(t,e,n){return 4===arguments.length?u.apply(this,arguments):void o(t,{declarative:!0,deps:e,declare:n})}function u(t,e,n,r){o(t,{declarative:!1,deps:e,executingRequire:n,execute:r})}function o(t,e){(e.name=t)in w||(w[t]=e),e.normalizedDeps=e.deps}function c(t,e){if(e[t.groupIndex]=e[t.groupIndex]||[],-1==x.call(e[t.groupIndex],t)){e[t.groupIndex].push(t);for(var n=0,r=t.normalizedDeps.length;n<r;n++){var o=t.normalizedDeps[n],i=w[o];if(i&&!i.evaluated){var s=t.groupIndex+(i.declarative!=t.declarative);if(void 0===i.groupIndex||i.groupIndex<s){if(void 0!==i.groupIndex&&(e[i.groupIndex].splice(x.call(e[i.groupIndex],i),1),0==e[i.groupIndex].length))throw new TypeError("Mixed dependency cycle detected");i.groupIndex=s}c(i,e)}}}}function n(t){var e=w[t];e.groupIndex=0;var n=[];c(e,n);for(var r=!!e.declarative==n.length%2,o=n.length-1;0<=o;o--){for(var i=n[o],s=0;s<i.length;s++){var a=i[s];r?h(a):m(a)}r=!r}}function f(t){return k[t]||(k[t]={name:t,dependencies:[],exports:{},importers:[]})}function h(t){if(!t.module){var a=t.module=f(t.name),c=t.module.exports,e=t.declare.call(p,function(t,e){if(a.locked=!0,"object"==typeof t)for(var n in t)c[n]=t[n];else c[t]=e;for(var r=0,o=a.importers.length;r<o;r++){var i=a.importers[r];if(!i.locked)for(var s=0;s<i.dependencies.length;++s)i.dependencies[s]===a&&i.setters[s](c)}return a.locked=!1,e},t.name);a.setters=e.setters,a.execute=e.execute;for(var n=0,r=t.normalizedDeps.length;n<r;n++){var o,i=t.normalizedDeps[n],s=w[i],l=k[i];l?o=l.exports:s&&!s.declarative?o=s.esModule:s?(h(s),o=(l=s.module).exports):o=g(i),l&&l.importers?(l.importers.push(a),a.dependencies.push(l)):a.dependencies.push(null),a.setters[n]&&a.setters[n](o)}}}function d(t){var e,n=w[t];if(n)n.declarative?a(t,[]):n.evaluated||m(n),e=n.module.exports;else if(!(e=g(t)))throw new Error("Unable to load dependency "+t+".");return(!n||n.declarative)&&e&&e.__useDefault?e["default"]:e}function m(r){if(!r.module){var t={},e=r.module={exports:t,id:r.name};if(!r.executingRequire)for(var n=0,o=r.normalizedDeps.length;n<o;n++){var i=r.normalizedDeps[n],s=w[i];s&&m(s)}r.evaluated=!0;var a=r.execute.call(p,function(t){for(var e=0,n=r.deps.length;e<n;e++)if(r.deps[e]==t)return d(r.normalizedDeps[e]);throw new TypeError("Module "+t+" not declared as a dependency.")},t,e);a&&(e.exports=a),(t=e.exports)&&t.__esModule?r.esModule=t:r.esModule=v(t)}}function v(t){var e={};if("object"==typeof t||"function"==typeof t){var n=t&&t.hasOwnProperty;if(b)for(var r in t)s(e,t,r)||i(e,t,r,n);else for(var r in t)i(e,t,r,n)}return e["default"]=t,y(e,"__useDefault",{value:!0}),e}function i(t,e,n,r){(!r||e.hasOwnProperty(n))&&(t[n]=e[n])}function s(t,e,n){try{var r;return(r=Object.getOwnPropertyDescriptor(e,n))&&y(t,n,r),!0}catch(c){return!1}}function a(t,e){var n=w[t];if(n&&!n.evaluated&&n.declarative){e.push(t);for(var r=0,o=n.normalizedDeps.length;r<o;r++){var i=n.normalizedDeps[r];-1==x.call(e,i)&&(w[i]?a(i,e):g(i))}n.evaluated||(n.evaluated=!0,n.module.execute.call(p))}}function g(t){if(M[t])return M[t];if("@node/"==t.substr(0,6))return S(t.substr(6));var e=w[t];if(!e)throw"Module "+t+" not present.";return n(t),a(t,[]),w[t]=void 0,e.declarative&&y(e.module.exports,"__esModule",{value:!0}),M[t]=e.declarative?e.module.exports:e.esModule}var y,w={},x=Array.prototype.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},b=!0;try{Object.getOwnPropertyDescriptor({a:0},"a")}catch(t){b=!1}!function(){try{Object.defineProperty({},"a",{})&&(y=Object.defineProperty)}catch(p){y=function(t,e,n){try{t[e]=n.value||n.get.call(t)}catch(o){}}}}();var k={},S="undefined"!=typeof System&&System._nodeRequire||"undefined"!=typeof require&&require.resolve&&"undefined"!=typeof process&&require,M={"@empty":{}};return function(s,a,c){return function(t){t(function(t){for(var e={_nodeRequire:S,register:l,registerDynamic:u,get:g,set:function(t,e){M[t]=e},newModule:function(t){return t}},n=0;n<a.length;n++)r=a[n],(o=arguments[n])&&o.__esModule?M[r]=o:M[r]=v(o);var r,o;c(e);var i=g(s[0]);if(1<s.length)for(n=1;n<s.length;n++)g(s[n]);return i.__useDefault?i["default"]:i})}}}("undefined"!=typeof self?self:global)(["1"],[],function(t){this.require,this.exports,this.module;t.registerDynamic("2",["3"],!0,function(t,e,n){var r={doc:{content:"block+"},paragraph:{content:"inline<_>*",group:"block",parseDOM:[{tag:"p"}],toDOM:function s(){return["p",0]}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:function s(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function s(){return["hr"]}},heading:{attrs:{level:{"default":1}},content:"inline<_>*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM:function s(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:!0}],toDOM:function s(){return["pre",["code",0]]}},text:{group:"inline",toDOM:function s(t){return t.text}},image:{inline:!0,attrs:{src:{},alt:{"default":null},title:{"default":null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:function a(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM:function s(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function s(){return["br"]}}},o={em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:function(t){return"italic"==t&&null}}],toDOM:function s(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:function(t){return"normal"!=t.style.fontWeight&&null}},{style:"font-weight",getAttrs:function(t){return/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}}],toDOM:function s(){return["strong"]}},link:{attrs:{href:{},title:{"default":null}},parseDOM:[{tag:"a[href]",getAttrs:function a(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM:function s(t){return["a",t.attrs]}},code:{parseDOM:[{tag:"code"}],toDOM:function s(){return["code"]}}},i=new(t("3").Schema)({nodes:e.nodes=r,marks:e.marks=o});return e.schema=i,n.exports}),t.registerDynamic("4",["2"],!0,function(t,e,n){return n.exports=t("2"),n.exports}),t.registerDynamic("5",["6"],!0,function(t,e,n){var r=t("6").InputRule,o=new r(/--$/,"\u2014");e.emDash=o;var i=new r(/\.\.\.$/,"\u2026");e.ellipsis=i;var s=new r(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201c");e.openDoubleQuote=s;var a=new r(/"$/,"\u201d");e.closeDoubleQuote=a;var c=new r(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018");e.openSingleQuote=c;var l=new r(/'$/,"\u2019"),p=[s,a,c,e.closeSingleQuote=l];e.smartQuotes=p;var u=[o,i].concat(p);return e.allInputRules=u,n.exports}),t.registerDynamic("6",["7"],!0,function(t,e,n){function r(c){return function(t,e,n,r){var o=c;if(e[1]){var i=e[0].lastIndexOf(e[1]);o+=e[0].slice(i+e[1].length);var s=(n+=i)-r;0<s&&(o=e[0].slice(i-s,i)+o,n=r)}var a=t.doc.resolve(n).marks();return t.tr.replaceWith(n,r,t.schema.text(o,a))}}function o(t){var p=t.rules;return new a({state:{init:function e(){return null},apply:function r(t,e){var n=t.getMeta(h);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function u(t,e,n,r){for(var o=t.state,i=o.doc.resolve(e),s=i.parent.textBetween(Math.max(0,i.parentOffset-f),i.parentOffset,null,"\ufffc")+r,a=0;a<p.length;a++){var c=p[a].match.exec(s),l=c&&p[a].handler(o,c,e-(c[0].length-r.length),n);if(l)return t.dispatch(l.setMeta(h,{transform:l,from:e,to:n,text:r})),!0}return!1},handleKeyDown:function n(t,e){return 8==e.keyCode&&i(t.state,t.dispatch,this.getState(t.state))}}})}function i(t,e,n){if(!n)return!1;for(var r=t.tr,o=n.transform,i=o.steps.length-1;0<=i;i--)r.step(o.steps[i].invert(o.docs[i]));var s=r.doc.resolve(n.from).marks();return e(r.replaceWith(n.from,n.to,t.schema.text(n.text,s))),!0}var s=t("7"),a=s.Plugin,c=s.PluginKey,l=function l(t,e){this.match=t,this.handler="string"==typeof e?r(e):e};e.InputRule=l;var f=500,h=new c("fromInputRule");return e.inputRules=o,n.exports}),t.registerDynamic("8",["6","9"],!0,function(t,e,n){function r(t,l,p,u){return new f(t,function(t,e,n,r){var o=p instanceof Function?p(e):p,i=t.tr["delete"](n,r),s=i.doc.resolve(n).blockRange(),a=s&&h(s,l,o);if(!a)return null;i.wrap(s,a);var c=i.doc.resolve(n-1).nodeBefore;return c&&c.type==l&&d(i.doc,n-1)&&(!u||u(e,c))&&i.join(n-1),i})}function o(t,s,a){return new f(t,function(t,e,n,r){var o=t.doc.resolve(n),i=a instanceof Function?a(e):a;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),s,i)?t.tr["delete"](n,r).setBlockType(n,n,s,i):null})}function i(t){return r(/^\s*> $/,t)}function s(t){return r(/^(\d+)\. $/,t,function(t){return{order:+t[1]}},function(t,e){return e.childCount+e.attrs.order==+t[1]})}function a(t){return r(/^\s*([-+*]) $/,t)}function c(t){return o(/^```$/,t)}function l(t,e){return o(new RegExp("^(#{1,"+e+"}) $"),t,function(t){return{level:t[1].length}})}var f=t("6").InputRule,p=t("9"),h=p.findWrapping,d=p.canJoin;return e.wrappingInputRule=r,e.textblockTypeInputRule=o,e.blockQuoteRule=i,e.orderedListRule=s,e.bulletListRule=a,e.codeBlockRule=c,e.headingRule=l,n.exports}),t.registerDynamic("a",["6","5","8"],!0,function(t,e,n){var r,o,i;return r=t("6"),e.InputRule=r.InputRule,e.inputRules=r.inputRules,o=t("5"),e.emDash=o.emDash,e.ellipsis=o.ellipsis,e.openDoubleQuote=o.openDoubleQuote,e.closeDoubleQuote=o.closeDoubleQuote,e.openSingleQuote=o.openSingleQuote,e.closeSingleQuote=o.closeSingleQuote,e.smartQuotes=o.smartQuotes,e.allInputRules=o.allInputRules,i=t("8"),e.wrappingInputRule=i.wrappingInputRule,e.textblockTypeInputRule=i.textblockTypeInputRule,e.blockQuoteRule=i.blockQuoteRule,e.orderedListRule=i.orderedListRule,e.bulletListRule=i.bulletListRule,e.codeBlockRule=i.codeBlockRule,e.headingRule=i.headingRule,n.exports}),t.registerDynamic("b",["a"],!0,function(t,e,n){return n.exports=t("a"),n.exports}),t.registerDynamic("c",[],!0,function(t,e,n){function r(t){var e=(!a||!t.ctrlKey&&!t.altKey&&!t.metaKey)&&t.key||(t.shiftKey?i:o)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}for(var o={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:"'",229:"q"},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:'"',229:"Q"},s="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),a=s&&+s[1]<57,c=0;c<10;c++)o[48+c]=o[96+c]=String(c);for(c=1;c<=24;c++)o[c+111]="F"+c;for(c=65;c<=90;c++)o[c]=String.fromCharCode(c+32),i[c]=String.fromCharCode(c);for(var l in o)i.hasOwnProperty(l)||(i[l]=o[l]);return(n.exports=r).base=o,r.shift=i,n.exports}),t.registerDynamic("d",["c"],!0,function(t,e,n){return n.exports=t("c"),n.exports}),t.registerDynamic("e",["d","7"],!0,function(t,e,n){function r(t){var e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a<i.length-1;a++){var c=i[a];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))e=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))r=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);u?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function o(t){var e=Object.create(null);for(var n in t)e[r(n)]=t[n];return e}function l(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function i(t){var a=o(t);return new s({props:{handleKeyDown:function c(t,e){var n,r=p(e),o=1==r.length&&" "!=r,i=a[l(r,e,!o)];if(i&&i(t.state,t.dispatch,t))return!0;if(e.shiftKey&&o&&(n=p.base[e.keyCode])){var s=a[l(n,e,!0)];if(s&&s(t.state,t.dispatch,t))return!0}return!1}}})}var p=t("d"),s=t("7").Plugin,u="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);return e.keymap=i,n.exports}),t.registerDynamic("f",["e"],!0,function(t,e,n){return n.exports=t("e"),n.exports}),t.registerDynamic("10",["7","11"],!0,function(t,e,n){function r(o){function i(t,e){t.dispatch(t.state.tr.setMeta(a,e))}function s(t){clearTimeout(e),e=setTimeout(function(){a.getState(t.state)&&i(t,{type:"remove"})},1e3)}var e=null,a=new h({state:{init:function t(){return null},apply:function c(t,e,n){if(d&&m)return null;var r=t.getMeta(a);return r?"set"==r.type?f(n,r.pos,o):null:e}},props:{handleDOMEvents:{dragover:function l(t,e){var n=a.getState(t.state),r=t.posAtCoords({left:e.clientX,top:e.clientY});return!r||n&&n.pos==r.pos||i(t,{type:"set",pos:r.pos}),s(t),!1},dragend:function n(t){return a.getState(t.state)&&i(t,{type:"remove"}),!1},drop:function r(t){return a.getState(t.state)&&i(t,{type:"remove"}),!1},dragleave:function p(t,e){return e.target==t.content&&i(t,{type:"remove"}),!1}},decorations:function u(t){var e=a.getState(t);return e&&e.deco}}});return a}function c(t,e){var n=t&&t.width||1;return"border-"+e+": "+n+"px solid "+(t&&t.color||"black")+"; margin-"+e+": -"+n+"px"}function f(t,e,n){var r,o,i,s=t.doc.resolve(e);s.parent.isTextblock||((o=s.nodeBefore)?r=l.node(e-o.nodeSize,e,{nodeName:"div",style:c(n,"right")}):(i=s.nodeAfter)&&(r=l.node(e,e+i.nodeSize,{nodeName:"div",style:c(n,"left")})));if(!r){var a=document.createElement("span");a.textContent="\u200b",a.style.cssText=c(n,"left")+"; display: inline-block; pointer-events: none",r=l.widget(e,a)}return{pos:e,deco:p.create(t.doc,[r])}}var h=t("7").Plugin,o=t("11"),l=o.Decoration,p=o.DecorationSet,d="undefined"!=typeof navigator&&/gecko\/\d/i.test(navigator.userAgent),m="undefined"!=typeof navigator&&/linux/i.test(navigator.platform);return e.dropCursor=r,n.exports}),t.registerDynamic("12",["10"],!0,function(t,e,n){return n.exports=t("10"),n.exports}),t.registerDynamic("13",[],!0,function(t,e,n){function l(){return{left:0,right:window.innerWidth,top:0,bottom:window.innerHeight}}function u(t){var e=t.parentNode;return 11==e.nodeType?e.host:e}function r(t,e){var n=t.someProp("scrollThreshold")||0,r=t.someProp("scrollMargin");null==r&&(r=5);for(var o=t.content;;o=u(o)){var i=o==document.body,s=i?l():o.getBoundingClientRect(),a=0,c=0;if(e.top<s.top+n?c=-(s.top-e.top+r):e.bottom>s.bottom-n&&(c=e.bottom-s.bottom+r),e.left<s.left+n?a=-(s.left-e.left+r):e.right>s.right-n&&(a=e.right-s.right+r),(a||c)&&(i?window.scrollBy(a,c):(c&&(o.scrollTop+=c),a&&(o.scrollLeft+=a))),i)break}}function o(t){for(var e,n,r=t.content.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){var a=t.root.elementFromPoint(i,s);if(a!=t.content&&t.content.contains(a)){var c=a.getBoundingClientRect();if(c.top>=o-20){e=a,n=c.top;break}}}for(var l=[],p=t.content;p&&(l.push({dom:p,top:p.scrollTop,left:p.scrollLeft}),p!=document.body);p=u(p));return{refDOM:e,refTop:n,stack:l}}function i(t){for(var e=t.refDOM,n=t.refTop,r=t.stack,o=e?e.getBoundingClientRect().top:0,i=0==o?0:o-n,s=0;s<r.length;s++){var a=r[s],c=a.dom,l=a.top,p=a.left;c.scrollTop!=l+i&&(c.scrollTop=l+i),c.scrollLeft!=p&&(c.scrollLeft=p)}}function d(t,e){for(var n,r,o=2e8,i=0,s=e.top,a=e.top,c=t.firstChild,l=0;c;c=c.nextSibling,l++){var p=void 0;if(1==c.nodeType)p=c.getClientRects();else{if(3!=c.nodeType)continue;p=v(c).getClientRects()}for(var u=0;u<p.length;u++){var f=p[u];if(f.top<=s&&f.bottom>=a){s=Math.max(f.bottom,s),a=Math.min(f.top,a);var h=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(h<o){n=c,r=(o=h)&&3==n.nodeType?{left:f.right<e.left?f.right:f.left,top:e.top}:e,1==c.nodeType&&h&&(i=l+(e.left>=(f.left+f.right)/2?1:0));continue}}!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(i=l+1)}}return n&&3==n.nodeType?m(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:d(n,r)}function m(t,e){for(var n=t.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);var i=f(r,1);if(i.top!=i.bottom&&(i.left-1<=e.left&&i.right+1>=e.left&&i.top-1<=e.top&&i.bottom+1>=e.top))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function p(t,e){if(/^[uo]l$/i.test(t.nodeName))for(var n=t.firstChild;n;n=n.nextSibling)if(n.pmViewDesc&&/^li$/i.test(n.nodeName)){var r=n.getBoundingClientRect();if(e.left>r.left-2)break;if(r.top<=e.top&&r.bottom>=e.top)return n}return t}function s(t,e){var n=p(t.root.elementFromPoint(e.left,e.top+1),e);if(!t.content.contains(3==n.nodeType?n.parentNode:n))return null;var r=d(n,e),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&e.left>(a.left+a.right)/2?1:-1}var c=t.docView.nearestDesc(n,!0);return{pos:t.docView.posFromDOM(o,i,s),inside:c&&c.posAtStart-c.border}}function v(t,e,n){var r=document.createRange();return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r}function f(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}function h(t,e){var n,r,o=t.docView.domFromPos(e),i=o.node,s=o.offset;if(3==i.nodeType)s<i.nodeValue.length&&(r=f(v(i,s,s+1),-1),n="left"),r&&r.left!=r.right||!s||(r=f(v(i,s-1,s),1),n="right");else if(i.firstChild){if(s<i.childNodes.length){var a=i.childNodes[s];r=f(3==a.nodeType?v(a):a,-1),n="left"}if((!r||r.top==r.bottom)&&s){var c=i.childNodes[s-1];r=f(3==c.nodeType?v(c):c,1),n="right"}}else r=i.getBoundingClientRect(),n="left";var l=r[n];return{top:r.top,bottom:r.bottom,left:l,right:l}}function g(t,e,n){var r=t.state,o=t.root.activeElement;r==e&&t.inDOMChange||t.updateState(e),o!=t.content&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.content&&o.focus()}}function a(s,t,a){var c="up"==a?t.selection.$from:t.selection.$to;return!!c.depth&&g(s,t,function(){for(var t=s.docView.domAfterPos(c.before()),e=h(s,c.pos),n=t.firstChild;n;n=n.nextSibling){var r=void 0;if(1==n.nodeType)r=n.getClientRects();else{if(3!=n.nodeType)continue;r=v(n,0,n.nodeValue.length).getClientRects()}for(var o=0;o<r.length;o++){var i=r[o];if("up"==a?i.bottom<e.top+1:i.top>e.bottom-1)return!1}}return!0})}function c(n,t,r){var e=t.selection,o=e.$head;if(!e.empty||!o.parent.isTextblock||!o.depth)return!1;var i=o.parentOffset,s=!i,a=i==o.parent.content.size;if(!s&&!a&&!w.test(o.parent.textContent))return!1;var c=getSelection();return c.modify?g(n,t,function(){var t=c.getRangeAt(0);c.modify("move",r,"character");var e=!n.docView.domAfterPos(o.before()).contains(1==c.focusNode.nodeType?c.focusNode:c.focusNode.parentNode)||n.docView.posFromDOM(c.focusNode,c.focusOffset)==o.pos;return c.removeAllRanges(),c.addRange(t),e}):"left"==r||"backward"==r?s:a}function y(t,e,n){return x==e&&b==n?k:(x=e,k="up"==(b=n)||"down"==n?a(t,e,n):c(t,e,n))}e.scrollRectIntoView=r,e.storeScrollPos=o,e.resetScrollPos=i,e.posAtCoords=s,e.coordsAtPos=h;var w=/[\u0590-\u08ac]/,x=null,b=null,k=!1;return e.endOfTextblock=y,n.exports}),t.registerDynamic("14",["3","15"],!0,function(t,e,n){function r(t,e,n,r,o){return h(r,e,t,!0),new D(null,t,e,n,r,r,r,o)}function s(t,e){for(var n=t.firstChild,r=0;r<e.length;r++){var o=e[r],i=o.dom;if(i.parentNode==t){for(;i!=n;)n=c(n);n=n.nextSibling}else t.insertBefore(i,n);o instanceof C&&s(o.contentDOM,o.children)}for(;n;)n=c(n)}function o(t,e,n){if(0==t.length)return I;for(var r=n?I[0]:new N,o=[r],i=0;i<t.length;i++){var s=t[i].type.attrs,a=r;if(s)for(var c in s.nodeName&&o.push(a=new N(s.nodeName)),s){var l=s[c];null!=l&&(n&&1==o.length&&o.push(a=r=new N(e.isInline?"span":"div")),"class"==c?a["class"]=(a["class"]?a["class"]+" ":"")+l:"style"==c?a.style=(a.style?a.style+";":"")+l:"nodeName"!=c&&(a[c]=l))}}return o}function i(t,e,n,r){if(n==I&&r==I)return e;for(var o=e,i=0;i<r.length;i++){var s=r[i],a=n[i];if(i){var c=void 0;a&&a.nodeName==s.nodeName&&o!=t&&(c=e.parentNode)&&c.tagName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName)).appendChild(o),o=c}l(o,a||I[0],s)}return o}function l(t,e,n){for(var r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e["class"]!=n["class"]){for(var i=e["class"]?e["class"].split(" "):S,s=n["class"]?n["class"].split(" "):S,a=0;a<i.length;a++)-1==s.indexOf(i[a])&&t.classList.remove(i[a]);for(var c=0;c<s.length;c++)-1==i.indexOf(s[c])&&t.classList.add(s[c])}if(e.style!=n.style){var l,p=t.style.cssText;e.style&&-1<(l=p.indexOf(e.style))&&(p=p.slice(0,l)+p.slice(l+e.style.length)),t.style.cssText=p+(n.style||"")}}function h(t,e,n){return i(t,t,I,o(e,n,1!=t.nodeType))}function a(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function c(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}function p(t,e,n,r){var o=e.locals(t),i=0;if(0!=o.length)for(var s=0,a=[],c=null,l=0;;){for(;s<o.length&&o[s].to==i;)n(o[s++]);var p=void 0;if(c)p=c,c=null;else{if(!(l<t.childCount))break;p=t.child(l++)}for(var u=0;u<a.length;u++)a[u].to<=i&&a.splice(u--,1);for(;s<o.length&&o[s].from==i;)a.push(o[s++]);var f=i+p.nodeSize;if(p.isText){var h=f;s<o.length&&o[s].from<h&&(h=o[s].from);for(var d=0;d<a.length;d++)a[d].to<h&&(h=a[d].to);h<f&&(c=p.cut(h-i),p=p.cut(0,h-i),f=h)}r(p,a.length?a.slice():S,e.forChild(i,p),l-1),i=f}else for(var m=0;m<t.childCount;m++){var v=t.child(m);r(v,o,e.forChild(i,v),m),i+=v.nodeSize}}function d(t){return A==t.props?E:(A=t.props,E=u(t))}function u(t){var n={};return t.someProp("nodeViews",function(t){for(var e in t)Object.prototype.hasOwnProperty.call(n,e)||(n[e]=t[e])}),n}function m(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}var v=t("3").DOMSerializer,g=t("15"),y=0,f=1,w=2,x=3,b=function(t,e,n,r){this.parent=t,this.children=e,((this.dom=n).pmViewDesc=this).contentDOM=r,this.dirty=y},k={size:{},border:{},posAtStart:{},posAtEnd:{},contentLost:{}};b.prototype.matchesWidget=function(){return!1},b.prototype.matchesMark=function(){return!1},b.prototype.matchesNode=function(){return!1},b.prototype.matchesHack=function(){return!1},b.prototype.parseRule=function(){return null},b.prototype.stopEvent=function(){return!1},k.size.get=function(){for(var t=this,e=0,n=0;n<this.children.length;n++)e+=t.children[n].size;return e},k.border.get=function(){return 0},b.prototype.destroy=function(){var t=this;this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var e=0;e<this.children.length;e++)t.children[e].destroy()},b.prototype.posBeforeChild=function(t){for(var e=this,n=0,r=this.posAtStart;n<this.children.length;n++){var o=e.children[n];if(o==t)return r;r+=o.size}},k.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},k.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},b.prototype.localPosFromDOM=function(t,e,n){var r,o=this;if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var i,s;if(t==this.contentDOM)i=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&(!(s=i.pmViewDesc)||s.parent!=this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}var a,c;if(t==this.contentDOM)a=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;a=t.nextSibling}for(;a&&(!(c=a.pmViewDesc)||c.parent!=this);)a=a.nextSibling;return a?this.posBeforeChild(c):this.posAtEnd}if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var l=t;;l=l.parentNode){if(l==o.dom){r=!1;break}if(l.parentNode.firstChild!=l)break}if(null==r&&e==t.childNodes.length)for(var p=t;;p=p.parentNode){if(p==o.dom){r=!0;break}if(p.parentNode.lastChild!=p)break}}return(null==r?0<n:r)?this.posAtEnd:this.posAtStart},b.prototype.nearestDesc=function(t,e){for(var n=this,r=!0,o=t;o;o=o.parentNode){var i=n.getDesc(o);if(i&&(!e||i.node)){if(!r||!i.nodeDOM||1==i.nodeDOM.nodeType&&i.nodeDOM.contains(t))return i;r=!1}}},b.prototype.getDesc=function(t){for(var e=this,n=t.pmViewDesc,r=n;r;r=r.parent)if(r==e)return n},b.prototype.posFromDOM=function(t,e,n){for(var r=this,o=t;;o=o.parentNode){var i=r.getDesc(o);if(i)return i.localPosFromDOM(t,e,n)}},b.prototype.descAt=function(t){for(var e=this,n=0,r=0;n<this.children.length;n++){var o=e.children[n],i=r+o.size;if(r==t&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(t<i)return o.descAt(t-r-o.border);r=i}},b.prototype.domFromPos=function(t,e){var n=this;if(!this.contentDOM)return{node:this.dom,offset:0};for(var r=0,o=0;;o++){if(r==t)return{node:n.contentDOM,offset:e?n.findDOMOffset(o,e):o};if(o==n.children.length)throw new Error("Invalid position "+t);var i=n.children[o],s=r+i.size;if(t<s)return i.domFromPos(t-r-i.border,e);r=s}},b.prototype.findDOMOffset=function(t,e){var n=this,r=this.contentDOM;if(e<0){for(var o=t-1;0<=o;o--){var i=n.children[o];if(i.size){var s=Array.prototype.indexOf.call(r.childNodes,i.dom);if(-1<s)return s+1}}return 0}for(var a=t;a<this.children.length;a++){var c=n.children[a];if(c.size){var l=Array.prototype.indexOf.call(r.childNodes,c.dom);if(-1<l)return l}}return r.childNodes.length},b.prototype.domAfterPos=function(t){var e=this.domFromPos(t),n=e.node,r=e.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]},b.prototype.setSelection=function(t,e,n){for(var r=this,o=Math.min(t,e),i=Math.max(t,e),s=0,a=0;s<this.children.length;s++){var c=r.children[s],l=a+c.size;if(a<o&&i<l)return c.setSelection(t-a-c.border,e-a-c.border,n);a=l}var p=this.domFromPos(t),u=this.domFromPos(e),f=n.getSelection(),h=document.createRange();if(f.extend)h.setEnd(p.node,p.offset),h.collapse(!1);else{if(e<t){var d=p;p=u,u=d}h.setEnd(u.node,u.offset),h.setStart(p.node,p.offset)}f.removeAllRanges(),f.addRange(h),f.extend&&f.extend(u.node,u.offset)},b.prototype.ignoreMutation=function(){return!this.contentDOM},k.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},b.prototype.markDirty=function(t,e){for(var n=this,r=0,o=0;o<this.children.length;o++){var i=n.children[o],s=r+i.size;if(r==s?t<=s&&r<=e:t<s&&r<e){var a=r+i.border,c=s-i.border;if(a<=t&&e<=c)return n.dirty=t==r||e==s?w:f,void(t==a&&e==c&&i.contentLost?i.dirty=x:i.markDirty(t-a,e-a));i.dirty=x}r=s}this.dirty=w},Object.defineProperties(b.prototype,k);var S=[],M=function(n){function t(t,e){n.call(this,t,S,e.type.widget,null),this.widget=e}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),(t.prototype.constructor=t).prototype.matchesWidget=function(t){return this.dirty==y&&t.type.eq(this.widget.type)},t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.stopEvent=function(t){var e=this.widget.type.options.stopEvent;return!!e&&e(t)},t}(b),C=function(r){function i(t,e,n){r.call(this,t,[],n,n),this.mark=e}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),(i.prototype.constructor=i).create=function(t,e,n){var r=d(n)[e.type.name],o=r&&r(e,n);return new i(t,e,o&&o.dom||v.renderSpec(document,e.type.spec.toDOM(e)).dom)},i.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},i.prototype.matchesMark=function(t){return this.dirty!=x&&this.mark.eq(t)},i}(b),D=function(c){function f(t,e,n,r,o,i,s,a){c.call(this,t,e.isLeaf?S:[],o,i),this.nodeDOM=s,this.node=e,this.outerDeco=n,this.innerDeco=r,i&&this.updateChildren(a)}c&&(f.__proto__=c),f.prototype=Object.create(c&&c.prototype);var t={size:{},border:{}};return(f.prototype.constructor=f).create=function(t,e,n,r,o){var i,s,a=d(o)[e.type.name],c=a&&a(e,o,function(){if(i&&i.parent)return i.parent.posBeforeChild(i)},n),l=c&&c.dom,p=c&&c.contentDOM;l||(l=(s=v.renderSpec(document,e.type.spec.toDOM(e))).dom,p=s.contentDOM);p||e.isText||(l.contentEditable=!1);var u=l;return l=h(l,n,e),c?i=new R(t,e,n,r,l,p,u,c,o):e.isText?new O(t,e,n,r,l,u,o):new f(t,e,n,r,l,p,u,o)},f.prototype.parseRule=function(){return{node:this.node.type.name,attrs:this.node.attrs,contentElement:this.contentLost?null:this.contentDOM}},f.prototype.matchesNode=function(t,e,n){return this.dirty==y&&t.eq(this.node)&&a(e,this.outerDeco)&&n.eq(this.innerDeco)},t.size.get=function(){return this.node.nodeSize},t.border.get=function(){return this.node.isLeaf?0:1},f.prototype.updateChildren=function(o){var i=this,s=new z(this);p(this.node,this.innerDeco,function(t){s.placeWidget(t)},function(t,e,n,r){s.syncToMarks(t.marks,o),s.findNodeMatch(t,e,n)||s.updateNextNode(t,e,n,o,i.node.content,r)||s.addNode(t,e,n,o)}),s.syncToMarks(S,o),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==w)&&this.renderChildren()},f.prototype.renderChildren=function(){s(this.contentDOM,this.children,f.is),g.ios&&m(this.dom)},f.prototype.update=function(t,e,n,r){return!(this.dirty==x||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),this.node=t,this.innerDeco=n,t.isLeaf||this.updateChildren(r),this.dirty=y,!0)},f.prototype.updateOuterDeco=function(t){if(!a(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType;this.dom=i(this.dom,this.nodeDOM,o(this.outerDeco,this.node,e),o(t,this.node,e)),this.outerDeco=t}},f.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode")},f.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode")},Object.defineProperties(f.prototype,t),f}(b);e.docViewDesc=r;var O=function(c){function t(t,e,n,r,o,i,s){c.call(this,t,e,n,r,o,null,i,s);for(var a=i;3!=a.nodeType;)if(!(a=a.firstChild))throw new RangeError("Text node rendered without text DOM");this.textDOM=a}return c&&(t.__proto__=c),t.prototype=Object.create(c&&c.prototype),(t.prototype.constructor=t).prototype.parseRule=function(){return{skip:this.textDOM.parentNode}},t.prototype.update=function(t,e){return!(this.dirty==x||this.dirty!=y&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),this.dirty==y&&t.text==this.node.text||t.text==this.textDOM.nodeValue||(this.textDOM.nodeValue=t.text),this.node=t,this.dirty=y,!0)},t.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.textDOM;e;e=e.parentNode)if(e==t)return!0;return!1},t.prototype.domFromPos=function(t,e){return{node:this.textDOM,offset:e?Math.max(t,this.textDOM.nodeValue.length):t}},t.prototype.localPosFromDOM=function(t,e,n){return t==this.textDOM?this.posAtStart+Math.min(e,this.node.text.length):c.prototype.localPosFromDOM.call(this,t,e,n)},t.prototype.ignoreMutation=function(t){return"characterData"!=t.type},t}(D),T=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),(e.prototype.constructor=e).prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(){return this.dirty==y},e}(b),R=function(l){function t(t,e,n,r,o,i,s,a,c){l.call(this,t,e,n,r,o,i,s,c),this.spec=a}return l&&(t.__proto__=l),t.prototype=Object.create(l&&l.prototype),(t.prototype.constructor=t).prototype.update=function(t,e,n,r){if(this.dirty==x)return!1;if(this.spec.update){var o=this.spec.update(t,e);return o&&(this.node=t,this.contentDOM&&this.updateChildren(r)),o}return!(!this.contentDOM&&!t.isLeaf)&&l.prototype.update.call(this,t,e,this.contentDOM?this.innerDeco:n,r)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():l.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():l.prototype.deselectNode.call(this)},t.prototype.setSelection=function(t,e,n){this.spec.setSelection?this.spec.setSelection(t,e,n):l.prototype.setSelection.call(this,t,e,n)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),l.prototype.destroy.call(this)},t.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},t.prototype.ignoreMutation=function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):l.prototype.ignoreMutation.call(this,t)},t}(D),
3
- N=function(t){t&&(this.nodeName=t)};N.prototype=Object.create(null);var E,A,I=[new N],z=function(t){this.top=t,this.index=0,this.stack=[],this.changed=!1};return z.prototype.destroyBetween=function(t,e){var n=this;if(t!=e){for(var r=t;r<e;r++)n.top.children[r].destroy();this.top.children.splice(t,e-t),this.changed=!0}},z.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},z.prototype.syncToMarks=function(t,e){for(var n,r=this,o=0,i=this.stack.length>>1,s=Math.min(i,t.length);o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(t[o]);)o++;for(;o<i;)r.destroyRest(),r.top.dirty=y,r.index=r.stack.pop(),r.top=r.stack.pop(),i--;for(;i<t.length;){if(r.stack.push(r.top,r.index+1),r.index<r.top.children.length&&(n=r.top.children[r.index]).matchesMark(t[i]))r.top=n;else{var a=C.create(r.top,t[i],e);r.top.children.splice(r.index,0,a),r.top=a,r.changed=!0}r.index=0,i++}},z.prototype.findNodeMatch=function(t,e,n){for(var r=this,o=this.index,i=this.top.children,s=Math.min(i.length,o+5);o<s;o++)if(i[o].matchesNode(t,e,n))return r.destroyBetween(r.index,o),r.index++,!0;return!1},z.prototype.updateNextNode=function(t,e,n,r,o,i){if(this.index==this.top.children.length)return!1;var s=this.top.children[this.index];if(s instanceof D){for(var a=i+1,c=Math.min(o.childCount,a+5);a<c;a++)if(s.node==o.child(a))return!1;var l=s.dom;if(s.update(t,e,n,r))return s.dom!=l&&(this.changed=!0),this.index++,!0}return!1},z.prototype.addNode=function(t,e,n,r){this.top.children.splice(this.index++,0,D.create(this.top,t,e,n,r)),this.changed=!0},z.prototype.placeWidget=function(t){this.index<this.top.children.length&&this.top.children[this.index].matchesWidget(t)?this.index++:(this.top.children.splice(this.index++,0,new M(this.top,t)),this.changed=!0)},z.prototype.addTextblockHacks=function(){for(var t=this.top.children[this.index-1];t instanceof C;)t=t.children[t.children.length-1];if(!t||!(t instanceof O)||/\n$/.test(t.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var e=document.createElement("br");this.top.children.splice(this.index++,0,new T(this.top,S,e,null)),this.changed=!0}},n.exports}),t.registerDynamic("15",[],!0,function(t,e,n){var r=n.exports={};if("undefined"!=typeof navigator){var o=/MSIE \d/.test(navigator.userAgent),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);r.mac=/Mac/.test(navigator.platform),r.ie=o||!!i,r.ie_version=o?document.documentMode||6:i&&+i[1],r.gecko=/gecko\/\d/i.test(navigator.userAgent),r.ios=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),r.webkit="WebkitAppearance"in document.documentElement.style}return n.exports}),t.registerDynamic("16",["7","15"],!0,function(t,e,n){function u(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.node,s=0<e?o:r,a=i&&i.isBlock?s:s.depth?t.doc.resolve(0<e?s.after():s.before()):null;return a&&g.findFrom(a,e)}function f(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function o(t,e){var n=t.state.selection,r=n.empty,o=n.node,i=n.$from,s=n.$to;if(!r&&!o)return!1;if(o&&o.isInline)return f(t,new w(0<e?s:i));if(!o&&!t.endOfTextblock(0<e?"right":"left")){var a=0<e?i.parent.childAfter(i.parentOffset):i.parent.childBefore(i.parentOffset),c=a.node,l=a.offset;return!(!c||!y.isSelectable(c)||l!=i.parentOffset-(0<e?0:c.nodeSize))&&f(t,new y(e<0?t.state.doc.resolve(i.pos-c.nodeSize):i))}var p=u(t.state,e);return!(!p||!(p instanceof y||o))&&f(t,p)}function c(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function l(t){var e=t.pmViewDesc;return e&&0==e.size}function i(t){for(var e,n,r=t.root.getSelection(),o=r.anchorNode,i=r.anchorOffset;;)if(0<i){if(1!=o.nodeType)break;if(!l(o.childNodes[i-1]))break;e=o,n=--i}else{if(p(o))break;for(var s=o.previousSibling;s&&l(s);)e=o.parentNode,n=Array.prototype.indexOf.call(e.childNodes,s),s=s.previousSibling;if(s)i=c(o=s);else{if((o=o.parentNode)==t.content)break;i=0}}e&&h(r,e,n)}function s(t){for(var e,n,r=t.root.getSelection(),o=r.anchorNode,i=r.anchorOffset,s=c(o);;)if(i<s){if(1!=o.nodeType)break;if(!l(o.childNodes[i]))break;e=o,n=++i}else{if(p(o))break;for(var a=o.nextSibling;a&&l(a);)e=a.parentNode,n=Array.prototype.indexOf.call(e.childNodes,a)+1,a=a.nextSibling;if(a)i=0,s=c(o=a);else{if((o=o.parentNode)==t.content)break;i=s=0}}e&&h(r,e,n)}function p(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function h(t,e,n){var r=document.createRange();r.setEnd(e,n),r.setStart(e,n),t.removeAllRanges(),t.addRange(r)}function a(t,e){var n=t.state.selection,r=n.empty,o=n.node,i=n.$from,s=n.$to;if(!r&&!o)return!1;var a=!0,c=e<0?i:s;if(o&&!o.isInline||(a=t.endOfTextblock(e<0?"up":"down")),a){var l=u(t.state,e);if(l&&l instanceof y)return f(t,l)}if(!o||o.isInline)return!1;var p=g.findFrom(c,e);return!p||f(t,p)}function d(t,e){var n=t.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r||!r.sameParent(o)||!r.parent.isTextblock)return!0;if(!i)return!1;if(t.endOfTextblock(0<e?"forward":"backward"))return!0;var s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(!s||s.isText)return!1;var a=t.state.tr;return e<0?a["delete"](r.pos-s.nodeSize,r.pos):a["delete"](r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}function m(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function r(t,e){var n=e.keyCode,r=m(e);return 8==n?d(t,-1)||i(t):46==n?d(t,1)||s(t):13==n||27==n||(37==n?o(t,-1)||i(t):39==n?o(t,1)||s(t):38==n?a(t,-1):40==n?a(t,1):r==(x.mac?"m":"c")&&(66==n||73==n||89==n||90==n)||!!(x.mac&&(68==n||72==n)&&"c"==r||68==n&&"a"==r)&&(d(t,68==n?1:-1)||s(t)))}var v=t("7"),g=v.Selection,y=v.NodeSelection,w=v.TextSelection,x=t("15");return e.captureKeyDown=r,n.exports}),t.registerDynamic("17",["3","7","18"],!0,function(t,e,n){function M(t,e,n,r){var o=t.docView.domFromPos(n,-1),i=o.node,s=o.offset,a=t.docView.domFromPos(r,1),c=a.node,l=a.offset;if(i!=c)return null;if(l==i.childNodes.length)for(var p=i;p!=t.content;){if(!p)return null;if(p.nextSibling){if(!p.nextSibling.pmViewDesc)return null;break}p=p.parentNode}var u=t.root.getSelection(),f=null,h=u.anchorNode;h&&t.content.contains(1==h.nodeType?h:h.parentNode)&&(f=[{node:h,offset:u.anchorOffset}],u.isCollapsed||f.push({node:u.focusNode,offset:u.focusOffset}));var d=e.doc,m=t.someProp("domParser")||k.fromSchema(t.state.schema),v=d.resolve(n),g=null,y=m.parse(i,{topNode:v.parent.copy(),topStart:v.index(),topOpen:!0,from:s,to:l,preserveWhitespace:!0,editableContent:!0,findPositions:f,ruleFromNode:b});if(f&&null!=f[0].pos){var w=f[0].pos,x=f[1]&&f[1].pos;null==x&&(x=w),g={anchor:w+n,head:x+n}}return{doc:y,sel:g}}function b(t){var e=t.pmViewDesc;return e?e.parseRule():"BR"==t.nodeName&&t.parentNode&&t.parentNode.lastChild==t?{ignore:!0}:void 0}function h(t,e){for(var n=e||0;n<t.depth;n++)if(t.index(n)+1<t.node(n).childCount)return!1;return t.parentOffset==t.parent.content.size}function d(t,e){for(var n=e||0;n<t.depth;n++)if(0<t.index(0))return!1;return 0==t.parentOffset}function r(t){var e=t.$from,n=t.$to;if(e.sameParent(n)&&e.parent.isTextblock&&e.parentOffset&&n.parentOffset<n.parent.content.size){var r=Math.max(0,e.parentOffset),o=e.parent.content.size,i=Math.min(o,n.parentOffset);if(0<r&&(r=e.parent.childBefore(r).offset),i<o){var s=e.parent.childAfter(i);i=s.offset+s.node.nodeSize}var a=e.start();return{from:a+r,to:a+i}}for(var c=0;;c++){var l=d(e,c+1),p=h(n,c+1);if(l||p||e.index(c)!=n.index(c)||n.node(c).isTextblock){var u=e.before(c+1),f=n.after(c+1);return l&&0<e.index(c)&&(u-=e.node(c).child(e.index(c)-1).nodeSize),p&&n.index(c)+1<n.node(c).childCount&&(f+=n.node(c).child(n.index(c)+1).nodeSize),{from:u,to:f}}}}function C(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function o(e,t,n,r){for(var o,i=n.doc;!(o=M(e,n,r.from,r.to));){var s=i.resolve(r.from),a=i.resolve(r.to);r={from:s.depth?s.before():0,to:a.depth?a.after():i.content.size}}var c=o.doc,l=o.sel,p=R(i.slice(r.from,r.to).content,c.content,r.from,n.selection.from);if(p){var u,f=c.resolveNoCache(p.start-r.from),h=c.resolveNoCache(p.endB-r.from);if(!(!f.sameParent(h)&&f.pos<c.content.size&&(u=N.findFrom(c.resolve(f.pos+1),1,!0))&&u.head==h.pos&&e.someProp("handleKeyDown",function(t){return t(e,C(13,"Enter"))})||n.selection.anchor>p.start&&T(i,p.start,p.endA,f,h)&&e.someProp("handleKeyDown",function(t){return t(e,C(8,"Backspace"))}))){var d,m,v,g,y=t.map(p.start),w=t.map(p.endA,-1);if(f.sameParent(h)&&f.parent.isTextblock)if(f.pos==h.pos){d=e.state.tr["delete"](y,w);var x=i.resolve(p.start);x.parentOffset<x.parent.content.size&&(m=x.marks(!0))}else if(p.endA==p.endB&&(g=i.resolve(p.start))&&(v=O(f.parent.content.cut(f.parentOffset,h.parentOffset),g.parent.content.cut(g.parentOffset,p.endA-g.start()))))d=e.state.tr,"add"==v.type?d.addMark(y,w,v.mark):d.removeMark(y,w,v.mark);else if(f.parent.child(f.index()).isText&&f.index()==h.index()-(h.textOffset?0:1)){var b=f.parent.textBetween(f.parentOffset,h.parentOffset);if(e.someProp("handleTextInput",function(t){return t(e,y,w,b)}))return;d=e.state.tr.insertText(b,y,w)}if(d||(d=e.state.tr.replace(y,w,c.slice(p.start-r.from,p.endB-r.from))),l){var k=D(d.doc,t,l);k&&d.setSelection(k)}m&&d.setStoredMarks(m),e.dispatch(d.scrollIntoView())}}else if(l){var S=D(e.state.doc,t,l);S&&!S.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(S))}}function D(t,e,n){return Math.max(n.anchor,n.head)>t.content.size?null:N.between(t.resolve(e.map(n.anchor)),t.resolve(e.map(n.head)))}function O(t,e){for(var n,r,o,i=t.firstChild.marks,s=e.firstChild.marks,a=i,c=s,l=0;l<s.length;l++)a=s[l].removeFromSet(a);for(var p=0;p<i.length;p++)c=i[p].removeFromSet(c);if(1==a.length&&0==c.length)r=a[0],n="add",o=function(t){return t.mark(r.addToSet(t.marks))};else{if(0!=a.length||1!=c.length)return null;r=c[0],n="remove",o=function(t){return t.mark(r.removeFromSet(t.marks))}}for(var u=[],f=0;f<e.childCount;f++)u.push(o(e.child(f)));if(m.from(u).eq(t))return{mark:r,type:n}}function T(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||a(r,!0,!1)<o.pos)return!1;var i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=t.resolve(a(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||a(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function a(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;0<r&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function R(t,e,n,r){var o=t.findDiffStart(e,n);if(null==o)return null;var i=t.findDiffEnd(e,n+t.size,n+e.size),s=i.a,a=i.b;if(s<o&&t.size<e.size)a=(o-=r<=o&&s<=r?o-r:0)+(a-s),s=o;else if(a<o){s=(o-=r<=o&&a<=r?o-r:0)+(s-a),a=o}return{start:o,endA:s,endB:a}}var i=t("3"),m=i.Fragment,k=i.DOMParser,N=t("7").Selection,s=t("18").TrackMappings,c=function(t,e,n){var r=this;this.view=t,this.id=e,this.state=t.state,this.composing=n,this.from=this.to=null,this.timeout=n?null:setTimeout(function(){return r.finish()},20),this.mappings=new s(t.state)};return c.prototype.addRange=function(t,e){null==this.from?(this.from=t,this.to=e):(this.from=Math.min(t,this.from),this.to=Math.max(e,this.to))},c.prototype.changedRange=function(){if(null==this.from)return r(this.state.selection);var t=this.state.doc.resolve(Math.min(this.from,this.state.selection.from)),e=this.state.doc.resolve(this.to),n=t.sharedDepth(this.to);return{from:t.before(n+1),to:e.after(n+1)}},c.prototype.finish=function(t){if(clearTimeout(this.timeout),!this.composing||t){var e=this.changedRange();null==this.from?this.view.docView.markDirty(e.from,e.to):this.view.docView.markDirty(this.from,this.to);var n=this.mappings.getMapping(this.view.state);this.destroy(),n&&o(this.view,n,this.state,e),this.view.docView.dirty&&this.view.updateState(this.view.state)}},c.prototype.destroy=function(){this.mappings.destroy(),this.view.inDOMChange=null},c.prototype.compositionEnd=function(){var t=this;this.composing&&(this.composing=!1,this.timeout=setTimeout(function(){return t.finish()},50))},c.start=function(t,e){if(t.inDOMChange)e&&(clearTimeout(t.inDOMChange.timeout),t.inDOMChange.composing=!0);else{var n=Math.floor(4294967295*Math.random());t.inDOMChange=new c(t,n,e)}return t.inDOMChange},e.DOMChange=c,n.exports}),t.registerDynamic("19",["3"],!0,function(t,e,n){function r(t,e,n){var r,o=t.state.doc.slice(e.from,e.to,!e.node),i=o;if(!e.node){var s=Math.max(0,e.$from.sharedDepth(e.to)-1);r=f(i,s);for(var a=i.content,c=0;c<s;c++)a=a.firstChild.content;i=new d(a,i.openLeft-s,i.openRight-s)}var l=(t.someProp("clipboardSerializer")||g.fromSchema(t.state.schema)).serializeFragment(i.content),p=document.createElement("div");p.appendChild(l);var u=1==p.firstChild.nodeType&&p.firstChild;return u&&(e.node?u.setAttribute("data-pm-node-selection",!0):u.setAttribute("data-pm-context",r)),n.clearData(),n.setData("text/html",p.innerHTML),n.setData("text/plain",i.content.textBetween(0,i.content.size,"\n\n")),o}function o(t){return null!=y?y:(t.setData("text/html","<hr>"),y="<hr>"==t.getData("text/html"))}function i(t,e,n,r){var o=e.getData("text/plain"),i=e.getData("text/html");if(!i&&!o)return null;var s,a=r.parent.type.spec.code;if((n||a||!i)&&o){if(t.someProp("transformPastedText",function(t){return o=t(o)}),a)return new d(m.from(t.state.schema.text(o)),0,0);s=document.createElement("div"),o.split(/(?:\r\n?|\n)+/).forEach(function(t){s.appendChild(document.createElement("p")).textContent=t})}else t.someProp("transformPastedHTML",function(t){return i=t(i)}),s=u(i);var c,l=(t.someProp("clipboardParser")||t.someProp("domParser")||v.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!0});return l=s.querySelector("[data-pm-node-selection]")?new d(l.content,0,0):(c=s.querySelector("[data-pm-context]"))?h(l,c.getAttribute("data-pm-context")):p(l,r)}function p(e,n){if(e.content.childCount<2)return e;for(var t=function(t){var o=n.node(t).contentMatchAt(n.index(t)),i=void 0,s=[];if(e.content.forEach(function(t){if(s){var e,n=o.findWrappingFor(t);if(!n)return s=null;if(e=s.length&&i.length&&c(n,i,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=l(s[s.length-1],i.length));var r=a(t,n);s.push(r),o=o.matchType(r.type,r.attrs),i=n}}}),s)return{v:d.maxOpen(m.from(s))}},r=n.depth;0<=r;r--){var o=t(r);if(o)return o.v}return e}function a(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;n<=r;r--)t=e[r].type.create(e[r].attrs,m.from(t));return t}function c(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o].type==e[o].type){var i=c(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));var s=r.contentMatchAt(r.childCount);if(o==t.length-1?s.matchNode(n):s.matchType(t[o+1].type,t[o+1].attrs))return r.copy(r.content.append(m.from(a(n,t,o+1))))}}function l(t,e){if(0==e)return t;var n=t.content.replaceChild(t.childCount-1,l(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(m.empty,!0);return t.copy(n.append(r))}function u(t){var e=/(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=(x||(x=document.implementation.createHTMLDocument("title"))).createElement("div"),o=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(t),i=0;if(n=o&&w[o[1].toLowerCase()]){var s=n.split(" ");t=s.map(function(t){return"<"+t+">"}).join("")+t+s.map(function(t){return"</"+t+">"}).reverse().join(""),i=s.length}r.innerHTML=t;for(var a=0;a<i;a++)r=r.firstChild;return r}function f(t,e){for(var n=[],r=t.content,o=0;o<e;o++){var i=r.firstChild;n.push(i.type.name,i.type.hasRequiredAttrs()?i.attrs:null),r=i.content}return JSON.stringify(n)}function h(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(l){return t}for(var o=t.content,i=t.openLeft,s=t.openRight,a=n.length-2;0<=a;a-=2){var c=r.nodes[n[a]];if(!c||c.hasRequiredAttrs())break;o=m.from(c.create(n[a+1],o)),i++,s++}return new d(o,i,s)}var s=t("3"),d=s.Slice,m=s.Fragment,v=s.DOMParser,g=s.DOMSerializer;e.toClipboard=r;var y=null;e.canUpdateClipboard=o,e.fromClipboard=i;var w={thead:"table",colgroup:"table",col:"table colgroup",tr:"table tbody",td:"table tbody tr",th:"table tbody tr"},x=null;return n.exports}),t.registerDynamic("18",["7","9"],!0,function(t,e,n){var r=t("7").EditorState,s=t("9").Mapping,o=function(t,e,n){this.prev=t,this.mapping=e,this.state=n},i=function(t){this.seen=[new o(null,null,t)],r.addApplyListener(this.track=this.track.bind(this))};return i.prototype.destroy=function(){r.removeApplyListener(this.track)},i.prototype.find=function(t){for(var e=this,n=this.seen.length-1;0<=n;n--){var r=e.seen[n];if(r.state==t)return r}},i.prototype.track=function(t,e,n){var r=this.seen.length<200?this.find(t):null;r&&this.seen.push(new o(r,e.docChanged?e.mapping:null,n))},i.prototype.getMapping=function(t){var e=this.find(t);if(!e)return null;for(var n=[],r=e;r;r=r.prev)r.mapping&&n.push(r.mapping);for(var o=new s,i=n.length-1;0<=i;i--)o.appendMapping(n[i]);return o},e.TrackMappings=i,n.exports}),t.registerDynamic("1a",["7","15","16","17","19","18"],!0,function(t,e,n){function r(n){n.shiftKey=!1,n.mouseDown=null,n.dragging=null,n.inDOMChange=null,n.mutationObserver=window.MutationObserver&&new window.MutationObserver(function(t){return S(n,t)}),x(n);var t=function(t){var e=_[t];n.content.addEventListener(t,function(t){!a(n,t)||s(n,t)||!n.editable&&t.type in V||e(n,t)})};for(var e in _)t(e);n.extraHandlers=Object.create(null),i(n)}function o(t){k(t),t.inDOMChange&&t.inDOMChange.destroy(),t.dragging&&t.dragging.destroy()}function i(n){n.someProp("handleDOMEvents",function(t){for(var e in t)n.extraHandlers[e]||t.hasOwnProperty(e)||(n.extraHandlers[e]=!0,n.content.addEventListener(e,function(t){return s(n,t)}))})}function s(n,r){return n.someProp("handleDOMEvents",function(t){var e=t[r.type];return!!e&&e(n,r)})}function a(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.content;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function c(t,e){s(t,e)||!_[e.type]||!t.editable&&e.type in V||_[e.type](t,e)}function d(t){return{left:t.clientX,top:t.clientY}}function l(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function p(n,t,r,e,o){if(-1==e)return!1;for(var i=n.state.doc.resolve(e),s=function(e){if(n.someProp(t,function(t){return e>i.depth?t(n,r,i.nodeAfter,i.before(e),o,!0):t(n,r,i.node(e),i.before(e),o,!1)}))return{v:!0}},a=i.depth+1;0<a;a--){var c=s(a);if(c)return c.v}return!1}function u(t,e,n){t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function f(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isLeaf&&N.isSelectable(r))&&(u(t,new N(n),"pointer"),!0)}function h(t,e){if(-1==e)return!1;for(var n,r=t.state.selection,o=r.node,i=r.$from,s=t.state.doc.resolve(e),a=s.depth+1;0<a;a--){var c=a>s.depth?s.nodeAfter:s.node(a);if(N.isSelectable(c)){n=o&&0<i.depth&&a>=i.depth&&s.before(i.depth+1)==i.pos?s.before(i.depth):s.before(a);break}}return null!=n&&(u(t,N.create(t.state.doc,n),"pointer"),!0)}function m(e,n,t,r,o){return p(e,"handleClickOn",n,t,r)||e.someProp("handleClick",function(t){return t(e,n,r)})||(o?h(e,t):f(e,t))}function v(e,n,t,r){return p(e,"handleDoubleClickOn",n,t,r)||e.someProp("handleDoubleClick",function(t){return t(e,n,r)})}function g(e,n,t,r){return p(e,"handleTripleClickOn",n,t,r)||e.someProp("handleTripleClick",function(t){return t(e,n,r)})||y(e,t)}function y(t,e){var n=t.state.doc;if(-1==e)return!!n.isTextblock&&(u(t,E.create(n,0,n.content.size),"pointer"),!0);for(var r=n.resolve(e),o=r.depth+1;0<o;o--){var i=o>r.depth?r.nodeAfter:r.node(o),s=r.before(o);if(i.isTextblock)u(t,E.create(n,s+1,s+1+i.content.size),"pointer");else{if(!N.isSelectable(i))continue;u(t,N.create(n,s),"pointer")}return!0}}function w(t){return!!t.inDOMChange&&(t.inDOMChange.finish(!0),!0)}function x(e){e.mutationObserver&&e.mutationObserver.observe(e.content,H),A.ie&&A.ie_version<=11&&e.content.addEventListener("DOMCharacterDataModified",e.onCharData||(e.onCharData=function(t){M(e,{target:t.target,type:"characterData"})}))}function b(t){t.mutationObserver&&S(t,t.mutationObserver.takeRecords())}function k(t){t.mutationObserver&&(b(t),t.mutationObserver.disconnect()),A.ie&&A.ie_version<=11&&t.content.removeEventListener("DOMCharacterDataModified",t.onCharData)}function S(t,e){if(t.editable)for(var n=0;n<e.length;n++)M(t,e[n])}function M(t,e){var n=t.docView.nearestDesc(e.target);if(("attributes"!=e.type||n!=t.docView&&"contenteditable"!=e.attributeName)&&n&&!n.ignoreMutation(e)){var r,o;if("childList"==e.type){var i=e.previousSibling&&e.previousSibling.parentNode==e.target?Array.prototype.indexOf.call(e.target.childNodes,e.previousSibling)+1:0;if(-1==i)return;r=n.localPosFromDOM(e.target,i,-1);var s=e.nextSibling&&e.nextSibling.parentNode==e.target?Array.prototype.indexOf.call(e.target.childNodes,e.nextSibling):e.target.childNodes.length;if(-1==s)return;o=n.localPosFromDOM(e.target,s,1)}else"attributes"==e.type?(r=n.posAtStart-n.border,o=n.posAtEnd+n.border):(r=n.posAtStart,o=n.posAtEnd);z.start(t).addRange(r,o)}}function C(t){return 0==t.openLeft&&0==t.openRight&&1==t.content.childCount?t.content.firstChild:null}function D(t){t.dragging&&(t.dragging.destroy(),t.dragging=null)}function O(t,e){if(!t||!t.content.size)return e.pos;for(var n=t.content,r=0;r<t.openLeft;r++)n=n.firstChild.content;for(var o=e.depth;0<=o;o--){var i=o==e.depth?0:e.pos<=(e.start(o+1)+e.end(o+1))/2?-1:1,s=e.index(o)+(0<i?1:0);if(e.node(o).canReplace(s,s,n))return 0==i?e.pos:i<0?e.before(o+1):e.after(o+1)}return e.pos}var T=t("7"),R=T.Selection,N=T.NodeSelection,E=T.TextSelection,A=t("15"),I=t("16").captureKeyDown,z=t("17").DOMChange,P=t("19"),L=P.fromClipboard,F=P.toClipboard,B=P.canUpdateClipboard,q=t("18").TrackMappings,_={},V={};e.initInput=r,e.destroyInput=o,e.ensureListeners=i,e.dispatchEvent=c,V.keydown=function(e,n){16==n.keyCode&&(e.shiftKey=!0),e.inDOMChange||(e.someProp("handleKeyDown",function(t){return t(e,n)})||I(e,n)?n.preventDefault():e.selectionReader.poll())},V.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},V.keypress=function(e,n){if(!(e.inDOMChange||!n.charCode||n.ctrlKey&&!n.altKey||A.mac&&n.metaKey))if(e.someProp("handleKeyPress",function(t){return t(e,n)}))n.preventDefault();else{var t=e.state.selection,r=t.node,o=t.$from,i=t.$to;if(r||!o.sameParent(i)){var s=String.fromCharCode(n.charCode);e.someProp("handleTextInput",function(t){return t(e,o.pos,i.pos,s)})||e.dispatch(e.state.tr.insertText(s).scrollIntoView()),n.preventDefault()}}};var $={time:0,x:0,y:0},j=$,J=A.mac?"metaKey":"ctrlKey";_.mousedown=function(t,e){var n,r=w(t),o=Date.now();n=500<=o-$.time||!l(e,$)||e[J]?"singleClick":600<=o-j.time||!l(e,j)?"doubleClick":"tripleClick",j=$,$={time:o,x:e.clientX,y:e.clientY};var i=t.posAtCoords(d(e));i&&("singleClick"==n?t.mouseDown=new W(t,i,e,r):("doubleClick"==n?v:g)(t,i.pos,i.inside,e)?e.preventDefault():t.selectionReader.poll("pointer"))};var W=function(t,e,n,r){var o,i,s=this;if(this.view=t,this.pos=e,this.flushed=r,this.selectNode=n[J],this.allowDefault=n.shiftKey,-1<e.inside)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{var a=t.state.doc.resolve(e.pos);o=a.parent,i=a.depth?a.before():0}this.mightDrag=o.type.spec.draggable||o==t.state.selection.node?{node:o,pos:i}:null,this.target=r?null:n.target,this.target&&this.mightDrag&&(k(this.view),this.target.draggable=!0,A.gecko&&(this.setContentEditable=!this.target.hasAttribute("contentEditable"))&&setTimeout(function(){return s.target.setAttribute("contentEditable","false")},20),x(this.view)),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),t.selectionReader.poll("pointer")};W.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(k(this.view),this.target.draggable=!1,A.gecko&&this.setContentEditable&&this.target.removeAttribute("contentEditable"),x(this.view))},W.prototype.up=function(t){this.done(),this.view.content.contains(3==t.target.nodeType?t.target.parentNode:t.target)&&(this.allowDefault?this.view.selectionReader.poll("pointer"):m(this.view,this.pos.pos,this.pos.inside,t,this.selectNode)?t.preventDefault():this.flushed?(u(this.view,R.near(this.view.state.doc.resolve(this.pos.pos)),"pointer"),t.preventDefault()):this.view.selectionReader.poll("pointer"))},W.prototype.move=function(t){!this.allowDefault&&(4<Math.abs(this.x-t.clientX)||4<Math.abs(this.y-t.clientY))&&(this.allowDefault=!0),this.view.selectionReader.poll("pointer")},_.touchdown=function(t){w(t),t.selectionReader.poll("pointer")},_.contextmenu=function(e,n){w(e);var r=e.posAtCoords(d(n));r&&e.someProp("handleContextMenu",function(t){return t(e,r.pos,n)})&&n.preventDefault()},V.compositionstart=V.compositionupdate=function(t){z.start(t,!0),t.state.storedMarks&&t.inDOMChange.finish(!0)},V.compositionend=function(t,e){if(!t.inDOMChange){if(!e.data)return;z.start(t,!0)}t.inDOMChange.compositionEnd()};var H={childList:!0,characterData:!0,attributes:!0,subtree:!0};e.startObserving=x,e.flushObserver=b,e.stopObserving=k,V.input=function(t){return z.start(t)},_.copy=V.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;n.empty||(e.clipboardData&&B(e.clipboardData)?(F(t,n,e.clipboardData),e.preventDefault(),r&&t.dispatch(t.state.tr.deleteRange(n.from,n.to).scrollIntoView())):r&&A.ie&&A.ie_version<=11&&z.start(t))},V.paste=function(t,e){if(e.clipboardData){var n=L(t,e.clipboardData,t.shiftKey,t.state.selection.$from);if(n){e.preventDefault(),t.someProp("transformPasted",function(t){n=t(n)});var r=C(n),o=r?t.state.tr.replaceSelectionWith(r):t.state.tr.replaceSelection(n);t.dispatch(o.scrollIntoView())}}else A.ie&&A.ie_version<=11&&z.start(t)};var K=function(t,e,n,r){this.slice=e,this.range=n,this.move=r&&new q(t)};for(var Q in K.prototype.destroy=function(){this.move&&this.move.destroy()},_.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var r,o=t.state.selection,i=o.empty?null:t.posAtCoords(d(e));if(null!=i&&i.pos>=o.from&&i.pos<=o.to?r=o:n&&n.mightDrag&&(r=N.create(t.state.doc,n.mightDrag.pos)),r){var s=F(t,r,e.dataTransfer);t.dragging=new K(t.state,s,r,!e.ctrlKey)}}},_.dragend=function(t){window.setTimeout(function(){return D(t)},50)},V.dragover=V.dragenter=function(t,e){return e.preventDefault()},V.drop=function(t,e){var n=t.dragging;if(D(t),e.dataTransfer){var r=t.state.doc.resolve(t.posAtCoords(d(e)).pos);if(r){var o=n&&n.slice||L(t,e.dataTransfer,!1,r);if(o){var i=O(o,t.state.doc.resolve(r.pos));e.preventDefault();var s=t.state.tr;if(n&&n.move){var a=n.range,c=a.from,l=a.to,p=n.move.getMapping(t.state);p&&s.deleteRange(p.map(c,1),p.map(l,-1))}t.someProp("transformPasted",function(t){o=t(o)});var u=s.mapping.map(i),f=0==o.openLeft&&0==o.openRight&&1==o.content.childCount;f?s.replaceRangeWith(u,u,o.content.firstChild):s.replaceRange(u,u,o);var h=s.doc.resolve(u);f&&N.isSelectable(o.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(o.content.firstChild)?s.setSelection(new N(h)):s.setSelection(R.between(h,s.doc.resolve(s.mapping.map(i)))),t.focus(),t.dispatch(s)}}}},_.focus=function(e,n){e.focused||(e.content.classList.add("ProseMirror-focused"),e.focused=!0),e.someProp("onFocus",function(t){t(e,n)})},_.blur=function(e,n){e.focused&&(e.content.classList.remove("ProseMirror-focused"),e.focused=!1),e.someProp("onBlur",function(t){t(e,n)})},V)_[Q]=V[Q];return n.exports}),t.registerDynamic("1b",["7","15","1a"],!0,function(t,e,n){function r(t){return new("onselectionchange"in document?p:d)(t)}function o(t,e,n){if(c(t,e),!t.hasFocus()){if(!n)return;l.gecko&&t.editable&&t.content.focus()}var r=t.selectionReader;if(e!=r.lastSelection||r.domChanged()){var o,i=e.anchor,s=e.head;if(null==i&&(i=e.from,s=e.to,l.webkit&&e.node.isBlock)){var a=t.docView.descAt(e.from);a.contentDOM||"false"!=a.dom.contentEditable||(o=a.dom,a.dom.contentEditable="true")}t.docView.setSelection(i,s,t.root),o&&(o.contentEditable="false"),r.storeDOMState(e)}}function c(t,e){if(e instanceof f){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(i(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else i(t)}function i(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}var s=t("7"),u=s.Selection,f=s.NodeSelection,l=t("15"),h=t("1a").flushObserver,a=function(t){var e=this;this.view=t,this.lastAnchorNode=this.lastHeadNode=this.lastAnchorOffset=this.lastHeadOffset=null,this.lastSelection=t.state.selection,this.poller=r(this),t.content.addEventListener("focus",function(){return e.poller.start()}),t.content.addEventListener("blur",function(){return e.poller.stop()}),t.editable||this.poller.start()};a.prototype.destroy=function(){this.poller.stop()},a.prototype.poll=function(t){this.poller.poll(t)},a.prototype.editableChanged=function(){this.view.editable?this.view.hasFocus()||this.poller.stop():this.poller.start()},a.prototype.domChanged=function(){var t=this.view.root.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastHeadNode||t.focusOffset!=this.lastHeadOffset},a.prototype.storeDOMState=function(t){var e=this.view.root.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastHeadNode=e.focusNode,this.lastHeadOffset=e.focusOffset,this.lastSelection=t},a.prototype.readFromDOM=function(t){if(this.view.inDOMChange||h(this.view),this.view.hasFocus()&&!this.view.inDOMChange&&this.domChanged()){var e=this.view.root.getSelection(),n=this.view.state.doc,r=this.view.docView.nearestDesc(e.focusNode);if(r.size){var o,i,s=this.view.docView.posFromDOM(e.focusNode,e.focusOffset),a=n.resolve(s);if(e.isCollapsed){for(o=a;r&&!r.node;)r=r.parent;if(r&&r.node.isLeaf&&f.isSelectable(r.node)){var c=r.posAtStart;i=new f(s==c?a:n.resolve(c))}}else o=n.resolve(this.view.docView.posFromDOM(e.anchorNode,e.anchorOffset));if(!i){var l=null!=this.view.state.selection.head&&this.view.state.selection.head<a.pos?1:-1;i=u.between(o,a,l),-1==l&&i.node&&(i=u.between(o,a,1))}if(a.pos==i.head&&o.pos==i.anchor&&this.storeDOMState(i),!this.view.state.selection.eq(i)){var p=this.view.state.tr.setSelection(i);"pointer"==t&&p.setMeta("pointer",!0),this.view.dispatch(p)}}else this.storeDOMState()}},e.SelectionReader=a;var p=function(t){var e=this;this.listening=!1,this.curOrigin=null,this.originTime=0,this.reader=t,this.readFunc=function(){return t.readFromDOM(e.originTime>Date.now()-50?e.curOrigin:null)}};p.prototype.poll=function(t){this.curOrigin=t,this.originTime=Date.now()},p.prototype.start=function(){this.listening||(document.addEventListener("selectionchange",this.readFunc),this.listening=!0,this.reader.view.hasFocus()&&this.readFunc())},p.prototype.stop=function(){this.listening&&(document.removeEventListener("selectionchange",this.readFunc),this.listening=!1)};var d=function(t){this.polling=null,this.reader=t,this.pollFunc=this.doPoll.bind(this,null)};return d.prototype.doPoll=function(t){var e=this.reader.view;e.focused||!e.editable?(this.reader.readFromDOM(t),this.polling=setTimeout(this.pollFunc,100)):this.polling=null},d.prototype.poll=function(t){clearTimeout(this.polling),this.polling=setTimeout(t?this.doPoll.bind(this,t):this.pollFunc,0)},d.prototype.start=function(){null==this.polling&&this.poll()},d.prototype.stop=function(){clearTimeout(this.polling),this.polling=null},e.selectionToDOM=o,n.exports}),t.registerDynamic("1c",[],!0,function(t,e,n){function r(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}function l(t,e,n,r,o,a,i){for(var c=t.slice(),s=function(t,e,n,r){for(var o=0;o<c.length;o+=3){var i=c[o+1],s=void 0;-1==i||i+a<t||(e>=c[o]+a?c[o+1]=-1:(s=r-n-(e-t))&&(c[o]+=s,c[o+1]+=s))}},l=0;l<n.maps.length;l++)n.maps[l].forEach(s);for(var p=!1,u=0;u<c.length;u+=3)if(-1==c[u+1]){var f=n.map(c[u]+a),h=f-o;if(h<0||h>=r.content.size){p=!0;continue}var d=n.map(t[u+1]+a,-1)-o,m=r.content.findIndex(h),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==h&&g+y.nodeSize==d){var w=c[u+2].mapInner(n,y,f+1,c[u]+a+1,i);w!=N?(c[u]=h,c[u+1]=d,c[u+2]=w):(c.splice(u,3),u-=3)}else p=!0}if(p){var x=O(D(c,e?C(e,o):[],n,a,i),r,0,i);e=x.local;for(var b=0;b<c.length;b+=3)-1==c[b+1]&&(c.splice(b,3),b-=3);for(var k=0,S=0;k<x.children.length;k+=3){for(var M=x.children[k];S<c.length&&c[S]<M;)S+=3;c.splice(S,0,x.children[k],x.children[k+1],x.children[k+2])}}return new R(e&&e.sort(T),c)}function C(t,e){if(!e||!t.length)return t;for(var n=[],r=0;r<t.length;r++){var o=t[r];n.push(new f(o.from+e,o.to+e,o.type))}return n}function D(t,i,s,e,a){function c(t,e){for(
4
- var n=0;n<t.local.length;n++){var r=t.local[n].map(s,0,e);r?i.push(r):a.onRemove&&a.onRemove(t.local[n].options)}for(var o=0;o<t.children.length;o+=3)c(t.children[o+2],t.children[o]+e+1)}for(var n=0;n<t.length;n+=3)-1==t[n+1]&&c(t[n+2],t[n]+e+1);return i}function p(t,e,n){if(e.isLeaf)return null;for(var r=n+e.nodeSize,o=null,i=0,s=void 0;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function u(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function O(o,t,i,s){var a=[],c=!1;t.forEach(function(t,e){var n=p(o,t,e+i);if(n){c=!0;var r=O(n,t,i+e+1,s);r!=N&&a.push(e,e+t.nodeSize,r)}});for(var e=C(c?u(o):o,-i).sort(T),n=0;n<e.length;n++)e[n].type.valid(t,e[n])||(s.onRemove&&s.onRemove(e[n].options),e.splice(n--,1));return e.length||a.length?new R(e,a):N}function T(t,e){return t.from-e.from||t.to-e.to}function a(t){for(var e=t,n=0;n<e.length-1;n++){var r=e[n];if(r.from!=r.to)for(var o=n+1;o<e.length;o++){var i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),s(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),s(e,o+1,i.copy(r.to,i.to)))}}return e}function s(t,e,n){for(;e<t.length&&0<T(n,t[e]);)e++;t.splice(e,0,n)}function o(n){var r=[];return n.someProp("decorations",function(t){var e=t(n.state);e&&e!=N&&r.push(e)}),g.from(r)}var i=function(t,e){if(1!=t.nodeType){var n=document.createElement("span");n.appendChild(t),t=n}t.contentEditable=!1,t.classList.add("ProseMirror-widget"),this.widget=t,this.options=e||v};i.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,"left"==this.options.associative?-1:1),i=o.pos;return o.deleted?null:new f(i-n,i-n,this)},i.prototype.valid=function(){return!0},i.prototype.eq=function(t){return this==t||t instanceof i&&(this.widget==t.widget||this.options.key)&&r(this.options,t.options)};var h=function(t,e){this.options=e||v,this.attrs=t};h.prototype.map=function(t,e,n,r){var o=t.map(e.from+r,this.options.inclusiveLeft?-1:1)-n,i=t.map(e.to+r,this.options.inclusiveRight?1:-1)-n;return i<=o?null:new f(o,i,this)},h.prototype.valid=function(t,e){return e.from<e.to},h.prototype.eq=function(t){return this==t||t instanceof h&&r(this.attrs,t.attrs)&&r(this.options,t.options)},h.is=function(t){return t.type instanceof h};var c=function(t,e){this.attrs=t,this.options=e||v};c.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,1);if(o.deleted)return null;var i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new f(o.pos-n,i.pos-n,this)},c.prototype.valid=function(t,e){var n=t.content.findIndex(e.from),r=n.index,o=n.offset;return o==e.from&&o+t.child(r).nodeSize==e.to},c.prototype.eq=function(t){return this==t||t instanceof c&&r(this.attrs,t.attrs)&&r(this.options,t.options)};var f=function(t,e,n){this.from=t,this.to=e,this.type=n},d={options:{}};f.prototype.copy=function(t,e){return new f(t,e,this.type)},f.prototype.eq=function(t){return this.type.eq(t.type)&&this.from==t.from&&this.to==t.to},f.prototype.map=function(t,e,n){return this.type.map(t,this,e,n)},f.widget=function(t,e,n){return new f(t,t,new i(e,n))},f.inline=function(t,e,n,r){return new f(t,e,new h(n,r))},f.node=function(t,e,n,r){return new f(t,e,new c(n,r))},d.options.get=function(){return this.type.options},Object.defineProperties(f.prototype,d),e.Decoration=f;var m=[],v={},R=function(t,e){this.local=t&&t.length?t:m,this.children=e&&e.length?e:m};R.create=function(t,e){return e.length?O(e,t,0,v):N},R.prototype.find=function(t,e){var n=[];return this.findInner(null==t?0:t,null==e?1e9:e,n,0),n},R.prototype.findInner=function(t,e,n,r){for(var o=this,i=0;i<this.local.length;i++){var s=o.local[i];s.from<=e&&s.to>=t&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;a<this.children.length;a+=3)if(o.children[a]<e&&o.children[a+1]>t){var c=o.children[a]+1;o.children[a+2].findInner(t-c,e-c,n,r+c)}},R.prototype.map=function(t,e,n){return this==N||0==t.maps.length?this:this.mapInner(t,e,0,0,n||v)},R.prototype.mapInner=function(t,e,n,r,o){for(var i,s=this,a=0;a<this.local.length;a++){var c=s.local[a].map(t,n,r);c&&c.type.valid(e,c)?(i||(i=[])).push(c):o.onRemove&&o.onRemove(s.local[a].options)}return this.children.length?l(this.children,i,t,e,n,r,o):i?new R(i.sort(T)):N},R.prototype.add=function(t,e){return e.length?this==N?R.create(t,e):this.addInner(t,e,0):this},R.prototype.addInner=function(t,o,i){var s,a=this,c=0;t.forEach(function(t,e){var n,r=e+i;if(n=p(o,t,r)){for(s||(s=a.children.slice());c<s.length&&s[c]<e;)c+=3;s[c]==e?s[c+2]=s[c+2].addInner(t,n,r+1):s.splice(c,0,e,e+t.nodeSize,O(n,t,r+1,v)),c+=3}});var e=C(c?u(o):o,-i);return new R(e.length?this.local.concat(e).sort(T):this.local,s||this.children)},R.prototype.remove=function(t){return 0==t.length||this==N?this:this.removeInner(t,0)},R.prototype.removeInner=function(t,e){for(var n=this,r=this.children,o=this.local,i=0;i<r.length;i+=3){for(var s=void 0,a=r[i]+e,c=r[i+1]+e,l=0,p=void 0;l<t.length;l++)(p=t[l])&&p.from>a&&p.to<c&&(t[l]=null,(s||(s=[])).push(p));if(s){r==n.children&&(r=n.children.slice());var u=r[i+2].removeInner(s,a+1);u!=N?r[i+2]=u:(r.splice(i,3),i-=3)}}if(o.length)for(var f=0,h=void 0;f<t.length;f++)if(h=t[f])for(var d=0;d<o.length;d++)o[d].type==h.type&&(o==n.local&&(o=n.local.slice()),o.splice(d--,1));return r==this.children&&o==this.local?this:o.length||r.length?new R(o,r):N},R.prototype.forChild=function(t,e){var n,r,o=this;if(this==N)return this;if(e.isLeaf)return R.empty;for(var i=0;i<this.children.length;i+=3)if(o.children[i]>=t){o.children[i]==t&&(n=o.children[i+2]);break}for(var s=t+1,a=s+e.content.size,c=0;c<this.local.length;c++){var l=o.local[c];if(l.from<a&&l.to>s&&l.type instanceof h){var p=Math.max(s,l.from)-s,u=Math.min(a,l.to)-s;p<u&&(r||(r=[])).push(l.copy(p,u))}}if(r){var f=new R(r);return n?new g([f,n]):f}return n||N},R.prototype.eq=function(t){var e=this;if(this==t)return!0;if(!(t instanceof R)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!e.local[n].eq(t.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(e.children[r]!=t.children[r]||e.children[r+1]!=t.children[r+1]||!e.children[r+2].eq(t.children[r+2]))return!1;return!1},R.prototype.locals=function(t){return a(this.localsInner(t))},R.prototype.localsInner=function(t){var e=this;if(this==N)return m;if(t.isTextblock||!this.local.some(h.is))return this.local;for(var n=[],r=0;r<this.local.length;r++)e.local[r].type instanceof h||n.push(e.local[r]);return n};var N=new(e.DecorationSet=R);R.empty=N;var g=function(t){this.members=t};return g.prototype.forChild=function(t,e){var n=this;if(e.isLeaf)return R.empty;for(var r=[],o=0;o<this.members.length;o++){var i=n.members[o].forChild(t,e);i!=N&&(i instanceof g?r=r.concat(i.members):r.push(i))}return g.from(r)},g.prototype.eq=function(t){var e=this;if(!(t instanceof g)||t.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!e.members[n].eq(t.members[n]))return!1;return!0},g.prototype.locals=function(t){for(var e,n=this,r=!0,o=0;o<this.members.length;o++){var i=n.members[o].localsInner(t);if(i.length)if(e){r&&(e=e.slice(),r=!1);for(var s=0;s<i.length;s++)e.push(i[s])}else e=i}return e?a(r?e:e.sort(T)):m},g.from=function(t){switch(t.length){case 0:return N;case 1:return t[0];default:return new g(t)}},e.removeOverlap=a,e.viewDecorations=o,n.exports}),t.registerDynamic("1d",["13","14","1a","1b","1c"],!0,function(t,e,n){function l(n){var r=Object.create(null);return r["class"]="ProseMirror"+(n.focused?" ProseMirror-focused":"")+(n.state.selection.node?" ProseMirror-nodeselection":""),r.contenteditable=String(n.editable),n.someProp("attributes",function(t){if("function"==typeof t&&(t=t(n.state)),t)for(var e in t)"class"==e?r["class"]+=" "+t[e]:r[e]||"contenteditable"==e||"nodeName"==e||(r[e]=String(t[e]))}),[D.node(0,n.state.doc.content.size,r)]}function p(e){return!e.someProp("editable",function(t){return!1===t(e.state)})}var r,o=t("13"),u=o.scrollRectIntoView,i=o.posAtCoords,s=o.coordsAtPos,a=o.endOfTextblock,f=o.storeScrollPos,h=o.resetScrollPos,c=t("14").docViewDesc,d=t("1a"),m=d.initInput,v=d.destroyInput,g=d.dispatchEvent,y=d.startObserving,w=d.stopObserving,x=d.ensureListeners,b=t("1b"),k=b.SelectionReader,S=b.selectionToDOM,M=t("1c"),C=M.viewDecorations,D=M.Decoration;r=t("1c"),e.Decoration=r.Decoration,e.DecorationSet=r.DecorationSet;var O=function(t,e){this.props=e,this.state=e.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.content=document.createElement("div"),t&&t.appendChild?t.appendChild(this.content):t&&t(this.content),this.editable=p(this),this.docView=c(this.state.doc,l(this),C(this),this.content,this),this.lastSelectedViewDesc=null,this.selectionReader=new k(this),m(this),this.pluginViews=[],this.updatePluginViews()},T={root:{}};return O.prototype.update=function(t){t.handleDOMEvents!=this.props.handleDOMEvents&&x(this),this.props=t,this.updateState(t.state)},O.prototype.updateState=function(t){var e=this.state;if(this.state=t,e.plugins!=t.plugins&&x(this),!this.inDOMChange){var n=this.editable;this.editable=p(this);var r=C(this),o=l(this),i=t.scrollToSelection>e.scrollToSelection||e.config!=t.config,s=!this.docView.matchesNode(t.doc,o,r),a=s||!t.selection.eq(e.selection)||this.selectionReader.domChanged(),c=!i&&a&&f(this);a&&(w(this),s&&this.docView.update(t.doc,o,r,this),S(this,t.selection),y(this)),n!=this.editable&&this.selectionReader.editableChanged(),this.updatePluginViews(e),i?t.selection.node?u(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect()):u(this,this.coordsAtPos(t.selection.head)):c&&h(c)}},O.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},O.prototype.updatePluginViews=function(t){var e=this,n=this.state.plugins;if(t&&t.plugins==n)for(var r=0;r<this.pluginViews.length;r++){var o=e.pluginViews[r];o.update&&o.update(e)}else{this.destroyPluginViews();for(var i=0;i<n.length;i++){var s=n[i];s.options.view&&e.pluginViews.push(s.options.view(e))}}},O.prototype.hasFocus=function(){if(this.editable&&this.content.ownerDocument.activeElement!=this.content)return!1;var t=this.root.getSelection();return t.rangeCount&&this.content.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)},O.prototype.someProp=function(t,e){var n,r=this.props&&this.props[t];if(null!=r&&(n=e?e(r):r))return n;var o=this.state.plugins;if(o)for(var i=0;i<o.length;i++){var s=o[i].props[t];if(null!=s&&(n=e?e(s):s))return n}},O.prototype.focus=function(){w(this),S(this,this.state.selection,!0),y(this),this.editable&&this.content.focus()},T.root.get=function(){var t=this,e=this._root;if(null==e)for(var n=this.content.parentNode;n;n=n.parentNode)if(9==n.nodeType||11==n.nodeType&&n.host)return t._root=n;return e||document},O.prototype.posAtCoords=function(t){return i(this,t)},O.prototype.coordsAtPos=function(t){return s(this,t)},O.prototype.endOfTextblock=function(t,e){return a(this,e||this.state,t)},O.prototype.destroy=function(){v(this),this.destroyPluginViews(),this.docView.destroy(),this.selectionReader.destroy(),this.content.parentNode&&this.content.parentNode.removeChild(this.content)},O.prototype.dispatchEvent=function(t){return g(this,t)},O.prototype.dispatch=function(t){var e=this.props.dispatchTransaction;e?e(t):this.updateState(this.state.apply(t))},Object.defineProperties(O.prototype,T),e.EditorView=O,n.exports}),t.registerDynamic("11",["1d"],!0,function(t,e,n){return n.exports=t("1d"),n.exports}),t.registerDynamic("1e",[],!0,function(t,e,n){var r,o,i;return o=this,i=function(){function p(){var t,e=arguments,n=e[0],r=e[1],o=2,i=e.length,s=p[m];if(n=p[g](n)?n:y.createElement(n),1===i)return n;if((!w(r,f)||p[v](r)||x(r))&&(--o,r=null),i-o==1&&w(e[o],"string")&&n[h]!==undefined)n[h]=e[o];else for(;o<i;++o)if(null!=(t=e[o]))if(x(t))for(var a=0;a<t.length;++a)b(n,t[a]);else b(n,t);for(var c in r)if(s[c]){var l=s[c];typeof l===u?l(n,r[c]):n[d](l,r[c])}else w(r[c],u)?n[c]=r[c]:n[d](c,r[c]);return n}var u="function",f="object",e="nodeType",h="textContent",d="setAttribute",m="attrMap",v="isNode",g="isElement",y=typeof document===f?document:{},w=function(t,e){return typeof t===e},t=typeof Node===u?function(t){return t instanceof Node}:function(t){return t&&w(t,f)&&e in t&&w(t.ownerDocument,f)},n=function(t){return p[v](t)&&1===t[e]},x=function(t){return t instanceof Array},b=function(t,e){p[v](e)||(e=y.createTextNode(e)),t.appendChild(e)};return p[m]={},p[g]=n,p[v]=t,"undefined"!=typeof Proxy&&(p.proxy=new Proxy(p,{get:function(t,e){return!(e in p)&&(p[e]=p.bind(null,e)),p[e]}})),p},"object"==typeof e?n.exports=i():"function"==typeof r&&r.amd?r(i):o.crel=i(),n.exports}),t.registerDynamic("1f",["1e"],!0,function(t,e,n){return n.exports=t("1e"),n.exports}),t.registerDynamic("20",[],!0,function(t,e,n){function o(t){for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return e}function r(t){var e=document.createElement("div");if(e.className=c,t.path){var n="pm-icon-"+o(t.path).toString(16);document.getElementById(n)||i(n,t);var r=e.appendChild(document.createElementNS(s,"svg"));r.style.width=t.width/t.height+"em",r.appendChild(document.createElementNS(s,"use")).setAttributeNS(a,"href",/([^#]*)/.exec(document.location)[1]+"#"+n)}else t.dom?e.appendChild(t.dom.cloneNode(!0)):(e.appendChild(document.createElement("span")).textContent=t.text||"",t.css&&(e.firstChild.style.cssText=t.css));return e}function i(t,e){var n=document.getElementById(c+"-collection");n||((n=document.createElementNS(s,"svg")).id=c+"-collection",n.style.display="none",document.body.insertBefore(n,document.body.firstChild));var r=document.createElementNS(s,"symbol");r.id=t,r.setAttribute("viewBox","0 0 "+e.width+" "+e.height),r.appendChild(document.createElementNS(s,"path")).setAttribute("d",e.path),n.appendChild(r)}var s="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xlink",c="ProseMirror-icon";return e.getIcon=r,n.exports}),t.registerDynamic("21",["1f","22","23","20"],!0,function(t,e,n){function c(t,e){return t.props.translate?t.props.translate(e):e}function l(t){M.time=Date.now(),M.node=t.target}function p(t){return Date.now()-100<M.time&&M.node&&t.contains(M.node)}function u(t,e){for(var n=[],r=0;r<t.length;r++){var o=t[r].render(e);o&&n.push(h("div",{"class":k+"-dropdown-item"},o))}return n}function r(t,e){for(var n=document.createDocumentFragment(),r=!1,o=0;o<e.length;o++){for(var i=e[o],s=!1,a=0;a<i.length;a++){var c=i[a].render(t);c&&(!s&&r&&n.appendChild(f()),n.appendChild(h("span",{"class":k+"item"},c)),s=!0)}s&&(r=!0)}return n}function f(){return h("span",{"class":k+"separator"})}function o(n,r){var t={run:function o(t,e){return v(n,r.attrs)(t,e)},select:function i(t){return v(n,r.attrs instanceof Function?null:r.attrs)(t)}};for(var e in r)t[e]=r[e];return new S(t)}function i(i,s){var e=g(i,s.attrs),t={run:e,select:function r(t){return e(t)},active:function a(t){var e=t.selection,n=e.$from,r=e.to,o=e.node;return o?o.hasMarkup(i,s.attrs):r<=n.end()&&n.parent.hasMarkup(i,s.attrs)}};for(var n in s)t[n]=s[n];return new S(t)}var h=t("1f"),s=t("22"),a=s.lift,d=s.joinUp,m=s.selectParentNode,v=s.wrapIn,g=s.setBlockType,y=t("23"),w=y.undo,x=y.redo,b=t("20").getIcon,k="ProseMirror-menu",S=function S(t){this.spec=t};S.prototype.render=function I(e){var t=!1,n=this.spec;if(n.select&&!n.select(e.state)){if("disable"!=n.onDeselected)return null;t=!0}var r,o=n.active&&!t&&n.active(e.state);if(n.render)r=n.render(e);else if(n.icon)r=b(n.icon),o&&r.classList.add(k+"-active");else{if(!n.label)throw new RangeError("MenuItem without render, icon, or label property");r=h("div",null,c(e,n.label))}return n.title&&r.setAttribute("title",c(e,n.title)),n["class"]&&r.classList.add(n["class"]),t&&r.classList.add(k+"-disabled"),n.css&&(r.style.cssText+=n.css),t||r.addEventListener(n.execEvent||"mousedown",function(t){t.preventDefault(),n.run(e.state,e.dispatch,e)}),r},e.MenuItem=S;var M={time:0,node:null},C=function C(t,e){this.options=e||{},this.content=Array.isArray(t)?t:[t]};C.prototype.render=function I(t){var e=this,n=u(this.content,t);if(!n.length)return null;var r=h("div",{"class":k+"-dropdown "+(this.options["class"]||""),style:this.options.css,title:this.options.title&&c(t,this.options.title)},c(t,this.options.label)),o=h("div",{"class":k+"-dropdown-wrap"},r),i=null,s=null,a=function(){i&&i.close()&&(i=null,window.removeEventListener("mousedown",s))};return r.addEventListener("mousedown",function(t){t.preventDefault(),l(t),i?a():(i=e.expand(o,n),window.addEventListener("mousedown",s=function(){p(o)||a()}))}),o},C.prototype.expand=function z(t,e){function n(){if(!o)return o=!0,t.removeChild(r),!0}var r=h("div",{"class":k+"-dropdown-menu "+(this.options["class"]||"")},e),o=!1;return t.appendChild(r),{close:n,node:r}},e.Dropdown=C;var D=function D(t,e){this.options=e||{},this.content=Array.isArray(t)?t:[t]};D.prototype.render=function I(t){var e=u(this.content,t);if(!e.length)return null;var n=h("div",{"class":k+"-submenu-label"},c(t,this.options.label)),r=h("div",{"class":k+"-submenu-wrap"},n,h("div",{"class":k+"-submenu"},e)),o=null;return n.addEventListener("mousedown",function(t){t.preventDefault(),l(t),r.classList.toggle(k+"-submenu-wrap-active"),o||window.addEventListener("mousedown",o=function(){p(r)||(r.classList.remove(k+"-submenu-wrap-active"),window.removeEventListener("mousedown",o),o=null)})}),r},e.DropdownSubmenu=D,e.renderGrouped=r;var O={join:{width:800,height:900,path:"M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z"},lift:{width:1024,height:1024,path:"M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z"},selectParentNode:{text:"\u2b1a",css:"font-weight: bold"},undo:{width:1024,height:1024,path:"M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z"},redo:{width:1024,height:1024,path:"M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z"},strong:{width:805,height:1024,path:"M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z"},em:{width:585,height:1024,path:"M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z"},code:{width:896,height:1024,path:"M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z"},link:{width:951,height:1024,path:"M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z"},bulletList:{width:768,height:896,path:"M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z"},orderedList:{width:768,height:896,path:"M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z"},blockquote:{width:640,height:896,path:"M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z"}};e.icons=O;var T=new S({title:"Join with above block",run:d,select:function(t){return d(t)},icon:O.join});e.joinUpItem=T;var R=new S({title:"Lift out of enclosing block",run:a,select:function(t){return a(t)},icon:O.lift});e.liftItem=R;var N=new S({title:"Select parent node",run:m,select:function(t){return m(t)},icon:O.selectParentNode});e.selectParentNodeItem=N;var E=new S({title:"Undo last change",run:w,select:function(t){return w(t)},icon:O.undo});e.undoItem=E;var A=new S({title:"Redo last undone change",run:x,select:function(t){return x(t)},icon:O.redo});return e.redoItem=A,e.wrapItem=o,e.blockTypeItem=i,n.exports}),t.registerDynamic("24",["1f","11","21"],!0,function(t,e,n){function i(t){return t.anchorNode==t.focusNode?t.anchorOffset>t.focusOffset:t.anchorNode.compareDocumentPosition(t.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}function s(t){for(var e=t.parentNode;e;e=e.parentNode)if(e.scrollHeight>e.clientHeight)return e}var o=t("1f"),r=t("11").EditorView,a=t("21").renderGrouped,c="ProseMirror-menubar",l=function l(t,e){var n=this;this.wrapper=o("div",{"class":c+"-wrapper"}),t&&t.appendChild?t.appendChild(this.wrapper):t&&t(this.wrapper),e.dispatchTransaction||(e.dispatchTransaction=function(t){return n.updateState(n.editor.state.apply(t))}),this.editor=new r(this.wrapper,e),this.menu=o("div",{"class":c}),this.menu.className=c,this.spacer=null,this.wrapper.insertBefore(this.menu,this.wrapper.firstChild),this.maxHeight=0,this.widthForMaxHeight=0,this.floating=!1,this.props=e,this.updateMenu(),this.editor.someProp("floatingMenu")&&(this.updateFloat(),this.scrollFunc=function(){var t=n.editor.root;(t.body||t).contains(n.wrapper)?n.updateFloat():window.removeEventListener("scroll",n.scrollFunc)},window.addEventListener("scroll",this.scrollFunc))};return l.prototype.update=function p(t){this.props=t,this.editor.update(t),this.updateMenu()},l.prototype.updateState=function u(t){this.editor.updateState(t),this.updateMenu()},l.prototype.updateMenu=function f(){this.menu.textContent="",this.menu.appendChild(a(this.editor,this.editor.someProp("menuContent"))),this.floating?this.updateScrollCursor():(this.menu.offsetWidth!=this.widthForMaxHeight&&(this.widthForMaxHeight=this.menu.offsetWidth,this.maxHeight=0),this.menu.offsetHeight>this.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+"px"))},l.prototype.updateScrollCursor=function h(){var t=this.editor.root.getSelection();if(t.focusNode){var e=t.getRangeAt(0).getClientRects(),n=e[i(t)?0:e.length-1];if(n){var r=this.menu.getBoundingClientRect();if(n.top<r.bottom&&n.bottom>r.top){var o=s(this.wrapper);o&&(o.scrollTop-=r.bottom-n.top)}}}},l.prototype.updateFloat=function d(){var t=this.wrapper,e=t.getBoundingClientRect();if(this.floating)if(0<=e.top||e.bottom<this.menu.offsetHeight+10)this.floating=!1,this.menu.style.position=this.menu.style.left=this.menu.style.width="",this.menu.style.display="",this.spacer.parentNode.removeChild(this.spacer),this.spacer=null;else{var n=(t.offsetWidth-t.clientWidth)/2;this.menu.style.left=e.left+n+"px",this.menu.style.display=e.top>window.innerHeight?"none":""}else if(e.top<0&&e.bottom>=this.menu.offsetHeight+10){this.floating=!0;var r=this.menu.getBoundingClientRect();this.menu.style.left=r.left+"px",this.menu.style.width=r.width+"px",this.menu.style.position="fixed",this.spacer=o("div",{"class":c+"-spacer",style:"height: "+r.height+"px"}),t.insertBefore(this.spacer,this.menu)}},l.prototype.destroy=function m(){this.editor.destroy()},e.MenuBarEditorView=l,n.exports}),t.registerDynamic("25",["21","24"],!0,function(t,e,n){var r;return r=t("21"),e.MenuItem=r.MenuItem,e.Dropdown=r.Dropdown,e.DropdownSubmenu=r.DropdownSubmenu,e.renderGrouped=r.renderGrouped,e.icons=r.icons,e.joinUpItem=r.joinUpItem,e.liftItem=r.liftItem,e.selectParentNodeItem=r.selectParentNodeItem,e.undoItem=r.undoItem,e.redoItem=r.redoItem,e.wrapItem=r.wrapItem,e.blockTypeItem=r.blockTypeItem,e.MenuBarEditorView=t("24").MenuBarEditorView,n.exports}),t.registerDynamic("26",["25"],!0,function(t,e,n){return n.exports=t("25"),n.exports}),t.registerDynamic("27",[],!0,function(t,e,n){function r(e){var n=document.body.appendChild(document.createElement("div"));n.className=d;var t=function(t){n.contains(t.target)||r()};setTimeout(function(){return window.addEventListener("mousedown",t)},50);var r=function(){window.removeEventListener("mousedown",t),n.parentNode&&n.parentNode.removeChild(n)},o=[];for(var i in e.fields)o.push(e.fields[i].render());var s=document.createElement("button");s.type="submit",s.className=d+"-submit",s.textContent="OK";var a=document.createElement("button");a.type="button",a.className=d+"-cancel",a.textContent="Cancel",a.addEventListener("click",r);var c=n.appendChild(document.createElement("form"));e.title&&(c.appendChild(document.createElement("h5")).textContent=e.title),o.forEach(function(t){c.appendChild(document.createElement("div")).appendChild(t)});var l=c.appendChild(document.createElement("div"));l.className=d+"-buttons",l.appendChild(s),l.appendChild(document.createTextNode(" ")),l.appendChild(a);var p=n.getBoundingClientRect();n.style.top=(window.innerHeight-p.height)/2+"px",n.style.left=(window.innerWidth-p.width)/2+"px";var u=function(){var t=h(e.fields,o);t&&(r(),e.callback(t))};c.addEventListener("submit",function(t){t.preventDefault(),u()}),c.addEventListener("keydown",function(t){27==t.keyCode?(t.preventDefault(),r()):13!=t.keyCode||t.ctrlKey||t.metaKey||t.shiftKey?9==t.keyCode&&window.setTimeout(function(){n.contains(document.activeElement)||r()},500):(t.preventDefault(),u())});var f=c.elements[0];f&&f.focus()}function h(t,e){var n=Object.create(null),r=0;for(var o in t){var i=t[o],s=e[r++],a=i.read(s),c=i.validate(a);if(c)return l(s,c),null;n[o]=i.clean(a)}return n}function l(t,e){var n=t.parentNode,r=n.appendChild(document.createElement("div"));r.style.left=t.offsetLeft+t.offsetWidth+2+"px",r.style.top=t.offsetTop-5+"px",r.className="ProseMirror-invalid",r.textContent=e,setTimeout(function(){return n.removeChild(r)},1500)}var d="ProseMirror-prompt";e.openPrompt=r;var o=function o(t){this.options=t};o.prototype.read=function a(t){return t.value},o.prototype.validateType=function c(){},o.prototype.validate=function p(t){return!t&&this.options.required?"Required field":this.validateType(t)||this.options.validate&&this.options.validate(t)},o.prototype.clean=function u(t){return this.options.clean?this.options.clean(t):t};var i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),(e.prototype.constructor=e).prototype.render=function n(){var t=document.createElement("input");return t.type="text",t.placeholder=this.options.label,t.value=this.options.value||"",t.autocomplete="off",t},e}(e.Field=o);e.TextField=i;var s=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),(e.prototype.constructor=e).prototype.render=function o(){var n=this,r=document.createElement("select");return this.options.options.forEach(function(t){var e=r.appendChild(document.createElement("option"));e.value=t.value,e.selected=t.value==n.options.value,e.label=t.label}),r},e}(o);return e.SelectField=s,n.exports}),t.registerDynamic("28",["26","29","7","22","2a","27"],!0,function(t,e,n){function u(t,e,n){for(var r=t.selection.$from,o=r.depth;0<=o;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,e,n))return!0}return!1}function l(l){return new D({title:"Insert image",label:"Image",select:function e(t){return u(t,l)},run:function p(t,e,n){var r=t.selection,o=r.node,i=r.from,s=r.to,a=l&&o&&o.type==l&&o.attrs;B({title:"Insert image",fields:{src:new F({label:"Location",required:!0,value:a&&a.src}),title:new F({label:"Title",value:a&&a.title}),alt:new F({label:"Description",value:a?a.title:t.doc.textBetween(i,s," ")})},callback:function c(t){n.dispatch(n.state.tr.replaceSelectionWith(l.createAndFill(t))),n.focus()}})}})}function r(t){if(!/^[1-9]\d*$/.test(t))return"Should be a positive integer"}function p(s){return new D({title:"Insert a table",run:function n(t,e,o){B({title:"Insert table",fields:{rows:new F({label:"Rows",validate:r}),cols:new F({label:"Columns",validate:r})},callback:function i(t){var e=t.rows,n=t.cols,r=o.state.tr.replaceSelectionWith(c(s,+e,+n));r.setSelection(I.near(r.doc.resolve(o.state.selection.from))),o.dispatch(r.scrollIntoView()),o.focus()}})},select:function o(t){for(var e=t.selection.$from,n=e.depth;0<=n;n--){var r=e.index(n);if(e.node(n).canReplaceWith(r,r,s))return!0}return!1},label:"Table"})}function f(e,t){var n={label:t.title,run:e,select:function o(t){return e(t)}};for(var r in t)n[r]=t[r];return new D(n)}function s(t,e){var n=t.selection,r=n.from,o=n.$from,i=n.to;return n.empty?e.isInSet(t.storedMarks||o.marks()):t.doc.rangeHasMark(r,i,e)}function h(e,t){var n={active:function o(t){return s(t,e)}};for(var r in t)n[r]=t[r];return f(z(e),n)}function d(o){return h(o,{title:"Add or remove link",icon:C.link,run:function i(t,e,n){if(s(t,o))return z(o)(t,e),!0;B({title:"Create a link",fields:{href:new F({label:"Link target",required:!0,clean:function(t){return/^https?:\/\//i.test(t)||(t="http://"+t),t}}),title:new F({label:"Title"})},callback:function r(t){z(o,t)(n.state,n.dispatch),n.focus()}})}})}function m(t,e){return f(P(t,e.attrs),e)}function o(t){var e,n={};if((e=t.marks.strong)&&(n.toggleStrong=h(e,{title:"Toggle strong style",icon:C.strong})),(e=t.marks.em)&&(n.toggleEm=h(e,{title:"Toggle emphasis",icon:C.em})),(e=t.marks.code)&&(n.toggleCode=h(e,{title:"Toggle code font",icon:C.code})),(e=t.marks.link)&&(n.toggleLink=d(e)),(e=t.nodes.image)&&(n.insertImage=l(e)),(e=t.nodes.bullet_list)&&(n.wrapBulletList=m(e,{title:"Wrap in bullet list",icon:C.bulletList})),(e=t.nodes.ordered_list)&&(n.wrapOrderedList=m(e,{title:"Wrap in ordered list",icon:C.orderedList})),(e=t.nodes.blockquote)&&(n.wrapBlockQuote=v(e,{title:"Wrap in block quote",icon:C.blockquote})),(e=t.nodes.paragraph)&&(n.makeParagraph=g(e,{title:"Change to paragraph",label:"Plain"})),(e=t.nodes.code_block)&&(n.makeCodeBlock=g(e,{title:"Change to code block",label:"Code"})),e=t.nodes.heading)for(var r=1;r<=10;r++)n["makeHead"+r]=g(e,{title:"Change to heading "+r,label:"Level "+r,attrs:{level:r}});if(e=t.nodes.horizontal_rule){var o=e;n.insertHorizontalRule=new D({title:"Insert horizontal rule",label:"Horizontal rule",select:function a(t){return u(t,o)},run:function c(t,e){e(t.tr.replaceSelectionWith(o.create()))}})}(e=t.nodes.table)&&(n.insertTable=p(e)),(e=t.nodes.table_row)&&(n.addRowBefore=f(N,{title:"Add row before"}),n.addRowAfter=f(E,{title:"Add row after"}),n.removeRow=f(A,{title:"Remove row"}),n.addColumnBefore=f(O,{title:"Add column before"}),n.addColumnAfter=f(T,{title:"Add column after"}),n.removeColumn=f(R,{title:"Remove column"}));var i=function(t){return t.filter(function(t){return t})};n.insertMenu=new y(i([n.insertImage,n.insertHorizontalRule,n.insertTable]),{label:"Insert"}),n.typeMenu=new y(i([n.makeParagraph,n.makeCodeBlock,n.makeHead1&&new w(i([n.makeHead1,n.makeHead2,n.makeHead3,n.makeHead4,n.makeHead5,n.makeHead6]),{label:"Heading"})]),{label:"Type..."});var s=i([n.addRowBefore,n.addRowAfter,n.removeRow,n.addColumnBefore,n.addColumnAfter,n.removeColumn]);return s.length&&(n.tableMenu=new y(s,{label:"Table"})),n.inlineMenu=[i([n.toggleStrong,n.toggleEm,n.toggleCode,n.toggleLink]),[n.insertMenu]],n.blockMenu=[i([n.typeMenu,n.tableMenu,n.wrapBulletList,n.wrapOrderedList,n.wrapBlockQuote,x,b,k])],n.fullMenu=n.inlineMenu.concat(n.blockMenu).concat([[S,M]]),n}var i=t("26"),v=i.wrapItem,g=i.blockTypeItem,y=i.Dropdown,w=i.DropdownSubmenu,x=i.joinUpItem,b=i.liftItem,k=i.selectParentNodeItem,S=i.undoItem,M=i.redoItem,C=i.icons,D=i.MenuItem,a=t("29"),c=a.createTable,O=a.addColumnBefore,T=a.addColumnAfter,R=a.removeColumn,
5
- N=a.addRowBefore,E=a.addRowAfter,A=a.removeRow,I=t("7").Selection,z=t("22").toggleMark,P=t("2a").wrapInList,L=t("27"),F=L.TextField,B=L.openPrompt;return e.buildMenuItems=o,n.exports}),t.registerDynamic("2b",["9","3","7"],!0,function(t,e,n){function r(t,e){if(t.selection.empty)return!1;if(e){var n=t.selection,r=n.$from,o=n.$to,i=t.tr.deleteSelection().scrollIntoView();r.sameParent(o)&&r.parent.isTextblock&&i.setStoredMarks(r.marks(!0)),e(i)}return!0}function o(t,e,n){var r,o,i=t.selection,s=i.$head;if(!i.empty||(n?!n.endOfTextblock("backward",t):0<s.parentOffset))return!1;for(var a=s.depth-1;!r&&0<=a;a--)0<s.index(a)&&(o=s.before(a+1),r=s.node(a).child(s.index(a)-1));if(!r){var c=s.blockRange(),l=c&&N(c);return null!=l&&(e&&e(t.tr.lift(c,l).scrollIntoView()),!0)}if(r.isLeaf&&q.isSelectable(r)&&0==s.parent.content.size){if(e){var p=t.tr["delete"](o,o+s.parent.nodeSize);p.setSelection(q.create(p.doc,o-r.nodeSize)),e(p.scrollIntoView())}return!0}return r.isLeaf?(e&&e(t.tr["delete"](o-r.nodeSize,o).scrollIntoView()),!0):m(t,o,e)||g(t,o,-1,e)}function i(t,e,n){var r,o,i=t.selection,s=i.$head;if(!i.empty||(n?!n.endOfTextblock("forward",t):s.parentOffset<s.parent.content.size))return!1;for(var a=s.depth-1;!r&&0<=a;a--){var c=s.node(a);s.index(a)+1<c.childCount&&(r=c.child(s.index(a)+1),o=s.after(a+1))}return!!r&&(r.isLeaf?(e&&e(t.tr["delete"](o,o+r.nodeSize).scrollIntoView()),!0):m(t,o,e)||g(t,o,1,e))}function s(t,e){var n,r=t.selection,o=r.node,i=r.from;if(o){if(o.isTextblock||!T(t.doc,i))return!1;n=i}else if(null==(n=O(t.doc,i,-1)))return!1;if(e){var s=t.tr.join(n);t.selection.node&&s.setSelection(q.create(s.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0}function a(t,e){var n=t.selection.node,r=t.selection.from,o=y(t);if(!o)return!1;if(e){var i=t.tr.join(o);n&&i.setSelection(q.create(i.doc,r)),e(i.scrollIntoView())}return!0}function c(t,e){var n=t.selection,r=n.$from,o=n.$to,i=r.blockRange(o),s=i&&N(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}function l(t,e){var n=t.selection,r=n.$head,o=n.anchor;return!(!r||!r.parent.type.spec.code||r.sharedDepth(o)!=r.depth)&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}function p(t,e){var n=t.selection,r=n.$head,o=n.anchor;if(!r||!r.parent.type.spec.code||r.sharedDepth(o)!=r.depth)return!1;var i=r.node(-1),s=r.indexAfter(-1),a=i.defaultContentType(s);if(!i.canReplaceWith(s,s,a))return!1;if(e){var c=r.after(),l=t.tr.replaceWith(c,c,a.createAndFill());l.setSelection(F.near(l.doc.resolve(c),1)),e(l.scrollIntoView())}return!0}function u(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.node;if(!i||!i.isBlock)return!1;var s=r.parent.defaultContentType(o.indexAfter());if(!s||!s.isTextblock)return!1;if(e){var a=(r.parentOffset?o:r).pos,c=t.tr.insert(a,s.createAndFill());c.setSelection(B.create(c.doc,a+1)),e(c.scrollIntoView())}return!0}function f(t,e){var n=t.selection,r=n.$head;if(!n.empty||r.parent.content.size)return!1;if(1<r.depth&&r.after()!=r.end(-1)){var o=r.before();if(E(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}var i=r.blockRange(),s=i&&N(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}function h(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.node;if(i&&i.isBlock)return!(!r.parentOffset||!E(t.doc,r.pos))&&(e&&e(t.tr.split(r.pos).scrollIntoView()),!0);if(e){var s=o.parentOffset==o.parent.content.size,a=t.tr["delete"](r.pos,o.pos),c=0==r.depth?null:r.node(-1).defaultContentType(r.indexAfter(-1)),l=s?[{type:c}]:null,p=E(a.doc,r.pos,1,l);l||p||!E(a.doc,r.pos,1,[{type:c}])||(l=[{type:c}],p=!0),p&&(a.split(r.pos,1,l),s||r.parentOffset||r.parent.type==c||!r.node(-1).canReplace(r.index(-1),r.indexAfter(-1),P.from(c.create(),r.parent))||a.setNodeType(r.before(),c)),e(a.scrollIntoView())}return!0}function d(t,e){var n,r=t.selection;if(r.node){if(!r.$from.depth)return!1;n=r.$from.before()}else{var o=r.$head.sharedDepth(r.anchor);if(0==o)return!1;n=r.$head.before(o)}return e&&e(t.tr.setSelection(q.create(t.doc,n))),!0}function v(t,e,n){var r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr["delete"](e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!!e.parent.canReplace(i,i+1)&&(n&&n(t.tr.clearNonMatching(e.pos,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0))}function m(t,e,n){var r,o,i=t.doc.resolve(e),s=i.nodeBefore,a=i.nodeAfter;if(v(t,i,n))return!0;if(a.isTextblock&&i.parent.canReplace(i.index(),i.index()+1)&&(r=(o=s.contentMatchAt(s.childCount)).findWrappingFor(a))&&o.matchType((r[0]||a).type,(r[0]||a).attrs).validEnd()){if(n){for(var c=e+a.nodeSize,l=P.empty,p=r.length-1;0<=p;p--)l=P.from(r[p].type.create(r[p].attrs,l));l=P.from(s.copy(l));var u=t.tr.step(new A(e-1,c,e,c,new z(l,1,0),r.length,!0)),f=c+2*r.length;T(u.doc,f)&&u.join(f),n(u.scrollIntoView())}return!0}var h=F.findFrom(i,1),d=h.$from.blockRange(h.$to),m=d&&N(d);return null!=m&&(n&&n(t.tr.lift(d,m).scrollIntoView()),!0)}function g(t,e,n,r){var o=t.doc.resolve(e),i=0<n?o.nodeAfter:o.nodeBefore;return!(!i||!q.isSelectable(i))&&(r&&r(t.tr.setSelection(q.create(t.doc,e-(0<n?0:i.nodeSize))).scrollIntoView()),!0)}function y(t){var e=t.selection,n=e.node,r=e.to;return n?T(t.doc,r)?r:null:O(t.doc,r,1)}function w(a,c){return function(t,e){var n=t.selection,r=n.$from,o=n.$to,i=r.blockRange(o),s=i&&R(i,a,c);return!!s&&(e&&e(t.tr.wrap(i,s).scrollIntoView()),!0)}}function x(p,u){return function(t,e){var n,r=t.selection,o=r.$from,i=r.$to,s=r.node;if(s)n=o.depth;else{if(!o.depth||i.pos>o.end())return!1;n=o.depth-1}var a=s||o.parent;if(!a.isTextblock||a.hasMarkup(p,u))return!1;var c=o.index(n);if(!o.node(n).canReplaceWith(c,c+1,p))return!1;if(e){var l=o.before(n+1);e(t.tr.clearNonMatching(l,p.contentExpr.start(u)).setNodeType(l,p,u).scrollIntoView())}return!0}}function b(t,e,n,r){var o=t.contentMatchAt(0).allowsMark(r);return t.nodesBetween(e,n,function(t){if(o)return!1;o=t.isTextblock&&t.contentMatchAt(0).allowsMark(r)}),o}function k(a,c){return function(t,e){var n=t.selection,r=n.empty,o=n.from,i=n.to,s=n.$from;return!!b(t.doc,o,i,a)&&(e&&(r?a.isInSet(t.storedMarks||s.marks())?e(t.tr.removeStoredMark(a)):e(t.tr.addStoredMark(a.create(c))):t.doc.rangeHasMark(o,i,a)?e(t.tr.removeMark(o,i,a).scrollIntoView()):e(t.tr.addMark(o,i,a.create(c)).scrollIntoView())),!0)}}function S(g,y){return function(t){if(!t.isGeneric)return g(t);for(var o=[],e=0;e<t.mapping.maps.length;e++){for(var n=t.mapping.maps[e],r=0;r<o.length;r++)o[r]=n.map(o[r]);n.forEach(function(t,e,n,r){return o.push(n,r)})}for(var i=[],s=0;s<o.length;s+=2)for(var a=o[s],c=o[s+1],l=t.doc.resolve(a),p=l.sharedDepth(c),u=l.node(p),f=l.indexAfter(p),h=l.after(p+1);h<=c;++f){var d=u.maybeChild(f);if(!d)break;if(f&&-1==i.indexOf(h)){var m=u.child(f-1);m.type==d.type&&y(m,d)&&i.push(h)}h+=d.nodeSize}i.sort(function(t,e){return t-e});for(var v=i.length-1;0<=v;v--)T(t.doc,i[v])&&t.join(i[v]);g(t)}}function M(n,r){if(Array.isArray(r)){var e=r;r=function(t){return-1<e.indexOf(t.type.name)}}return function(t,e){return n(t,e&&S(e,r))}}function C(){for(var o=[],t=arguments.length;t--;)o[t]=arguments[t];return function(t,e,n){for(var r=0;r<o.length;r++)if(o[r](t,e,n))return!0;return!1}}var D=t("9"),O=D.joinPoint,T=D.canJoin,R=D.findWrapping,N=D.liftTarget,E=D.canSplit,A=D.ReplaceAroundStep,I=t("3"),z=I.Slice,P=I.Fragment,L=t("7"),F=L.Selection,B=L.TextSelection,q=L.NodeSelection;e.deleteSelection=r,e.joinBackward=o,e.joinForward=i,e.joinUp=s,e.joinDown=a,e.lift=c,e.newlineInCode=l,e.exitCode=p,e.createParagraphNear=u,e.liftEmptyBlock=f,e.splitBlock=h,e.selectParentNode=d,e.wrapIn=w,e.setBlockType=x,e.toggleMark=k,e.autoJoin=M;var _={Enter:(e.chainCommands=C)(l,u,f,h),"Mod-Enter":p,Backspace:C(r,o),"Mod-Backspace":C(r,o),Delete:C(r,i),"Mod-Delete":C(r,i),"Alt-ArrowUp":s,"Alt-ArrowDown":a,"Mod-BracketLeft":c,Escape:d};if("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform()){var V={"Ctrl-h":_.Backspace,"Alt-Backspace":_["Mod-Backspace"],"Ctrl-d":_.Delete,"Ctrl-Alt-Backspace":_["Mod-Delete"],"Alt-Delete":_["Mod-Delete"],"Alt-d":_["Mod-Delete"]};for(var $ in V)_[$]=V[$]}return e.baseKeymap=_,n.exports}),t.registerDynamic("22",["2b"],!0,function(t,e,n){return n.exports=t("2b"),n.exports}),t.registerDynamic("2c",["3","9","7"],!0,function(t,e,n){function r(t,e){var n={};for(var r in t)n[r]=t[r];for(var o in e)n[o]=e[o];return n}function o(t,e,n){return t.append({table:r(T,{content:"table_row[columns=.columns]+",group:n}),table_row:r(R,{content:"table_cell{.columns}"}),table_cell:r(N,{content:e})})}function i(t,e,n,r){r=u(r,n);for(var o=t.contentExpr.elements[0].nodeTypes[0],i=o.contentExpr.elements[0].nodeTypes[0].createAndFill(),s=[],a=0;a<n;a++)s.push(i);for(var c=o.create({columns:n},x.from(s)),l=[],p=0;p<e;p++)l.push(c);return t.create(r,x.from(l))}function u(t,e){var n=Object.create(null);if(t)for(var r in t)n[r]=t[r];return n.columns=e,n}function m(t,e){return u(t,t.columns+e)}function d(t,e){for(var n=t.depth;0<n;n--)if(t.node(n).type.spec.tableRow&&(!e||e(n)))return n;return-1}function s(t,e){var n,r=t.selection.$from,o=d(r,function(t){return n=t==r.depth?r.nodeBefore:r.node(t+1)});return-1!=o&&(e&&e(t.tr.step(E.create(t.doc,r.before(o-1),r.index(o),n.type,n.attrs))),!0)}function a(t,e){var n,r=t.selection.$from,o=d(r,function(t){return n=t==r.depth?r.nodeAfter:r.node(t+1)});return-1!=o&&(e&&e(t.tr.step(E.create(t.doc,r.before(o-1),r.indexAfter(o)+(o==r.depth?1:0),n.type,n.attrs))),!0)}function c(t,e){var n=t.selection.$from,r=d(n,function(t){return 1<n.node(t).childCount});return-1!=r&&(e&&e(t.tr.step(A.create(t.doc,n.before(r-1),n.index(r)))),!0)}function l(t,e,n){var r=t.selection.$from,o=d(r);if(-1==o)return!1;if(e){var i=r.node(o),s=[],a=n<0?r.before(o):r.after(o);i.forEach(function(t){return s.push(t.type.createAndFill(t.attrs))});var c=i.copy(x.from(s));e(t.tr.step(new D(a,a,new b(x.from(c),0,0))))}return!0}function p(t,e){return l(t,e,-1)}function f(t,e){return l(t,e,1)}function h(t,e){var n=t.selection.$from,r=d(n,function(t){return 1<n.node(t-1).childCount});return-1!=r&&(e&&e(t.tr.step(new D(n.before(r),n.after(r),b.empty))),!0)}function v(t,e,n){var r=t.selection.$from,o=d(r);if(-1==o)return!1;var i=r.node(o),s=r.index(o)+e;if(0<=s&&s<i.childCount){var a=t.doc.resolve(i.content.offsetAt(s)+r.start(o)),c=O.findFrom(a,1);return!(!c||c.from>=a.end())&&(n&&n(t.tr.setSelection(c).scrollIntoView()),!0)}var l=r.index(o-1)+e,p=r.node(o-1);if(l<0||l>=p.childCount)return!1;var u=0<e?r.after(o)+2:r.before(o)-2-p.child(l).lastChild.content.size,f=t.doc.resolve(u),h=O.findFrom(f,1);return!(!h||h.from>=f.end())&&(n&&n(t.tr.setSelection(h).scrollIntoView()),!0)}function g(t,e){return v(t,1,e)}function y(t,e){return v(t,-1,e)}var w=t("3"),x=w.Fragment,b=w.Slice,k=t("9"),S=k.Step,M=k.StepResult,C=k.StepMap,D=k.ReplaceStep,O=t("7").Selection,T={attrs:{columns:{"default":1}},parseDOM:[{tag:"table",getAttrs:function I(t){var e=t.querySelector("tr");return!(!e||!e.children.length)&&{columns:e.children.length}}}],toDOM:function z(){return["table",["tbody",0]]}};e.table=T;var R={attrs:{columns:{"default":1}},parseDOM:[{tag:"tr",getAttrs:function(t){return!!t.children.length&&{columns:t.children.length}}}],toDOM:function z(){return["tr",0]},tableRow:!0};e.tableRow=R;var N={parseDOM:[{tag:"td"}],toDOM:function z(){return["td",0]}};e.tableCell=N,e.addTableNodes=o,e.createTable=i;var E=function(n){function r(t,e){n.call(this),this.positions=t,this.cells=e}return n&&(r.__proto__=n),r.prototype=Object.create(n&&n.prototype),(r.prototype.constructor=r).create=function l(t,o,i,e,n){var s=e.createAndFill(n),a=[],c=[];return t.nodeAt(o).forEach(function(t,e){for(var n=o+2+e,r=0;r<i;r++)n+=t.child(r).nodeSize;a.push(n),c.push(s)}),new r(a,c)},r.prototype.apply=function h(t){for(var e=this,n=null,r=null,o=null,i=0;i<this.positions.length;i++){var s=t.resolve(e.positions[i]);if(s.depth<2||s.index(-1)!=i)return M.fail("Invalid cell insert position");if(null==r){if((r=s.node(-1)).childCount!=e.positions.length)return M.fail("Mismatch in number of rows");o=s.before(-1),n=s.index()}else if(s.before(-1)!=o||s.index()!=n)return M.fail("Column insert positions not consistent")}for(var a=[],c=0;c<r.childCount;c++){for(var l=r.child(c),p=n?[]:[e.cells[c]],u=0;u<l.childCount;u++)p.push(l.child(u)),u+1==n&&p.push(e.cells[c]);a.push(l.type.create(m(l.attrs,1),x.from(p)))}var f=r.type.create(m(r.attrs,1),x.from(a));return M.fromReplace(t,o,o+r.nodeSize,new b(x.from(f),0,0))},r.prototype.getMap=function o(){for(var t=this,e=[],n=0;n<this.positions.length;n++)e.push(t.positions[n],0,t.cells[n].nodeSize);return new C(e)},r.prototype.invert=function p(t){for(var e=this,n=t.resolve(this.positions[0]).node(-1),r=[],o=[],i=0,s=0;s<n.childCount;s++){var a=e.positions[s]+i,c=e.cells[s].nodeSize;r.push(a),o.push(a+c),i+=c}return new A(r,o)},r.prototype.map=function t(e){return new r(this.positions.map(function(t){return e.map(t)}),this.cells)},r.prototype.toJSON=function e(){return{stepType:this.jsonID,positions:this.positions,cells:this.cells.map(function(t){return t.toJSON()})}},r.fromJSON=function i(t,e){return new r(e.positions,e.cells.map(t.nodeFromJSON))},r}(S);e.AddColumnStep=E,S.jsonID("addTableColumn",E);var A=function(n){function c(t,e){n.call(this),this.from=t,this.to=e}return n&&(c.__proto__=n),c.prototype=Object.create(n&&n.prototype),(c.prototype.constructor=c).create=function e(t,o,i){var s=[],a=[];return t.nodeAt(o).forEach(function(t,e){for(var n=o+2+e,r=0;r<i;r++)n+=t.child(r).nodeSize;s.push(n),a.push(n+t.child(i).nodeSize)}),new c(s,a)},c.prototype.apply=function d(t){for(var e=this,n=null,r=null,o=null,i=0;i<this.from.length;i++){var s=t.resolve(e.from[i]),a=s.nodeAfter;if(s.depth<2||s.index(-1)!=i||!a||e.from[i]+a.nodeSize!=e.to[i])return M.fail("Invalid cell delete positions");if(null==r){if((r=s.node(-1)).childCount!=e.from.length)return M.fail("Mismatch in number of rows");o=s.before(-1),n=s.index()}else if(s.before(-1)!=o||s.index()!=n)return M.fail("Column delete positions not consistent")}for(var c=[],l=0;l<r.childCount;l++){for(var p=r.child(l),u=[],f=0;f<p.childCount;f++)f!=n&&u.push(p.child(f));c.push(p.type.create(m(p.attrs,-1),x.from(u)))}var h=r.type.create(m(r.attrs,-1),x.from(c));return M.fromReplace(t,o,o+r.nodeSize,new b(x.from(h),0,0))},c.prototype.getMap=function r(){for(var t=this,e=[],n=0;n<this.from.length;n++)e.push(t.from[n],t.to[n]-t.from[n],0);return new C(e)},c.prototype.invert=function p(t){for(var e=this,n=t.resolve(this.from[0]),r=n.node(-1),o=n.index(),i=[],s=[],a=0,c=0;c<r.childCount;c++){i.push(e.from[c]-a);var l=r.child(c).child(o);a+=l.nodeSize,s.push(l)}return new E(i,s)},c.prototype.map=function a(t){for(var e=this,n=[],r=[],o=0;o<this.from.length;o++){var i=t.map(e.from[o],1),s=t.map(e.to[o],-1);if(s<=i)return null;n.push(i),r.push(s)}return new c(n,r)},c.fromJSON=function o(t,e){return new c(e.from,e.to)},c}(S);return e.RemoveColumnStep=A,S.jsonID("removeTableColumn",A),e.addColumnBefore=s,e.addColumnAfter=a,e.removeColumn=c,e.addRowBefore=p,e.addRowAfter=f,e.removeRow=h,e.selectNextCell=g,e.selectPreviousCell=y,n.exports}),t.registerDynamic("29",["2c"],!0,function(t,e,n){return n.exports=t("2c"),n.exports}),t.registerDynamic("2d",[],!0,function(t,e,n){var p=200,r=function r(){};r.prototype.append=function s(t){return t.length?(t=r.from(t),!this.length&&t||t.length<p&&this.leafAppend(t)||this.length<p&&t.leafPrepend(this)||this.appendInner(t)):this},r.prototype.prepend=function a(t){return t.length?r.from(t).append(this):this},r.prototype.appendInner=function c(t){return new i(this,t)},r.prototype.slice=function l(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),e<=t?r.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},r.prototype.get=function u(t){return t<0||t>=this.length?undefined:this.getInner(t)},r.prototype.forEach=function f(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},r.prototype.map=function h(n,t,e){void 0===t&&(t=0),void 0===e&&(e=this.length);var r=[];return this.forEach(function(t,e){return r.push(n(t,e))},t,e),r},r.from=function d(t){return t instanceof r?t:t&&t.length?new o(t):r.empty};var o=function(e){function n(t){e.call(this),this.values=t}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype);var t={length:{},depth:{}};return(n.prototype.constructor=n).prototype.flatten=function r(){return this.values},n.prototype.sliceInner=function o(t,e){return 0==t&&e==this.length?this:new n(this.values.slice(t,e))},n.prototype.getInner=function i(t){return this.values[t]},n.prototype.forEachInner=function s(t,e,n,r){for(var o=this,i=e;i<n;i++)if(!1===t(o.values[i],r+i))return!1},n.prototype.forEachInvertedInner=function a(t,e,n,r){for(var o=this,i=e-1;n<=i;i--)if(!1===t(o.values[i],r+i))return!1},n.prototype.leafAppend=function c(t){if(this.length+t.length<=p)return new n(this.values.concat(t.flatten()))},n.prototype.leafPrepend=function l(t){if(this.length+t.length<=p)return new n(t.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(n.prototype,t),n}(r);r.empty=new o([]);var i=function(n){function r(t,e){n.call(this),this.left=t,this.right=e,this.length=t.length+e.length,this.depth=Math.max(t.depth,e.depth)+1}return n&&(r.__proto__=n),r.prototype=Object.create(n&&n.prototype),(r.prototype.constructor=r).prototype.flatten=function t(){return this.left.flatten().concat(this.right.flatten())},r.prototype.getInner=function e(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},r.prototype.forEachInner=function i(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(o<n&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},r.prototype.forEachInvertedInner=function s(t,e,n,r){var o=this.left.length;return!(o<e&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},r.prototype.sliceInner=function o(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):n<=t?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},r.prototype.leafAppend=function a(t){var e=this.right.leafAppend(t);if(e)return new r(this.left,e)},r.prototype.leafPrepend=function c(t){var e=this.left.leafPrepend(t);if(e)return new r(e,this.right)},r.prototype.appendInner=function l(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new r(this.left,new r(this.right,t)):new r(this,t)},r}(r);return n.exports=r,n.exports}),t.registerDynamic("2e",["2d"],!0,function(t,e,n){return n.exports=t("2d"),n.exports}),t.registerDynamic("2f",[],!0,function(t,e,n){function l(t,e,n,r,o,i){if(e.isTextblock)return p.create(t,n);for(var s=r-(0<o?0:1);0<o?s<e.childCount:0<=s;s+=o){var a=e.child(s);if(a.isLeaf){if(!i&&u.isSelectable(a))return u.create(t,n-(o<0?a.nodeSize:0))}else{var c=l(t,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}var c=function c(t,e){this.$from=t,this.$to=e},r={from:{},to:{},empty:{}};r.from.get=function(){return this.$from.pos},r.to.get=function(){return this.$to.pos},r.empty.get=function(){return this.from==this.to},c.findFrom=function s(t,e,n){var r=t.parent.isTextblock?new p(t):l(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var o=t.depth-1;0<=o;o--){var i=e<0?l(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):l(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}},c.near=function o(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);var r=this.findFrom(t,e,n)||this.findFrom(t,-e,n);if(!r)throw new RangeError("Searching for selection in invalid document "+t.node(0));return r},c.atStart=function i(t,e){return l(t,t,0,0,1,e)},c.atEnd=function a(t,e){return l(t,t,t.content.size,t.childCount,-1,e)},c.between=function f(t,e,n){var r=c.near(e,n);if(r instanceof p){var o=c.findFrom(t,t.pos>r.to?-1:1,!0);r=new p(o.$anchor,r.$head)}else if(t.pos<r.from||t.pos>r.to){var i=t.pos>r.to,s=c.findFrom(t,i?-1:1,!0),a=c.findFrom(i?r.$from:r.$to,i?1:-1,!0);s&&a&&(r=new p(s.$anchor,a.$head))}return r},c.mapJSON=function h(t,e){return null!=t.anchor?{head:e.map(t.head),anchor:e.map(t.anchor)}:{node:e.map(t.node),after:e.map(t.after,-1)}},c.fromJSON=function d(t,e){if(null!=e.head){var n=t.resolve(e.anchor),r=t.resolve(e.head);return n.parent.isTextblock&&r.parent.isTextblock?new p(n,r):c.between(n,r)}var o=t.resolve(e.node),i=o.nodeAfter;return i&&e.after==e.pos+i.nodeSize&&u.isSelectable(i)?new u(o):c.near(o)},Object.defineProperties(c.prototype,r);var p=function(o){function i(t,e){void 0===e&&(e=t);var n=t.pos>e.pos;o.call(this,n?e:t,n?t:e),this.$anchor=t,this.$head=e}o&&(i.__proto__=o),i.prototype=Object.create(o&&o.prototype),i.prototype.constructor=i;var t={anchor:{},head:{},inverted:{}};return t.anchor.get=function(){return this.$anchor.pos},t.head.get=function(){return this.$head.pos},t.inverted.get=function(){return this.anchor>this.head},i.prototype.eq=function e(t){return t instanceof i&&t.head==this.head&&t.anchor==this.anchor},i.prototype.map=function s(t,e){var n=t.resolve(e.map(this.head));if(!n.parent.isTextblock)return o.near(n);var r=t.resolve(e.map(this.anchor));return new i(r.parent.isTextblock?r:n,n)},i.prototype.toJSON=function n(){return{head:this.head,anchor:this.anchor}},i.create=function a(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},Object.defineProperties(i.prototype,t),i}(e.Selection=c);e.TextSelection=p;var u=function(s){function a(t){var e=t.node(0).resolve(t.pos+t.nodeAfter.nodeSize);s.call(this,t,e),this.node=t.nodeAfter}return s&&(a.__proto__=s),a.prototype=Object.create(s&&s.prototype),(a.prototype.constructor=a).prototype.eq=function e(t){return t instanceof a&&this.from==t.from},a.prototype.map=function c(t,e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=t.resolve(n.pos),i=o.nodeAfter;return!n.deleted&&!r.deleted&&i&&r.pos==n.pos+i.nodeSize&&a.isSelectable(i)?new a(o):s.near(o)},a.prototype.toJSON=function t(){return{node:this.from,after:this.to}},a.create=function n(t,e){return new this(t.resolve(e))},a.isSelectable=function r(t){return!t.isText&&!1!==t.type.spec.selectable},a}(c);return e.NodeSelection=u,n.exports}),t.registerDynamic("30",["9","3","2f"],!0,function(t,e,n){function v(t,e,n){var o;t.steps.length!=e&&(t.mapping.maps[t.mapping.maps.length-1].forEach(function(t,e,n,r){return o=r}),null!=o&&t.setSelection(i.near(t.doc.resolve(o),n)))}function g(t){return null==t.head?o.none:t.$head.marks()}var r=t("9").Transform,o=t("3").Mark,i=t("2f").Selection,y=1,w=2,x=4,s=function(n){function t(t){n.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={docChanged:{},selection:{},selectionSet:{},storedMarksSet:{},isGeneric:{},scrolledIntoView:{}};return e.docChanged.get=function(){return 0<this.steps.length},e.selection.get=function(){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},t.prototype.setSelection=function r(t){return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|y)&~w,this.storedMarks=null,this},e.selectionSet.get=function(){return 0<(this.updated&y)},t.prototype.setStoredMarks=function o(t){return this.storedMarks=t,this.updated|=w,this},e.storedMarksSet.get=function(){return 0<(this.updated&w)},t.prototype.addStep=function i(t,e){n.prototype.addStep.call(this,t,e),this.updated=this.updated&~w,this.storedMarks=null},t.prototype.setTime=function s(t){return this.time=t,this},t.prototype.replaceSelection=function c(t){var e=this.selection,n=e.from,r=e.to,o=this.steps.length;this.replaceRange(n,r,t);for(var i=t.content.lastChild,s=null,a=0;a<t.openRight;a++)i=(s=i).lastChild;return v(this,o,(i?i.isInline:s&&s.isTextblock)?-1:1),this},t.prototype.replaceSelectionWith=function a(t,e){var n=this.selection,r=n.$from,o=n.from,i=n.to,s=this.steps.length;return!1!==e&&(t=t.mark(this.storedMarks||r.marks(o<i))),this.replaceRangeWith(o,i,t),v(this,s,t.isInline?-1:1),this},t.prototype.deleteSelection=function l(){var t=this.selection,e=t.from,n=t.to;return this.deleteRange(e,n)},t.prototype.insertText=function p(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=r.text(t,this.storedMarks||this.doc.resolve(e).marks(e<n));return this.replaceRangeWith(e,n,o)},t.prototype.setMeta=function u(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},t.prototype.getMeta=function f(t){return this.meta["string"==typeof t?t:t.key]},e.isGeneric.get=function(){var t=this;for(var e in t.meta)return!1;return!0},t.prototype.scrollIntoView=function h(){return this.updated|=x,this},e.scrolledIntoView.get=function(){return 0<(this.updated&x)},t.prototype.addStoredMark=function d(t){return this.storedMarks=t.addToSet(this.storedMarks||g(this.selection)),this},t.prototype.removeStoredMark=function m(t){return this.storedMarks=t.removeFromSet(this.storedMarks||g(this.selection)),this},Object.defineProperties(t.prototype,e),t}(r);return e.Transaction=s,n.exports}),t.registerDynamic("31",["3","2f","30"],!0,function(t,e,n){function r(t,e){return e&&t?t.bind(e):t}var c=t("3").Node,l=t("2f").Selection,o=t("30").Transaction,i=function i(t,e,n){this.name=t,this.init=r(e.init,n),this.apply=r(e.apply,n)},s=[new i("doc",{init:function h(t){return t.doc||t.schema.nodes.doc.createAndFill()},apply:function d(t){return t.doc}}),new i("selection",{init:function h(t,e){return t.selection||l.atStart(e.doc)},apply:function d(t){return t.selection}}),new i("storedMarks",{init:function h(){return null},apply:function d(t,e,n,r){return r.selection.empty?t.storedMarks:null}}),new i("scrollToSelection",{init:function h(){return 0},apply:function d(t,e){return t.scrolledIntoView?e+1:e}})],p=function p(t,e){var n=this;this.schema=t,this.fields=s.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach(function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),(n.pluginsByKey[t.key]=t).options.state&&n.fields.push(new i(t.key,t.options.state,t))})},u=function u(t){this.config=t},a={schema:{},plugins:{},tr:{}};a.schema.get=function(){return this.config.schema},a.plugins.get=function(){return this.config.plugins},u.prototype.apply=function d(t){return this.applyTransaction(t).state},u.prototype.filterTransaction=function m(t,e){var n=this;void 0===e&&(e=-1);for(var r=0;r<this.config.plugins.length;r++)if(r!=e){var o=n.config.plugins[r];if(o.options.filterTransaction&&!o.options.filterTransaction.call(o,t,n))return!1}return!0},u.prototype.applyTransaction=function v(t){var e=this;if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var n=[t],r=this.applyInner(t),o=null;;){for(var i=!1,s=0;s<this.config.plugins.length;s++){var a=e.config.plugins[s];if(a.options.appendTransaction){var c=o?o[s].n:0,l=o?o[s].state:e,p=c<n.length&&a.options.appendTransaction.call(a,c?n.slice(c):n,l,r);if(p&&r.filterTransaction(p,s)){if(!o){o=[];for(var u=0;u<this.config.plugins.length;u++)o.push(u<s?{state:r,n:n.length}:{state:e,n:0})}n.push(p),r=r.applyInner(p),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}},u.prototype.applyInner=function g(t){var e=this;if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new u(this.config),r=this.config.fields,o=0;o<r.length;o++){var i=r[o];n[i.name]=i.apply(t,e[i.name],e,n)}for(var s=0;s<f.length;s++)f[s](e,t,n);return n},a.tr.get=function(){return new o(this)},u.create=function y(t){for(var e=new p(t.schema||t.doc.type.schema,t.plugins),n=new u(e),r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n},u.prototype.reconfigure=function w(t){for(var e=this,n=new p(t.schema||this.schema,t.plugins),r=n.fields,o=new u(n),i=0;i<r.length;i++){var s=r[i].name;o[s]=e.hasOwnProperty(s)?e[s]:r[i].init(t,o)}return o},u.prototype.toJSON=function x(t){var e=this,n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(t)for(var r in t){if("doc"==r||"selection"==r)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var o=t[r],i=o.options.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,e[o.key]))}return n},u.fromJSON=function b(o,i,s){if(!o.schema)throw new RangeError("Required config field 'schema' missing");var t=new p(o.schema,o.plugins),a=new u(t);return t.fields.forEach(function(t){if("doc"==t.name)a.doc=c.fromJSON(o.schema,i.doc);else if("selection"==t.name)a.selection=l.fromJSON(a.doc,i.selection);else{if(s)for(var e in s){var n=s[e],r=n.options.state;if(n.key==t.name&&r&&r.fromJSON&&Object.prototype.hasOwnProperty.call(i,e))return void(a[t.name]=r.fromJSON.call(n,o,i[e],a))}a[t.name]=t.init(o,a)}}),a},u.addApplyListener=function k(t){f.push(t)},u.removeApplyListener=function S(t){var e=f.indexOf(t);-1<e&&f.splice(e,1)},Object.defineProperties(u.prototype,a),e.EditorState=u;var f=[];return n.exports}),t.registerDynamic("32",[],!0,function(t,e,n){function o(t){return t in r?t+"$"+ ++r[t]:(r[t]=0,t+"$")}var i=function i(t){var e=this;if(this.props={},t.props)for(var n in t.props){var r=t.props[n];r instanceof Function&&(r=r.bind(e)),e.props[n]=r}this.options=t,this.key=t.key?t.key.key:o("plugin")};i.prototype.getState=function a(t){return t[this.key]},e.Plugin=i;var r=Object.create(null),s=function s(t){void 0===t&&(t="key"),this.key=o(t)};return s.prototype.get=function c(t){return t.config.pluginsByKey[this.key]},s.prototype.getState=function a(t){return t[this.key]},e.PluginKey=s,n.exports}),t.registerDynamic("33",["2f","30","31","32"],!0,function(t,e,n){var r,o;return r=t("2f"),e.Selection=r.Selection,e.TextSelection=r.TextSelection,e.NodeSelection=r.NodeSelection,e.Transaction=t("30").Transaction,e.EditorState=t("31").EditorState,o=t("32"),e.Plugin=o.Plugin,e.PluginKey=o.PluginKey,n.exports}),t.registerDynamic("7",["33"],!0,function(t,e,n){return n.exports=t("33"),n.exports}),t.registerDynamic("34",["2e","9","7"],!0,function(t,e,n){function f(t,n){var r;return t.forEach(function(t,e){if(t.selection&&0==n--)return r=e,!1}),t.slice(r)}function i(t,e,n,r){var o,i=n.getMeta(M);if(i)return i;if(0==n.steps.length)return n.getMeta(C)?new k(t.done,t.undone,null,0):t;if(!1===n.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new k(t.done.rebased(n,o),t.undone.rebased(n,o),t.prevMap&&n.mapping.maps[n.steps.length-1],t.prevTime):new k(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),t.prevMap,t.prevTime);var s=t.prevTime<(n.time||0)-r.newGroupDelay||!a(n,t.prevMap,t.done);return new k(t.done.addTransform(n,s?e.toJSON():null,r),x.empty,n.mapping.maps[n.steps.length-1],n.time)}function a(t,e,n){if(!e)return!1;var r=t.mapping.maps[0],s=!1;return!r||(r.forEach(function(o,i){n.items.forEach(function(t){if(t.step)return e.forEach(function(t,e,n,r){o<=r&&n<=i&&(s=!0)}),!1;o=t.map.invert().map(o,-1),i=t.map.invert().map(i,1)},n.items.length,0)}),s)}function r(t,e,n,r){var o=M.get(e).options.config,i=(r?t.undone:t.done).popEvent(e,o.preserveItems);if(i){var s=e.selection,a=v.fromJSON(i.transform.doc,i.selection),c=(r?t.done:t.undone).addTransform(i.transform,s.toJSON(),o),l=new k(r?c:i.remaining,r?i.remaining:c,null,0);n(i.transform.setSelection(a).setMeta(M,l).scrollIntoView())}}function o(t){return t.tr.setMeta(C,!0)}function s(r){return r={depth:r&&r.depth||100,preserveItems:!(!r||!r.preserveItems),newGroupDelay:r&&r.newGroupDelay||500},new g({key:M,state:{init:function t(){return new k(x.empty,x.empty,null,0)},apply:function o(t,e,n){return i(e,n.selection,t,r)}},config:r})}function c(t,e){var n=M.getState(t);return!(!n||0==n.done.eventCount)&&(e&&r(n,t,e,!1),!0)}function l(t,e){var n=M.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&r(n,t,e,!0),!0)}function p(t){var e=M.getState(t);return e?e.done.eventCount:0}function u(t){var e=M.getState(t);return e?e.undone.eventCount:0}var h=t("2e"),d=t("9").Mapping,m=t("7"),v=m.Selection,g=m.Plugin,y=m.PluginKey,w=500,x=function x(t,e){this.items=t,this.eventCount=e};x.prototype.popEvent=function D(t,e){var o=this;if(0==this.eventCount)return null;for(var i,s,a=this.items.length;;a--){if(
6
- o.items.get(a-1).selection){--a;break}}e&&(i=this.remapping(a,this.items.length),s=i.maps.length);var c,l,p=t.tr,u=[],f=[];return this.items.forEach(function(t,e){if(!t.step)return i||(i=o.remapping(a,e+1),s=i.maps.length),s--,void f.push(t);if(i){f.push(new b(t.map));var n,r=t.step.map(i.slice(s));r&&p.maybeStep(r).doc&&(n=p.mapping.maps[p.mapping.maps.length-1],u.push(new b(n,null,null,u.length+f.length))),s--,n&&i.appendMap(n,s)}else p.maybeStep(t.step);return t.selection?(c=i?v.mapJSON(t.selection,i.slice(s)):t.selection,l=new x(o.items.slice(0,a).append(f.reverse().concat(u)),o.eventCount-1),!1):void 0},this.items.length,0),{remaining:l,transform:p,selection:c}},x.prototype.addTransform=function O(t,e,n){for(var r=[],o=this.eventCount+(e?1:0),i=this.items,s=!n.preserveItems&&i.length?i.get(i.length-1):null,a=0;a<t.steps.length;a++){var c=t.steps[a].invert(t.docs[a]),l=new b(t.mapping.maps[a],c,e),p=void 0;(p=s&&s.merge(l))&&(l=p,a?r.pop():i=i.slice(0,i.length-1)),r.push(l),e=null,n.preserveItems||(s=l)}var u=o-n.depth;return S<u&&(i=f(i,u),o-=u),new x(i.append(r),o)},x.prototype.remapping=function T(r,t){var o=[],i=[];return this.items.forEach(function(t,e){if(null!=t.mirrorOffset){var n=e-t.mirrorOffset;r<=n&&i.push(o.length-t.mirrorOffset,o.length)}o.push(t.map)},r,t),new d(o,i)},x.prototype.addMaps=function R(t){return 0==this.eventCount?this:new x(this.items.append(t.map(function(t){return new b(t)})),this.eventCount)},x.prototype.rebased=function N(i,t){if(!this.eventCount)return this;var s=[],e=this.items.length-t,n=0;e<0&&(n=-e,e=0);var a=i.mapping,c=i.steps.length,l=this.eventCount,p=n;this.items.forEach(function(t){var e=a.getMirror(p++);if(null!=e){c=Math.min(c,e);var n=a.maps[e];if(t.step){var r=i.steps[e].invert(i.docs[e]),o=t.selection&&v.mapJSON(t.selection,a.slice(p-1,e));s.push(new b(n,r,o))}else t.selection&&l--,s.push(new b(n))}},e);for(var r=[],o=t;o<c;o++)r.push(new b(a.maps[o]));var u=this.items.slice(0,e).append(r).append(s),f=new x(u,l);return f.emptyItemCount()>w&&(f=f.compress(this.items.length-s.length)),f},x.prototype.emptyItemCount=function E(){var e=0;return this.items.forEach(function(t){t.step||e++}),e},x.prototype.compress=function A(c){void 0===c&&(c=this.items.length);var l=this.remapping(0,c),p=l.maps.length,u=[],f=0;return this.items.forEach(function(t,e){if(c<=e)u.push(t),t.selection&&f++;else if(t.step){var n=t.step.map(l.slice(p)),r=n&&n.getMap();if(p--,r&&l.appendMap(r,p),n){var o=t.selection&&v.mapJSON(t.selection,l.slice(p));o&&f++;var i,s=new b(r.invert(),n,o),a=u.length-1;(i=u.length&&u[a].merge(s))?u[a]=i:u.push(s)}}else t.map&&p--},this.items.length,0),new x(h.from(u.reverse()),f)},x.empty=new x(h.empty,0);var b=function b(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};b.prototype.merge=function I(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new b(e.getMap().invert(),e,this.selection)}};var k=function k(t,e,n,r){this.done=t,this.undone=e,this.prevMap=n,this.prevTime=r};e.HistoryState=k;var S=20;e.closeHistory=o;var M=new y("history"),C=new y("closeHistory");return e.history=s,e.undo=c,e.redo=l,e.undoDepth=p,e.redoDepth=u,n.exports}),t.registerDynamic("23",["34"],!0,function(t,e,n){return n.exports=t("34"),n.exports}),t.registerDynamic("35",["22","29","2a","23"],!0,function(t,e,n){function r(t,r){function e(t,e){if(r){var n=r[t];if(!1===n)return;n&&(t=n)}o[t]=e}var n,o={};if(e("Mod-z",x),e("Shift-Mod-z",b),k||e("Mod-y",b),(n=t.marks.strong)&&e("Mod-b",f(n)),(n=t.marks.em)&&e("Mod-i",f(n)),(n=t.marks.code)&&e("Mod-`",f(n)),(n=t.nodes.bullet_list)&&e("Shift-Ctrl-8",v(n)),(n=t.nodes.ordered_list)&&e("Shift-Ctrl-9",v(n)),(n=t.nodes.blockquote)&&e("Ctrl->",l(n)),n=t.nodes.hard_break){var i=n,s=u(h,function(t,e){return e(t.tr.replaceSelectionWith(i.create()).scrollIntoView()),!0});e("Mod-Enter",s),e("Shift-Enter",s),k&&e("Ctrl-Enter",s)}if((n=t.nodes.list_item)&&(e("Enter",g(n)),e("Mod-[",y(n)),e("Mod-]",w(n))),(n=t.nodes.paragraph)&&e("Shift-Ctrl-0",p(n)),(n=t.nodes.code_block)&&e("Shift-Ctrl-\\",p(n)),n=t.nodes.heading)for(var a=1;a<=6;a++)e("Shift-Ctrl-"+a,p(n,{level:a}));if(n=t.nodes.horizontal_rule){var c=n;e("Mod-_",function(t,e){return e(t.tr.replaceSelectionWith(c.create()).scrollIntoView()),!0})}return t.nodes.table_row&&(e("Tab",d),e("Shift-Tab",m)),o}var o=t("22"),l=o.wrapIn,p=o.setBlockType,u=o.chainCommands,f=o.toggleMark,h=o.exitCode,i=t("29"),d=i.selectNextCell,m=i.selectPreviousCell,s=t("2a"),v=s.wrapInList,g=s.splitListItem,y=s.liftListItem,w=s.sinkListItem,a=t("23"),x=a.undo,b=a.redo,k="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);return e.buildKeymap=r,n.exports}),t.registerDynamic("36",["b","f","23","22","7","12","28","35"],!0,function(t,e,n){function r(t){var e=[u({rules:f.concat(o(t.schema))}),h(w(t.schema,t.mapKeys)),h(m),g()];return!1!==t.history&&e.push(d()),e.concat(new v({props:{attributes:{"class":"ProseMirror-example-setup-style"},menuContent:y(t.schema).fullMenu,floatingMenu:!0}}))}function o(t){var e,n=[];return(e=t.nodes.blockquote)&&n.push(s(e)),(e=t.nodes.ordered_list)&&n.push(a(e)),(e=t.nodes.bullet_list)&&n.push(c(e)),(e=t.nodes.code_block)&&n.push(l(e)),(e=t.nodes.heading)&&n.push(p(e,6)),n}var i=t("b"),s=i.blockQuoteRule,a=i.orderedListRule,c=i.bulletListRule,l=i.codeBlockRule,p=i.headingRule,u=i.inputRules,f=i.allInputRules,h=t("f").keymap,d=t("23").history,m=t("22").baseKeymap,v=t("7").Plugin,g=t("12").dropCursor,y=t("28").buildMenuItems;e.buildMenuItems=y;var w=t("35").buildKeymap;return e.buildKeymap=w,e.exampleSetup=r,e.buildInputRules=o,n.exports}),t.registerDynamic("37",["36"],!0,function(t,e,n){return n.exports=t("36"),n.exports}),t.registerDynamic("38",["3","39"],!0,function(t,e,n){function a(t,e,n){for(var r=[],o=0;o<t.childCount;o++){var i=t.child(o);i.content.size&&(i=i.copy(a(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return s.fromArray(r)}var r=t("3"),s=r.Fragment,c=r.Slice,o=t("39"),i=o.Step,l=o.StepResult,p=function(r){function o(t,e,n){r.call(this),this.from=t,this.to=e,this.mark=n}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),(o.prototype.constructor=o).prototype.apply=function s(t){var r=this,e=t.slice(this.from,this.to),n=t.resolve(this.from),o=n.node(n.sharedDepth(this.to)),i=new c(a(e.content,function(t,e,n){return e.contentMatchAt(n+1).allowsMark(r.mark.type)?t.mark(r.mark.addToSet(t.marks)):t},o),e.openLeft,e.openRight);return l.fromReplace(t,this.from,this.to,i)},o.prototype.invert=function t(){return new u(this.from,this.to,this.mark)},o.prototype.map=function i(t){var e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new o(e.pos,n.pos,this.mark)},o.prototype.merge=function e(t){if(t instanceof o&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new o(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},o.fromJSON=function n(t,e){return new o(e.from,e.to,t.markFromJSON(e.mark))},o}(i);e.AddMarkStep=p,i.jsonID("addMark",p);var u=function(r){function o(t,e,n){r.call(this),this.from=t,this.to=e,this.mark=n}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),(o.prototype.constructor=o).prototype.apply=function i(t){var e=this,n=t.slice(this.from,this.to),r=new c(a(n.content,function(t){return t.mark(e.mark.removeFromSet(t.marks))}),n.openLeft,n.openRight);return l.fromReplace(t,this.from,this.to,r)},o.prototype.invert=function t(){return new p(this.from,this.to,this.mark)},o.prototype.map=function s(t){var e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new o(e.pos,n.pos,this.mark)},o.prototype.merge=function e(t){if(t instanceof o&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new o(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},o.fromJSON=function n(t,e){return new o(e.from,e.to,t.markFromJSON(e.mark))},o}(i);return e.RemoveMarkStep=u,i.jsonID("removeMark",u),n.exports}),t.registerDynamic("3a",["3","3b","38","3c"],!0,function(t,e,n){var r=t("3"),m=r.MarkType,h=r.Slice,d=r.Fragment,o=t("3b").Transform,i=t("38"),v=i.AddMarkStep,g=i.RemoveMarkStep,y=t("3c").ReplaceStep;return o.prototype.addMark=function(c,l,p){var e=this,u=[],f=[],h=null,d=null;return this.doc.nodesBetween(c,l,function(t,e,n,r){if(t.isInline){var o=t.marks;if(p.isInSet(o)||!n.contentMatchAt(r+1).allowsMark(p.type))d=h=null;else{var i=Math.max(e,c),s=Math.min(e+t.nodeSize,l),a=p.type.isInSet(o);a?h&&h.mark.eq(a)?h.to=s:u.push(h=new g(i,s,a)):h=null,d?d.to=s:f.push(d=new v(i,s,p))}}}),u.forEach(function(t){return e.step(t)}),f.forEach(function(t){return e.step(t)}),this},o.prototype.removeMark=function(p,u,f){var e=this;void 0===f&&(f=null);var h=[],d=0;return this.doc.nodesBetween(p,u,function(t,e){if(t.isInline){d++;var n=null;if(f instanceof m){var r=f.isInSet(t.marks);r&&(n=[r])}else f?f.isInSet(t.marks)&&(n=[f]):n=t.marks;if(n&&n.length)for(var o=Math.min(e+t.nodeSize,u),i=0;i<n.length;i++){for(var s=n[i],a=void 0,c=0;c<h.length;c++){var l=h[c];l.step==d-1&&s.eq(h[c].style)&&(a=l)}a?(a.to=o,a.step=d):h.push({style:s,from:Math.max(e,p),to:o,step:d})}}}),h.forEach(function(t){return e.step(new g(t.from,t.to,t.style))}),this},o.prototype.clearMarkup=function(r,o){var i=this,s=[];this.doc.nodesBetween(r,o,function(t,e){if(t.isInline)if(t.type.isText)for(var n=0;n<t.marks.length;n++)i.step(new g(Math.max(e,r),Math.min(e+t.nodeSize,o),t.marks[n]));else s.push(new y(e,e+t.nodeSize,h.empty))});for(var t=s.length-1;0<=t;t--)i.step(s[t]);return this},o.prototype.clearNonMatching=function(t,e){for(var n=this,r=this.doc.nodeAt(t),o=[],i=t+1,s=0;s<r.childCount;s++){var a=r.child(s),c=i+a.nodeSize,l=e.matchType(a.type,a.attrs);if(l){e=l;for(var p=0;p<a.marks.length;p++)e.allowsMark(a.marks[p])||n.step(new g(i,c,a.marks[p]))}else o.push(new y(i,c,h.empty));i=c}if(!e.validEnd()){var u=e.fillBefore(d.empty,!0);this.replace(i,i,new h(u,0,0))}for(var f=o.length-1;0<=f;f--)n.step(o[f]);return this},n.exports}),t.registerDynamic("3b",["3d"],!0,function(t,e,n){var r=t("3d").Mapping,o=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e}(Error);e.TransformError=o;var i=function i(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new r},s={before:{}};return s.before.get=function(){return this.docs.length?this.docs[0]:this.doc},i.prototype.step=function a(t){var e=this.maybeStep(t);if(e.failed)throw new o(e.failed);return this},i.prototype.maybeStep=function c(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e},i.prototype.addStep=function l(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(i.prototype,s),e.Transform=i,n.exports}),t.registerDynamic("39",["3","3d"],!0,function(t,e,n){function r(){throw new Error("Override me")}var i=t("3").ReplaceError,o=t("3d").StepMap,s=Object.create(null),a=function a(){};a.prototype.apply=function l(){return r()},a.prototype.getMap=function p(){return o.empty},a.prototype.invert=function u(){return r()},a.prototype.map=function f(){return r()},a.prototype.merge=function h(){return null},a.prototype.toJSON=function d(){var t=this,e={stepType:this.jsonID};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];e[n]=r&&r.toJSON?r.toJSON():r}return e},a.fromJSON=function m(t,e){return s[e.stepType].fromJSON(t,e)},a.jsonID=function v(t,e){if(t in s)throw new RangeError("Duplicate use of step JSON ID "+t);return(s[t]=e).prototype.jsonID=t,e},e.Step=a;var c=function c(t,e){this.doc=t,this.failed=e};return c.ok=function g(t){return new c(t,null)},c.fail=function y(t){return new c(null,t)},c.fromReplace=function w(t,e,n,r){try{return c.ok(t.replace(e,n,r))}catch(o){if(o instanceof i)return c.fail(o.message);throw o}},e.StepResult=c,n.exports}),t.registerDynamic("3d",[],!0,function(t,e,n){function d(t,e){return t+e*o}function p(t){return t&r}function i(t){return(t-(t&r))/o}var r=65535,o=Math.pow(2,16),m=function m(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n};e.MapResult=m;var s=function s(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};s.prototype.recover=function c(t){var e=this,n=0,r=p(t);if(!this.inverted)for(var o=0;o<r;o++)n+=e.ranges[3*o+2]-e.ranges[3*o+1];return this.ranges[3*r]+n+i(t)},s.prototype.mapResult=function l(t,e){return this._map(t,e,!1)},s.prototype.map=function u(t,e){return this._map(t,e,!0)},s.prototype._map=function v(t,e,n){for(var r=this,o=0,i=this.inverted?2:1,s=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var c=r.ranges[a]-(r.inverted?o:0);if(t<c)break;var l=r.ranges[a+i],p=r.ranges[a+s],u=c+l;if(t<=u){var f=c+o+((l?t==c?-1:t==u?1:e:e)<0?0:p);if(n)return f;var h=d(a/3,t-c);return new m(f,e<0?t!=c:t!=u,h)}o+=p-l}return n?t+o:new m(t+o)},s.prototype.touches=function f(t,e){for(var n=this,r=0,o=p(e),i=this.inverted?2:1,s=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var c=n.ranges[a]-(n.inverted?r:0);if(t<c)break;var l=n.ranges[a+i];if(t<=c+l&&a==3*o)return!0;r+=n.ranges[a+s]-l}return!1},s.prototype.forEach=function h(t){for(var e=this,n=this.inverted?2:1,r=this.inverted?1:2,o=0,i=0;o<this.ranges.length;o+=3){var s=e.ranges[o],a=s-(e.inverted?i:0),c=s+(e.inverted?0:i),l=e.ranges[o+n],p=e.ranges[o+r];t(a,a+l,c,c+p),i+=p-l}},s.prototype.invert=function g(){return new s(this.ranges,!this.inverted)},s.prototype.toString=function y(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},(e.StepMap=s).empty=new s([]);var a=function a(t,e,n,r){this.maps=t||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=e};return a.prototype.slice=function w(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.maps.length),new a(this.maps,this.mirror,t,e)},a.prototype.copy=function x(){return new a(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},a.prototype.getMirror=function b(t){var e=this;if(this.mirror)for(var n=0;n<this.mirror.length;n++)if(e.mirror[n]==t)return e.mirror[n+(n%2?-1:1)]},a.prototype.setMirror=function k(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)},a.prototype.appendMap=function S(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)},a.prototype.appendMapping=function M(t){for(var e=this,n=0,r=this.maps.length;n<t.maps.length;n++){var o=t.getMirror(n);e.appendMap(t.maps[n],null!=o&&o<n?r+o:null)}},a.prototype.map=function u(t,e){var n=this;if(this.mirror)return this._map(t,e,!0);for(var r=this.from;r<this.to;r++)t=n.maps[r].map(t,e);return t},a.prototype.mapResult=function l(t,e){return this._map(t,e,!1)},a.prototype._map=function v(t,e,n){for(var r=this,o=!1,i=null,s=this.from;s<this.to;s++){var a=r.maps[s],c=i&&i[s];if(null!=c&&a.touches(t,c))t=a.recover(c);else{var l=a.mapResult(t,e);if(null!=l.recover){var p=r.getMirror(s);if(null!=p&&s<p&&p<r.to){if(l.deleted){s=p,t=r.maps[p].recover(l.recover);continue}(i||(i=Object.create(null)))[p]=l.recover}}l.deleted&&(o=!0),t=l.pos}}return n?t:new m(t,o)},e.Mapping=a,n.exports}),t.registerDynamic("3c",["3","39","3d"],!0,function(t,e,n){function l(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;0<o&&0<i&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(0<o)for(var s=r.node(i).maybeChild(r.indexAfter(i));0<o;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}var p=t("3").Slice,r=t("39"),o=r.Step,u=r.StepResult,f=t("3d").StepMap,i=function(o){function r(t,e,n,r){o.call(this),this.from=t,this.to=e,this.slice=n,this.structure=!!r}return o&&(r.__proto__=o),r.prototype=Object.create(o&&o.prototype),(r.prototype.constructor=r).prototype.apply=function e(t){return this.structure&&l(t,this.from,this.to)?u.fail("Structure replace would overwrite content"):u.fromReplace(t,this.from,this.to,this.slice)},r.prototype.getMap=function t(){return new f([this.from,this.to-this.from,this.slice.size])},r.prototype.invert=function n(t){return new r(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},r.prototype.map=function i(t){var e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted?null:new r(e.pos,Math.max(e.pos,n.pos),this.slice)},r.prototype.merge=function s(t){if(!(t instanceof r)||t.structure!=this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openRight||t.slice.openLeft){if(t.to!=this.from||this.slice.openLeft||t.slice.openRight)return null;var e=this.slice.size+t.slice.size==0?p.empty:new p(t.slice.content.append(this.slice.content),t.slice.openLeft,this.slice.openRight);return new r(t.from,this.to,e,this.structure)}var n=this.slice.size+t.slice.size==0?p.empty:new p(this.slice.content.append(t.slice.content),this.slice.openLeft,t.slice.openRight);return new r(this.from,this.to+(t.to-t.from),n,this.structure)},r.prototype.toJSON=function a(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},r.fromJSON=function c(t,e){return new r(e.from,e.to,p.fromJSON(t,e.slice),!!e.structure)},r}(o);e.ReplaceStep=i,o.jsonID("replace",i);var s=function(a){function i(t,e,n,r,o,i,s){a.call(this),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=!!s}return a&&(i.__proto__=a),i.prototype=Object.create(a&&a.prototype),(i.prototype.constructor=i).prototype.apply=function r(t){if(this.structure&&(l(t,this.from,this.gapFrom)||l(t,this.gapTo,this.to)))return u.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openLeft||e.openRight)return u.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?u.fromReplace(t,this.from,this.to,n):u.fail("Content does not fit in gap")},i.prototype.getMap=function t(){return new f([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},i.prototype.invert=function n(t){var e=this.gapTo-this.gapFrom;return new i(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},i.prototype.map=function s(t){var e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deleted&&n.deleted||r<e.pos||o>n.pos?null:new i(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)},i.toJSON=function e(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,slice:this.slice.toJSON()};return this.structure&&(t.structure=!0),!0},i.fromJSON=function o(t,e){return new i(e.from,e.to,e.gapFrom,e.gapTo,p.fromJSON(t,e.slice),e.insert,!!e.structure)},i}(o);return e.ReplaceAroundStep=s,o.jsonID("replaceAround",s),n.exports}),t.registerDynamic("3e",["3","3b","3c"],!0,function(t,e,n){function s(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function r(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||!s(r,o,i))break}}function o(t,e,n,r){void 0===r&&(r=t);var o={type:e,attrs:n},i=a(t,o),s=i&&c(r,o);return s?i.concat(o).concat(s):null}function a(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.contentMatchAt(r).findWrapping(e.type,e.attrs);if(!i)return null;var s=i.length?i[0]:e;return n.canReplaceWith(r,o,s.type,s.attrs)?i:null}function c(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.child(r),s=e.type.contentExpr.start(e.attrs).findWrappingFor(i);if(!s)return null;for(var a=s.length?s[s.length-1]:e,c=a.type.contentExpr.start(a.attrs),l=r;l<o;l++)c=c&&c.matchNode(n.child(l));return c&&c.validEnd()?s:null}function i(t,e,n,r){void 0===n&&(n=1);var o=t.resolve(e),i=o.depth-n;if(i<0||!o.parent.canReplace(o.index(),o.parent.childCount)||!o.parent.canReplace(0,o.indexAfter()))return!1;for(var s=o.depth-1,a=n-1;i<s;s--,a--){var c=o.node(s),l=o.index(s),p=r&&r[a];if(!c.canReplace(0,l)||!c.canReplaceWith(l,c.childCount,p?p.type:o.node(s+1).type,p?p.attrs:o.node(s+1).attrs))return!1}var u=o.indexAfter(i),f=r&&r[0];return o.node(i).canReplaceWith(u,u,f?f.type:o.node(i+1).type,f?f.attrs:o.node(i+1).attrs)}function l(t,e){var n=t.resolve(e),r=n.index();return p(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function p(t,e){return t&&e&&!t.isLeaf&&t.canAppend(e)}function u(t,e,n){void 0===n&&(n=-1);for(var r=t.resolve(e),o=r.depth;;o--){var i=void 0,s=void 0;if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):0<n?(i=r.node(o+1),s=r.node(o).maybeChild(r.index(o)+1)):(i=r.node(o).maybeChild(r.index(o)-1),s=r.node(o+1)),i&&!i.isTextblock&&p(i,s))return e;if(0==o)break;e=n<0?r.before(o):r.after(o)}}function f(t,e,n,r){var o=t.resolve(e);if(o.parent.canReplaceWith(o.index(),o.index(),n,r))return e;if(0==o.parentOffset)for(var i=o.depth-1;0<=i;i--){var s=o.index(i);if(o.node(i).canReplaceWith(s,s,n,r))return o.before(i+1);if(0<s)return null}if(o.parentOffset==o.parent.content.size)for(var a=o.depth-1;0<=a;a--){var c=o.indexAfter(a);if(o.node(a).canReplaceWith(c,c,n,r))return o.after(a+1);if(c<o.node(a).childCount)return null}}var h=t("3"),g=h.Slice,y=h.Fragment,d=t("3b").Transform,m=t("3c"),v=m.ReplaceStep,w=m.ReplaceAroundStep;return e.liftTarget=r,d.prototype.lift=function(t,e){for(var n=t.$from,r=t.$to,o=t.depth,i=n.before(o+1),s=r.after(o+1),a=i,c=s,l=y.empty,p=0,u=o,f=!1;e<u;u--)f||0<n.index(u)?(f=!0,l=y.from(n.node(u).copy(l)),p++):a--;for(var h=y.empty,d=0,m=o,v=!1;e<m;m--)v||r.after(m+1)<r.end(m)?(v=!0,h=y.from(r.node(m).copy(h)),d++):c++;return this.step(new w(a,c,i,s,new g(l.append(h),p,d),l.size-p,!0))},e.findWrapping=o,d.prototype.wrap=function(t,e){for(var n=y.empty,r=e.length-1;0<=r;r--)n=y.from(e[r].type.create(e[r].attrs,n));var o=t.start,i=t.end;return this.step(new w(o,i,o,i,new g(n,0,0),e.length,!0))},d.prototype.setBlockType=function(t,e,i,s){var a=this;if(void 0===e&&(e=t),!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var c=this.steps.length;return this.doc.nodesBetween(t,e,function(t,e){if(t.isTextblock&&!t.hasMarkup(i,s)){a.clearNonMatching(a.mapping.slice(c).map(e,1),i.contentExpr.start(s));var n=a.mapping.slice(c),r=n.map(e,1),o=n.map(e+t.nodeSize,1);return a.step(new w(r,o,r+1,o-1,new g(y.from(i.create(s)),0,0),1,!0)),!1}}),this},d.prototype.setNodeType=function(t,e,n){var r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at given position");if(e||(e=r.type),r.isLeaf)return this.replaceWith(t,t+r.nodeSize,e.create(n,null,r.marks));if(!e.validContent(r.content,n))throw new RangeError("Invalid content for node type "+e.name);return this.step(new w(t,t+r.nodeSize,t+1,t+r.nodeSize-1,new g(y.from(e.create(n)),0,0),1,!0))},e.canSplit=i,d.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),o=y.empty,i=y.empty,s=r.depth,a=r.depth-e,c=e-1;a<s;s--,c--){o=y.from(r.node(s).copy(o));var l=n&&n[c];i=y.from(l?l.type.create(l.attrs,i):r.node(s).copy(i))}return this.step(new v(t,t,new g(o.append(i),e,e,!0)))},e.canJoin=l,e.joinPoint=u,d.prototype.join=function(t,e){void 0===e&&(e=1);var n=new v(t-e,t+e,g.empty,!0);return this.step(n)},e.insertPoint=f,n.exports}),t.registerDynamic("3f",["3","3c","3b","3e"],!0,function(t,e,n){function b(t,e,n,r,o){if(e<n){var i=t.firstChild;t=t.replaceChild(0,i.copy(b(i.content,e+1,n,r,i)))}return r<e&&(t=o.contentMatchAt(0).fillBefore(t).append(t)),t}function k(t,e){for(var n=[],r=0;r<t.depth;r++){var o=t.depth-r;if(t.pos-r>t.start(o))break;e.depth>=o&&e.pos+(e.depth-o)==t.end(o)&&n.push(o)}return n}function o(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=O.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);if(S(o,i,r))return new T(e,n,r);var s=u(o,d(o,r)),a=f(o,i,s);if(!a)return null;if(s.size!=a.size&&h(o,i,s)){for(var c=i.depth,l=i.after(c);1<c&&l==i.end(--c);)++l;var p=f(o,t.resolve(l),s);if(p)return new v(e,l,n,i.end(),p,s.size)}return new T(e,n,a)}function c(t,e,n,r){var o=D.empty,i=0,s=n[e];if(t.depth>e){var a=c(t,e+1,n,r||s);i=a.openRight+1,o=D.from(t.node(e+1).copy(a.content))}return s&&(o=o.append(s.content),i=s.openRight),r&&(o=o.append(t.node(e).contentMatchAt(t.indexAfter(e)).fillBefore(D.empty,!0)),i=0),{content:o,openRight:i}}function u(t,e){var n=c(t,0,e,!1),r=n.content,o=n.openRight;return new O(r,t.depth,o||0)}function y(t,e,n,r,o,i,s){var a,c=t.childCount,l=c-(0<s?1:0);a=i<0?e.contentMatchAt(l):1==c&&0<s?n.node(o).contentMatchAt(i?n.index(o):n.indexAfter(o)):n.node(o).contentMatchAt(n.indexAfter(o)).matchFragment(t,0<c&&i?1:0,l);var p=r.node(o);if(0<s&&o<r.depth){var u=p.content.cutByIndex(r.indexAfter(o)).addToStart(t.lastChild),f=a.fillBefore(u,!0);if(f&&f.size&&0<i&&1==c&&(f=null),f){var h=y(t.lastChild.content,t.lastChild,n,r,o+1,1==c?i-1:-1,s-1);if(h){var d=t.lastChild.copy(h);return f.size?t.cutByIndex(0,c-1).append(f).addToEnd(d):t.replaceChild(c-1,d)}}}0<s&&(a=a.matchNode(1==c&&0<i?n.node(o+1):t.lastChild));var m=r.index(o);if(m==p.childCount&&!p.type.compatibleContent(e.type))return null;var v=a.fillBefore(p.content,!0,m);if(!v)return null;if(0<s){var g=w(t.lastChild,s-1,n,o+1,1==c?i-1:-1);t=t.replaceChild(c-1,g)}return t=t.append(v),r.depth>o&&(t=t.addToEnd(x(r,o+1))),t}function w(t,e,n,r,o){var i,s=t.content,a=s.childCount;if(i=0<=o?n.node(r).contentMatchAt(n.indexAfter(r)).matchFragment(s,0<o?1:0,a):t.contentMatchAt(a),0<e){var c=w(s.lastChild,e-1,n,r+1,1==a?o-1:-1);s=s.replaceChild(a-1,c)}return t.copy(s.append(i.fillBefore(D.empty,!0)))}function x(t,e){var n=t.node(e),r=n.contentMatchAt(0).fillBefore(n.content,!0,t.index(e));return t.depth>e&&(r=r.addToEnd(x(t,e+1))),n.copy(r)}function i(t,e,n){for(;0<e&&0<n&&1==t.childCount;)t=t.firstChild.content,e--,n--;return new O(t,e,n)}function f(t,e,n){var r=y(n.content,t.node(0),t,e,0,n.openLeft,n.openRight);return r?i(r,n.openLeft,e.depth):null}function S(t,e,n){return!n.openLeft&&!n.openRight&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}function h(t,e,n){if(!e.parent.isTextblock)return!1;var r;if(n.openRight){var o=s(n.content,n.openRight);if(!o.isTextblock)return!1;r=o.contentMatchAt(o.childCount)}else{var i=t.node(t.depth-(n.openLeft-n.openRight));if(!i.isTextblock)return!1;r=i.contentMatchAt(i.childCount),n.size&&(r=r.matchFragment(n.content,n.openLeft?1:0))}return(r=r.matchFragment(e.parent.content,e.index()))&&r.validEnd()}function g(t,e){for(var n=1;n<e;n++)t=t.firstChild.content;return t.firstChild}function s(t,e){for(var n=1;n<e;n++)t=t.lastChild.content;return t.lastChild}function d(t,e){for(var n=t.depth,r=null,o=[],i=null,s=e.openLeft;;--s){var a=void 0,c=void 0,l=void 0;if(0<=s){var p;if(0<s)a=(p=g(e.content,s)).type,c=p.attrs,l=p.content;else 0==s&&(l=e.content);s<e.openLeft&&(l=l.cut(l.firstChild.nodeSize))}else{l=D.empty;var u=i[i.length+s-1];a=u.type,c=u.attrs}if(r&&(l=l.addToStart(r)),0==l.size&&s<=0)break;var f=C(l,t,n,o);if(f){if(0<f.fragment.size&&(o[f.depth]={content:f.fragment,openRight:M(e,s)?e.openRight-s:0,depth:f.depth}),s<=0)break;r=null,n=f.depth-(a==t.node(f.depth).type?1:0)}else{if(0==s){var h=t.node(0),d=h.contentMatchAt(t.index(0)).findWrappingFor(l.firstChild);if(!d||0==d.length)break;var m,v=d[d.length-1];if(!v.type.contentExpr.matches(v.attrs,l))break;i=[{type:h.type,attrs:h.attrs}].concat(d),a=(m=v).type,c=m.attrs}l.size?(l=a.contentExpr.start(c).fillBefore(l,!0).append(l),r=a.create(c,l)):r=null}}return o}function M(t,e){for(var n=0,r=t.content;n<e;n++){if(1<r.childCount)return!1;r=r.firstChild.content}return!0}function C(t,e,n,r){for(var o=!1,i=0;i<t.childCount;i++)t.child(i).marks.length&&(o=!0);for(var s=n;0<=s;s--){var a=e.node(s).contentMatchAt(e.indexAfter(s)),c=r[s];c&&(a=a.matchFragment(c.content));var l=a.fillBefore(t);if(l)return{depth:s,fragment:(c?c.content.append(l):l).append(t)};if(o){var p=m(a,t);if(p)return{depth:s,fragment:c?c.content.append(p):p}}}}function m(e,t){for(var n=[],r=0;r<t.childCount;r++){var o=t.child(r),i=o.mark(o.marks.filter(function(t){return e.allowsMark(t.type)}));if(!(e=e.matchNode(i)))return null;n.push(i)}return D.from(n)}var r=t("3"),D=r.Fragment,O=r.Slice,a=t("3c"),T=a.ReplaceStep,v=a.ReplaceAroundStep,l=t("3b").Transform,p=t("3e").insertPoint;return l.prototype.replaceRange=function(t,e,n){var r=this;if(!n.size)return this.deleteRange(t,e);var o=this.doc.resolve(t);if(S(o,this.doc.resolve(e),n))return this.step(new T(t,e,n));var i=k(o,this.doc.resolve(e)),s=0;i.unshift(o.depth+1);for(var a=o.depth;0<a&&!o.node(a).type.spec.defining;a--){var c=i.indexOf(a,1);-1<c&&(s=c)}for(var l=[],p=n.openLeft,u=n.content,f=0;;f++){var h=u.firstChild;if(l.push(h),f==n.openLeft)break;u=h.content}0<p&&l[p-1].type.spec.defining?p-=1:2<=p&&l[p-1].isTextblock&&l[p-2].type.spec.defining&&(p-=2);for(var d=n.openLeft;0<=d;d--){var m=(d+p+1)%(n.openLeft+1),v=l[m];if(v)for(var g=0;g<i.length;g++){var y=i[(g+s)%i.length],w=o.node(y-1),x=o.index(y-1);if(w.canReplaceWith(x,x,v.type,v.attrs,v.marks))return r.replace(o.before(y),y>o.depth?e:o.after(y),new O(b(n.content,0,n.openLeft,m),m,n.openRight))}}return this.replace(t,e,n)},l.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=p(this.doc,t,n.type,n.attrs);null!=r&&(t=e=r)}return this.replaceRange(t,e,new O(D.from(n),0,0))},l.prototype.deleteRange=function(t,e){for(var n=this.doc.resolve(t),r=k(n,this.doc.resolve(e)),o=!1,i=0;i<r.length;i++)if(n.node(r[i]).contentMatchAt(0).validEnd()){t=n.start(r[i]),e=n.end(r[i]),o=!0;break}if(!o&&r.length){var s=r[r.length-1];n.node(s-1).canReplace(n.index(s-1),n.indexAfter(s-1))&&(t=n.before(s),e=n.after(s))}return this["delete"](t,e)},l.prototype["delete"]=function(t,e){return this.replace(t,e,O.empty)},e.replaceStep=o,l.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=O.empty);var r=o(this.doc,t,e,n);return r&&this.step(r),this},l.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new O(D.from(n),0,0))},l.prototype.insert=function(t,e){return this.replaceWith(t,t,e)},n.exports}),t.registerDynamic("40",["3b","39","3e","3d","38","3c","3a","3f"],!0,function(t,e,n){var r,o,i,s,a,c,l;return r=t("3b"),e.Transform=r.Transform,e.TransformError=r.TransformError,o=t("39"),e.Step=o.Step,e.StepResult=o.StepResult,i=t("3e"),e.joinPoint=i.joinPoint,e.canJoin=i.canJoin,e.canSplit=i.canSplit,e.insertPoint=i.insertPoint,e.liftTarget=i.liftTarget,e.findWrapping=i.findWrapping,s=t("3d"),e.StepMap=s.StepMap,e.MapResult=s.MapResult,e.Mapping=s.Mapping,a=t("38"),e.AddMarkStep=a.AddMarkStep,e.RemoveMarkStep=a.RemoveMarkStep,c=t("3c"),e.ReplaceStep=c.ReplaceStep,e.ReplaceAroundStep=c.ReplaceAroundStep,t("3a"),l=t("3f"),e.replaceStep=l.replaceStep,n.exports}),t.registerDynamic("9",["40"],!0,function(t,e,n){return n.exports=t("40"),n.exports}),t.registerDynamic("41",[],!0,function(t,e,n){function s(t){this.content=t}return s.prototype={constructor:s,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?undefined:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return-1==o?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new s(i)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new s(n)},addToStart:function(t,e){return new s([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new s(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(-1==i?o.length:i,0,e,n),new s(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=s.from(t)).size?new s(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=s.from(t)).size?new s(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=s.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},s.from=function(t){if(t instanceof s)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new s(e)},n.exports=s,n.exports}),t.registerDynamic("42",["41"],!0,function(t,e,n){return n.exports=t("41"),n.exports}),t.registerDynamic("43",["44"],!0,function(t,e,n){var i=t("44").Mark,p=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},r={parent:{},textOffset:{},nodeAfter:{},nodeBefore:{}};p.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},r.parent.get=function(){return this.node(this.depth)},
7
- p.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},p.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},p.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},p.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},p.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},p.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},p.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},r.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},r.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},r.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},p.prototype.marks=function(t){var e=this.parent,n=this.index();if(0==e.content.size)return i.none;if(t&&n<e.childCount||0==n||this.textOffset)return e.child(n).marks;for(var r=e.child(n-1).marks,o=0;o<r.length;o++)!1===r[o].type.spec.inclusiveRight&&(r=r[o--].removeFromSet(r));return r},p.prototype.sharedDepth=function(t){for(var e=this,n=this.depth;0<n;n--)if(e.start(n)<=t&&e.end(n)>=t)return n;return 0},p.prototype.blockRange=function(t,e){var n=this;if(void 0===t&&(t=this),t.pos<this.pos)return t.blockRange(this);for(var r=this.depth-(this.parent.isTextblock||this.pos==t.pos?1:0);0<=r;r--)if(t.pos<=n.end(r)&&(!e||e(n.node(r))))return new o(n,t,r)},p.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},p.prototype.toString=function(){for(var t=this,e="",n=1;n<=this.depth;n++)e+=(e?"/":"")+t.node(n).type.name+"_"+t.index(n-1);return e+":"+this.parentOffset},p.resolve=function(t,e){if(!(0<=e&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,i=t;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,l=o-c;if(n.push(i,a,r+c),!l)break;if((i=i.child(a)).isText)break;o=l-1,r+=c+1}return new p(e,n,o)},p.resolveCached=function(t,e){for(var n=0;n<s.length;n++){var r=s[n];if(r.pos==e&&r.node(0)==t)return r}var o=s[a]=p.resolve(t,e);return a=(a+1)%c,o},Object.defineProperties(p.prototype,r),e.ResolvedPos=p;var s=[],a=0,c=6,o=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},l={start:{},end:{},parent:{},startIndex:{},endIndex:{}};return l.start.get=function(){return this.$from.before(this.depth+1)},l.end.get=function(){return this.$to.after(this.depth+1)},l.parent.get=function(){return this.$from.node(this.depth)},l.startIndex.get=function(){return this.$from.index(this.depth)},l.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(o.prototype,l),e.NodeRange=o,n.exports}),t.registerDynamic("45",["46","44","47","43","48"],!0,function(t,e,n){function r(t,e){for(var n=t.length-1;0<=n;n--)e=t[n].type.name+"("+e+")";return e}var o=t("46").Fragment,i=t("44").Mark,s=t("47"),c=s.Slice,a=s.replace,l=t("43").ResolvedPos,p=t("48").compareDeep,u=Object.create(null),f=!1,h=function(t,e,n,r){this.type=t,this.attrs=e,this.content=n||o.empty,this.marks=r||i.none},d={nodeSize:{},childCount:{},textContent:{},firstChild:{},lastChild:{},isBlock:{},isTextblock:{},isInline:{},isText:{},isLeaf:{}};d.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},d.childCount.get=function(){return this.content.childCount},h.prototype.child=function(t){return this.content.child(t)},h.prototype.maybeChild=function(t){return this.content.maybeChild(t)},h.prototype.forEach=function(t){this.content.forEach(t)},h.prototype.nodesBetween=function(t,e,n,r){void 0===r&&(r=0),this.content.nodesBetween(t,e,n,r,this)},h.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},d.textContent.get=function(){return this.textBetween(0,this.content.size,"")},h.prototype.textBetween=function(t,e,n,r){return this.content.textBetween(t,e,n,r)},d.firstChild.get=function(){return this.content.firstChild},d.lastChild.get=function(){return this.content.lastChild},h.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},h.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},h.prototype.hasMarkup=function(t,e,n){return this.type==t&&p(this.attrs,e||t.defaultAttrs||u)&&i.sameSet(this.marks,n||i.none)},h.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},h.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},h.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},h.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return c.empty;var r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new c(a,r.depth-i,o.depth-i)},h.prototype.replace=function(t,e,n){return a(this.resolve(t),this.resolve(e),n)},h.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,o=n.offset;if(!(e=e.maybeChild(r)))return null;if(o==t||e.isText)return e;t-=o+1}},h.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},h.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},h.prototype.resolve=function(t){return l.resolveCached(this,t)},h.prototype.resolveNoCache=function(t){return l.resolve(this,t)},h.prototype.marksAt=function(t,e){return!f&&"undefined"!=typeof console&&console.warn&&(f=!0,console.warn("Node.marksAt is deprecated. Use ResolvedPos.marks instead.")),this.resolve(t).marks(e)},h.prototype.rangeHasMark=function(t,e,n){var r=!1;return this.nodesBetween(t,e,function(t){return n.isInSet(t.marks)&&(r=!0),!r}),r},d.isBlock.get=function(){return this.type.isBlock},d.isTextblock.get=function(){return this.type.isTextblock},d.isInline.get=function(){return this.type.isInline},d.isText.get=function(){return this.type.isText},d.isLeaf.get=function(){return this.type.isLeaf},h.prototype.toString=function(){var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),r(this.marks,t)},h.prototype.contentMatchAt=function(t){return this.type.contentExpr.getMatchAt(this.attrs,this.content,t)},h.prototype.canReplace=function(t,e,n,r,o){return this.type.contentExpr.checkReplace(this.attrs,this.content,t,e,n,r,o)},h.prototype.canReplaceWith=function(t,e,n,r,o){return this.type.contentExpr.checkReplaceWith(this.attrs,this.content,t,e,n,r,o||i.none)},h.prototype.canAppend=function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)},h.prototype.defaultContentType=function(t){var e=this.contentMatchAt(t).nextElement;return e&&e.defaultType()},h.prototype.toJSON=function(){var t=this,e={type:this.type.name};for(var n in t.attrs){e.attrs=t.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(function(t){return t.toJSON()})),e},h.fromJSON=function(t,e){var n=e.marks&&e.marks.map(t.markFromJSON);return"text"==e.type?t.text(e.text,n):t.nodeType(e.type).create(e.attrs,o.fromJSON(t,e.content),n)},Object.defineProperties(h.prototype,d);var m=function(o){function e(t,e,n,r){if(o.call(this,t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}o&&(e.__proto__=o),e.prototype=Object.create(o&&o.prototype);var t={textContent:{},nodeSize:{}};return(e.prototype.constructor=e).prototype.toString=function(){return r(this.marks,JSON.stringify(this.text))},t.textContent.get=function(){return this.text},e.prototype.textBetween=function(t,e){return this.text.slice(t,e)},t.nodeSize.get=function(){return this.text.length},e.prototype.mark=function(t){return new e(this.type,this.attrs,this.text,t)},e.prototype.withText=function(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)},e.prototype.cut=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.text.length),0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))},e.prototype.eq=function(t){return this.sameMarkup(t)&&this.text==t.text},e.prototype.toJSON=function(){var t=o.prototype.toJSON.call(this);return t.text=this.text,t},Object.defineProperties(e.prototype,t),e}(e.Node=h);return e.TextNode=m,n.exports}),t.registerDynamic("49",["42","45","46","44","4a"],!0,function(t,e,n){function i(t){var e=Object.create(null);for(var n in t){var r=t[n];if(r["default"]===undefined)return null;e[n]=r["default"]}return e}function r(t,e){var n=Object.create(null);for(var r in t){var o=e&&e[r];if(null==o){var i=t[r];if(i["default"]!==undefined)o=i["default"];else{if(!i.compute)throw new RangeError("No value supplied for attribute "+r);o=i.compute()}}n[r]=o}return n}function s(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new m(t[n]);return e}var o=t("42"),a=t("45"),c=a.Node,l=a.TextNode,p=t("46").Fragment,u=t("44").Mark,f=t("4a").ContentExpr,h=function(t,e,n){this.name=t,this.schema=e,this.spec=n,this.attrs=s(n.attrs),this.defaultAttrs=i(this.attrs),this.contentExpr=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t},d={isInline:{},isTextblock:{},isLeaf:{}};d.isInline.get=function(){return!this.isBlock},d.isTextblock.get=function(){return this.isBlock&&this.contentExpr.inlineContent},d.isLeaf.get=function(){return this.contentExpr.isLeaf},h.prototype.hasRequiredAttrs=function(t){var e=this;for(var n in e.attrs)if(e.attrs[n].isRequired&&(!t||!(n in t)))return!0;return!1},h.prototype.compatibleContent=function(t){return this==t||this.contentExpr.compatible(t.contentExpr)},h.prototype.computeAttrs=function(t){return!t&&this.defaultAttrs?this.defaultAttrs:r(this.attrs,t)},h.prototype.create=function(t,e,n){if("string"==typeof e)throw new Error("Calling create with string");return new c(this,this.computeAttrs(t),p.from(e),u.setFrom(n))},h.prototype.createChecked=function(t,e,n){if(t=this.computeAttrs(t),e=p.from(e),!this.validContent(e,t))throw new RangeError("Invalid content for node "+this.name);return new c(this,t,e,u.setFrom(n))},h.prototype.createAndFill=function(t,e,n){if(t=this.computeAttrs(t),(e=p.from(e)).size){var r=this.contentExpr.start(t).fillBefore(e);if(!r)return null;e=r.append(e)}var o=this.contentExpr.getMatchAt(t,e).fillBefore(p.empty,!0);return o?new c(this,t,e.append(o),u.setFrom(n)):null},h.prototype.validContent=function(t,e){return this.contentExpr.matches(e,t)},h.compile=function(t,n){var r=Object.create(null);if(t.forEach(function(t,e){return r[t]=new h(t,n,e)}),!r.doc)throw new RangeError("Every schema needs a 'doc' type");if(!r.text)throw new RangeError("Every schema needs a 'text' type");return r},Object.defineProperties(h.prototype,d),e.NodeType=h;var m=function(t){this["default"]=t["default"],this.compute=t.compute},v={isRequired:{}};v.isRequired.get=function(){return this["default"]===undefined&&!this.compute},Object.defineProperties(m.prototype,v);var g=function(t,e,n,r){this.name=t,this.schema=n,this.spec=r,this.attrs=s(r.attrs),this.rank=e;var o=i(this.attrs);this.instance=o&&new u(this,o)};g.prototype.create=function(t){return!t&&this.instance?this.instance:new u(this,r(this.attrs,t))},g.compile=function(t,n){var r=Object.create(null),o=0;return t.forEach(function(t,e){return r[t]=new g(t,o++,n,e)}),r},g.prototype.removeFromSet=function(t){for(var e=this,n=0;n<t.length;n++)if(t[n].type==e)return t.slice(0,n).concat(t.slice(n+1));return t},g.prototype.isInSet=function(t){for(var e=this,n=0;n<t.length;n++)if(t[n].type==e)return t[n]},e.MarkType=g;var y=function(t){var e=this;for(var n in this.nodeSpec=o.from(t.nodes),this.markSpec=o.from(t.marks),this.nodes=h.compile(this.nodeSpec,this),this.marks=g.compile(this.markSpec,this),e.nodes){if(n in e.marks)throw new RangeError(n+" can not be both a node and a mark");var r=e.nodes[n];r.contentExpr=f.parse(r,e.nodeSpec.get(n).content||"",e.nodeSpec)}this.cached=Object.create(null),this.cached.wrappings=Object.create(null),this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this)};return y.prototype.node=function(t,e,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof h))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)},y.prototype.text=function(t,e){var n=this.nodes.text;return new l(n,n.defaultAttrs,t,u.setFrom(e))},y.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},y.prototype.nodeFromJSON=function(t){return c.fromJSON(this,t)},y.prototype.markFromJSON=function(t){return u.fromJSON(this,t)},y.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e},e.Schema=y,n.exports}),t.registerDynamic("4a",["46","44"],!0,function(t,e,n){function s(t,e){if("."!=e.charAt(0))return JSON.parse(e);var n=e.slice(1);if(!t.attrs[n])throw new SyntaxError("Node type "+t.name+" has no attribute "+n);return new i(n)}function x(t,e){for(var n=[],r=0;r<e.length;r++){var o=t.marks[e[r]];if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'");n.push(o)}return n}function c(t,e,n){if(!(t instanceof i))return t;var r=e&&e[t.attr];return r!==undefined?r:n.nodeType.defaultAttrs[t.attr]}function u(t,e,n,r){return e>=c(t.min,n,r)&&e<=c(t.max,n,r)}function b(o,t,e){var i=[];return e.forEach(function(n){var r=o.nodes[n];if(r?-1==i.indexOf(r)&&i.push(r):t.forEach(function(t,e){e.group&&-1<e.group.split(" ").indexOf(n)&&(r=o.nodes[t],-1==i.indexOf(r)&&i.push(r))}),!r)throw new SyntaxError("Node type or group '"+n+"' does not exist")}),i}function k(t,e){var n=1,r=1;if(e&&("+"==e[1]?r=p:"*"==e[1]?(n=0,r=p):"?"==e[1]?n=0:e[2]&&(n=s(t,e[2]),r=e[3]?e[4]?s(t,e[4]):p:n),0==r||r<n))throw new SyntaxError("Invalid repeat count in '"+e[0]+"'");return{min:n,max:r}}function S(t,e){for(var n=e.split(/\s*,\s*/),r=Object.create(null),o=0;o<n.length;o++){var i=/^(\w+)=(\w+|\"(?:\\.|[^\\])*\"|\.\w+)$/.exec(n[o]);if(!i)throw new SyntaxError("Invalid attribute syntax: "+n[o]);r[i[1]]=s(t,i[2])}return r}var f=t("46").Fragment,l=t("44").Mark,M=function(t,e,n){this.nodeType=t,this.elements=e,this.inlineContent=n},r={isLeaf:{}};r.isLeaf.get=function(){return 0==this.elements.length},M.prototype.start=function(t){return new a(this,t,0,0)},M.prototype.atType=function(t,e,n,r){var o=this;void 0===r&&(r=l.none);for(var i=0;i<this.elements.length;i++)if(o.elements[i].matchesType(e,n,r,t,o))return new a(o,t,i,0)},M.prototype.matches=function(t,e,n,r){return this.start(t).matchToEnd(e,n,r)},M.prototype.getMatchAt=function(t,e,n){return void 0===n&&(n=e.childCount),1==this.elements.length?new a(this,t,0,n):this.start(t).matchFragment(e,0,n)},M.prototype.checkReplace=function(t,e,n,r,o,i,s){var a=this;if(void 0===o&&(o=f.empty),void 0===i&&(i=0),void 0===s&&(s=o.childCount),1==this.elements.length){var c=this.elements[0];if(!u(c,e.childCount-(r-n)+(s-i),t,this))return!1;for(var l=i;l<s;l++)if(!c.matches(o.child(l),t,a))return!1;return!0}var p=this.getMatchAt(t,e,n).matchFragment(o,i,s);return!!p&&p.matchToEnd(e,r)},M.prototype.checkReplaceWith=function(t,e,n,r,o,i,s){if(1==this.elements.length){var a=this.elements[0];return!!u(a,e.childCount-(r-n)+1,t,this)&&a.matchesType(o,i,s,t,this)}var c=this.getMatchAt(t,e,n).matchType(o,i,s);return!!c&&c.matchToEnd(e,r)},M.prototype.compatible=function(t){for(var e=this,n=0;n<this.elements.length;n++)for(var r=e.elements[n],o=0;o<t.elements.length;o++)if(t.elements[o].compatible(r))return!0;return!1},M.prototype.generateContent=function(t){return this.start(t).fillBefore(f.empty,!0)},M.parse=function(t,e,n){for(var r=[],o=0,i=null;(o+=/^\s*/.exec(e.slice(o))[0].length)!=e.length;){var s=/^(?:(\w+)|\(\s*(\w+(?:\s*\|\s*\w+)*)\s*\))/.exec(e.slice(o));if(!s)throw new SyntaxError("Invalid content expression '"+e+"' at "+o);o+=s[0].length;var a=/^\[([^\]]+)\]/.exec(e.slice(o));a&&(o+=a[0].length);var c=/^<(?:(_)|\s*(\w+(?:\s+\w+)*)\s*)>/.exec(e.slice(o));c&&(o+=c[0].length);var l=/^(?:([+*?])|\{\s*(\d+|\.\w+)\s*(,\s*(\d+|\.\w+)?)?\s*\})/.exec(e.slice(o));l&&(o+=l[0].length);for(var p=b(t.schema,n,s[1]?[s[1]]:s[2].split(/\s*\|\s*/)),u=0;u<p.length;u++)if(null==i)i=p[u].isInline;else if(i!=p[u].isInline)throw new SyntaxError("Mixing inline and block content in a single node");var f=a?S(t,a[1]):null,h=!!c&&(!!c[1]||x(t.schema,c[2].split(/\s+/))),d=k(t,l),m=d.min,v=d.max;if(0!=m&&(p[0].hasRequiredAttrs(f)||p[0].isText))throw new SyntaxError("Node type "+s[0]+" in type "+t.name+" is required, but has non-optional attributes");for(var g=new C(p,f,h,m,v),y=r.length-1;0<=y;y--){var w=r[y];if(w.min!=w.max&&w.overlaps(g))throw new SyntaxError("Possibly ambiguous overlapping adjacent content expressions in '"+e+"'");if(0!=w.min)break}r.push(g)}return new M(t,r,!!i)},Object.defineProperties(M.prototype,r),e.ContentExpr=M;var C=function(t,e,n,r,o){this.nodeTypes=t,this.attrs=e,this.marks=n,this.min=r,this.max=o};C.prototype.matchesType=function(t,e,n,r,o){var i=this;if(-1==this.nodeTypes.indexOf(t))return!1;if(this.attrs){if(!e)return!1;for(var s in i.attrs)if(e[s]!=c(i.attrs[s],r,o))return!1}if(!0===this.marks)return!0;if(!1===this.marks)return 0==n.length;for(var a=0;a<n.length;a++)if(-1==i.marks.indexOf(n[a].type))return!1;return!0},C.prototype.matches=function(t,e,n){return this.matchesType(t.type,t.attrs,t.marks,e,n)},C.prototype.compatible=function(t){for(var e=this,n=0;n<this.nodeTypes.length;n++)if(-1!=t.nodeTypes.indexOf(e.nodeTypes[n]))return!0;return!1},C.prototype.constrainedAttrs=function(t,e){var n=this;if(!this.attrs)return null;var r=Object.create(null);for(var o in n.attrs)r[o]=c(n.attrs[o],t,e);return r},C.prototype.createFiller=function(t,e){var n=this.nodeTypes[0],r=n.computeAttrs(this.constrainedAttrs(t,e));return n.create(r,n.contentExpr.generateContent(r))},C.prototype.defaultType=function(){var t=this.nodeTypes[0];if(!t.hasRequiredAttrs()&&!t.isText)return t},C.prototype.overlaps=function(e){return this.nodeTypes.some(function(t){return-1<e.nodeTypes.indexOf(t)})},C.prototype.allowsMark=function(t){return!0===this.marks||this.marks&&-1<this.marks.indexOf(t)};var a=function(t,e,n,r){this.expr=t,this.attrs=e,this.index=n,this.count=r},o={element:{},nextElement:{}};o.element.get=function(){return this.expr.elements[this.index]},o.nextElement.get=function(){for(var t=this,e=this.index,n=this.count;e<this.expr.elements.length;e++){var r=t.expr.elements[e];if(t.resolveValue(r.max)>n)return r;n=0}},a.prototype.move=function(t,e){return new a(this.expr,this.attrs,t,e)},a.prototype.resolveValue=function(t){return t instanceof i?c(t,this.attrs,this.expr):t},a.prototype.matchNode=function(t){return this.matchType(t.type,t.attrs,t.marks)},a.prototype.matchType=function(t,e,n){var r=this;void 0===n&&(n=l.none);for(var o=this,i=o.index,s=o.count;i<this.expr.elements.length;i++,s=0){var a=r.expr.elements[i];if(s<r.resolveValue(a.max)&&a.matchesType(t,e,n,r.attrs,r.expr))return s++,r.move(i,s);if(s<r.resolveValue(a.min))return null}},a.prototype.matchFragment=function(t,e,n){var r=this;if(void 0===e&&(e=0),void 0===n&&(n=t.childCount),e==n)return this;for(var o=e,i=this.expr.elements.length,s=this,a=s.index,c=s.count;a<i;a++,c=0){for(var l=r.expr.elements[a],p=r.resolveValue(l.max);c<p&&o<n&&l.matches(t.child(o),r.attrs,r.expr);)if(c++,++o==n)return r.move(a,c);if(c<r.resolveValue(l.min))return null}return!1},a.prototype.matchToEnd=function(t,e,n){var r=this.matchFragment(t,e,n);return r&&r.validEnd()||!1},a.prototype.validEnd=function(){for(var t=this,e=this.index,n=this.count;e<this.expr.elements.length;e++,n=0)if(n<t.resolveValue(t.expr.elements[e].min))return!1;return!0},a.prototype.fillBefore=function(t,e,n){for(var r=this,o=[],i=this,s=n||0,a=this.expr.elements.length;;){var c=i.matchFragment(t,s);if(c&&(!e||c.validEnd()))return f.from(o);if(!1===c)return null;var l=i.element;if(i.count<r.resolveValue(l.min))o.push(l.createFiller(r.attrs,r.expr)),i=i.move(i.index,i.count+1);else{if(!(i.index<a))return t.childCount>s?null:f.from(o);i=i.move(i.index+1,0)}}},a.prototype.possibleContent=function(){for(var t=this,e=[],n=this.index,r=this.count;n<this.expr.elements.length;n++,r=0){var o=t.expr.elements[n],i=o.constrainedAttrs(t.attrs,t.expr);if(r<t.resolveValue(o.max))for(var s=0;s<o.nodeTypes.length;s++){var a=o.nodeTypes[s];a.hasRequiredAttrs(i)||a.isText||e.push({type:a,attrs:i})}if(t.resolveValue(o.min)>r)break}return e},a.prototype.allowsMark=function(t){return this.element.allowsMark(t)},a.prototype.findWrapping=function(t,e,n){for(var r=Object.create(null),o={match:this,via:null},i=[o];i.length;){var s=i.shift(),a=s.match;if(a.matchType(t,e,n)){for(var c=[],l=s;l!=o;l=l.via)c.push({type:l.match.expr.nodeType,attrs:l.match.attrs});return c.reverse()}for(var p=a.possibleContent(),u=0;u<p.length;u++){var f=p[u],h=f.type,d=f.attrs,m=h.computeAttrs(d);h.isLeaf||h.name in r||s!=o&&!a.matchType(h,m).validEnd()||(i.push({match:h.contentExpr.start(m),via:s}),r[h.name]=!0)}}},a.prototype.findWrappingFor=function(t){return this.findWrapping(t.type,t.attrs,t.marks)},Object.defineProperties(a.prototype,o),e.ContentMatch=a;var i=function(t){this.attr=t},p=2e9;return n.exports}),t.registerDynamic("4b",[],!0,function(t,e,n){function c(t,e,n){for(var r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;var o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(var s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){var a=c(o.content,i.content,n+1);if(null!=a)return a}n+=o.nodeSize}else n+=o.nodeSize}}function f(t,e,n,r){for(var o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var s=t.child(--o),a=e.child(--i),c=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){for(var l=0,p=Math.min(s.text.length,a.text.length);l<p&&s.text[s.text.length-l-1]==a.text[a.text.length-l-1];)l++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){var u=f(s.content,a.content,n-1,r-1);if(u)return u}n-=c,r-=c}else n-=c,r-=c}}return e.findDiffStart=c,e.findDiffEnd=f,n.exports}),t.registerDynamic("46",["4b"],!0,function(t,e,n){function s(t,e){return c.index=t,c.offset=e,c}var r=t("4b"),o=r.findDiffStart,i=r.findDiffEnd,l=function(t,e){var n=this;if(this.content=t,this.size=e||0,null==e)for(var r=0;r<t.length;r++)n.size+=t[r].nodeSize},a={firstChild:{},lastChild:{},childCount:{}};l.prototype.nodesBetween=function(t,e,n,r,o){for(var i=this,s=0,a=0;a<e;s++){var c=i.content[s],l=a+c.nodeSize;if(t<l&&!1!==n(c,r+a,o,s)&&c.content.size){var p=a+1;c.nodesBetween(Math.max(0,t-p),Math.min(c.content.size,e-p),n,r+p)}a=l}},l.prototype.textBetween=function(n,r,o,i){var s="",a=!0;return this.nodesBetween(n,r,function(t,e){t.isText?(s+=t.text.slice(Math.max(n,e)-e,r-e),a=!o):t.isLeaf&&i?(s+=i,a=!o):!a&&t.isBlock&&(s+=o,a=!0)},0),s},l.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new l(r,this.size+t.size)},l.prototype.cut=function(t,e){var n=this;if(null==e&&(e=this.size),0==t&&e==this.size)return this;var r=[],o=0;if(t<e)for(var i=0,s=0;s<e;i++){var a=n.content[i],c=s+a.nodeSize;t<c&&((s<t||e<c)&&(a=a.isText?a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),r.push(a),o+=a.nodeSize),s=c}return new l(r,o)},l.prototype.cutByIndex=function(t,e){return t==e?l.empty:0==t&&e==this.content.length?this:new l(this.content.slice(t,e))},l.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new l(r,o)},l.prototype.addToStart=function(t){return new l([t].concat(this.content),this.size+t.nodeSize)},l.prototype.addToEnd=function(t){return new l(this.content.concat(t),this.size+t.nodeSize)},l.prototype.eq=function(t){var e=this;if(this.content.length!=t.content.length)return!1;for(var n=0;n<this.content.length;n++)if(!e.content[n].eq(t.content[n]))return!1;return!0},a.firstChild.get=function(){return this.content.length?this.content[0]:null},a.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},a.childCount.get=function(){return this.content.length},l.prototype.child=function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e},l.prototype.offsetAt=function(t){for(var e=this,n=0,r=0;r<t;r++)n+=e.content[r].nodeSize;return n},l.prototype.maybeChild=function(t){return this.content[t]},l.prototype.forEach=function(t){for(var e=this,n=0,r=0;n<this.content.length;n++){var o=e.content[n];t(o,r,n),r+=o.nodeSize}},l.prototype.findDiffStart=function(t,e){return void 0===e&&(e=0),o(this,t,e)},l.prototype.findDiffEnd=function(t,e,n){return void 0===e&&(e=this.size),void 0===n&&(n=t.size),i(this,t,e,n)},l.prototype.findIndex=function(t,e){var n=this;if(void 0===e&&(e=-1),0==t)return s(0,t);if(t==this.size)return s(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var r=0,o=0;;r++){var i=o+n.child(r).nodeSize;if(t<=i)return i==t||0<e?s(r+1,i):s(r,o);o=i}},l.prototype.toString=function(){return"<"+this.toStringInner()+">"},l.prototype.toStringInner=function(){return this.content.join(", ")},l.prototype.toJSON=function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null},l.fromJSON=function(t,e){return e?new l(e.map(t.nodeFromJSON)):l.empty},l.fromArray=function(t){if(!t.length)return l.empty;for(var e,n=0,r=0;r<t.length;r++){var o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new l(e||t,n)},l.from=function(t){return t?t instanceof l?t:Array.isArray(t)?this.fromArray(t):new l([t],t.nodeSize):l.empty},Object.defineProperties(l.prototype,a),e.Fragment=l;var c={index:0,offset:0};return l.empty=new l([],0),n.exports}),t.registerDynamic("47",["46"],!0,function(t,e,n){function p(t,e,n){var r=t.findIndex(e),o=r.index,i=r.offset,s=t.maybeChild(o),a=t.findIndex(n),c=a.index,l=a.offset;if(i==e||s.isText){if(l!=n&&!t.child(c).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(o!=c)throw new RangeError("Removing non-flat range");return t.replaceChild(o,s.copy(p(s.content,e-i-1,n-i-1)))}function l(t,e,n,r){var o=t.findIndex(e),i=o.index,s=o.offset,a=t.maybeChild(i);if(s==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));var c=l(a.content,e-s-1,n);return c&&t.replaceChild(i,a.copy(c))}function r(t,e,n){if(n.openLeft>t.depth)throw new o("Inserted content deeper than insertion position");if(t.depth-n.openLeft!=e.depth-n.openRight)throw new o("Inconsistent open depths");return u(t,e,n,0)}function u(t,e,n,r){var o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openLeft){var s=u(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openLeft||n.openRight||t.depth!=r||e.depth!=r){var a=y(n,t);return m(i,v(t,a.start,a.end,e,r))}var c=t.parent,l=c.content;return m(c,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}return m(i,g(t,e,r))}function c(t,e){if(!e.type.compatibleContent(t.type))throw new o("Cannot join "+e.type.name+" onto "+t.type.name)}function f(t,e,n){var r=t.node(n);return c(r,e.node(n)),r}function h(t,e){var n=e.length-1;0<=n&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function d(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(h(t.nodeAfter,r),i++));for(var a=i;a<s;a++)h(o.child(a),r);e&&e.depth==n&&e.textOffset&&h(e.nodeBefore,r)}function m(t,e){if(!t.type.validContent(e,t.attrs))throw new o("Invalid content for node "+t.type.name);return t.copy(e)}function v(t,e,n,r,o){var i=t.depth>o&&f(t,e,o+1),s=r.depth>o&&f(n,r,o+1),a=[];return d(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(c(i,s),h(m(i,v(t,e,n,r,o+1)),a)):(i&&h(m(i,g(t,e,o+1)),a),d(e,n,o,a),s&&h(m(s,g(n,r,o+1)),a)),d(r,null,o,a),new w(a)}function g(t,e,n){var r=[];(d(null,t,n,r),t.depth>n)&&h(m(f(t,e,n+1),g(t,e,n+1)),r);return d(e,null,n,r),new w(r)}function y(t,e){for(var n=e.depth-t.openLeft,r=e.node(n).copy(t.content),o=n-1;0<=o;o--)r=e.node(o).copy(w.from(r));return{start:r.resolveNoCache(t.openLeft+n),end:r.resolveNoCache(r.content.size-t.openRight-n)}}var w=t("46").Fragment,o=function(e){function t(t){e.call(this,t),this.message=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t}(Error);e.ReplaceError=o;var i=function(t,e,n){this.content=t,this.openLeft=e,this.openRight=n},s={size:{}};return s.size.get=function(){return this.content.size-this.openLeft-this.openRight},i.prototype.insertAt=function(t,e){var n=l(this.content,t+this.openLeft,e,null);return n&&new i(n,this.openLeft,this.openRight)},i.prototype.removeBetween=function(t,e){return new i(p(this.content,t+this.openLeft,e+this.openLeft),this.openLeft,this.openRight)},i.prototype.eq=function(t){return this.content.eq(t.content)&&this.openLeft==t.openLeft&&this.openRight==t.openRight},i.prototype.toString=function(){return this.content+"("+this.openLeft+","+this.openRight+")"},i.prototype.toJSON=function(){return this.content.size?{content:this.content.toJSON(),openLeft:this.openLeft,openRight:this.openRight}:null},i.fromJSON=function(t,e){return e?new i(w.fromJSON(t,e.content),e.openLeft,e.openRight):i.empty},i.maxOpen=function(t){for(var e=0,n=0,r=t.firstChild;r&&!r.isLeaf;r=r.firstChild)e++;for(var o=t.lastChild;o&&!o.isLeaf;o=o.lastChild)n++;return new i(t,e,n)},Object.defineProperties(i.prototype,s),(e.Slice=i).empty=new i(w.empty,0,0),e.replace=r,n.exports}),t.registerDynamic("48",[],!0,function(t,e,n){function s(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!s(t[r],e[r]))return!1}else{for(var o in t)if(!(o in e&&s(t[o],e[o])))return!1;for(var i in e)if(!(i in t))return!1}return!0}return e.compareDeep=s,n.exports}),t.registerDynamic("44",["48"],!0,function(t,e,n){var r=t("48").compareDeep,o=function(t,e){this.type=t,this.attrs=e};return o.prototype.addToSet=function(t){for(var e=this,n=0;n<t.length;n++){var r=t[n];if(r.type==e.type){if(e.eq(r))return t;var o=t.slice();return o[n]=e,o}if(r.type.rank>e.type.rank)return t.slice(0,n).concat(e).concat(t.slice(n))}return t.concat(this)},o.prototype.removeFromSet=function(t){for(var e=this,n=0;n<t.length;n++)if(e.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t},o.prototype.isInSet=function(t){for(var e=this,n=0;n<t.length;n++)if(e.eq(t[n]))return!0;return!1},o.prototype.eq=function(t){return this==t||this.type==t.type&&!!r(t.attrs,this.attrs)},o.prototype.toJSON=function(){var t=this,e={type:this.type.name};for(var n in t.attrs){e.attrs=t.attrs;break}return e},o.fromJSON=function(t,e){return t.marks[e.type].create(e.attrs)},o.sameSet=function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0},o.setFrom=function(t){if(!t||0==t.length)return o.none;if(t instanceof o)return[t];var e=t.slice();return e.sort(function(t,e){return t.type.rank-e.type.rank}),e},(e.Mark=o).none=[],n.exports}),t.registerDynamic("4c",["46","47","44"],!0,function(t,e,n){function o(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&h.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}function i(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function r(t){for(
8
- var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];e=n.exec(t);)r.push(e[1],e[2].trim());return r}function a(t){var e={};for(var n in t)e[n]=t[n];return e}var s=t("46").Fragment,c=t("47").Slice,l=t("44").Mark,p=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach(function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})};p.prototype.parse=function(t,e){void 0===e&&(e={});var n=new g(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},p.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new g(this,e,!0);return n.addAll(t,null,e.from,e.to),c.maxOpen(n.finish())},p.prototype.matchTag=function(t){for(var e=this,n=0;n<this.tags.length;n++){var r=e.tags[n];if(i(t,r.tag)){if(r.getAttrs){var o=r.getAttrs(t);if(!1===o)continue;r.attrs=o}return r}}},p.prototype.matchStyle=function(t,e){for(var n=this,r=0;r<this.styles.length;r++){var o=n.styles[r];if(o.style==t){if(o.getAttrs){var i=o.getAttrs(e);if(!1===i)continue;o.attrs=i}return o}}},p.schemaRules=function(n){function r(t){for(var e=null==t.priority?50:t.priority,n=0;n<o.length;n++){var r=o[n];if((null==r.priority?50:r.priority)<e)break}o.splice(n,0,t)}var o=[],t=function(e){var t=n.marks[e].spec.parseDOM;t&&t.forEach(function(t){r(t=a(t)),t.mark=e})};for(var e in n.marks)t(e);var i=function(){var t=n.nodes[s].spec.parseDOM;t&&t.forEach(function(t){r(t=a(t)),t.node=s})};for(var s in n.nodes)i(e);return o},p.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new p(t,p.schemaRules(t)))},e.DOMParser=p;var 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},f={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},h={ol:!0,ul:!0},d=1,m=2,v=function(t,e,n,r,o){this.type=t,this.attrs=e,this.solid=n,this.match=r||(o&m?null:t.contentExpr.start(e)),this.options=o,this.content=[]};v.prototype.findWrapping=function(t,e){if(!this.match){if(!this.type)return[];var n=this.type.contentExpr.atType(this.attrs,t,e);if(!n){var r,o=this.type.contentExpr.start(this.attrs);if(r=o.findWrapping(t,e))return this.match=o,r}if(!n)return null;this.match=n}return this.match.findWrapping(t,e)},v.prototype.finish=function(t){if(!(this.options&d)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/\s+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=s.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(s.empty,!0))),this.type?this.type.create(this.attrs,r):r};var g=function(t,e,n){this.parser=t,this.options=e,this.isOpen=n;var r,o=e.topNode,i=(e.preserveWhitespace?d:0)|(n?m:0);r=o?new v(o.type,o.attrs,!0,o.contentMatchAt(e.topStart||0),i):new v(n?null:t.schema.nodes.doc,null,!0,null,i),this.nodes=[r],this.marks=l.none,this.open=0,this.find=e.findPositions},y={top:{},currentPos:{}};return y.top.get=function(){return this.nodes[this.open]},g.prototype.addMark=function(t){var e=this.marks;return this.marks=t.addToSet(this.marks),e},g.prototype.addDOM=function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style");e?this.addElementWithStyles(r(e),t):this.addElement(t)}},g.prototype.addTextNode=function(t){var e=t.nodeValue,n=this.top;if(n.type&&n.type.isTextblock||/\S/.test(e)){if(!(n.options&d)&&(e=e.replace(/\s+/g," "),/^\s/.test(e))){var r=n.content[n.content.length-1];(!r||r.isText&&/\s$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e,this.marks)),this.findInText(t)}else this.findInside(t)},g.prototype.addElement=function(t){var e=t.nodeName.toLowerCase();h.hasOwnProperty(e)&&o(t);var n=this.options.ruleFromNode&&this.options.ruleFromNode(t)||this.parser.matchTag(t);if(n?n.ignore:f.hasOwnProperty(e))this.findInside(t);else if(!n||n.skip){n&&n.skip.nodeType&&(t=n.skip);var r=u.hasOwnProperty(e)&&this.top;this.addAll(t),r&&this.sync(r)}else this.addElementByRule(t,n)},g.prototype.addElementWithStyles=function(t,e){for(var n=this,r=this.marks,o=!1,i=0;i<t.length;i+=2){var s=n.parser.matchStyle(t[i],t[i+1]);if(s){if(s.ignore){o=!0;break}n.addMark(n.parser.schema.marks[s.mark].create(s.attrs))}}o||this.addElement(e),this.marks=r},g.prototype.addElementByRule=function(t,e){var n,r,o,i,s,a=this;if(e.node?(o=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(o.create(e.attrs,null,this.marks)):n=this.enter(o,e.attrs,e.preserveWhitespace)&&this.top:(i=this.parser.schema.marks[e.mark],r=this.addMark(s=i.create(e.attrs))),o&&o.isLeaf)this.findInside(t);else if(e.getContent)this.findInside(t),e.getContent(t).forEach(function(t){return a.insertNode(s?t.mark(s.addToSet(t.marks)):t)});else{var c=e.contentElement;"string"==typeof c&&(c=t.querySelector(c)),c||(c=t),this.findAround(t,c,!0),this.addAll(c,n),n?(this.sync(n),this.open--):r&&(this.marks=r),this.findAround(t,c,!0)}return!0},g.prototype.addAll=function(t,e,n,r){for(var o=this,i=n||0,s=n?t.childNodes[n]:t.firstChild,a=null==r?null:t.childNodes[r];s!=a;s=s.nextSibling,++i)o.findAtPoint(t,i),o.addDOM(s),e&&u.hasOwnProperty(s.nodeName.toLowerCase())&&o.sync(e);this.findAtPoint(t,i)},g.prototype.findPlace=function(t,e){for(var n,r,o=this,i=this.open;0<=i;i--){var s=o.nodes[i],a=s.findWrapping(t,e);if(a&&(!n||n.length>a.length)&&(r=s,!(n=a).length))break;if(s.solid)break}if(!n)return!1;this.sync(r);for(var c=0;c<n.length;c++)o.enterInner(n[c].type,n[c].attrs,!1);return!0},g.prototype.insertNode=function(t){if(this.findPlace(t.type,t.attrs)){this.closeExtra();var e=this.top;if(e.match){var n=e.match.matchNode(t);n||(t=t.mark(t.marks.filter(function(t){return e.match.allowsMark(t.type)})),n=e.match.matchNode(t)),e.match=n}e.content.push(t)}},g.prototype.enter=function(t,e,n){var r=this.findPlace(t,e);return r&&this.enterInner(t,e,!0,n),r},g.prototype.enterInner=function(t,e,n,r){this.closeExtra();var o=this.top;o.match=o.match&&o.match.matchType(t,e);var i=null==r?o.options&d:r?d:0;o.options&m&&0==o.content.length&&(i|=m),this.nodes.push(new v(t,e,n,null,i)),this.open++},g.prototype.closeExtra=function(t){var e=this,n=this.nodes.length-1;if(n>this.open){for(this.marks=l.none;n>this.open;n--)e.nodes[n-1].content.push(e.nodes[n].finish(t));this.nodes.length=this.open+1}},g.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},g.prototype.sync=function(t){for(var e=this,n=this.open;0<=n;n--)if(e.nodes[n]==t)return void(e.open=n)},y.currentPos.get=function(){var t=this;this.closeExtra();for(var e=0,n=this.open;0<=n;n--){for(var r=t.nodes[n].content,o=r.length-1;0<=o;o--)e+=r[o].nodeSize;n&&e++}return e},g.prototype.findAtPoint=function(t,e){var n=this;if(this.find)for(var r=0;r<this.find.length;r++)n.find[r].node==t&&n.find[r].offset==e&&(n.find[r].pos=n.currentPos)},g.prototype.findInside=function(t){var e=this;if(this.find)for(var n=0;n<this.find.length;n++)null==e.find[n].pos&&t.contains(e.find[n].node)&&(e.find[n].pos=e.currentPos)},g.prototype.findAround=function(t,e,n){var r=this;if(t!=e&&this.find)for(var o=0;o<this.find.length;o++){if(null==r.find[o].pos&&t.contains(r.find[o].node))e.compareDocumentPosition(r.find[o].node)&(n?2:4)&&(r.find[o].pos=r.currentPos)}},g.prototype.findInText=function(t){var e=this;if(this.find)for(var n=0;n<this.find.length;n++)e.find[n].node==t&&(e.find[n].pos=e.currentPos-(t.nodeValue.length-e.find[n].offset))},Object.defineProperties(g.prototype,y),n.exports}),t.registerDynamic("4d",[],!0,function(t,e,n){function r(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function a(t){return t.document||window.document}var f=function(t,e){this.nodes=t||{},this.marks=e||{}};return f.prototype.serializeFragment=function(t,r,e){var o=this;void 0===r&&(r={}),e||(e=a(r).createDocumentFragment());var i=e,s=null;return t.forEach(function(t){if(s||t.marks.length){s||(s=[]);for(var e=0;e<Math.min(s.length,t.marks.length)&&t.marks[e].eq(s[e]);++e);for(;e<s.length;)s.pop(),i=i.parentNode;for(;s.length<t.marks.length;){var n=t.marks[s.length];s.push(n),i=i.appendChild(o.serializeMark(n,r))}}i.appendChild(o.serializeNode(t,r))}),e},f.prototype.serializeNode=function(t,e){return void 0===e&&(e={}),this.renderStructure(this.nodes[t.type.name](t),t,e)},f.prototype.serializeNodeAndMarks=function(t,e){var n=this;void 0===e&&(e={});for(var r=this.serializeNode(t,e),o=t.marks.length-1;0<=o;o--){var i=n.serializeMark(t.marks[o],e);i.appendChild(r),r=i}return r},f.prototype.serializeMark=function(t,e){return void 0===e&&(e={}),this.renderStructure(this.marks[t.type.name](t),null,e)},f.renderSpec=function(t,e){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};var n=t.createElement(e[0]),r=null,o=e[1],i=1;if(o&&"object"==typeof o&&null==o.nodeType&&!Array.isArray(o))for(var s in i=2,o)"style"==s?n.style.cssText=o[s]:null!=o[s]&&n.setAttribute(s,o[s]);for(var a=i;a<e.length;a++){var c=e[a];if(0===c){if(a<e.length-1||i<a)throw new RangeError("Content hole must be the only child of its parent node");return{dom:n,contentDOM:n}}var l=f.renderSpec(t,c),p=l.dom,u=l.contentDOM;if(n.appendChild(p),u){if(r)throw new RangeError("Multiple content holes");r=u}}return{dom:n,contentDOM:r}},f.prototype.renderStructure=function(t,e,n){var r=f.renderSpec(a(n),t),o=r.dom,i=r.contentDOM;if(e&&!e.isLeaf){if(!i)throw new RangeError("No content hole in template for non-leaf node");n.onContent?n.onContent(e,i,n):this.serializeFragment(e.content,n,i)}else if(i)throw new RangeError("Content hole not allowed in a mark or leaf node spec");return o},f.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new f(this.nodesFromSchema(t),this.marksFromSchema(t)))},f.nodesFromSchema=function(t){return r(t.nodes)},f.marksFromSchema=function(t){return r(t.marks)},e.DOMSerializer=f,n.exports}),t.registerDynamic("4e",["45","43","46","47","44","49","4a","4c","4d"],!0,function(t,e,n){var r,o,i,s;return e.Node=t("45").Node,r=t("43"),e.ResolvedPos=r.ResolvedPos,e.NodeRange=r.NodeRange,e.Fragment=t("46").Fragment,o=t("47"),e.Slice=o.Slice,e.ReplaceError=o.ReplaceError,e.Mark=t("44").Mark,i=t("49"),e.Schema=i.Schema,e.NodeType=i.NodeType,e.MarkType=i.MarkType,s=t("4a"),e.ContentMatch=s.ContentMatch,e.DOMParser=t("4c").DOMParser,e.DOMSerializer=t("4d").DOMSerializer,n.exports}),t.registerDynamic("3",["4e"],!0,function(t,e,n){return n.exports=t("4e"),n.exports}),t.registerDynamic("4f",["9","3"],!0,function(t,e,n){function r(t,e){var n={};for(var r in t)n[r]=t[r];for(var o in e)n[o]=e[o];return n}function o(t,e,n){return t.append({ordered_list:r(w,{content:"list_item+",group:n}),bullet_list:r(x,{content:"list_item+",group:n}),list_item:r(b,{content:e})})}function i(p,u){return function(t,e){var n=t.selection,r=n.$from,o=n.$to,i=r.blockRange(o),s=!1,a=i;if(2<=i.depth&&r.node(i.depth-1).type.compatibleContent(p)&&0==i.startIndex){if(0==r.index(i.depth-1))return!1;var c=t.doc.resolve(i.start-2);a=new d(c,c,i.depth),i.endIndex<i.parent.childCount&&(i=new d(r,t.doc.resolve(o.end(i.depth)),i.depth)),s=!0}var l=h(a,p,u,i);return!!l&&(e&&e(f(t.tr,i,l,s,p).scrollIntoView()),!0)}}function f(t,e,n,r,o){for(var i=y.empty,s=n.length-1;0<=s;s--)i=y.from(n[s].type.create(n[s].attrs,i));t.step(new v(e.start-(r?2:0),e.end,e.start,e.end,new g(i,0,0),n.length,!0));for(var a=0,c=0;c<n.length;c++)n[c].type==o&&(a=c+1);for(var l=n.length-a,p=e.start+n.length-(r?2:0),u=e.parent,f=e.startIndex,h=e.endIndex,d=!0;f<h;f++,d=!1)!d&&m(t.doc,p,l)&&t.split(p,l),p+=u.child(f).nodeSize+(d?0:2*l);return t}function s(p){return function(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.node;if(i&&i.isBlock||!r.parent.content.size||r.depth<2||!r.sameParent(o))return!1;var s=r.node(-1);if(s.type!=p)return!1;var a=o.pos==r.end()?s.defaultContentType(r.indexAfter(-1)):null,c=t.tr["delete"](r.pos,o.pos),l=a&&[null,{type:a}];return!!m(c.doc,r.pos,2,l)&&(e&&e(c.split(r.pos,2,l).scrollIntoView()),!0)}}function a(l){return function(t,e){var n=t.selection,r=n.$from,o=n.$to,i=r.blockRange(o,function(t){return t.childCount&&t.firstChild.type==l});if(!i||i.depth<2||r.node(i.depth-1).type!=l)return!1;if(e){var s=t.tr,a=i.end,c=o.end(i.depth);a<c&&(s.step(new v(a-1,c,a,c,new g(y.from(l.create(null,i.parent.copy())),1,0),1,!0)),i=new d(s.doc.resolveNoCache(r.pos),s.doc.resolveNoCache(c),i.depth)),e(s.lift(i,p(i)).scrollIntoView())}return!0}}function c(d){return function(t,e){var n=t.selection,r=n.$from,o=n.$to,i=r.blockRange(o,function(t){return t.childCount&&t.firstChild.type==d});if(!i)return!1;var s=i.startIndex;if(0==s)return!1;var a=i.parent,c=a.child(s-1);if(c.type!=d)return!1;if(e){var l=c.lastChild&&c.lastChild.type==a.type,p=y.from(l?d.create():null),u=new g(y.from(d.create(null,y.from(a.copy(p)))),l?3:1,0),f=i.start,h=i.end;e(t.tr.step(new v(f-(l?3:1),h,f,h,u,1,!0)).scrollIntoView())}return!0}}var l=t("9"),h=l.findWrapping,p=l.liftTarget,m=l.canSplit,v=l.ReplaceAroundStep,u=t("3"),g=u.Slice,y=u.Fragment,d=u.NodeRange,w={attrs:{order:{"default":1}},parseDOM:[{tag:"ol",getAttrs:function k(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM:function S(t){return["ol",{start:1==t.attrs.order?null:t.attrs.order},0]}};e.orderedList=w;var x={parseDOM:[{tag:"ul"}],toDOM:function S(){return["ul",0]}};e.bulletList=x;var b={parseDOM:[{tag:"li"}],toDOM:function S(){return["li",0]},defining:!0};return e.listItem=b,e.addListNodes=o,e.wrapInList=i,e.splitListItem=s,e.liftListItem=a,e.sinkListItem=c,n.exports}),t.registerDynamic("2a",["4f"],!0,function(t,e,n){return n.exports=t("4f"),n.exports}),t.register("50",["3","4","7","11","26","37","2a"],function(t){"use strict";function e(t){return h[t]}function n(t){var e=h[t],n=s.fromSchema(f).serializeFragment(e.editor.state.doc.content),r=document.createElement("div");return r.appendChild(n),r.innerHTML}function r(e){var t=document.getElementById(e);return h[e]=new l(t,{floatingMenu:!0,state:c.create({doc:d(t),plugins:p({schema:f})}),onAction:function n(t){h[e].updateState(h[e].editor.state.applyAction(t))}}),h[e]}var o,i,s,a,c,l,p,u,f,h,d;return t("getProseMirror",e),t("getPMContent",n),t("createProseMirror",r),{setters:[function(t){o=t.Schema,i=t.DOMParser,s=t.DOMSerializer},function(t){a=t.schema},function(t){c=t.EditorState},function(t){t.EditorView},function(t){l=t.MenuBarEditorView},function(t){p=t.exampleSetup,t.buildMenuItems},function(t){u=t.addListNodes}],execute:function(){f=new o({nodes:u(a.nodeSpec,"paragraph block*","block"),marks:a.markSpec}),h={},d=function r(t){var e=$(t).find(".d0-card-content").val(),n=document.createElement("div");return n.innerHTML=e,i.fromSchema(f).parse(n)}}}}),t.registerDynamic("1",["50"],!0,function(t,e,n){return pm=t("50"),createProseMirror=pm.createProseMirror,getProseMirror=pm.getProseMirror,getProseMirrorContent=pm.getPMContent,n.exports})})(function(t){t()});
9
- // script_prosemirror_config.js.coffee
10
- (function(){var r;decko.addEditor(".prosemirror-editor",function(){return decko.initProseMirror(this[0].id)},function(){return r(this[0].id)}),$.extend(decko,{setProseMirrorConfig:function(o){var r;return r=function(){try{return $.parseJSON(o)}catch(r){return{}}},decko.proseMirrorConfig=r()},initProseMirror:function(r){var o,e,n;return o={menuBar:!0,tooltipMenu:!1},e={docFormat:"html"},n=null!=decko.proseMirrorConfig?decko.proseMirrorConfig:{},$.extend(o,n,e),createProseMirror(r,o)}}),r=function(r){var o;return"<p></p>"===(o=getProseMirrorContent(r))?"":o}}).call(this);
@@ -1,298 +0,0 @@
1
- /*-- ProseMirror color variables */
2
-
3
- $pm-yellow-1: #cc7;
4
- $pm-yellow-2: #ffc;
5
- $pm-grey-1: $gray-200;
6
- $pm-grey-2: $gray-300;
7
- $pm-grey-3: $gray-400;
8
- $pm-grey-5: $gray-600;
9
- $pm-cyan: $cyan;
10
-
11
- .ProseMirror {
12
- position: relative;
13
- }
14
-
15
- .ProseMirror {
16
- white-space: pre-wrap;
17
- }
18
-
19
- .ProseMirror ul, .ProseMirror ol {
20
- padding-left: 30px;
21
- cursor: default;
22
- }
23
-
24
- .ProseMirror blockquote {
25
- padding-left: 1em;
26
- border-left: 3px solid $gray-300;
27
- margin-left: 0; margin-right: 0;
28
- }
29
-
30
- .ProseMirror pre {
31
- white-space: pre-wrap;
32
- }
33
-
34
- .ProseMirror li {
35
- position: relative;
36
- pointer-events: none; /* Don't do weird stuff with marker clicks */
37
- }
38
- .ProseMirror li > * {
39
- pointer-events: auto;
40
- }
41
-
42
- .ProseMirror-nodeselection *::selection, .ProseMirror-widget *::selection { background: transparent; }
43
- .ProseMirror-nodeselection *::-moz-selection, .ProseMirror-widget *::-moz-selection { background: transparent; }
44
-
45
- .ProseMirror-selectednode {
46
- outline: 2px solid $pm-cyan;
47
- }
48
-
49
- /* Make sure li selections wrap around markers */
50
-
51
- li.ProseMirror-selectednode {
52
- outline: none;
53
- }
54
-
55
- li.ProseMirror-selectednode:after {
56
- content: "";
57
- position: absolute;
58
- left: -32px;
59
- right: -2px; top: -2px; bottom: -2px;
60
- border: 2px solid $pm-cyan;
61
- pointer-events: none;
62
- }
63
-
64
-
65
- .ProseMirror-textblock-dropdown {
66
- min-width: 3em;
67
- }
68
-
69
- .ProseMirror-menu {
70
- margin: 0 -4px;
71
- line-height: 1;
72
- }
73
-
74
- .ProseMirror-tooltip .ProseMirror-menu {
75
- width: -webkit-fit-content;
76
- width: fit-content;
77
- white-space: pre;
78
- }
79
-
80
- .ProseMirror-menuitem {
81
- margin-right: 3px;
82
- display: inline-block;
83
- }
84
-
85
- .ProseMirror-menuseparator {
86
- border-right: 1px solid $pm-grey-3;
87
- margin-right: 3px;
88
- }
89
-
90
- .ProseMirror-menu-dropdown, .ProseMirror-menu-dropdown-menu {
91
- font-size: 90%;
92
- white-space: nowrap;
93
- }
94
-
95
- .ProseMirror-menu-dropdown {
96
- vertical-align: 1px;
97
- cursor: pointer;
98
- }
99
-
100
- .ProseMirror-menu-dropdown-wrap {
101
- padding: 1px 14px 1px 4px;
102
- display: inline-block;
103
- position: relative;
104
- }
105
-
106
- .ProseMirror-menu-dropdown:after {
107
- content: "";
108
- border-left: 4px solid transparent;
109
- border-right: 4px solid transparent;
110
- border-top: 4px solid currentColor;
111
- opacity: .6;
112
- position: absolute;
113
- right: 2px;
114
- top: calc(50% - 2px);
115
- }
116
-
117
- .ProseMirror-menu-dropdown-menu, .ProseMirror-menu-submenu {
118
- position: absolute;
119
- background: white;
120
- color: $pm-grey-5;
121
- border: 1px solid #aaa;
122
- padding: 2px;
123
- }
124
-
125
- .ProseMirror-menu-dropdown-menu {
126
- z-index: 15;
127
- min-width: 6em;
128
- }
129
-
130
- .ProseMirror-menu-dropdown-item {
131
- cursor: pointer;
132
- padding: 2px 8px 2px 4px;
133
- }
134
-
135
- .ProseMirror-menu-dropdown-item:hover {
136
- background: $pm-grey-1;
137
- }
138
-
139
- .ProseMirror-menu-submenu-wrap {
140
- position: relative;
141
- margin-right: -4px;
142
- }
143
-
144
- .ProseMirror-menu-submenu-label:after {
145
- content: "";
146
- border-top: 4px solid transparent;
147
- border-bottom: 4px solid transparent;
148
- border-left: 4px solid currentColor;
149
- opacity: .6;
150
- position: absolute;
151
- right: 4px;
152
- top: calc(50% - 4px);
153
- }
154
-
155
- .ProseMirror-menu-submenu {
156
- display: none;
157
- min-width: 4em;
158
- left: 100%;
159
- top: -3px;
160
- }
161
-
162
- .ProseMirror-menu-active {
163
- background: $pm-grey-2;
164
- border-radius: 4px;
165
- }
166
-
167
- .ProseMirror-menu-active {
168
- background: $pm-grey-2;
169
- border-radius: 4px;
170
- }
171
-
172
- .ProseMirror-menu-disabled {
173
- opacity: .3;
174
- }
175
-
176
- .ProseMirror-menu-submenu-wrap:hover .ProseMirror-menu-submenu, .ProseMirror-menu-submenu-wrap-active .ProseMirror-menu-submenu {
177
- display: block;
178
- }
179
-
180
- .ProseMirror-menubar {
181
- border-top-left-radius: inherit;
182
- border-top-right-radius: inherit;
183
- position: relative;
184
- min-height: 1em;
185
- color: $pm-grey-5;
186
- padding: 1px 6px;
187
- top: 0; left: 0; right: 0;
188
- border-bottom: 1px solid silver;
189
- background: white;
190
- z-index: 10;
191
- -moz-box-sizing: border-box;
192
- box-sizing: border-box;
193
- overflow: visible;
194
- }
195
-
196
- .ProseMirror-icon {
197
- display: inline-block;
198
- line-height: .8;
199
- vertical-align: -2px; /* Compensate for padding */
200
- padding: 2px 8px;
201
- cursor: pointer;
202
- }
203
-
204
- .ProseMirror-icon svg {
205
- fill: currentColor;
206
- height: 1em;
207
- }
208
-
209
- .ProseMirror-icon span {
210
- vertical-align: text-top;
211
- }
212
-
213
-
214
-
215
- /* Add space around the hr to make clicking it easier */
216
-
217
- .ProseMirror-example-setup-style hr {
218
- position: relative;
219
- height: 6px;
220
- border: none;
221
- }
222
-
223
- .ProseMirror-example-setup-style hr:after {
224
- content: "";
225
- position: absolute;
226
- left: 10px;
227
- right: 10px;
228
- top: 2px;
229
- border-top: 2px solid silver;
230
- }
231
-
232
- .ProseMirror-example-setup-style img {
233
- cursor: default;
234
- }
235
-
236
- .ProseMirror-example-setup-style table {
237
- border-collapse: collapse;
238
- }
239
-
240
- .ProseMirror-example-setup-style td {
241
- vertical-align: top;
242
- border: 1px solid $pm-grey-3;
243
- padding: 3px 5px;
244
- }
245
-
246
- .ProseMirror-prompt {
247
- background: white;
248
- padding: 5px 10px 5px 15px;
249
- border: 1px solid silver;
250
- position: fixed;
251
- border-radius: 3px;
252
- z-index: 11;
253
- box-shadow: -.5px 2px 5px rgba(0, 0, 0, .2);
254
- }
255
-
256
- .ProseMirror-prompt h5 {
257
- margin: 0;
258
- font-weight: normal;
259
- font-size: 100%;
260
- color: #444;
261
- }
262
-
263
- .ProseMirror-prompt input[type="text"],
264
- .ProseMirror-prompt textarea {
265
- background: $pm-grey-2;
266
- border: none;
267
- outline: none;
268
- }
269
-
270
- .ProseMirror-prompt input[type="text"] {
271
- padding: 0 4px;
272
- }
273
-
274
- .ProseMirror-prompt-close {
275
- position: absolute;
276
- left: 2px; top: 1px;
277
- color: $pm-grey-5;
278
- border: none; background: transparent; padding: 0;
279
- }
280
-
281
- .ProseMirror-prompt-close:after {
282
- content: "✕";
283
- font-size: 12px;
284
- }
285
-
286
- .ProseMirror-invalid {
287
- background: $pm-yellow-2;
288
- border: 1px solid $pm-yellow-1;
289
- border-radius: 4px;
290
- padding: 5px 10px;
291
- position: absolute;
292
- min-width: 10em;
293
- }
294
-
295
- .ProseMirror-prompt-buttons {
296
- margin-top: 5px;
297
- display: none;
298
- }
@@ -1,3 +0,0 @@
1
- include_set Abstract::CodeFile
2
-
3
- basket[:style_mods] << :style_prosemirror