@bigbinary/neeto-editor 0.3.22 → 0.3.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/index.js +1 -1
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -73,4 +73,4 @@ function dc(e,t){if(!e)throw new Error(t)}const cc=Object(p.createContext)(null)
73
73
  *
74
74
  * Licensed under the MIT license.
75
75
  */
76
- var Eg="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function yg(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){i(window.event)}))}function Dg(e,t){for(var i=t.slice(0,t.length-1),n=0;n<i.length;n++)i[n]=e[i[n].toLowerCase()];return i}function vg(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),i=t.lastIndexOf("");i>=0;)t[i-1]+=",",t.splice(i,1),i=t.lastIndexOf("");return t}for(var kg={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Eg?173:189,"=":Eg?61:187,";":Eg?59:186,"'":222,"[":219,"]":221,"\\":220},Sg={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},wg={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Cg={16:!1,18:!1,17:!1,91:!1},xg={},Tg=1;Tg<20;Tg++)kg["f".concat(Tg)]=111+Tg;var Og=[],Ng="all",Ag=[],Rg=function(e){return kg[e.toLowerCase()]||Sg[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Mg(e){Ng=e||"all"}function Ig(){return Ng||"all"}var Bg=function(e){var t=e.key,i=e.scope,n=e.method,a=e.splitKey,r=void 0===a?"+":a;vg(t).forEach((function(e){var t=e.split(r),a=t.length,o=t[a-1],s="*"===o?"*":Rg(o);if(xg[s]){i||(i=Ig());var l=a>1?Dg(Sg,t):[];xg[s]=xg[s].map((function(e){return(!n||e.method===n)&&e.scope===i&&function(e,t){for(var i=e.length>=t.length?e:t,n=e.length>=t.length?t:e,a=!0,r=0;r<i.length;r++)-1===n.indexOf(i[r])&&(a=!1);return a}(e.mods,l)?{}:e}))}}))};function Lg(e,t,i){var n;if(t.scope===i||"all"===t.scope){for(var a in n=t.mods.length>0,Cg)Object.prototype.hasOwnProperty.call(Cg,a)&&(!Cg[a]&&t.mods.indexOf(+a)>-1||Cg[a]&&-1===t.mods.indexOf(+a))&&(n=!1);(0!==t.mods.length||Cg[16]||Cg[18]||Cg[17]||Cg[91])&&!n&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Pg(e){var t=xg["*"],i=e.keyCode||e.which||e.charCode;if(jg.filter.call(this,e)){if(93!==i&&224!==i||(i=91),-1===Og.indexOf(i)&&229!==i&&Og.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var i=wg[t];e[t]&&-1===Og.indexOf(i)?Og.push(i):!e[t]&&Og.indexOf(i)>-1?Og.splice(Og.indexOf(i),1):"metaKey"===t&&e[t]&&3===Og.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Og=Og.slice(Og.indexOf(i))))})),i in Cg){for(var n in Cg[i]=!0,Sg)Sg[n]===i&&(jg[n]=!0);if(!t)return}for(var a in Cg)Object.prototype.hasOwnProperty.call(Cg,a)&&(Cg[a]=e[wg[a]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Og.indexOf(17)&&Og.push(17),-1===Og.indexOf(18)&&Og.push(18),Cg[17]=!0,Cg[18]=!0);var r=Ig();if(t)for(var o=0;o<t.length;o++)t[o].scope===r&&("keydown"===e.type&&t[o].keydown||"keyup"===e.type&&t[o].keyup)&&Lg(e,t[o],r);if(i in xg)for(var s=0;s<xg[i].length;s++)if(("keydown"===e.type&&xg[i][s].keydown||"keyup"===e.type&&xg[i][s].keyup)&&xg[i][s].key){for(var l=xg[i][s],u=l.splitKey,_=l.key.split(u),d=[],c=0;c<_.length;c++)d.push(Rg(_[c]));d.sort().join("")===Og.sort().join("")&&Lg(e,l,r)}}}function jg(e,t,i){Og=[];var n=vg(e),a=[],r="all",o=document,s=0,l=!1,u=!0,_="+";for(void 0===i&&"function"==typeof t&&(i=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(r=t.scope),t.element&&(o=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(u=t.keydown),"string"==typeof t.splitKey&&(_=t.splitKey)),"string"==typeof t&&(r=t);s<n.length;s++)a=[],(e=n[s].split(_)).length>1&&(a=Dg(Sg,e)),(e="*"===(e=e[e.length-1])?"*":Rg(e))in xg||(xg[e]=[]),xg[e].push({keyup:l,keydown:u,scope:r,mods:a,shortcut:n[s],method:i,key:n[s],splitKey:_});void 0!==o&&!function(e){return Ag.indexOf(e)>-1}(o)&&window&&(Ag.push(o),yg(o,"keydown",(function(e){Pg(e)})),yg(window,"focus",(function(){Og=[]})),yg(o,"keyup",(function(e){Pg(e),function(e){var t=e.keyCode||e.which||e.charCode,i=Og.indexOf(t);if(i>=0&&Og.splice(i,1),e.key&&"meta"===e.key.toLowerCase()&&Og.splice(0,Og.length),93!==t&&224!==t||(t=91),t in Cg)for(var n in Cg[t]=!1,Sg)Sg[n]===t&&(jg[n]=!1)}(e)})))}var qg={setScope:Mg,getScope:Ig,deleteScope:function(e,t){var i,n;for(var a in e||(e=Ig()),xg)if(Object.prototype.hasOwnProperty.call(xg,a))for(i=xg[a],n=0;n<i.length;)i[n].scope===e?i.splice(n,1):n++;Ig()===e&&Mg(t||"all")},getPressedKeyCodes:function(){return Og.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=Rg(e)),-1!==Og.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,i=t.tagName,n=!0;return!t.isContentEditable&&("INPUT"!==i&&"TEXTAREA"!==i&&"SELECT"!==i||t.readOnly)||(n=!1),n},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&Bg(e)}));else if("object"==typeof e)e.key&&Bg(e);else if("string"==typeof e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var a=i[0],r=i[1];"function"==typeof a&&(r=a,a=""),Bg({key:e,scope:a,method:r,splitKey:"+"})}}else Object.keys(xg).forEach((function(e){return delete xg[e]}))}};for(var Ug in qg)Object.prototype.hasOwnProperty.call(qg,Ug)&&(jg[Ug]=qg[Ug]);if("undefined"!=typeof window){var zg=window.hotkeys;jg.noConflict=function(e){return e&&window.hotkeys===jg&&(window.hotkeys=zg),jg},window.hotkeys=jg}var Gg=jg;Gg.filter=function(){return!0};var Hg=function(e,t){var i=e.target,n=i&&i.tagName;return Boolean(n&&t&&t.includes(n))};function Yg(e,t,i,n){i instanceof Array&&(n=i,i=void 0);var a=i||{},r=a.enableOnTags,o=a.filter,s=a.keyup,l=a.keydown,u=a.filterPreventDefault,_=void 0===u||u,d=a.enabled,c=void 0===d||d,g=a.enableOnContentEditable,f=void 0!==g&&g,h=Object(p.useRef)(null),m=Object(p.useCallback)((function(e,i){var n;return o&&!o(e)?!_:!!(Hg(e,["INPUT","TEXTAREA","SELECT"])&&!Hg(e,r)||null!=(n=e.target)&&n.isContentEditable&&!f)||(null===h.current||document.activeElement===h.current)&&(t(e,i),!0)}),n?[h,r,o].concat(n):[h,r,o]);return Object(p.useEffect)((function(){if(c)return s&&!0!==l&&(i.keydown=!1),Gg(e,i||{},m),function(){return Gg.unbind(e,m)};Gg.unbind(e,m)}),[m,e,c]),h}Gg.isPressed;var Vg=function(e,t){Object(p.useEffect)((function(){var i=function(i){e.current&&!e.current.contains(i.target)&&t(i)};return document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),function(){document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}}),[e,t])},Wg=["icon","label","isOpen","onVisible","onClose","ulProps","position","children","className","buttonStyle","buttonProps","customTarget","disabled","closeOnEsc","closeOnSelect","closeOnOutsideClick","dropdownModifiers"];function $g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Kg(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$g(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):$g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Qg=function(){},Zg=Object(p.forwardRef)((function(e,t){e.icon;var i=e.label,n=e.isOpen,a=e.onVisible,r=void 0===a?Qg:a,o=e.onClose,s=void 0===o?Qg:o,l=e.ulProps,_=e.position,c=e.children,f=e.className,F=(e.buttonStyle,e.buttonProps),E=e.customTarget,y=(e.disabled,e.closeOnEsc),D=void 0===y||y,v=e.closeOnSelect,k=void 0===v||v,S=e.closeOnOutsideClick,w=void 0===S||S,C=e.dropdownModifiers,x=void 0===C?[]:C,T=h()(e,Wg),O=Object(p.useRef)(),N=E(),A=!(null==n),R=Object(p.useState)(!1),M=g()(R,2),I=M[0],B=M[1],L=Object(p.useState)(null),P=g()(L,2),j=P[0],q=P[1],U=Object(p.useState)(null),z=g()(U,2),G=z[0],H=z[1],Y=function(e,t,i){void 0===i&&(i={});var n=p.useRef(null),a={onFirstUpdate:i.onFirstUpdate,placement:i.placement||"bottom",strategy:i.strategy||"absolute",modifiers:i.modifiers||mg},r=p.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=r[0],s=r[1],l=p.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,i=Object.keys(t.elements);s({styles:hg(i.map((function(e){return[e,t.styles[e]||{}]}))),attributes:hg(i.map((function(e){return[e,t.attributes[e]]})))})},requires:["computeStyles"]}}),[]),u=p.useMemo((function(){var e={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[l,{name:"applyStyles",enabled:!1}])};return fg()(n.current,e)?n.current||e:(n.current=e,e)}),[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,l]),_=p.useRef();return pg((function(){_.current&&_.current.setOptions(u)}),[u]),pg((function(){if(null!=e&&null!=t){var n=(i.createPopper||wl)(e,t,u);return _.current=n,function(){n.destroy(),_.current=null}}}),[e,t,i.createPopper]),{state:_.current?_.current.state:null,styles:o.styles,attributes:o.attributes,update:_.current?_.current.update:null,forceUpdate:_.current?_.current.forceUpdate:null}}(j,G,{placement:_||"bottom-end",modifiers:x}),V=Y.styles,W=Y.attributes;Object(p.useImperativeHandle)(t,(function(){return{close:function(){return B(!1)},visible:I}}));var $=function(){A||B(!1),s()},K=function(){!A&&B(!I)};return D&&Yg("esc",$),w&&Vg(O,$),A||(F=Kg(Kg({},F),{},{onClick:function(){K()}})),Object(p.useEffect)((function(){A&&B(n)}),[n]),Object(p.useEffect)((function(){I&&r()}),[I]),m.a.createElement("div",u()({ref:O,className:b()("ne-dropdown__wrapper",d()({},f,f))},T),E?m.a.createElement("div",{ref:q,onClick:K},N):m.a.createElement("div",null,i,m.a.createElement(bg,null)),I&&m.a.createElement("ul",u()({className:"ne-dropdown__popup",ref:H,onClick:function(){k&&$()},"data-cy":"neeto-editor-".concat(c_(i),"-dropdown-container")},l,{style:Kg(Kg({display:"block"},V.offset),V.popper)},W.popper),c))})),Xg=function(e){var t=e.editor;return m.a.createElement(Zg,{customTarget:function(){return m.a.createElement(rg,{icon:cg,iconActive:t.isActive("heading"),tooltipProps:{content:"Font Size",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-font-size-option"})},className:"neeto-editor-font-size-wrapper",placement:"bottom"},[{label:"H1",value:1},{label:"H2",value:2},{label:"H3",value:3}].map((function(e){var i,n=e.label,a=e.value;return m.a.createElement("li",{onClick:function(){return e=a,t.chain().focus().toggleHeading({level:e}).run();var e},key:a,className:b()({active:(i=a,t.isActive("heading",{level:i}))}),"data-cy":"neeto-editor-fixed-menu-font-size-option-".concat(n)},n)})))};function Jg(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ef(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Jg(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Jg(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var tf=function(e){var t=e.onClickVariable,i=e.variables,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=[];return e.forEach((function(e){var n=e.category_key,a=e.category_label,r=e.variables;if(n&&r){var o=r.map((function(e){return ef(ef({},e),{},{category_key:n})}));i.push({label:a,variables:o})}else t.push(e)})),t.length&&i.push({label:i.length?"Others":null,variables:t}),i}(i);return i&&i.length?m.a.createElement("div",{className:"neeto-editor-variables-list"},n.map((function(e,i){var n=e.label,a=e.variables;return m.a.createElement(nf,{key:i,index:i,title:n,variables:a,onClickItem:t})}))):null},nf=function(e){var t=e.index,i=e.title,n=e.variables,a=e.onClickItem;return m.a.createElement("div",{className:"neeto-editor-variables-block","data-cy":"neeto-editor-variable-option-category-".concat(t)},i&&m.a.createElement("h6",null,i),m.a.createElement("div",{className:"neeto-editor-variables-row"},n.map((function(e){return m.a.createElement("button",{type:"button",onClick:function(){return a(e)},key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable","data-cy":"neeto-editor-variable-option-item-".concat(e.label,"--").concat(e.value)},e.label)}))))},af=["color"],rf=function(e){var t=e.editor,i=e.variables;return i&&i.length?m.a.createElement(Zg,{customTarget:function(){return m.a.createElement(rg,{icon:function(e){e.color;var t=h()(e,af);return m.a.createElement(ug,t)},tooltipProps:{content:"Variables",position:"bottom",delay:[500]},"data-cy":"neeto-editor-variable-option"})}},m.a.createElement(tf,{onClickVariable:function(e){var i=e.category_key,n=e.key,a=i?"".concat(i,".").concat(n):n;t.chain().focus().setVariable({label:a}).run()},variables:i})):null},of=["size","color","strokeWidth"];function sf(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,of);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M17 21H12C10.22 21 8.47991 20.4722 6.99987 19.4832C5.51983 18.4943 4.36628 17.0887 3.68509 15.4442C3.0039 13.7996 2.82567 11.99 3.17294 10.2442C3.5202 8.49836 4.37737 6.89472 5.63604 5.63604C6.89472 4.37737 8.49836 3.5202 10.2442 3.17294C11.99 2.82567 13.7996 3.0039 15.4442 3.68509C17.0887 4.36628 18.4943 5.51983 19.4832 6.99987C20.4722 8.47991 21 10.22 21 12V13.5C21 14.163 20.7366 14.7989 20.2678 15.2678C19.7989 15.7366 19.163 16 18.5 16C17.837 16 17.2011 15.7366 16.7322 15.2678C16.2634 14.7989 16 14.163 16 13.5V12C16 10.9391 15.5786 9.92172 14.8284 9.17158C14.0783 8.42143 13.0609 8 12 8V8C11.2089 8 10.4355 8.2346 9.77772 8.67413C9.11993 9.11365 8.60724 9.73837 8.30449 10.4693C8.00174 11.2002 7.92252 12.0044 8.07686 12.7804C8.2312 13.5563 8.61217 14.269 9.17158 14.8284C9.73099 15.3878 10.4437 15.7688 11.2196 15.9231C11.9956 16.0775 12.7998 15.9983 13.5307 15.6955C14.2616 15.3928 14.8864 14.8801 15.3259 14.2223C15.7654 13.5645 16 12.7911 16 12",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}sf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},sf.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var lf=["size","user","isSquare","status","onClick","className"],uf={small:24,medium:32,large:40,xlarge:64},_f=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function df(e){var t,i,n=e.size,a=e.user,r=e.isSquare,o=e.status,s=e.onClick,l=e.className,_=h()(e,lf),d=Object(p.useState)(!1),c=g()(d,2),f=c[0],F=c[1],E=a.name,y=void 0===E?"":E,D=a.imageUrl,v="medium"===n,k="large"===n,S="xlarge"===n,w=(t=y.trim().split(" ")).reduce((function(e,i,n){return 0!==n&&n!==t.length-1||(e="".concat(e).concat(i.charAt(0).toUpperCase())),e}),""),C={height:uf[n],width:uf[n],backgroundColor:(i=(w.charCodeAt(0)||0)+(w.charCodeAt(1)||0),_f[i%65%_f.length]||_f[0])},x=b()("ne-avatar",{"ne-avatar--medium":v,"ne-avatar--large":k,"ne-avatar--xlarge":S,"ne-avatar--round":!r,hidden:!f}),T=b()("ne-avatar__text",{"ne-avatar__text-medium":v,"ne-avatar__text-large":k,"ne-avatar__text-xlarge":S}),O=b()("ne-avatar__status","".concat(o),{"ne-avatar__status-medium":v,"ne-avatar__status-large":k,"ne-avatar__status-xlarge":S,"ne-avatar__status-square":r}),N=function(){return null==o?m.a.Fragment:m.a.createElement("span",{className:O})},A=function(){return m.a.createElement("span",{className:T},w)},R=w&&!D&&!f;return m.a.createElement("div",u()({onClick:s,style:C,className:b()("ne-avatar--container",{"ne-avatar--container-round":!r},l)},_),m.a.createElement(N,null),R?m.a.createElement(A,null):m.a.createElement("img",{className:x,onLoad:function(){return F(!0)},onError:function(){return F(!1)},src:D,alt:"avatar-".concat(w)}))}df.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},df.propTypes={size:ig.a.oneOf(Object.keys(uf)),user:ig.a.shape({imageUrl:ig.a.string,name:ig.a.string}),isSquare:ig.a.bool,onClick:ig.a.func,status:ig.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:ig.a.string};var cf=df,gf=function(e){var t=e.editor,i=e.mentions,n=e.showImageInMention,a=Object(p.useRef)();return i&&i.length?m.a.createElement(Zg,{ref:a,customTarget:function(){var e;return m.a.createElement(rg,{icon:sf,iconActive:null===(e=a.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Mention",position:"bottom",delay:[500]},"data-cy":"neeto-editor-mention-option"})}},m.a.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},i.map((function(e){var i=e.key,a=e.name,r=e.imageUrl;return m.a.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:i,onClick:function(){return t.commands.setMention(a)},type:"button","data-cy":"neeto-editor-mention-option-".concat(i)},n&&m.a.createElement(cf,{size:"small",user:{name:a,imageUrl:r}}),m.a.createElement("p",null,a))})))):null},ff=["size","color","strokeWidth"];function hf(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,ff);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M11.009 11.249H12.159V15.499",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}),J_.createElement("path",{d:"M11 15.4986H13.3093",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}),J_.createElement("path",{d:"M12.1 8.24587C12.1 8.29532 12.0853 8.34365 12.0579 8.38477C12.0304 8.42588 11.9914 8.45792 11.9457 8.47684C11.9 8.49576 11.8497 8.50071 11.8012 8.49107C11.7527 8.48142 11.7082 8.45761 11.6732 8.42265C11.6383 8.38769 11.6145 8.34314 11.6048 8.29464C11.5952 8.24615 11.6001 8.19588 11.619 8.1502C11.638 8.10452 11.67 8.06548 11.7111 8.03801C11.7522 8.01053 11.8006 7.99587 11.85 7.99587",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}),J_.createElement("path",{d:"M11.85 7.99587C11.9163 7.99587 11.9799 8.02221 12.0268 8.0691C12.0737 8.11598 12.1 8.17957 12.1 8.24587",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}),J_.createElement("path",{d:"M16 2.99862H8C5.23858 2.99862 3 5.2372 3 7.99862V15.9986C3 18.76 5.23858 20.9986 8 20.9986H16C18.7614 20.9986 21 18.76 21 15.9986V7.99862C21 5.2372 18.7614 2.99862 16 2.99862Z",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}hf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},hf.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var pf=["children","className","required","helpIconProps"],mf=["onClick","icon","tooltipProps","className"],Ff=function(e){var t=e.children,i=e.className,n=void 0===i?"":i,a=e.required,r=void 0!==a&&a,o=e.helpIconProps,s=void 0===o?null:o,l=h()(e,pf),_=s||{},c=_.onClick,g=_.icon,f=_.tooltipProps,p=_.className,F=h()(_,mf),E=g||hf;return m.a.createElement("label",u()({className:b()("ne-label flex items-center",n)},l),t,r&&m.a.createElement("span",{"aria-hidden":!0},"*"),s&&m.a.createElement(ac,u()({},f,{disabled:!f}),m.a.createElement("span",{className:b()("ml-1",d()({},p,p)),onClick:c},m.a.createElement(E,u()({size:16},F)))))},bf=["id","size","type","label","error","suffix","prefix","disabled","helpText","className","nakedInput","contentSize","required"],Ef=Object(p.forwardRef)((function(e,t){var i=e.id,n=e.size,a=void 0===n?"small":n,r=e.type,o=void 0===r?"text":r,s=e.label,l=e.error,_=void 0===l?null:l,d=e.suffix,c=void 0===d?null:d,g=e.prefix,f=void 0===g?null:g,p=e.disabled,F=void 0!==p&&p,E=e.helpText,y=void 0===E?"":E,D=e.className,v=void 0===D?"":D,k=e.nakedInput,S=void 0!==k&&k,w=e.contentSize,C=void 0===w?null:w,x=e.required,T=void 0!==x&&x,O=h()(e,bf);return m.a.createElement("div",{className:b()(["ne-input__wrapper",v])},s&&m.a.createElement(Ff,{required:T,"data-cy":"neeto-editor-".concat(c_(s),"-input-label"),htmlFor:i},s),m.a.createElement("div",{className:b()("ne-input",{"ne-input--naked":!!S,"ne-input--error":!!_,"ne-input--disabled":!!F,"ne-input--small":"small"===a})},f&&m.a.createElement("div",{className:"ne-input__prefix"},f),m.a.createElement("input",u()({ref:t,type:o,disabled:F,size:C,required:T,"aria-invalid":!!_,"data-cy":"".concat(c_(s),"-input-field")},O)),c&&m.a.createElement("div",{className:"ne-input__suffix"},c)),!!_&&m.a.createElement("p",{"data-cy":"".concat(c_(s),"-input-error"),className:"ne-input__error"},_),y&&m.a.createElement("p",{className:"ne-input__help-text"},y))}));Ef.displayName="Input";var yf=Ef,Df=function(e){var t=e.editor,i=Object(p.useRef)(),n=Object(p.useRef)(),a=Object(p.useState)(""),r=g()(a,2),o=r[0],s=r[1],l=Object(p.useState)(""),u=g()(l,2),_=u[0],d=u[1],c=t.isActive("link"),f=function(){d(t.getAttributes("link").href||"")},h=function(){var e;Uc.test(_)?(t.chain().focus().setLink({href:_}).run(),null===(e=i.current)||void 0===e||e.close()):s("Please enter a valid url")};return m.a.createElement(Zg,{ref:i,onVisible:function(){var e;return null===(e=n.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:function(){return m.a.createElement(rg,{icon:Ld,iconActive:c,onClick:f,tooltipProps:{content:"Link",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-link-option"})},className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?i.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},m.a.createElement(yf,{ref:n,name:"url",value:_,placeholder:"Paste URL",onFocus:function(){return s("")},error:o,onChange:function(e){var t=e.target.value;return d(t)},"data-cy":"neeto-editor-fixed-menu-link-option-input"}),m.a.createElement(qc,{label:"Link",onClick:h,"data-cy":"neeto-editor-fixed-menu-link-option-link-button"}),c&&m.a.createElement(qc,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=i.current)||void 0===e||e.close()},"data-cy":"neeto-editor-fixed-menu-link-option-unlink-button"})))},vf=["size","color","strokeWidth"];function kf(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,vf);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M12 3C7.037 3 3 7.037 3 12C3 16.963 7.037 21 12 21C16.963 21 21 16.962 21 12C21 7.038 16.962 3 12 3Z",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}),J_.createElement("path",{d:"M15.5006 15.688C15.5006 15.688 14.1876 17 12.0006 17C9.81263 17 8.50063 15.688 8.50063 15.688M15.3286 9.5C15.1906 9.5 15.0786 9.612 15.0796 9.75C15.0796 9.888 15.1916 10 15.3296 10C15.4676 10 15.5796 9.888 15.5796 9.75C15.5796 9.612 15.4676 9.5 15.3286 9.5ZM8.63963 9.5C8.50163 9.5 8.38963 9.612 8.39063 9.75C8.39063 9.888 8.50263 10 8.64063 10C8.77863 10 8.89063 9.888 8.89063 9.75C8.89063 9.612 8.77863 9.5 8.63963 9.5Z",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}kf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},kf.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var Sf=i(20),wf=i.n(Sf),Cf=i(21),xf=i.n(Cf),Tf=i(14),Of=i.n(Tf),Nf=i(22),Af=i.n(Nf),Rf=i(23),Mf=i.n(Rf),If=i(17),Bf=i.n(If),Lf=i(30),Pf=i(9),jf=i.n(Pf),qf=i(10),Uf=i.n(qf),zf=i(46),Gf=i.n(zf),Hf={name:"a",unified:"b",non_qualified:"c",has_img_apple:"d",has_img_google:"e",has_img_twitter:"f",has_img_facebook:"h",keywords:"j",sheet:"k",emoticons:"l",text:"m",short_names:"n",added_in:"o"},Yf=function(e){var t=[],i=function(e,i){e&&(Array.isArray(e)?e:[e]).forEach((function(e){(i?e.split(/[-|_|\s]+/):[e]).forEach((function(e){e=e.toLowerCase(),-1==t.indexOf(e)&&t.push(e)}))}))};return i(e.short_names,!0),i(e.name,!0),i(e.keywords,!1),i(e.emoticons,!1),t.join(",")},Vf=function(e){for(var t in e.compressed=!1,e.emojis){var i=e.emojis[t];for(var n in Hf)i[n]=i[Hf[n]],delete i[Hf[n]];i.short_names||(i.short_names=[]),i.short_names.unshift(t),i.sheet_x=i.sheet[0],i.sheet_y=i.sheet[1],delete i.sheet,i.text||(i.text=""),i.added_in||(i.added_in=6),i.added_in=i.added_in.toFixed(1),i.search=Yf(i)}},Wf=String.fromCodePoint||function(){var e,t,i=16384,n=[],a=-1,r=arguments.length;if(!r)return"";for(var o="";++a<r;){var s=Number(arguments[a]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(a+1===r||n.length>i)&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o},$f=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,Kf=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function Qf(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return Wf.apply(null,t)}function Zf(e){var t=e.name,i=e.short_names,n=e.skin_tone,a=e.skin_variations,r=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,_=e.id||i[0],d=":".concat(_,":");return s?{id:_,name:t,short_names:i,colons:d,emoticons:r,custom:s,customCategory:l,imageUrl:u}:(n&&(d+=":skin-tone-".concat(n,":")),{id:_,name:t,short_names:i,colons:d,emoticons:r,unified:o.toLowerCase(),skin:n||(a?1:null),native:Qf(o)})}function Xf(){return Zf(Jf.apply(void 0,arguments))}function Jf(e,t,i,n){var a={};if("string"==typeof e){var r=e.match($f);if(r&&(e=r[1],r[2]&&(t=parseInt(r[2],10))),n.aliases.hasOwnProperty(e)&&(e=n.aliases[e]),!n.emojis.hasOwnProperty(e))return null;a=n.emojis[e]}else e.id&&(n.aliases.hasOwnProperty(e.id)&&(e.id=n.aliases[e.id]),n.emojis.hasOwnProperty(e.id)&&(a=n.emojis[e.id],t||(t=e.skin)));if(Object.keys(a).length||((a=e).custom=!0,a.search||(a.search=Yf(e))),a.emoticons||(a.emoticons=[]),a.variations||(a.variations=[]),a.skin_variations&&t>1){a=JSON.parse(JSON.stringify(a));var o=Kf[t-1],s=a.skin_variations[o];if(s&&(!s.variations&&a.variations&&delete a.variations,i&&(null==s["has_img_".concat(i)]||s["has_img_".concat(i)])||!i))for(var l in a.skin_tone=t,s){var u=s[l];a[l]=u}}return a.variations&&a.variations.length&&((a=JSON.parse(JSON.stringify(a))).unified=a.variations.shift()),a}function eh(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function th(e,t){var i=eh(e),n=eh(t);return i.filter((function(e){return n.indexOf(e)>=0}))}function ih(e,t){var i={};for(var n in e){var a=e[n],r=a;t.hasOwnProperty(n)&&(r=t[n]),"object"===Gf()(r)&&(r=ih(a,r)),i[n]=r}return i}var nh,ah,rh="emoji-mart",oh="undefined"!=typeof window&&"localStorage"in window;function sh(e,t){if(ah)ah(e,t);else{if(!oh)return;try{window.localStorage["".concat(rh,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var lh={update:function(e){for(var t in e){sh(t,e[t])}},set:sh,get:function(e){if(nh)return nh(e);if(oh)try{var t=window.localStorage["".concat(rh,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){rh=e},setHandlers:function(e){e||(e={}),nh=e.getter,ah=e.setter}},uh=function(){function e(t,i){jf()(this,e),t.compressed&&Vf(t),this.data=t||{},this.set=i||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return Uf()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var i=e.data.emojis[t],n=i.short_names,a=i.emoticons,r=i.skin_variations,o=n[0];if(a&&a.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),r){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=Xf({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=Xf(o,null,e.set,e.data);e.originalPool[o]=i};for(var i in this.data.emojis)t(i)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(i){var n=i.id||i.short_names[0];delete e[n],delete t.emojis[n]}))}},{key:"addCustomToPool",value:function(e,t){var i=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var n=e.id||e.short_names[0];n&&!t[n]&&(t[n]=Jf(e,null,null,i.data),i.emojis[n]=Xf(e,null,null,i.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.emojisToShowFilter,a=i.maxResults,r=i.include,o=i.exclude,s=i.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=lh.get("skin")||1;a||(a=75),r||(r=[]),o||(o=[]);var _=null,d=this.originalPool;if(e.length){if("-"==e||"-1"==e)return[this.emojis[-1][u]];var c=e.toLowerCase().split(/[\s|,|\-|_]+/),g=[];if(c.length>2&&(c=[c[0],c[1]]),(r.length||o.length)&&(d={},this.data.categories.forEach((function(e){var i=!r||!r.length||r.indexOf(e.id)>-1,n=!(!o||!o.length)&&o.indexOf(e.id)>-1;i&&!n&&e.emojis.forEach((function(e){return d[e]=t.data.emojis[e]}))})),l.length)){var f=!r||!r.length||r.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;f&&!h&&this.addCustomToPool(l,d)}_=(g=c.map((function(e){for(var i=d,n=t.index,a=0,r=0;r<e.length;r++){var o=e[r];a++,n[o]||(n[o]={}),(n=n[o]).results||function(){var r={};for(var o in n.results=[],n.pool={},i){var s=i[o],l=s.search,_=e.substr(0,a),d=l.indexOf(_);if(-1!=d){var c=d+1;_==o&&(c=0),t.emojis[o]&&t.emojis[o][u]?n.results.push(t.emojis[o][u]):n.results.push(t.emojis[o]),n.pool[o]=s,r[o]=c}}n.results.sort((function(e,t){var i=r[e.id],n=r[t.id];return i==n?e.id.localeCompare(t.id):i-n}))}(),i=n.pool}return n.results})).filter((function(e){return e}))).length>1?th.apply(null,g):g.length?g[0]:[]}return _&&(n&&(_=_.filter((function(e){return n(d[e.id])}))),_&&_.length>a&&(_=_.slice(0,a))),_}}]),e}(),_h=new uh(Lf);var dh,ch,gh={search:function(){return _h.search.apply(_h,arguments)},emojis:_h.emojis,emoticons:_h.emoticons},fh=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],hh={};function ph(){ch=!0,dh=lh.get("frequently")}var mh={add:function(e){ch||ph();var t=e.id;dh||(dh=hh),dh[t]||(dh[t]=0),dh[t]+=1,lh.set("last",t),lh.set("frequently",dh)},get:function(e){if(ch||ph(),!dh){hh={};for(var t=[],i=0;i<e;i++)hh[fh[i]]=e-i,t.push(fh[i]);return t}var n=4*e,a=[];for(var r in dh)dh.hasOwnProperty(r)&&a.push(r);var o=a.sort((function(e,t){return dh[e]-dh[t]})).reverse().slice(0,n),s=lh.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},Fh=i(15),bh=i.n(Fh),Eh=i(24),yh=i.n(Eh),Dh=i(11),vh=i.n(Dh),kh=i(12),Sh=i.n(kh),wh=i(13),Ch=i.n(wh),xh=i(7),Th=i.n(xh),Oh={activity:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"}))},custom:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("g",{transform:"translate(2.000000, 1.000000)"},m.a.createElement("rect",{id:"Rectangle",x:"8",y:"0",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(-60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"})))},flags:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"}))},foods:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"}))},nature:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),m.a.createElement("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"}))},objects:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),m.a.createElement("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"}))},people:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),m.a.createElement("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"}))},places:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),m.a.createElement("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"}))},recent:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}))},symbols:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"}))}},Nh={search:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"}))},delete:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"}))}},Ah={data:ig.a.object.isRequired,onOver:ig.a.func,onLeave:ig.a.func,onClick:ig.a.func,fallback:ig.a.func,backgroundImageFn:ig.a.func,native:ig.a.bool,forceSize:ig.a.bool,tooltip:ig.a.bool,useButton:ig.a.bool,skin:ig.a.oneOf([1,2,3,4,5,6]),sheetSize:ig.a.oneOf([16,20,32,64]),sheetColumns:ig.a.number,sheetRows:ig.a.number,set:ig.a.oneOf(["apple","google","twitter","facebook"]),size:ig.a.number.isRequired,emoji:ig.a.oneOfType([ig.a.string,ig.a.object]).isRequired},Rh={onClick:ig.a.func,onSelect:ig.a.func,onSkinChange:ig.a.func,perLine:ig.a.number,emojiSize:ig.a.number,i18n:ig.a.object,style:ig.a.object,title:ig.a.string,emoji:ig.a.string,color:ig.a.string,set:Ah.set,skin:Ah.skin,native:ig.a.bool,backgroundImageFn:Ah.backgroundImageFn,sheetSize:Ah.sheetSize,emojisToShowFilter:ig.a.func,showPreview:ig.a.bool,showSkinTones:ig.a.bool,emojiTooltip:Ah.tooltip,useButton:Ah.useButton,theme:ig.a.oneOf(["auto","light","dark"]),include:ig.a.arrayOf(ig.a.string),exclude:ig.a.arrayOf(ig.a.string),recent:ig.a.arrayOf(ig.a.string),autoFocus:ig.a.bool,enableFrequentEmojiSort:ig.a.bool,custom:ig.a.arrayOf(ig.a.shape({name:ig.a.string.isRequired,short_names:ig.a.arrayOf(ig.a.string).isRequired,emoticons:ig.a.arrayOf(ig.a.string),keywords:ig.a.arrayOf(ig.a.string),imageUrl:ig.a.string,spriteUrl:ig.a.string,sheet_x:ig.a.number,sheet_y:ig.a.number,size:ig.a.number,sheetColumns:ig.a.number,sheetRows:ig.a.number})),skinEmoji:ig.a.string,notFound:ig.a.func,notFoundEmoji:ig.a.string,icons:ig.a.object},Mh=function(e){function t(e){var i;jf()(this,t),i=vh()(this,Sh()(t).call(this,e));var n=e.categories.filter((function(e){return e.first}))[0];return i.state={selected:n.name},i.handleClick=i.handleClick.bind(Th()(i)),i}return Ch()(t,e),Uf()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),i=this.props,n=i.categories;(0,i.onAnchorClick)(n[t],t)}},{key:"render",value:function(){var e=this,t=this.props,i=t.categories,n=t.color,a=t.i18n,r=t.icons,o=this.state.selected;return m.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":a.categorieslabel},i.map((function(t,i){var s=t.id,l=t.name,u=t.anchor,_=l==o;if(!1===u)return null;var d=s.startsWith("custom-")?"custom":s;return m.a.createElement("button",{key:s,"aria-label":a.categories[d],title:a.categories[d],"data-index":i,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(_?"emoji-mart-anchor-selected":""),style:{color:_?n:null}},m.a.createElement("div",{className:"emoji-mart-anchor-icon"},r.categories[d]()),m.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:n}}))})))}}]),t}(m.a.PureComponent);Mh.propTypes={categories:ig.a.array,onAnchorClick:ig.a.func,icons:ig.a.object},Mh.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var Ih={skin:1,set:"apple",sheetSize:64,sheetColumns:57,sheetRows:57,native:!1,forceSize:!1,tooltip:!1,useButton:!0,backgroundImageFn:function(e,t){return"https://unpkg.com/emoji-datasource-".concat(e,"@").concat("5.0.1","/img/").concat(e,"/sheets-256/").concat(t,".png")}},Bh={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:Ih.set,theme:"light",skin:null,defaultSkin:Ih.skin,native:Ih.native,sheetSize:Ih.sheetSize,backgroundImageFn:Ih.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:Ih.tooltip,useButton:Ih.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function Lh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Ph(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Lh(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Lh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var jh=function(e){return Jf(e.emoji,e.skin,e.set,e.data)},qh=function(e){var t=jh(e),i=t.sheet_x,n=t.sheet_y,a=100/(e.sheetColumns-1),r=100/(e.sheetRows-1);return"".concat(a*i,"% ").concat(r*n,"%")},Uh=function(e){return Xf(e.emoji,e.skin,e.set,e.data)},zh=function(e){return!isNaN(e-parseFloat(e))},Gh=function e(t){for(var i in t.data.compressed&&Vf(t.data),e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);var n=jh(t);if(!n)return t.fallback?t.fallback(null,t):null;var a=n.unified,r=n.custom,o=n.short_names,s=n.imageUrl,l={},u=t.children,_="emoji-mart-emoji",d=a&&Qf(a),c=[d].concat(o).filter(Boolean).join(", "),g=null;if(!a&&!r)return t.fallback?t.fallback(n,t):null;if(t.tooltip&&(g=o[0]),t.native&&a)_+=" emoji-mart-emoji-native",l={fontSize:t.size},u=d,t.forceSize&&(l.display="inline-block",l.width=t.size,l.height=t.size,l.wordBreak="keep-all");else if(r)_+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=n.spriteUrl?Ph({},l,{backgroundImage:"url(".concat(n.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:qh(t)}):Ph({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==n["has_img_".concat(t.set)]||n["has_img_".concat(t.set)]))return t.fallback?t.fallback(n,t):null;l={width:t.size,height:t.size,display:"inline-block",backgroundImage:"url(".concat(t.backgroundImageFn(t.set,t.sheetSize),")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:qh(t)}}var f={name:"span",props:{}};return t.onClick&&t.useButton&&(f.name="button",f.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var i in e){var n=e[i];zh(n)&&(n+="px"),t.style[i]=n}return t.getAttribute("style")}(l),"<".concat(f.name," style='").concat(l,"' aria-label='").concat(c,"' ").concat(g?"title='".concat(g,"'"):""," class='").concat(_,"'>").concat(u||"","</").concat(f.name,">")):m.a.createElement(f.name,yh()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(Uh(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(Uh(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(Uh(t),e)}(e,t)},"aria-label":c,title:g,className:_},f.props),m.a.createElement("span",{style:l},u))};Gh.propTypes=Ph({},Ah,{data:ig.a.object.isRequired}),Gh.defaultProps=Ih;var Hh=Gh;function Yh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var Vh=function(e){function t(){return jf()(this,t),vh()(this,Sh()(t).apply(this,arguments))}return Ch()(t,e),Uf()(t,[{key:"render",value:function(){var e=this.props,t=e.data,i=e.emojiProps,n=e.i18n,a=e.notFound,r=e.notFoundEmoji;return a&&a()||m.a.createElement("div",{className:"emoji-mart-no-results"},Hh(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Yh(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Yh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({data:t},i,{size:38,emoji:r,onOver:null,onLeave:null,onClick:null})),m.a.createElement("div",{className:"emoji-mart-no-results-label"},n.notfound))}}]),t}(m.a.PureComponent);function Wh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}Vh.propTypes={notFound:ig.a.func.isRequired,emojiProps:ig.a.object.isRequired};var $h=function(e){function t(e){var i;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).data=e.data,i.setContainerRef=i.setContainerRef.bind(Th()(i)),i.setLabelRef=i.setLabelRef.bind(Th()(i)),i}return Ch()(t,e),Uf()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var i=this.props,n=i.name,a=i.perLine,r=i.native,o=i.hasStickyPosition,s=i.emojis,l=i.emojiProps,u=l.skin,_=l.size,d=l.set,c=e.perLine,g=e.native,f=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,E=!1;return"Recent"==n&&a!=c&&(E=!0),"Search"==n&&(E=!(s==h)),u==m&&_==F&&r==g&&d==b&&o==f||(E=!0),E}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),i=t.top,n=t.height,a=e.getBoundingClientRect().top,r=this.label.getBoundingClientRect().height;this.top=i-a+e.scrollTop,this.maxMargin=0==n?0:n-r}},{key:"handleScroll",value:function(e){var t=e-this.top;if((t=(t=t<this.minMargin?this.minMargin:t)>this.maxMargin?this.maxMargin:t)!=this.margin)return this.props.hasStickyPosition||(this.label.style.top="".concat(t,"px")),this.margin=t,!0}},{key:"getEmojis",value:function(){var e=this,t=this.props,i=t.name,n=t.emojis,a=t.recent,r=t.perLine;if("Recent"==i){var o=this.props.custom,s=a||mh.get(r);if(s.length&&(n=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!Jf(t,null,null,e.data)}))),0===n.length&&s.length>0)return null}return n&&(n=n.slice(0)),n}},{key:"updateDisplay",value:function(e){this.getEmojis()&&this.container&&(this.container.style.display=e)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setLabelRef",value:function(e){this.label=e}},{key:"render",value:function(){var e=this,t=this.props,i=t.id,n=t.name,a=t.hasStickyPosition,r=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,u=this.getEmojis(),_={},d={},c={};u||(c={display:"none"}),a||(_={height:28},d={position:"absolute"});var g=o.categories[i]||n;return m.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":g,style:c},m.a.createElement("div",{style:_,"data-name":n,className:"emoji-mart-category-label"},m.a.createElement("span",{style:d,ref:this.setLabelRef,"aria-hidden":!0},g)),m.a.createElement("ul",{className:"emoji-mart-category-list"},u&&u.map((function(t){return m.a.createElement("li",{key:t.short_names&&t.short_names.join("_")||t},Hh(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Wh(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Wh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({emoji:t,data:e.data},r)))}))),u&&!u.length&&m.a.createElement(Vh,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:r}))}}]),t}(m.a.Component);$h.propTypes={emojis:ig.a.array,hasStickyPosition:ig.a.bool,name:ig.a.string.isRequired,native:ig.a.bool.isRequired,perLine:ig.a.number.isRequired,emojiProps:ig.a.object.isRequired,recent:ig.a.arrayOf(ig.a.string),notFound:ig.a.func,notFoundEmoji:ig.a.string.isRequired},$h.defaultProps={emojis:[],hasStickyPosition:!0};var Kh=function(e){function t(e){var i;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).state={opened:!1},i}return Ch()(t,e),Uf()(t,[{key:"handleClick",value:function(e){var t=parseInt(e.currentTarget.getAttribute("data-skin")),i=this.props.onChange;this.state.opened?(this.setState({opened:!1}),t!=this.props.skin&&i(t)):this.setState({opened:!0})}},{key:"render",value:function(){return null}}]),t}(m.a.PureComponent);Kh.propTypes={onChange:ig.a.func,skin:ig.a.number.isRequired},Kh.defaultProps={onChange:function(){}};var Qh=function(e){function t(e){var i;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).handleClick=i.handleClick.bind(Th()(i)),i}return Ch()(t,e),Uf()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.emojiProps,n=e.data,a=e.skinEmoji,r=e.i18n,o=this.state.opened,s=[],l=1;l<=6;l++){var u=l===t;s.push(m.a.createElement("span",{key:"skin-tone-".concat(l),className:"emoji-mart-skin-swatch custom".concat(u?" selected":"")},m.a.createElement("span",{onClick:this.handleClick,"data-skin":l,className:"emoji-mart-skin-tone-".concat(l)},Hh({emoji:a,data:n,skin:l,backgroundImageFn:i.backgroundImageFn,native:i.native,set:i.set,sheetSize:i.sheetSize,size:23}))))}return m.a.createElement("div",{className:"emoji-mart-skin-swatches custom".concat(o?" opened":"")},m.a.createElement("div",{className:"emoji-mart-skin-text".concat(o?" opened":"")},r.skintext),s)}}]),t}(Kh);Qh.propTypes={onChange:ig.a.func,skin:ig.a.number.isRequired,emojiProps:ig.a.object.isRequired,skinTone:ig.a.number,skinEmoji:ig.a.string.isRequired,i18n:ig.a.object},Qh.defaultProps={onChange:function(){},skinTone:null};var Zh=function(e){function t(e){var i;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).handleClick=i.handleClick.bind(Th()(i)),i.handleKeyDown=i.handleKeyDown.bind(Th()(i)),i}return Ch()(t,e),Uf()(t,[{key:"handleKeyDown",value:function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),this.handleClick(e))}},{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.i18n,n=this.state.opened,a=[],r=1;r<=6;r++){var o=r===t,s=n||o;a.push(m.a.createElement("span",yh()({key:"skin-tone-".concat(r),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":i.skintones[r],"aria-hidden":!s},n?{role:"menuitem"}:{}),m.a.createElement("span",yh()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!n}:{},n?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":i.skintones[r],title:i.skintones[r],"data-skin":r,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(r)}))))}return m.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(n?" opened":""),"aria-label":i.skintext},m.a.createElement("div",n?{role:"menubar"}:{},a))}}]),t}(Kh);function Xh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Jh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Xh(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Xh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}Zh.propTypes={onChange:ig.a.func,skin:ig.a.number.isRequired,i18n:ig.a.object},Zh.defaultProps={onChange:function(){}};var ep=function(e){function t(e){var i;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).data=e.data,i.state={emoji:null},i}return Ch()(t,e),Uf()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,i=t.emojiProps,n=t.skinsProps,a=t.showSkinTones,r=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var u=Jf(e,null,null,this.data),_=u.emoticons,d=[],c=[];return(void 0===_?[]:_).forEach((function(e){d.indexOf(e.toLowerCase())>=0||(d.push(e.toLowerCase()),c.push(e))})),m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},Hh(Jh({key:e.id,emoji:e,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("div",{className:"emoji-mart-preview-name"},e.name),m.a.createElement("div",{className:"emoji-mart-preview-shortnames"},u.short_names.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-shortname"},":",e,":")}))),m.a.createElement("div",{className:"emoji-mart-preview-emoticons"},c.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-emoticon"},e)})))))}return m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},o&&o.length&&Hh(Jh({emoji:o,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("span",{className:"emoji-mart-title-label"},r)),a&&m.a.createElement("div",{className:"emoji-mart-preview-skins".concat(n.skinEmoji?" custom":"")},n.skinEmoji?m.a.createElement(Qh,{skin:n.skin,emojiProps:i,data:this.data,skinEmoji:n.skinEmoji,i18n:s,onChange:n.onChange}):m.a.createElement(Zh,{skin:n.skin,i18n:s,onChange:n.onChange})))}}]),t}(m.a.PureComponent);ep.propTypes={showSkinTones:ig.a.bool,title:ig.a.string.isRequired,emoji:ig.a.string.isRequired,emojiProps:ig.a.object.isRequired,skinsProps:ig.a.object.isRequired},ep.defaultProps={showSkinTones:!0,onChange:function(){}};var tp=0,ip=function(e){function t(e){var i,n,a,r;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).state={icon:Nh.search,isSearching:!1,id:++tp},i.data=e.data,i.emojiIndex=new uh(i.data),i.setRef=i.setRef.bind(Th()(i)),i.clear=i.clear.bind(Th()(i)),i.handleKeyUp=i.handleKeyUp.bind(Th()(i)),i.handleChange=(n=i.handleChange.bind(Th()(i)),a="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,r=!1,function(){r||(r=!0,a((function(){r=!1,n()})))}),i}return Ch()(t,e),Uf()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:Nh.search,isSearching:!1}):this.setState({icon:Nh.delete,isSearching:!0}),this.props.onSearch(this.emojiIndex.search(e,{emojisToShowFilter:this.props.emojisToShowFilter,maxResults:this.props.maxResults,include:this.props.include,exclude:this.props.exclude,custom:this.props.custom}))}},{key:"clear",value:function(){""!=this.input.value&&(this.input.value="",this.input.focus(),this.search(""))}},{key:"handleChange",value:function(){this.input&&this.search(this.input.value)}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.clear()}},{key:"setRef",value:function(e){this.input=e}},{key:"render",value:function(){var e=this.props,t=e.i18n,i=e.autoFocus,n=this.state,a=n.icon,r=n.isSearching,o=n.id,s="emoji-mart-search-".concat(o);return m.a.createElement("section",{className:"emoji-mart-search","aria-label":t.search},m.a.createElement("input",{id:s,ref:this.setRef,type:"search",onChange:this.handleChange,placeholder:t.search,autoFocus:i}),m.a.createElement("label",{className:"emoji-mart-sr-only",htmlFor:s},t.search),m.a.createElement("button",{className:"emoji-mart-search-icon",onClick:this.clear,onKeyUp:this.handleKeyUp,"aria-label":t.clear,disabled:!r},a()))}}]),t}(m.a.PureComponent);function np(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ap(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?np(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):np(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}ip.propTypes={onSearch:ig.a.func,maxResults:ig.a.number,emojisToShowFilter:ig.a.func,autoFocus:ig.a.bool},ip.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var rp={search:"Search",clear:"Clear",notfound:"No Emoji Found",skintext:"Choose your default skin tone",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"},categorieslabel:"Emoji categories",skintones:{1:"Default Skin Tone",2:"Light Skin Tone",3:"Medium-Light Skin Tone",4:"Medium Skin Tone",5:"Medium-Dark Skin Tone",6:"Dark Skin Tone"}},op=function(e){function t(e){var i;jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).CUSTOM=[],i.RECENT_CATEGORY={id:"recent",name:"Recent",emojis:null},i.SEARCH_CATEGORY={id:"search",name:"Search",emojis:null,anchor:!1},e.data.compressed&&Vf(e.data),i.data=e.data,i.i18n=ih(rp,e.i18n),i.icons=ih(n,e.icons),i.state={firstRender:!0},i.categories=[];var a=[].concat(i.data.categories);if(e.custom.length>0){var r={},o=0;e.custom.forEach((function(e){r[e.customCategory]||(r[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=r[e.customCategory],n=ap({},e,{id:e.short_names[0],custom:!0});t.emojis.push(n),i.CUSTOM.push(n)})),a=a.concat(Object.keys(r).map((function(e){return r[e]})))}i.hideRecent=!0,null!=e.include&&a.sort((function(t,i){return e.include.indexOf(t.id)>e.include.indexOf(i.id)?1:-1}));for(var s=0;s<a.length;s++){var l=a[s],u=!e.include||!e.include.length||e.include.indexOf(l.id)>-1,_=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(l.id)>-1;if(u&&!_)if(e.emojisToShowFilter){for(var d=[],c=l.emojis,g=0;g<c.length;g++){var f=c[g];e.emojisToShowFilter(i.data.emojis[f]||f)&&d.push(f)}if(d.length){var h={emojis:d,name:l.name,id:l.id};i.categories.push(h)}}else i.categories.push(l)}var p=!e.include||!e.include.length||e.include.indexOf(i.RECENT_CATEGORY.id)>-1,m=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(i.RECENT_CATEGORY.id)>-1;return p&&!m&&(i.hideRecent=!1,i.categories.unshift(i.RECENT_CATEGORY)),i.categories[0]&&(i.categories[0].first=!0),i.categories.unshift(i.SEARCH_CATEGORY),i.setAnchorsRef=i.setAnchorsRef.bind(Th()(i)),i.handleAnchorClick=i.handleAnchorClick.bind(Th()(i)),i.setSearchRef=i.setSearchRef.bind(Th()(i)),i.handleSearch=i.handleSearch.bind(Th()(i)),i.setScrollRef=i.setScrollRef.bind(Th()(i)),i.handleScroll=i.handleScroll.bind(Th()(i)),i.handleScrollPaint=i.handleScrollPaint.bind(Th()(i)),i.handleEmojiOver=i.handleEmojiOver.bind(Th()(i)),i.handleEmojiLeave=i.handleEmojiLeave.bind(Th()(i)),i.handleEmojiClick=i.handleEmojiClick.bind(Th()(i)),i.handleEmojiSelect=i.handleEmojiSelect.bind(Th()(i)),i.setPreviewRef=i.setPreviewRef.bind(Th()(i)),i.handleSkinChange=i.handleSkinChange.bind(Th()(i)),i.handleKeyDown=i.handleKeyDown.bind(Th()(i)),i.handleDarkMatchMediaChange=i.handleDarkMatchMediaChange.bind(Th()(i)),i}return Ch()(t,e),Uf()(t,[{key:"componentDidMount",value:function(){var e=this;this.state.firstRender&&(this.testStickyPosition(),this.firstRenderTimeout=setTimeout((function(){e.setState({firstRender:!1})}),60))}},{key:"componentDidUpdate",value:function(){this.updateCategoriesSize(),this.handleScroll()}},{key:"componentWillUnmount",value:function(){this.SEARCH_CATEGORY.emojis=null,clearTimeout(this.leaveTimeout),clearTimeout(this.firstRenderTimeout),this.darkMatchMedia&&this.darkMatchMedia.removeListener(this.handleDarkMatchMediaChange)}},{key:"testStickyPosition",value:function(){var e=document.createElement("div");["","-webkit-","-ms-","-moz-","-o-"].forEach((function(t){return e.style.position="".concat(t,"sticky")})),this.hasStickyPosition=!!e.style.position.length}},{key:"getPreferredTheme",value:function(){return"auto"!=this.props.theme?this.props.theme:this.state.theme?this.state.theme:"function"!=typeof matchMedia?Bh.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?Bh.theme:this.darkMatchMedia.matches?"dark":"light")}},{key:"handleDarkMatchMediaChange",value:function(){this.setState({theme:this.darkMatchMedia.matches?"dark":"light"})}},{key:"handleEmojiOver",value:function(e){var t=this.preview;if(t){var i=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n]);t.setState({emoji:e}),clearTimeout(this.leaveTimeout)}}},{key:"handleEmojiLeave",value:function(e){var t=this.preview;t&&(this.leaveTimeout=setTimeout((function(){t.setState({emoji:null})}),16))}},{key:"handleEmojiClick",value:function(e,t){this.props.onClick(e,t),this.handleEmojiSelect(e)}},{key:"handleEmojiSelect",value:function(e){var t=this;this.props.onSelect(e),this.hideRecent||this.props.recent||mh.add(e);var i=this.categoryRefs["category-1"];if(i){var n=i.maxMargin;this.props.enableFrequentEmojiSort&&i.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(i.memoizeSize(),n!=i.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&i.updateDisplay("none")))}))}}},{key:"handleScroll",value:function(){this.waitingForPaint||(this.waitingForPaint=!0,requestAnimationFrame(this.handleScrollPaint))}},{key:"handleScrollPaint",value:function(){if(this.waitingForPaint=!1,this.scroll){var e=null;if(this.SEARCH_CATEGORY.emojis)e=this.SEARCH_CATEGORY;else{for(var t=this.scroll.scrollTop,i=t>(this.scrollTop||0),n=0,a=0,r=this.categories.length;a<r;a++){var o=i?this.categories.length-1-a:a,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!n||l.top<n)&&l.top>0&&(n=l.top),u&&!e&&(e=s)}}t<n?e=this.categories.filter((function(e){return!(!1===e.anchor)}))[0]:t+this.clientHeight>=this.scrollHeight&&(e=this.categories[this.categories.length-1])}if(e){var _=this.anchors,d=e.name;_.state.selected!=d&&_.setState({selected:d})}this.scrollTop=t}}},{key:"handleSearch",value:function(e){this.SEARCH_CATEGORY.emojis=e;for(var t=0,i=this.categories.length;t<i;t++){var n=this.categoryRefs["category-".concat(t)];if(n&&"Search"!=n.props.name){var a=e?"none":"inherit";n.updateDisplay(a)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var i,n=this.categoryRefs["category-".concat(t)],a=this.scroll;this.anchors;i=function(){if(n){var t=n.top;e.first?t=0:t+=1,a.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(i)):i()}},{key:"handleSkinChange",value:function(e){var t={skin:e},i=this.props.onSkinChange;this.setState(t),lh.update(t),i(e)}},{key:"handleKeyDown",value:function(e){var t=!1;switch(e.keyCode){case 13:var i;this.SEARCH_CATEGORY.emojis&&this.SEARCH_CATEGORY.emojis.length&&(i=Xf(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(i),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var i=this.categoryRefs["category-".concat(e)];i&&i.memoizeSize()}if(this.scroll){var n=this.scroll;this.scrollHeight=n.scrollHeight,this.clientHeight=n.clientHeight}}},{key:"getCategories",value:function(){return this.state.firstRender?this.categories.slice(0,3):this.categories}},{key:"setAnchorsRef",value:function(e){this.anchors=e}},{key:"setSearchRef",value:function(e){this.search=e}},{key:"setPreviewRef",value:function(e){this.preview=e}},{key:"setScrollRef",value:function(e){this.scroll=e}},{key:"setCategoryRef",value:function(e,t){this.categoryRefs||(this.categoryRefs={}),this.categoryRefs[e]=t}},{key:"render",value:function(){var e=this,t=this.props,i=t.perLine,n=t.emojiSize,a=t.set,r=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,u=t.title,_=t.emoji,d=t.color,c=t.native,g=t.backgroundImageFn,f=t.emojisToShowFilter,h=t.showPreview,p=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,E=t.include,y=t.exclude,D=t.recent,v=t.autoFocus,k=t.skinEmoji,S=t.notFound,w=t.notFoundEmoji,C=i*(n+12)+12+2+function(){if("undefined"==typeof document)return 0;var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}(),x=this.getPreferredTheme(),T=this.props.skin||this.state.skin||lh.get("skin")||this.props.defaultSkin;return m.a.createElement("section",{style:ap({width:C},l),className:"emoji-mart emoji-mart-".concat(x),"aria-label":u,onKeyDown:this.handleKeyDown},m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(Mh,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:d,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),m.a.createElement(ip,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:f,include:E,exclude:y,custom:this.CUSTOM,autoFocus:v}),m.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return m.a.createElement($h,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:i,native:c,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?D:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:c,skin:T,size:n,set:a,sheetSize:r,sheetColumns:o,sheetRows:s,forceSize:c,tooltip:F,backgroundImageFn:g,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:S,notFoundEmoji:w})}))),(h||p)&&m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(ep,{ref:this.setPreviewRef,data:this.data,title:u,emoji:_,showSkinTones:p,showPreview:h,emojiProps:{native:c,size:38,skin:T,set:a,sheetSize:r,sheetColumns:o,sheetRows:s,backgroundImageFn:g},skinsProps:{skin:T,onChange:this.handleSkinChange,skinEmoji:k},i18n:this.i18n})))}}]),t}(m.a.PureComponent);function sp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}op.propTypes=ap({},Rh,{data:ig.a.object.isRequired}),op.defaultProps=ap({},Bh);var lp=function(e){function t(){return jf()(this,t),vh()(this,Sh()(t).apply(this,arguments))}return Ch()(t,e),Uf()(t,[{key:"render",value:function(){return m.a.createElement(op,yh()({},this.props,this.state))}}]),t}(m.a.PureComponent);function up(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _p(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?up(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):up(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}lp.propTypes=Rh,lp.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sp(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},Bh,{data:Lf});var dp=function e(t){for(var i in e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);return Hh(_p({},t))};dp.propTypes=Ah,dp.defaultProps=_p({},Ih,{data:Lf});var cp=i(49),gp={insert:"head",singleton:!1},fp=(r()(cp.a,gp),cp.a.locals,i(88));function hp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Bf()(e);if(t){var a=Bf()(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Mf()(this,i)}}var pp=function(e){Af()(i,e);var t=hp(i);function i(){var e;wf()(this,i);for(var n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return e=t.call.apply(t,[this].concat(a)),d()(Of()(e),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),d()(Of()(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return xf()(i,[{key:"render",value:function(){return m.a.createElement(op,{style:{maxWidth:"100%"},data:fp,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect,"data-cy":"neeto-editor-emoji-picker"})}}]),i}(m.a.Component);pp.defaultProps={editor:{},range:{}},pp.propTypes={editor:ig.a.object.isRequired,range:ig.a.object};var mp=pp,Fp=function(e){var t=e.editor,i=Object(p.useRef)();return m.a.createElement(Zg,{ref:i,closeOnSelect:!1,customTarget:function(){var e;return m.a.createElement(rg,{icon:kf,iconActive:null==i||null===(e=i.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Emoji",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-emoji-option-button"})},position:"bottom-start"},m.a.createElement(mp,{editor:t}))},bp=function(e){var t=e.editor,i=e.variables,n=e.setImageUploadVisible,a=e.options,r=e.mentions,o=e.showImageInMention;if(!t)return null;var s=[{Icon:Td,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Nd,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:Rd,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:Id,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Ud,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}].filter((function(e){return a.includes(e.optionName)})),l=[{Icon:$c,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:jd,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"code-block"},{Icon:Qc,command:function(){return n(!0)},active:t.isActive("imageUpload"),optionName:"image-upload"}].filter((function(e){return a.includes(e.optionName)})),u=[{Icon:Xc,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:eg,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}].filter((function(e){return a.includes(e.optionName)})),_=a.includes("font-color"),d=a.includes("font-size"),c=a.includes("emoji"),g=a.includes("link"),f=function(e,t){var i=e.Icon,n=e.command,a=e.active,r=e.optionName;return m.a.createElement(rg,{key:t,icon:i,iconActive:a,onClick:n,tooltipProps:{content:d_(r),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(r,"-option")})};return m.a.createElement("div",{className:"neeto-editor-fixed-menu"},d&&m.a.createElement(Xg,{editor:t}),s.map(f),_&&m.a.createElement(_g,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),c&&m.a.createElement(Fp,{editor:t}),g&&m.a.createElement(Df,{editor:t}),l.map(f),u.map(f),m.a.createElement("div",{className:"neeto-editor-fixed-menu-addons"},m.a.createElement(rf,{editor:t,variables:i}),m.a.createElement(gf,{editor:t,mentions:r,showImageInMention:o})))},Ep=function(e){var t=e.children,i=e.className,n=void 0===i?"root-portal":i,a=e.el,r=void 0===a?"div":a,o=document.getElementsByClassName(n)[0];return o||(o=document.createElement(r)).classList.add(n),m.a.useEffect((function(){document.body.appendChild(o)}),[]),Su.a.createPortal(t,o)},yp=["children","className"],Dp=function(e){var t=e.children,i=e.className,n=h()(e,yp);return m.a.createElement("div",u()({className:b()("ne-backdrop",d()({},i,i))},n),t)},vp=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"],kp=function(){},Sp="xs",wp="sm",Cp="md",xp=function(e){var t=e.size,i=void 0===t?"sm":t,n=e.isOpen,a=void 0!==n&&n,r=e.onClose,o=void 0===r?kp:r,s=e.loading,l=void 0!==s&&s,_=e.children,c=e.className,g=void 0===c?"":c,f=e.closeOnEsc,F=void 0===f||f,E=e.closeButton,y=void 0===E||E,D=e.backdropClassName,v=void 0===D?"":D,k=e.closeOnOutsideClick,S=void 0===k||k,w=h()(e,vp),C=Object(p.useRef)();return S&&Vg(C,o),F&&Yg("esc",o),m.a.createElement(Ep,{className:"ne-portal"},a&&m.a.createElement(Dp,{key:"modal-backdrop",className:b()("ne-modal__backdrop",v)},m.a.createElement("div",u()({ref:C,key:"modal-wrapper",className:b()("ne-modal__wrapper",d()({"ne-modal__wrapper--xs":i===Sp,"ne-modal__wrapper--sm":i===wp,"ne-modal__wrapper--md":i===Cp},g,g))},w),y&&m.a.createElement(qc,{style:"text",icon:oc,className:"ne-modal__close",onClick:o}),l?m.a.createElement(m.a.Fragment,null):_)))},Tp=["children","size","noUnderline","className"],Op=["active","className","children","icon","onClick","activeClassName"],Np=function(){},Ap="large",Rp=function(e){var t=e.children,i=e.size,n=e.noUnderline,a=e.className,r=void 0===a?"":a,o=h()(e,Tp);return m.a.createElement("div",u()({className:b()({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":i===Ap},{"ne-tab__wrapper--underline-none":n},[r]),"data-cy":"tab-container"},o),t)};Rp.Item=function(e){var t=e.active,i=e.className,n=void 0===i?"":i,a=e.children,r=e.icon,o=void 0===r?null:r,s=e.onClick,l=void 0===s?Np:s,_=e.activeClassName,d=void 0===_?"":_,c=h()(e,Op),g="button",f="string"==typeof o?function(){return m.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||m.a.Fragment;return d&&(g=Tc),m.a.createElement(g,u()({className:b()(["ne-tab flex items-center justify-center select-none",n],{active:t}),onClick:l,"data-cy":"tab-item"},c),o&&m.a.createElement(f,{className:"ne-tab__icon"}),a)};var Mp=Rp,Ip=function(e){var t,i=Object(p.useState)(null===(t=e[0])||void 0===t?void 0:t.key),n=g()(i,2),a=n[0],r=n[1];return[a,function(e){return r(e.key)}]},Bp=function(e){var t=e.buttonLabel,i=void 0===t?"Submit":t,n=e.placeholder,a=e.onSubmit,r=e.className,o=Object(p.useState)(""),s=g()(o,2),l=s[0],u=s[1],_=Object(p.useState)(""),c=g()(_,2),f=c[0],h=c[1];return m.a.createElement("div",{className:b()("neeto-editor-url-form__wrapper",d()({},r,r))},m.a.createElement(yf,{name:"url",value:l,placeholder:n,onFocus:function(){return h("")},error:f,onChange:function(e){var t=e.target.value;return u(t)},"data-cy":"neeto-editor-image-upload-url-input"}),m.a.createElement(qc,{size:"large",label:i,onClick:function(e){e.preventDefault(),Uc.test(l)?a(l):h("Please enter a valid url")},"data-cy":"neeto-editor-image-upload-url-submit"}))},Lp=i(19),Pp=i.n(Lp),jp=(i(60),i(72),i(73)),qp=i.n(jp),Up=(i(74),i(75),i(76),i(77)),zp=i.n(Up),Gp=i(89),Hp=i.n(Gp),Yp=function(e){var t,i=e.uppy,n=Object(p.useState)(0),a=g()(n,2),r=a[0],o=a[1];Object(p.useEffect)((function(){i.on("progress",o)}),[i]);var s="".concat(r,"%");return m.a.createElement("div",{className:"neeto-editor-image-uploader__progress"},m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(t=i.getFiles()[0])||void 0===t?void 0:t.name),m.a.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},m.a.createElement("div",{className:"neeto-editor-progress-bar__percent"},m.a.createElement("p",null,s),m.a.createElement(qc,{icon:oc,onClick:function(){return i.cancelAll()},size:"small",style:"text"})),m.a.createElement("div",{className:"neeto-editor-progress-bar__indicator"},m.a.createElement("div",{style:{width:s},className:"neeto-editor-progress-bar__indicator-inner"}))))};function Vp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var Wp={allowMultipleUploads:!1,autoProceed:!0},$p={formData:!0,fieldName:"blob"},Kp=function(e){var t=e.endpoint,i=void 0===t?"/api/v1/direct_uploads/image_upload":t,n=e.onSuccess,a=Object(p.useState)(!1),r=g()(a,2),o=r[0],s=r[1],l=zp()((function(){return new Pp.a(Wp).use(Hp.a,function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Vp(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Vp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({endpoint:i},$p)).on("upload",(function(){return s(!0)})).on("upload-success",(function(e,t){return n(t.body.imageURL)})).on("cancel-all",(function(){return s(!1)})).on("complete",(function(){return s(!1)}))}));return o?m.a.createElement(Yp,{uppy:l}):m.a.createElement(qp.a,{className:"neeto-editor-image-uploader__dnd",note:"Max. File Size: 5MB",locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:l,"data-cy":"neeto-editor-image-local-uploader"})},Qp=i(50),Zp=i.n(Qp),Xp=i(90),Jp=i.n(Xp),em=i(51),tm=i.n(em),im=i(91),nm=i.n(im),am=i(92),rm=i.n(am),om={FONT_COLOR:"font-color",FONT_SIZE:"font-size",BOLD:"bold",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"strike",BLOCKQUOTE:"block-quote",CODE_BLOCK:"code-block",LINK:"link",LIST_BULLETS:"bullet-list",LIST_ORDERED:"ordered-list",IMAGE_UPLOAD:"image-upload",VIDEO_EMBED:"video-embed",EMOJI:"emoji",DIVIDER:"divider",MENTION:"mention"},sm=function(e){var t=e.pageNo,i=e.query,n=e.apiKey;return rm.a.get("https://api.unsplash.com/search/photos",{headers:{Authorization:"Client-ID ".concat(n)},params:{page:t,per_page:30,order_by:"popular",query:i}})},lm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,i=Object(p.useState)(e),n=g()(i,2),a=n[0],r=n[1];return Object(p.useEffect)((function(){var i=setTimeout((function(){r(e)}),t);return function(){clearTimeout(i)}}),[e]),a},um=function(){return m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__loader"},m.a.createElement("span",{className:"neeto-editor-unsplash-gallery__spinner-icon"}))},_m=function(e){var t=e.onSubmit,i=e.unsplashApiKey,n=Object(p.useRef)(null),a=Object(p.useState)(""),r=g()(a,2),o=r[0],s=r[1],l=Object(p.useState)(!1),u=g()(l,2),_=u[0],d=u[1],c=Object(p.useState)([]),f=g()(c,2),h=f[0],F=f[1],b=Object(p.useState)(1),E=g()(b,2),y=E[0],D=E[1],v=Object(p.useState)(!0),k=g()(v,2),S=k[0],w=k[1],C=Object(p.useState)(!1),x=g()(C,2),T=x[0],O=x[1],N=lm(o||"latest");Object(p.useEffect)((function(){A(1)}),[N]);var A=function(){var e=Jp()(tm.a.mark((function e(t){var n,a,r,o;return tm.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,O(!0),d(!1),e.next=5,sm({page:t,query:N,apiKey:i});case 5:n=e.sent,a=n.data,r=a.results,o=a.total_pages,F(1===t?r:[].concat(Zp()(h),Zp()(r))),D(t+1),w(t<o),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),d(!0);case 15:return e.prev=15,O(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,12,15,18]])})));return function(t){return e.apply(this,arguments)}}();return m.a.createElement("div",{className:"neeto-editor-unsplash-wrapper"},m.a.createElement(yf,{name:"text",value:o,placeholder:"Search Unsplash",onChange:function(e){var t=e.target.value;s(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),_&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!_&&!T&&f_(h)&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!_&&m.a.createElement("div",{className:"neeto-editor-unsplash-container"},m.a.createElement(nm.a,{ref:n,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:S,loadMore:function(){!T&&S&&y>1&&A(y)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:m.a.createElement(um,{key:0})},h&&h.map((function(e,i){return m.a.createElement("div",{key:i,className:"neeto-editor-unsplash-gallery__item","data-cy":"neeto-editor-unsplash-image-picker-result-".concat(i)},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:"".concat(e.height/e.width*100,"%")}},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:"unsplashImage".concat(i)},m.a.createElement("img",{src:e.urls.regular,onClick:function(){return t(e.urls.small)}}),m.a.createElement("a",{href:"https://unsplash.com/@".concat(e.user.username),target:"_blank",rel:"noreferrer"},e.user.name," "))))}))),!S&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},dm=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}],cm=function(e){var t=e.editor,i=e.imageUploadUrl,n=e.isVisible,a=e.setIsVisible,r=e.unsplashApiKey,o=e.isUnsplashImageUploadActive,s=Ip(dm),l=g()(s,2),u=l[0],_=l[1],d=function(e){t.chain().focus().setImage({src:e}).run(),a(!1)},c={local:function(){return m.a.createElement(Kp,{endpoint:i,onSuccess:d})},link:function(){return m.a.createElement(Bp,{onSubmit:d,buttonLabel:"Upload Image",placeholder:"Paste the image link"})},unsplash:function(){return m.a.createElement(_m,{unsplashApiKey:r,onSubmit:d})}}[u];return m.a.createElement(xp,{isOpen:n,onClose:function(){return a(!1)},closeButton:!1},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement(Mp,null,dm.filter((function(e){return"unsplash"!==e.key||o})).map((function(e){return m.a.createElement(Mp.Item,{key:e.key,active:u===e.key,onClick:function(){return _(e)}},e.title)}))),m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},m.a.createElement(c,null))))};function gm(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var fm=function(e){var t=e.strategy,i=e.style,n=e.ref,a=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gm(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gm(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},i);return a["min-height"]&&(a.minHeight=a["min-height"],delete a["min-height"]),"flexible"===t&&n.current&&(a.height=n.current.scrollHeight),a},hm=["editor","className","style","strategy","limit"],pm=function(e){var t=e.editor,i=e.className,n=e.style,a=e.strategy,r=e.limit,o=h()(e,hm),s=t.inputFieldRef,l=t.onChange,_=t.state.length;return m.a.createElement("textarea",u()({ref:s,onChange:function(e){return l(e.target.value)},onKeyDown:function(e){_>=r&&"Backspace"!==e.key&&e.preventDefault()},className:b()("ProseMirror neeto-editor-markdown",d()({},i,i)),style:fm({style:n,strategy:a,ref:s}),"data-cy":"neeto-editor-markdown-editor",role:"textbox"},o))},mm=function(e){var t=e.count,i=e.limit,n="limit"===e.strategy&&i;return m.a.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},n?"".concat(i-t," characters remaining"):"".concat(t," characters"))},Fm=i(38),bm=i.n(Fm),Em=i(93);function ym(e,t){return Array(t+1).join(e)}var Dm=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function vm(e){return Cm(e,Dm)}var km=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Sm(e){return Cm(e,km)}var wm=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Cm(e,t){return t.indexOf(e.nodeName)>=0}function xm(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var Tm={};function Om(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function Nm(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function Am(e,t,i){for(var n=0;n<e.length;n++){var a=e[n];if(Rm(a,t,i))return a}}function Rm(e,t,i){var n=e.filter;if("string"==typeof n){if(n===t.nodeName.toLowerCase())return!0}else if(Array.isArray(n)){if(n.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof n)throw new TypeError("`filter` needs to be a string, array, or function");if(n.call(e,t,i))return!0}}function Mm(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Im(e,t,i){return e&&e.parentNode===t||i(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}Tm.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},Tm.lineBreak={filter:"br",replacement:function(e,t,i){return i.br+"\n"}},Tm.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,i){var n=Number(t.nodeName.charAt(1));return"setext"===i.headingStyle&&n<3?"\n\n"+e+"\n"+ym(1===n?"=":"-",e.length)+"\n\n":"\n\n"+ym("#",n)+" "+e+"\n\n"}},Tm.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},Tm.list={filter:["ul","ol"],replacement:function(e,t){var i=t.parentNode;return"LI"===i.nodeName&&i.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},Tm.listItem={filter:"li",replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var n=i.bulletListMarker+" ",a=t.parentNode;if("OL"===a.nodeName){var r=a.getAttribute("start"),o=Array.prototype.indexOf.call(a.children,t);n=(r?Number(r)+o:o+1)+". "}return n+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},Tm.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},Tm.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){for(var n,a=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],r=t.firstChild.textContent,o=i.fence.charAt(0),s=3,l=new RegExp("^"+o+"{3,}","gm");n=l.exec(r);)n[0].length>=s&&(s=n[0].length+1);var u=ym(o,s);return"\n\n"+u+a+"\n"+r.replace(/\n$/,"")+"\n"+u+"\n\n"}},Tm.horizontalRule={filter:"hr",replacement:function(e,t,i){return"\n\n"+i.hr+"\n\n"}},Tm.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var i=t.getAttribute("href"),n=Om(t.getAttribute("title"));return n&&(n=' "'+n+'"'),"["+e+"]("+i+n+")"}},Tm.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,i){var n,a,r=t.getAttribute("href"),o=Om(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),i.linkReferenceStyle){case"collapsed":n="["+e+"][]",a="["+e+"]: "+r+o;break;case"shortcut":n="["+e+"]",a="["+e+"]: "+r+o;break;default:var s=this.references.length+1;n="["+e+"]["+s+"]",a="["+s+"]: "+r+o}return this.references.push(a),n},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},Tm.emphasis={filter:["em","i"],replacement:function(e,t,i){return e.trim()?i.emDelimiter+e+i.emDelimiter:""}},Tm.strong={filter:["strong","b"],replacement:function(e,t,i){return e.trim()?i.strongDelimiter+e+i.strongDelimiter:""}},Tm.code={filter:function(e){var t=e.previousSibling||e.nextSibling,i="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!i},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",i="`",n=e.match(/`+/gm)||[];-1!==n.indexOf(i);)i+="`";return i+t+e+t+i}},Tm.image={filter:"img",replacement:function(e,t){var i=Om(t.getAttribute("alt")),n=t.getAttribute("src")||"",a=Om(t.getAttribute("title"));return n?"!["+i+"]("+n+(a?' "'+a+'"':"")+")":""}},Nm.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=Am(this.array,e,this.options))||(t=Am(this._keep,e,this.options))||(t=Am(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var Bm="undefined"!=typeof window?window:{};var Lm,Pm,jm=function(){var e=Bm.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?Bm.DOMParser:(Lm=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?Lm.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:Lm.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},Lm);function qm(e,t){var i;"string"==typeof e?i=(Pm=Pm||new jm).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):i=e.cloneNode(!0);return function(e){var t=e.element,i=e.isBlock,n=e.isVoid,a=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!a(t)){for(var r=null,o=!1,s=null,l=Im(s,t,a);l!==t;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \r\n\t]+/g," ");if(r&&!/ $/.test(r.data)||o||" "!==u[0]||(u=u.substr(1)),!u){l=Mm(l);continue}l.data=u,r=l}else{if(1!==l.nodeType){l=Mm(l);continue}i(l)||"BR"===l.nodeName?(r&&(r.data=r.data.replace(/ $/,"")),r=null,o=!1):n(l)||a(l)?(r=null,o=!0):r&&(o=!1)}var _=Im(s,l,a);s=l,l=_}r&&(r.data=r.data.replace(/ $/,""),r.data||Mm(r))}}({element:i,isBlock:vm,isVoid:Sm,isPre:t.preformattedCode?Um:null}),i}function Um(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function zm(e,t){return e.isBlock=vm(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!Sm(e)&&!function(e){return Cm(e,wm)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return xm(e,km)}(e)&&!function(e){return xm(e,wm)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var i=(n=e.textContent,a=n.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/),{leading:a[1],leadingAscii:a[2],leadingNonAscii:a[3],trailing:a[4],trailingNonAscii:a[5],trailingAscii:a[6]});var n,a;i.leadingAscii&&Gm("left",e,t)&&(i.leading=i.leadingNonAscii);i.trailingAscii&&Gm("right",e,t)&&(i.trailing=i.trailingNonAscii);return{leading:i.leading,trailing:i.trailing}}(e,t),e}function Gm(e,t,i){var n,a,r;return"left"===e?(n=t.previousSibling,a=/ $/):(n=t.nextSibling,a=/^ /),n&&(3===n.nodeType?r=a.test(n.nodeValue):i.preformattedCode&&"CODE"===n.nodeName?r=!1:1!==n.nodeType||vm(n)||(r=a.test(n.textContent))),r}var Hm=Array.prototype.reduce,Ym=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Vm(e){if(!(this instanceof Vm))return new Vm(e);var t={rules:Tm,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])}return e}({},t,e),this.rules=new Nm(this.options)}function Wm(e){var t=this;return Hm.call(e.childNodes,(function(e,i){var n="";return 3===(i=new zm(i,t.options)).nodeType?n=i.isCode?i.nodeValue:t.escape(i.nodeValue):1===i.nodeType&&(n=Km.call(t,i)),Qm(e,n)}),"")}function $m(e){var t=this;return this.rules.forEach((function(i){"function"==typeof i.append&&(e=Qm(e,i.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Km(e){var t=this.rules.forNode(e),i=Wm.call(this,e),n=e.flankingWhitespace;return(n.leading||n.trailing)&&(i=i.trim()),n.leading+t.replacement(i,e,this.options)+n.trailing}function Qm(e,t){var i=function(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),n=t.replace(/^\n*/,""),a=Math.max(e.length-i.length,t.length-n.length);return i+"\n\n".substring(0,a)+n}Vm.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=Wm.call(this,new qm(e,this.options));return $m.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return Ym.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};var Zm=Vm,Xm=function(e){e=e.replaceAll(/^\\$/gm,"<p></p>");var t=Em.marked.parse(e,{sanitize:!1});return t=(t=(t=(t=t.replaceAll(/<p><img[^>]*><\/p>/g,(function(e){return e.replace(/<\/?p>/g,"")}))).replaceAll(/!\[(.*?)\]\((.*?)\)/g,(function(e,t,i){return'<img src="'.concat(i,'" alt="').concat(t,'">')}))).replaceAll(/==([^=]+)==/g,"<mark>$1</mark>")).replaceAll(/--([^-]+)--/g,"<u>$1</u>"),bm.a.sanitize(t,{ADD_TAGS:["iframe"]})},Jm=function(e){var t=new Zm({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){return t.isBlock?"\\\n":""}});return t.keep(["iframe"]),t.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~".concat(e,"~")}}),t.addRule("highlight",{filter:["mark"],replacement:function(e){return"==".concat(e,"==")}}),t.addRule("underline",{filter:["u"],replacement:function(e){return"--".concat(e,"--")}}),t.turndown(e)},eF=function(e){var t=document.createElement("div");return t.innerHTML=e,t.textContent},tF=function(e){var t=e.content,i=e.onUpdate,n=e.onSubmit,a=Object(p.useState)((function(){return t?{content:Jm(t),length:eF(t).length}:{content:"",length:0}})),r=g()(a,2),o=r[0],s=r[1],l=Object(p.useRef)(),u=Object(p.useRef)();u.current=o.content;var _=Object(p.useCallback)((function(e){if(l.current){var t=Jm(e),i=eF(e);s({content:t,length:i.length}),l.current.textContent=t}}),[s]),d=Object(p.useCallback)((function(){return Xm(u.current)}),[u]),c=Object(p.useCallback)((function(){var e=d();return eF(e)}),[u]),f=Object(p.useCallback)((function(e){var t;if("Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null===(t=l.current)||void 0===t||t.blur(),n)){var i=d();n({markdown:u.current,html:i})}}),[u]);Object(p.useEffect)((function(){return document.addEventListener("keydown",f),function(){document.removeEventListener("keydown",f)}}),[f]),Object(p.useEffect)((function(){l.current&&(l.current.textContent=u.current)}),[l,u]);var h=Object(p.useMemo)((function(){return{setContent:_}}),[_]);return{inputFieldRef:l,state:o,onChange:function(e){var t=Xm(e),n=eF(t);s({content:e,length:n.length}),i({markdown:e,html:t})},isEmpty:o.length<=0,getHTML:d,getText:c,commands:h}};const iF=/^\s*>\s$/,nF=cs.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBlockquote:()=>({commands:e})=>e.wrapIn("blockquote"),toggleBlockquote:()=>({commands:e})=>e.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:e})=>e.lift("blockquote")}),addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[bs({find:iF,type:this.type})]}}),aF=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,rF=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,oF=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,sF=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,lF=gs.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBold:()=>({commands:e})=>e.setMark("bold"),toggleBold:()=>({commands:e})=>e.toggleMark("bold"),unsetBold:()=>({commands:e})=>e.unsetMark("bold")}),addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ps({find:aF,type:this.type}),ps({find:oF,type:this.type})]},addPasteRules(){return[Es({find:rF,type:this.type}),Es({find:sF,type:this.type})]}}),uF=/^\s*([-+*])\s$/,_F=cs.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[bs({find:uF,type:this.type})]}}),dF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,cF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,gF=gs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setCode:()=>({commands:e})=>e.setMark("code"),toggleCode:()=>({commands:e})=>e.toggleMark("code"),unsetCode:()=>({commands:e})=>e.unsetMark("code")}),addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ps({find:dF,type:this.type})]},addPasteRules(){return[Es({find:cF,type:this.type})]}}),fF=/^```(?<language>[a-z]*)?[\s\n]$/,hF=/^~~~(?<language>[a-z]*)?[\s\n]$/,pF=cs.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:i}=this.options,n=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(i)).map(e=>e.replace(i,""))[0];return n||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands:()=>({setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,i=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!i&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[ms({find:fF,type:this.type,getAttributes:({groups:e})=>e}),ms({find:hF,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Rt({key:new Bt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const i=t.clipboardData.getData("text/plain"),n=t.clipboardData.getData("vscode-editor-data"),a=n?JSON.parse(n):void 0,r=null==a?void 0:a.mode;if(!i||!r)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:r})),o.setSelection(mt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(i.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}});var mF=cs.create({name:"doc",topNode:!0,content:"block+"});var FF=function(e,t){var i=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var n=function(e){return i[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))};FF.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var i=t.name,n=t.handler;return e.editorView.dom.removeEventListener(i,n)}))},FF.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())},FF.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},FF.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var i=t.nodeBefore,n=t.nodeAfter;if(i||n){var a=this.editorView.nodeDOM(this.cursorPos-(i?i.nodeSize:0)).getBoundingClientRect(),r=i?a.bottom:a.top;i&&n&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:a.left,right:a.right,top:r-this.width/2,bottom:r+this.width/2}}}if(!e){var o=this.editorView.coordsAtPos(this.cursorPos);e={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var _=u.getBoundingClientRect();s=_.left-u.scrollLeft,l=_.top-u.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},FF.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},FF.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Je(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},FF.prototype.dragend=function(){this.scheduleRemoval(20)},FF.prototype.drop=function(){this.scheduleRemoval(20)},FF.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const bF=mr.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Rt({view:function(t){return new FF(t,e)}}))];var e}});var EF=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,n){var a=i.resolve(n.map(this.head));return t.valid(a)?new t(a):e.near(a)},t.prototype.content=function(){return T.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(i.pos))},t.prototype.getBookmark=function(){return new yF(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var i=e.index(t);if(0!=i)for(var n=e.node(t).child(i-1);;n=n.lastChild){if(0==n.childCount&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var i=e.indexAfter(t),n=e.node(t);if(i!=n.childCount)for(var a=n.child(i);;a=a.firstChild){if(0==a.childCount&&!a.inlineContent||a.isAtom||a.type.spec.isolating)return!0;if(a.inlineContent)return!1}}return!0}(e))return!1;var i=t.type.spec.allowGapCursor;if(null!=i)return i;var n=t.contentMatchAt(e.index()).defaultType;return n&&n.isTextblock},t.findFrom=function(e,i,n){e:for(;;){if(!n&&t.valid(e))return e;for(var a=e.pos,r=null,o=e.depth;;o--){var s=e.node(o);if(i>0?e.indexAfter(o)<s.childCount:e.index(o)>0){r=s.child(i>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;a+=i;var l=e.doc.resolve(a);if(t.valid(l))return l}for(;;){var u=i>0?r.firstChild:r.lastChild;if(!u){if(r.isAtom&&!r.isText&&!bt.isSelectable(r)){e=e.doc.resolve(a+r.nodeSize*i),n=!1;continue e}break}r=u,a+=i;var _=e.doc.resolve(a);if(t.valid(_))return _}return null}},t}(ft);EF.prototype.visible=!1,ft.jsonID("gapcursor",EF);var yF=function(e){this.pos=e};yF.prototype.map=function(e){return new yF(e.map(this.pos))},yF.prototype.resolve=function(e){var t=e.resolve(this.pos);return EF.valid(t)?new EF(t):ft.near(t)};var DF=dr({ArrowLeft:vF("horiz",-1),ArrowRight:vF("horiz",1),ArrowUp:vF("vert",-1),ArrowDown:vF("vert",1)});function vF(e,t){var i="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,n,a){var r=e.selection,o=t>0?r.$to:r.$from,s=r.empty;if(r instanceof mt){if(!a.endOfTextblock(i)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=EF.findFrom(o,t,s);return!!l&&(n&&n(e.tr.setSelection(new EF(l))),!0)}}function kF(e,t,i){if(!e.editable)return!1;var n=e.state.doc.resolve(t);if(!EF.valid(n))return!1;var a=e.posAtCoords({left:i.clientX,top:i.clientY}).inside;return!(a>-1&&bt.isSelectable(e.state.doc.nodeAt(a)))&&(e.dispatch(e.state.tr.setSelection(new EF(n))),!0)}function SF(e){if(!(e.selection instanceof EF))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ma.create(e.doc,[Oa.widget(e.selection.head,t,{key:"gapcursor"})])}const wF=mr.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Rt({props:{decorations:SF,createSelectionBetween:function(e,t,i){if(t.pos==i.pos&&EF.valid(i))return new EF(i)},handleClick:kF,handleKeyDown:DF}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=hr(pr(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),CF=cs.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",as(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:i,editor:n})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:a}=n.extensionManager,r=i.storedMarks||i.selection.$to.parentOffset&&i.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:i})=>{if(i&&r&&e){const e=r.filter(e=>a.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),xF=cs.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:"h"+e,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return["h"+(this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]),as(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode("heading",e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode("heading","paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,["Mod-Alt-"+t]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>ms({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var TF=function(){};TF.prototype.append=function(e){return e.length?(e=TF.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},TF.prototype.prepend=function(e){return e.length?TF.from(e).append(this):this},TF.prototype.appendInner=function(e){return new NF(this,e)},TF.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?TF.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},TF.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},TF.prototype.forEach=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length),t<=i?this.forEachInner(e,t,i,0):this.forEachInvertedInner(e,t,i,0)},TF.prototype.map=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length);var n=[];return this.forEach((function(t,i){return n.push(e(t,i))}),t,i),n},TF.from=function(e){return e instanceof TF?e:e&&e.length?new OF(e):TF.empty};var OF=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,i){return 0==e&&i==this.length?this:new t(this.values.slice(e,i))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,i,n){for(var a=t;a<i;a++)if(!1===e(this.values[a],n+a))return!1},t.prototype.forEachInvertedInner=function(e,t,i,n){for(var a=t-1;a>=i;a--)if(!1===e(this.values[a],n+a))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},i.length.get=function(){return this.values.length},i.depth.get=function(){return 0},Object.defineProperties(t.prototype,i),t}(TF);TF.empty=new OF([]);var NF=function(e){function t(t,i){e.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,i,n){var a=this.left.length;return!(t<a&&!1===this.left.forEachInner(e,t,Math.min(i,a),n))&&(!(i>a&&!1===this.right.forEachInner(e,Math.max(t-a,0),Math.min(this.length,i)-a,n+a))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,i,n){var a=this.left.length;return!(t>a&&!1===this.right.forEachInvertedInner(e,t-a,Math.max(i,a)-a,n+a))&&(!(i<a&&!1===this.left.forEachInvertedInner(e,Math.min(t,a),i,n))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var i=this.left.length;return t<=i?this.left.slice(e,t):e>=i?this.right.slice(e-i,t-i):this.left.slice(e,i).append(this.right.slice(0,t-i))},t.prototype.leafAppend=function(e){var i=this.right.leafAppend(e);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(e){var i=this.left.leafPrepend(e);if(i)return new t(i,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(TF),AF=TF,RF=function(e,t){this.items=e,this.eventCount=t};RF.prototype.popEvent=function(e,t){var i=this;if(0==this.eventCount)return null;for(var n,a,r=this.items.length;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(n=this.remapping(r,this.items.length),a=n.maps.length);var o,s,l=e.tr,u=[],_=[];return this.items.forEach((function(e,t){if(!e.step)return n||(n=i.remapping(r,t+1),a=n.maps.length),a--,void _.push(e);if(n){_.push(new MF(e.map));var d,c=e.step.map(n.slice(a));c&&l.maybeStep(c).doc&&(d=l.mapping.maps[l.mapping.maps.length-1],u.push(new MF(d,null,null,u.length+_.length))),a--,d&&n.appendMap(d,a)}else l.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(a)):e.selection,s=new RF(i.items.slice(0,r).append(_.reverse().concat(u)),i.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}},RF.prototype.addTransform=function(e,t,i,n){for(var a=[],r=this.eventCount,o=this.items,s=!n&&o.length?o.get(o.length-1):null,l=0;l<e.steps.length;l++){var u,_=e.steps[l].invert(e.docs[l]),d=new MF(e.mapping.maps[l],_,t);(u=s&&s.merge(d))&&(d=u,l?a.pop():o=o.slice(0,o.length-1)),a.push(d),t&&(r++,t=null),n||(s=d)}var c,g,f,h=r-i.depth;return h>BF&&(g=h,(c=o).forEach((function(e,t){if(e.selection&&0==g--)return f=t,!1})),o=c.slice(f),r-=h),new RF(o.append(a),r)},RF.prototype.remapping=function(e,t){var i=new Ie;return this.items.forEach((function(t,n){var a=null!=t.mirrorOffset&&n-t.mirrorOffset>=e?i.maps.length-t.mirrorOffset:null;i.appendMap(t.map,a)}),e,t),i},RF.prototype.addMaps=function(e){return 0==this.eventCount?this:new RF(this.items.append(e.map((function(e){return new MF(e)}))),this.eventCount)},RF.prototype.rebased=function(e,t){if(!this.eventCount)return this;var i=[],n=Math.max(0,this.items.length-t),a=e.mapping,r=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),n);var s=t;this.items.forEach((function(t){var n=a.getMirror(--s);if(null!=n){r=Math.min(r,n);var l=a.maps[n];if(t.step){var u=e.steps[n].invert(e.docs[n]),_=t.selection&&t.selection.map(a.slice(s+1,n));_&&o++,i.push(new MF(l,u,_))}else i.push(new MF(l))}}),n);for(var l=[],u=t;u<r;u++)l.push(new MF(a.maps[u]));var _=this.items.slice(0,n).append(l).append(i),d=new RF(_,o);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-i.length)),d},RF.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},RF.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),i=t.maps.length,n=[],a=0;return this.items.forEach((function(r,o){if(o>=e)n.push(r),r.selection&&a++;else if(r.step){var s=r.step.map(t.slice(i)),l=s&&s.getMap();if(i--,l&&t.appendMap(l,i),s){var u=r.selection&&r.selection.map(t.slice(i));u&&a++;var _,d=new MF(l.invert(),s,u),c=n.length-1;(_=n.length&&n[c].merge(d))?n[c]=_:n.push(d)}}else r.map&&i--}),this.items.length,0),new RF(AF.from(n.reverse()),a)},RF.empty=new RF(AF.empty,0);var MF=function(e,t,i,n){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=n};MF.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new MF(t.getMap().invert(),t,this.selection)}};var IF=function(e,t,i,n){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=n},BF=20;function LF(e){var t=[];return e.forEach((function(e,i,n,a){return t.push(n,a)})),t}function PF(e,t){if(!e)return null;for(var i=[],n=0;n<e.length;n+=2){var a=t.map(e[n],1),r=t.map(e[n+1],-1);a<=r&&i.push(a,r)}return i}function jF(e,t,i,n){var a=zF(t),r=GF.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,a);if(o){var s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),r,a),u=new IF(n?l:o.remaining,n?o.remaining:l,null,0);i(o.transform.setSelection(s).setMeta(GF,{redo:n,historyState:u}).scrollIntoView())}}var qF=!1,UF=null;function zF(e){var t=e.plugins;if(UF!=t){qF=!1,UF=t;for(var i=0;i<t.length;i++)if(t[i].spec.historyPreserveItems){qF=!0;break}}return qF}var GF=new Bt("history"),HF=new Bt("closeHistory");function YF(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Rt({key:GF,state:{init:function(){return new IF(RF.empty,RF.empty,null,0)},apply:function(t,i,n){return function(e,t,i,n){var a,r=i.getMeta(GF);if(r)return r.historyState;i.getMeta(HF)&&(e=new IF(e.done,e.undone,null,0));var o=i.getMeta("appendedTransaction");if(0==i.steps.length)return e;if(o&&o.getMeta(GF))return o.getMeta(GF).redo?new IF(e.done.addTransform(i,null,n,zF(t)),e.undone,LF(i.mapping.maps[i.steps.length-1]),e.prevTime):new IF(e.done,e.undone.addTransform(i,null,n,zF(t)),null,e.prevTime);if(!1===i.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(a=i.getMeta("rebased"))?new IF(e.done.rebased(i,a),e.undone.rebased(i,a),PF(e.prevRanges,i.mapping),e.prevTime):new IF(e.done.addMaps(i.mapping.maps),e.undone.addMaps(i.mapping.maps),PF(e.prevRanges,i.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(i.time||0)-n.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var i=!1;return e.mapping.maps[0].forEach((function(e,n){for(var a=0;a<t.length;a+=2)e<=t[a+1]&&n>=t[a]&&(i=!0)})),i}(i,e.prevRanges)),l=o?PF(e.prevRanges,i.mapping):LF(i.mapping.maps[i.steps.length-1]);return new IF(e.done.addTransform(i,s?t.selection.getBookmark():null,n,zF(t)),RF.empty,l,i.time)}(i,n,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var i="historyUndo"==t.inputType?VF(e.state,e.dispatch):"historyRedo"==t.inputType&&WF(e.state,e.dispatch);return i&&t.preventDefault(),i}}}})}function VF(e,t){var i=GF.getState(e);return!(!i||0==i.done.eventCount)&&(t&&jF(i,e,t,!1),!0)}function WF(e,t){var i=GF.getState(e);return!(!i||0==i.undone.eventCount)&&(t&&jF(i,e,t,!0),!0)}const $F=mr.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>VF(e,t),redo:()=>({state:e,dispatch:t})=>WF(e,t)}),addProseMirrorPlugins(){return[YF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),KF=cs.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",as(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:i}=e,{empty:n,$anchor:a}=i,r=a.parent.isTextblock&&!a.parent.type.spec.code&&!a.parent.textContent;if(!n||!r||!t)return!0;const o=a.before(),s=a.start();return e.deleteRange(o,s),e.setSelection(mt.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var i;if(t){const{parent:t,pos:n}=e.selection.$from,a=n+1;if(!e.doc.nodeAt(a)){const n=null===(i=t.type.contentMatch.defaultType)||void 0===i?void 0:i.create();n&&(e.insert(a,n),e.setSelection(mt.create(e.doc,a)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[fs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),QF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,ZF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,XF=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,JF=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,eb=gs.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setItalic:()=>({commands:e})=>e.setMark("italic"),toggleItalic:()=>({commands:e})=>e.toggleMark("italic"),unsetItalic:()=>({commands:e})=>e.unsetMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ps({find:QF,type:this.type}),ps({find:XF,type:this.type})]},addPasteRules(){return[Es({find:ZF,type:this.type}),Es({find:JF,type:this.type})]}}),tb=cs.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",as(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),ib=/^(\d+)\.\s$/,nb=cs.create({name:"orderedList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...i}=e;return 1===t?["ol",as(this.options.HTMLAttributes,i),0]:["ol",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[bs({find:ib,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),ab=cs.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),rb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,ob=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,sb=gs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setStrike:()=>({commands:e})=>e.setMark("strike"),toggleStrike:()=>({commands:e})=>e.toggleMark("strike"),unsetStrike:()=>({commands:e})=>e.unsetMark("strike")}),addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ps({find:rb,type:this.type})]},addPasteRules(){return[Es({find:ob,type:this.type})]}});var lb=cs.create({name:"text",group:"inline"});const ub=mr.create({name:"starterKit",addExtensions(){var e,t,i,n,a,r,o,s,l,u,_,d,c,g,f,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(nF.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(lF.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(_F.configure(null===(i=this.options)||void 0===i?void 0:i.bulletList)),!1!==this.options.code&&F.push(gF.configure(null===(n=this.options)||void 0===n?void 0:n.code)),!1!==this.options.codeBlock&&F.push(pF.configure(null===(a=this.options)||void 0===a?void 0:a.codeBlock)),!1!==this.options.document&&F.push(mF.configure(null===(r=this.options)||void 0===r?void 0:r.document)),!1!==this.options.dropcursor&&F.push(bF.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(wF.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(CF.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push(xF.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push($F.configure(null===(_=this.options)||void 0===_?void 0:_.history)),!1!==this.options.horizontalRule&&F.push(KF.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&F.push(eb.configure(null===(c=this.options)||void 0===c?void 0:c.italic)),!1!==this.options.listItem&&F.push(tb.configure(null===(g=this.options)||void 0===g?void 0:g.listItem)),!1!==this.options.orderedList&&F.push(nb.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&F.push(ab.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(sb.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(lb.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),_b=Fs({find:/--$/,replace:"—"}),db=Fs({find:/\.\.\.$/,replace:"…"}),cb=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),gb=Fs({find:/"$/,replace:"”"}),fb=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),hb=Fs({find:/'$/,replace:"’"}),pb=Fs({find:/<-$/,replace:"←"}),mb=Fs({find:/->$/,replace:"→"}),Fb=Fs({find:/\(c\)$/,replace:"©"}),bb=Fs({find:/\(tm\)$/,replace:"™"}),Eb=Fs({find:/\(r\)$/,replace:"®"}),yb=Fs({find:/1\/2$/,replace:"½"}),Db=Fs({find:/\+\/-$/,replace:"±"}),vb=Fs({find:/!=$/,replace:"≠"}),kb=Fs({find:/<<$/,replace:"«"}),Sb=Fs({find:/>>$/,replace:"»"}),wb=Fs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),Cb=Fs({find:/\^2$/,replace:"²"}),xb=Fs({find:/\^3$/,replace:"³"}),Tb=Fs({find:/1\/4$/,replace:"¼"}),Ob=Fs({find:/3\/4$/,replace:"¾"}),Nb=mr.create({name:"typography",addInputRules:()=>[_b,db,cb,gb,fb,hb,pb,mb,Fb,bb,Eb,yb,Db,vb,kb,Sb,wb,Cb,xb,Tb,Ob]}),Ab=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,Rb=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,Mb=gs.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:"background-color: "+e.color}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setHighlight:e=>({commands:t})=>t.setMark("highlight",e),toggleHighlight:e=>({commands:t})=>t.toggleMark("highlight",e),unsetHighlight:()=>({commands:e})=>e.unsetMark("highlight")}),addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[ps({find:Ab,type:this.type})]},addPasteRules(){return[Es({find:Rb,type:this.type})]}});var Ib=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var i=0;i<e.length;i++)this.size+=e[i].nodeSize},Bb={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};Ib.prototype.nodesBetween=function(e,t,i,n,a){void 0===n&&(n=0);for(var r=0,o=0;o<t;r++){var s=this.content[r],l=o+s.nodeSize;if(l>e&&!1!==i(s,n+o,a,r)&&s.content.size){var u=o+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),i,n+u)}o=l}},Ib.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},Ib.prototype.textBetween=function(e,t,i,n){var a="",r=!0;return this.nodesBetween(e,t,(function(o,s){o.isText?(a+=o.text.slice(Math.max(e,s)-s,t-s),r=!i):o.isLeaf&&n?(a+="function"==typeof n?n(o):n,r=!i):!r&&o.isBlock&&(a+=i,r=!0)}),0),a},Ib.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,i=e.firstChild,n=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(i)&&(n[n.length-1]=t.withText(t.text+i.text),a=1);a<e.content.length;a++)n.push(e.content[a]);return new Ib(n,this.size+e.size)},Ib.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var i=[],n=0;if(t>e)for(var a=0,r=0;r<t;a++){var o=this.content[a],s=r+o.nodeSize;s>e&&((r<e||s>t)&&(o=o.isText?o.cut(Math.max(0,e-r),Math.min(o.text.length,t-r)):o.cut(Math.max(0,e-r-1),Math.min(o.content.size,t-r-1))),i.push(o),n+=o.nodeSize),r=s}return new Ib(i,n)},Ib.prototype.cutByIndex=function(e,t){return e==t?Ib.empty:0==e&&t==this.content.length?this:new Ib(this.content.slice(e,t))},Ib.prototype.replaceChild=function(e,t){var i=this.content[e];if(i==t)return this;var n=this.content.slice(),a=this.size+t.nodeSize-i.nodeSize;return n[e]=t,new Ib(n,a)},Ib.prototype.addToStart=function(e){return new Ib([e].concat(this.content),this.size+e.nodeSize)},Ib.prototype.addToEnd=function(e){return new Ib(this.content.concat(e),this.size+e.nodeSize)},Ib.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},Bb.firstChild.get=function(){return this.content.length?this.content[0]:null},Bb.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},Bb.childCount.get=function(){return this.content.length},Ib.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},Ib.prototype.maybeChild=function(e){return this.content[e]},Ib.prototype.forEach=function(e){for(var t=0,i=0;t<this.content.length;t++){var n=this.content[t];e(n,i,t),i+=n.nodeSize}},Ib.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,i,n){for(var a=0;;a++){if(a==t.childCount||a==i.childCount)return t.childCount==i.childCount?null:n;var r=t.child(a),o=i.child(a);if(r!=o){if(!r.sameMarkup(o))return n;if(r.isText&&r.text!=o.text){for(var s=0;r.text[s]==o.text[s];s++)n++;return n}if(r.content.size||o.content.size){var l=e(r.content,o.content,n+1);if(null!=l)return l}n+=r.nodeSize}else n+=r.nodeSize}}(this,e,t)},Ib.prototype.findDiffEnd=function(e,t,i){return void 0===t&&(t=this.size),void 0===i&&(i=e.size),function e(t,i,n,a){for(var r=t.childCount,o=i.childCount;;){if(0==r||0==o)return r==o?null:{a:n,b:a};var s=t.child(--r),l=i.child(--o),u=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:n,b:a};if(s.isText&&s.text!=l.text){for(var _=0,d=Math.min(s.text.length,l.text.length);_<d&&s.text[s.text.length-_-1]==l.text[l.text.length-_-1];)_++,n--,a--;return{a:n,b:a}}if(s.content.size||l.content.size){var c=e(s.content,l.content,n-1,a-1);if(c)return c}n-=u,a-=u}else n-=u,a-=u}}(this,e,t,i)},Ib.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return Pb(0,e);if(e==this.size)return Pb(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var i=0,n=0;;i++){var a=n+this.child(i).nodeSize;if(a>=e)return a==e||t>0?Pb(i+1,a):Pb(i,n);n=a}},Ib.prototype.toString=function(){return"<"+this.toStringInner()+">"},Ib.prototype.toStringInner=function(){return this.content.join(", ")},Ib.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},Ib.fromJSON=function(e,t){if(!t)return Ib.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ib(t.map(e.nodeFromJSON))},Ib.fromArray=function(e){if(!e.length)return Ib.empty;for(var t,i=0,n=0;n<e.length;n++){var a=e[n];i+=a.nodeSize,n&&a.isText&&e[n-1].sameMarkup(a)?(t||(t=e.slice(0,n)),t[t.length-1]=a.withText(t[t.length-1].text+a.text)):t&&t.push(a)}return new Ib(t||e,i)},Ib.from=function(e){if(!e)return Ib.empty;if(e instanceof Ib)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ib([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(Ib.prototype,Bb);var Lb={index:0,offset:0};function Pb(e,t){return Lb.index=e,Lb.offset=t,Lb}function jb(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var i=Array.isArray(e);if(Array.isArray(t)!=i)return!1;if(i){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!jb(e[n],t[n]))return!1}else{for(var a in e)if(!(a in t)||!jb(e[a],t[a]))return!1;for(var r in t)if(!(r in e))return!1}return!0}Ib.empty=new Ib([],0);var qb=function(e,t){this.type=e,this.attrs=t};function Ub(e){var t=Error.call(this,e);return t.__proto__=Ub.prototype,t}qb.prototype.addToSet=function(e){for(var t,i=!1,n=0;n<e.length;n++){var a=e[n];if(this.eq(a))return e;if(this.type.excludes(a.type))t||(t=e.slice(0,n));else{if(a.type.excludes(this.type))return e;!i&&a.type.rank>this.type.rank&&(t||(t=e.slice(0,n)),t.push(this),i=!0),t&&t.push(a)}}return t||(t=e.slice()),i||t.push(this),t},qb.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},qb.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},qb.prototype.eq=function(e){return this==e||this.type==e.type&&jb(this.attrs,e.attrs)},qb.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},qb.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var i=e.marks[t.type];if(!i)throw new RangeError("There is no mark type "+t.type+" in this schema");return i.create(t.attrs)},qb.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0},qb.setFrom=function(e){if(!e||0==e.length)return qb.none;if(e instanceof qb)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},qb.none=[],Ub.prototype=Object.create(Error.prototype),Ub.prototype.constructor=Ub,Ub.prototype.name="ReplaceError";var zb=function(e,t,i){this.content=e,this.openStart=t,this.openEnd=i},Gb={size:{configurable:!0}};function Hb(e,t,i){if(i.openStart>e.depth)throw new Ub("Inserted content deeper than insertion position");if(e.depth-i.openStart!=t.depth-i.openEnd)throw new Ub("Inconsistent open depths");return function e(t,i,n,a){var r=t.index(a),o=t.node(a);if(r==i.index(a)&&a<t.depth-n.openStart){var s=e(t,i,n,a+1);return o.copy(o.content.replaceChild(r,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=a||i.depth!=a){var l=function(e,t){for(var i=t.depth-e.openStart,n=t.node(i).copy(e.content),a=i-1;a>=0;a--)n=t.node(a).copy(Ib.from(n));return{start:n.resolveNoCache(e.openStart+i),end:n.resolveNoCache(n.content.size-e.openEnd-i)}}(n,t),u=l.start,_=l.end;return Kb(o,function e(t,i,n,a,r){var o=t.depth>r&&Vb(t,i,r+1),s=a.depth>r&&Vb(n,a,r+1),l=[];$b(null,t,r,l),o&&s&&i.index(r)==n.index(r)?(Yb(o,s),Wb(Kb(o,e(t,i,n,a,r+1)),l)):(o&&Wb(Kb(o,Qb(t,i,r+1)),l),$b(i,n,r,l),s&&Wb(Kb(s,Qb(n,a,r+1)),l));return $b(a,null,r,l),new Ib(l)}(t,u,_,i,a))}var d=t.parent,c=d.content;return Kb(d,c.cut(0,t.parentOffset).append(n.content).append(c.cut(i.parentOffset)))}return Kb(o,Qb(t,i,a))}(e,t,i,0)}function Yb(e,t){if(!t.type.compatibleContent(e.type))throw new Ub("Cannot join "+t.type.name+" onto "+e.type.name)}function Vb(e,t,i){var n=e.node(i);return Yb(n,t.node(i)),n}function Wb(e,t){var i=t.length-1;i>=0&&e.isText&&e.sameMarkup(t[i])?t[i]=e.withText(t[i].text+e.text):t.push(e)}function $b(e,t,i,n){var a=(t||e).node(i),r=0,o=t?t.index(i):a.childCount;e&&(r=e.index(i),e.depth>i?r++:e.textOffset&&(Wb(e.nodeAfter,n),r++));for(var s=r;s<o;s++)Wb(a.child(s),n);t&&t.depth==i&&t.textOffset&&Wb(t.nodeBefore,n)}function Kb(e,t){if(!e.type.validContent(t))throw new Ub("Invalid content for node "+e.type.name);return e.copy(t)}function Qb(e,t,i){var n=[];($b(null,e,i,n),e.depth>i)&&Wb(Kb(Vb(e,t,i+1),Qb(e,t,i+1)),n);return $b(t,null,i,n),new Ib(n)}Gb.size.get=function(){return this.content.size-this.openStart-this.openEnd},zb.prototype.insertAt=function(e,t){var i=function e(t,i,n,a){var r=t.findIndex(i),o=r.index,s=r.offset,l=t.maybeChild(o);if(s==i||l.isText)return a&&!a.canReplace(o,o,n)?null:t.cut(0,i).append(n).append(t.cut(i));var u=e(l.content,i-s-1,n);return u&&t.replaceChild(o,l.copy(u))}(this.content,e+this.openStart,t,null);return i&&new zb(i,this.openStart,this.openEnd)},zb.prototype.removeBetween=function(e,t){return new zb(function e(t,i,n){var a=t.findIndex(i),r=a.index,o=a.offset,s=t.maybeChild(r),l=t.findIndex(n),u=l.index,_=l.offset;if(o==i||s.isText){if(_!=n&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,i).append(t.cut(n))}if(r!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(e(s.content,i-o-1,n-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},zb.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},zb.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},zb.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},zb.fromJSON=function(e,t){if(!t)return zb.empty;var i=t.openStart||0,n=t.openEnd||0;if("number"!=typeof i||"number"!=typeof n)throw new RangeError("Invalid input for Slice.fromJSON");return new zb(Ib.fromJSON(e,t.content),i,n)},zb.maxOpen=function(e,t){void 0===t&&(t=!0);for(var i=0,n=0,a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)i++;for(var r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)n++;return new zb(e,i,n)},Object.defineProperties(zb.prototype,Gb),zb.empty=new zb(Ib.empty,0,0);var Zb=function(e,t,i){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=i},Xb={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};Zb.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},Xb.parent.get=function(){return this.node(this.depth)},Xb.doc.get=function(){return this.node(0)},Zb.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},Zb.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},Zb.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},Zb.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},Zb.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},Zb.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},Zb.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},Xb.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Xb.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var i=this.pos-this.path[this.path.length-1],n=e.child(t);return i?e.child(t).cut(i):n},Xb.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},Zb.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var i=this.path[3*t],n=0==t?0:this.path[3*t-1]+1,a=0;a<e;a++)n+=i.child(a).nodeSize;return n},Zb.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return qb.none;if(this.textOffset)return e.child(t).marks;var i=e.maybeChild(t-1),n=e.maybeChild(t);if(!i){var a=i;i=n,n=a}for(var r=i.marks,o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||n&&r[o].isInSet(n.marks)||(r=r[o--].removeFromSet(r));return r},Zb.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var i=t.marks,n=e.parent.maybeChild(e.index()),a=0;a<i.length;a++)!1!==i[a].type.spec.inclusive||n&&i[a].isInSet(n.marks)||(i=i[a--].removeFromSet(i));return i},Zb.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},Zb.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new iE(this,e,i)},Zb.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},Zb.prototype.max=function(e){return e.pos>this.pos?e:this},Zb.prototype.min=function(e){return e.pos<this.pos?e:this},Zb.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},Zb.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var i=[],n=0,a=t,r=e;;){var o=r.content.findIndex(a),s=o.index,l=o.offset,u=a-l;if(i.push(r,s,n+l),!u)break;if((r=r.child(s)).isText)break;a=u-1,n+=l+1}return new Zb(t,i,a)},Zb.resolveCached=function(e,t){for(var i=0;i<Jb.length;i++){var n=Jb[i];if(n.pos==t&&n.doc==e)return n}var a=Jb[eE]=Zb.resolve(e,t);return eE=(eE+1)%tE,a},Object.defineProperties(Zb.prototype,Xb);var Jb=[],eE=0,tE=12,iE=function(e,t,i){this.$from=e,this.$to=t,this.depth=i},nE={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};nE.start.get=function(){return this.$from.before(this.depth+1)},nE.end.get=function(){return this.$to.after(this.depth+1)},nE.parent.get=function(){return this.$from.node(this.depth)},nE.startIndex.get=function(){return this.$from.index(this.depth)},nE.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(iE.prototype,nE);var aE=Object.create(null),rE=function(e,t,i,n){this.type=e,this.attrs=t,this.content=i||Ib.empty,this.marks=n||qb.none},oE={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};oE.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},oE.childCount.get=function(){return this.content.childCount},rE.prototype.child=function(e){return this.content.child(e)},rE.prototype.maybeChild=function(e){return this.content.maybeChild(e)},rE.prototype.forEach=function(e){this.content.forEach(e)},rE.prototype.nodesBetween=function(e,t,i,n){void 0===n&&(n=0),this.content.nodesBetween(e,t,i,n,this)},rE.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},oE.textContent.get=function(){return this.textBetween(0,this.content.size,"")},rE.prototype.textBetween=function(e,t,i,n){return this.content.textBetween(e,t,i,n)},oE.firstChild.get=function(){return this.content.firstChild},oE.lastChild.get=function(){return this.content.lastChild},rE.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},rE.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},rE.prototype.hasMarkup=function(e,t,i){return this.type==e&&jb(this.attrs,t||e.defaultAttrs||aE)&&qb.sameSet(this.marks,i||qb.none)},rE.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},rE.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},rE.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},rE.prototype.slice=function(e,t,i){if(void 0===t&&(t=this.content.size),void 0===i&&(i=!1),e==t)return zb.empty;var n=this.resolve(e),a=this.resolve(t),r=i?0:n.sharedDepth(t),o=n.start(r),s=n.node(r).content.cut(n.pos-o,a.pos-o);return new zb(s,n.depth-r,a.depth-r)},rE.prototype.replace=function(e,t,i){return Hb(this.resolve(e),this.resolve(t),i)},rE.prototype.nodeAt=function(e){for(var t=this;;){var i=t.content.findIndex(e),n=i.index,a=i.offset;if(!(t=t.maybeChild(n)))return null;if(a==e||t.isText)return t;e-=a+1}},rE.prototype.childAfter=function(e){var t=this.content.findIndex(e),i=t.index,n=t.offset;return{node:this.content.maybeChild(i),index:i,offset:n}},rE.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),i=t.index,n=t.offset;if(n<e)return{node:this.content.child(i),index:i,offset:n};var a=this.content.child(i-1);return{node:a,index:i-1,offset:n-a.nodeSize}},rE.prototype.resolve=function(e){return Zb.resolveCached(this,e)},rE.prototype.resolveNoCache=function(e){return Zb.resolve(this,e)},rE.prototype.rangeHasMark=function(e,t,i){var n=!1;return t>e&&this.nodesBetween(e,t,(function(e){return i.isInSet(e.marks)&&(n=!0),!n})),n},oE.isBlock.get=function(){return this.type.isBlock},oE.isTextblock.get=function(){return this.type.isTextblock},oE.inlineContent.get=function(){return this.type.inlineContent},oE.isInline.get=function(){return this.type.isInline},oE.isText.get=function(){return this.type.isText},oE.isLeaf.get=function(){return this.type.isLeaf},oE.isAtom.get=function(){return this.type.isAtom},rE.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),function(e,t){for(var i=e.length-1;i>=0;i--)t=e[i].type.name+"("+t+")";return t}(this.marks,e)},rE.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},rE.prototype.canReplace=function(e,t,i,n,a){void 0===i&&(i=Ib.empty),void 0===n&&(n=0),void 0===a&&(a=i.childCount);var r=this.contentMatchAt(e).matchFragment(i,n,a),o=r&&r.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(var s=n;s<a;s++)if(!this.type.allowsMarks(i.child(s).marks))return!1;return!0},rE.prototype.canReplaceWith=function(e,t,i,n){if(n&&!this.type.allowsMarks(n))return!1;var a=this.contentMatchAt(e).matchType(i),r=a&&a.matchFragment(this.content,t);return!!r&&r.validEnd},rE.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},rE.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var e=qb.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!qb.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(e){return e.type.name})));this.content.forEach((function(e){return e.check()}))},rE.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e},rE.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var i=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}var n=Ib.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,n,i)},Object.defineProperties(rE.prototype,oE);var sE=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},lE={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};sE.parse=function(e,t){var i=new uE(e,t);if(null==i.next)return sE.empty;var n=dE(i);i.next&&i.err("Unexpected trailing text");var a=function(e){var t=Object.create(null);return function i(n){var a=[];n.forEach((function(t){e[t].forEach((function(t){var i=t.term,n=t.to;if(i){var r=a.indexOf(i),o=r>-1&&a[r+1];mE(e,n).forEach((function(e){o||a.push(i,o=[]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var r=t[n.join(",")]=new sE(n.indexOf(e.length-1)>-1),o=0;o<a.length;o+=2){var s=a[o+1].sort(pE);r.next.push(a[o],t[s.join(",")]||i(s))}return r}(mE(e,0))}(function(e){var t=[[]];return a(function e(t,r){if("choice"==t.type)return t.exprs.reduce((function(t,i){return t.concat(e(i,r))}),[]);if("seq"==t.type)for(var o=0;;o++){var s=e(t.exprs[o],r);if(o==t.exprs.length-1)return s;a(s,r=i())}else{if("star"==t.type){var l=i();return n(r,l),a(e(t.expr,l),l),[n(l)]}if("plus"==t.type){var u=i();return a(e(t.expr,r),u),a(e(t.expr,u),u),[n(u)]}if("opt"==t.type)return[n(r)].concat(e(t.expr,r));if("range"==t.type){for(var _=r,d=0;d<t.min;d++){var c=i();a(e(t.expr,_),c),_=c}if(-1==t.max)a(e(t.expr,_),_);else for(var g=t.min;g<t.max;g++){var f=i();n(_,f),a(e(t.expr,_),f),_=f}return[n(_)]}if("name"==t.type)return[n(r,null,t.value)]}}(e,0),i()),t;function i(){return t.push([])-1}function n(e,i,n){var a={term:n,to:i};return t[e].push(a),a}function a(e,t){e.forEach((function(e){return e.to=t}))}}(n));return function(e,t){for(var i=0,n=[e];i<n.length;i++){for(var a=n[i],r=!a.validEnd,o=[],s=0;s<a.next.length;s+=2){var l=a.next[s],u=a.next[s+1];o.push(l.name),!r||l.isText||l.hasRequiredAttrs()||(r=!1),-1==n.indexOf(u)&&n.push(u)}r&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(a,i),a},sE.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},sE.prototype.matchFragment=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.childCount);for(var n=this,a=t;n&&a<i;a++)n=n.matchType(e.child(a).type);return n},lE.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},lE.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},sE.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var i=0;i<e.next.length;i+=2)if(this.next[t]==e.next[i])return!0;return!1},sE.prototype.fillBefore=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=0);var n=[this];return function a(r,o){var s=r.matchFragment(e,i);if(s&&(!t||s.validEnd))return Ib.from(o.map((function(e){return e.createAndFill()})));for(var l=0;l<r.next.length;l+=2){var u=r.next[l],_=r.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==n.indexOf(_)){n.push(_);var d=a(_,o.concat(u));if(d)return d}}}(this,[])},sE.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var i=this.computeWrapping(e);return this.wrapCache.push(e,i),i},sE.prototype.computeWrapping=function(e){for(var t=Object.create(null),i=[{match:this,type:null,via:null}];i.length;){var n=i.shift(),a=n.match;if(a.matchType(e)){for(var r=[],o=n;o.type;o=o.via)r.push(o.type);return r.reverse()}for(var s=0;s<a.next.length;s+=2){var l=a.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||n.type&&!a.next[s+1].validEnd||(i.push({match:l.contentMatch,type:l,via:n}),t[l.name]=!0)}}},lE.edgeCount.get=function(){return this.next.length>>1},sE.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},sE.prototype.toString=function(){var e=[];return function t(i){e.push(i);for(var n=1;n<i.next.length;n+=2)-1==e.indexOf(i.next[n])&&t(i.next[n])}(this),e.map((function(t,i){for(var n=i+(t.validEnd?"*":" ")+" ",a=0;a<t.next.length;a+=2)n+=(a?", ":"")+t.next[a].name+"->"+e.indexOf(t.next[a+1]);return n})).join("\n")},Object.defineProperties(sE.prototype,lE),sE.empty=new sE(!0);var uE=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},_E={next:{configurable:!0}};function dE(e){var t=[];do{t.push(cE(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function cE(e){var t=[];do{t.push(gE(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function gE(e){for(var t=function(e){if(e.eat("(")){var t=dE(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var i=function(e,t){var i=e.nodeTypes,n=i[t];if(n)return[n];var a=[];for(var r in i){var o=i[r];o.groups.indexOf(t)>-1&&a.push(o)}0==a.length&&e.err("No node type or group '"+t+"' found");return a}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==i.length?i[0]:{type:"choice",exprs:i}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=hE(e,t)}return t}function fE(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function hE(e,t){var i=fE(e),n=i;return e.eat(",")&&(n="}"!=e.next?fE(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:i,max:n,expr:t}}function pE(e,t){return t-e}function mE(e,t){var i=[];return function t(n){var a=e[n];if(1==a.length&&!a[0].term)return t(a[0].to);i.push(n);for(var r=0;r<a.length;r++){var o=a[r],s=o.term,l=o.to;s||-1!=i.indexOf(l)||t(l)}}(t),i.sort(pE)}function FE(e){var t=Object.create(null);for(var i in e){var n=e[i];if(!n.hasDefault)return null;t[i]=n.default}return t}function bE(e,t){var i=Object.create(null);for(var n in e){var a=t&&t[n];if(void 0===a){var r=e[n];if(!r.hasDefault)throw new RangeError("No value supplied for attribute "+n);a=r.default}i[n]=a}return i}function EE(e){var t=Object.create(null);if(e)for(var i in e)t[i]=new vE(e[i]);return t}_E.next.get=function(){return this.tokens[this.pos]},uE.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},uE.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(uE.prototype,_E);var yE=function(e,t,i){this.name=e,this.schema=t,this.spec=i,this.groups=i.group?i.group.split(" "):[],this.attrs=EE(i.attrs),this.defaultAttrs=FE(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(i.inline||"text"==e),this.isText="text"==e},DE={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};DE.isInline.get=function(){return!this.isBlock},DE.isTextblock.get=function(){return this.isBlock&&this.inlineContent},DE.isLeaf.get=function(){return this.contentMatch==sE.empty},DE.isAtom.get=function(){return this.isLeaf||this.spec.atom},yE.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},yE.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},yE.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:bE(this.attrs,e)},yE.prototype.create=function(e,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new rE(this,this.computeAttrs(e),Ib.from(t),qb.setFrom(i))},yE.prototype.createChecked=function(e,t,i){if(t=Ib.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new rE(this,this.computeAttrs(e),t,qb.setFrom(i))},yE.prototype.createAndFill=function(e,t,i){if(e=this.computeAttrs(e),(t=Ib.from(t)).size){var n=this.contentMatch.fillBefore(t);if(!n)return null;t=n.append(t)}var a=this.contentMatch.matchFragment(t).fillBefore(Ib.empty,!0);return a?new rE(this,e,t.append(a),qb.setFrom(i)):null},yE.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0},yE.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},yE.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},yE.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:qb.empty:e},yE.compile=function(e,t){var i=Object.create(null);e.forEach((function(e,n){return i[e]=new yE(e,t,n)}));var n=t.spec.topNode||"doc";if(!i[n])throw new RangeError("Schema is missing its top node type ('"+n+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(var a in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i},Object.defineProperties(yE.prototype,DE);var vE=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},kE={isRequired:{configurable:!0}};kE.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(vE.prototype,kE);var SE=function(e,t,i,n){this.name=e,this.schema=i,this.spec=n,this.attrs=EE(n.attrs),this.rank=t,this.excluded=null;var a=FE(this.attrs);this.instance=a&&new qb(this,a)};SE.prototype.create=function(e){return!e&&this.instance?this.instance:new qb(this,bE(this.attrs,e))},SE.compile=function(e,t){var i=Object.create(null),n=0;return e.forEach((function(e,a){return i[e]=new SE(e,n++,t,a)})),i},SE.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e},SE.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},SE.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var wE={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},CE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},xE={ol:!0,ul:!0};function TE(e){return(e?1:0)|("full"===e?2:0)}var OE=function(e,t,i,n,a,r,o){this.type=e,this.attrs=t,this.solid=a,this.match=r||(4&o?null:e.contentMatch),this.options=o,this.content=[],this.marks=i,this.activeMarks=qb.none,this.pendingMarks=n,this.stashMarks=[]};OE.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(Ib.from(e));if(!t){var i,n=this.type.contentMatch;return(i=n.findWrapping(e.type))?(this.match=n,i):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},OE.prototype.finish=function(e){if(!(1&this.options)){var t,i=this.content[this.content.length-1];i&&i.isText&&(t=/[ \t\r\n\u000c]+$/.exec(i.text))&&(i.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-t[0].length)))}var n=Ib.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Ib.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n},OE.prototype.popFromStashMark=function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]},OE.prototype.applyPending=function(e){for(var t=0,i=this.pendingMarks;t<i.length;t++){var n=i[t];(this.type?this.type.allowsMarkType(n.type):RE(n.type,e))&&!n.isInSet(this.activeMarks)&&(this.activeMarks=n.addToSet(this.activeMarks),this.pendingMarks=n.removeFromSet(this.pendingMarks))}},OE.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!wE.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var NE=function(e,t,i){this.parser=e,this.options=t,this.isOpen=i;var n,a=t.topNode,r=TE(t.preserveWhitespace)|(i?4:0);n=a?new OE(a.type,a.attrs,qb.none,qb.none,!0,t.topMatch||a.type.contentMatch,r):new OE(i?null:e.schema.topNodeType,null,qb.none,qb.none,!0,null,r),this.nodes=[n],this.open=0,this.find=t.findPositions,this.needsBlock=!1},AE={top:{configurable:!0},currentPos:{configurable:!0}};function RE(e,t){var i=t.schema.nodes,n=function(n){var a=i[n];if(a.allowsMarkType(e)){var r=[],o=function(e){r.push(e);for(var i=0;i<e.edgeCount;i++){var n=e.edge(i),a=n.type,s=n.next;if(a==t)return!0;if(r.indexOf(s)<0&&o(s))return!0}};return o(a.contentMatch)?{v:!0}:void 0}};for(var a in i){var r=n(a);if(r)return r.v}}AE.top.get=function(){return this.nodes[this.open]},NE.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),i=t?this.readStyles(function(e){var t,i=/\s*([\w-]+)\s*:\s*([^;]+)/g,n=[];for(;t=i.exec(e);)n.push(t[1],t[2].trim());return n}(t)):null,n=this.top;if(null!=i)for(var a=0;a<i.length;a++)this.addPendingMark(i[a]);if(this.addElement(e),null!=i)for(var r=0;r<i.length;r++)this.removePendingMark(i[r],n)}},NE.prototype.addTextNode=function(e){var t=e.nodeValue,i=this.top;if(2&i.options||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&i.options)t=2&i.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var n=i.content[i.content.length-1],a=e.previousSibling;(!n||a&&"BR"==a.nodeName||n.isText&&/[ \t\r\n\u000c]$/.test(n.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},NE.prototype.addElement=function(e,t){var i,n=e.nodeName.toLowerCase();xE.hasOwnProperty(n)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,i=null;t;t=t.nextSibling){var n=1==t.nodeType?t.nodeName.toLowerCase():null;n&&xE.hasOwnProperty(n)&&i?(i.appendChild(t),t=i):"li"==n?i=t:n&&(i=null)}}(e);var a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(a?a.ignore:CE.hasOwnProperty(n))this.findInside(e),this.ignoreFallback(e);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);var r,o=this.top,s=this.needsBlock;if(wE.hasOwnProperty(n))r=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),r&&this.sync(o),this.needsBlock=s}else this.addElementByRule(e,a,!1===a.consuming?i:null)},NE.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},NE.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},NE.prototype.readStyles=function(e){var t=qb.none;e:for(var i=0;i<e.length;i+=2)for(var n=null;;){var a=this.parser.matchStyle(e[i],e[i+1],this,n);if(!a)continue e;if(a.ignore)return null;if(t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),!1!==a.consuming)break;n=a}return t},NE.prototype.addElementByRule=function(e,t,i){var n,a,r,o=this;t.node?(a=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(a.create(t.attrs))||this.leafFallback(e):n=this.enter(a,t.attrs,t.preserveWhitespace):(r=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(r));var s=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return o.insertNode(e)}));else{var l=t.contentElement;"string"==typeof l?l=e.querySelector(l):"function"==typeof l&&(l=l(e)),l||(l=e),this.findAround(e,l,!0),this.addAll(l,n)}n&&(this.sync(s),this.open--),r&&this.removePendingMark(r,s)},NE.prototype.addAll=function(e,t,i,n){for(var a=i||0,r=i?e.childNodes[i]:e.firstChild,o=null==n?null:e.childNodes[n];r!=o;r=r.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(r),t&&wE.hasOwnProperty(r.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,a)},NE.prototype.findPlace=function(e){for(var t,i,n=this.open;n>=0;n--){var a=this.nodes[n],r=a.findWrapping(e);if(r&&(!t||t.length>r.length)&&(t=r,i=a,!r.length))break;if(a.solid)break}if(!t)return!1;this.sync(i);for(var o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0},NE.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var i=this.top;i.applyPending(e.type),i.match&&(i.match=i.match.matchType(e.type));for(var n=i.activeMarks,a=0;a<e.marks.length;a++)i.type&&!i.type.allowsMarkType(e.marks[a].type)||(n=e.marks[a].addToSet(n));return i.content.push(e.mark(n)),!0}return!1},NE.prototype.enter=function(e,t,i){var n=this.findPlace(e.create(t));return n&&this.enterInner(e,t,!0,i),n},NE.prototype.enterInner=function(e,t,i,n){this.closeExtra();var a=this.top;a.applyPending(e),a.match=a.match&&a.match.matchType(e,t);var r=null==n?-5&a.options:TE(n);4&a.options&&0==a.content.length&&(r|=4),this.nodes.push(new OE(e,t,a.activeMarks,a.pendingMarks,i,null,r)),this.open++},NE.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},NE.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},NE.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},AE.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var i=this.nodes[t].content,n=i.length-1;n>=0;n--)e+=i[n].nodeSize;t&&e++}return e},NE.prototype.findAtPoint=function(e,t){if(this.find)for(var i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==t&&(this.find[i].pos=this.currentPos)},NE.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},NE.prototype.findAround=function(e,t,i){if(e!=t&&this.find)for(var n=0;n<this.find.length;n++){if(null==this.find[n].pos&&1==e.nodeType&&e.contains(this.find[n].node))t.compareDocumentPosition(this.find[n].node)&(i?2:4)&&(this.find[n].pos=this.currentPos)}},NE.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},NE.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var i=e.split("/"),n=this.options.context,a=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),r=-(n?n.depth+1:0)+(a?0:1),o=function(e,s){for(;e>=0;e--){var l=i[e];if(""==l){if(e==i.length-1||0==e)continue;for(;s>=r;s--)if(o(e-1,s))return!0;return!1}var u=s>0||0==s&&a?t.nodes[s].type:n&&s>=r?n.node(s-r).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0};return o(i.length-1,this.open)},NE.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var i=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(var n in this.parser.schema.nodes){var a=this.parser.schema.nodes[n];if(a.isTextblock&&a.defaultAttrs)return a}},NE.prototype.addPendingMark=function(e){var t=function(e,t){for(var i=0;i<t.length;i++)if(e.eq(t[i]))return t[i]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},NE.prototype.removePendingMark=function(e,t){for(var i=this.open;i>=0;i--){var n=this.nodes[i];if(n.pendingMarks.lastIndexOf(e)>-1)n.pendingMarks=e.removeFromSet(n.pendingMarks);else{n.activeMarks=e.removeFromSet(n.activeMarks);var a=n.popFromStashMark(e);a&&n.type&&n.type.allowsMarkType(a.type)&&(n.activeMarks=a.addToSet(n.activeMarks))}if(n==t)break}},Object.defineProperties(NE.prototype,AE);var ME=Math.pow(2,16);function IE(e){return 65535&e}var BE=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null),this.pos=e,this.deleted=t,this.recover=i},LE=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};LE.prototype.recover=function(e){var t=0,i=IE(e);if(!this.inverted)for(var n=0;n<i;n++)t+=this.ranges[3*n+2]-this.ranges[3*n+1];return this.ranges[3*i]+t+function(e){return(e-(65535&e))/ME}(e)},LE.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},LE.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},LE.prototype._map=function(e,t,i){for(var n=0,a=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?n:0);if(s>e)break;var l=this.ranges[o+a],u=this.ranges[o+r],_=s+l;if(e<=_){var d=s+n+((l?e==s?-1:e==_?1:t:t)<0?0:u);if(i)return d;var c=e==(t<0?s:_)?null:o/3+(e-s)*ME;return new BE(d,t<0?e!=s:e!=_,c)}n+=u-l}return i?e+n:new BE(e+n)},LE.prototype.touches=function(e,t){for(var i=0,n=IE(t),a=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?i:0);if(s>e)break;var l=this.ranges[o+a];if(e<=s+l&&o==3*n)return!0;i+=this.ranges[o+r]-l}return!1},LE.prototype.forEach=function(e){for(var t=this.inverted?2:1,i=this.inverted?1:2,n=0,a=0;n<this.ranges.length;n+=3){var r=this.ranges[n],o=r-(this.inverted?a:0),s=r+(this.inverted?0:a),l=this.ranges[n+t],u=this.ranges[n+i];e(o,o+l,s,s+u),a+=u-l}},LE.prototype.invert=function(){return new LE(this.ranges,!this.inverted)},LE.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},LE.offset=function(e){return 0==e?LE.empty:new LE(e<0?[0,-e,0]:[0,0,e])},LE.empty=new LE([]);var PE=function(e,t,i,n){this.maps=e||[],this.from=i||0,this.to=null==n?this.maps.length:n,this.mirror=t};function jE(e){var t=Error.call(this,e);return t.__proto__=jE.prototype,t}PE.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new PE(this.maps,this.mirror,e,t)},PE.prototype.copy=function(){return new PE(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},PE.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},PE.prototype.appendMapping=function(e){for(var t=0,i=this.maps.length;t<e.maps.length;t++){var n=e.getMirror(t);this.appendMap(e.maps[t],null!=n&&n<t?i+n:null)}},PE.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},PE.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},PE.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,i=this.maps.length+e.maps.length;t>=0;t--){var n=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=n&&n>t?i-n-1:null)}},PE.prototype.invert=function(){var e=new PE;return e.appendMappingInverted(this),e},PE.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var i=this.from;i<this.to;i++)e=this.maps[i].map(e,t);return e},PE.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},PE.prototype._map=function(e,t,i){for(var n=!1,a=this.from;a<this.to;a++){var r=this.maps[a].mapResult(e,t);if(null!=r.recover){var o=this.getMirror(a);if(null!=o&&o>a&&o<this.to){a=o,e=this.maps[o].recover(r.recover);continue}}r.deleted&&(n=!0),e=r.pos}return i?e:new BE(e,n)},jE.prototype=Object.create(Error.prototype),jE.prototype.constructor=jE,jE.prototype.name="TransformError";var qE=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new PE},UE={before:{configurable:!0},docChanged:{configurable:!0}};function zE(){throw new Error("Override me")}UE.before.get=function(){return this.docs.length?this.docs[0]:this.doc},qE.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new jE(t.failed);return this},qE.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},UE.docChanged.get=function(){return this.steps.length>0},qE.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(qE.prototype,UE);var GE=Object.create(null),HE=function(){};HE.prototype.apply=function(e){return zE()},HE.prototype.getMap=function(){return LE.empty},HE.prototype.invert=function(e){return zE()},HE.prototype.map=function(e){return zE()},HE.prototype.merge=function(e){return null},HE.prototype.toJSON=function(){return zE()},HE.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var i=GE[t.stepType];if(!i)throw new RangeError("No step type "+t.stepType+" defined");return i.fromJSON(e,t)},HE.jsonID=function(e,t){if(e in GE)throw new RangeError("Duplicate use of step JSON ID "+e);return GE[e]=t,t.prototype.jsonID=e,t};var YE=function(e,t){this.doc=e,this.failed=t};YE.ok=function(e){return new YE(e,null)},YE.fail=function(e){return new YE(null,e)},YE.fromReplace=function(e,t,i,n){try{return YE.ok(e.replace(t,i,n))}catch(e){if(e instanceof Ub)return YE.fail(e.message);throw e}};var VE=function(e){function t(t,i,n,a){e.call(this),this.from=t,this.to=i,this.slice=n,this.structure=!!a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&$E(e,this.from,this.to)?YE.fail("Structure replace would overwrite content"):YE.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new LE([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var i=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return i.deleted&&n.deleted?null:new t(i.pos,Math.max(i.pos,n.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var i=this.slice.size+e.slice.size==0?zb.empty:new zb(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,i,this.structure)}var n=this.slice.size+e.slice.size==0?zb.empty:new zb(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),n,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(i.from,i.to,zb.fromJSON(e,i.slice),!!i.structure)},t}(HE);HE.jsonID("replace",VE);var WE=function(e){function t(t,i,n,a,r,o,s){e.call(this),this.from=t,this.to=i,this.gapFrom=n,this.gapTo=a,this.slice=r,this.insert=o,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&($E(e,this.from,this.gapFrom)||$E(e,this.gapTo,this.to)))return YE.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return YE.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,t.content);return i?YE.fromReplace(e,this.from,this.to,i):YE.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new LE([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var i=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+i,this.from+this.insert,this.from+this.insert+i,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),a=e.map(this.gapFrom,-1),r=e.map(this.gapTo,1);return i.deleted&&n.deleted||a<i.pos||r>n.pos?null:new t(i.pos,n.pos,a,r,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to||"number"!=typeof i.gapFrom||"number"!=typeof i.gapTo||"number"!=typeof i.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(i.from,i.to,i.gapFrom,i.gapTo,zb.fromJSON(e,i.slice),i.insert,!!i.structure)},t}(HE);function $E(e,t,i){for(var n=e.resolve(t),a=i-t,r=n.depth;a>0&&r>0&&n.indexAfter(r)==n.node(r).childCount;)r--,a--;if(a>0)for(var o=n.node(r).maybeChild(n.indexAfter(r));a>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,a--}return!1}function KE(e,t,i){for(var n=[],a=0;a<e.childCount;a++){var r=e.child(a);r.content.size&&(r=r.copy(KE(r.content,t,r))),r.isInline&&(r=t(r,i,a)),n.push(r)}return Ib.fromArray(n)}HE.jsonID("replaceAround",WE),qE.prototype.lift=function(e,t){for(var i=e.$from,n=e.$to,a=e.depth,r=i.before(a+1),o=n.after(a+1),s=r,l=o,u=Ib.empty,_=0,d=a,c=!1;d>t;d--)c||i.index(d)>0?(c=!0,u=Ib.from(i.node(d).copy(u)),_++):s--;for(var g=Ib.empty,f=0,h=a,p=!1;h>t;h--)p||n.after(h+1)<n.end(h)?(p=!0,g=Ib.from(n.node(h).copy(g)),f++):l++;return this.step(new WE(s,l,r,o,new zb(u.append(g),_,f),u.size-_,!0))},qE.prototype.wrap=function(e,t){for(var i=Ib.empty,n=t.length-1;n>=0;n--)i=Ib.from(t[n].type.create(t[n].attrs,i));var a=e.start,r=e.end;return this.step(new WE(a,r,a,r,new zb(i,0,0),t.length,!0))},qE.prototype.setBlockType=function(e,t,i,n){var a=this;if(void 0===t&&(t=e),!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var r=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(i,n)&&function(e,t,i){var n=e.resolve(t),a=n.index();return n.parent.canReplaceWith(a,a+1,i)}(a.doc,a.mapping.slice(r).map(t),i)){a.clearIncompatible(a.mapping.slice(r).map(t,1),i);var o=a.mapping.slice(r),s=o.map(t,1),l=o.map(t+e.nodeSize,1);return a.step(new WE(s,l,s+1,l-1,new zb(Ib.from(i.create(n,null,e.marks)),0,0),1,!0)),!1}})),this},qE.prototype.setNodeMarkup=function(e,t,i,n){var a=this.doc.nodeAt(e);if(!a)throw new RangeError("No node at given position");t||(t=a.type);var r=t.create(i,null,n||a.marks);if(a.isLeaf)return this.replaceWith(e,e+a.nodeSize,r);if(!t.validContent(a.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new WE(e,e+a.nodeSize,e+1,e+a.nodeSize-1,new zb(Ib.from(r),0,0),1,!0))},qE.prototype.split=function(e,t,i){void 0===t&&(t=1);for(var n=this.doc.resolve(e),a=Ib.empty,r=Ib.empty,o=n.depth,s=n.depth-t,l=t-1;o>s;o--,l--){a=Ib.from(n.node(o).copy(a));var u=i&&i[l];r=Ib.from(u?u.type.create(u.attrs,r):n.node(o).copy(r))}return this.step(new VE(e,e,new zb(a.append(r),t,t),!0))},qE.prototype.join=function(e,t){void 0===t&&(t=1);var i=new VE(e-t,e+t,zb.empty,!0);return this.step(i)};var QE=function(e){function t(t,i,n){e.call(this),this.from=t,this.to=i,this.mark=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),n=e.resolve(this.from),a=n.node(n.sharedDepth(this.to)),r=new zb(KE(i.content,(function(e,i){return e.isAtom&&i.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),a),i.openStart,i.openEnd);return YE.fromReplace(e,this.from,this.to,r)},t.prototype.invert=function(){return new ZE(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return i.deleted&&n.deleted||i.pos>=n.pos?null:new t(i.pos,n.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(HE);HE.jsonID("addMark",QE);var ZE=function(e){function t(t,i,n){e.call(this),this.from=t,this.to=i,this.mark=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),n=new zb(KE(i.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),i.openStart,i.openEnd);return YE.fromReplace(e,this.from,this.to,n)},t.prototype.invert=function(){return new QE(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return i.deleted&&n.deleted||i.pos>=n.pos?null:new t(i.pos,n.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(HE);function XE(e,t,i){return!i.openStart&&!i.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),i.content)}HE.jsonID("removeMark",ZE),qE.prototype.addMark=function(e,t,i){var n=this,a=[],r=[],o=null,s=null;return this.doc.nodesBetween(e,t,(function(n,l,u){if(n.isInline){var _=n.marks;if(!i.isInSet(_)&&u.type.allowsMarkType(i.type)){for(var d=Math.max(l,e),c=Math.min(l+n.nodeSize,t),g=i.addToSet(_),f=0;f<_.length;f++)_[f].isInSet(g)||(o&&o.to==d&&o.mark.eq(_[f])?o.to=c:a.push(o=new ZE(d,c,_[f])));s&&s.to==d?s.to=c:r.push(s=new QE(d,c,i))}}})),a.forEach((function(e){return n.step(e)})),r.forEach((function(e){return n.step(e)})),this},qE.prototype.removeMark=function(e,t,i){var n=this;void 0===i&&(i=null);var a=[],r=0;return this.doc.nodesBetween(e,t,(function(n,o){if(n.isInline){r++;var s=null;if(i instanceof SE)for(var l,u=n.marks;l=i.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else i?i.isInSet(n.marks)&&(s=[i]):s=n.marks;if(s&&s.length)for(var _=Math.min(o+n.nodeSize,t),d=0;d<s.length;d++){for(var c=s[d],g=void 0,f=0;f<a.length;f++){var h=a[f];h.step==r-1&&c.eq(a[f].style)&&(g=h)}g?(g.to=_,g.step=r):a.push({style:c,from:Math.max(o,e),to:_,step:r})}}})),a.forEach((function(e){return n.step(new ZE(e.from,e.to,e.style))})),this},qE.prototype.clearIncompatible=function(e,t,i){void 0===i&&(i=t.contentMatch);for(var n=this.doc.nodeAt(e),a=[],r=e+1,o=0;o<n.childCount;o++){var s=n.child(o),l=r+s.nodeSize,u=i.matchType(s.type,s.attrs);if(u){i=u;for(var _=0;_<s.marks.length;_++)t.allowsMarkType(s.marks[_].type)||this.step(new ZE(r,l,s.marks[_]))}else a.push(new VE(r,l,zb.empty));r=l}if(!i.validEnd){var d=i.fillBefore(Ib.empty,!0);this.replace(r,r,new zb(d,0,0))}for(var c=a.length-1;c>=0;c--)this.step(a[c]);return this},qE.prototype.replace=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=zb.empty);var n=function(e,t,i,n){if(void 0===i&&(i=t),void 0===n&&(n=zb.empty),t==i&&!n.size)return null;var a=e.resolve(t),r=e.resolve(i);return XE(a,r,n)?new VE(t,i,n):new JE(a,r,n).fit()}(this.doc,e,t,i);return n&&this.step(n),this},qE.prototype.replaceWith=function(e,t,i){return this.replace(e,t,new zb(Ib.from(i),0,0))},qE.prototype.delete=function(e,t){return this.replace(e,t,zb.empty)},qE.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var JE=function(e,t,i){this.$to=t,this.$from=e,this.unplaced=i,this.frontier=[];for(var n=0;n<=e.depth;n++){var a=e.node(n);this.frontier.push({type:a.type,match:a.contentMatchAt(e.indexAfter(n))})}this.placed=Ib.empty;for(var r=e.depth;r>0;r--)this.placed=Ib.from(e.node(r).copy(this.placed))},ey={depth:{configurable:!0}};function ty(e,t,i){return 0==t?e.cutByIndex(i):e.replaceChild(0,e.firstChild.copy(ty(e.firstChild.content,t-1,i)))}function iy(e,t,i){return 0==t?e.append(i):e.replaceChild(e.childCount-1,e.lastChild.copy(iy(e.lastChild.content,t-1,i)))}function ny(e,t){for(var i=0;i<t;i++)e=e.firstChild.content;return e}function ay(e,t,i){if(t<=0)return e;var n=e.content;return t>1&&(n=n.replaceChild(0,ay(n.firstChild,t-1,1==n.childCount?i-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),i<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(Ib.empty,!0)))),e.copy(n)}function ry(e,t,i,n,a){var r=e.node(t),o=a?e.indexAfter(t):e.index(t);if(o==r.childCount&&!i.compatibleContent(r.type))return null;var s=n.fillBefore(r.content,!0,o);return s&&!function(e,t,i){for(var n=i;n<t.childCount;n++)if(!e.allowsMarks(t.child(n).marks))return!0;return!1}(i,r.content,o)?s:null}function oy(e,t,i,n,a){if(t<i){var r=e.firstChild;e=e.replaceChild(0,r.copy(oy(r.content,t+1,i,n,r)))}if(t>n){var o=a.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(Ib.empty,!0))}return e}function sy(e,t){for(var i=[],n=Math.min(e.depth,t.depth);n>=0;n--){var a=e.start(n);if(a<e.pos-(e.depth-n)||t.end(n)>t.pos+(t.depth-n)||e.node(n).type.spec.isolating||t.node(n).type.spec.isolating)break;(a==t.start(n)||n==e.depth&&n==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&n&&t.start(n-1)==a-1)&&i.push(n)}return i}ey.depth.get=function(){return this.frontier.length-1},JE.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),i=this.placed.size-this.depth-this.$from.depth,n=this.$from,a=this.close(t<0?this.$to:n.doc.resolve(t));if(!a)return null;for(var r=this.placed,o=n.depth,s=a.depth;o&&s&&1==r.childCount;)r=r.firstChild.content,o--,s--;var l=new zb(r,o,s);return t>-1?new WE(n.pos,t,this.$to.pos,this.$to.end(),l,i):l.size||n.pos!=this.$to.pos?new VE(n.pos,a.pos,l):void 0},JE.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var i=void 0,n=(t?(i=ny(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,a=this.depth;a>=0;a--){var r=this.frontier[a],o=r.type,s=r.match,l=void 0,u=void 0;if(1==e&&(n?s.matchType(n.type)||(u=s.fillBefore(Ib.from(n),!1)):o.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:a,parent:i,inject:u};if(2==e&&n&&(l=s.findWrapping(n.type)))return{sliceDepth:t,frontierDepth:a,parent:i,wrap:l};if(i&&s.matchType(i.type))break}},JE.prototype.openMore=function(){var e=this.unplaced,t=e.content,i=e.openStart,n=e.openEnd,a=ny(t,i);return!(!a.childCount||a.firstChild.isLeaf)&&(this.unplaced=new zb(t,i+1,Math.max(n,a.size+i>=t.size-n?i+1:0)),!0)},JE.prototype.dropNode=function(){var e=this.unplaced,t=e.content,i=e.openStart,n=e.openEnd,a=ny(t,i);if(a.childCount<=1&&i>0){var r=t.size-i<=i+a.size;this.unplaced=new zb(ty(t,i-1,1),i-1,r?i-1:n)}else this.unplaced=new zb(ty(t,i,1),i,n)},JE.prototype.placeNodes=function(e){for(var t=e.sliceDepth,i=e.frontierDepth,n=e.parent,a=e.inject,r=e.wrap;this.depth>i;)this.closeFrontierNode();if(r)for(var o=0;o<r.length;o++)this.openFrontierNode(r[o]);var s=this.unplaced,l=n?n.content:s.content,u=s.openStart-t,_=0,d=[],c=this.frontier[i],g=c.match,f=c.type;if(a){for(var h=0;h<a.childCount;h++)d.push(a.child(h));g=g.matchFragment(a)}for(var p=l.size+t-(s.content.size-s.openEnd);_<l.childCount;){var m=l.child(_),F=g.matchType(m.type);if(!F)break;(++_>1||0==u||m.content.size)&&(g=F,d.push(ay(m.mark(f.allowedMarks(m.marks)),1==_?u:0,_==l.childCount?p:-1)))}var b=_==l.childCount;b||(p=-1),this.placed=iy(this.placed,i,Ib.from(d)),this.frontier[i].match=g,b&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var E=0,y=l;E<p;E++){var D=y.lastChild;this.frontier.push({type:D.type,match:D.contentMatchAt(D.childCount)}),y=D.content}this.unplaced=b?0==t?zb.empty:new zb(ty(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new zb(ty(s.content,t,_),s.openStart,s.openEnd)},JE.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!ry(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var i=this.$to.depth,n=this.$to.after(i);i>1&&n==this.$to.end(--i);)++n;return n},JE.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var i=this.frontier[t],n=i.match,a=i.type,r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=ry(e,t,a,n,r);if(o){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,_=ry(e,s,l.type,u,!0);if(!_||_.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}},JE.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=iy(this.placed,t.depth,t.fit)),e=t.move;for(var i=t.depth+1;i<=e.depth;i++){var n=e.node(i),a=n.type.contentMatch.fillBefore(n.content,!0,e.index(i));this.openFrontierNode(n.type,n.attrs,a)}return e},JE.prototype.openFrontierNode=function(e,t,i){var n=this.frontier[this.depth];n.match=n.match.matchType(e),this.placed=iy(this.placed,this.depth,Ib.from(e.create(t,i))),this.frontier.push({type:e,match:e.contentMatch})},JE.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(Ib.empty,!0);e.childCount&&(this.placed=iy(this.placed,this.frontier.length,e))},Object.defineProperties(JE.prototype,ey),qE.prototype.replaceRange=function(e,t,i){if(!i.size)return this.deleteRange(e,t);var n=this.doc.resolve(e),a=this.doc.resolve(t);if(XE(n,a,i))return this.step(new VE(e,t,i));var r=sy(n,this.doc.resolve(t));0==r[r.length-1]&&r.pop();var o=-(n.depth+1);r.unshift(o);for(var s=n.depth,l=n.pos-1;s>0;s--,l--){var u=n.node(s).type.spec;if(u.defining||u.isolating)break;r.indexOf(s)>-1?o=s:n.before(s)==l&&r.splice(1,0,-s)}for(var _=r.indexOf(o),d=[],c=i.openStart,g=i.content,f=0;;f++){var h=g.firstChild;if(d.push(h),f==i.openStart)break;g=h.content}c>0&&d[c-1].type.spec.defining&&n.node(_).type!=d[c-1].type?c-=1:c>=2&&d[c-1].isTextblock&&d[c-2].type.spec.defining&&n.node(_).type!=d[c-2].type&&(c-=2);for(var p=i.openStart;p>=0;p--){var m=(p+c+1)%(i.openStart+1),F=d[m];if(F)for(var b=0;b<r.length;b++){var E=r[(b+_)%r.length],y=!0;E<0&&(y=!1,E=-E);var D=n.node(E-1),v=n.index(E-1);if(D.canReplaceWith(v,v,F.type,F.marks))return this.replace(n.before(E),y?a.after(E):t,new zb(oy(i.content,0,i.openStart,m),m,i.openEnd))}}for(var k=this.steps.length,S=r.length-1;S>=0&&(this.replace(e,t,i),!(this.steps.length>k));S--){var w=r[S];w<0||(e=n.before(w),t=a.after(w))}return this},qE.prototype.replaceRangeWith=function(e,t,i){if(!i.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var n=function(e,t,i){var n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),i))return t;if(0==n.parentOffset)for(var a=n.depth-1;a>=0;a--){var r=n.index(a);if(n.node(a).canReplaceWith(r,r,i))return n.before(a+1);if(r>0)return null}if(n.parentOffset==n.parent.content.size)for(var o=n.depth-1;o>=0;o--){var s=n.indexAfter(o);if(n.node(o).canReplaceWith(s,s,i))return n.after(o+1);if(s<n.node(o).childCount)return null}}(this.doc,e,i.type);null!=n&&(e=t=n)}return this.replaceRange(e,t,new zb(Ib.from(i),0,0))},qE.prototype.deleteRange=function(e,t){for(var i=this.doc.resolve(e),n=this.doc.resolve(t),a=sy(i,n),r=0;r<a.length;r++){var o=a[r],s=r==a.length-1;if(s&&0==o||i.node(o).type.contentMatch.validEnd)return this.delete(i.start(o),n.end(o));if(o>0&&(s||i.node(o-1).canReplace(i.index(o-1),n.indexAfter(o-1))))return this.delete(i.before(o),n.after(o))}for(var l=1;l<=i.depth&&l<=n.depth;l++)if(e-i.start(l)==i.depth-l&&t>i.end(l)&&n.end(l)-t!=n.depth-l)return this.delete(i.before(l),t);return this.delete(e,t)};var ly=Object.create(null),uy=function(e,t,i){this.ranges=i||[new dy(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},_y={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};_y.anchor.get=function(){return this.$anchor.pos},_y.head.get=function(){return this.$head.pos},_y.from.get=function(){return this.$from.pos},_y.to.get=function(){return this.$to.pos},_y.$from.get=function(){return this.ranges[0].$from},_y.$to.get=function(){return this.ranges[0].$to},_y.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},uy.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},uy.prototype.replace=function(e,t){void 0===t&&(t=zb.empty);for(var i=t.content.lastChild,n=null,a=0;a<t.openEnd;a++)n=i,i=i.lastChild;for(var r=e.steps.length,o=this.ranges,s=0;s<o.length;s++){var l=o[s],u=l.$from,_=l.$to,d=e.mapping.slice(r);e.replaceRange(d.map(u.pos),d.map(_.pos),s?zb.empty:t),0==s&&by(e,r,(i?i.isInline:n&&n.isTextblock)?-1:1)}},uy.prototype.replaceWith=function(e,t){for(var i=e.steps.length,n=this.ranges,a=0;a<n.length;a++){var r=n[a],o=r.$from,s=r.$to,l=e.mapping.slice(i),u=l.map(o.pos),_=l.map(s.pos);a?e.deleteRange(u,_):(e.replaceRangeWith(u,_,t),by(e,i,t.isInline?-1:1))}},uy.findFrom=function(e,t,i){var n=e.parent.inlineContent?new cy(e):Fy(e.node(0),e.parent,e.pos,e.index(),t,i);if(n)return n;for(var a=e.depth-1;a>=0;a--){var r=t<0?Fy(e.node(0),e.node(a),e.before(a+1),e.index(a),t,i):Fy(e.node(0),e.node(a),e.after(a+1),e.index(a)+1,t,i);if(r)return r}},uy.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new py(e.node(0))},uy.atStart=function(e){return Fy(e,e,0,0,1)||new py(e)},uy.atEnd=function(e){return Fy(e,e,e.content.size,e.childCount,-1)||new py(e)},uy.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var i=ly[t.type];if(!i)throw new RangeError("No selection type "+t.type+" defined");return i.fromJSON(e,t)},uy.jsonID=function(e,t){if(e in ly)throw new RangeError("Duplicate use of selection JSON ID "+e);return ly[e]=t,t.prototype.jsonID=e,t},uy.prototype.getBookmark=function(){return cy.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(uy.prototype,_y),uy.prototype.visible=!0;var dy=function(e,t){this.$from=e,this.$to=t},cy=function(e){function t(t,i){void 0===i&&(i=t),e.call(this,t,i)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={$cursor:{configurable:!0}};return i.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(i,n){var a=i.resolve(n.map(this.head));if(!a.parent.inlineContent)return e.near(a);var r=i.resolve(n.map(this.anchor));return new t(r.parent.inlineContent?r:a,a)},t.prototype.replace=function(t,i){if(void 0===i&&(i=zb.empty),e.prototype.replace.call(this,t,i),i==zb.empty){var n=this.$from.marksAcross(this.$to);n&&t.ensureMarks(n)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new gy(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.anchor||"number"!=typeof i.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(i.anchor),e.resolve(i.head))},t.create=function(e,t,i){void 0===i&&(i=t);var n=e.resolve(t);return new this(n,i==t?n:e.resolve(i))},t.between=function(i,n,a){var r=i.pos-n.pos;if(a&&!r||(a=r>=0?1:-1),!n.parent.inlineContent){var o=e.findFrom(n,a,!0)||e.findFrom(n,-a,!0);if(!o)return e.near(n,a);n=o.$head}return i.parent.inlineContent||(0==r||(i=(e.findFrom(i,-a,!0)||e.findFrom(i,a,!0)).$anchor).pos<n.pos!=r<0)&&(i=n),new t(i,n)},Object.defineProperties(t.prototype,i),t}(uy);uy.jsonID("text",cy);var gy=function(e,t){this.anchor=e,this.head=t};gy.prototype.map=function(e){return new gy(e.map(this.anchor),e.map(this.head))},gy.prototype.resolve=function(e){return cy.between(e.resolve(this.anchor),e.resolve(this.head))};var fy=function(e){function t(t){var i=t.nodeAfter,n=t.node(0).resolve(t.pos+i.nodeSize);e.call(this,t,n),this.node=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,n){var a=n.mapResult(this.anchor),r=a.deleted,o=a.pos,s=i.resolve(o);return r?e.near(s):new t(s)},t.prototype.content=function(){return new zb(Ib.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new hy(this.anchor)},t.fromJSON=function(e,i){if("number"!=typeof i.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(i.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(uy);fy.prototype.visible=!1,uy.jsonID("node",fy);var hy=function(e){this.anchor=e};hy.prototype.map=function(e){var t=e.mapResult(this.anchor),i=t.deleted,n=t.pos;return i?new gy(n,n):new hy(n)},hy.prototype.resolve=function(e){var t=e.resolve(this.anchor),i=t.nodeAfter;return i&&fy.isSelectable(i)?new fy(t):uy.near(t)};var py=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,i){if(void 0===i&&(i=zb.empty),i==zb.empty){t.delete(0,t.doc.content.size);var n=e.atStart(t.doc);n.eq(t.selection)||t.setSelection(n)}else e.prototype.replace.call(this,t,i)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return my},t}(uy);uy.jsonID("all",py);var my={map:function(){return this},resolve:function(e){return new py(e)}};function Fy(e,t,i,n,a,r){if(t.inlineContent)return cy.create(e,i);for(var o=n-(a>0?0:1);a>0?o<t.childCount:o>=0;o+=a){var s=t.child(o);if(s.isAtom){if(!r&&fy.isSelectable(s))return fy.create(e,i-(a<0?s.nodeSize:0))}else{var l=Fy(e,s,i+a,a<0?s.childCount:0,a,r);if(l)return l}i+=s.nodeSize*a}}function by(e,t,i){var n=e.steps.length-1;if(!(n<t)){var a,r=e.steps[n];if(r instanceof VE||r instanceof WE)e.mapping.maps[n].forEach((function(e,t,i,n){null==a&&(a=n)})),e.setSelection(uy.near(e.doc.resolve(a),i))}}var Ey=function(e){function t(t){e.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)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return i.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(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},i.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return qb.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},i.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,i){e.prototype.addStep.call(this,t,i),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var i=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||qb.none))),i.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,i){void 0===i&&(i=t);var n=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(n.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,i);var a=this.storedMarks;if(!a){var r=this.doc.resolve(t);a=i==t?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(t,i,n.text(e,a)),this.selection.empty||this.setSelection(uy.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},i.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},i.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,i),t}(qE);function yy(e,t){return t&&e?e.bind(t):e}var Dy=function(e,t,i){this.name=e,this.init=yy(t.init,i),this.apply=yy(t.apply,i)},vy=[new Dy("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new Dy("selection",{init:function(e,t){return e.selection||uy.atStart(t.doc)},apply:function(e){return e.selection}}),new Dy("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,i,n){return n.selection.$cursor?e.storedMarks:null}}),new Dy("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],ky=function(e,t){var i=this;this.schema=e,this.fields=vy.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(i.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");i.plugins.push(e),i.pluginsByKey[e.key]=e,e.spec.state&&i.fields.push(new Dy(e.key,e.spec.state,e))}))},Sy=function(e){this.config=e},wy={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};wy.schema.get=function(){return this.config.schema},wy.plugins.get=function(){return this.config.plugins},Sy.prototype.apply=function(e){return this.applyTransaction(e).state},Sy.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var i=0;i<this.config.plugins.length;i++)if(i!=t){var n=this.config.plugins[i];if(n.spec.filterTransaction&&!n.spec.filterTransaction.call(n,e,this))return!1}return!0},Sy.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],i=this.applyInner(e),n=null;;){for(var a=!1,r=0;r<this.config.plugins.length;r++){var o=this.config.plugins[r];if(o.spec.appendTransaction){var s=n?n[r].n:0,l=n?n[r].state:this,u=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,l,i);if(u&&i.filterTransaction(u,r)){if(u.setMeta("appendedTransaction",e),!n){n=[];for(var _=0;_<this.config.plugins.length;_++)n.push(_<r?{state:i,n:t.length}:{state:this,n:0})}t.push(u),i=i.applyInner(u),a=!0}n&&(n[r]={state:i,n:t.length})}}if(!a)return{state:i,transactions:t}}},Sy.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new Sy(this.config),i=this.config.fields,n=0;n<i.length;n++){var a=i[n];t[a.name]=a.apply(e,this[a.name],this,t)}for(var r=0;r<Cy.length;r++)Cy[r](this,e,t);return t},wy.tr.get=function(){return new Ey(this)},Sy.create=function(e){for(var t=new ky(e.doc?e.doc.type.schema:e.schema,e.plugins),i=new Sy(t),n=0;n<t.fields.length;n++)i[t.fields[n].name]=t.fields[n].init(e,i);return i},Sy.prototype.reconfigure=function(e){for(var t=new ky(this.schema,e.plugins),i=t.fields,n=new Sy(t),a=0;a<i.length;a++){var r=i[a].name;n[r]=this.hasOwnProperty(r)?this[r]:i[a].init(e,n)}return n},Sy.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var i in e){if("doc"==i||"selection"==i)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var n=e[i],a=n.spec.state;a&&a.toJSON&&(t[i]=a.toJSON.call(n,this[n.key]))}return t},Sy.fromJSON=function(e,t,i){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var n=new ky(e.schema,e.plugins),a=new Sy(n);return n.fields.forEach((function(n){if("doc"==n.name)a.doc=rE.fromJSON(e.schema,t.doc);else if("selection"==n.name)a.selection=uy.fromJSON(a.doc,t.selection);else if("storedMarks"==n.name)t.storedMarks&&(a.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(i)for(var r in i){var o=i[r],s=o.spec.state;if(o.key==n.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(a[n.name]=s.fromJSON.call(o,e,t[r],a))}a[n.name]=n.init(e,a)}})),a},Sy.addApplyListener=function(e){Cy.push(e)},Sy.removeApplyListener=function(e){var t=Cy.indexOf(e);t>-1&&Cy.splice(t,1)},Object.defineProperties(Sy.prototype,wy);var Cy=[];var xy=function(e){this.props={},e.props&&function e(t,i,n){for(var a in t){var r=t[a];r instanceof Function?r=r.bind(i):"handleDOMEvents"==a&&(r=e(r,i,{})),n[a]=r}return n}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:Oy("plugin")};xy.prototype.getState=function(e){return e[this.key]};var Ty=Object.create(null);function Oy(e){return e in Ty?e+"$"+ ++Ty[e]:(Ty[e]=0,e+"$")}var Ny=function(e){void 0===e&&(e="key"),this.key=Oy(e)};Ny.prototype.get=function(e){return e.config.pluginsByKey[this.key]},Ny.prototype.getState=function(e){return e[this.key]};const Ay=mr.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter(e=>""!==e).length}},addProseMirrorPlugins(){return[new xy({key:new Ny("characterCount"),filterTransaction:(e,t)=>{const i=this.options.limit;if(!e.docChanged||0===i||null==i)return!0;const n=this.storage.characters({node:t.doc}),a=this.storage.characters({node:e.doc});if(a<=i)return!0;if(n>i&&a>i&&a<=n)return!0;if(n>i&&a>i&&a>n)return!1;if(!e.getMeta("paste"))return!1;const r=e.selection.$head.pos,o=r-(a-i),s=r;e.deleteRange(o,s);return!(this.storage.characters({node:e.doc})>i)}})]}});var Ry=i(52);const My=gs.create({name:"link",priority:1e3,inclusive:!1,addOptions:()=>({openOnClick:!0,linkOnPaste:!0,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target}}},parseHTML:()=>[{tag:"a[href]"}],renderHTML({HTMLAttributes:e}){return["a",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setLink:e=>({commands:t})=>t.setMark("link",e),toggleLink:e=>({commands:t})=>t.toggleMark("link",e,{extendEmptyMarkRange:!0}),unsetLink:()=>({commands:e})=>e.unsetMark("link",{extendEmptyMarkRange:!0})}),addPasteRules(){return[Es({find:e=>Object(Ry.find)(e).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.openOnClick&&e.push(new Rt({key:new Bt("handleClickLink"),props:{handleClick:(e,t,i)=>{var n;const a=this.editor.getAttributes("link");return!(!(null===(n=i.target)||void 0===n?void 0:n.closest("a"))||!a.href)&&(window.open(a.href,a.target),!0)}}})),this.options.linkOnPaste&&e.push(new Rt({key:new Bt("handlePasteLink"),props:{handlePaste:(e,t,i)=>{const{state:n}=e,{selection:a}=n,{empty:r}=a;if(r)return!1;let o="";i.content.forEach(e=>{o+=e.textContent});const s=Object(Ry.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),Iy=gs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",as(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const i=po(e,this.type);return!!Object.entries(i).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),By=mr.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>e.style.color.replace(/['"]+/g,""),renderHTML:e=>e.color?{style:"color: "+e.color}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})});var Ly=cs.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Rt({key:new Bt("eventHandler"),props:{handleClick:function(t,i){var n=t.state,a=n.doc.lastChild,r=n.doc.resolve(i).nodeBefore;if(a&&r){var o=a.eq(r),s=a.isInline,l=["paragraph","text"].includes(a.type.name);!o||s||l||e.commands.insertContentAt(i,{type:"paragraph",content:""})}}}})]}}),Py=xF.extend({name:"title",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return[{tag:"h1"}]},renderHTML:function(e){e.node;var t=e.HTMLAttributes;return["h1",as(this.options.HTMLAttributes,t),0]}});const jy=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,qy=cs.create({name:"image",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML:()=>[{tag:"img[src]"}],renderHTML({HTMLAttributes:e}){return["img",as(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[fs({find:jy,type:this.type,getAttributes:e=>{const[,,t,i,n]=e;return{src:i,alt:t,title:n}}})]}});function Uy(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function zy(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Uy(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Uy(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Gy=qy.extend({name:"image",addAttributes:function(){return zy(zy({},qy.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(i){var n,a,r,o=i.tr,s=i.commands;return"image"==(null===(n=o.selection)||void 0===n||null===(a=n.node)||void 0===a||null===(r=a.type)||void 0===r?void 0:r.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}}}},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return i.class=" image-"+t.attrs.size,i.class+=" image-float-"+t.attrs.float,["img",as(this.options.HTMLAttributes,i)]}});const Hy=gs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setUnderline:()=>({commands:e})=>e.setMark("underline"),toggleUnderline:()=>({commands:e})=>e.toggleMark("underline"),unsetUnderline:()=>({commands:e})=>e.unsetMark("underline")}),addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});const Yy=new Bt("suggestion");function Vy({pluginKey:e=Yy,editor:t,char:i="@",allowSpaces:n=!1,prefixSpace:a=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:_=(()=>({})),allow:d=(()=>!0)}){const c=null==_?void 0:_();return new Rt({key:e,view(){return{update:async(e,i)=>{var n,a,r,o,s;const _=null===(n=this.key)||void 0===n?void 0:n.getState(i),d=null===(a=this.key)||void 0===a?void 0:a.getState(e.state),g=_.active&&d.active&&_.range.from!==d.range.from,f=!_.active&&d.active,h=_.active&&!d.active,p=f||g,m=!f&&!h&&_.query!==d.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?_:d,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:_}=l,c={...o};if(c.composing=s,u||t.view.composing){!(_<o.range.from||_>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:n,startOfLine:a,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=a?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),_=r.depth<=0?0:r.before(),d=r.pos,c=r.doc.textBetween(_,d,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(n&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:n,prefixSpace:a,startOfLine:r,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(c.active=!0,c.decorationId=o.decorationId?o.decorationId:u,c.range=e.range,c.query=e.query,c.text=e.text):c.active=!1}else c.active=!1;return c.active||(c.decorationId=null,c.range={},c.query=null,c.text=null),c}},props:{handleKeyDown(e,t){var i;const{active:n,range:a}=this.getState(e.state);return n&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:a}))||!1},decorations(e){const{active:t,range:i,decorationId:n}=this.getState(e);return t?Ma.create(e.doc,[Oa.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":n})]):null}}})}var Wy=function(e){var t=e.wrapperRef,i=e.index;if(t.current&&!(i>=t.current.children.length)){var n=t.current,a=n.children[i],r=a.clientHeight+8,o=n.scrollTop;a.offsetTop+r>o+n.clientHeight?o=a.offsetTop-n.clientHeight+r:o>a.offsetTop&&(o=a.offsetTop-8),t.current.scrollTop=o}};function $y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Bf()(e);if(t){var a=Bf()(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Mf()(this,i)}}var Ky=function(e){Af()(i,e);var t=$y(i);function i(e){var n;return wf()(this,i),n=t.call(this,e),d()(Of()(n),"onKeyDown",(function(e){var t=e.event;return"ArrowUp"===t.key?(n.upHandler(),!0):"ArrowDown"===t.key?(n.downHandler(),!0):"Enter"===t.key&&(n.enterHandler(),!0)})),d()(Of()(n),"upHandler",(function(){n.setState({selectedIndex:(n.state.selectedIndex+n.props.items.length-1)%n.props.items.length})})),d()(Of()(n),"downHandler",(function(){n.setState({selectedIndex:(n.state.selectedIndex+1)%n.props.items.length})})),d()(Of()(n),"enterHandler",(function(){n.selectItem(n.state.selectedIndex)})),d()(Of()(n),"selectItem",(function(e){var t=n.props.items[e];if(t&&f_(t.items)){var i=n.props,a=i.editor,r=i.range;t.command({editor:a,range:r})}})),n.state={selectedIndex:0},n.menuRef=m.a.createRef(),n}return xf()(i,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),Wy({wrapperRef:this.menuRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.props.items;return m.a.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},t.map((function(t,n){var a=f_(t.items),r=m.a.createElement(Qy,{key:t.title,item:t,index:n,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(n)}});return a?r:m.a.createElement(ic,{key:t.title,interactive:!0,placement:"right",hideOnClick:!1,content:m.a.createElement(i,u()({},e.props,{items:t.items})),onCreate:function(e){return e.popper.style.width="max-content"}},r)})))}}]),i}(m.a.Component),Qy=Object(p.forwardRef)((function(e,t){var i=e.item,n=e.selectedIndex,a=e.index,r=e.selectItem,o=i.Icon;return m.a.createElement("div",{className:b()("neeto-editor-slash-commands__item",{active:a===n}),onClick:function(){return r(a)},ref:t,"data-cy":"neeto-editor-command-list-item-".concat(a)},o&&m.a.createElement(o,{size:20}),m.a.createElement("div",{className:"neeto-editor-slash-commands__item-content"},m.a.createElement("h5",null,i.title),m.a.createElement("p",null,i.description)))})),Zy=Ky,Xy=["size","color","strokeWidth"];function Jy(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,Xy);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M13 4.5H20M13 9.5H20M4 14.5H20M4 19.5H20M9 9.5L6.5 4.5L4 9.5M4.5 8.5H6.5H8.5",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}Jy.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Jy.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var eD=["size","color","strokeWidth"];function tD(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,eD);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M5 6V18M13 6V18M5 12H13M18.5 18V13L17.25 14.25M20 18H17",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}tD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},tD.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var iD=["size","color","strokeWidth"];function nD(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,iD);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M17 14C17 13.7348 17.1054 13.4804 17.2929 13.2929C17.4804 13.1054 17.7348 13 18 13H18.6145C18.8723 13 19.1237 13.0811 19.3329 13.2319C19.542 13.3827 19.6985 13.5955 19.78 13.8401C19.8471 14.0414 19.8609 14.2566 19.8202 14.4648C19.7794 14.673 19.6854 14.8671 19.5473 15.0281L17 18H20M5 6V18M13 6V18M5 12H13",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}nD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},nD.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var aD=["size","color","strokeWidth"];function rD(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,aD);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M20.667 20.125H3.33301M20.667 14.708H3.33301M20.667 9.292H16.334M20.667 3.875H16.334M9.29201 6.042H12C12.299 6.042 12.542 6.285 12.542 6.584V8.75C12.542 9.049 12.299 9.292 12 9.292H9.83301C9.53401 9.292 9.29101 9.049 9.29101 8.75L9.29201 6.042ZM9.29201 6.042C9.29201 3.875 9.69801 3.515 10.917 2.792M3.33301 6.042H6.04101C6.34001 6.042 6.58301 6.285 6.58301 6.584V8.75C6.58301 9.049 6.34001 9.292 6.04101 9.292H3.87501C3.57601 9.292 3.33301 9.049 3.33301 8.75V6.042ZM3.33301 6.042C3.33301 3.875 3.73901 3.515 4.95801 2.792",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}rD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},rD.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var oD=["size","color","strokeWidth"];function sD(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,oD);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M17 12H7",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}sD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},sD.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var lD=["size","color","strokeWidth"];function uD(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,lD);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M15.375 13.097L19.17 16.151C19.906 16.744 21 16.22 21 15.275V8.725C21 7.78 19.906 7.256 19.17 7.849L15.375 10.903M13.125 17.75H5.25C4.007 17.75 3 16.743 3 15.5V8.5C3 7.257 4.007 6.25 5.25 6.25H13.125C14.368 6.25 15.375 7.257 15.375 8.5V15.5C15.375 16.743 14.368 17.75 13.125 17.75Z",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}uD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},uD.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var _D={PARAGRAPH:{optionName:om.FONT_SIZE,title:"Paragraph",description:"Add a plain text block.",Icon:Jy,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("paragraph").run()}},H1:{optionName:om.FONT_SIZE,title:"H1",description:"Add a big heading.",Icon:tD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:1}).run()}},H2:{optionName:om.FONT_SIZE,title:"H2",description:"Add a sub-heading.",Icon:nD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:2}).run()}},LIST_ORDERED:{optionName:om.LIST_ORDERED,title:"Numbered list",description:"Add a list with numbering.",Icon:eg,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleOrderedList().run()}},LIST_BULLETS:{optionName:om.LIST_BULLETS,title:"Bulleted list",description:"Add an list bullets.",Icon:Xc,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBulletList().run()}},BLOCKQUOTE:{optionName:om.BLOCKQUOTE,title:"Blockquote",description:"Add a quote.",Icon:rD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBlockquote().run()}},IMAGE:{optionName:om.IMAGE_UPLOAD,title:"Image",description:"Add an image.",Icon:Qc,command:function(e){var t=e.editor,i=e.range;return t.chain().focus().deleteRange(i).run()}},CODE:{optionName:om.CODE_BLOCK,title:"Code block",description:"Add a code block with syntax highlighting.",Icon:jd,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleCodeBlock().run()}},EMOJI:{optionName:om.EMOJI,title:"Emoji",description:"Add an emoji.",Icon:kf,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("::").run()}},DIVIDER:{optionName:om.DIVIDER,title:"Divider",description:"Add an horizontal line to separate sections.",Icon:sD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setHorizontalRule().run()}},VIDEO:{optionName:om.VIDEO_EMBED,title:"Embed Youtube/Vimeo",description:"Embed a video from major services.",Icon:uD,command:function(e){var t,i=e.editor,n=e.range,a=prompt("Please enter Youtube/Vimeo embed URL."),r=(t=a.match(zc))&&"https://www.youtube.com/embed/".concat(t[5])||function(e){var t=e.match(Gc);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])}(a);r?i.chain().focus().deleteRange(n).setExternalVideo({src:r}).run():i.chain().focus().deleteRange(n).insertContent("#invalid").run()}},MENTION:{optionName:om.MENTION,title:"Mention",description:"Mention a user.",Icon:sf,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("@").run()}},NO_RESULT:{title:"No results",command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).run()}}};function dD(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function cD(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?dD(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dD(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var gD=new Bt("commands"),fD=function(e){var t=e.setImageUploadVisible,i=e.mentions,n=e.addonCommands,a=e.options,r=[_D.PARAGRAPH,_D.H1,_D.H2,_D.LIST_ORDERED,_D.LIST_BULLETS,_D.BLOCKQUOTE,cD(cD({},_D.IMAGE),{},{command:function(){var e;t(!0),(e=_D.IMAGE).command.apply(e,arguments)}}),_D.CODE,_D.EMOJI,_D.DIVIDER,_D.VIDEO];return f_(i)||r.push(_D.MENTION),f_(a)||(r=r.filter((function(e){var t=e.optionName;return a.includes(t)}))),f_(n)||(r=r.concat(n)),mr.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:gD,command:function(e){var t=e.editor,i=e.range;e.props.command({editor:t,range:i})},items:function(e){var t=e.query,i=r.filter((function(e){return e.title.toLowerCase().includes(t.toLowerCase())}));return f_(i)?[_D.NO_RESULT]:i},render:function(){var e,t;return{onStart:function(i){e=new Tu(Zy,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t&&t[0].destroy(),e&&e.destroy()}}}}}},addProseMirrorPlugins:function(){return[Vy(cD({editor:this.editor},this.options.suggestion))]}})},hD={};function pD(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var i=e[t];"object"!=typeof i||Object.isFrozen(i)||pD(i)})),e}var mD=pD,FD=pD;mD.default=FD;class bD{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ED(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function yD(e,...t){const i=Object.create(null);for(const t in e)i[t]=e[t];return t.forEach((function(e){for(const t in e)i[t]=e[t]})),i}const DD=e=>!!e.kind;class vD{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=ED(e)}openNode(e){if(!DD(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){DD(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class kD{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{kD._collapse(e)}))}}class SD extends kD{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const i=e.root;i.kind=t,i.sublanguage=!0,this.add(i)}toHTML(){return new vD(this,this.options).value()}finalize(){return!0}}function wD(e){return e?"string"==typeof e?e:e.source:null}const CD=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const xD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",TD={begin:"\\\\[\\s\\S]",relevance:0},OD={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[TD]},ND={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[TD]},AD={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},RD=function(e,t,i={}){const n=yD({className:"comment",begin:e,end:t,contains:[]},i);return n.contains.push(AD),n.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),n},MD=RD("//","$"),ID=RD("/\\*","\\*/"),BD=RD("#","$"),LD={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},PD={className:"number",begin:xD,relevance:0},jD={className:"number",begin:"\\b(0b[01]+)",relevance:0},qD={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},UD={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[TD,{begin:/\[/,end:/\]/,relevance:0,contains:[TD]}]}]},zD={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},GD={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},HD={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var YD=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:xD,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>wD(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),yD({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:TD,APOS_STRING_MODE:OD,QUOTE_STRING_MODE:ND,PHRASAL_WORDS_MODE:AD,COMMENT:RD,C_LINE_COMMENT_MODE:MD,C_BLOCK_COMMENT_MODE:ID,HASH_COMMENT_MODE:BD,NUMBER_MODE:LD,C_NUMBER_MODE:PD,BINARY_NUMBER_MODE:jD,CSS_NUMBER_MODE:qD,REGEXP_MODE:UD,TITLE_MODE:zD,UNDERSCORE_TITLE_MODE:GD,METHOD_GUARD:HD,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function VD(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function WD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=VD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function $D(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>wD(e)).join("|")+")"}(...e.illegal))}function KD(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function QD(e,t){void 0===e.relevance&&(e.relevance=1)}const ZD=["of","and","for","in","not","or","if","then","parent","list","value"];function XD(e,t){return t?Number(t):function(e){return ZD.includes(e.toLowerCase())}(e)?0:1}function JD(e,{plugins:t}){function i(t,i){return new RegExp(wD(t),"m"+(e.case_insensitive?"i":"")+(i?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=i(function(e,t="|"){let i=0;return e.map(e=>{i+=1;const t=i;let n=wD(e),a="";for(;n.length>0;){const e=CD.exec(n);if(!e){a+=n;break}a+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?a+="\\"+String(Number(e[1])+t):(a+=e[0],"("===e[0]&&i++)}return a}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex((e,t)=>t>0&&void 0!==e),n=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,n)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,i])=>t.addRule(e,i)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=yD(e.classNameAliases||{}),function t(n,r){const o=n;if(n.isCompiled)return o;[KD].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[WD,$D,QD].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;if("object"==typeof n.keywords&&(s=n.keywords.$pattern,delete n.keywords.$pattern),n.keywords&&(n.keywords=function e(t,i,n="keyword"){const a={};return"string"==typeof t?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach((function(n){Object.assign(a,e(t[n],i,n))})),a;function r(e,t){i&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const i=t.split("|");a[i[0]]=[e,XD(i[0],i[1])]}))}}(n.keywords,e.case_insensitive)),n.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||n.lexemes||/\w+/,o.keywordPatternRe=i(s,!0),r&&(n.begin||(n.begin=/\B|\b/),o.beginRe=i(n.begin),n.endSameAsBegin&&(n.end=n.begin),n.end||n.endsWithParent||(n.end=/\B|\b/),n.end&&(o.endRe=i(n.end)),o.terminatorEnd=wD(n.end)||"",n.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(n.end?"|":"")+r.terminatorEnd)),n.illegal&&(o.illegalRe=i(n.illegal)),n.contains||(n.contains=[]),n.contains=[].concat(...n.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return yD(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return yD(e,{starts:e.starts?yD(e.starts):null});if(Object.isFrozen(e))return yD(e);return e}("self"===e?n:e)}))),n.contains.forEach((function(e){t(e,o)})),n.starts&&t(n.starts,r),o.matcher=function(e){const t=new a;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function ev(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,ED(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const tv={"after:highlightElement":({el:e,result:t,text:i})=>{const n=nv(e);if(!n.length)return;const a=document.createElement("div");a.innerHTML=t.value,t.value=function(e,t,i){let n=0,a="";const r=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){a+="<"+iv(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+ED(e.value)+'"'})).join("")+">"}function l(e){a+="</"+iv(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(a+=ED(i.substring(n,t[0].offset)),n=t[0].offset,t===e){r.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===n);r.reverse().forEach(s)}else"start"===t[0].event?r.push(t[0].node):r.pop(),u(t.splice(0,1)[0])}return a+ED(i.substr(n))}(n,nv(a),i)}};function iv(e){return e.nodeName.toLowerCase()}function nv(e){const t=[];return function e(i,n){for(let a=i.firstChild;a;a=a.nextSibling)3===a.nodeType?n+=a.nodeValue.length:1===a.nodeType&&(t.push({event:"start",offset:n,node:a}),n=e(a,n),iv(a).match(/br|hr|img|input/)||t.push({event:"stop",offset:n,node:a}));return n}(e,0),t}const av={},rv=e=>{console.error(e)},ov=(e,...t)=>{console.log("WARN: "+e,...t)},sv=(e,t)=>{av[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),av[`${e}/${t}`]=!0)},lv=ED,uv=yD,_v=Symbol("nomatch");var dv=function(e){const t=Object.create(null),i=Object.create(null),n=[];let a=!0;const r=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:SD};function u(e){return l.noHighlightRe.test(e)}function _(e,t,i,n){let a="",r="";"object"==typeof t?(a=e,i=t.ignoreIllegals,r=t.language,n=void 0):(sv("10.7.0","highlight(lang, code, ...args) has been deprecated."),sv("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,a=t);const o={code:a,language:r};v("before:highlight",o);const s=o.result?o.result:d(o.language,o.code,i,n);return s.code=o.code,v("after:highlight",s),s}function d(e,i,r,s){function u(e,t){const i=b.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,i)&&e.keywords[i]}function _(){null!=v.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof v.subLanguage){if(!t[v.subLanguage])return void S.addText(w);e=d(v.subLanguage,w,!0,k[v.subLanguage]),k[v.subLanguage]=e.top}else e=c(w,v.subLanguage.length?v.subLanguage:null);v.relevance>0&&(C+=e.relevance),S.addSublanguage(e.emitter,e.language)}():function(){if(!v.keywords)return void S.addText(w);let e=0;v.keywordPatternRe.lastIndex=0;let t=v.keywordPatternRe.exec(w),i="";for(;t;){i+=w.substring(e,t.index);const n=u(v,t);if(n){const[e,a]=n;if(S.addText(i),i="",C+=a,e.startsWith("_"))i+=t[0];else{const i=b.classNameAliases[e]||e;S.addKeyword(t[0],i)}}else i+=t[0];e=v.keywordPatternRe.lastIndex,t=v.keywordPatternRe.exec(w)}i+=w.substr(e),S.addText(i)}(),w=""}function g(e){return e.className&&S.openNode(b.classNameAliases[e.className]||e.className),v=Object.create(e,{parent:{value:v}}),v}function f(e){return 0===v.matcher.regexIndex?(w+=e[0],1):(O=!0,0)}function h(e){const t=e[0],i=e.rule,n=new bD(i),a=[i.__beforeBegin,i["on:begin"]];for(const i of a)if(i&&(i(e,n),n.isMatchIgnored))return f(t);return i&&i.endSameAsBegin&&(i.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),i.skip?w+=t:(i.excludeBegin&&(w+=t),_(),i.returnBegin||i.excludeBegin||(w=t)),g(i),i.returnBegin?0:t.length}function p(e){const t=e[0],n=i.substr(e.index),a=function e(t,i,n){let a=function(e,t){const i=e&&e.exec(t);return i&&0===i.index}(t.endRe,n);if(a){if(t["on:end"]){const e=new bD(t);t["on:end"](i,e),e.isMatchIgnored&&(a=!1)}if(a){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,i,n)}(v,e,n);if(!a)return _v;const r=v;r.skip?w+=t:(r.returnEnd||r.excludeEnd||(w+=t),_(),r.excludeEnd&&(w=t));do{v.className&&S.closeNode(),v.skip||v.subLanguage||(C+=v.relevance),v=v.parent}while(v!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.endRe=a.endRe),g(a.starts)),r.returnEnd?0:t.length}let m={};function F(t,n){const o=n&&n[0];if(w+=t,null==o)return _(),0;if("begin"===m.type&&"end"===n.type&&m.index===n.index&&""===o){if(w+=i.slice(n.index,n.index+1),!a){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=n,"begin"===n.type)return h(n);if("illegal"===n.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(v.className||"<unnamed>")+'"');throw e.mode=v,e}if("end"===n.type){const e=p(n);if(e!==_v)return e}if("illegal"===n.type&&""===o)return 1;if(T>1e5&&T>3*n.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=E(e);if(!b)throw rv(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const y=JD(b,{plugins:n});let D="",v=s||y;const k={},S=new l.__emitter(l);!function(){const e=[];for(let t=v;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>S.openNode(e))}();let w="",C=0,x=0,T=0,O=!1;try{for(v.matcher.considerAll();;){T++,O?O=!1:v.matcher.considerAll(),v.matcher.lastIndex=x;const e=v.matcher.exec(i);if(!e)break;const t=F(i.substring(x,e.index),e);x=e.index+t}return F(i.substr(x)),S.closeAllNodes(),S.finalize(),D=S.toHTML(),{relevance:Math.floor(C),value:D,language:e,illegal:!1,emitter:S,top:v}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:i.slice(x-100,x+100),mode:t.mode},sofar:D,relevance:0,value:lv(i),emitter:S};if(a)return{illegal:!1,relevance:0,value:lv(i),emitter:S,language:e,top:v,errorRaised:t};throw t}}function c(e,i){i=i||l.languages||Object.keys(t);const n=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:lv(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),a=i.filter(E).filter(D).map(t=>d(t,e,!1));a.unshift(n);const r=a.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(E(e.language).supersetOf===t.language)return 1;if(E(t.language).supersetOf===e.language)return-1}return 0}),[o,u]=r,_=o;return _.second_best=u,_}const g={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},f=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(f,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=l.languageDetectRe.exec(t);if(i){const t=E(i[1]);return t||(ov(o.replace("{}",i[1])),ov("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||E(e))}(e);if(u(n))return;v("before:highlightElement",{el:e,language:n}),t=e;const a=t.textContent,r=n?_(a,{language:n,ignoreIllegals:!0}):c(a);v("after:highlightElement",{el:e,result:r,text:a}),e.innerHTML=r.value,function(e,t,n){const a=t?i[t]:n;e.classList.add("hljs"),a&&e.classList.add(a)}(e,n,r.language),e.result={language:r.language,re:r.relevance,relavance:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance,relavance:r.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,sv("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(p)};let F=!1;function b(){if("loading"===document.readyState)return void(F=!0);document.querySelectorAll("pre code").forEach(p)}function E(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function y(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function D(e){const t=E(e);return t&&!t.disableAutodetect}function v(e,t){const i=e;n.forEach((function(e){e[i]&&e[i](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){F&&b()}),!1),Object.assign(e,{highlight:_,highlightAuto:c,highlightAll:b,fixMarkup:function(e){return sv("10.2.0","fixMarkup will be removed entirely in v11.0"),sv("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(r,e=>"\n"===e?l.useBR?"<br>":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:p,highlightBlock:function(e){return sv("10.7.0","highlightBlock will be removed entirely in v12.0"),sv("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(sv("10.3.0","'useBR' will be removed entirely in v11.0"),sv("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=uv(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){sv("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(i,n){let r=null;try{r=n(e)}catch(e){if(rv("Language definition for '{}' could not be registered.".replace("{}",i)),!a)throw e;rv(e),r=s}r.name||(r.name=i),t[i]=r,r.rawDefinition=n.bind(null,e),r.aliases&&y(r.aliases,{languageName:i})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(i))i[t]===e&&delete i[t]},listLanguages:function(){return Object.keys(t)},getLanguage:E,registerAliases:y,requireLanguage:function(e){sv("10.4.0","requireLanguage will be removed entirely in v11."),sv("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=E(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:D,inherit:uv,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),n.push(e)},vuePlugin:ev(e).VuePlugin}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="10.7.3";for(const e in YD)"object"==typeof YD[e]&&mD(YD[e]);return Object.assign(e,YD),e.addPlugin(g),e.addPlugin(tv),e.addPlugin(h),e}({}),cv={exports:{}};!function(e){!function(){var t;function i(e){for(var t,i,n,a,r=1,o=[].slice.call(arguments),s=0,l=e.length,u="",_=!1,d=!1,c=function(){return o[r++]},g=function(){for(var i="";/\d/.test(e[s]);)i+=e[s++],t=e[s];return i.length>0?parseInt(i):null};s<l;++s)if(t=e[s],_)switch(_=!1,"."==t?(d=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(d=!0,t=e[s+=2]):d=!0,a=g(),t){case"b":u+=parseInt(c(),10).toString(2);break;case"c":u+="string"==typeof(i=c())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case"d":u+=parseInt(c(),10);break;case"f":n=String(parseFloat(c()).toFixed(a||6)),u+=d?n:n.replace(/^0/,"");break;case"j":u+=JSON.stringify(c());break;case"o":u+="0"+parseInt(c(),10).toString(8);break;case"s":u+=c();break;case"x":u+="0x"+parseInt(c(),10).toString(16);break;case"X":u+="0x"+parseInt(c(),10).toString(16).toUpperCase();break;default:u+=t}else"%"===t?_=!0:u+=t;return u}(t=e.exports=i).format=i,t.vsprintf=function(e,t){return i.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(i.apply(null,arguments))})}()}(cv);var gv=cv.exports,fv=pv(Error),hv=fv;function pv(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=gv.apply(null,arguments)),new e(t)}}fv.eval=pv(EvalError),fv.range=pv(RangeError),fv.reference=pv(ReferenceError),fv.syntax=pv(SyntaxError),fv.type=pv(TypeError),fv.uri=pv(URIError),fv.create=pv;var mv=dv,Fv=hv;hD.highlight=bv,hD.highlightAuto=function(e,t){var i=t||{},n=i.subset||mv.listLanguages();i.prefix;var a,r,o,s,l=n.length,u=-1;if("string"!=typeof e)throw Fv("Expected `string` for value, got `%s`",e);r={relevance:0,language:null,value:[]},a={relevance:0,language:null,value:[]};for(;++u<l;)s=n[u],mv.getLanguage(s)&&((o=bv(s,e,t)).language=s,o.relevance>r.relevance&&(r=o),o.relevance>a.relevance&&(r=a,a=o));r.language&&(a.secondBest=r);return a},hD.registerLanguage=function(e,t){mv.registerLanguage(e,t)},hD.listLanguages=function(){return mv.listLanguages()},hD.registerAlias=function(e,t){var i,n=e;t&&((n={})[e]=t);for(i in n)mv.registerAliases(n[i],{languageName:i})},Ev.prototype.addText=function(e){var t,i,n=this.stack;if(""===e)return;t=n[n.length-1],(i=t.children[t.children.length-1])&&"text"===i.type?i.value+=e:t.children.push({type:"text",value:e})},Ev.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},Ev.prototype.addSublanguage=function(e,t){var i=this.stack,n=i[i.length-1],a=e.rootNode.children,r=t?{type:"element",tagName:"span",properties:{className:[t]},children:a}:a;n.children=n.children.concat(r)},Ev.prototype.openNode=function(e){var t=this.stack,i=this.options.classPrefix+e,n=t[t.length-1],a={type:"element",tagName:"span",properties:{className:[i]},children:[]};n.children.push(a),t.push(a)},Ev.prototype.closeNode=function(){this.stack.pop()},Ev.prototype.closeAllNodes=yv,Ev.prototype.finalize=yv,Ev.prototype.toHTML=function(){return""};function bv(e,t,i){var n,a=mv.configure({}),r=(i||{}).prefix;if("string"!=typeof e)throw Fv("Expected `string` for name, got `%s`",e);if(!mv.getLanguage(e))throw Fv("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw Fv("Expected `string` for value, got `%s`",t);if(null==r&&(r="hljs-"),mv.configure({__emitter:Ev,classPrefix:r}),n=mv.highlight(t,{language:e,ignoreIllegals:!0}),mv.configure(a||{}),n.errorRaised)throw n.errorRaised;return{relevance:n.relevance,language:n.language,value:n.emitter.rootNode.children}}function Ev(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function yv(){}function Dv(e){return e.value||e.children||[]}function vv({doc:e,name:t,lowlight:i}){const n=[];return ys(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:a}=e.node.attrs,r=i.listLanguages();(function e(t,i=[]){return t.map(t=>{const n=[...i,...t.properties?t.properties.className:[]];return t.children?e(t.children,n):{text:t.value,classes:n}}).flat()})(a&&r.includes(a)?Dv(i.highlight(a,e.node.textContent)):Dv(i.highlightAuto(e.node.textContent))).forEach(e=>{const i=t+e.text.length;if(e.classes.length){const a=Oa.inline(t,i,{class:e.classes.join(" ")});n.push(a)}t=i})}),Ma.create(e,n)}function kv({name:e,lowlight:t}){return new Rt({key:new Bt("lowlight"),state:{init:(i,{doc:n})=>vv({doc:n,name:e,lowlight:t}),apply:(i,n,a,r)=>{const o=a.selection.$head.parent.type.name,s=r.selection.$head.parent.type.name,l=ys(a.doc,t=>t.type.name===e),u=ys(r.doc,t=>t.type.name===e);return i.docChanged&&([o,s].includes(e)||u.length!==l.length||i.steps.some(e=>void 0!==e.from&&void 0!==e.to&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?vv({doc:i.doc,name:e,lowlight:t}):n.map(i.mapping,i.doc)}},props:{decorations(e){return this.getState(e)}}})}const Sv=pF.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:hD}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],kv({name:this.name,lowlight:this.options.lowlight})]}});function wv(){return m.a.createElement(Lu,{"data-cy":"neeto-editor-code-block"},m.a.createElement("pre",null,m.a.createElement(Pu,{as:"code"})))}var Cv=i(94),xv=i.n(Cv),Tv=Sv.extend({addNodeView:function(){return new Ru(wv)}}).configure({lowlight:xv.a}),Ov=function(e){var t=e.items,i=e.command;return m.a.createElement("div",{className:"neeto-editor-variables-suggestion"},m.a.createElement(tf,{variables:t,onClickVariable:function(e){var t=e.category_key,n=e.key,a=t?"".concat(t,".").concat(n):n;i({label:a,id:a})}}))};function Nv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Av(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Nv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Nv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Rv=new Bt("variables"),Mv=cs.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel:function(e){var t=e.options,i=e.node;return"".concat(t.charOpen).concat(i.attrs.label||i.attrs.id).concat(t.charClose)},suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:function(e){return e.getAttribute("data-id")},renderHTML:function(e){return e.id?{"data-id":e.id}:{}}},label:{default:null,parseHTML:function(e){return e.getAttribute("data-label")},renderHTML:function(e){return e.label?{"data-label":e.label}:{}}}}},parseHTML:function(){return[{tag:"span[data-variable]"}]},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return["span",as({"data-variable":""},this.options.HTMLAttributes,i),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addCommands:function(){var e=this;return{setVariable:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:t},{type:"text",text:" "}]).run()}}}},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var i=t.tr,n=t.state,a=!1,r=n.selection,o=r.empty,s=r.anchor;return!!o&&(n.doc.nodesBetween(s-1,s,(function(t,n){if(t.type.name===e.name)return a=!0,i.insertText("",n,n+t.nodeSize),!1})),a)}))}}},addProseMirrorPlugins:function(){return[Vy(Av({editor:this.editor},this.options.suggestion))]}}),Iv={char:"{{",startOfLine:!1,pluginKey:Rv,command:function(e){var t=e.editor,i=e.range,n=e.props;t.chain().focus().deleteRange(i).setVariable(n).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(Ov,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Bv=function(e){var t=e.suggestion,i=void 0===t?{}:t;return Mv.configure({suggestion:Av(Av({},Iv),i)})},Lv=i(33),Pv=i.n(Lv),jv=i(95),qv=i.n(jv),Uv=function(e){var t=Pv()(e);return"string"===t||"funtion"===t?e:qv()(e)?function(t){var i=t.node.type.name;return e[i]}:""},zv=mr.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Rt({props:{decorations:function(t){var i=t.doc,n=t.selection,a=e.editor.isEditable||!e.options.showOnlyWhenEditable,r=n.anchor,o=[];if(a)return i.descendants((function(t,i){var n=r>=i&&r<=i+t.nodeSize,a=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((n||!e.options.showOnlyCurrent)&&!s&&a){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=Oa.node(i,i+t.nodeSize,{class:l.join(" "),"data-placeholder":"function"==typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:i}):e.options.placeholder});o.push(u)}return e.options.includeChildren})),Ma.create(i,o)}}})]}});const Gv=new Bt("suggestion");function Hv({pluginKey:e=Gv,editor:t,char:i="@",allowSpaces:n=!1,prefixSpace:a=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:_=(()=>({})),allow:d=(()=>!0)}){const c=null==_?void 0:_();return new Rt({key:e,view(){return{update:async(e,i)=>{var n,a,r,o,s;const _=null===(n=this.key)||void 0===n?void 0:n.getState(i),d=null===(a=this.key)||void 0===a?void 0:a.getState(e.state),g=_.active&&d.active&&_.range.from!==d.range.from,f=!_.active&&d.active,h=_.active&&!d.active,p=f||g,m=!f&&!h&&_.query!==d.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?_:d,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:_}=l,c={...o};if(c.composing=s,u||t.view.composing){!(_<o.range.from||_>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:n,startOfLine:a,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=a?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),_=r.depth<=0?0:r.before(),d=r.pos,c=r.doc.textBetween(_,d,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(n&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:n,prefixSpace:a,startOfLine:r,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(c.active=!0,c.decorationId=o.decorationId?o.decorationId:u,c.range=e.range,c.query=e.query,c.text=e.text):c.active=!1}else c.active=!1;return c.active||(c.decorationId=null,c.range={},c.query=null,c.text=null),c}},props:{handleKeyDown(e,t){var i;const{active:n,range:a}=this.getState(e.state);return n&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:a}))||!1},decorations(e){const{active:t,range:i,decorationId:n}=this.getState(e);return t?Ma.create(e.doc,[Oa.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":n})]):null}}})}const Yv=new Bt("mention"),Vv=cs.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var i;return`${e.suggestion.char}${null!==(i=t.attrs.label)&&void 0!==i?i:t.attrs.id}`},suggestion:{char:"@",pluginKey:Yv,command:({editor:e,range:t,props:i})=>{var n;const a=e.view.state.selection.$to.nodeAfter;(null===(n=null==a?void 0:a.text)||void 0===n?void 0:n.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:i},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const i=e.state.doc.resolve(t.from),n=e.schema.nodes[this.name];return!!i.parent.type.contentMatch.matchType(n)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-mention]"}],renderHTML({node:e,HTMLAttributes:t}){return["span",as({"data-mention":""},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let i=!1;const{selection:n}=t,{empty:a,anchor:r}=n;return!!a&&(t.doc.nodesBetween(r-1,r,(t,n)=>{if(t.type.name===this.name)return i=!0,e.insertText(this.options.suggestion.char||"",n,n+t.nodeSize),!1}),i)})}},addProseMirrorPlugins(){return[Hv({editor:this.editor,...this.options.suggestion})]}});function Wv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Bf()(e);if(t){var a=Bf()(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Mf()(this,i)}}var $v=function(e){Af()(i,e);var t=Wv(i);function i(e){var n;return wf()(this,i),n=t.call(this,e),d()(Of()(n),"selectItem",(function(e){var t=n.props,i=t.items,a=t.command,r=i[e];r&&a({label:r.name,id:r.key})})),d()(Of()(n),"upHandler",(function(){var e=n.props.items;n.setState((function(t){return{selectedIndex:(t.selectedIndex+e.length-1)%e.length}}))})),d()(Of()(n),"downHandler",(function(){var e=n.props.items;n.setState((function(t){return{selectedIndex:(t.selectedIndex+1)%e.length}}))})),d()(Of()(n),"enterHandler",(function(){var e=n.state.selectedIndex;n.selectItem(e)})),d()(Of()(n),"onKeyDown",(function(e){var t=e.event,i={ArrowUp:n.upHandler,ArrowDown:n.downHandler,Enter:n.enterHandler};return!!i.hasOwnProperty(t.key)&&(i[t.key](),!0)})),n.state={selectedIndex:0},n.mentionRef=m.a.createRef(),n}return xf()(i,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),Wy({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,i=this.props.items;return 0===i.length?m.a.createElement("div",{className:"neeto-editor-mentions__wrapper"},m.a.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):m.a.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},i.map((function(i,n){var a=i.key,r=i.name,o=i.imageUrl,s=i.showImage;return m.a.createElement("button",{className:b()("neeto-editor-mentions__item",{active:n===t}),key:a,onClick:function(){return e.selectItem(n)},type:"button","data-cy":"neeto-editor-mention-list-".concat(r)},s&&m.a.createElement(cf,{user:{name:r,imageUrl:o}}),m.a.createElement("p",null,r))})))}}]),i}(m.a.Component);function Kv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Qv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Kv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Kv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Zv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.showImage,n=void 0!==i&&i,a=e.map((function(e,t){return Qv({showImage:n,key:"".concat(c_(e.name),"-").concat(t)},e)})).sort((function(e,t){return e.name.localeCompare(t.name)}));return function(e){var t=e.query;return a.filter((function(e){return e.name.toLowerCase().includes(t.toLowerCase())}))}},Xv=["suggestion"];function Jv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ek(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Jv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Jv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var tk={render:function(){var e,t;return{onStart:function(i){e=new Tu($v,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(i){var n;return"Escape"===i.event.key?(t[0].hide(),!0):null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(i)},onExit:function(){t[0].destroy(),e.destroy()}}}},ik=Vv.extend({addCommands:function(){var e=this;return{setMention:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:{id:t,label:t}},{type:"text",text:" "}]).run()}}}}}),nk=function(e){var t=e.suggestion,i=void 0===t?{}:t,n=h()(e,Xv);return ik.configure(ek(ek({},n),{},{suggestion:ek(ek({},tk),i)}))};function ak(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function rk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ak(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ak(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var ok=cs.create({name:"external-video",addOptions:function(){return{inline:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["iframe",as(this.options.HTMLAttributes,rk(rk({},t),{},{class:"video-wrapper"}))]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(i){return i.commands.insertContent({type:e.name,attrs:t})}}}}});function sk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Bf()(e);if(t){var a=Bf()(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Mf()(this,i)}}var lk=function(e){Af()(i,e);var t=sk(i);function i(){var e;wf()(this,i);for(var n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return e=t.call.apply(t,[this].concat(a)),d()(Of()(e),"state",{selectedIndex:0,emojiSuggestions:gh.search(e.props.query||"smile").slice(0,5)}),d()(Of()(e),"onKeyDown",(function(t){var i=t.event;if("ArrowLeft"===i.key||"ArrowDown"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===i.key||"ArrowUp"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===i.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===i.key){var n;if(f_(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(n=gh.search(e.props.query))||void 0===n?void 0:n[0]).run();return!0}return"Escape"===i.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),d()(Of()(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return xf()(i,[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:gh.search(this.props.query||"smile").slice(0,5)})}},{key:"render",value:function(){var e=this;return m.a.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map((function(t,i){return m.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(i)},className:b()("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":i===e.state.selectedIndex}),"data-cy":"neeto-editor-emoji-suggestion-".concat(t.id)},t.native)})):m.a.createElement("p",null,"No results"))}}]),i}(m.a.Component);function uk(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _k(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?uk(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):uk(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var dk=new Bt("emoji-suggestion"),ck=cs.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:dk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(lk,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addCommands:function(){return{setEmoji:function(e){return function(t){(0,t.chain)().focus().insertContent("".concat((null==e?void 0:e.native)||""," ")).run()}}}},addProseMirrorPlugins:function(){return[Vy(_k({editor:this.editor},this.options.suggestion))]}});function gk(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function fk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gk(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gk(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var hk=new Bt("emoji-picker"),pk=cs.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:hk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(mp,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[Vy(fk({editor:this.editor},this.options.suggestion))]}}),mk=function(e){return function(e){var t=e.handleSubmit;return mr.create({addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return null==t||t(e.editor.getHTML()),e.editor.commands.blur(),!0}}}})}({handleSubmit:e.handleSubmit})};var Fk=[om.FONT_COLOR,om.FONT_SIZE,om.BOLD,om.ITALIC,om.UNDERLINE,om.STRIKETHROUGH,om.LINK,om.LIST_BULLETS,om.LIST_ORDERED],bk=["forceTitle","titleError","hideSlashCommands","addons","addonCommands","markdownMode","className","uploadEndpoint","initialValue","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName","characterLimit","editorSecrets","rows","autoFocus","onSubmit","heightStrategy","characterCountStrategy"],Ek=function(e,t){var i=e.forceTitle,n=void 0!==i&&i,a=e.titleError,r=void 0!==a&&a,o=e.hideSlashCommands,s=void 0!==o&&o,l=e.addons,_=void 0===l?[]:l,c=e.addonCommands,f=e.markdownMode,F=void 0!==f&&f,E=e.className,y=e.uploadEndpoint,D=e.initialValue,v=void 0===D?"":D,k=e.onChange,S=void 0===k?function(){}:k,w=e.menuType,C=void 0===w?"fixed":w,x=e.variables,T=e.mentions,O=e.showImageInMention,N=void 0!==O&&O,A=e.placeholder,R=void 0===A?n?{title:"Untitled"}:null:A,M=e.extensions,I=e.contentClassName,B=e.characterLimit,L=e.editorSecrets,P=e.rows,j=void 0===P?6:P,q=e.autoFocus,U=void 0!==q&&q,z=e.onSubmit,G=e.heightStrategy,H=void 0===G?"fixed":G,Y=e.characterCountStrategy,V=void 0===Y?"hidden":Y,W=h()(e,bk),$=Object(p.useState)(!1),K=g()($,2),Q=K[0],Z=K[1],X=!F&&"fixed"===C,J=!F&&"bubble"===C,ee=!F&&!s,te=function(e){if(e){if("string"==typeof e&&e.length)return!0;if("object"===Pv()(e)&&Object.keys(e).length)return!0;if("function"==typeof e)return!0}return!1}(R),ie=!te&&ee,ne=_.includes("image-upload-unsplash"),ae=!F&&"hidden"!==V,re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=t.includeImageUpload,n=e.map((function(e){return e.toLowerCase()}));return i&&n.push(om.IMAGE_UPLOAD),[].concat(Fk,n)}(_,{includeImageUpload:ne}),oe=function(e){var t=e.forceTitle,i=e.placeholder,n=e.extensions,a=e.mentions,r=e.variables,o=e.isSlashCommandsActive,s=e.showImageInMention,l=e.setImageUploadVisible,u=e.options,_=e.addonCommands,d=e.characterLimit,c=e.onSubmit,g=[Py,Ly.extend({content:t?"title block*":"block+"}),ub.configure({document:!1,codeBlock:!1}),Hy,Nb,Iy,Mb,Tv,Gy,bF,ok,My,By,zv.configure({placeholder:Uv(i)}),ck,pk,Ay.configure({limit:d}),mk({handleSubmit:c})];return o&&g.push(fD({setImageUploadVisible:l,options:u,addonCommands:_,mentions:a})),f_(a)||g.push(nk({suggestion:{items:Zv(a,{showImage:s})}})),f_(r)||g.push(Bv({suggestion:{items:function(){return r}}})),f_(n)||(g=g.concat(n)),g}({contentClassName:I,forceTitle:n,placeholder:R,extensions:M,mentions:T,variables:x,isSlashCommandsActive:ee,showImageInMention:N,setImageUploadVisible:Z,options:re,addonCommands:c,characterLimit:B,onSubmit:z}),se=b()("neeto-editor",d()({"slash-active":ie,"fixed-menu-active border":X,"bubble-menu-active":J,"force-title":n,"force-title--error":r,"placeholder-active":te},E,E)),le=function(e){var t=e.heightStrategy,i={},n=21*e.rows+26;return"flexible"===t?i["min-height"]=n+"px":i.height=n+"px",i}({heightStrategy:H,rows:j}),ue=xu({extensions:oe,content:v,injectCSS:!1,autofocus:U&&"end",editorProps:{attributes:{class:se,style:g_(le)}},onUpdate:function(e){var t=e.editor;return S(t.getHTML())}}),_e=tF({content:v,onUpdate:function(e){var t=e.html;return S(t)},onSubmit:function(e){var t=e.html;return z&&z(t)}});return m.a.useImperativeHandle(t,(function(){return{editor:F?_e:ue}})),Object(p.useEffect)((function(){if(ue){var e=F?ue.getHTML():_e.getHTML();(F?_e.commands.setContent:ue.commands.setContent)(e)}}),[F]),m.a.createElement("div",{className:"neeto-editor-wrapper"},X&&m.a.createElement(bp,{editor:ue,variables:x,setImageUploadVisible:Z,options:re,mentions:T,showImageInMention:N}),J&&m.a.createElement(Yc,{editor:ue,options:re}),m.a.createElement(cm,{isVisible:Q,setIsVisible:Z,editor:ue,imageUploadUrl:y,isUnsplashImageUploadActive:ne,unsplashApiKey:null==L?void 0:L.unsplash}),F&&m.a.createElement(pm,u()({editor:_e,strategy:H,style:le,limit:B,className:se},W)),m.a.createElement("div",{className:b()({"neeto-editor-content--hidden":F})},m.a.createElement(Bu,u()({editor:ue},W))),ae&&m.a.createElement(mm,{count:null==ue?void 0:ue.storage.characterCount.characters(),limit:B,strategy:V}))},yk=m.a.forwardRef(Ek),Dk=i(96),vk=i.n(Dk);var kk=["content","className"],Sk=function(e){var t=e.content,i=void 0===t?"":t,n=e.className,a=h()(e,kk);return Object(p.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){vk.a.highlightElement(e)}))}),[i]),m.a.createElement("div",u()({className:b()("neeto-editor-content",d()({},n,n)),dangerouslySetInnerHTML:{__html:bm.a.sanitize(i,{ADD_ATTR:["target"]})},"data-cy":"neeto-editor-content"},a))}}])}));
76
+ var Eg="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function yg(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){i(window.event)}))}function Dg(e,t){for(var i=t.slice(0,t.length-1),n=0;n<i.length;n++)i[n]=e[i[n].toLowerCase()];return i}function vg(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),i=t.lastIndexOf("");i>=0;)t[i-1]+=",",t.splice(i,1),i=t.lastIndexOf("");return t}for(var kg={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Eg?173:189,"=":Eg?61:187,";":Eg?59:186,"'":222,"[":219,"]":221,"\\":220},Sg={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},wg={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Cg={16:!1,18:!1,17:!1,91:!1},xg={},Tg=1;Tg<20;Tg++)kg["f".concat(Tg)]=111+Tg;var Og=[],Ng="all",Ag=[],Rg=function(e){return kg[e.toLowerCase()]||Sg[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Mg(e){Ng=e||"all"}function Ig(){return Ng||"all"}var Bg=function(e){var t=e.key,i=e.scope,n=e.method,a=e.splitKey,r=void 0===a?"+":a;vg(t).forEach((function(e){var t=e.split(r),a=t.length,o=t[a-1],s="*"===o?"*":Rg(o);if(xg[s]){i||(i=Ig());var l=a>1?Dg(Sg,t):[];xg[s]=xg[s].map((function(e){return(!n||e.method===n)&&e.scope===i&&function(e,t){for(var i=e.length>=t.length?e:t,n=e.length>=t.length?t:e,a=!0,r=0;r<i.length;r++)-1===n.indexOf(i[r])&&(a=!1);return a}(e.mods,l)?{}:e}))}}))};function Lg(e,t,i){var n;if(t.scope===i||"all"===t.scope){for(var a in n=t.mods.length>0,Cg)Object.prototype.hasOwnProperty.call(Cg,a)&&(!Cg[a]&&t.mods.indexOf(+a)>-1||Cg[a]&&-1===t.mods.indexOf(+a))&&(n=!1);(0!==t.mods.length||Cg[16]||Cg[18]||Cg[17]||Cg[91])&&!n&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Pg(e){var t=xg["*"],i=e.keyCode||e.which||e.charCode;if(jg.filter.call(this,e)){if(93!==i&&224!==i||(i=91),-1===Og.indexOf(i)&&229!==i&&Og.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var i=wg[t];e[t]&&-1===Og.indexOf(i)?Og.push(i):!e[t]&&Og.indexOf(i)>-1?Og.splice(Og.indexOf(i),1):"metaKey"===t&&e[t]&&3===Og.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Og=Og.slice(Og.indexOf(i))))})),i in Cg){for(var n in Cg[i]=!0,Sg)Sg[n]===i&&(jg[n]=!0);if(!t)return}for(var a in Cg)Object.prototype.hasOwnProperty.call(Cg,a)&&(Cg[a]=e[wg[a]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Og.indexOf(17)&&Og.push(17),-1===Og.indexOf(18)&&Og.push(18),Cg[17]=!0,Cg[18]=!0);var r=Ig();if(t)for(var o=0;o<t.length;o++)t[o].scope===r&&("keydown"===e.type&&t[o].keydown||"keyup"===e.type&&t[o].keyup)&&Lg(e,t[o],r);if(i in xg)for(var s=0;s<xg[i].length;s++)if(("keydown"===e.type&&xg[i][s].keydown||"keyup"===e.type&&xg[i][s].keyup)&&xg[i][s].key){for(var l=xg[i][s],u=l.splitKey,_=l.key.split(u),d=[],c=0;c<_.length;c++)d.push(Rg(_[c]));d.sort().join("")===Og.sort().join("")&&Lg(e,l,r)}}}function jg(e,t,i){Og=[];var n=vg(e),a=[],r="all",o=document,s=0,l=!1,u=!0,_="+";for(void 0===i&&"function"==typeof t&&(i=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(r=t.scope),t.element&&(o=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(u=t.keydown),"string"==typeof t.splitKey&&(_=t.splitKey)),"string"==typeof t&&(r=t);s<n.length;s++)a=[],(e=n[s].split(_)).length>1&&(a=Dg(Sg,e)),(e="*"===(e=e[e.length-1])?"*":Rg(e))in xg||(xg[e]=[]),xg[e].push({keyup:l,keydown:u,scope:r,mods:a,shortcut:n[s],method:i,key:n[s],splitKey:_});void 0!==o&&!function(e){return Ag.indexOf(e)>-1}(o)&&window&&(Ag.push(o),yg(o,"keydown",(function(e){Pg(e)})),yg(window,"focus",(function(){Og=[]})),yg(o,"keyup",(function(e){Pg(e),function(e){var t=e.keyCode||e.which||e.charCode,i=Og.indexOf(t);if(i>=0&&Og.splice(i,1),e.key&&"meta"===e.key.toLowerCase()&&Og.splice(0,Og.length),93!==t&&224!==t||(t=91),t in Cg)for(var n in Cg[t]=!1,Sg)Sg[n]===t&&(jg[n]=!1)}(e)})))}var qg={setScope:Mg,getScope:Ig,deleteScope:function(e,t){var i,n;for(var a in e||(e=Ig()),xg)if(Object.prototype.hasOwnProperty.call(xg,a))for(i=xg[a],n=0;n<i.length;)i[n].scope===e?i.splice(n,1):n++;Ig()===e&&Mg(t||"all")},getPressedKeyCodes:function(){return Og.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=Rg(e)),-1!==Og.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,i=t.tagName,n=!0;return!t.isContentEditable&&("INPUT"!==i&&"TEXTAREA"!==i&&"SELECT"!==i||t.readOnly)||(n=!1),n},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&Bg(e)}));else if("object"==typeof e)e.key&&Bg(e);else if("string"==typeof e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var a=i[0],r=i[1];"function"==typeof a&&(r=a,a=""),Bg({key:e,scope:a,method:r,splitKey:"+"})}}else Object.keys(xg).forEach((function(e){return delete xg[e]}))}};for(var Ug in qg)Object.prototype.hasOwnProperty.call(qg,Ug)&&(jg[Ug]=qg[Ug]);if("undefined"!=typeof window){var zg=window.hotkeys;jg.noConflict=function(e){return e&&window.hotkeys===jg&&(window.hotkeys=zg),jg},window.hotkeys=jg}var Gg=jg;Gg.filter=function(){return!0};var Hg=function(e,t){var i=e.target,n=i&&i.tagName;return Boolean(n&&t&&t.includes(n))};function Yg(e,t,i,n){i instanceof Array&&(n=i,i=void 0);var a=i||{},r=a.enableOnTags,o=a.filter,s=a.keyup,l=a.keydown,u=a.filterPreventDefault,_=void 0===u||u,d=a.enabled,c=void 0===d||d,g=a.enableOnContentEditable,f=void 0!==g&&g,h=Object(p.useRef)(null),m=Object(p.useCallback)((function(e,i){var n;return o&&!o(e)?!_:!!(Hg(e,["INPUT","TEXTAREA","SELECT"])&&!Hg(e,r)||null!=(n=e.target)&&n.isContentEditable&&!f)||(null===h.current||document.activeElement===h.current)&&(t(e,i),!0)}),n?[h,r,o].concat(n):[h,r,o]);return Object(p.useEffect)((function(){if(c)return s&&!0!==l&&(i.keydown=!1),Gg(e,i||{},m),function(){return Gg.unbind(e,m)};Gg.unbind(e,m)}),[m,e,c]),h}Gg.isPressed;var Vg=function(e,t){Object(p.useEffect)((function(){var i=function(i){e.current&&!e.current.contains(i.target)&&t(i)};return document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),function(){document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}}),[e,t])},Wg=["icon","label","isOpen","onVisible","onClose","ulProps","position","children","className","buttonStyle","buttonProps","customTarget","disabled","closeOnEsc","closeOnSelect","closeOnOutsideClick","dropdownModifiers"];function $g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Kg(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$g(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):$g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Qg=function(){},Zg=Object(p.forwardRef)((function(e,t){e.icon;var i=e.label,n=e.isOpen,a=e.onVisible,r=void 0===a?Qg:a,o=e.onClose,s=void 0===o?Qg:o,l=e.ulProps,_=e.position,c=e.children,f=e.className,F=(e.buttonStyle,e.buttonProps),E=e.customTarget,y=(e.disabled,e.closeOnEsc),D=void 0===y||y,v=e.closeOnSelect,k=void 0===v||v,S=e.closeOnOutsideClick,w=void 0===S||S,C=e.dropdownModifiers,x=void 0===C?[]:C,T=h()(e,Wg),O=Object(p.useRef)(),N=E(),A=!(null==n),R=Object(p.useState)(!1),M=g()(R,2),I=M[0],B=M[1],L=Object(p.useState)(null),P=g()(L,2),j=P[0],q=P[1],U=Object(p.useState)(null),z=g()(U,2),G=z[0],H=z[1],Y=function(e,t,i){void 0===i&&(i={});var n=p.useRef(null),a={onFirstUpdate:i.onFirstUpdate,placement:i.placement||"bottom",strategy:i.strategy||"absolute",modifiers:i.modifiers||mg},r=p.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=r[0],s=r[1],l=p.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,i=Object.keys(t.elements);s({styles:hg(i.map((function(e){return[e,t.styles[e]||{}]}))),attributes:hg(i.map((function(e){return[e,t.attributes[e]]})))})},requires:["computeStyles"]}}),[]),u=p.useMemo((function(){var e={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[l,{name:"applyStyles",enabled:!1}])};return fg()(n.current,e)?n.current||e:(n.current=e,e)}),[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,l]),_=p.useRef();return pg((function(){_.current&&_.current.setOptions(u)}),[u]),pg((function(){if(null!=e&&null!=t){var n=(i.createPopper||wl)(e,t,u);return _.current=n,function(){n.destroy(),_.current=null}}}),[e,t,i.createPopper]),{state:_.current?_.current.state:null,styles:o.styles,attributes:o.attributes,update:_.current?_.current.update:null,forceUpdate:_.current?_.current.forceUpdate:null}}(j,G,{placement:_||"bottom-end",modifiers:x}),V=Y.styles,W=Y.attributes;Object(p.useImperativeHandle)(t,(function(){return{close:function(){return B(!1)},visible:I}}));var $=function(){A||B(!1),s()},K=function(){!A&&B(!I)};return D&&Yg("esc",$),w&&Vg(O,$),A||(F=Kg(Kg({},F),{},{onClick:function(){K()}})),Object(p.useEffect)((function(){A&&B(n)}),[n]),Object(p.useEffect)((function(){I&&r()}),[I]),m.a.createElement("div",u()({ref:O,className:b()("ne-dropdown__wrapper",d()({},f,f))},T),E?m.a.createElement("div",{ref:q,onClick:K},N):m.a.createElement("div",null,i,m.a.createElement(bg,null)),I&&m.a.createElement("ul",u()({className:"ne-dropdown__popup",ref:H,onClick:function(){k&&$()},"data-cy":"neeto-editor-".concat(c_(i),"-dropdown-container")},l,{style:Kg(Kg({display:"block"},V.offset),V.popper)},W.popper),c))})),Xg=function(e){var t=e.editor;return m.a.createElement(Zg,{customTarget:function(){return m.a.createElement(rg,{icon:cg,iconActive:t.isActive("heading"),tooltipProps:{content:"Font Size",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-font-size-option"})},className:"neeto-editor-font-size-wrapper",placement:"bottom"},[{label:"H1",value:1},{label:"H2",value:2},{label:"H3",value:3}].map((function(e){var i,n=e.label,a=e.value;return m.a.createElement("li",{onClick:function(){return e=a,t.chain().focus().toggleHeading({level:e}).run();var e},key:a,className:b()({active:(i=a,t.isActive("heading",{level:i}))}),"data-cy":"neeto-editor-fixed-menu-font-size-option-".concat(n)},n)})))};function Jg(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ef(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Jg(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Jg(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var tf=function(e){var t=e.onClickVariable,i=e.variables,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=[];return e.forEach((function(e){var n=e.category_key,a=e.category_label,r=e.variables;if(n&&r){var o=r.map((function(e){return ef(ef({},e),{},{category_key:n})}));i.push({label:a,variables:o})}else t.push(e)})),t.length&&i.push({label:i.length?"Others":null,variables:t}),i}(i);return i&&i.length?m.a.createElement("div",{className:"neeto-editor-variables-list"},n.map((function(e,i){var n=e.label,a=e.variables;return m.a.createElement(nf,{key:i,index:i,title:n,variables:a,onClickItem:t})}))):null},nf=function(e){var t=e.index,i=e.title,n=e.variables,a=e.onClickItem;return m.a.createElement("div",{className:"neeto-editor-variables-block","data-cy":"neeto-editor-variable-option-category-".concat(t)},i&&m.a.createElement("h6",null,i),m.a.createElement("div",{className:"neeto-editor-variables-row"},n.map((function(e){return m.a.createElement("button",{type:"button",onClick:function(){return a(e)},key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable","data-cy":"neeto-editor-variable-option-item-".concat(e.label,"--").concat(e.value)},e.label)}))))},af=["color"],rf=function(e){var t=e.editor,i=e.variables;return i&&i.length?m.a.createElement(Zg,{customTarget:function(){return m.a.createElement(rg,{icon:function(e){e.color;var t=h()(e,af);return m.a.createElement(ug,t)},tooltipProps:{content:"Variables",position:"bottom",delay:[500]},"data-cy":"neeto-editor-variable-option"})}},m.a.createElement(tf,{onClickVariable:function(e){var i=e.category_key,n=e.key,a=i?"".concat(i,".").concat(n):n;t.chain().focus().setVariable({label:a}).run()},variables:i})):null},of=["size","color","strokeWidth"];function sf(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,of);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M17 21H12C10.22 21 8.47991 20.4722 6.99987 19.4832C5.51983 18.4943 4.36628 17.0887 3.68509 15.4442C3.0039 13.7996 2.82567 11.99 3.17294 10.2442C3.5202 8.49836 4.37737 6.89472 5.63604 5.63604C6.89472 4.37737 8.49836 3.5202 10.2442 3.17294C11.99 2.82567 13.7996 3.0039 15.4442 3.68509C17.0887 4.36628 18.4943 5.51983 19.4832 6.99987C20.4722 8.47991 21 10.22 21 12V13.5C21 14.163 20.7366 14.7989 20.2678 15.2678C19.7989 15.7366 19.163 16 18.5 16C17.837 16 17.2011 15.7366 16.7322 15.2678C16.2634 14.7989 16 14.163 16 13.5V12C16 10.9391 15.5786 9.92172 14.8284 9.17158C14.0783 8.42143 13.0609 8 12 8V8C11.2089 8 10.4355 8.2346 9.77772 8.67413C9.11993 9.11365 8.60724 9.73837 8.30449 10.4693C8.00174 11.2002 7.92252 12.0044 8.07686 12.7804C8.2312 13.5563 8.61217 14.269 9.17158 14.8284C9.73099 15.3878 10.4437 15.7688 11.2196 15.9231C11.9956 16.0775 12.7998 15.9983 13.5307 15.6955C14.2616 15.3928 14.8864 14.8801 15.3259 14.2223C15.7654 13.5645 16 12.7911 16 12",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}sf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},sf.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var lf=["size","user","isSquare","status","onClick","className"],uf={small:24,medium:32,large:40,xlarge:64},_f=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function df(e){var t,i,n=e.size,a=e.user,r=e.isSquare,o=e.status,s=e.onClick,l=e.className,_=h()(e,lf),d=Object(p.useState)(!1),c=g()(d,2),f=c[0],F=c[1],E=a.name,y=void 0===E?"":E,D=a.imageUrl,v="medium"===n,k="large"===n,S="xlarge"===n,w=(t=y.trim().split(" ")).reduce((function(e,i,n){return 0!==n&&n!==t.length-1||(e="".concat(e).concat(i.charAt(0).toUpperCase())),e}),""),C={height:uf[n],width:uf[n],backgroundColor:(i=(w.charCodeAt(0)||0)+(w.charCodeAt(1)||0),_f[i%65%_f.length]||_f[0])},x=b()("ne-avatar",{"ne-avatar--medium":v,"ne-avatar--large":k,"ne-avatar--xlarge":S,"ne-avatar--round":!r,hidden:!f}),T=b()("ne-avatar__text",{"ne-avatar__text-medium":v,"ne-avatar__text-large":k,"ne-avatar__text-xlarge":S}),O=b()("ne-avatar__status","".concat(o),{"ne-avatar__status-medium":v,"ne-avatar__status-large":k,"ne-avatar__status-xlarge":S,"ne-avatar__status-square":r}),N=function(){return null==o?m.a.Fragment:m.a.createElement("span",{className:O})},A=function(){return m.a.createElement("span",{className:T},w)},R=w&&!D&&!f;return m.a.createElement("div",u()({onClick:s,style:C,className:b()("ne-avatar--container",{"ne-avatar--container-round":!r},l)},_),m.a.createElement(N,null),R?m.a.createElement(A,null):m.a.createElement("img",{className:x,onLoad:function(){return F(!0)},onError:function(){return F(!1)},src:D,alt:"avatar-".concat(w)}))}df.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},df.propTypes={size:ig.a.oneOf(Object.keys(uf)),user:ig.a.shape({imageUrl:ig.a.string,name:ig.a.string}),isSquare:ig.a.bool,onClick:ig.a.func,status:ig.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:ig.a.string};var cf=df,gf=function(e){var t=e.editor,i=e.mentions,n=e.showImageInMention,a=Object(p.useRef)();return i&&i.length?m.a.createElement(Zg,{ref:a,customTarget:function(){var e;return m.a.createElement(rg,{icon:sf,iconActive:null===(e=a.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Mention",position:"bottom",delay:[500]},"data-cy":"neeto-editor-mention-option"})}},m.a.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},i.map((function(e){var i=e.key,a=e.name,r=e.imageUrl;return m.a.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:i,onClick:function(){return t.commands.setMention(a)},type:"button","data-cy":"neeto-editor-mention-option-".concat(i)},n&&m.a.createElement(cf,{size:"small",user:{name:a,imageUrl:r}}),m.a.createElement("p",null,a))})))):null},ff=["size","color","strokeWidth"];function hf(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,ff);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M11.009 11.249H12.159V15.499",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}),J_.createElement("path",{d:"M11 15.4986H13.3093",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}),J_.createElement("path",{d:"M12.1 8.24587C12.1 8.29532 12.0853 8.34365 12.0579 8.38477C12.0304 8.42588 11.9914 8.45792 11.9457 8.47684C11.9 8.49576 11.8497 8.50071 11.8012 8.49107C11.7527 8.48142 11.7082 8.45761 11.6732 8.42265C11.6383 8.38769 11.6145 8.34314 11.6048 8.29464C11.5952 8.24615 11.6001 8.19588 11.619 8.1502C11.638 8.10452 11.67 8.06548 11.7111 8.03801C11.7522 8.01053 11.8006 7.99587 11.85 7.99587",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}),J_.createElement("path",{d:"M11.85 7.99587C11.9163 7.99587 11.9799 8.02221 12.0268 8.0691C12.0737 8.11598 12.1 8.17957 12.1 8.24587",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}),J_.createElement("path",{d:"M16 2.99862H8C5.23858 2.99862 3 5.2372 3 7.99862V15.9986C3 18.76 5.23858 20.9986 8 20.9986H16C18.7614 20.9986 21 18.76 21 15.9986V7.99862C21 5.2372 18.7614 2.99862 16 2.99862Z",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}hf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},hf.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var pf=["children","className","required","helpIconProps"],mf=["onClick","icon","tooltipProps","className"],Ff=function(e){var t=e.children,i=e.className,n=void 0===i?"":i,a=e.required,r=void 0!==a&&a,o=e.helpIconProps,s=void 0===o?null:o,l=h()(e,pf),_=s||{},c=_.onClick,g=_.icon,f=_.tooltipProps,p=_.className,F=h()(_,mf),E=g||hf;return m.a.createElement("label",u()({className:b()("ne-label flex items-center",n)},l),t,r&&m.a.createElement("span",{"aria-hidden":!0},"*"),s&&m.a.createElement(ac,u()({},f,{disabled:!f}),m.a.createElement("span",{className:b()("ml-1",d()({},p,p)),onClick:c},m.a.createElement(E,u()({size:16},F)))))},bf=["id","size","type","label","error","suffix","prefix","disabled","helpText","className","nakedInput","contentSize","required"],Ef=Object(p.forwardRef)((function(e,t){var i=e.id,n=e.size,a=void 0===n?"small":n,r=e.type,o=void 0===r?"text":r,s=e.label,l=e.error,_=void 0===l?null:l,d=e.suffix,c=void 0===d?null:d,g=e.prefix,f=void 0===g?null:g,p=e.disabled,F=void 0!==p&&p,E=e.helpText,y=void 0===E?"":E,D=e.className,v=void 0===D?"":D,k=e.nakedInput,S=void 0!==k&&k,w=e.contentSize,C=void 0===w?null:w,x=e.required,T=void 0!==x&&x,O=h()(e,bf);return m.a.createElement("div",{className:b()(["ne-input__wrapper",v])},s&&m.a.createElement(Ff,{required:T,"data-cy":"neeto-editor-".concat(c_(s),"-input-label"),htmlFor:i},s),m.a.createElement("div",{className:b()("ne-input",{"ne-input--naked":!!S,"ne-input--error":!!_,"ne-input--disabled":!!F,"ne-input--small":"small"===a})},f&&m.a.createElement("div",{className:"ne-input__prefix"},f),m.a.createElement("input",u()({ref:t,type:o,disabled:F,size:C,required:T,"aria-invalid":!!_,"data-cy":"".concat(c_(s),"-input-field")},O)),c&&m.a.createElement("div",{className:"ne-input__suffix"},c)),!!_&&m.a.createElement("p",{"data-cy":"".concat(c_(s),"-input-error"),className:"ne-input__error"},_),y&&m.a.createElement("p",{className:"ne-input__help-text"},y))}));Ef.displayName="Input";var yf=Ef,Df=function(e){var t=e.editor,i=Object(p.useRef)(),n=Object(p.useRef)(),a=Object(p.useState)(""),r=g()(a,2),o=r[0],s=r[1],l=Object(p.useState)(""),u=g()(l,2),_=u[0],d=u[1],c=t.isActive("link"),f=function(){d(t.getAttributes("link").href||"")},h=function(){var e;Uc.test(_)?(t.chain().focus().setLink({href:_}).run(),null===(e=i.current)||void 0===e||e.close()):s("Please enter a valid url")};return m.a.createElement(Zg,{ref:i,onVisible:function(){var e;return null===(e=n.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:function(){return m.a.createElement(rg,{icon:Ld,iconActive:c,onClick:f,tooltipProps:{content:"Link",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-link-option"})},className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?i.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},m.a.createElement(yf,{ref:n,name:"url",value:_,placeholder:"Paste URL",onFocus:function(){return s("")},error:o,onChange:function(e){var t=e.target.value;return d(t)},"data-cy":"neeto-editor-fixed-menu-link-option-input"}),m.a.createElement(qc,{label:"Link",onClick:h,"data-cy":"neeto-editor-fixed-menu-link-option-link-button"}),c&&m.a.createElement(qc,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=i.current)||void 0===e||e.close()},"data-cy":"neeto-editor-fixed-menu-link-option-unlink-button"})))},vf=["size","color","strokeWidth"];function kf(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,vf);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M12 3C7.037 3 3 7.037 3 12C3 16.963 7.037 21 12 21C16.963 21 21 16.962 21 12C21 7.038 16.962 3 12 3Z",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}),J_.createElement("path",{d:"M15.5006 15.688C15.5006 15.688 14.1876 17 12.0006 17C9.81263 17 8.50063 15.688 8.50063 15.688M15.3286 9.5C15.1906 9.5 15.0786 9.612 15.0796 9.75C15.0796 9.888 15.1916 10 15.3296 10C15.4676 10 15.5796 9.888 15.5796 9.75C15.5796 9.612 15.4676 9.5 15.3286 9.5ZM8.63963 9.5C8.50163 9.5 8.38963 9.612 8.39063 9.75C8.39063 9.888 8.50263 10 8.64063 10C8.77863 10 8.89063 9.888 8.89063 9.75C8.89063 9.612 8.77863 9.5 8.63963 9.5Z",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}kf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},kf.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var Sf=i(20),wf=i.n(Sf),Cf=i(21),xf=i.n(Cf),Tf=i(14),Of=i.n(Tf),Nf=i(22),Af=i.n(Nf),Rf=i(23),Mf=i.n(Rf),If=i(17),Bf=i.n(If),Lf=i(30),Pf=i(9),jf=i.n(Pf),qf=i(10),Uf=i.n(qf),zf=i(46),Gf=i.n(zf),Hf={name:"a",unified:"b",non_qualified:"c",has_img_apple:"d",has_img_google:"e",has_img_twitter:"f",has_img_facebook:"h",keywords:"j",sheet:"k",emoticons:"l",text:"m",short_names:"n",added_in:"o"},Yf=function(e){var t=[],i=function(e,i){e&&(Array.isArray(e)?e:[e]).forEach((function(e){(i?e.split(/[-|_|\s]+/):[e]).forEach((function(e){e=e.toLowerCase(),-1==t.indexOf(e)&&t.push(e)}))}))};return i(e.short_names,!0),i(e.name,!0),i(e.keywords,!1),i(e.emoticons,!1),t.join(",")},Vf=function(e){for(var t in e.compressed=!1,e.emojis){var i=e.emojis[t];for(var n in Hf)i[n]=i[Hf[n]],delete i[Hf[n]];i.short_names||(i.short_names=[]),i.short_names.unshift(t),i.sheet_x=i.sheet[0],i.sheet_y=i.sheet[1],delete i.sheet,i.text||(i.text=""),i.added_in||(i.added_in=6),i.added_in=i.added_in.toFixed(1),i.search=Yf(i)}},Wf=String.fromCodePoint||function(){var e,t,i=16384,n=[],a=-1,r=arguments.length;if(!r)return"";for(var o="";++a<r;){var s=Number(arguments[a]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(a+1===r||n.length>i)&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o},$f=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,Kf=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function Qf(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return Wf.apply(null,t)}function Zf(e){var t=e.name,i=e.short_names,n=e.skin_tone,a=e.skin_variations,r=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,_=e.id||i[0],d=":".concat(_,":");return s?{id:_,name:t,short_names:i,colons:d,emoticons:r,custom:s,customCategory:l,imageUrl:u}:(n&&(d+=":skin-tone-".concat(n,":")),{id:_,name:t,short_names:i,colons:d,emoticons:r,unified:o.toLowerCase(),skin:n||(a?1:null),native:Qf(o)})}function Xf(){return Zf(Jf.apply(void 0,arguments))}function Jf(e,t,i,n){var a={};if("string"==typeof e){var r=e.match($f);if(r&&(e=r[1],r[2]&&(t=parseInt(r[2],10))),n.aliases.hasOwnProperty(e)&&(e=n.aliases[e]),!n.emojis.hasOwnProperty(e))return null;a=n.emojis[e]}else e.id&&(n.aliases.hasOwnProperty(e.id)&&(e.id=n.aliases[e.id]),n.emojis.hasOwnProperty(e.id)&&(a=n.emojis[e.id],t||(t=e.skin)));if(Object.keys(a).length||((a=e).custom=!0,a.search||(a.search=Yf(e))),a.emoticons||(a.emoticons=[]),a.variations||(a.variations=[]),a.skin_variations&&t>1){a=JSON.parse(JSON.stringify(a));var o=Kf[t-1],s=a.skin_variations[o];if(s&&(!s.variations&&a.variations&&delete a.variations,i&&(null==s["has_img_".concat(i)]||s["has_img_".concat(i)])||!i))for(var l in a.skin_tone=t,s){var u=s[l];a[l]=u}}return a.variations&&a.variations.length&&((a=JSON.parse(JSON.stringify(a))).unified=a.variations.shift()),a}function eh(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function th(e,t){var i=eh(e),n=eh(t);return i.filter((function(e){return n.indexOf(e)>=0}))}function ih(e,t){var i={};for(var n in e){var a=e[n],r=a;t.hasOwnProperty(n)&&(r=t[n]),"object"===Gf()(r)&&(r=ih(a,r)),i[n]=r}return i}var nh,ah,rh="emoji-mart",oh="undefined"!=typeof window&&"localStorage"in window;function sh(e,t){if(ah)ah(e,t);else{if(!oh)return;try{window.localStorage["".concat(rh,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var lh={update:function(e){for(var t in e){sh(t,e[t])}},set:sh,get:function(e){if(nh)return nh(e);if(oh)try{var t=window.localStorage["".concat(rh,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){rh=e},setHandlers:function(e){e||(e={}),nh=e.getter,ah=e.setter}},uh=function(){function e(t,i){jf()(this,e),t.compressed&&Vf(t),this.data=t||{},this.set=i||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return Uf()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var i=e.data.emojis[t],n=i.short_names,a=i.emoticons,r=i.skin_variations,o=n[0];if(a&&a.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),r){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=Xf({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=Xf(o,null,e.set,e.data);e.originalPool[o]=i};for(var i in this.data.emojis)t(i)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(i){var n=i.id||i.short_names[0];delete e[n],delete t.emojis[n]}))}},{key:"addCustomToPool",value:function(e,t){var i=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var n=e.id||e.short_names[0];n&&!t[n]&&(t[n]=Jf(e,null,null,i.data),i.emojis[n]=Xf(e,null,null,i.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.emojisToShowFilter,a=i.maxResults,r=i.include,o=i.exclude,s=i.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=lh.get("skin")||1;a||(a=75),r||(r=[]),o||(o=[]);var _=null,d=this.originalPool;if(e.length){if("-"==e||"-1"==e)return[this.emojis[-1][u]];var c=e.toLowerCase().split(/[\s|,|\-|_]+/),g=[];if(c.length>2&&(c=[c[0],c[1]]),(r.length||o.length)&&(d={},this.data.categories.forEach((function(e){var i=!r||!r.length||r.indexOf(e.id)>-1,n=!(!o||!o.length)&&o.indexOf(e.id)>-1;i&&!n&&e.emojis.forEach((function(e){return d[e]=t.data.emojis[e]}))})),l.length)){var f=!r||!r.length||r.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;f&&!h&&this.addCustomToPool(l,d)}_=(g=c.map((function(e){for(var i=d,n=t.index,a=0,r=0;r<e.length;r++){var o=e[r];a++,n[o]||(n[o]={}),(n=n[o]).results||function(){var r={};for(var o in n.results=[],n.pool={},i){var s=i[o],l=s.search,_=e.substr(0,a),d=l.indexOf(_);if(-1!=d){var c=d+1;_==o&&(c=0),t.emojis[o]&&t.emojis[o][u]?n.results.push(t.emojis[o][u]):n.results.push(t.emojis[o]),n.pool[o]=s,r[o]=c}}n.results.sort((function(e,t){var i=r[e.id],n=r[t.id];return i==n?e.id.localeCompare(t.id):i-n}))}(),i=n.pool}return n.results})).filter((function(e){return e}))).length>1?th.apply(null,g):g.length?g[0]:[]}return _&&(n&&(_=_.filter((function(e){return n(d[e.id])}))),_&&_.length>a&&(_=_.slice(0,a))),_}}]),e}(),_h=new uh(Lf);var dh,ch,gh={search:function(){return _h.search.apply(_h,arguments)},emojis:_h.emojis,emoticons:_h.emoticons},fh=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],hh={};function ph(){ch=!0,dh=lh.get("frequently")}var mh={add:function(e){ch||ph();var t=e.id;dh||(dh=hh),dh[t]||(dh[t]=0),dh[t]+=1,lh.set("last",t),lh.set("frequently",dh)},get:function(e){if(ch||ph(),!dh){hh={};for(var t=[],i=0;i<e;i++)hh[fh[i]]=e-i,t.push(fh[i]);return t}var n=4*e,a=[];for(var r in dh)dh.hasOwnProperty(r)&&a.push(r);var o=a.sort((function(e,t){return dh[e]-dh[t]})).reverse().slice(0,n),s=lh.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},Fh=i(15),bh=i.n(Fh),Eh=i(24),yh=i.n(Eh),Dh=i(11),vh=i.n(Dh),kh=i(12),Sh=i.n(kh),wh=i(13),Ch=i.n(wh),xh=i(7),Th=i.n(xh),Oh={activity:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"}))},custom:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("g",{transform:"translate(2.000000, 1.000000)"},m.a.createElement("rect",{id:"Rectangle",x:"8",y:"0",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(-60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"})))},flags:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"}))},foods:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"}))},nature:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),m.a.createElement("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"}))},objects:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),m.a.createElement("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"}))},people:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),m.a.createElement("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"}))},places:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),m.a.createElement("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"}))},recent:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}))},symbols:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"}))}},Nh={search:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"}))},delete:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"}))}},Ah={data:ig.a.object.isRequired,onOver:ig.a.func,onLeave:ig.a.func,onClick:ig.a.func,fallback:ig.a.func,backgroundImageFn:ig.a.func,native:ig.a.bool,forceSize:ig.a.bool,tooltip:ig.a.bool,useButton:ig.a.bool,skin:ig.a.oneOf([1,2,3,4,5,6]),sheetSize:ig.a.oneOf([16,20,32,64]),sheetColumns:ig.a.number,sheetRows:ig.a.number,set:ig.a.oneOf(["apple","google","twitter","facebook"]),size:ig.a.number.isRequired,emoji:ig.a.oneOfType([ig.a.string,ig.a.object]).isRequired},Rh={onClick:ig.a.func,onSelect:ig.a.func,onSkinChange:ig.a.func,perLine:ig.a.number,emojiSize:ig.a.number,i18n:ig.a.object,style:ig.a.object,title:ig.a.string,emoji:ig.a.string,color:ig.a.string,set:Ah.set,skin:Ah.skin,native:ig.a.bool,backgroundImageFn:Ah.backgroundImageFn,sheetSize:Ah.sheetSize,emojisToShowFilter:ig.a.func,showPreview:ig.a.bool,showSkinTones:ig.a.bool,emojiTooltip:Ah.tooltip,useButton:Ah.useButton,theme:ig.a.oneOf(["auto","light","dark"]),include:ig.a.arrayOf(ig.a.string),exclude:ig.a.arrayOf(ig.a.string),recent:ig.a.arrayOf(ig.a.string),autoFocus:ig.a.bool,enableFrequentEmojiSort:ig.a.bool,custom:ig.a.arrayOf(ig.a.shape({name:ig.a.string.isRequired,short_names:ig.a.arrayOf(ig.a.string).isRequired,emoticons:ig.a.arrayOf(ig.a.string),keywords:ig.a.arrayOf(ig.a.string),imageUrl:ig.a.string,spriteUrl:ig.a.string,sheet_x:ig.a.number,sheet_y:ig.a.number,size:ig.a.number,sheetColumns:ig.a.number,sheetRows:ig.a.number})),skinEmoji:ig.a.string,notFound:ig.a.func,notFoundEmoji:ig.a.string,icons:ig.a.object},Mh=function(e){function t(e){var i;jf()(this,t),i=vh()(this,Sh()(t).call(this,e));var n=e.categories.filter((function(e){return e.first}))[0];return i.state={selected:n.name},i.handleClick=i.handleClick.bind(Th()(i)),i}return Ch()(t,e),Uf()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),i=this.props,n=i.categories;(0,i.onAnchorClick)(n[t],t)}},{key:"render",value:function(){var e=this,t=this.props,i=t.categories,n=t.color,a=t.i18n,r=t.icons,o=this.state.selected;return m.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":a.categorieslabel},i.map((function(t,i){var s=t.id,l=t.name,u=t.anchor,_=l==o;if(!1===u)return null;var d=s.startsWith("custom-")?"custom":s;return m.a.createElement("button",{key:s,"aria-label":a.categories[d],title:a.categories[d],"data-index":i,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(_?"emoji-mart-anchor-selected":""),style:{color:_?n:null}},m.a.createElement("div",{className:"emoji-mart-anchor-icon"},r.categories[d]()),m.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:n}}))})))}}]),t}(m.a.PureComponent);Mh.propTypes={categories:ig.a.array,onAnchorClick:ig.a.func,icons:ig.a.object},Mh.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var Ih={skin:1,set:"apple",sheetSize:64,sheetColumns:57,sheetRows:57,native:!1,forceSize:!1,tooltip:!1,useButton:!0,backgroundImageFn:function(e,t){return"https://unpkg.com/emoji-datasource-".concat(e,"@").concat("5.0.1","/img/").concat(e,"/sheets-256/").concat(t,".png")}},Bh={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:Ih.set,theme:"light",skin:null,defaultSkin:Ih.skin,native:Ih.native,sheetSize:Ih.sheetSize,backgroundImageFn:Ih.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:Ih.tooltip,useButton:Ih.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function Lh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Ph(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Lh(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Lh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var jh=function(e){return Jf(e.emoji,e.skin,e.set,e.data)},qh=function(e){var t=jh(e),i=t.sheet_x,n=t.sheet_y,a=100/(e.sheetColumns-1),r=100/(e.sheetRows-1);return"".concat(a*i,"% ").concat(r*n,"%")},Uh=function(e){return Xf(e.emoji,e.skin,e.set,e.data)},zh=function(e){return!isNaN(e-parseFloat(e))},Gh=function e(t){for(var i in t.data.compressed&&Vf(t.data),e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);var n=jh(t);if(!n)return t.fallback?t.fallback(null,t):null;var a=n.unified,r=n.custom,o=n.short_names,s=n.imageUrl,l={},u=t.children,_="emoji-mart-emoji",d=a&&Qf(a),c=[d].concat(o).filter(Boolean).join(", "),g=null;if(!a&&!r)return t.fallback?t.fallback(n,t):null;if(t.tooltip&&(g=o[0]),t.native&&a)_+=" emoji-mart-emoji-native",l={fontSize:t.size},u=d,t.forceSize&&(l.display="inline-block",l.width=t.size,l.height=t.size,l.wordBreak="keep-all");else if(r)_+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=n.spriteUrl?Ph({},l,{backgroundImage:"url(".concat(n.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:qh(t)}):Ph({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==n["has_img_".concat(t.set)]||n["has_img_".concat(t.set)]))return t.fallback?t.fallback(n,t):null;l={width:t.size,height:t.size,display:"inline-block",backgroundImage:"url(".concat(t.backgroundImageFn(t.set,t.sheetSize),")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:qh(t)}}var f={name:"span",props:{}};return t.onClick&&t.useButton&&(f.name="button",f.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var i in e){var n=e[i];zh(n)&&(n+="px"),t.style[i]=n}return t.getAttribute("style")}(l),"<".concat(f.name," style='").concat(l,"' aria-label='").concat(c,"' ").concat(g?"title='".concat(g,"'"):""," class='").concat(_,"'>").concat(u||"","</").concat(f.name,">")):m.a.createElement(f.name,yh()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(Uh(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(Uh(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(Uh(t),e)}(e,t)},"aria-label":c,title:g,className:_},f.props),m.a.createElement("span",{style:l},u))};Gh.propTypes=Ph({},Ah,{data:ig.a.object.isRequired}),Gh.defaultProps=Ih;var Hh=Gh;function Yh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var Vh=function(e){function t(){return jf()(this,t),vh()(this,Sh()(t).apply(this,arguments))}return Ch()(t,e),Uf()(t,[{key:"render",value:function(){var e=this.props,t=e.data,i=e.emojiProps,n=e.i18n,a=e.notFound,r=e.notFoundEmoji;return a&&a()||m.a.createElement("div",{className:"emoji-mart-no-results"},Hh(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Yh(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Yh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({data:t},i,{size:38,emoji:r,onOver:null,onLeave:null,onClick:null})),m.a.createElement("div",{className:"emoji-mart-no-results-label"},n.notfound))}}]),t}(m.a.PureComponent);function Wh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}Vh.propTypes={notFound:ig.a.func.isRequired,emojiProps:ig.a.object.isRequired};var $h=function(e){function t(e){var i;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).data=e.data,i.setContainerRef=i.setContainerRef.bind(Th()(i)),i.setLabelRef=i.setLabelRef.bind(Th()(i)),i}return Ch()(t,e),Uf()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var i=this.props,n=i.name,a=i.perLine,r=i.native,o=i.hasStickyPosition,s=i.emojis,l=i.emojiProps,u=l.skin,_=l.size,d=l.set,c=e.perLine,g=e.native,f=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,E=!1;return"Recent"==n&&a!=c&&(E=!0),"Search"==n&&(E=!(s==h)),u==m&&_==F&&r==g&&d==b&&o==f||(E=!0),E}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),i=t.top,n=t.height,a=e.getBoundingClientRect().top,r=this.label.getBoundingClientRect().height;this.top=i-a+e.scrollTop,this.maxMargin=0==n?0:n-r}},{key:"handleScroll",value:function(e){var t=e-this.top;if((t=(t=t<this.minMargin?this.minMargin:t)>this.maxMargin?this.maxMargin:t)!=this.margin)return this.props.hasStickyPosition||(this.label.style.top="".concat(t,"px")),this.margin=t,!0}},{key:"getEmojis",value:function(){var e=this,t=this.props,i=t.name,n=t.emojis,a=t.recent,r=t.perLine;if("Recent"==i){var o=this.props.custom,s=a||mh.get(r);if(s.length&&(n=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!Jf(t,null,null,e.data)}))),0===n.length&&s.length>0)return null}return n&&(n=n.slice(0)),n}},{key:"updateDisplay",value:function(e){this.getEmojis()&&this.container&&(this.container.style.display=e)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setLabelRef",value:function(e){this.label=e}},{key:"render",value:function(){var e=this,t=this.props,i=t.id,n=t.name,a=t.hasStickyPosition,r=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,u=this.getEmojis(),_={},d={},c={};u||(c={display:"none"}),a||(_={height:28},d={position:"absolute"});var g=o.categories[i]||n;return m.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":g,style:c},m.a.createElement("div",{style:_,"data-name":n,className:"emoji-mart-category-label"},m.a.createElement("span",{style:d,ref:this.setLabelRef,"aria-hidden":!0},g)),m.a.createElement("ul",{className:"emoji-mart-category-list"},u&&u.map((function(t){return m.a.createElement("li",{key:t.short_names&&t.short_names.join("_")||t},Hh(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Wh(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Wh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({emoji:t,data:e.data},r)))}))),u&&!u.length&&m.a.createElement(Vh,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:r}))}}]),t}(m.a.Component);$h.propTypes={emojis:ig.a.array,hasStickyPosition:ig.a.bool,name:ig.a.string.isRequired,native:ig.a.bool.isRequired,perLine:ig.a.number.isRequired,emojiProps:ig.a.object.isRequired,recent:ig.a.arrayOf(ig.a.string),notFound:ig.a.func,notFoundEmoji:ig.a.string.isRequired},$h.defaultProps={emojis:[],hasStickyPosition:!0};var Kh=function(e){function t(e){var i;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).state={opened:!1},i}return Ch()(t,e),Uf()(t,[{key:"handleClick",value:function(e){var t=parseInt(e.currentTarget.getAttribute("data-skin")),i=this.props.onChange;this.state.opened?(this.setState({opened:!1}),t!=this.props.skin&&i(t)):this.setState({opened:!0})}},{key:"render",value:function(){return null}}]),t}(m.a.PureComponent);Kh.propTypes={onChange:ig.a.func,skin:ig.a.number.isRequired},Kh.defaultProps={onChange:function(){}};var Qh=function(e){function t(e){var i;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).handleClick=i.handleClick.bind(Th()(i)),i}return Ch()(t,e),Uf()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.emojiProps,n=e.data,a=e.skinEmoji,r=e.i18n,o=this.state.opened,s=[],l=1;l<=6;l++){var u=l===t;s.push(m.a.createElement("span",{key:"skin-tone-".concat(l),className:"emoji-mart-skin-swatch custom".concat(u?" selected":"")},m.a.createElement("span",{onClick:this.handleClick,"data-skin":l,className:"emoji-mart-skin-tone-".concat(l)},Hh({emoji:a,data:n,skin:l,backgroundImageFn:i.backgroundImageFn,native:i.native,set:i.set,sheetSize:i.sheetSize,size:23}))))}return m.a.createElement("div",{className:"emoji-mart-skin-swatches custom".concat(o?" opened":"")},m.a.createElement("div",{className:"emoji-mart-skin-text".concat(o?" opened":"")},r.skintext),s)}}]),t}(Kh);Qh.propTypes={onChange:ig.a.func,skin:ig.a.number.isRequired,emojiProps:ig.a.object.isRequired,skinTone:ig.a.number,skinEmoji:ig.a.string.isRequired,i18n:ig.a.object},Qh.defaultProps={onChange:function(){},skinTone:null};var Zh=function(e){function t(e){var i;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).handleClick=i.handleClick.bind(Th()(i)),i.handleKeyDown=i.handleKeyDown.bind(Th()(i)),i}return Ch()(t,e),Uf()(t,[{key:"handleKeyDown",value:function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),this.handleClick(e))}},{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.i18n,n=this.state.opened,a=[],r=1;r<=6;r++){var o=r===t,s=n||o;a.push(m.a.createElement("span",yh()({key:"skin-tone-".concat(r),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":i.skintones[r],"aria-hidden":!s},n?{role:"menuitem"}:{}),m.a.createElement("span",yh()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!n}:{},n?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":i.skintones[r],title:i.skintones[r],"data-skin":r,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(r)}))))}return m.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(n?" opened":""),"aria-label":i.skintext},m.a.createElement("div",n?{role:"menubar"}:{},a))}}]),t}(Kh);function Xh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Jh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Xh(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Xh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}Zh.propTypes={onChange:ig.a.func,skin:ig.a.number.isRequired,i18n:ig.a.object},Zh.defaultProps={onChange:function(){}};var ep=function(e){function t(e){var i;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).data=e.data,i.state={emoji:null},i}return Ch()(t,e),Uf()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,i=t.emojiProps,n=t.skinsProps,a=t.showSkinTones,r=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var u=Jf(e,null,null,this.data),_=u.emoticons,d=[],c=[];return(void 0===_?[]:_).forEach((function(e){d.indexOf(e.toLowerCase())>=0||(d.push(e.toLowerCase()),c.push(e))})),m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},Hh(Jh({key:e.id,emoji:e,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("div",{className:"emoji-mart-preview-name"},e.name),m.a.createElement("div",{className:"emoji-mart-preview-shortnames"},u.short_names.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-shortname"},":",e,":")}))),m.a.createElement("div",{className:"emoji-mart-preview-emoticons"},c.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-emoticon"},e)})))))}return m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},o&&o.length&&Hh(Jh({emoji:o,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("span",{className:"emoji-mart-title-label"},r)),a&&m.a.createElement("div",{className:"emoji-mart-preview-skins".concat(n.skinEmoji?" custom":"")},n.skinEmoji?m.a.createElement(Qh,{skin:n.skin,emojiProps:i,data:this.data,skinEmoji:n.skinEmoji,i18n:s,onChange:n.onChange}):m.a.createElement(Zh,{skin:n.skin,i18n:s,onChange:n.onChange})))}}]),t}(m.a.PureComponent);ep.propTypes={showSkinTones:ig.a.bool,title:ig.a.string.isRequired,emoji:ig.a.string.isRequired,emojiProps:ig.a.object.isRequired,skinsProps:ig.a.object.isRequired},ep.defaultProps={showSkinTones:!0,onChange:function(){}};var tp=0,ip=function(e){function t(e){var i,n,a,r;return jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).state={icon:Nh.search,isSearching:!1,id:++tp},i.data=e.data,i.emojiIndex=new uh(i.data),i.setRef=i.setRef.bind(Th()(i)),i.clear=i.clear.bind(Th()(i)),i.handleKeyUp=i.handleKeyUp.bind(Th()(i)),i.handleChange=(n=i.handleChange.bind(Th()(i)),a="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,r=!1,function(){r||(r=!0,a((function(){r=!1,n()})))}),i}return Ch()(t,e),Uf()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:Nh.search,isSearching:!1}):this.setState({icon:Nh.delete,isSearching:!0}),this.props.onSearch(this.emojiIndex.search(e,{emojisToShowFilter:this.props.emojisToShowFilter,maxResults:this.props.maxResults,include:this.props.include,exclude:this.props.exclude,custom:this.props.custom}))}},{key:"clear",value:function(){""!=this.input.value&&(this.input.value="",this.input.focus(),this.search(""))}},{key:"handleChange",value:function(){this.input&&this.search(this.input.value)}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.clear()}},{key:"setRef",value:function(e){this.input=e}},{key:"render",value:function(){var e=this.props,t=e.i18n,i=e.autoFocus,n=this.state,a=n.icon,r=n.isSearching,o=n.id,s="emoji-mart-search-".concat(o);return m.a.createElement("section",{className:"emoji-mart-search","aria-label":t.search},m.a.createElement("input",{id:s,ref:this.setRef,type:"search",onChange:this.handleChange,placeholder:t.search,autoFocus:i}),m.a.createElement("label",{className:"emoji-mart-sr-only",htmlFor:s},t.search),m.a.createElement("button",{className:"emoji-mart-search-icon",onClick:this.clear,onKeyUp:this.handleKeyUp,"aria-label":t.clear,disabled:!r},a()))}}]),t}(m.a.PureComponent);function np(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ap(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?np(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):np(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}ip.propTypes={onSearch:ig.a.func,maxResults:ig.a.number,emojisToShowFilter:ig.a.func,autoFocus:ig.a.bool},ip.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var rp={search:"Search",clear:"Clear",notfound:"No Emoji Found",skintext:"Choose your default skin tone",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"},categorieslabel:"Emoji categories",skintones:{1:"Default Skin Tone",2:"Light Skin Tone",3:"Medium-Light Skin Tone",4:"Medium Skin Tone",5:"Medium-Dark Skin Tone",6:"Dark Skin Tone"}},op=function(e){function t(e){var i;jf()(this,t),(i=vh()(this,Sh()(t).call(this,e))).CUSTOM=[],i.RECENT_CATEGORY={id:"recent",name:"Recent",emojis:null},i.SEARCH_CATEGORY={id:"search",name:"Search",emojis:null,anchor:!1},e.data.compressed&&Vf(e.data),i.data=e.data,i.i18n=ih(rp,e.i18n),i.icons=ih(n,e.icons),i.state={firstRender:!0},i.categories=[];var a=[].concat(i.data.categories);if(e.custom.length>0){var r={},o=0;e.custom.forEach((function(e){r[e.customCategory]||(r[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=r[e.customCategory],n=ap({},e,{id:e.short_names[0],custom:!0});t.emojis.push(n),i.CUSTOM.push(n)})),a=a.concat(Object.keys(r).map((function(e){return r[e]})))}i.hideRecent=!0,null!=e.include&&a.sort((function(t,i){return e.include.indexOf(t.id)>e.include.indexOf(i.id)?1:-1}));for(var s=0;s<a.length;s++){var l=a[s],u=!e.include||!e.include.length||e.include.indexOf(l.id)>-1,_=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(l.id)>-1;if(u&&!_)if(e.emojisToShowFilter){for(var d=[],c=l.emojis,g=0;g<c.length;g++){var f=c[g];e.emojisToShowFilter(i.data.emojis[f]||f)&&d.push(f)}if(d.length){var h={emojis:d,name:l.name,id:l.id};i.categories.push(h)}}else i.categories.push(l)}var p=!e.include||!e.include.length||e.include.indexOf(i.RECENT_CATEGORY.id)>-1,m=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(i.RECENT_CATEGORY.id)>-1;return p&&!m&&(i.hideRecent=!1,i.categories.unshift(i.RECENT_CATEGORY)),i.categories[0]&&(i.categories[0].first=!0),i.categories.unshift(i.SEARCH_CATEGORY),i.setAnchorsRef=i.setAnchorsRef.bind(Th()(i)),i.handleAnchorClick=i.handleAnchorClick.bind(Th()(i)),i.setSearchRef=i.setSearchRef.bind(Th()(i)),i.handleSearch=i.handleSearch.bind(Th()(i)),i.setScrollRef=i.setScrollRef.bind(Th()(i)),i.handleScroll=i.handleScroll.bind(Th()(i)),i.handleScrollPaint=i.handleScrollPaint.bind(Th()(i)),i.handleEmojiOver=i.handleEmojiOver.bind(Th()(i)),i.handleEmojiLeave=i.handleEmojiLeave.bind(Th()(i)),i.handleEmojiClick=i.handleEmojiClick.bind(Th()(i)),i.handleEmojiSelect=i.handleEmojiSelect.bind(Th()(i)),i.setPreviewRef=i.setPreviewRef.bind(Th()(i)),i.handleSkinChange=i.handleSkinChange.bind(Th()(i)),i.handleKeyDown=i.handleKeyDown.bind(Th()(i)),i.handleDarkMatchMediaChange=i.handleDarkMatchMediaChange.bind(Th()(i)),i}return Ch()(t,e),Uf()(t,[{key:"componentDidMount",value:function(){var e=this;this.state.firstRender&&(this.testStickyPosition(),this.firstRenderTimeout=setTimeout((function(){e.setState({firstRender:!1})}),60))}},{key:"componentDidUpdate",value:function(){this.updateCategoriesSize(),this.handleScroll()}},{key:"componentWillUnmount",value:function(){this.SEARCH_CATEGORY.emojis=null,clearTimeout(this.leaveTimeout),clearTimeout(this.firstRenderTimeout),this.darkMatchMedia&&this.darkMatchMedia.removeListener(this.handleDarkMatchMediaChange)}},{key:"testStickyPosition",value:function(){var e=document.createElement("div");["","-webkit-","-ms-","-moz-","-o-"].forEach((function(t){return e.style.position="".concat(t,"sticky")})),this.hasStickyPosition=!!e.style.position.length}},{key:"getPreferredTheme",value:function(){return"auto"!=this.props.theme?this.props.theme:this.state.theme?this.state.theme:"function"!=typeof matchMedia?Bh.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?Bh.theme:this.darkMatchMedia.matches?"dark":"light")}},{key:"handleDarkMatchMediaChange",value:function(){this.setState({theme:this.darkMatchMedia.matches?"dark":"light"})}},{key:"handleEmojiOver",value:function(e){var t=this.preview;if(t){var i=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n]);t.setState({emoji:e}),clearTimeout(this.leaveTimeout)}}},{key:"handleEmojiLeave",value:function(e){var t=this.preview;t&&(this.leaveTimeout=setTimeout((function(){t.setState({emoji:null})}),16))}},{key:"handleEmojiClick",value:function(e,t){this.props.onClick(e,t),this.handleEmojiSelect(e)}},{key:"handleEmojiSelect",value:function(e){var t=this;this.props.onSelect(e),this.hideRecent||this.props.recent||mh.add(e);var i=this.categoryRefs["category-1"];if(i){var n=i.maxMargin;this.props.enableFrequentEmojiSort&&i.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(i.memoizeSize(),n!=i.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&i.updateDisplay("none")))}))}}},{key:"handleScroll",value:function(){this.waitingForPaint||(this.waitingForPaint=!0,requestAnimationFrame(this.handleScrollPaint))}},{key:"handleScrollPaint",value:function(){if(this.waitingForPaint=!1,this.scroll){var e=null;if(this.SEARCH_CATEGORY.emojis)e=this.SEARCH_CATEGORY;else{for(var t=this.scroll.scrollTop,i=t>(this.scrollTop||0),n=0,a=0,r=this.categories.length;a<r;a++){var o=i?this.categories.length-1-a:a,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!n||l.top<n)&&l.top>0&&(n=l.top),u&&!e&&(e=s)}}t<n?e=this.categories.filter((function(e){return!(!1===e.anchor)}))[0]:t+this.clientHeight>=this.scrollHeight&&(e=this.categories[this.categories.length-1])}if(e){var _=this.anchors,d=e.name;_.state.selected!=d&&_.setState({selected:d})}this.scrollTop=t}}},{key:"handleSearch",value:function(e){this.SEARCH_CATEGORY.emojis=e;for(var t=0,i=this.categories.length;t<i;t++){var n=this.categoryRefs["category-".concat(t)];if(n&&"Search"!=n.props.name){var a=e?"none":"inherit";n.updateDisplay(a)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var i,n=this.categoryRefs["category-".concat(t)],a=this.scroll;this.anchors;i=function(){if(n){var t=n.top;e.first?t=0:t+=1,a.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(i)):i()}},{key:"handleSkinChange",value:function(e){var t={skin:e},i=this.props.onSkinChange;this.setState(t),lh.update(t),i(e)}},{key:"handleKeyDown",value:function(e){var t=!1;switch(e.keyCode){case 13:var i;this.SEARCH_CATEGORY.emojis&&this.SEARCH_CATEGORY.emojis.length&&(i=Xf(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(i),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var i=this.categoryRefs["category-".concat(e)];i&&i.memoizeSize()}if(this.scroll){var n=this.scroll;this.scrollHeight=n.scrollHeight,this.clientHeight=n.clientHeight}}},{key:"getCategories",value:function(){return this.state.firstRender?this.categories.slice(0,3):this.categories}},{key:"setAnchorsRef",value:function(e){this.anchors=e}},{key:"setSearchRef",value:function(e){this.search=e}},{key:"setPreviewRef",value:function(e){this.preview=e}},{key:"setScrollRef",value:function(e){this.scroll=e}},{key:"setCategoryRef",value:function(e,t){this.categoryRefs||(this.categoryRefs={}),this.categoryRefs[e]=t}},{key:"render",value:function(){var e=this,t=this.props,i=t.perLine,n=t.emojiSize,a=t.set,r=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,u=t.title,_=t.emoji,d=t.color,c=t.native,g=t.backgroundImageFn,f=t.emojisToShowFilter,h=t.showPreview,p=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,E=t.include,y=t.exclude,D=t.recent,v=t.autoFocus,k=t.skinEmoji,S=t.notFound,w=t.notFoundEmoji,C=i*(n+12)+12+2+function(){if("undefined"==typeof document)return 0;var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}(),x=this.getPreferredTheme(),T=this.props.skin||this.state.skin||lh.get("skin")||this.props.defaultSkin;return m.a.createElement("section",{style:ap({width:C},l),className:"emoji-mart emoji-mart-".concat(x),"aria-label":u,onKeyDown:this.handleKeyDown},m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(Mh,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:d,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),m.a.createElement(ip,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:f,include:E,exclude:y,custom:this.CUSTOM,autoFocus:v}),m.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return m.a.createElement($h,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:i,native:c,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?D:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:c,skin:T,size:n,set:a,sheetSize:r,sheetColumns:o,sheetRows:s,forceSize:c,tooltip:F,backgroundImageFn:g,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:S,notFoundEmoji:w})}))),(h||p)&&m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(ep,{ref:this.setPreviewRef,data:this.data,title:u,emoji:_,showSkinTones:p,showPreview:h,emojiProps:{native:c,size:38,skin:T,set:a,sheetSize:r,sheetColumns:o,sheetRows:s,backgroundImageFn:g},skinsProps:{skin:T,onChange:this.handleSkinChange,skinEmoji:k},i18n:this.i18n})))}}]),t}(m.a.PureComponent);function sp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}op.propTypes=ap({},Rh,{data:ig.a.object.isRequired}),op.defaultProps=ap({},Bh);var lp=function(e){function t(){return jf()(this,t),vh()(this,Sh()(t).apply(this,arguments))}return Ch()(t,e),Uf()(t,[{key:"render",value:function(){return m.a.createElement(op,yh()({},this.props,this.state))}}]),t}(m.a.PureComponent);function up(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _p(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?up(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):up(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}lp.propTypes=Rh,lp.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sp(Object(i),!0).forEach((function(t){bh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},Bh,{data:Lf});var dp=function e(t){for(var i in e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);return Hh(_p({},t))};dp.propTypes=Ah,dp.defaultProps=_p({},Ih,{data:Lf});var cp=i(49),gp={insert:"head",singleton:!1},fp=(r()(cp.a,gp),cp.a.locals,i(88));function hp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Bf()(e);if(t){var a=Bf()(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Mf()(this,i)}}var pp=function(e){Af()(i,e);var t=hp(i);function i(){var e;wf()(this,i);for(var n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return e=t.call.apply(t,[this].concat(a)),d()(Of()(e),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),d()(Of()(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return xf()(i,[{key:"render",value:function(){return m.a.createElement(op,{style:{maxWidth:"100%"},data:fp,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect,"data-cy":"neeto-editor-emoji-picker"})}}]),i}(m.a.Component);pp.defaultProps={editor:{},range:{}},pp.propTypes={editor:ig.a.object.isRequired,range:ig.a.object};var mp=pp,Fp=function(e){var t=e.editor,i=Object(p.useRef)();return m.a.createElement(Zg,{ref:i,closeOnSelect:!1,customTarget:function(){var e;return m.a.createElement(rg,{icon:kf,iconActive:null==i||null===(e=i.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Emoji",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-emoji-option-button"})},position:"bottom-start"},m.a.createElement(mp,{editor:t}))},bp=function(e){var t=e.editor,i=e.variables,n=e.setImageUploadVisible,a=e.options,r=e.mentions,o=e.showImageInMention;if(!t)return null;var s=[{Icon:Td,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Nd,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:Rd,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:Id,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Ud,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}].filter((function(e){return a.includes(e.optionName)})),l=[{Icon:$c,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:jd,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"code-block"},{Icon:Qc,command:function(){return n(!0)},active:t.isActive("imageUpload"),optionName:"image-upload"}].filter((function(e){return a.includes(e.optionName)})),u=[{Icon:Xc,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:eg,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}].filter((function(e){return a.includes(e.optionName)})),_=a.includes("font-color"),d=a.includes("font-size"),c=a.includes("emoji"),g=a.includes("link"),f=function(e,t){var i=e.Icon,n=e.command,a=e.active,r=e.optionName;return m.a.createElement(rg,{key:t,icon:i,iconActive:a,onClick:n,tooltipProps:{content:d_(r),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(r,"-option")})};return m.a.createElement("div",{className:"neeto-editor-fixed-menu"},d&&m.a.createElement(Xg,{editor:t}),s.map(f),_&&m.a.createElement(_g,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),c&&m.a.createElement(Fp,{editor:t}),g&&m.a.createElement(Df,{editor:t}),l.map(f),u.map(f),m.a.createElement("div",{className:"neeto-editor-fixed-menu-addons"},m.a.createElement(rf,{editor:t,variables:i}),m.a.createElement(gf,{editor:t,mentions:r,showImageInMention:o})))},Ep=function(e){var t=e.children,i=e.className,n=void 0===i?"root-portal":i,a=e.el,r=void 0===a?"div":a,o=document.getElementsByClassName(n)[0];return o||(o=document.createElement(r)).classList.add(n),m.a.useEffect((function(){document.body.appendChild(o)}),[]),Su.a.createPortal(t,o)},yp=["children","className"],Dp=function(e){var t=e.children,i=e.className,n=h()(e,yp);return m.a.createElement("div",u()({className:b()("ne-backdrop",d()({},i,i))},n),t)},vp=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"],kp=function(){},Sp="xs",wp="sm",Cp="md",xp=function(e){var t=e.size,i=void 0===t?"sm":t,n=e.isOpen,a=void 0!==n&&n,r=e.onClose,o=void 0===r?kp:r,s=e.loading,l=void 0!==s&&s,_=e.children,c=e.className,g=void 0===c?"":c,f=e.closeOnEsc,F=void 0===f||f,E=e.closeButton,y=void 0===E||E,D=e.backdropClassName,v=void 0===D?"":D,k=e.closeOnOutsideClick,S=void 0===k||k,w=h()(e,vp),C=Object(p.useRef)();return S&&Vg(C,o),F&&Yg("esc",o),m.a.createElement(Ep,{className:"ne-portal"},a&&m.a.createElement(Dp,{key:"modal-backdrop",className:b()("ne-modal__backdrop",v)},m.a.createElement("div",u()({ref:C,key:"modal-wrapper",className:b()("ne-modal__wrapper",d()({"ne-modal__wrapper--xs":i===Sp,"ne-modal__wrapper--sm":i===wp,"ne-modal__wrapper--md":i===Cp},g,g))},w),y&&m.a.createElement(qc,{style:"text",icon:oc,className:"ne-modal__close",onClick:o}),l?m.a.createElement(m.a.Fragment,null):_)))},Tp=["children","size","noUnderline","className"],Op=["active","className","children","icon","onClick","activeClassName"],Np=function(){},Ap="large",Rp=function(e){var t=e.children,i=e.size,n=e.noUnderline,a=e.className,r=void 0===a?"":a,o=h()(e,Tp);return m.a.createElement("div",u()({className:b()({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":i===Ap},{"ne-tab__wrapper--underline-none":n},[r]),"data-cy":"tab-container"},o),t)};Rp.Item=function(e){var t=e.active,i=e.className,n=void 0===i?"":i,a=e.children,r=e.icon,o=void 0===r?null:r,s=e.onClick,l=void 0===s?Np:s,_=e.activeClassName,d=void 0===_?"":_,c=h()(e,Op),g="button",f="string"==typeof o?function(){return m.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||m.a.Fragment;return d&&(g=Tc),m.a.createElement(g,u()({className:b()(["ne-tab flex items-center justify-center select-none",n],{active:t}),onClick:l,"data-cy":"tab-item"},c),o&&m.a.createElement(f,{className:"ne-tab__icon"}),a)};var Mp=Rp,Ip=function(e){var t,i=Object(p.useState)(null===(t=e[0])||void 0===t?void 0:t.key),n=g()(i,2),a=n[0],r=n[1];return[a,function(e){return r(e.key)}]},Bp=function(e){var t=e.buttonLabel,i=void 0===t?"Submit":t,n=e.placeholder,a=e.onSubmit,r=e.className,o=Object(p.useState)(""),s=g()(o,2),l=s[0],u=s[1],_=Object(p.useState)(""),c=g()(_,2),f=c[0],h=c[1];return m.a.createElement("div",{className:b()("neeto-editor-url-form__wrapper",d()({},r,r))},m.a.createElement(yf,{name:"url",value:l,placeholder:n,onFocus:function(){return h("")},error:f,onChange:function(e){var t=e.target.value;return u(t)},"data-cy":"neeto-editor-image-upload-url-input"}),m.a.createElement(qc,{size:"large",label:i,onClick:function(e){e.preventDefault(),Uc.test(l)?a(l):h("Please enter a valid url")},"data-cy":"neeto-editor-image-upload-url-submit"}))},Lp=i(19),Pp=i.n(Lp),jp=(i(60),i(72),i(73)),qp=i.n(jp),Up=(i(74),i(75),i(76),i(77)),zp=i.n(Up),Gp=i(89),Hp=i.n(Gp),Yp=function(e){var t,i=e.uppy,n=Object(p.useState)(0),a=g()(n,2),r=a[0],o=a[1];Object(p.useEffect)((function(){i.on("progress",o)}),[i]);var s="".concat(r,"%");return m.a.createElement("div",{className:"neeto-editor-image-uploader__progress"},m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(t=i.getFiles()[0])||void 0===t?void 0:t.name),m.a.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},m.a.createElement("div",{className:"neeto-editor-progress-bar__percent"},m.a.createElement("p",null,s),m.a.createElement(qc,{icon:oc,onClick:function(){return i.cancelAll()},size:"small",style:"text"})),m.a.createElement("div",{className:"neeto-editor-progress-bar__indicator"},m.a.createElement("div",{style:{width:s},className:"neeto-editor-progress-bar__indicator-inner"}))))};function Vp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var Wp={allowMultipleUploads:!1,autoProceed:!0},$p={formData:!0,fieldName:"blob"},Kp=function(e){var t=e.endpoint,i=void 0===t?"/api/v1/direct_uploads/image_upload":t,n=e.onSuccess,a=Object(p.useState)(!1),r=g()(a,2),o=r[0],s=r[1],l=zp()((function(){return new Pp.a(Wp).use(Hp.a,function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Vp(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Vp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({endpoint:i},$p)).on("upload",(function(){return s(!0)})).on("upload-success",(function(e,t){return n(t.body.imageURL)})).on("cancel-all",(function(){return s(!1)})).on("complete",(function(){return s(!1)}))}));return o?m.a.createElement(Yp,{uppy:l}):m.a.createElement(qp.a,{className:"neeto-editor-image-uploader__dnd",note:"Max. File Size: 5MB",locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:l,"data-cy":"neeto-editor-image-local-uploader"})},Qp=i(50),Zp=i.n(Qp),Xp=i(90),Jp=i.n(Xp),em=i(51),tm=i.n(em),im=i(91),nm=i.n(im),am=i(92),rm=i.n(am),om={FONT_COLOR:"font-color",FONT_SIZE:"font-size",BOLD:"bold",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"strike",BLOCKQUOTE:"block-quote",CODE_BLOCK:"code-block",LINK:"link",LIST_BULLETS:"bullet-list",LIST_ORDERED:"ordered-list",IMAGE_UPLOAD:"image-upload",VIDEO_EMBED:"video-embed",EMOJI:"emoji",DIVIDER:"divider",MENTION:"mention"},sm=function(e){var t=e.pageNo,i=e.query,n=e.apiKey;return rm.a.get("https://api.unsplash.com/search/photos",{headers:{Authorization:"Client-ID ".concat(n)},params:{page:t,per_page:30,order_by:"popular",query:i}})},lm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,i=Object(p.useState)(e),n=g()(i,2),a=n[0],r=n[1];return Object(p.useEffect)((function(){var i=setTimeout((function(){r(e)}),t);return function(){clearTimeout(i)}}),[e]),a},um=function(){return m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__loader"},m.a.createElement("span",{className:"neeto-editor-unsplash-gallery__spinner-icon"}))},_m=function(e){var t=e.onSubmit,i=e.unsplashApiKey,n=Object(p.useRef)(null),a=Object(p.useState)(""),r=g()(a,2),o=r[0],s=r[1],l=Object(p.useState)(!1),u=g()(l,2),_=u[0],d=u[1],c=Object(p.useState)([]),f=g()(c,2),h=f[0],F=f[1],b=Object(p.useState)(1),E=g()(b,2),y=E[0],D=E[1],v=Object(p.useState)(!0),k=g()(v,2),S=k[0],w=k[1],C=Object(p.useState)(!1),x=g()(C,2),T=x[0],O=x[1],N=lm(o||"latest");Object(p.useEffect)((function(){A(1)}),[N]);var A=function(){var e=Jp()(tm.a.mark((function e(t){var n,a,r,o;return tm.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,O(!0),d(!1),e.next=5,sm({page:t,query:N,apiKey:i});case 5:n=e.sent,a=n.data,r=a.results,o=a.total_pages,F(1===t?r:[].concat(Zp()(h),Zp()(r))),D(t+1),w(t<o),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),d(!0);case 15:return e.prev=15,O(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,12,15,18]])})));return function(t){return e.apply(this,arguments)}}();return m.a.createElement("div",{className:"neeto-editor-unsplash-wrapper"},m.a.createElement(yf,{name:"text",value:o,placeholder:"Search Unsplash",onChange:function(e){var t=e.target.value;s(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),_&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!_&&!T&&f_(h)&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!_&&m.a.createElement("div",{className:"neeto-editor-unsplash-container"},m.a.createElement(nm.a,{ref:n,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:S,loadMore:function(){!T&&S&&y>1&&A(y)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:m.a.createElement(um,{key:0})},h&&h.map((function(e,i){return m.a.createElement("div",{key:i,className:"neeto-editor-unsplash-gallery__item","data-cy":"neeto-editor-unsplash-image-picker-result-".concat(i)},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:"".concat(e.height/e.width*100,"%")}},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:"unsplashImage".concat(i)},m.a.createElement("img",{src:e.urls.regular,onClick:function(){return t(e.urls.small)}}),m.a.createElement("a",{href:"https://unsplash.com/@".concat(e.user.username),target:"_blank",rel:"noreferrer"},e.user.name," "))))}))),!S&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},dm=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}],cm=function(e){var t=e.editor,i=e.imageUploadUrl,n=e.isVisible,a=e.setIsVisible,r=e.unsplashApiKey,o=e.isUnsplashImageUploadActive,s=Ip(dm),l=g()(s,2),u=l[0],_=l[1],d=function(e){t.chain().focus().setImage({src:e}).run(),a(!1)},c={local:function(){return m.a.createElement(Kp,{endpoint:i,onSuccess:d})},link:function(){return m.a.createElement(Bp,{onSubmit:d,buttonLabel:"Upload Image",placeholder:"Paste the image link"})},unsplash:function(){return m.a.createElement(_m,{unsplashApiKey:r,onSubmit:d})}}[u];return m.a.createElement(xp,{isOpen:n,onClose:function(){return a(!1)},closeButton:!1},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement(Mp,null,dm.filter((function(e){return"unsplash"!==e.key||o})).map((function(e){return m.a.createElement(Mp.Item,{key:e.key,active:u===e.key,onClick:function(){return _(e)}},e.title)}))),m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},m.a.createElement(c,null))))};function gm(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var fm=function(e){var t=e.strategy,i=e.style,n=e.ref,a=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gm(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gm(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},i);return a["min-height"]&&(a.minHeight=a["min-height"],delete a["min-height"]),"flexible"===t&&n.current&&(a.height=n.current.scrollHeight),a},hm=["editor","className","style","strategy","limit","onFocus","onBlur"],pm=function(e){var t=e.editor,i=e.className,n=e.style,a=e.strategy,r=e.limit,o=e.onFocus,s=e.onBlur,l=h()(e,hm),_=t.inputFieldRef,c=t.onChange,g=t.state.length;return m.a.createElement("textarea",u()({ref:_,onChange:function(e){return c(e.target.value)},onKeyDown:function(e){g>=r&&"Backspace"!==e.key&&e.preventDefault()},onFocus:o,onBlur:s,className:b()("ProseMirror neeto-editor-markdown",d()({},i,i)),style:fm({style:n,strategy:a,ref:_}),"data-cy":"neeto-editor-markdown-editor",role:"textbox"},l))},mm=function(e){var t=e.count,i=e.limit,n="limit"===e.strategy&&i;return m.a.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},n?"".concat(i-t," characters remaining"):"".concat(t," characters"))},Fm=i(38),bm=i.n(Fm),Em=i(93);function ym(e,t){return Array(t+1).join(e)}var Dm=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function vm(e){return Cm(e,Dm)}var km=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Sm(e){return Cm(e,km)}var wm=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Cm(e,t){return t.indexOf(e.nodeName)>=0}function xm(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var Tm={};function Om(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function Nm(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function Am(e,t,i){for(var n=0;n<e.length;n++){var a=e[n];if(Rm(a,t,i))return a}}function Rm(e,t,i){var n=e.filter;if("string"==typeof n){if(n===t.nodeName.toLowerCase())return!0}else if(Array.isArray(n)){if(n.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof n)throw new TypeError("`filter` needs to be a string, array, or function");if(n.call(e,t,i))return!0}}function Mm(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Im(e,t,i){return e&&e.parentNode===t||i(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}Tm.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},Tm.lineBreak={filter:"br",replacement:function(e,t,i){return i.br+"\n"}},Tm.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,i){var n=Number(t.nodeName.charAt(1));return"setext"===i.headingStyle&&n<3?"\n\n"+e+"\n"+ym(1===n?"=":"-",e.length)+"\n\n":"\n\n"+ym("#",n)+" "+e+"\n\n"}},Tm.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},Tm.list={filter:["ul","ol"],replacement:function(e,t){var i=t.parentNode;return"LI"===i.nodeName&&i.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},Tm.listItem={filter:"li",replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var n=i.bulletListMarker+" ",a=t.parentNode;if("OL"===a.nodeName){var r=a.getAttribute("start"),o=Array.prototype.indexOf.call(a.children,t);n=(r?Number(r)+o:o+1)+". "}return n+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},Tm.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},Tm.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){for(var n,a=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],r=t.firstChild.textContent,o=i.fence.charAt(0),s=3,l=new RegExp("^"+o+"{3,}","gm");n=l.exec(r);)n[0].length>=s&&(s=n[0].length+1);var u=ym(o,s);return"\n\n"+u+a+"\n"+r.replace(/\n$/,"")+"\n"+u+"\n\n"}},Tm.horizontalRule={filter:"hr",replacement:function(e,t,i){return"\n\n"+i.hr+"\n\n"}},Tm.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var i=t.getAttribute("href"),n=Om(t.getAttribute("title"));return n&&(n=' "'+n+'"'),"["+e+"]("+i+n+")"}},Tm.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,i){var n,a,r=t.getAttribute("href"),o=Om(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),i.linkReferenceStyle){case"collapsed":n="["+e+"][]",a="["+e+"]: "+r+o;break;case"shortcut":n="["+e+"]",a="["+e+"]: "+r+o;break;default:var s=this.references.length+1;n="["+e+"]["+s+"]",a="["+s+"]: "+r+o}return this.references.push(a),n},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},Tm.emphasis={filter:["em","i"],replacement:function(e,t,i){return e.trim()?i.emDelimiter+e+i.emDelimiter:""}},Tm.strong={filter:["strong","b"],replacement:function(e,t,i){return e.trim()?i.strongDelimiter+e+i.strongDelimiter:""}},Tm.code={filter:function(e){var t=e.previousSibling||e.nextSibling,i="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!i},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",i="`",n=e.match(/`+/gm)||[];-1!==n.indexOf(i);)i+="`";return i+t+e+t+i}},Tm.image={filter:"img",replacement:function(e,t){var i=Om(t.getAttribute("alt")),n=t.getAttribute("src")||"",a=Om(t.getAttribute("title"));return n?"!["+i+"]("+n+(a?' "'+a+'"':"")+")":""}},Nm.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=Am(this.array,e,this.options))||(t=Am(this._keep,e,this.options))||(t=Am(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var Bm="undefined"!=typeof window?window:{};var Lm,Pm,jm=function(){var e=Bm.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?Bm.DOMParser:(Lm=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?Lm.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:Lm.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},Lm);function qm(e,t){var i;"string"==typeof e?i=(Pm=Pm||new jm).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):i=e.cloneNode(!0);return function(e){var t=e.element,i=e.isBlock,n=e.isVoid,a=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!a(t)){for(var r=null,o=!1,s=null,l=Im(s,t,a);l!==t;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \r\n\t]+/g," ");if(r&&!/ $/.test(r.data)||o||" "!==u[0]||(u=u.substr(1)),!u){l=Mm(l);continue}l.data=u,r=l}else{if(1!==l.nodeType){l=Mm(l);continue}i(l)||"BR"===l.nodeName?(r&&(r.data=r.data.replace(/ $/,"")),r=null,o=!1):n(l)||a(l)?(r=null,o=!0):r&&(o=!1)}var _=Im(s,l,a);s=l,l=_}r&&(r.data=r.data.replace(/ $/,""),r.data||Mm(r))}}({element:i,isBlock:vm,isVoid:Sm,isPre:t.preformattedCode?Um:null}),i}function Um(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function zm(e,t){return e.isBlock=vm(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!Sm(e)&&!function(e){return Cm(e,wm)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return xm(e,km)}(e)&&!function(e){return xm(e,wm)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var i=(n=e.textContent,a=n.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/),{leading:a[1],leadingAscii:a[2],leadingNonAscii:a[3],trailing:a[4],trailingNonAscii:a[5],trailingAscii:a[6]});var n,a;i.leadingAscii&&Gm("left",e,t)&&(i.leading=i.leadingNonAscii);i.trailingAscii&&Gm("right",e,t)&&(i.trailing=i.trailingNonAscii);return{leading:i.leading,trailing:i.trailing}}(e,t),e}function Gm(e,t,i){var n,a,r;return"left"===e?(n=t.previousSibling,a=/ $/):(n=t.nextSibling,a=/^ /),n&&(3===n.nodeType?r=a.test(n.nodeValue):i.preformattedCode&&"CODE"===n.nodeName?r=!1:1!==n.nodeType||vm(n)||(r=a.test(n.textContent))),r}var Hm=Array.prototype.reduce,Ym=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Vm(e){if(!(this instanceof Vm))return new Vm(e);var t={rules:Tm,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])}return e}({},t,e),this.rules=new Nm(this.options)}function Wm(e){var t=this;return Hm.call(e.childNodes,(function(e,i){var n="";return 3===(i=new zm(i,t.options)).nodeType?n=i.isCode?i.nodeValue:t.escape(i.nodeValue):1===i.nodeType&&(n=Km.call(t,i)),Qm(e,n)}),"")}function $m(e){var t=this;return this.rules.forEach((function(i){"function"==typeof i.append&&(e=Qm(e,i.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Km(e){var t=this.rules.forNode(e),i=Wm.call(this,e),n=e.flankingWhitespace;return(n.leading||n.trailing)&&(i=i.trim()),n.leading+t.replacement(i,e,this.options)+n.trailing}function Qm(e,t){var i=function(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),n=t.replace(/^\n*/,""),a=Math.max(e.length-i.length,t.length-n.length);return i+"\n\n".substring(0,a)+n}Vm.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=Wm.call(this,new qm(e,this.options));return $m.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return Ym.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};var Zm=Vm,Xm=function(e){e=e.replaceAll(/^\\$/gm,"<p></p>");var t=Em.marked.parse(e,{sanitize:!1});return t=(t=(t=(t=t.replaceAll(/<p><img[^>]*><\/p>/g,(function(e){return e.replace(/<\/?p>/g,"")}))).replaceAll(/!\[(.*?)\]\((.*?)\)/g,(function(e,t,i){return'<img src="'.concat(i,'" alt="').concat(t,'">')}))).replaceAll(/==([^=]+)==/g,"<mark>$1</mark>")).replaceAll(/--([^-]+)--/g,"<u>$1</u>"),bm.a.sanitize(t,{ADD_TAGS:["iframe"]})},Jm=function(e){var t=new Zm({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){return t.isBlock?"\\\n":""}});return t.keep(["iframe"]),t.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~".concat(e,"~")}}),t.addRule("highlight",{filter:["mark"],replacement:function(e){return"==".concat(e,"==")}}),t.addRule("underline",{filter:["u"],replacement:function(e){return"--".concat(e,"--")}}),t.turndown(e)},eF=function(e){var t=document.createElement("div");return t.innerHTML=e,t.textContent},tF=function(e){var t=e.content,i=e.onUpdate,n=e.onSubmit,a=Object(p.useState)((function(){return t?{content:Jm(t),length:eF(t).length}:{content:"",length:0}})),r=g()(a,2),o=r[0],s=r[1],l=Object(p.useRef)(),u=Object(p.useRef)();u.current=o.content;var _=Object(p.useCallback)((function(e){if(l.current){var t=Jm(e),i=eF(e);s({content:t,length:i.length}),l.current.textContent=t}}),[s]),d=Object(p.useCallback)((function(){return Xm(u.current)}),[u]),c=Object(p.useCallback)((function(){var e=d();return eF(e)}),[u]),f=Object(p.useCallback)((function(e){var t;if("Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null===(t=l.current)||void 0===t||t.blur(),n)){var i=d();n({markdown:u.current,html:i})}}),[u]);Object(p.useEffect)((function(){return document.addEventListener("keydown",f),function(){document.removeEventListener("keydown",f)}}),[f]),Object(p.useEffect)((function(){l.current&&(l.current.textContent=u.current)}),[l,u]);var h=Object(p.useMemo)((function(){return{setContent:_}}),[_]);return{inputFieldRef:l,state:o,onChange:function(e){var t=Xm(e),n=eF(t);s({content:e,length:n.length}),i({markdown:e,html:t})},isEmpty:o.length<=0,getHTML:d,getText:c,commands:h}};const iF=/^\s*>\s$/,nF=cs.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBlockquote:()=>({commands:e})=>e.wrapIn("blockquote"),toggleBlockquote:()=>({commands:e})=>e.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:e})=>e.lift("blockquote")}),addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[bs({find:iF,type:this.type})]}}),aF=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,rF=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,oF=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,sF=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,lF=gs.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBold:()=>({commands:e})=>e.setMark("bold"),toggleBold:()=>({commands:e})=>e.toggleMark("bold"),unsetBold:()=>({commands:e})=>e.unsetMark("bold")}),addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ps({find:aF,type:this.type}),ps({find:oF,type:this.type})]},addPasteRules(){return[Es({find:rF,type:this.type}),Es({find:sF,type:this.type})]}}),uF=/^\s*([-+*])\s$/,_F=cs.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[bs({find:uF,type:this.type})]}}),dF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,cF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,gF=gs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setCode:()=>({commands:e})=>e.setMark("code"),toggleCode:()=>({commands:e})=>e.toggleMark("code"),unsetCode:()=>({commands:e})=>e.unsetMark("code")}),addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ps({find:dF,type:this.type})]},addPasteRules(){return[Es({find:cF,type:this.type})]}}),fF=/^```(?<language>[a-z]*)?[\s\n]$/,hF=/^~~~(?<language>[a-z]*)?[\s\n]$/,pF=cs.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:i}=this.options,n=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(i)).map(e=>e.replace(i,""))[0];return n||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands:()=>({setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,i=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!i&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[ms({find:fF,type:this.type,getAttributes:({groups:e})=>e}),ms({find:hF,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Rt({key:new Bt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const i=t.clipboardData.getData("text/plain"),n=t.clipboardData.getData("vscode-editor-data"),a=n?JSON.parse(n):void 0,r=null==a?void 0:a.mode;if(!i||!r)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:r})),o.setSelection(mt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(i.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}});var mF=cs.create({name:"doc",topNode:!0,content:"block+"});var FF=function(e,t){var i=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var n=function(e){return i[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))};FF.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var i=t.name,n=t.handler;return e.editorView.dom.removeEventListener(i,n)}))},FF.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())},FF.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},FF.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var i=t.nodeBefore,n=t.nodeAfter;if(i||n){var a=this.editorView.nodeDOM(this.cursorPos-(i?i.nodeSize:0)).getBoundingClientRect(),r=i?a.bottom:a.top;i&&n&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:a.left,right:a.right,top:r-this.width/2,bottom:r+this.width/2}}}if(!e){var o=this.editorView.coordsAtPos(this.cursorPos);e={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var _=u.getBoundingClientRect();s=_.left-u.scrollLeft,l=_.top-u.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},FF.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},FF.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Je(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},FF.prototype.dragend=function(){this.scheduleRemoval(20)},FF.prototype.drop=function(){this.scheduleRemoval(20)},FF.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const bF=mr.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Rt({view:function(t){return new FF(t,e)}}))];var e}});var EF=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,n){var a=i.resolve(n.map(this.head));return t.valid(a)?new t(a):e.near(a)},t.prototype.content=function(){return T.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(i.pos))},t.prototype.getBookmark=function(){return new yF(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var i=e.index(t);if(0!=i)for(var n=e.node(t).child(i-1);;n=n.lastChild){if(0==n.childCount&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var i=e.indexAfter(t),n=e.node(t);if(i!=n.childCount)for(var a=n.child(i);;a=a.firstChild){if(0==a.childCount&&!a.inlineContent||a.isAtom||a.type.spec.isolating)return!0;if(a.inlineContent)return!1}}return!0}(e))return!1;var i=t.type.spec.allowGapCursor;if(null!=i)return i;var n=t.contentMatchAt(e.index()).defaultType;return n&&n.isTextblock},t.findFrom=function(e,i,n){e:for(;;){if(!n&&t.valid(e))return e;for(var a=e.pos,r=null,o=e.depth;;o--){var s=e.node(o);if(i>0?e.indexAfter(o)<s.childCount:e.index(o)>0){r=s.child(i>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;a+=i;var l=e.doc.resolve(a);if(t.valid(l))return l}for(;;){var u=i>0?r.firstChild:r.lastChild;if(!u){if(r.isAtom&&!r.isText&&!bt.isSelectable(r)){e=e.doc.resolve(a+r.nodeSize*i),n=!1;continue e}break}r=u,a+=i;var _=e.doc.resolve(a);if(t.valid(_))return _}return null}},t}(ft);EF.prototype.visible=!1,ft.jsonID("gapcursor",EF);var yF=function(e){this.pos=e};yF.prototype.map=function(e){return new yF(e.map(this.pos))},yF.prototype.resolve=function(e){var t=e.resolve(this.pos);return EF.valid(t)?new EF(t):ft.near(t)};var DF=dr({ArrowLeft:vF("horiz",-1),ArrowRight:vF("horiz",1),ArrowUp:vF("vert",-1),ArrowDown:vF("vert",1)});function vF(e,t){var i="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,n,a){var r=e.selection,o=t>0?r.$to:r.$from,s=r.empty;if(r instanceof mt){if(!a.endOfTextblock(i)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=EF.findFrom(o,t,s);return!!l&&(n&&n(e.tr.setSelection(new EF(l))),!0)}}function kF(e,t,i){if(!e.editable)return!1;var n=e.state.doc.resolve(t);if(!EF.valid(n))return!1;var a=e.posAtCoords({left:i.clientX,top:i.clientY}).inside;return!(a>-1&&bt.isSelectable(e.state.doc.nodeAt(a)))&&(e.dispatch(e.state.tr.setSelection(new EF(n))),!0)}function SF(e){if(!(e.selection instanceof EF))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ma.create(e.doc,[Oa.widget(e.selection.head,t,{key:"gapcursor"})])}const wF=mr.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Rt({props:{decorations:SF,createSelectionBetween:function(e,t,i){if(t.pos==i.pos&&EF.valid(i))return new EF(i)},handleClick:kF,handleKeyDown:DF}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=hr(pr(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),CF=cs.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",as(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:i,editor:n})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:a}=n.extensionManager,r=i.storedMarks||i.selection.$to.parentOffset&&i.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:i})=>{if(i&&r&&e){const e=r.filter(e=>a.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),xF=cs.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:"h"+e,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return["h"+(this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]),as(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode("heading",e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode("heading","paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,["Mod-Alt-"+t]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>ms({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var TF=function(){};TF.prototype.append=function(e){return e.length?(e=TF.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},TF.prototype.prepend=function(e){return e.length?TF.from(e).append(this):this},TF.prototype.appendInner=function(e){return new NF(this,e)},TF.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?TF.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},TF.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},TF.prototype.forEach=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length),t<=i?this.forEachInner(e,t,i,0):this.forEachInvertedInner(e,t,i,0)},TF.prototype.map=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length);var n=[];return this.forEach((function(t,i){return n.push(e(t,i))}),t,i),n},TF.from=function(e){return e instanceof TF?e:e&&e.length?new OF(e):TF.empty};var OF=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,i){return 0==e&&i==this.length?this:new t(this.values.slice(e,i))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,i,n){for(var a=t;a<i;a++)if(!1===e(this.values[a],n+a))return!1},t.prototype.forEachInvertedInner=function(e,t,i,n){for(var a=t-1;a>=i;a--)if(!1===e(this.values[a],n+a))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},i.length.get=function(){return this.values.length},i.depth.get=function(){return 0},Object.defineProperties(t.prototype,i),t}(TF);TF.empty=new OF([]);var NF=function(e){function t(t,i){e.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,i,n){var a=this.left.length;return!(t<a&&!1===this.left.forEachInner(e,t,Math.min(i,a),n))&&(!(i>a&&!1===this.right.forEachInner(e,Math.max(t-a,0),Math.min(this.length,i)-a,n+a))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,i,n){var a=this.left.length;return!(t>a&&!1===this.right.forEachInvertedInner(e,t-a,Math.max(i,a)-a,n+a))&&(!(i<a&&!1===this.left.forEachInvertedInner(e,Math.min(t,a),i,n))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var i=this.left.length;return t<=i?this.left.slice(e,t):e>=i?this.right.slice(e-i,t-i):this.left.slice(e,i).append(this.right.slice(0,t-i))},t.prototype.leafAppend=function(e){var i=this.right.leafAppend(e);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(e){var i=this.left.leafPrepend(e);if(i)return new t(i,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(TF),AF=TF,RF=function(e,t){this.items=e,this.eventCount=t};RF.prototype.popEvent=function(e,t){var i=this;if(0==this.eventCount)return null;for(var n,a,r=this.items.length;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(n=this.remapping(r,this.items.length),a=n.maps.length);var o,s,l=e.tr,u=[],_=[];return this.items.forEach((function(e,t){if(!e.step)return n||(n=i.remapping(r,t+1),a=n.maps.length),a--,void _.push(e);if(n){_.push(new MF(e.map));var d,c=e.step.map(n.slice(a));c&&l.maybeStep(c).doc&&(d=l.mapping.maps[l.mapping.maps.length-1],u.push(new MF(d,null,null,u.length+_.length))),a--,d&&n.appendMap(d,a)}else l.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(a)):e.selection,s=new RF(i.items.slice(0,r).append(_.reverse().concat(u)),i.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}},RF.prototype.addTransform=function(e,t,i,n){for(var a=[],r=this.eventCount,o=this.items,s=!n&&o.length?o.get(o.length-1):null,l=0;l<e.steps.length;l++){var u,_=e.steps[l].invert(e.docs[l]),d=new MF(e.mapping.maps[l],_,t);(u=s&&s.merge(d))&&(d=u,l?a.pop():o=o.slice(0,o.length-1)),a.push(d),t&&(r++,t=null),n||(s=d)}var c,g,f,h=r-i.depth;return h>BF&&(g=h,(c=o).forEach((function(e,t){if(e.selection&&0==g--)return f=t,!1})),o=c.slice(f),r-=h),new RF(o.append(a),r)},RF.prototype.remapping=function(e,t){var i=new Ie;return this.items.forEach((function(t,n){var a=null!=t.mirrorOffset&&n-t.mirrorOffset>=e?i.maps.length-t.mirrorOffset:null;i.appendMap(t.map,a)}),e,t),i},RF.prototype.addMaps=function(e){return 0==this.eventCount?this:new RF(this.items.append(e.map((function(e){return new MF(e)}))),this.eventCount)},RF.prototype.rebased=function(e,t){if(!this.eventCount)return this;var i=[],n=Math.max(0,this.items.length-t),a=e.mapping,r=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),n);var s=t;this.items.forEach((function(t){var n=a.getMirror(--s);if(null!=n){r=Math.min(r,n);var l=a.maps[n];if(t.step){var u=e.steps[n].invert(e.docs[n]),_=t.selection&&t.selection.map(a.slice(s+1,n));_&&o++,i.push(new MF(l,u,_))}else i.push(new MF(l))}}),n);for(var l=[],u=t;u<r;u++)l.push(new MF(a.maps[u]));var _=this.items.slice(0,n).append(l).append(i),d=new RF(_,o);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-i.length)),d},RF.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},RF.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),i=t.maps.length,n=[],a=0;return this.items.forEach((function(r,o){if(o>=e)n.push(r),r.selection&&a++;else if(r.step){var s=r.step.map(t.slice(i)),l=s&&s.getMap();if(i--,l&&t.appendMap(l,i),s){var u=r.selection&&r.selection.map(t.slice(i));u&&a++;var _,d=new MF(l.invert(),s,u),c=n.length-1;(_=n.length&&n[c].merge(d))?n[c]=_:n.push(d)}}else r.map&&i--}),this.items.length,0),new RF(AF.from(n.reverse()),a)},RF.empty=new RF(AF.empty,0);var MF=function(e,t,i,n){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=n};MF.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new MF(t.getMap().invert(),t,this.selection)}};var IF=function(e,t,i,n){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=n},BF=20;function LF(e){var t=[];return e.forEach((function(e,i,n,a){return t.push(n,a)})),t}function PF(e,t){if(!e)return null;for(var i=[],n=0;n<e.length;n+=2){var a=t.map(e[n],1),r=t.map(e[n+1],-1);a<=r&&i.push(a,r)}return i}function jF(e,t,i,n){var a=zF(t),r=GF.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,a);if(o){var s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),r,a),u=new IF(n?l:o.remaining,n?o.remaining:l,null,0);i(o.transform.setSelection(s).setMeta(GF,{redo:n,historyState:u}).scrollIntoView())}}var qF=!1,UF=null;function zF(e){var t=e.plugins;if(UF!=t){qF=!1,UF=t;for(var i=0;i<t.length;i++)if(t[i].spec.historyPreserveItems){qF=!0;break}}return qF}var GF=new Bt("history"),HF=new Bt("closeHistory");function YF(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Rt({key:GF,state:{init:function(){return new IF(RF.empty,RF.empty,null,0)},apply:function(t,i,n){return function(e,t,i,n){var a,r=i.getMeta(GF);if(r)return r.historyState;i.getMeta(HF)&&(e=new IF(e.done,e.undone,null,0));var o=i.getMeta("appendedTransaction");if(0==i.steps.length)return e;if(o&&o.getMeta(GF))return o.getMeta(GF).redo?new IF(e.done.addTransform(i,null,n,zF(t)),e.undone,LF(i.mapping.maps[i.steps.length-1]),e.prevTime):new IF(e.done,e.undone.addTransform(i,null,n,zF(t)),null,e.prevTime);if(!1===i.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(a=i.getMeta("rebased"))?new IF(e.done.rebased(i,a),e.undone.rebased(i,a),PF(e.prevRanges,i.mapping),e.prevTime):new IF(e.done.addMaps(i.mapping.maps),e.undone.addMaps(i.mapping.maps),PF(e.prevRanges,i.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(i.time||0)-n.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var i=!1;return e.mapping.maps[0].forEach((function(e,n){for(var a=0;a<t.length;a+=2)e<=t[a+1]&&n>=t[a]&&(i=!0)})),i}(i,e.prevRanges)),l=o?PF(e.prevRanges,i.mapping):LF(i.mapping.maps[i.steps.length-1]);return new IF(e.done.addTransform(i,s?t.selection.getBookmark():null,n,zF(t)),RF.empty,l,i.time)}(i,n,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var i="historyUndo"==t.inputType?VF(e.state,e.dispatch):"historyRedo"==t.inputType&&WF(e.state,e.dispatch);return i&&t.preventDefault(),i}}}})}function VF(e,t){var i=GF.getState(e);return!(!i||0==i.done.eventCount)&&(t&&jF(i,e,t,!1),!0)}function WF(e,t){var i=GF.getState(e);return!(!i||0==i.undone.eventCount)&&(t&&jF(i,e,t,!0),!0)}const $F=mr.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>VF(e,t),redo:()=>({state:e,dispatch:t})=>WF(e,t)}),addProseMirrorPlugins(){return[YF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),KF=cs.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",as(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:i}=e,{empty:n,$anchor:a}=i,r=a.parent.isTextblock&&!a.parent.type.spec.code&&!a.parent.textContent;if(!n||!r||!t)return!0;const o=a.before(),s=a.start();return e.deleteRange(o,s),e.setSelection(mt.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var i;if(t){const{parent:t,pos:n}=e.selection.$from,a=n+1;if(!e.doc.nodeAt(a)){const n=null===(i=t.type.contentMatch.defaultType)||void 0===i?void 0:i.create();n&&(e.insert(a,n),e.setSelection(mt.create(e.doc,a)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[fs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),QF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,ZF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,XF=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,JF=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,eb=gs.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setItalic:()=>({commands:e})=>e.setMark("italic"),toggleItalic:()=>({commands:e})=>e.toggleMark("italic"),unsetItalic:()=>({commands:e})=>e.unsetMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ps({find:QF,type:this.type}),ps({find:XF,type:this.type})]},addPasteRules(){return[Es({find:ZF,type:this.type}),Es({find:JF,type:this.type})]}}),tb=cs.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",as(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),ib=/^(\d+)\.\s$/,nb=cs.create({name:"orderedList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...i}=e;return 1===t?["ol",as(this.options.HTMLAttributes,i),0]:["ol",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[bs({find:ib,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),ab=cs.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),rb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,ob=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,sb=gs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setStrike:()=>({commands:e})=>e.setMark("strike"),toggleStrike:()=>({commands:e})=>e.toggleMark("strike"),unsetStrike:()=>({commands:e})=>e.unsetMark("strike")}),addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ps({find:rb,type:this.type})]},addPasteRules(){return[Es({find:ob,type:this.type})]}});var lb=cs.create({name:"text",group:"inline"});const ub=mr.create({name:"starterKit",addExtensions(){var e,t,i,n,a,r,o,s,l,u,_,d,c,g,f,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(nF.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(lF.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(_F.configure(null===(i=this.options)||void 0===i?void 0:i.bulletList)),!1!==this.options.code&&F.push(gF.configure(null===(n=this.options)||void 0===n?void 0:n.code)),!1!==this.options.codeBlock&&F.push(pF.configure(null===(a=this.options)||void 0===a?void 0:a.codeBlock)),!1!==this.options.document&&F.push(mF.configure(null===(r=this.options)||void 0===r?void 0:r.document)),!1!==this.options.dropcursor&&F.push(bF.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(wF.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(CF.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push(xF.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push($F.configure(null===(_=this.options)||void 0===_?void 0:_.history)),!1!==this.options.horizontalRule&&F.push(KF.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&F.push(eb.configure(null===(c=this.options)||void 0===c?void 0:c.italic)),!1!==this.options.listItem&&F.push(tb.configure(null===(g=this.options)||void 0===g?void 0:g.listItem)),!1!==this.options.orderedList&&F.push(nb.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&F.push(ab.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(sb.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(lb.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),_b=Fs({find:/--$/,replace:"—"}),db=Fs({find:/\.\.\.$/,replace:"…"}),cb=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),gb=Fs({find:/"$/,replace:"”"}),fb=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),hb=Fs({find:/'$/,replace:"’"}),pb=Fs({find:/<-$/,replace:"←"}),mb=Fs({find:/->$/,replace:"→"}),Fb=Fs({find:/\(c\)$/,replace:"©"}),bb=Fs({find:/\(tm\)$/,replace:"™"}),Eb=Fs({find:/\(r\)$/,replace:"®"}),yb=Fs({find:/1\/2$/,replace:"½"}),Db=Fs({find:/\+\/-$/,replace:"±"}),vb=Fs({find:/!=$/,replace:"≠"}),kb=Fs({find:/<<$/,replace:"«"}),Sb=Fs({find:/>>$/,replace:"»"}),wb=Fs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),Cb=Fs({find:/\^2$/,replace:"²"}),xb=Fs({find:/\^3$/,replace:"³"}),Tb=Fs({find:/1\/4$/,replace:"¼"}),Ob=Fs({find:/3\/4$/,replace:"¾"}),Nb=mr.create({name:"typography",addInputRules:()=>[_b,db,cb,gb,fb,hb,pb,mb,Fb,bb,Eb,yb,Db,vb,kb,Sb,wb,Cb,xb,Tb,Ob]}),Ab=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,Rb=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,Mb=gs.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:"background-color: "+e.color}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setHighlight:e=>({commands:t})=>t.setMark("highlight",e),toggleHighlight:e=>({commands:t})=>t.toggleMark("highlight",e),unsetHighlight:()=>({commands:e})=>e.unsetMark("highlight")}),addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[ps({find:Ab,type:this.type})]},addPasteRules(){return[Es({find:Rb,type:this.type})]}});var Ib=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var i=0;i<e.length;i++)this.size+=e[i].nodeSize},Bb={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};Ib.prototype.nodesBetween=function(e,t,i,n,a){void 0===n&&(n=0);for(var r=0,o=0;o<t;r++){var s=this.content[r],l=o+s.nodeSize;if(l>e&&!1!==i(s,n+o,a,r)&&s.content.size){var u=o+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),i,n+u)}o=l}},Ib.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},Ib.prototype.textBetween=function(e,t,i,n){var a="",r=!0;return this.nodesBetween(e,t,(function(o,s){o.isText?(a+=o.text.slice(Math.max(e,s)-s,t-s),r=!i):o.isLeaf&&n?(a+="function"==typeof n?n(o):n,r=!i):!r&&o.isBlock&&(a+=i,r=!0)}),0),a},Ib.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,i=e.firstChild,n=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(i)&&(n[n.length-1]=t.withText(t.text+i.text),a=1);a<e.content.length;a++)n.push(e.content[a]);return new Ib(n,this.size+e.size)},Ib.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var i=[],n=0;if(t>e)for(var a=0,r=0;r<t;a++){var o=this.content[a],s=r+o.nodeSize;s>e&&((r<e||s>t)&&(o=o.isText?o.cut(Math.max(0,e-r),Math.min(o.text.length,t-r)):o.cut(Math.max(0,e-r-1),Math.min(o.content.size,t-r-1))),i.push(o),n+=o.nodeSize),r=s}return new Ib(i,n)},Ib.prototype.cutByIndex=function(e,t){return e==t?Ib.empty:0==e&&t==this.content.length?this:new Ib(this.content.slice(e,t))},Ib.prototype.replaceChild=function(e,t){var i=this.content[e];if(i==t)return this;var n=this.content.slice(),a=this.size+t.nodeSize-i.nodeSize;return n[e]=t,new Ib(n,a)},Ib.prototype.addToStart=function(e){return new Ib([e].concat(this.content),this.size+e.nodeSize)},Ib.prototype.addToEnd=function(e){return new Ib(this.content.concat(e),this.size+e.nodeSize)},Ib.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},Bb.firstChild.get=function(){return this.content.length?this.content[0]:null},Bb.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},Bb.childCount.get=function(){return this.content.length},Ib.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},Ib.prototype.maybeChild=function(e){return this.content[e]},Ib.prototype.forEach=function(e){for(var t=0,i=0;t<this.content.length;t++){var n=this.content[t];e(n,i,t),i+=n.nodeSize}},Ib.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,i,n){for(var a=0;;a++){if(a==t.childCount||a==i.childCount)return t.childCount==i.childCount?null:n;var r=t.child(a),o=i.child(a);if(r!=o){if(!r.sameMarkup(o))return n;if(r.isText&&r.text!=o.text){for(var s=0;r.text[s]==o.text[s];s++)n++;return n}if(r.content.size||o.content.size){var l=e(r.content,o.content,n+1);if(null!=l)return l}n+=r.nodeSize}else n+=r.nodeSize}}(this,e,t)},Ib.prototype.findDiffEnd=function(e,t,i){return void 0===t&&(t=this.size),void 0===i&&(i=e.size),function e(t,i,n,a){for(var r=t.childCount,o=i.childCount;;){if(0==r||0==o)return r==o?null:{a:n,b:a};var s=t.child(--r),l=i.child(--o),u=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:n,b:a};if(s.isText&&s.text!=l.text){for(var _=0,d=Math.min(s.text.length,l.text.length);_<d&&s.text[s.text.length-_-1]==l.text[l.text.length-_-1];)_++,n--,a--;return{a:n,b:a}}if(s.content.size||l.content.size){var c=e(s.content,l.content,n-1,a-1);if(c)return c}n-=u,a-=u}else n-=u,a-=u}}(this,e,t,i)},Ib.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return Pb(0,e);if(e==this.size)return Pb(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var i=0,n=0;;i++){var a=n+this.child(i).nodeSize;if(a>=e)return a==e||t>0?Pb(i+1,a):Pb(i,n);n=a}},Ib.prototype.toString=function(){return"<"+this.toStringInner()+">"},Ib.prototype.toStringInner=function(){return this.content.join(", ")},Ib.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},Ib.fromJSON=function(e,t){if(!t)return Ib.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ib(t.map(e.nodeFromJSON))},Ib.fromArray=function(e){if(!e.length)return Ib.empty;for(var t,i=0,n=0;n<e.length;n++){var a=e[n];i+=a.nodeSize,n&&a.isText&&e[n-1].sameMarkup(a)?(t||(t=e.slice(0,n)),t[t.length-1]=a.withText(t[t.length-1].text+a.text)):t&&t.push(a)}return new Ib(t||e,i)},Ib.from=function(e){if(!e)return Ib.empty;if(e instanceof Ib)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ib([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(Ib.prototype,Bb);var Lb={index:0,offset:0};function Pb(e,t){return Lb.index=e,Lb.offset=t,Lb}function jb(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var i=Array.isArray(e);if(Array.isArray(t)!=i)return!1;if(i){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!jb(e[n],t[n]))return!1}else{for(var a in e)if(!(a in t)||!jb(e[a],t[a]))return!1;for(var r in t)if(!(r in e))return!1}return!0}Ib.empty=new Ib([],0);var qb=function(e,t){this.type=e,this.attrs=t};function Ub(e){var t=Error.call(this,e);return t.__proto__=Ub.prototype,t}qb.prototype.addToSet=function(e){for(var t,i=!1,n=0;n<e.length;n++){var a=e[n];if(this.eq(a))return e;if(this.type.excludes(a.type))t||(t=e.slice(0,n));else{if(a.type.excludes(this.type))return e;!i&&a.type.rank>this.type.rank&&(t||(t=e.slice(0,n)),t.push(this),i=!0),t&&t.push(a)}}return t||(t=e.slice()),i||t.push(this),t},qb.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},qb.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},qb.prototype.eq=function(e){return this==e||this.type==e.type&&jb(this.attrs,e.attrs)},qb.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},qb.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var i=e.marks[t.type];if(!i)throw new RangeError("There is no mark type "+t.type+" in this schema");return i.create(t.attrs)},qb.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0},qb.setFrom=function(e){if(!e||0==e.length)return qb.none;if(e instanceof qb)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},qb.none=[],Ub.prototype=Object.create(Error.prototype),Ub.prototype.constructor=Ub,Ub.prototype.name="ReplaceError";var zb=function(e,t,i){this.content=e,this.openStart=t,this.openEnd=i},Gb={size:{configurable:!0}};function Hb(e,t,i){if(i.openStart>e.depth)throw new Ub("Inserted content deeper than insertion position");if(e.depth-i.openStart!=t.depth-i.openEnd)throw new Ub("Inconsistent open depths");return function e(t,i,n,a){var r=t.index(a),o=t.node(a);if(r==i.index(a)&&a<t.depth-n.openStart){var s=e(t,i,n,a+1);return o.copy(o.content.replaceChild(r,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=a||i.depth!=a){var l=function(e,t){for(var i=t.depth-e.openStart,n=t.node(i).copy(e.content),a=i-1;a>=0;a--)n=t.node(a).copy(Ib.from(n));return{start:n.resolveNoCache(e.openStart+i),end:n.resolveNoCache(n.content.size-e.openEnd-i)}}(n,t),u=l.start,_=l.end;return Kb(o,function e(t,i,n,a,r){var o=t.depth>r&&Vb(t,i,r+1),s=a.depth>r&&Vb(n,a,r+1),l=[];$b(null,t,r,l),o&&s&&i.index(r)==n.index(r)?(Yb(o,s),Wb(Kb(o,e(t,i,n,a,r+1)),l)):(o&&Wb(Kb(o,Qb(t,i,r+1)),l),$b(i,n,r,l),s&&Wb(Kb(s,Qb(n,a,r+1)),l));return $b(a,null,r,l),new Ib(l)}(t,u,_,i,a))}var d=t.parent,c=d.content;return Kb(d,c.cut(0,t.parentOffset).append(n.content).append(c.cut(i.parentOffset)))}return Kb(o,Qb(t,i,a))}(e,t,i,0)}function Yb(e,t){if(!t.type.compatibleContent(e.type))throw new Ub("Cannot join "+t.type.name+" onto "+e.type.name)}function Vb(e,t,i){var n=e.node(i);return Yb(n,t.node(i)),n}function Wb(e,t){var i=t.length-1;i>=0&&e.isText&&e.sameMarkup(t[i])?t[i]=e.withText(t[i].text+e.text):t.push(e)}function $b(e,t,i,n){var a=(t||e).node(i),r=0,o=t?t.index(i):a.childCount;e&&(r=e.index(i),e.depth>i?r++:e.textOffset&&(Wb(e.nodeAfter,n),r++));for(var s=r;s<o;s++)Wb(a.child(s),n);t&&t.depth==i&&t.textOffset&&Wb(t.nodeBefore,n)}function Kb(e,t){if(!e.type.validContent(t))throw new Ub("Invalid content for node "+e.type.name);return e.copy(t)}function Qb(e,t,i){var n=[];($b(null,e,i,n),e.depth>i)&&Wb(Kb(Vb(e,t,i+1),Qb(e,t,i+1)),n);return $b(t,null,i,n),new Ib(n)}Gb.size.get=function(){return this.content.size-this.openStart-this.openEnd},zb.prototype.insertAt=function(e,t){var i=function e(t,i,n,a){var r=t.findIndex(i),o=r.index,s=r.offset,l=t.maybeChild(o);if(s==i||l.isText)return a&&!a.canReplace(o,o,n)?null:t.cut(0,i).append(n).append(t.cut(i));var u=e(l.content,i-s-1,n);return u&&t.replaceChild(o,l.copy(u))}(this.content,e+this.openStart,t,null);return i&&new zb(i,this.openStart,this.openEnd)},zb.prototype.removeBetween=function(e,t){return new zb(function e(t,i,n){var a=t.findIndex(i),r=a.index,o=a.offset,s=t.maybeChild(r),l=t.findIndex(n),u=l.index,_=l.offset;if(o==i||s.isText){if(_!=n&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,i).append(t.cut(n))}if(r!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(e(s.content,i-o-1,n-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},zb.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},zb.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},zb.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},zb.fromJSON=function(e,t){if(!t)return zb.empty;var i=t.openStart||0,n=t.openEnd||0;if("number"!=typeof i||"number"!=typeof n)throw new RangeError("Invalid input for Slice.fromJSON");return new zb(Ib.fromJSON(e,t.content),i,n)},zb.maxOpen=function(e,t){void 0===t&&(t=!0);for(var i=0,n=0,a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)i++;for(var r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)n++;return new zb(e,i,n)},Object.defineProperties(zb.prototype,Gb),zb.empty=new zb(Ib.empty,0,0);var Zb=function(e,t,i){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=i},Xb={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};Zb.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},Xb.parent.get=function(){return this.node(this.depth)},Xb.doc.get=function(){return this.node(0)},Zb.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},Zb.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},Zb.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},Zb.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},Zb.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},Zb.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},Zb.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},Xb.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Xb.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var i=this.pos-this.path[this.path.length-1],n=e.child(t);return i?e.child(t).cut(i):n},Xb.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},Zb.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var i=this.path[3*t],n=0==t?0:this.path[3*t-1]+1,a=0;a<e;a++)n+=i.child(a).nodeSize;return n},Zb.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return qb.none;if(this.textOffset)return e.child(t).marks;var i=e.maybeChild(t-1),n=e.maybeChild(t);if(!i){var a=i;i=n,n=a}for(var r=i.marks,o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||n&&r[o].isInSet(n.marks)||(r=r[o--].removeFromSet(r));return r},Zb.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var i=t.marks,n=e.parent.maybeChild(e.index()),a=0;a<i.length;a++)!1!==i[a].type.spec.inclusive||n&&i[a].isInSet(n.marks)||(i=i[a--].removeFromSet(i));return i},Zb.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},Zb.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new iE(this,e,i)},Zb.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},Zb.prototype.max=function(e){return e.pos>this.pos?e:this},Zb.prototype.min=function(e){return e.pos<this.pos?e:this},Zb.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},Zb.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var i=[],n=0,a=t,r=e;;){var o=r.content.findIndex(a),s=o.index,l=o.offset,u=a-l;if(i.push(r,s,n+l),!u)break;if((r=r.child(s)).isText)break;a=u-1,n+=l+1}return new Zb(t,i,a)},Zb.resolveCached=function(e,t){for(var i=0;i<Jb.length;i++){var n=Jb[i];if(n.pos==t&&n.doc==e)return n}var a=Jb[eE]=Zb.resolve(e,t);return eE=(eE+1)%tE,a},Object.defineProperties(Zb.prototype,Xb);var Jb=[],eE=0,tE=12,iE=function(e,t,i){this.$from=e,this.$to=t,this.depth=i},nE={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};nE.start.get=function(){return this.$from.before(this.depth+1)},nE.end.get=function(){return this.$to.after(this.depth+1)},nE.parent.get=function(){return this.$from.node(this.depth)},nE.startIndex.get=function(){return this.$from.index(this.depth)},nE.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(iE.prototype,nE);var aE=Object.create(null),rE=function(e,t,i,n){this.type=e,this.attrs=t,this.content=i||Ib.empty,this.marks=n||qb.none},oE={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};oE.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},oE.childCount.get=function(){return this.content.childCount},rE.prototype.child=function(e){return this.content.child(e)},rE.prototype.maybeChild=function(e){return this.content.maybeChild(e)},rE.prototype.forEach=function(e){this.content.forEach(e)},rE.prototype.nodesBetween=function(e,t,i,n){void 0===n&&(n=0),this.content.nodesBetween(e,t,i,n,this)},rE.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},oE.textContent.get=function(){return this.textBetween(0,this.content.size,"")},rE.prototype.textBetween=function(e,t,i,n){return this.content.textBetween(e,t,i,n)},oE.firstChild.get=function(){return this.content.firstChild},oE.lastChild.get=function(){return this.content.lastChild},rE.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},rE.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},rE.prototype.hasMarkup=function(e,t,i){return this.type==e&&jb(this.attrs,t||e.defaultAttrs||aE)&&qb.sameSet(this.marks,i||qb.none)},rE.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},rE.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},rE.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},rE.prototype.slice=function(e,t,i){if(void 0===t&&(t=this.content.size),void 0===i&&(i=!1),e==t)return zb.empty;var n=this.resolve(e),a=this.resolve(t),r=i?0:n.sharedDepth(t),o=n.start(r),s=n.node(r).content.cut(n.pos-o,a.pos-o);return new zb(s,n.depth-r,a.depth-r)},rE.prototype.replace=function(e,t,i){return Hb(this.resolve(e),this.resolve(t),i)},rE.prototype.nodeAt=function(e){for(var t=this;;){var i=t.content.findIndex(e),n=i.index,a=i.offset;if(!(t=t.maybeChild(n)))return null;if(a==e||t.isText)return t;e-=a+1}},rE.prototype.childAfter=function(e){var t=this.content.findIndex(e),i=t.index,n=t.offset;return{node:this.content.maybeChild(i),index:i,offset:n}},rE.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),i=t.index,n=t.offset;if(n<e)return{node:this.content.child(i),index:i,offset:n};var a=this.content.child(i-1);return{node:a,index:i-1,offset:n-a.nodeSize}},rE.prototype.resolve=function(e){return Zb.resolveCached(this,e)},rE.prototype.resolveNoCache=function(e){return Zb.resolve(this,e)},rE.prototype.rangeHasMark=function(e,t,i){var n=!1;return t>e&&this.nodesBetween(e,t,(function(e){return i.isInSet(e.marks)&&(n=!0),!n})),n},oE.isBlock.get=function(){return this.type.isBlock},oE.isTextblock.get=function(){return this.type.isTextblock},oE.inlineContent.get=function(){return this.type.inlineContent},oE.isInline.get=function(){return this.type.isInline},oE.isText.get=function(){return this.type.isText},oE.isLeaf.get=function(){return this.type.isLeaf},oE.isAtom.get=function(){return this.type.isAtom},rE.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),function(e,t){for(var i=e.length-1;i>=0;i--)t=e[i].type.name+"("+t+")";return t}(this.marks,e)},rE.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},rE.prototype.canReplace=function(e,t,i,n,a){void 0===i&&(i=Ib.empty),void 0===n&&(n=0),void 0===a&&(a=i.childCount);var r=this.contentMatchAt(e).matchFragment(i,n,a),o=r&&r.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(var s=n;s<a;s++)if(!this.type.allowsMarks(i.child(s).marks))return!1;return!0},rE.prototype.canReplaceWith=function(e,t,i,n){if(n&&!this.type.allowsMarks(n))return!1;var a=this.contentMatchAt(e).matchType(i),r=a&&a.matchFragment(this.content,t);return!!r&&r.validEnd},rE.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},rE.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var e=qb.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!qb.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(e){return e.type.name})));this.content.forEach((function(e){return e.check()}))},rE.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e},rE.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var i=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}var n=Ib.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,n,i)},Object.defineProperties(rE.prototype,oE);var sE=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},lE={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};sE.parse=function(e,t){var i=new uE(e,t);if(null==i.next)return sE.empty;var n=dE(i);i.next&&i.err("Unexpected trailing text");var a=function(e){var t=Object.create(null);return function i(n){var a=[];n.forEach((function(t){e[t].forEach((function(t){var i=t.term,n=t.to;if(i){var r=a.indexOf(i),o=r>-1&&a[r+1];mE(e,n).forEach((function(e){o||a.push(i,o=[]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var r=t[n.join(",")]=new sE(n.indexOf(e.length-1)>-1),o=0;o<a.length;o+=2){var s=a[o+1].sort(pE);r.next.push(a[o],t[s.join(",")]||i(s))}return r}(mE(e,0))}(function(e){var t=[[]];return a(function e(t,r){if("choice"==t.type)return t.exprs.reduce((function(t,i){return t.concat(e(i,r))}),[]);if("seq"==t.type)for(var o=0;;o++){var s=e(t.exprs[o],r);if(o==t.exprs.length-1)return s;a(s,r=i())}else{if("star"==t.type){var l=i();return n(r,l),a(e(t.expr,l),l),[n(l)]}if("plus"==t.type){var u=i();return a(e(t.expr,r),u),a(e(t.expr,u),u),[n(u)]}if("opt"==t.type)return[n(r)].concat(e(t.expr,r));if("range"==t.type){for(var _=r,d=0;d<t.min;d++){var c=i();a(e(t.expr,_),c),_=c}if(-1==t.max)a(e(t.expr,_),_);else for(var g=t.min;g<t.max;g++){var f=i();n(_,f),a(e(t.expr,_),f),_=f}return[n(_)]}if("name"==t.type)return[n(r,null,t.value)]}}(e,0),i()),t;function i(){return t.push([])-1}function n(e,i,n){var a={term:n,to:i};return t[e].push(a),a}function a(e,t){e.forEach((function(e){return e.to=t}))}}(n));return function(e,t){for(var i=0,n=[e];i<n.length;i++){for(var a=n[i],r=!a.validEnd,o=[],s=0;s<a.next.length;s+=2){var l=a.next[s],u=a.next[s+1];o.push(l.name),!r||l.isText||l.hasRequiredAttrs()||(r=!1),-1==n.indexOf(u)&&n.push(u)}r&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(a,i),a},sE.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},sE.prototype.matchFragment=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.childCount);for(var n=this,a=t;n&&a<i;a++)n=n.matchType(e.child(a).type);return n},lE.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},lE.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},sE.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var i=0;i<e.next.length;i+=2)if(this.next[t]==e.next[i])return!0;return!1},sE.prototype.fillBefore=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=0);var n=[this];return function a(r,o){var s=r.matchFragment(e,i);if(s&&(!t||s.validEnd))return Ib.from(o.map((function(e){return e.createAndFill()})));for(var l=0;l<r.next.length;l+=2){var u=r.next[l],_=r.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==n.indexOf(_)){n.push(_);var d=a(_,o.concat(u));if(d)return d}}}(this,[])},sE.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var i=this.computeWrapping(e);return this.wrapCache.push(e,i),i},sE.prototype.computeWrapping=function(e){for(var t=Object.create(null),i=[{match:this,type:null,via:null}];i.length;){var n=i.shift(),a=n.match;if(a.matchType(e)){for(var r=[],o=n;o.type;o=o.via)r.push(o.type);return r.reverse()}for(var s=0;s<a.next.length;s+=2){var l=a.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||n.type&&!a.next[s+1].validEnd||(i.push({match:l.contentMatch,type:l,via:n}),t[l.name]=!0)}}},lE.edgeCount.get=function(){return this.next.length>>1},sE.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},sE.prototype.toString=function(){var e=[];return function t(i){e.push(i);for(var n=1;n<i.next.length;n+=2)-1==e.indexOf(i.next[n])&&t(i.next[n])}(this),e.map((function(t,i){for(var n=i+(t.validEnd?"*":" ")+" ",a=0;a<t.next.length;a+=2)n+=(a?", ":"")+t.next[a].name+"->"+e.indexOf(t.next[a+1]);return n})).join("\n")},Object.defineProperties(sE.prototype,lE),sE.empty=new sE(!0);var uE=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},_E={next:{configurable:!0}};function dE(e){var t=[];do{t.push(cE(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function cE(e){var t=[];do{t.push(gE(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function gE(e){for(var t=function(e){if(e.eat("(")){var t=dE(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var i=function(e,t){var i=e.nodeTypes,n=i[t];if(n)return[n];var a=[];for(var r in i){var o=i[r];o.groups.indexOf(t)>-1&&a.push(o)}0==a.length&&e.err("No node type or group '"+t+"' found");return a}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==i.length?i[0]:{type:"choice",exprs:i}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=hE(e,t)}return t}function fE(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function hE(e,t){var i=fE(e),n=i;return e.eat(",")&&(n="}"!=e.next?fE(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:i,max:n,expr:t}}function pE(e,t){return t-e}function mE(e,t){var i=[];return function t(n){var a=e[n];if(1==a.length&&!a[0].term)return t(a[0].to);i.push(n);for(var r=0;r<a.length;r++){var o=a[r],s=o.term,l=o.to;s||-1!=i.indexOf(l)||t(l)}}(t),i.sort(pE)}function FE(e){var t=Object.create(null);for(var i in e){var n=e[i];if(!n.hasDefault)return null;t[i]=n.default}return t}function bE(e,t){var i=Object.create(null);for(var n in e){var a=t&&t[n];if(void 0===a){var r=e[n];if(!r.hasDefault)throw new RangeError("No value supplied for attribute "+n);a=r.default}i[n]=a}return i}function EE(e){var t=Object.create(null);if(e)for(var i in e)t[i]=new vE(e[i]);return t}_E.next.get=function(){return this.tokens[this.pos]},uE.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},uE.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(uE.prototype,_E);var yE=function(e,t,i){this.name=e,this.schema=t,this.spec=i,this.groups=i.group?i.group.split(" "):[],this.attrs=EE(i.attrs),this.defaultAttrs=FE(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(i.inline||"text"==e),this.isText="text"==e},DE={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};DE.isInline.get=function(){return!this.isBlock},DE.isTextblock.get=function(){return this.isBlock&&this.inlineContent},DE.isLeaf.get=function(){return this.contentMatch==sE.empty},DE.isAtom.get=function(){return this.isLeaf||this.spec.atom},yE.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},yE.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},yE.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:bE(this.attrs,e)},yE.prototype.create=function(e,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new rE(this,this.computeAttrs(e),Ib.from(t),qb.setFrom(i))},yE.prototype.createChecked=function(e,t,i){if(t=Ib.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new rE(this,this.computeAttrs(e),t,qb.setFrom(i))},yE.prototype.createAndFill=function(e,t,i){if(e=this.computeAttrs(e),(t=Ib.from(t)).size){var n=this.contentMatch.fillBefore(t);if(!n)return null;t=n.append(t)}var a=this.contentMatch.matchFragment(t).fillBefore(Ib.empty,!0);return a?new rE(this,e,t.append(a),qb.setFrom(i)):null},yE.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0},yE.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},yE.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},yE.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:qb.empty:e},yE.compile=function(e,t){var i=Object.create(null);e.forEach((function(e,n){return i[e]=new yE(e,t,n)}));var n=t.spec.topNode||"doc";if(!i[n])throw new RangeError("Schema is missing its top node type ('"+n+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(var a in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i},Object.defineProperties(yE.prototype,DE);var vE=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},kE={isRequired:{configurable:!0}};kE.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(vE.prototype,kE);var SE=function(e,t,i,n){this.name=e,this.schema=i,this.spec=n,this.attrs=EE(n.attrs),this.rank=t,this.excluded=null;var a=FE(this.attrs);this.instance=a&&new qb(this,a)};SE.prototype.create=function(e){return!e&&this.instance?this.instance:new qb(this,bE(this.attrs,e))},SE.compile=function(e,t){var i=Object.create(null),n=0;return e.forEach((function(e,a){return i[e]=new SE(e,n++,t,a)})),i},SE.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e},SE.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},SE.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var wE={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},CE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},xE={ol:!0,ul:!0};function TE(e){return(e?1:0)|("full"===e?2:0)}var OE=function(e,t,i,n,a,r,o){this.type=e,this.attrs=t,this.solid=a,this.match=r||(4&o?null:e.contentMatch),this.options=o,this.content=[],this.marks=i,this.activeMarks=qb.none,this.pendingMarks=n,this.stashMarks=[]};OE.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(Ib.from(e));if(!t){var i,n=this.type.contentMatch;return(i=n.findWrapping(e.type))?(this.match=n,i):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},OE.prototype.finish=function(e){if(!(1&this.options)){var t,i=this.content[this.content.length-1];i&&i.isText&&(t=/[ \t\r\n\u000c]+$/.exec(i.text))&&(i.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-t[0].length)))}var n=Ib.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Ib.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n},OE.prototype.popFromStashMark=function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]},OE.prototype.applyPending=function(e){for(var t=0,i=this.pendingMarks;t<i.length;t++){var n=i[t];(this.type?this.type.allowsMarkType(n.type):RE(n.type,e))&&!n.isInSet(this.activeMarks)&&(this.activeMarks=n.addToSet(this.activeMarks),this.pendingMarks=n.removeFromSet(this.pendingMarks))}},OE.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!wE.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var NE=function(e,t,i){this.parser=e,this.options=t,this.isOpen=i;var n,a=t.topNode,r=TE(t.preserveWhitespace)|(i?4:0);n=a?new OE(a.type,a.attrs,qb.none,qb.none,!0,t.topMatch||a.type.contentMatch,r):new OE(i?null:e.schema.topNodeType,null,qb.none,qb.none,!0,null,r),this.nodes=[n],this.open=0,this.find=t.findPositions,this.needsBlock=!1},AE={top:{configurable:!0},currentPos:{configurable:!0}};function RE(e,t){var i=t.schema.nodes,n=function(n){var a=i[n];if(a.allowsMarkType(e)){var r=[],o=function(e){r.push(e);for(var i=0;i<e.edgeCount;i++){var n=e.edge(i),a=n.type,s=n.next;if(a==t)return!0;if(r.indexOf(s)<0&&o(s))return!0}};return o(a.contentMatch)?{v:!0}:void 0}};for(var a in i){var r=n(a);if(r)return r.v}}AE.top.get=function(){return this.nodes[this.open]},NE.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),i=t?this.readStyles(function(e){var t,i=/\s*([\w-]+)\s*:\s*([^;]+)/g,n=[];for(;t=i.exec(e);)n.push(t[1],t[2].trim());return n}(t)):null,n=this.top;if(null!=i)for(var a=0;a<i.length;a++)this.addPendingMark(i[a]);if(this.addElement(e),null!=i)for(var r=0;r<i.length;r++)this.removePendingMark(i[r],n)}},NE.prototype.addTextNode=function(e){var t=e.nodeValue,i=this.top;if(2&i.options||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&i.options)t=2&i.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var n=i.content[i.content.length-1],a=e.previousSibling;(!n||a&&"BR"==a.nodeName||n.isText&&/[ \t\r\n\u000c]$/.test(n.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},NE.prototype.addElement=function(e,t){var i,n=e.nodeName.toLowerCase();xE.hasOwnProperty(n)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,i=null;t;t=t.nextSibling){var n=1==t.nodeType?t.nodeName.toLowerCase():null;n&&xE.hasOwnProperty(n)&&i?(i.appendChild(t),t=i):"li"==n?i=t:n&&(i=null)}}(e);var a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(a?a.ignore:CE.hasOwnProperty(n))this.findInside(e),this.ignoreFallback(e);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);var r,o=this.top,s=this.needsBlock;if(wE.hasOwnProperty(n))r=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),r&&this.sync(o),this.needsBlock=s}else this.addElementByRule(e,a,!1===a.consuming?i:null)},NE.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},NE.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},NE.prototype.readStyles=function(e){var t=qb.none;e:for(var i=0;i<e.length;i+=2)for(var n=null;;){var a=this.parser.matchStyle(e[i],e[i+1],this,n);if(!a)continue e;if(a.ignore)return null;if(t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),!1!==a.consuming)break;n=a}return t},NE.prototype.addElementByRule=function(e,t,i){var n,a,r,o=this;t.node?(a=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(a.create(t.attrs))||this.leafFallback(e):n=this.enter(a,t.attrs,t.preserveWhitespace):(r=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(r));var s=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return o.insertNode(e)}));else{var l=t.contentElement;"string"==typeof l?l=e.querySelector(l):"function"==typeof l&&(l=l(e)),l||(l=e),this.findAround(e,l,!0),this.addAll(l,n)}n&&(this.sync(s),this.open--),r&&this.removePendingMark(r,s)},NE.prototype.addAll=function(e,t,i,n){for(var a=i||0,r=i?e.childNodes[i]:e.firstChild,o=null==n?null:e.childNodes[n];r!=o;r=r.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(r),t&&wE.hasOwnProperty(r.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,a)},NE.prototype.findPlace=function(e){for(var t,i,n=this.open;n>=0;n--){var a=this.nodes[n],r=a.findWrapping(e);if(r&&(!t||t.length>r.length)&&(t=r,i=a,!r.length))break;if(a.solid)break}if(!t)return!1;this.sync(i);for(var o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0},NE.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var i=this.top;i.applyPending(e.type),i.match&&(i.match=i.match.matchType(e.type));for(var n=i.activeMarks,a=0;a<e.marks.length;a++)i.type&&!i.type.allowsMarkType(e.marks[a].type)||(n=e.marks[a].addToSet(n));return i.content.push(e.mark(n)),!0}return!1},NE.prototype.enter=function(e,t,i){var n=this.findPlace(e.create(t));return n&&this.enterInner(e,t,!0,i),n},NE.prototype.enterInner=function(e,t,i,n){this.closeExtra();var a=this.top;a.applyPending(e),a.match=a.match&&a.match.matchType(e,t);var r=null==n?-5&a.options:TE(n);4&a.options&&0==a.content.length&&(r|=4),this.nodes.push(new OE(e,t,a.activeMarks,a.pendingMarks,i,null,r)),this.open++},NE.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},NE.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},NE.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},AE.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var i=this.nodes[t].content,n=i.length-1;n>=0;n--)e+=i[n].nodeSize;t&&e++}return e},NE.prototype.findAtPoint=function(e,t){if(this.find)for(var i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==t&&(this.find[i].pos=this.currentPos)},NE.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},NE.prototype.findAround=function(e,t,i){if(e!=t&&this.find)for(var n=0;n<this.find.length;n++){if(null==this.find[n].pos&&1==e.nodeType&&e.contains(this.find[n].node))t.compareDocumentPosition(this.find[n].node)&(i?2:4)&&(this.find[n].pos=this.currentPos)}},NE.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},NE.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var i=e.split("/"),n=this.options.context,a=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),r=-(n?n.depth+1:0)+(a?0:1),o=function(e,s){for(;e>=0;e--){var l=i[e];if(""==l){if(e==i.length-1||0==e)continue;for(;s>=r;s--)if(o(e-1,s))return!0;return!1}var u=s>0||0==s&&a?t.nodes[s].type:n&&s>=r?n.node(s-r).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0};return o(i.length-1,this.open)},NE.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var i=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(var n in this.parser.schema.nodes){var a=this.parser.schema.nodes[n];if(a.isTextblock&&a.defaultAttrs)return a}},NE.prototype.addPendingMark=function(e){var t=function(e,t){for(var i=0;i<t.length;i++)if(e.eq(t[i]))return t[i]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},NE.prototype.removePendingMark=function(e,t){for(var i=this.open;i>=0;i--){var n=this.nodes[i];if(n.pendingMarks.lastIndexOf(e)>-1)n.pendingMarks=e.removeFromSet(n.pendingMarks);else{n.activeMarks=e.removeFromSet(n.activeMarks);var a=n.popFromStashMark(e);a&&n.type&&n.type.allowsMarkType(a.type)&&(n.activeMarks=a.addToSet(n.activeMarks))}if(n==t)break}},Object.defineProperties(NE.prototype,AE);var ME=Math.pow(2,16);function IE(e){return 65535&e}var BE=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null),this.pos=e,this.deleted=t,this.recover=i},LE=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};LE.prototype.recover=function(e){var t=0,i=IE(e);if(!this.inverted)for(var n=0;n<i;n++)t+=this.ranges[3*n+2]-this.ranges[3*n+1];return this.ranges[3*i]+t+function(e){return(e-(65535&e))/ME}(e)},LE.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},LE.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},LE.prototype._map=function(e,t,i){for(var n=0,a=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?n:0);if(s>e)break;var l=this.ranges[o+a],u=this.ranges[o+r],_=s+l;if(e<=_){var d=s+n+((l?e==s?-1:e==_?1:t:t)<0?0:u);if(i)return d;var c=e==(t<0?s:_)?null:o/3+(e-s)*ME;return new BE(d,t<0?e!=s:e!=_,c)}n+=u-l}return i?e+n:new BE(e+n)},LE.prototype.touches=function(e,t){for(var i=0,n=IE(t),a=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?i:0);if(s>e)break;var l=this.ranges[o+a];if(e<=s+l&&o==3*n)return!0;i+=this.ranges[o+r]-l}return!1},LE.prototype.forEach=function(e){for(var t=this.inverted?2:1,i=this.inverted?1:2,n=0,a=0;n<this.ranges.length;n+=3){var r=this.ranges[n],o=r-(this.inverted?a:0),s=r+(this.inverted?0:a),l=this.ranges[n+t],u=this.ranges[n+i];e(o,o+l,s,s+u),a+=u-l}},LE.prototype.invert=function(){return new LE(this.ranges,!this.inverted)},LE.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},LE.offset=function(e){return 0==e?LE.empty:new LE(e<0?[0,-e,0]:[0,0,e])},LE.empty=new LE([]);var PE=function(e,t,i,n){this.maps=e||[],this.from=i||0,this.to=null==n?this.maps.length:n,this.mirror=t};function jE(e){var t=Error.call(this,e);return t.__proto__=jE.prototype,t}PE.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new PE(this.maps,this.mirror,e,t)},PE.prototype.copy=function(){return new PE(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},PE.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},PE.prototype.appendMapping=function(e){for(var t=0,i=this.maps.length;t<e.maps.length;t++){var n=e.getMirror(t);this.appendMap(e.maps[t],null!=n&&n<t?i+n:null)}},PE.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},PE.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},PE.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,i=this.maps.length+e.maps.length;t>=0;t--){var n=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=n&&n>t?i-n-1:null)}},PE.prototype.invert=function(){var e=new PE;return e.appendMappingInverted(this),e},PE.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var i=this.from;i<this.to;i++)e=this.maps[i].map(e,t);return e},PE.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},PE.prototype._map=function(e,t,i){for(var n=!1,a=this.from;a<this.to;a++){var r=this.maps[a].mapResult(e,t);if(null!=r.recover){var o=this.getMirror(a);if(null!=o&&o>a&&o<this.to){a=o,e=this.maps[o].recover(r.recover);continue}}r.deleted&&(n=!0),e=r.pos}return i?e:new BE(e,n)},jE.prototype=Object.create(Error.prototype),jE.prototype.constructor=jE,jE.prototype.name="TransformError";var qE=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new PE},UE={before:{configurable:!0},docChanged:{configurable:!0}};function zE(){throw new Error("Override me")}UE.before.get=function(){return this.docs.length?this.docs[0]:this.doc},qE.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new jE(t.failed);return this},qE.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},UE.docChanged.get=function(){return this.steps.length>0},qE.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(qE.prototype,UE);var GE=Object.create(null),HE=function(){};HE.prototype.apply=function(e){return zE()},HE.prototype.getMap=function(){return LE.empty},HE.prototype.invert=function(e){return zE()},HE.prototype.map=function(e){return zE()},HE.prototype.merge=function(e){return null},HE.prototype.toJSON=function(){return zE()},HE.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var i=GE[t.stepType];if(!i)throw new RangeError("No step type "+t.stepType+" defined");return i.fromJSON(e,t)},HE.jsonID=function(e,t){if(e in GE)throw new RangeError("Duplicate use of step JSON ID "+e);return GE[e]=t,t.prototype.jsonID=e,t};var YE=function(e,t){this.doc=e,this.failed=t};YE.ok=function(e){return new YE(e,null)},YE.fail=function(e){return new YE(null,e)},YE.fromReplace=function(e,t,i,n){try{return YE.ok(e.replace(t,i,n))}catch(e){if(e instanceof Ub)return YE.fail(e.message);throw e}};var VE=function(e){function t(t,i,n,a){e.call(this),this.from=t,this.to=i,this.slice=n,this.structure=!!a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&$E(e,this.from,this.to)?YE.fail("Structure replace would overwrite content"):YE.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new LE([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var i=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return i.deleted&&n.deleted?null:new t(i.pos,Math.max(i.pos,n.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var i=this.slice.size+e.slice.size==0?zb.empty:new zb(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,i,this.structure)}var n=this.slice.size+e.slice.size==0?zb.empty:new zb(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),n,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(i.from,i.to,zb.fromJSON(e,i.slice),!!i.structure)},t}(HE);HE.jsonID("replace",VE);var WE=function(e){function t(t,i,n,a,r,o,s){e.call(this),this.from=t,this.to=i,this.gapFrom=n,this.gapTo=a,this.slice=r,this.insert=o,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&($E(e,this.from,this.gapFrom)||$E(e,this.gapTo,this.to)))return YE.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return YE.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,t.content);return i?YE.fromReplace(e,this.from,this.to,i):YE.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new LE([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var i=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+i,this.from+this.insert,this.from+this.insert+i,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),a=e.map(this.gapFrom,-1),r=e.map(this.gapTo,1);return i.deleted&&n.deleted||a<i.pos||r>n.pos?null:new t(i.pos,n.pos,a,r,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to||"number"!=typeof i.gapFrom||"number"!=typeof i.gapTo||"number"!=typeof i.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(i.from,i.to,i.gapFrom,i.gapTo,zb.fromJSON(e,i.slice),i.insert,!!i.structure)},t}(HE);function $E(e,t,i){for(var n=e.resolve(t),a=i-t,r=n.depth;a>0&&r>0&&n.indexAfter(r)==n.node(r).childCount;)r--,a--;if(a>0)for(var o=n.node(r).maybeChild(n.indexAfter(r));a>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,a--}return!1}function KE(e,t,i){for(var n=[],a=0;a<e.childCount;a++){var r=e.child(a);r.content.size&&(r=r.copy(KE(r.content,t,r))),r.isInline&&(r=t(r,i,a)),n.push(r)}return Ib.fromArray(n)}HE.jsonID("replaceAround",WE),qE.prototype.lift=function(e,t){for(var i=e.$from,n=e.$to,a=e.depth,r=i.before(a+1),o=n.after(a+1),s=r,l=o,u=Ib.empty,_=0,d=a,c=!1;d>t;d--)c||i.index(d)>0?(c=!0,u=Ib.from(i.node(d).copy(u)),_++):s--;for(var g=Ib.empty,f=0,h=a,p=!1;h>t;h--)p||n.after(h+1)<n.end(h)?(p=!0,g=Ib.from(n.node(h).copy(g)),f++):l++;return this.step(new WE(s,l,r,o,new zb(u.append(g),_,f),u.size-_,!0))},qE.prototype.wrap=function(e,t){for(var i=Ib.empty,n=t.length-1;n>=0;n--)i=Ib.from(t[n].type.create(t[n].attrs,i));var a=e.start,r=e.end;return this.step(new WE(a,r,a,r,new zb(i,0,0),t.length,!0))},qE.prototype.setBlockType=function(e,t,i,n){var a=this;if(void 0===t&&(t=e),!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var r=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(i,n)&&function(e,t,i){var n=e.resolve(t),a=n.index();return n.parent.canReplaceWith(a,a+1,i)}(a.doc,a.mapping.slice(r).map(t),i)){a.clearIncompatible(a.mapping.slice(r).map(t,1),i);var o=a.mapping.slice(r),s=o.map(t,1),l=o.map(t+e.nodeSize,1);return a.step(new WE(s,l,s+1,l-1,new zb(Ib.from(i.create(n,null,e.marks)),0,0),1,!0)),!1}})),this},qE.prototype.setNodeMarkup=function(e,t,i,n){var a=this.doc.nodeAt(e);if(!a)throw new RangeError("No node at given position");t||(t=a.type);var r=t.create(i,null,n||a.marks);if(a.isLeaf)return this.replaceWith(e,e+a.nodeSize,r);if(!t.validContent(a.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new WE(e,e+a.nodeSize,e+1,e+a.nodeSize-1,new zb(Ib.from(r),0,0),1,!0))},qE.prototype.split=function(e,t,i){void 0===t&&(t=1);for(var n=this.doc.resolve(e),a=Ib.empty,r=Ib.empty,o=n.depth,s=n.depth-t,l=t-1;o>s;o--,l--){a=Ib.from(n.node(o).copy(a));var u=i&&i[l];r=Ib.from(u?u.type.create(u.attrs,r):n.node(o).copy(r))}return this.step(new VE(e,e,new zb(a.append(r),t,t),!0))},qE.prototype.join=function(e,t){void 0===t&&(t=1);var i=new VE(e-t,e+t,zb.empty,!0);return this.step(i)};var QE=function(e){function t(t,i,n){e.call(this),this.from=t,this.to=i,this.mark=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),n=e.resolve(this.from),a=n.node(n.sharedDepth(this.to)),r=new zb(KE(i.content,(function(e,i){return e.isAtom&&i.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),a),i.openStart,i.openEnd);return YE.fromReplace(e,this.from,this.to,r)},t.prototype.invert=function(){return new ZE(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return i.deleted&&n.deleted||i.pos>=n.pos?null:new t(i.pos,n.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(HE);HE.jsonID("addMark",QE);var ZE=function(e){function t(t,i,n){e.call(this),this.from=t,this.to=i,this.mark=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),n=new zb(KE(i.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),i.openStart,i.openEnd);return YE.fromReplace(e,this.from,this.to,n)},t.prototype.invert=function(){return new QE(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return i.deleted&&n.deleted||i.pos>=n.pos?null:new t(i.pos,n.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(HE);function XE(e,t,i){return!i.openStart&&!i.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),i.content)}HE.jsonID("removeMark",ZE),qE.prototype.addMark=function(e,t,i){var n=this,a=[],r=[],o=null,s=null;return this.doc.nodesBetween(e,t,(function(n,l,u){if(n.isInline){var _=n.marks;if(!i.isInSet(_)&&u.type.allowsMarkType(i.type)){for(var d=Math.max(l,e),c=Math.min(l+n.nodeSize,t),g=i.addToSet(_),f=0;f<_.length;f++)_[f].isInSet(g)||(o&&o.to==d&&o.mark.eq(_[f])?o.to=c:a.push(o=new ZE(d,c,_[f])));s&&s.to==d?s.to=c:r.push(s=new QE(d,c,i))}}})),a.forEach((function(e){return n.step(e)})),r.forEach((function(e){return n.step(e)})),this},qE.prototype.removeMark=function(e,t,i){var n=this;void 0===i&&(i=null);var a=[],r=0;return this.doc.nodesBetween(e,t,(function(n,o){if(n.isInline){r++;var s=null;if(i instanceof SE)for(var l,u=n.marks;l=i.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else i?i.isInSet(n.marks)&&(s=[i]):s=n.marks;if(s&&s.length)for(var _=Math.min(o+n.nodeSize,t),d=0;d<s.length;d++){for(var c=s[d],g=void 0,f=0;f<a.length;f++){var h=a[f];h.step==r-1&&c.eq(a[f].style)&&(g=h)}g?(g.to=_,g.step=r):a.push({style:c,from:Math.max(o,e),to:_,step:r})}}})),a.forEach((function(e){return n.step(new ZE(e.from,e.to,e.style))})),this},qE.prototype.clearIncompatible=function(e,t,i){void 0===i&&(i=t.contentMatch);for(var n=this.doc.nodeAt(e),a=[],r=e+1,o=0;o<n.childCount;o++){var s=n.child(o),l=r+s.nodeSize,u=i.matchType(s.type,s.attrs);if(u){i=u;for(var _=0;_<s.marks.length;_++)t.allowsMarkType(s.marks[_].type)||this.step(new ZE(r,l,s.marks[_]))}else a.push(new VE(r,l,zb.empty));r=l}if(!i.validEnd){var d=i.fillBefore(Ib.empty,!0);this.replace(r,r,new zb(d,0,0))}for(var c=a.length-1;c>=0;c--)this.step(a[c]);return this},qE.prototype.replace=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=zb.empty);var n=function(e,t,i,n){if(void 0===i&&(i=t),void 0===n&&(n=zb.empty),t==i&&!n.size)return null;var a=e.resolve(t),r=e.resolve(i);return XE(a,r,n)?new VE(t,i,n):new JE(a,r,n).fit()}(this.doc,e,t,i);return n&&this.step(n),this},qE.prototype.replaceWith=function(e,t,i){return this.replace(e,t,new zb(Ib.from(i),0,0))},qE.prototype.delete=function(e,t){return this.replace(e,t,zb.empty)},qE.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var JE=function(e,t,i){this.$to=t,this.$from=e,this.unplaced=i,this.frontier=[];for(var n=0;n<=e.depth;n++){var a=e.node(n);this.frontier.push({type:a.type,match:a.contentMatchAt(e.indexAfter(n))})}this.placed=Ib.empty;for(var r=e.depth;r>0;r--)this.placed=Ib.from(e.node(r).copy(this.placed))},ey={depth:{configurable:!0}};function ty(e,t,i){return 0==t?e.cutByIndex(i):e.replaceChild(0,e.firstChild.copy(ty(e.firstChild.content,t-1,i)))}function iy(e,t,i){return 0==t?e.append(i):e.replaceChild(e.childCount-1,e.lastChild.copy(iy(e.lastChild.content,t-1,i)))}function ny(e,t){for(var i=0;i<t;i++)e=e.firstChild.content;return e}function ay(e,t,i){if(t<=0)return e;var n=e.content;return t>1&&(n=n.replaceChild(0,ay(n.firstChild,t-1,1==n.childCount?i-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),i<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(Ib.empty,!0)))),e.copy(n)}function ry(e,t,i,n,a){var r=e.node(t),o=a?e.indexAfter(t):e.index(t);if(o==r.childCount&&!i.compatibleContent(r.type))return null;var s=n.fillBefore(r.content,!0,o);return s&&!function(e,t,i){for(var n=i;n<t.childCount;n++)if(!e.allowsMarks(t.child(n).marks))return!0;return!1}(i,r.content,o)?s:null}function oy(e,t,i,n,a){if(t<i){var r=e.firstChild;e=e.replaceChild(0,r.copy(oy(r.content,t+1,i,n,r)))}if(t>n){var o=a.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(Ib.empty,!0))}return e}function sy(e,t){for(var i=[],n=Math.min(e.depth,t.depth);n>=0;n--){var a=e.start(n);if(a<e.pos-(e.depth-n)||t.end(n)>t.pos+(t.depth-n)||e.node(n).type.spec.isolating||t.node(n).type.spec.isolating)break;(a==t.start(n)||n==e.depth&&n==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&n&&t.start(n-1)==a-1)&&i.push(n)}return i}ey.depth.get=function(){return this.frontier.length-1},JE.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),i=this.placed.size-this.depth-this.$from.depth,n=this.$from,a=this.close(t<0?this.$to:n.doc.resolve(t));if(!a)return null;for(var r=this.placed,o=n.depth,s=a.depth;o&&s&&1==r.childCount;)r=r.firstChild.content,o--,s--;var l=new zb(r,o,s);return t>-1?new WE(n.pos,t,this.$to.pos,this.$to.end(),l,i):l.size||n.pos!=this.$to.pos?new VE(n.pos,a.pos,l):void 0},JE.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var i=void 0,n=(t?(i=ny(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,a=this.depth;a>=0;a--){var r=this.frontier[a],o=r.type,s=r.match,l=void 0,u=void 0;if(1==e&&(n?s.matchType(n.type)||(u=s.fillBefore(Ib.from(n),!1)):o.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:a,parent:i,inject:u};if(2==e&&n&&(l=s.findWrapping(n.type)))return{sliceDepth:t,frontierDepth:a,parent:i,wrap:l};if(i&&s.matchType(i.type))break}},JE.prototype.openMore=function(){var e=this.unplaced,t=e.content,i=e.openStart,n=e.openEnd,a=ny(t,i);return!(!a.childCount||a.firstChild.isLeaf)&&(this.unplaced=new zb(t,i+1,Math.max(n,a.size+i>=t.size-n?i+1:0)),!0)},JE.prototype.dropNode=function(){var e=this.unplaced,t=e.content,i=e.openStart,n=e.openEnd,a=ny(t,i);if(a.childCount<=1&&i>0){var r=t.size-i<=i+a.size;this.unplaced=new zb(ty(t,i-1,1),i-1,r?i-1:n)}else this.unplaced=new zb(ty(t,i,1),i,n)},JE.prototype.placeNodes=function(e){for(var t=e.sliceDepth,i=e.frontierDepth,n=e.parent,a=e.inject,r=e.wrap;this.depth>i;)this.closeFrontierNode();if(r)for(var o=0;o<r.length;o++)this.openFrontierNode(r[o]);var s=this.unplaced,l=n?n.content:s.content,u=s.openStart-t,_=0,d=[],c=this.frontier[i],g=c.match,f=c.type;if(a){for(var h=0;h<a.childCount;h++)d.push(a.child(h));g=g.matchFragment(a)}for(var p=l.size+t-(s.content.size-s.openEnd);_<l.childCount;){var m=l.child(_),F=g.matchType(m.type);if(!F)break;(++_>1||0==u||m.content.size)&&(g=F,d.push(ay(m.mark(f.allowedMarks(m.marks)),1==_?u:0,_==l.childCount?p:-1)))}var b=_==l.childCount;b||(p=-1),this.placed=iy(this.placed,i,Ib.from(d)),this.frontier[i].match=g,b&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var E=0,y=l;E<p;E++){var D=y.lastChild;this.frontier.push({type:D.type,match:D.contentMatchAt(D.childCount)}),y=D.content}this.unplaced=b?0==t?zb.empty:new zb(ty(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new zb(ty(s.content,t,_),s.openStart,s.openEnd)},JE.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!ry(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var i=this.$to.depth,n=this.$to.after(i);i>1&&n==this.$to.end(--i);)++n;return n},JE.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var i=this.frontier[t],n=i.match,a=i.type,r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=ry(e,t,a,n,r);if(o){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,_=ry(e,s,l.type,u,!0);if(!_||_.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}},JE.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=iy(this.placed,t.depth,t.fit)),e=t.move;for(var i=t.depth+1;i<=e.depth;i++){var n=e.node(i),a=n.type.contentMatch.fillBefore(n.content,!0,e.index(i));this.openFrontierNode(n.type,n.attrs,a)}return e},JE.prototype.openFrontierNode=function(e,t,i){var n=this.frontier[this.depth];n.match=n.match.matchType(e),this.placed=iy(this.placed,this.depth,Ib.from(e.create(t,i))),this.frontier.push({type:e,match:e.contentMatch})},JE.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(Ib.empty,!0);e.childCount&&(this.placed=iy(this.placed,this.frontier.length,e))},Object.defineProperties(JE.prototype,ey),qE.prototype.replaceRange=function(e,t,i){if(!i.size)return this.deleteRange(e,t);var n=this.doc.resolve(e),a=this.doc.resolve(t);if(XE(n,a,i))return this.step(new VE(e,t,i));var r=sy(n,this.doc.resolve(t));0==r[r.length-1]&&r.pop();var o=-(n.depth+1);r.unshift(o);for(var s=n.depth,l=n.pos-1;s>0;s--,l--){var u=n.node(s).type.spec;if(u.defining||u.isolating)break;r.indexOf(s)>-1?o=s:n.before(s)==l&&r.splice(1,0,-s)}for(var _=r.indexOf(o),d=[],c=i.openStart,g=i.content,f=0;;f++){var h=g.firstChild;if(d.push(h),f==i.openStart)break;g=h.content}c>0&&d[c-1].type.spec.defining&&n.node(_).type!=d[c-1].type?c-=1:c>=2&&d[c-1].isTextblock&&d[c-2].type.spec.defining&&n.node(_).type!=d[c-2].type&&(c-=2);for(var p=i.openStart;p>=0;p--){var m=(p+c+1)%(i.openStart+1),F=d[m];if(F)for(var b=0;b<r.length;b++){var E=r[(b+_)%r.length],y=!0;E<0&&(y=!1,E=-E);var D=n.node(E-1),v=n.index(E-1);if(D.canReplaceWith(v,v,F.type,F.marks))return this.replace(n.before(E),y?a.after(E):t,new zb(oy(i.content,0,i.openStart,m),m,i.openEnd))}}for(var k=this.steps.length,S=r.length-1;S>=0&&(this.replace(e,t,i),!(this.steps.length>k));S--){var w=r[S];w<0||(e=n.before(w),t=a.after(w))}return this},qE.prototype.replaceRangeWith=function(e,t,i){if(!i.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var n=function(e,t,i){var n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),i))return t;if(0==n.parentOffset)for(var a=n.depth-1;a>=0;a--){var r=n.index(a);if(n.node(a).canReplaceWith(r,r,i))return n.before(a+1);if(r>0)return null}if(n.parentOffset==n.parent.content.size)for(var o=n.depth-1;o>=0;o--){var s=n.indexAfter(o);if(n.node(o).canReplaceWith(s,s,i))return n.after(o+1);if(s<n.node(o).childCount)return null}}(this.doc,e,i.type);null!=n&&(e=t=n)}return this.replaceRange(e,t,new zb(Ib.from(i),0,0))},qE.prototype.deleteRange=function(e,t){for(var i=this.doc.resolve(e),n=this.doc.resolve(t),a=sy(i,n),r=0;r<a.length;r++){var o=a[r],s=r==a.length-1;if(s&&0==o||i.node(o).type.contentMatch.validEnd)return this.delete(i.start(o),n.end(o));if(o>0&&(s||i.node(o-1).canReplace(i.index(o-1),n.indexAfter(o-1))))return this.delete(i.before(o),n.after(o))}for(var l=1;l<=i.depth&&l<=n.depth;l++)if(e-i.start(l)==i.depth-l&&t>i.end(l)&&n.end(l)-t!=n.depth-l)return this.delete(i.before(l),t);return this.delete(e,t)};var ly=Object.create(null),uy=function(e,t,i){this.ranges=i||[new dy(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},_y={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};_y.anchor.get=function(){return this.$anchor.pos},_y.head.get=function(){return this.$head.pos},_y.from.get=function(){return this.$from.pos},_y.to.get=function(){return this.$to.pos},_y.$from.get=function(){return this.ranges[0].$from},_y.$to.get=function(){return this.ranges[0].$to},_y.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},uy.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},uy.prototype.replace=function(e,t){void 0===t&&(t=zb.empty);for(var i=t.content.lastChild,n=null,a=0;a<t.openEnd;a++)n=i,i=i.lastChild;for(var r=e.steps.length,o=this.ranges,s=0;s<o.length;s++){var l=o[s],u=l.$from,_=l.$to,d=e.mapping.slice(r);e.replaceRange(d.map(u.pos),d.map(_.pos),s?zb.empty:t),0==s&&by(e,r,(i?i.isInline:n&&n.isTextblock)?-1:1)}},uy.prototype.replaceWith=function(e,t){for(var i=e.steps.length,n=this.ranges,a=0;a<n.length;a++){var r=n[a],o=r.$from,s=r.$to,l=e.mapping.slice(i),u=l.map(o.pos),_=l.map(s.pos);a?e.deleteRange(u,_):(e.replaceRangeWith(u,_,t),by(e,i,t.isInline?-1:1))}},uy.findFrom=function(e,t,i){var n=e.parent.inlineContent?new cy(e):Fy(e.node(0),e.parent,e.pos,e.index(),t,i);if(n)return n;for(var a=e.depth-1;a>=0;a--){var r=t<0?Fy(e.node(0),e.node(a),e.before(a+1),e.index(a),t,i):Fy(e.node(0),e.node(a),e.after(a+1),e.index(a)+1,t,i);if(r)return r}},uy.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new py(e.node(0))},uy.atStart=function(e){return Fy(e,e,0,0,1)||new py(e)},uy.atEnd=function(e){return Fy(e,e,e.content.size,e.childCount,-1)||new py(e)},uy.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var i=ly[t.type];if(!i)throw new RangeError("No selection type "+t.type+" defined");return i.fromJSON(e,t)},uy.jsonID=function(e,t){if(e in ly)throw new RangeError("Duplicate use of selection JSON ID "+e);return ly[e]=t,t.prototype.jsonID=e,t},uy.prototype.getBookmark=function(){return cy.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(uy.prototype,_y),uy.prototype.visible=!0;var dy=function(e,t){this.$from=e,this.$to=t},cy=function(e){function t(t,i){void 0===i&&(i=t),e.call(this,t,i)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={$cursor:{configurable:!0}};return i.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(i,n){var a=i.resolve(n.map(this.head));if(!a.parent.inlineContent)return e.near(a);var r=i.resolve(n.map(this.anchor));return new t(r.parent.inlineContent?r:a,a)},t.prototype.replace=function(t,i){if(void 0===i&&(i=zb.empty),e.prototype.replace.call(this,t,i),i==zb.empty){var n=this.$from.marksAcross(this.$to);n&&t.ensureMarks(n)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new gy(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.anchor||"number"!=typeof i.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(i.anchor),e.resolve(i.head))},t.create=function(e,t,i){void 0===i&&(i=t);var n=e.resolve(t);return new this(n,i==t?n:e.resolve(i))},t.between=function(i,n,a){var r=i.pos-n.pos;if(a&&!r||(a=r>=0?1:-1),!n.parent.inlineContent){var o=e.findFrom(n,a,!0)||e.findFrom(n,-a,!0);if(!o)return e.near(n,a);n=o.$head}return i.parent.inlineContent||(0==r||(i=(e.findFrom(i,-a,!0)||e.findFrom(i,a,!0)).$anchor).pos<n.pos!=r<0)&&(i=n),new t(i,n)},Object.defineProperties(t.prototype,i),t}(uy);uy.jsonID("text",cy);var gy=function(e,t){this.anchor=e,this.head=t};gy.prototype.map=function(e){return new gy(e.map(this.anchor),e.map(this.head))},gy.prototype.resolve=function(e){return cy.between(e.resolve(this.anchor),e.resolve(this.head))};var fy=function(e){function t(t){var i=t.nodeAfter,n=t.node(0).resolve(t.pos+i.nodeSize);e.call(this,t,n),this.node=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,n){var a=n.mapResult(this.anchor),r=a.deleted,o=a.pos,s=i.resolve(o);return r?e.near(s):new t(s)},t.prototype.content=function(){return new zb(Ib.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new hy(this.anchor)},t.fromJSON=function(e,i){if("number"!=typeof i.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(i.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(uy);fy.prototype.visible=!1,uy.jsonID("node",fy);var hy=function(e){this.anchor=e};hy.prototype.map=function(e){var t=e.mapResult(this.anchor),i=t.deleted,n=t.pos;return i?new gy(n,n):new hy(n)},hy.prototype.resolve=function(e){var t=e.resolve(this.anchor),i=t.nodeAfter;return i&&fy.isSelectable(i)?new fy(t):uy.near(t)};var py=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,i){if(void 0===i&&(i=zb.empty),i==zb.empty){t.delete(0,t.doc.content.size);var n=e.atStart(t.doc);n.eq(t.selection)||t.setSelection(n)}else e.prototype.replace.call(this,t,i)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return my},t}(uy);uy.jsonID("all",py);var my={map:function(){return this},resolve:function(e){return new py(e)}};function Fy(e,t,i,n,a,r){if(t.inlineContent)return cy.create(e,i);for(var o=n-(a>0?0:1);a>0?o<t.childCount:o>=0;o+=a){var s=t.child(o);if(s.isAtom){if(!r&&fy.isSelectable(s))return fy.create(e,i-(a<0?s.nodeSize:0))}else{var l=Fy(e,s,i+a,a<0?s.childCount:0,a,r);if(l)return l}i+=s.nodeSize*a}}function by(e,t,i){var n=e.steps.length-1;if(!(n<t)){var a,r=e.steps[n];if(r instanceof VE||r instanceof WE)e.mapping.maps[n].forEach((function(e,t,i,n){null==a&&(a=n)})),e.setSelection(uy.near(e.doc.resolve(a),i))}}var Ey=function(e){function t(t){e.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)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return i.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(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},i.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return qb.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},i.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,i){e.prototype.addStep.call(this,t,i),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var i=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||qb.none))),i.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,i){void 0===i&&(i=t);var n=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(n.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,i);var a=this.storedMarks;if(!a){var r=this.doc.resolve(t);a=i==t?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(t,i,n.text(e,a)),this.selection.empty||this.setSelection(uy.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},i.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},i.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,i),t}(qE);function yy(e,t){return t&&e?e.bind(t):e}var Dy=function(e,t,i){this.name=e,this.init=yy(t.init,i),this.apply=yy(t.apply,i)},vy=[new Dy("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new Dy("selection",{init:function(e,t){return e.selection||uy.atStart(t.doc)},apply:function(e){return e.selection}}),new Dy("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,i,n){return n.selection.$cursor?e.storedMarks:null}}),new Dy("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],ky=function(e,t){var i=this;this.schema=e,this.fields=vy.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(i.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");i.plugins.push(e),i.pluginsByKey[e.key]=e,e.spec.state&&i.fields.push(new Dy(e.key,e.spec.state,e))}))},Sy=function(e){this.config=e},wy={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};wy.schema.get=function(){return this.config.schema},wy.plugins.get=function(){return this.config.plugins},Sy.prototype.apply=function(e){return this.applyTransaction(e).state},Sy.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var i=0;i<this.config.plugins.length;i++)if(i!=t){var n=this.config.plugins[i];if(n.spec.filterTransaction&&!n.spec.filterTransaction.call(n,e,this))return!1}return!0},Sy.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],i=this.applyInner(e),n=null;;){for(var a=!1,r=0;r<this.config.plugins.length;r++){var o=this.config.plugins[r];if(o.spec.appendTransaction){var s=n?n[r].n:0,l=n?n[r].state:this,u=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,l,i);if(u&&i.filterTransaction(u,r)){if(u.setMeta("appendedTransaction",e),!n){n=[];for(var _=0;_<this.config.plugins.length;_++)n.push(_<r?{state:i,n:t.length}:{state:this,n:0})}t.push(u),i=i.applyInner(u),a=!0}n&&(n[r]={state:i,n:t.length})}}if(!a)return{state:i,transactions:t}}},Sy.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new Sy(this.config),i=this.config.fields,n=0;n<i.length;n++){var a=i[n];t[a.name]=a.apply(e,this[a.name],this,t)}for(var r=0;r<Cy.length;r++)Cy[r](this,e,t);return t},wy.tr.get=function(){return new Ey(this)},Sy.create=function(e){for(var t=new ky(e.doc?e.doc.type.schema:e.schema,e.plugins),i=new Sy(t),n=0;n<t.fields.length;n++)i[t.fields[n].name]=t.fields[n].init(e,i);return i},Sy.prototype.reconfigure=function(e){for(var t=new ky(this.schema,e.plugins),i=t.fields,n=new Sy(t),a=0;a<i.length;a++){var r=i[a].name;n[r]=this.hasOwnProperty(r)?this[r]:i[a].init(e,n)}return n},Sy.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var i in e){if("doc"==i||"selection"==i)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var n=e[i],a=n.spec.state;a&&a.toJSON&&(t[i]=a.toJSON.call(n,this[n.key]))}return t},Sy.fromJSON=function(e,t,i){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var n=new ky(e.schema,e.plugins),a=new Sy(n);return n.fields.forEach((function(n){if("doc"==n.name)a.doc=rE.fromJSON(e.schema,t.doc);else if("selection"==n.name)a.selection=uy.fromJSON(a.doc,t.selection);else if("storedMarks"==n.name)t.storedMarks&&(a.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(i)for(var r in i){var o=i[r],s=o.spec.state;if(o.key==n.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(a[n.name]=s.fromJSON.call(o,e,t[r],a))}a[n.name]=n.init(e,a)}})),a},Sy.addApplyListener=function(e){Cy.push(e)},Sy.removeApplyListener=function(e){var t=Cy.indexOf(e);t>-1&&Cy.splice(t,1)},Object.defineProperties(Sy.prototype,wy);var Cy=[];var xy=function(e){this.props={},e.props&&function e(t,i,n){for(var a in t){var r=t[a];r instanceof Function?r=r.bind(i):"handleDOMEvents"==a&&(r=e(r,i,{})),n[a]=r}return n}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:Oy("plugin")};xy.prototype.getState=function(e){return e[this.key]};var Ty=Object.create(null);function Oy(e){return e in Ty?e+"$"+ ++Ty[e]:(Ty[e]=0,e+"$")}var Ny=function(e){void 0===e&&(e="key"),this.key=Oy(e)};Ny.prototype.get=function(e){return e.config.pluginsByKey[this.key]},Ny.prototype.getState=function(e){return e[this.key]};const Ay=mr.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter(e=>""!==e).length}},addProseMirrorPlugins(){return[new xy({key:new Ny("characterCount"),filterTransaction:(e,t)=>{const i=this.options.limit;if(!e.docChanged||0===i||null==i)return!0;const n=this.storage.characters({node:t.doc}),a=this.storage.characters({node:e.doc});if(a<=i)return!0;if(n>i&&a>i&&a<=n)return!0;if(n>i&&a>i&&a>n)return!1;if(!e.getMeta("paste"))return!1;const r=e.selection.$head.pos,o=r-(a-i),s=r;e.deleteRange(o,s);return!(this.storage.characters({node:e.doc})>i)}})]}});var Ry=i(52);const My=gs.create({name:"link",priority:1e3,inclusive:!1,addOptions:()=>({openOnClick:!0,linkOnPaste:!0,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target}}},parseHTML:()=>[{tag:"a[href]"}],renderHTML({HTMLAttributes:e}){return["a",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setLink:e=>({commands:t})=>t.setMark("link",e),toggleLink:e=>({commands:t})=>t.toggleMark("link",e,{extendEmptyMarkRange:!0}),unsetLink:()=>({commands:e})=>e.unsetMark("link",{extendEmptyMarkRange:!0})}),addPasteRules(){return[Es({find:e=>Object(Ry.find)(e).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.openOnClick&&e.push(new Rt({key:new Bt("handleClickLink"),props:{handleClick:(e,t,i)=>{var n;const a=this.editor.getAttributes("link");return!(!(null===(n=i.target)||void 0===n?void 0:n.closest("a"))||!a.href)&&(window.open(a.href,a.target),!0)}}})),this.options.linkOnPaste&&e.push(new Rt({key:new Bt("handlePasteLink"),props:{handlePaste:(e,t,i)=>{const{state:n}=e,{selection:a}=n,{empty:r}=a;if(r)return!1;let o="";i.content.forEach(e=>{o+=e.textContent});const s=Object(Ry.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),Iy=gs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",as(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const i=po(e,this.type);return!!Object.entries(i).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),By=mr.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>e.style.color.replace(/['"]+/g,""),renderHTML:e=>e.color?{style:"color: "+e.color}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})});var Ly=cs.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Rt({key:new Bt("eventHandler"),props:{handleClick:function(t,i){var n=t.state,a=n.doc.lastChild,r=n.doc.resolve(i).nodeBefore;if(a&&r){var o=a.eq(r),s=a.isInline,l=["paragraph","text"].includes(a.type.name);!o||s||l||e.commands.insertContentAt(i,{type:"paragraph",content:""})}}}})]}}),Py=xF.extend({name:"title",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return[{tag:"h1"}]},renderHTML:function(e){e.node;var t=e.HTMLAttributes;return["h1",as(this.options.HTMLAttributes,t),0]}});const jy=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,qy=cs.create({name:"image",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML:()=>[{tag:"img[src]"}],renderHTML({HTMLAttributes:e}){return["img",as(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[fs({find:jy,type:this.type,getAttributes:e=>{const[,,t,i,n]=e;return{src:i,alt:t,title:n}}})]}});function Uy(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function zy(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Uy(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Uy(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Gy=qy.extend({name:"image",addAttributes:function(){return zy(zy({},qy.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(i){var n,a,r,o=i.tr,s=i.commands;return"image"==(null===(n=o.selection)||void 0===n||null===(a=n.node)||void 0===a||null===(r=a.type)||void 0===r?void 0:r.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}}}},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return i.class=" image-"+t.attrs.size,i.class+=" image-float-"+t.attrs.float,["img",as(this.options.HTMLAttributes,i)]}});const Hy=gs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",as(this.options.HTMLAttributes,e),0]},addCommands:()=>({setUnderline:()=>({commands:e})=>e.setMark("underline"),toggleUnderline:()=>({commands:e})=>e.toggleMark("underline"),unsetUnderline:()=>({commands:e})=>e.unsetMark("underline")}),addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});const Yy=new Bt("suggestion");function Vy({pluginKey:e=Yy,editor:t,char:i="@",allowSpaces:n=!1,prefixSpace:a=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:_=(()=>({})),allow:d=(()=>!0)}){const c=null==_?void 0:_();return new Rt({key:e,view(){return{update:async(e,i)=>{var n,a,r,o,s;const _=null===(n=this.key)||void 0===n?void 0:n.getState(i),d=null===(a=this.key)||void 0===a?void 0:a.getState(e.state),g=_.active&&d.active&&_.range.from!==d.range.from,f=!_.active&&d.active,h=_.active&&!d.active,p=f||g,m=!f&&!h&&_.query!==d.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?_:d,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:_}=l,c={...o};if(c.composing=s,u||t.view.composing){!(_<o.range.from||_>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:n,startOfLine:a,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=a?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),_=r.depth<=0?0:r.before(),d=r.pos,c=r.doc.textBetween(_,d,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(n&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:n,prefixSpace:a,startOfLine:r,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(c.active=!0,c.decorationId=o.decorationId?o.decorationId:u,c.range=e.range,c.query=e.query,c.text=e.text):c.active=!1}else c.active=!1;return c.active||(c.decorationId=null,c.range={},c.query=null,c.text=null),c}},props:{handleKeyDown(e,t){var i;const{active:n,range:a}=this.getState(e.state);return n&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:a}))||!1},decorations(e){const{active:t,range:i,decorationId:n}=this.getState(e);return t?Ma.create(e.doc,[Oa.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":n})]):null}}})}var Wy=function(e){var t=e.wrapperRef,i=e.index;if(t.current&&!(i>=t.current.children.length)){var n=t.current,a=n.children[i],r=a.clientHeight+8,o=n.scrollTop;a.offsetTop+r>o+n.clientHeight?o=a.offsetTop-n.clientHeight+r:o>a.offsetTop&&(o=a.offsetTop-8),t.current.scrollTop=o}};function $y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Bf()(e);if(t){var a=Bf()(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Mf()(this,i)}}var Ky=function(e){Af()(i,e);var t=$y(i);function i(e){var n;return wf()(this,i),n=t.call(this,e),d()(Of()(n),"onKeyDown",(function(e){var t=e.event;return"ArrowUp"===t.key?(n.upHandler(),!0):"ArrowDown"===t.key?(n.downHandler(),!0):"Enter"===t.key&&(n.enterHandler(),!0)})),d()(Of()(n),"upHandler",(function(){n.setState({selectedIndex:(n.state.selectedIndex+n.props.items.length-1)%n.props.items.length})})),d()(Of()(n),"downHandler",(function(){n.setState({selectedIndex:(n.state.selectedIndex+1)%n.props.items.length})})),d()(Of()(n),"enterHandler",(function(){n.selectItem(n.state.selectedIndex)})),d()(Of()(n),"selectItem",(function(e){var t=n.props.items[e];if(t&&f_(t.items)){var i=n.props,a=i.editor,r=i.range;t.command({editor:a,range:r})}})),n.state={selectedIndex:0},n.menuRef=m.a.createRef(),n}return xf()(i,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),Wy({wrapperRef:this.menuRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.props.items;return m.a.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},t.map((function(t,n){var a=f_(t.items),r=m.a.createElement(Qy,{key:t.title,item:t,index:n,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(n)}});return a?r:m.a.createElement(ic,{key:t.title,interactive:!0,placement:"right",hideOnClick:!1,content:m.a.createElement(i,u()({},e.props,{items:t.items})),onCreate:function(e){return e.popper.style.width="max-content"}},r)})))}}]),i}(m.a.Component),Qy=Object(p.forwardRef)((function(e,t){var i=e.item,n=e.selectedIndex,a=e.index,r=e.selectItem,o=i.Icon;return m.a.createElement("div",{className:b()("neeto-editor-slash-commands__item",{active:a===n}),onClick:function(){return r(a)},ref:t,"data-cy":"neeto-editor-command-list-item-".concat(a)},o&&m.a.createElement(o,{size:20}),m.a.createElement("div",{className:"neeto-editor-slash-commands__item-content"},m.a.createElement("h5",null,i.title),m.a.createElement("p",null,i.description)))})),Zy=Ky,Xy=["size","color","strokeWidth"];function Jy(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,Xy);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M13 4.5H20M13 9.5H20M4 14.5H20M4 19.5H20M9 9.5L6.5 4.5L4 9.5M4.5 8.5H6.5H8.5",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}Jy.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Jy.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var eD=["size","color","strokeWidth"];function tD(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,eD);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M5 6V18M13 6V18M5 12H13M18.5 18V13L17.25 14.25M20 18H17",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}tD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},tD.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var iD=["size","color","strokeWidth"];function nD(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,iD);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M17 14C17 13.7348 17.1054 13.4804 17.2929 13.2929C17.4804 13.1054 17.7348 13 18 13H18.6145C18.8723 13 19.1237 13.0811 19.3329 13.2319C19.542 13.3827 19.6985 13.5955 19.78 13.8401C19.8471 14.0414 19.8609 14.2566 19.8202 14.4648C19.7794 14.673 19.6854 14.8671 19.5473 15.0281L17 18H20M5 6V18M13 6V18M5 12H13",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}nD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},nD.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var aD=["size","color","strokeWidth"];function rD(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,aD);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M20.667 20.125H3.33301M20.667 14.708H3.33301M20.667 9.292H16.334M20.667 3.875H16.334M9.29201 6.042H12C12.299 6.042 12.542 6.285 12.542 6.584V8.75C12.542 9.049 12.299 9.292 12 9.292H9.83301C9.53401 9.292 9.29101 9.049 9.29101 8.75L9.29201 6.042ZM9.29201 6.042C9.29201 3.875 9.69801 3.515 10.917 2.792M3.33301 6.042H6.04101C6.34001 6.042 6.58301 6.285 6.58301 6.584V8.75C6.58301 9.049 6.34001 9.292 6.04101 9.292H3.87501C3.57601 9.292 3.33301 9.049 3.33301 8.75V6.042ZM3.33301 6.042C3.33301 3.875 3.73901 3.515 4.95801 2.792",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}rD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},rD.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var oD=["size","color","strokeWidth"];function sD(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,oD);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M17 12H7",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}sD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},sD.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var lD=["size","color","strokeWidth"];function uD(e){var t=e.size,i=e.color,n=e.strokeWidth,a=p_(e,lD);return J_.createElement("svg",h_({viewBox:"0 0 24 24",fill:"none",height:t,width:t},a),J_.createElement("path",{d:"M15.375 13.097L19.17 16.151C19.906 16.744 21 16.22 21 15.275V8.725C21 7.78 19.906 7.256 19.17 7.849L15.375 10.903M13.125 17.75H5.25C4.007 17.75 3 16.743 3 15.5V8.5C3 7.257 4.007 6.25 5.25 6.25H13.125C14.368 6.25 15.375 7.257 15.375 8.5V15.5C15.375 16.743 14.368 17.75 13.125 17.75Z",stroke:i,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}))}uD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},uD.propTypes={color:Cd.string,size:Cd.oneOfType([Cd.string,Cd.number]),strokeWidth:Cd.oneOfType([Cd.string,Cd.number])};var _D={PARAGRAPH:{optionName:om.FONT_SIZE,title:"Paragraph",description:"Add a plain text block.",Icon:Jy,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("paragraph").run()}},H1:{optionName:om.FONT_SIZE,title:"H1",description:"Add a big heading.",Icon:tD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:1}).run()}},H2:{optionName:om.FONT_SIZE,title:"H2",description:"Add a sub-heading.",Icon:nD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:2}).run()}},LIST_ORDERED:{optionName:om.LIST_ORDERED,title:"Numbered list",description:"Add a list with numbering.",Icon:eg,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleOrderedList().run()}},LIST_BULLETS:{optionName:om.LIST_BULLETS,title:"Bulleted list",description:"Add an list bullets.",Icon:Xc,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBulletList().run()}},BLOCKQUOTE:{optionName:om.BLOCKQUOTE,title:"Blockquote",description:"Add a quote.",Icon:rD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBlockquote().run()}},IMAGE:{optionName:om.IMAGE_UPLOAD,title:"Image",description:"Add an image.",Icon:Qc,command:function(e){var t=e.editor,i=e.range;return t.chain().focus().deleteRange(i).run()}},CODE:{optionName:om.CODE_BLOCK,title:"Code block",description:"Add a code block with syntax highlighting.",Icon:jd,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleCodeBlock().run()}},EMOJI:{optionName:om.EMOJI,title:"Emoji",description:"Add an emoji.",Icon:kf,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("::").run()}},DIVIDER:{optionName:om.DIVIDER,title:"Divider",description:"Add an horizontal line to separate sections.",Icon:sD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setHorizontalRule().run()}},VIDEO:{optionName:om.VIDEO_EMBED,title:"Embed Youtube/Vimeo",description:"Embed a video from major services.",Icon:uD,command:function(e){var t,i=e.editor,n=e.range,a=prompt("Please enter Youtube/Vimeo embed URL."),r=(t=a.match(zc))&&"https://www.youtube.com/embed/".concat(t[5])||function(e){var t=e.match(Gc);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])}(a);r?i.chain().focus().deleteRange(n).setExternalVideo({src:r}).run():i.chain().focus().deleteRange(n).insertContent("#invalid").run()}},MENTION:{optionName:om.MENTION,title:"Mention",description:"Mention a user.",Icon:sf,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("@").run()}},NO_RESULT:{title:"No results",command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).run()}}};function dD(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function cD(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?dD(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dD(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var gD=new Bt("commands"),fD=function(e){var t=e.setImageUploadVisible,i=e.mentions,n=e.addonCommands,a=e.options,r=[_D.PARAGRAPH,_D.H1,_D.H2,_D.LIST_ORDERED,_D.LIST_BULLETS,_D.BLOCKQUOTE,cD(cD({},_D.IMAGE),{},{command:function(){var e;t(!0),(e=_D.IMAGE).command.apply(e,arguments)}}),_D.CODE,_D.EMOJI,_D.DIVIDER,_D.VIDEO];return f_(i)||r.push(_D.MENTION),f_(a)||(r=r.filter((function(e){var t=e.optionName;return a.includes(t)}))),f_(n)||(r=r.concat(n)),mr.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:gD,command:function(e){var t=e.editor,i=e.range;e.props.command({editor:t,range:i})},items:function(e){var t=e.query,i=r.filter((function(e){return e.title.toLowerCase().includes(t.toLowerCase())}));return f_(i)?[_D.NO_RESULT]:i},render:function(){var e,t;return{onStart:function(i){e=new Tu(Zy,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t&&t[0].destroy(),e&&e.destroy()}}}}}},addProseMirrorPlugins:function(){return[Vy(cD({editor:this.editor},this.options.suggestion))]}})},hD={};function pD(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var i=e[t];"object"!=typeof i||Object.isFrozen(i)||pD(i)})),e}var mD=pD,FD=pD;mD.default=FD;class bD{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ED(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function yD(e,...t){const i=Object.create(null);for(const t in e)i[t]=e[t];return t.forEach((function(e){for(const t in e)i[t]=e[t]})),i}const DD=e=>!!e.kind;class vD{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=ED(e)}openNode(e){if(!DD(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){DD(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class kD{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{kD._collapse(e)}))}}class SD extends kD{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const i=e.root;i.kind=t,i.sublanguage=!0,this.add(i)}toHTML(){return new vD(this,this.options).value()}finalize(){return!0}}function wD(e){return e?"string"==typeof e?e:e.source:null}const CD=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const xD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",TD={begin:"\\\\[\\s\\S]",relevance:0},OD={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[TD]},ND={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[TD]},AD={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},RD=function(e,t,i={}){const n=yD({className:"comment",begin:e,end:t,contains:[]},i);return n.contains.push(AD),n.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),n},MD=RD("//","$"),ID=RD("/\\*","\\*/"),BD=RD("#","$"),LD={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},PD={className:"number",begin:xD,relevance:0},jD={className:"number",begin:"\\b(0b[01]+)",relevance:0},qD={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},UD={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[TD,{begin:/\[/,end:/\]/,relevance:0,contains:[TD]}]}]},zD={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},GD={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},HD={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var YD=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:xD,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>wD(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),yD({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:TD,APOS_STRING_MODE:OD,QUOTE_STRING_MODE:ND,PHRASAL_WORDS_MODE:AD,COMMENT:RD,C_LINE_COMMENT_MODE:MD,C_BLOCK_COMMENT_MODE:ID,HASH_COMMENT_MODE:BD,NUMBER_MODE:LD,C_NUMBER_MODE:PD,BINARY_NUMBER_MODE:jD,CSS_NUMBER_MODE:qD,REGEXP_MODE:UD,TITLE_MODE:zD,UNDERSCORE_TITLE_MODE:GD,METHOD_GUARD:HD,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function VD(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function WD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=VD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function $D(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>wD(e)).join("|")+")"}(...e.illegal))}function KD(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function QD(e,t){void 0===e.relevance&&(e.relevance=1)}const ZD=["of","and","for","in","not","or","if","then","parent","list","value"];function XD(e,t){return t?Number(t):function(e){return ZD.includes(e.toLowerCase())}(e)?0:1}function JD(e,{plugins:t}){function i(t,i){return new RegExp(wD(t),"m"+(e.case_insensitive?"i":"")+(i?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=i(function(e,t="|"){let i=0;return e.map(e=>{i+=1;const t=i;let n=wD(e),a="";for(;n.length>0;){const e=CD.exec(n);if(!e){a+=n;break}a+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?a+="\\"+String(Number(e[1])+t):(a+=e[0],"("===e[0]&&i++)}return a}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex((e,t)=>t>0&&void 0!==e),n=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,n)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,i])=>t.addRule(e,i)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=yD(e.classNameAliases||{}),function t(n,r){const o=n;if(n.isCompiled)return o;[KD].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[WD,$D,QD].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;if("object"==typeof n.keywords&&(s=n.keywords.$pattern,delete n.keywords.$pattern),n.keywords&&(n.keywords=function e(t,i,n="keyword"){const a={};return"string"==typeof t?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach((function(n){Object.assign(a,e(t[n],i,n))})),a;function r(e,t){i&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const i=t.split("|");a[i[0]]=[e,XD(i[0],i[1])]}))}}(n.keywords,e.case_insensitive)),n.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||n.lexemes||/\w+/,o.keywordPatternRe=i(s,!0),r&&(n.begin||(n.begin=/\B|\b/),o.beginRe=i(n.begin),n.endSameAsBegin&&(n.end=n.begin),n.end||n.endsWithParent||(n.end=/\B|\b/),n.end&&(o.endRe=i(n.end)),o.terminatorEnd=wD(n.end)||"",n.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(n.end?"|":"")+r.terminatorEnd)),n.illegal&&(o.illegalRe=i(n.illegal)),n.contains||(n.contains=[]),n.contains=[].concat(...n.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return yD(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return yD(e,{starts:e.starts?yD(e.starts):null});if(Object.isFrozen(e))return yD(e);return e}("self"===e?n:e)}))),n.contains.forEach((function(e){t(e,o)})),n.starts&&t(n.starts,r),o.matcher=function(e){const t=new a;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function ev(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,ED(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const tv={"after:highlightElement":({el:e,result:t,text:i})=>{const n=nv(e);if(!n.length)return;const a=document.createElement("div");a.innerHTML=t.value,t.value=function(e,t,i){let n=0,a="";const r=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){a+="<"+iv(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+ED(e.value)+'"'})).join("")+">"}function l(e){a+="</"+iv(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(a+=ED(i.substring(n,t[0].offset)),n=t[0].offset,t===e){r.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===n);r.reverse().forEach(s)}else"start"===t[0].event?r.push(t[0].node):r.pop(),u(t.splice(0,1)[0])}return a+ED(i.substr(n))}(n,nv(a),i)}};function iv(e){return e.nodeName.toLowerCase()}function nv(e){const t=[];return function e(i,n){for(let a=i.firstChild;a;a=a.nextSibling)3===a.nodeType?n+=a.nodeValue.length:1===a.nodeType&&(t.push({event:"start",offset:n,node:a}),n=e(a,n),iv(a).match(/br|hr|img|input/)||t.push({event:"stop",offset:n,node:a}));return n}(e,0),t}const av={},rv=e=>{console.error(e)},ov=(e,...t)=>{console.log("WARN: "+e,...t)},sv=(e,t)=>{av[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),av[`${e}/${t}`]=!0)},lv=ED,uv=yD,_v=Symbol("nomatch");var dv=function(e){const t=Object.create(null),i=Object.create(null),n=[];let a=!0;const r=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:SD};function u(e){return l.noHighlightRe.test(e)}function _(e,t,i,n){let a="",r="";"object"==typeof t?(a=e,i=t.ignoreIllegals,r=t.language,n=void 0):(sv("10.7.0","highlight(lang, code, ...args) has been deprecated."),sv("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,a=t);const o={code:a,language:r};v("before:highlight",o);const s=o.result?o.result:d(o.language,o.code,i,n);return s.code=o.code,v("after:highlight",s),s}function d(e,i,r,s){function u(e,t){const i=b.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,i)&&e.keywords[i]}function _(){null!=v.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof v.subLanguage){if(!t[v.subLanguage])return void S.addText(w);e=d(v.subLanguage,w,!0,k[v.subLanguage]),k[v.subLanguage]=e.top}else e=c(w,v.subLanguage.length?v.subLanguage:null);v.relevance>0&&(C+=e.relevance),S.addSublanguage(e.emitter,e.language)}():function(){if(!v.keywords)return void S.addText(w);let e=0;v.keywordPatternRe.lastIndex=0;let t=v.keywordPatternRe.exec(w),i="";for(;t;){i+=w.substring(e,t.index);const n=u(v,t);if(n){const[e,a]=n;if(S.addText(i),i="",C+=a,e.startsWith("_"))i+=t[0];else{const i=b.classNameAliases[e]||e;S.addKeyword(t[0],i)}}else i+=t[0];e=v.keywordPatternRe.lastIndex,t=v.keywordPatternRe.exec(w)}i+=w.substr(e),S.addText(i)}(),w=""}function g(e){return e.className&&S.openNode(b.classNameAliases[e.className]||e.className),v=Object.create(e,{parent:{value:v}}),v}function f(e){return 0===v.matcher.regexIndex?(w+=e[0],1):(O=!0,0)}function h(e){const t=e[0],i=e.rule,n=new bD(i),a=[i.__beforeBegin,i["on:begin"]];for(const i of a)if(i&&(i(e,n),n.isMatchIgnored))return f(t);return i&&i.endSameAsBegin&&(i.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),i.skip?w+=t:(i.excludeBegin&&(w+=t),_(),i.returnBegin||i.excludeBegin||(w=t)),g(i),i.returnBegin?0:t.length}function p(e){const t=e[0],n=i.substr(e.index),a=function e(t,i,n){let a=function(e,t){const i=e&&e.exec(t);return i&&0===i.index}(t.endRe,n);if(a){if(t["on:end"]){const e=new bD(t);t["on:end"](i,e),e.isMatchIgnored&&(a=!1)}if(a){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,i,n)}(v,e,n);if(!a)return _v;const r=v;r.skip?w+=t:(r.returnEnd||r.excludeEnd||(w+=t),_(),r.excludeEnd&&(w=t));do{v.className&&S.closeNode(),v.skip||v.subLanguage||(C+=v.relevance),v=v.parent}while(v!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.endRe=a.endRe),g(a.starts)),r.returnEnd?0:t.length}let m={};function F(t,n){const o=n&&n[0];if(w+=t,null==o)return _(),0;if("begin"===m.type&&"end"===n.type&&m.index===n.index&&""===o){if(w+=i.slice(n.index,n.index+1),!a){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=n,"begin"===n.type)return h(n);if("illegal"===n.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(v.className||"<unnamed>")+'"');throw e.mode=v,e}if("end"===n.type){const e=p(n);if(e!==_v)return e}if("illegal"===n.type&&""===o)return 1;if(T>1e5&&T>3*n.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=E(e);if(!b)throw rv(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const y=JD(b,{plugins:n});let D="",v=s||y;const k={},S=new l.__emitter(l);!function(){const e=[];for(let t=v;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>S.openNode(e))}();let w="",C=0,x=0,T=0,O=!1;try{for(v.matcher.considerAll();;){T++,O?O=!1:v.matcher.considerAll(),v.matcher.lastIndex=x;const e=v.matcher.exec(i);if(!e)break;const t=F(i.substring(x,e.index),e);x=e.index+t}return F(i.substr(x)),S.closeAllNodes(),S.finalize(),D=S.toHTML(),{relevance:Math.floor(C),value:D,language:e,illegal:!1,emitter:S,top:v}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:i.slice(x-100,x+100),mode:t.mode},sofar:D,relevance:0,value:lv(i),emitter:S};if(a)return{illegal:!1,relevance:0,value:lv(i),emitter:S,language:e,top:v,errorRaised:t};throw t}}function c(e,i){i=i||l.languages||Object.keys(t);const n=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:lv(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),a=i.filter(E).filter(D).map(t=>d(t,e,!1));a.unshift(n);const r=a.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(E(e.language).supersetOf===t.language)return 1;if(E(t.language).supersetOf===e.language)return-1}return 0}),[o,u]=r,_=o;return _.second_best=u,_}const g={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},f=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(f,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=l.languageDetectRe.exec(t);if(i){const t=E(i[1]);return t||(ov(o.replace("{}",i[1])),ov("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||E(e))}(e);if(u(n))return;v("before:highlightElement",{el:e,language:n}),t=e;const a=t.textContent,r=n?_(a,{language:n,ignoreIllegals:!0}):c(a);v("after:highlightElement",{el:e,result:r,text:a}),e.innerHTML=r.value,function(e,t,n){const a=t?i[t]:n;e.classList.add("hljs"),a&&e.classList.add(a)}(e,n,r.language),e.result={language:r.language,re:r.relevance,relavance:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance,relavance:r.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,sv("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(p)};let F=!1;function b(){if("loading"===document.readyState)return void(F=!0);document.querySelectorAll("pre code").forEach(p)}function E(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function y(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function D(e){const t=E(e);return t&&!t.disableAutodetect}function v(e,t){const i=e;n.forEach((function(e){e[i]&&e[i](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){F&&b()}),!1),Object.assign(e,{highlight:_,highlightAuto:c,highlightAll:b,fixMarkup:function(e){return sv("10.2.0","fixMarkup will be removed entirely in v11.0"),sv("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(r,e=>"\n"===e?l.useBR?"<br>":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:p,highlightBlock:function(e){return sv("10.7.0","highlightBlock will be removed entirely in v12.0"),sv("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(sv("10.3.0","'useBR' will be removed entirely in v11.0"),sv("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=uv(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){sv("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(i,n){let r=null;try{r=n(e)}catch(e){if(rv("Language definition for '{}' could not be registered.".replace("{}",i)),!a)throw e;rv(e),r=s}r.name||(r.name=i),t[i]=r,r.rawDefinition=n.bind(null,e),r.aliases&&y(r.aliases,{languageName:i})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(i))i[t]===e&&delete i[t]},listLanguages:function(){return Object.keys(t)},getLanguage:E,registerAliases:y,requireLanguage:function(e){sv("10.4.0","requireLanguage will be removed entirely in v11."),sv("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=E(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:D,inherit:uv,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),n.push(e)},vuePlugin:ev(e).VuePlugin}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="10.7.3";for(const e in YD)"object"==typeof YD[e]&&mD(YD[e]);return Object.assign(e,YD),e.addPlugin(g),e.addPlugin(tv),e.addPlugin(h),e}({}),cv={exports:{}};!function(e){!function(){var t;function i(e){for(var t,i,n,a,r=1,o=[].slice.call(arguments),s=0,l=e.length,u="",_=!1,d=!1,c=function(){return o[r++]},g=function(){for(var i="";/\d/.test(e[s]);)i+=e[s++],t=e[s];return i.length>0?parseInt(i):null};s<l;++s)if(t=e[s],_)switch(_=!1,"."==t?(d=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(d=!0,t=e[s+=2]):d=!0,a=g(),t){case"b":u+=parseInt(c(),10).toString(2);break;case"c":u+="string"==typeof(i=c())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case"d":u+=parseInt(c(),10);break;case"f":n=String(parseFloat(c()).toFixed(a||6)),u+=d?n:n.replace(/^0/,"");break;case"j":u+=JSON.stringify(c());break;case"o":u+="0"+parseInt(c(),10).toString(8);break;case"s":u+=c();break;case"x":u+="0x"+parseInt(c(),10).toString(16);break;case"X":u+="0x"+parseInt(c(),10).toString(16).toUpperCase();break;default:u+=t}else"%"===t?_=!0:u+=t;return u}(t=e.exports=i).format=i,t.vsprintf=function(e,t){return i.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(i.apply(null,arguments))})}()}(cv);var gv=cv.exports,fv=pv(Error),hv=fv;function pv(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=gv.apply(null,arguments)),new e(t)}}fv.eval=pv(EvalError),fv.range=pv(RangeError),fv.reference=pv(ReferenceError),fv.syntax=pv(SyntaxError),fv.type=pv(TypeError),fv.uri=pv(URIError),fv.create=pv;var mv=dv,Fv=hv;hD.highlight=bv,hD.highlightAuto=function(e,t){var i=t||{},n=i.subset||mv.listLanguages();i.prefix;var a,r,o,s,l=n.length,u=-1;if("string"!=typeof e)throw Fv("Expected `string` for value, got `%s`",e);r={relevance:0,language:null,value:[]},a={relevance:0,language:null,value:[]};for(;++u<l;)s=n[u],mv.getLanguage(s)&&((o=bv(s,e,t)).language=s,o.relevance>r.relevance&&(r=o),o.relevance>a.relevance&&(r=a,a=o));r.language&&(a.secondBest=r);return a},hD.registerLanguage=function(e,t){mv.registerLanguage(e,t)},hD.listLanguages=function(){return mv.listLanguages()},hD.registerAlias=function(e,t){var i,n=e;t&&((n={})[e]=t);for(i in n)mv.registerAliases(n[i],{languageName:i})},Ev.prototype.addText=function(e){var t,i,n=this.stack;if(""===e)return;t=n[n.length-1],(i=t.children[t.children.length-1])&&"text"===i.type?i.value+=e:t.children.push({type:"text",value:e})},Ev.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},Ev.prototype.addSublanguage=function(e,t){var i=this.stack,n=i[i.length-1],a=e.rootNode.children,r=t?{type:"element",tagName:"span",properties:{className:[t]},children:a}:a;n.children=n.children.concat(r)},Ev.prototype.openNode=function(e){var t=this.stack,i=this.options.classPrefix+e,n=t[t.length-1],a={type:"element",tagName:"span",properties:{className:[i]},children:[]};n.children.push(a),t.push(a)},Ev.prototype.closeNode=function(){this.stack.pop()},Ev.prototype.closeAllNodes=yv,Ev.prototype.finalize=yv,Ev.prototype.toHTML=function(){return""};function bv(e,t,i){var n,a=mv.configure({}),r=(i||{}).prefix;if("string"!=typeof e)throw Fv("Expected `string` for name, got `%s`",e);if(!mv.getLanguage(e))throw Fv("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw Fv("Expected `string` for value, got `%s`",t);if(null==r&&(r="hljs-"),mv.configure({__emitter:Ev,classPrefix:r}),n=mv.highlight(t,{language:e,ignoreIllegals:!0}),mv.configure(a||{}),n.errorRaised)throw n.errorRaised;return{relevance:n.relevance,language:n.language,value:n.emitter.rootNode.children}}function Ev(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function yv(){}function Dv(e){return e.value||e.children||[]}function vv({doc:e,name:t,lowlight:i}){const n=[];return ys(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:a}=e.node.attrs,r=i.listLanguages();(function e(t,i=[]){return t.map(t=>{const n=[...i,...t.properties?t.properties.className:[]];return t.children?e(t.children,n):{text:t.value,classes:n}}).flat()})(a&&r.includes(a)?Dv(i.highlight(a,e.node.textContent)):Dv(i.highlightAuto(e.node.textContent))).forEach(e=>{const i=t+e.text.length;if(e.classes.length){const a=Oa.inline(t,i,{class:e.classes.join(" ")});n.push(a)}t=i})}),Ma.create(e,n)}function kv({name:e,lowlight:t}){return new Rt({key:new Bt("lowlight"),state:{init:(i,{doc:n})=>vv({doc:n,name:e,lowlight:t}),apply:(i,n,a,r)=>{const o=a.selection.$head.parent.type.name,s=r.selection.$head.parent.type.name,l=ys(a.doc,t=>t.type.name===e),u=ys(r.doc,t=>t.type.name===e);return i.docChanged&&([o,s].includes(e)||u.length!==l.length||i.steps.some(e=>void 0!==e.from&&void 0!==e.to&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?vv({doc:i.doc,name:e,lowlight:t}):n.map(i.mapping,i.doc)}},props:{decorations(e){return this.getState(e)}}})}const Sv=pF.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:hD}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],kv({name:this.name,lowlight:this.options.lowlight})]}});function wv(){return m.a.createElement(Lu,{"data-cy":"neeto-editor-code-block"},m.a.createElement("pre",null,m.a.createElement(Pu,{as:"code"})))}var Cv=i(94),xv=i.n(Cv),Tv=Sv.extend({addNodeView:function(){return new Ru(wv)}}).configure({lowlight:xv.a}),Ov=function(e){var t=e.items,i=e.command;return m.a.createElement("div",{className:"neeto-editor-variables-suggestion"},m.a.createElement(tf,{variables:t,onClickVariable:function(e){var t=e.category_key,n=e.key,a=t?"".concat(t,".").concat(n):n;i({label:a,id:a})}}))};function Nv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Av(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Nv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Nv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Rv=new Bt("variables"),Mv=cs.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel:function(e){var t=e.options,i=e.node;return"".concat(t.charOpen).concat(i.attrs.label||i.attrs.id).concat(t.charClose)},suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:function(e){return e.getAttribute("data-id")},renderHTML:function(e){return e.id?{"data-id":e.id}:{}}},label:{default:null,parseHTML:function(e){return e.getAttribute("data-label")},renderHTML:function(e){return e.label?{"data-label":e.label}:{}}}}},parseHTML:function(){return[{tag:"span[data-variable]"}]},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return["span",as({"data-variable":""},this.options.HTMLAttributes,i),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addCommands:function(){var e=this;return{setVariable:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:t},{type:"text",text:" "}]).run()}}}},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var i=t.tr,n=t.state,a=!1,r=n.selection,o=r.empty,s=r.anchor;return!!o&&(n.doc.nodesBetween(s-1,s,(function(t,n){if(t.type.name===e.name)return a=!0,i.insertText("",n,n+t.nodeSize),!1})),a)}))}}},addProseMirrorPlugins:function(){return[Vy(Av({editor:this.editor},this.options.suggestion))]}}),Iv={char:"{{",startOfLine:!1,pluginKey:Rv,command:function(e){var t=e.editor,i=e.range,n=e.props;t.chain().focus().deleteRange(i).setVariable(n).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(Ov,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Bv=function(e){var t=e.suggestion,i=void 0===t?{}:t;return Mv.configure({suggestion:Av(Av({},Iv),i)})},Lv=i(33),Pv=i.n(Lv),jv=i(95),qv=i.n(jv),Uv=function(e){var t=Pv()(e);return"string"===t||"funtion"===t?e:qv()(e)?function(t){var i=t.node.type.name;return e[i]}:""},zv=mr.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Rt({props:{decorations:function(t){var i=t.doc,n=t.selection,a=e.editor.isEditable||!e.options.showOnlyWhenEditable,r=n.anchor,o=[];if(a)return i.descendants((function(t,i){var n=r>=i&&r<=i+t.nodeSize,a=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((n||!e.options.showOnlyCurrent)&&!s&&a){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=Oa.node(i,i+t.nodeSize,{class:l.join(" "),"data-placeholder":"function"==typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:i}):e.options.placeholder});o.push(u)}return e.options.includeChildren})),Ma.create(i,o)}}})]}});const Gv=new Bt("suggestion");function Hv({pluginKey:e=Gv,editor:t,char:i="@",allowSpaces:n=!1,prefixSpace:a=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:_=(()=>({})),allow:d=(()=>!0)}){const c=null==_?void 0:_();return new Rt({key:e,view(){return{update:async(e,i)=>{var n,a,r,o,s;const _=null===(n=this.key)||void 0===n?void 0:n.getState(i),d=null===(a=this.key)||void 0===a?void 0:a.getState(e.state),g=_.active&&d.active&&_.range.from!==d.range.from,f=!_.active&&d.active,h=_.active&&!d.active,p=f||g,m=!f&&!h&&_.query!==d.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?_:d,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:_}=l,c={...o};if(c.composing=s,u||t.view.composing){!(_<o.range.from||_>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:n,startOfLine:a,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=a?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),_=r.depth<=0?0:r.before(),d=r.pos,c=r.doc.textBetween(_,d,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(n&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:n,prefixSpace:a,startOfLine:r,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(c.active=!0,c.decorationId=o.decorationId?o.decorationId:u,c.range=e.range,c.query=e.query,c.text=e.text):c.active=!1}else c.active=!1;return c.active||(c.decorationId=null,c.range={},c.query=null,c.text=null),c}},props:{handleKeyDown(e,t){var i;const{active:n,range:a}=this.getState(e.state);return n&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:a}))||!1},decorations(e){const{active:t,range:i,decorationId:n}=this.getState(e);return t?Ma.create(e.doc,[Oa.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":n})]):null}}})}const Yv=new Bt("mention"),Vv=cs.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var i;return`${e.suggestion.char}${null!==(i=t.attrs.label)&&void 0!==i?i:t.attrs.id}`},suggestion:{char:"@",pluginKey:Yv,command:({editor:e,range:t,props:i})=>{var n;const a=e.view.state.selection.$to.nodeAfter;(null===(n=null==a?void 0:a.text)||void 0===n?void 0:n.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:i},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const i=e.state.doc.resolve(t.from),n=e.schema.nodes[this.name];return!!i.parent.type.contentMatch.matchType(n)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-mention]"}],renderHTML({node:e,HTMLAttributes:t}){return["span",as({"data-mention":""},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let i=!1;const{selection:n}=t,{empty:a,anchor:r}=n;return!!a&&(t.doc.nodesBetween(r-1,r,(t,n)=>{if(t.type.name===this.name)return i=!0,e.insertText(this.options.suggestion.char||"",n,n+t.nodeSize),!1}),i)})}},addProseMirrorPlugins(){return[Hv({editor:this.editor,...this.options.suggestion})]}});function Wv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Bf()(e);if(t){var a=Bf()(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Mf()(this,i)}}var $v=function(e){Af()(i,e);var t=Wv(i);function i(e){var n;return wf()(this,i),n=t.call(this,e),d()(Of()(n),"selectItem",(function(e){var t=n.props,i=t.items,a=t.command,r=i[e];r&&a({label:r.name,id:r.key})})),d()(Of()(n),"upHandler",(function(){var e=n.props.items;n.setState((function(t){return{selectedIndex:(t.selectedIndex+e.length-1)%e.length}}))})),d()(Of()(n),"downHandler",(function(){var e=n.props.items;n.setState((function(t){return{selectedIndex:(t.selectedIndex+1)%e.length}}))})),d()(Of()(n),"enterHandler",(function(){var e=n.state.selectedIndex;n.selectItem(e)})),d()(Of()(n),"onKeyDown",(function(e){var t=e.event,i={ArrowUp:n.upHandler,ArrowDown:n.downHandler,Enter:n.enterHandler};return!!i.hasOwnProperty(t.key)&&(i[t.key](),!0)})),n.state={selectedIndex:0},n.mentionRef=m.a.createRef(),n}return xf()(i,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),Wy({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,i=this.props.items;return 0===i.length?m.a.createElement("div",{className:"neeto-editor-mentions__wrapper"},m.a.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):m.a.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},i.map((function(i,n){var a=i.key,r=i.name,o=i.imageUrl,s=i.showImage;return m.a.createElement("button",{className:b()("neeto-editor-mentions__item",{active:n===t}),key:a,onClick:function(){return e.selectItem(n)},type:"button","data-cy":"neeto-editor-mention-list-".concat(r)},s&&m.a.createElement(cf,{user:{name:r,imageUrl:o}}),m.a.createElement("p",null,r))})))}}]),i}(m.a.Component);function Kv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Qv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Kv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Kv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Zv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.showImage,n=void 0!==i&&i,a=e.map((function(e,t){return Qv({showImage:n,key:"".concat(c_(e.name),"-").concat(t)},e)})).sort((function(e,t){return e.name.localeCompare(t.name)}));return function(e){var t=e.query;return a.filter((function(e){return e.name.toLowerCase().includes(t.toLowerCase())}))}},Xv=["suggestion"];function Jv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ek(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Jv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Jv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var tk={render:function(){var e,t;return{onStart:function(i){e=new Tu($v,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(i){var n;return"Escape"===i.event.key?(t[0].hide(),!0):null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(i)},onExit:function(){t[0].destroy(),e.destroy()}}}},ik=Vv.extend({addCommands:function(){var e=this;return{setMention:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:{id:t,label:t}},{type:"text",text:" "}]).run()}}}}}),nk=function(e){var t=e.suggestion,i=void 0===t?{}:t,n=h()(e,Xv);return ik.configure(ek(ek({},n),{},{suggestion:ek(ek({},tk),i)}))};function ak(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function rk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ak(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ak(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var ok=cs.create({name:"external-video",addOptions:function(){return{inline:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["iframe",as(this.options.HTMLAttributes,rk(rk({},t),{},{class:"video-wrapper"}))]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(i){return i.commands.insertContent({type:e.name,attrs:t})}}}}});function sk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Bf()(e);if(t){var a=Bf()(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Mf()(this,i)}}var lk=function(e){Af()(i,e);var t=sk(i);function i(){var e;wf()(this,i);for(var n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return e=t.call.apply(t,[this].concat(a)),d()(Of()(e),"state",{selectedIndex:0,emojiSuggestions:gh.search(e.props.query||"smile").slice(0,5)}),d()(Of()(e),"onKeyDown",(function(t){var i=t.event;if("ArrowLeft"===i.key||"ArrowDown"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===i.key||"ArrowUp"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===i.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===i.key){var n;if(f_(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(n=gh.search(e.props.query))||void 0===n?void 0:n[0]).run();return!0}return"Escape"===i.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),d()(Of()(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return xf()(i,[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:gh.search(this.props.query||"smile").slice(0,5)})}},{key:"render",value:function(){var e=this;return m.a.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map((function(t,i){return m.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(i)},className:b()("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":i===e.state.selectedIndex}),"data-cy":"neeto-editor-emoji-suggestion-".concat(t.id)},t.native)})):m.a.createElement("p",null,"No results"))}}]),i}(m.a.Component);function uk(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _k(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?uk(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):uk(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var dk=new Bt("emoji-suggestion"),ck=cs.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:dk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(lk,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addCommands:function(){return{setEmoji:function(e){return function(t){(0,t.chain)().focus().insertContent("".concat((null==e?void 0:e.native)||""," ")).run()}}}},addProseMirrorPlugins:function(){return[Vy(_k({editor:this.editor},this.options.suggestion))]}});function gk(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function fk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gk(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gk(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var hk=new Bt("emoji-picker"),pk=cs.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:hk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(mp,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[Vy(fk({editor:this.editor},this.options.suggestion))]}}),mk=function(e){return function(e){var t=e.handleSubmit;return mr.create({addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return null==t||t(e.editor.getHTML()),e.editor.commands.blur(),!0}}}})}({handleSubmit:e.handleSubmit})};var Fk=[om.FONT_COLOR,om.FONT_SIZE,om.BOLD,om.ITALIC,om.UNDERLINE,om.STRIKETHROUGH,om.LINK,om.LIST_BULLETS,om.LIST_ORDERED],bk=["forceTitle","titleError","hideSlashCommands","addons","addonCommands","markdownMode","className","uploadEndpoint","initialValue","onChange","onFocus","onBlur","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName","characterLimit","editorSecrets","rows","autoFocus","onSubmit","heightStrategy","characterCountStrategy"],Ek=function(e,t){var i=e.forceTitle,n=void 0!==i&&i,a=e.titleError,r=void 0!==a&&a,o=e.hideSlashCommands,s=void 0!==o&&o,l=e.addons,_=void 0===l?[]:l,c=e.addonCommands,f=e.markdownMode,F=void 0!==f&&f,E=e.className,y=e.uploadEndpoint,D=e.initialValue,v=void 0===D?"":D,k=e.onChange,S=void 0===k?function(){}:k,w=e.onFocus,C=void 0===w?function(){}:w,x=e.onBlur,T=void 0===x?function(){}:x,O=e.menuType,N=void 0===O?"fixed":O,A=e.variables,R=e.mentions,M=e.showImageInMention,I=void 0!==M&&M,B=e.placeholder,L=void 0===B?n?{title:"Untitled"}:null:B,P=e.extensions,j=e.contentClassName,q=e.characterLimit,U=e.editorSecrets,z=e.rows,G=void 0===z?6:z,H=e.autoFocus,Y=void 0!==H&&H,V=e.onSubmit,W=e.heightStrategy,$=void 0===W?"fixed":W,K=e.characterCountStrategy,Q=void 0===K?"hidden":K,Z=h()(e,bk),X=Object(p.useState)(!1),J=g()(X,2),ee=J[0],te=J[1],ie=!F&&"fixed"===N,ne=!F&&"bubble"===N,ae=!F&&!s,re=function(e){if(e){if("string"==typeof e&&e.length)return!0;if("object"===Pv()(e)&&Object.keys(e).length)return!0;if("function"==typeof e)return!0}return!1}(L),oe=!re&&ae,se=_.includes("image-upload-unsplash"),le=!F&&"hidden"!==Q,ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=t.includeImageUpload,n=e.map((function(e){return e.toLowerCase()}));return i&&n.push(om.IMAGE_UPLOAD),[].concat(Fk,n)}(_,{includeImageUpload:se}),_e=function(e){var t=e.forceTitle,i=e.placeholder,n=e.extensions,a=e.mentions,r=e.variables,o=e.isSlashCommandsActive,s=e.showImageInMention,l=e.setImageUploadVisible,u=e.options,_=e.addonCommands,d=e.characterLimit,c=e.onSubmit,g=[Py,Ly.extend({content:t?"title block*":"block+"}),ub.configure({document:!1,codeBlock:!1}),Hy,Nb,Iy,Mb,Tv,Gy,bF,ok,My,By,zv.configure({placeholder:Uv(i)}),ck,pk,Ay.configure({limit:d}),mk({handleSubmit:c})];return o&&g.push(fD({setImageUploadVisible:l,options:u,addonCommands:_,mentions:a})),f_(a)||g.push(nk({suggestion:{items:Zv(a,{showImage:s})}})),f_(r)||g.push(Bv({suggestion:{items:function(){return r}}})),f_(n)||(g=g.concat(n)),g}({contentClassName:j,forceTitle:n,placeholder:L,extensions:P,mentions:R,variables:A,isSlashCommandsActive:ae,showImageInMention:I,setImageUploadVisible:te,options:ue,addonCommands:c,characterLimit:q,onSubmit:V}),de=b()("neeto-editor",d()({"slash-active":oe,"fixed-menu-active border":ie,"bubble-menu-active":ne,"force-title":n,"force-title--error":r,"placeholder-active":re},E,E)),ce=function(e){var t=e.heightStrategy,i={},n=21*e.rows+26;return"flexible"===t?i["min-height"]=n+"px":i.height=n+"px",i}({heightStrategy:$,rows:G}),ge=xu({extensions:_e,content:v,injectCSS:!1,autofocus:Y&&"end",editorProps:{attributes:{class:de,style:g_(ce)}},onUpdate:function(e){var t=e.editor;return S(t.getHTML())},onFocus:C,onBlur:T}),fe=tF({content:v,onUpdate:function(e){var t=e.html;return S(t)},onSubmit:function(e){var t=e.html;return V&&V(t)}});return m.a.useImperativeHandle(t,(function(){return{editor:F?fe:ge}})),Object(p.useEffect)((function(){if(ge){var e=F?ge.getHTML():fe.getHTML();(F?fe.commands.setContent:ge.commands.setContent)(e)}}),[F]),m.a.createElement("div",{className:"neeto-editor-wrapper"},ie&&m.a.createElement(bp,{editor:ge,variables:A,setImageUploadVisible:te,options:ue,mentions:R,showImageInMention:I}),ne&&m.a.createElement(Yc,{editor:ge,options:ue}),m.a.createElement(cm,{isVisible:ee,setIsVisible:te,editor:ge,imageUploadUrl:y,isUnsplashImageUploadActive:se,unsplashApiKey:null==U?void 0:U.unsplash}),F&&m.a.createElement(pm,u()({editor:fe,strategy:$,style:ce,limit:q,className:de,onFocus:C,onBlur:T},Z)),m.a.createElement("div",{className:b()({"neeto-editor-content--hidden":F})},m.a.createElement(Bu,u()({editor:ge},Z))),le&&m.a.createElement(mm,{count:null==ge?void 0:ge.storage.characterCount.characters(),limit:q,strategy:Q}))},yk=m.a.forwardRef(Ek),Dk=i(96),vk=i.n(Dk);var kk=["content","className"],Sk=function(e){var t=e.content,i=void 0===t?"":t,n=e.className,a=h()(e,kk);return Object(p.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){vk.a.highlightElement(e)}))}),[i]),m.a.createElement("div",u()({className:b()("neeto-editor-content",d()({},n,n)),dangerouslySetInnerHTML:{__html:bm.a.sanitize(i,{ADD_ATTR:["target"]})},"data-cy":"neeto-editor-content"},a))}}])}));