@bigbinary/neeto-editor 0.2.45 → 0.2.46
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.
- package/build/index.js +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -56,4 +56,4 @@ function $u(e,t){if(!e)throw new Error(t)}const Ku=Object(p.createContext)(null)
|
|
|
56
56
|
* LICENSE.md file in the root directory of this source tree.
|
|
57
57
|
*
|
|
58
58
|
* @license MIT
|
|
59
|
-
*/;function sd(){return(sd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function ld(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}const ud=["onClick","reloadDocument","replace","state","target","to"],dd=["aria-current","caseSensitive","className","end","style","to"];const _d=Object(p.forwardRef)((function(e,t){let{onClick:n,reloadDocument:i,replace:r=!1,state:a,target:o,to:s}=e,l=ld(e,ud),u=Xu(s),d=function(e,t){let{target:n,replace:i,state:r}=void 0===t?{}:t,a=td(),o=ed(),s=nd(e);return Object(p.useCallback)(t=>{if(!(0!==t.button||n&&"_self"!==n||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t))){t.preventDefault();let n=!!i||Yu(o)===Yu(s);a(e,{replace:n,state:r})}},[o,a,s,i,r,n,e])}(s,{replace:r,state:a,target:o});return Object(p.createElement)("a",sd({},l,{href:u,onClick:function(e){n&&n(e),e.defaultPrevented||i||d(e)},ref:t,target:o}))}));const cd=Object(p.forwardRef)((function(e,t){let{"aria-current":n="page",caseSensitive:i=!1,className:r="",end:a=!1,style:o,to:s}=e,l=ld(e,dd),u=ed(),d=nd(s),_=u.pathname,c=d.pathname;i||(_=_.toLowerCase(),c=c.toLowerCase());let f,g=_===c||!a&&_.startsWith(c)&&"/"===_.charAt(c.length),h=g?n:void 0;f="function"==typeof r?r({isActive:g}):[r,g?"active":null].filter(Boolean).join(" ");let m="function"==typeof o?o({isActive:g}):o;return Object(p.createElement)(_d,sd({},l,{"aria-current":h,className:f,ref:t,style:m,to:s}))}));function fd(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}var gd="undefined"!=typeof window&&"undefined"!=typeof document;function hd(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function pd(){return gd&&document.createElement("div")}function md(e){var t=[];return e.forEach((function(e){t.find((function(t){return function e(t,n){if(t===n)return!0;if("object"==typeof t&&null!=t&&"object"==typeof n&&null!=n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var i in t){if(!n.hasOwnProperty(i))return!1;if(!e(t[i],n[i]))return!1}return!0}return!1}(e,t)}))||t.push(e)})),t}function Fd(e,t){var n,i;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:md([].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],(null==(i=t.popperOptions)?void 0:i.modifiers)||[]))})})}var bd=gd?p.useLayoutEffect:p.useEffect;function yd(e){var t=Object(p.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function Ed(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var vd={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function i(){e.props.className&&!n()||Ed(t,"add",e.props.className)}return{onCreate:i,onBeforeUpdate:function(){n()&&Ed(t,"remove",e.props.className)},onAfterUpdate:i}}};function kd(e){return function(t){var n=t.children,i=t.content,r=t.visible,a=t.singleton,o=t.render,s=t.reference,l=t.disabled,u=void 0!==l&&l,d=t.ignoreAttributes,_=void 0===d||d,c=(t.__source,t.__self,fd(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),f=void 0!==r,g=void 0!==a,h=Object(p.useState)(!1),F=h[0],b=h[1],y=Object(p.useState)({}),E=y[0],v=y[1],k=Object(p.useState)(),D=k[0],C=k[1],w=yd((function(){return{container:pd(),renders:1}})),S=Object.assign({ignoreAttributes:_},c,{content:w.container});f&&(S.trigger="manual",S.hideOnClick=!1),g&&(u=!0);var O=S,x=S.plugins||[];o&&(O=Object.assign({},S,{plugins:g&&null!=a.data?[].concat(x,[{fn:function(){return{onTrigger:function(e,t){var n=a.data.children.find((function(e){return e.instance.reference===t.currentTarget}));e.state.$$activeSingletonInstance=n.instance,C(n.content)}}}}]):x,render:function(){return{popper:w.container}}}));var T=[s].concat(n?[n.type]:[]);return bd((function(){var t=s;s&&s.hasOwnProperty("current")&&(t=s.current);var n=e(t||w.ref||pd(),Object.assign({},O,{plugins:[vd].concat(S.plugins||[])}));return w.instance=n,u&&n.disable(),r&&n.show(),g&&a.hook({instance:n,content:i,props:O,setSingletonContent:C}),b(!0),function(){n.destroy(),null==a||a.cleanup(n)}}),T),bd((function(){var e;if(1!==w.renders){var t=w.instance;t.setProps(Fd(t.props,O)),null==(e=t.popperInstance)||e.forceUpdate(),u?t.disable():t.enable(),f&&(r?t.show():t.hide()),g&&a.hook({instance:t,content:i,props:O,setSingletonContent:C})}else w.renders++})),bd((function(){var e;if(o){var t=w.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,i=null==(t=n.modifiersData)?void 0:t.hide;E.placement===n.placement&&E.referenceHidden===(null==i?void 0:i.isReferenceHidden)&&E.escaped===(null==i?void 0:i.hasPopperEscaped)||v({placement:n.placement,referenceHidden:null==i?void 0:i.isReferenceHidden,escaped:null==i?void 0:i.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[E.placement,E.referenceHidden,E.escaped].concat(T)),m.a.createElement(m.a.Fragment,null,n?Object(p.cloneElement)(n,{ref:function(e){w.ref=e,hd(n.ref,e)}}):null,F&&Object(Du.createPortal)(o?o(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(E),D,w.instance):i,w.container))}}var Dd=function(e,t){return Object(p.forwardRef)((function(n,i){var r=n.children,a=fd(n,["children"]);return m.a.createElement(e,Object.assign({},t,a),r?Object(p.cloneElement)(r,{ref:function(e){hd(i,e),hd(r.ref,e)}}):null)}))},Cd=Dd(kd(bu)),wd=["content","children","theme","disabled","placement","position","interactive"],Sd=function(e){var t=e.content,n=e.children,i=e.theme,r=void 0===i?"dark":i,a=e.disabled,o=void 0!==a&&a,s=e.placement,l=e.position,d=void 0===l?"auto":l,_=e.interactive,c=void 0!==_&&_,f=h()(e,wd);return m.a.createElement(Cd,u()({role:"tooltip",theme:r,content:t,arrow:"<svg width='10' height='5' viewBox='0 0 10 5' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M10 5H0.926697L3.95208 1.63847C4.74227 0.760478 6.11722 0.754951 6.91445 1.62656L10 5Z' /></svg>",disabled:o,animation:"scale-subtle",placement:s||d,plugins:[Fu],interactive:c,duration:[100,200],zIndex:100001},f),n)},Od=["icon","iconPosition","iconSize","label","loading","onClick","to","type","style","fullWidth","className","disabled","size","href","tooltipProps"],xd=function(){},Td="primary",Nd="secondary",Ad="danger",Md="text",Rd="link",Id="large",Ld="left",Bd=Object(p.forwardRef)((function(e,t){var n,i,r=e.icon,a=void 0===r?null:r,o=e.iconPosition,s=void 0===o?"right":o,l=e.iconSize,d=void 0===l?16:l,_=e.label,c=void 0===_?"":_,f=e.loading,g=void 0!==f&&f,p=e.onClick,F=void 0===p?xd:p,y=e.to,E=void 0===y?null:y,v=e.type,k=void 0===v?"button":v,D=e.style,C=void 0===D?"primary":D,w=e.fullWidth,S=void 0!==w&&w,O=e.className,x=void 0===O?"":O,T=e.disabled,N=void 0!==T&&T,A=e.size,M=void 0===A?null:A,R=e.href,I=void 0===R?null:R,L=e.tooltipProps,B=void 0===L?null:L,P=h()(e,Od);E?(n=_d,i={to:E}):I?(n="a",i={href:I}):(n="button",i={type:k});var j="string"==typeof a?function(){return m.a.createElement("i",{className:b()("ne-btn__icon",[a])})}:a||m.a.Fragment;return m.a.createElement(Sd,u()({},B,{disabled:!B}),m.a.createElement(n,u()({ref:t,onClick:function(e){g||N||F(e)},className:b()("ne-btn",[x],{"ne-btn--style-primary":C===Td,"ne-btn--style-secondary":C===Nd,"ne-btn--style-danger":C===Ad,"ne-btn--style-text":C===Md,"ne-btn--style-link":C===Rd,"ne-btn--size-large":M===Id,"ne-btn--width-full":S,"ne-btn--icon-left":s==Ld,"ne-btn--icon-only":!c,disabled:N}),disabled:N},i,P),c&&m.a.createElement("span",null,c),a?m.a.createElement(j,{key:"2",size:d,className:"ne-btn__icon"}):null))}));Bd.displayName="Button";var Pd=Bd,jd=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,qd=/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,Ud=/((?:http|https):\/\/)?(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|(?:manage\/)?videos?\/|)(\d+)(?:(?:\/|\?h=)(\w+))?(?:|\/\?)/,zd=function(e){var t=e.editor,n=e.handleClose,i=e.handleAnimateInvalidLink,r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1];Object(p.useEffect)((function(){s(t.getAttributes("link").href||"")}),[]);var l=function(){jd.test(o)?(t.chain().focus().setLink({href:o}).run(),n()):Hu()(o)?(t.chain().focus().unsetLink().run(),n()):(s(""),i())};return m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?n():"Enter"===e.key&&l()},className:"neeto-editor-bubble-menu__link"},m.a.createElement("input",{autoFocus:!0,name:"url",value:o,placeholder:"Paste or type a link...",onChange:function(e){var t=e.target.value;return s(t)},className:"neeto-editor-bubble-menu-link__input"}),m.a.createElement(Pd,{style:"icon",icon:ju.Close,onClick:function(){o?(s(""),t.chain().focus().unsetLink().run()):n()}}))};function Hd(e){var t=e.editor,n=e.options,i=Object(p.useState)(!1),r=f()(i,2),a=r[0],o=r[1],s=Object(p.useState)(!1),l=f()(s,2),d=l[0],_=l[1];if(!t)return null;var c=[{Icon:ju.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:ju.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:ju.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:ju.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:ju.Link,command:function(){o(!0)},active:t.isActive("link"),optionName:"link"},{Icon:ju.Code,command:function(){return t.chain().focus().toggleCode().run()},active:t.isActive("code"),optionName:"code-block"},{Icon:ju.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}];return m.a.createElement(wu,{editor:t,tippyOptions:{arrow:'<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',placement:"top-start",zIndex:99999,onHide:function(){return o(!1)}},className:b()("neeto-editor-bubble-menu",{"neeto-editor-bubble-menu-animate-shake":d})},a?m.a.createElement(zd,{editor:t,handleClose:function(){return o(!1)},handleAnimateInvalidLink:function(){_(!0);var e=setTimeout((function(){_(!1),clearTimeout(e)}),1e3)}}):c.filter((function(e){var t=e.optionName;return n.includes(t)})).map((function(e){return m.a.createElement(Wd,u()({},e,{key:e.optionName}))})))}var Wd=function(e){var t=e.Icon,n=e.command,i=e.active,r=e.iconSize;return m.a.createElement("div",{className:b()("neeto-editor-bubble-menu__item",{active:i}),onClick:n},m.a.createElement(t,{size:r||20}))},Gd=n(1),Yd=n.n(Gd),Vd=["size","color","underlineColor"];function $d(e){var t=e.size,n=e.color,i=e.underlineColor,r=h()(e,Vd);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},r),m.a.createElement("path",{d:"M21 20H3",stroke:i||n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M17.3125 15L12.1562 4L7 15M8.03125 12.8H16.2812",stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}$d.defaultProps={color:"currentColor",size:24},$d.propTypes={color:Yd.a.string,size:Yd.a.oneOfType([Yd.a.string,Yd.a.number])};var Kd=["size","color","bgColor"];function Qd(e){var t=e.size,n=e.color,i=e.bgColor,r=h()(e,Kd);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},r),m.a.createElement("path",{d:"M21 7V17C21 19.209 19.209 21 17 21H7C4.791 21 3 19.209 3 17V7C3 4.791 4.791 3 7 3H17C19.209 3 21 4.791 21 7Z",fill:i,stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M10 8V16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M14 8V16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 14H16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 10H16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}))}Qd.defaultProps={color:"white",bgColor:"#68737D",size:24},Qd.propTypes={color:Yd.a.string,bgColor:Yd.a.string,size:Yd.a.oneOfType([Yd.a.string,Yd.a.number])};var Zd=function(e){var t=e.color,n=void 0===t?"#000":t,i=e.onChange,r=Object(p.useRef)();return m.a.createElement("div",{onClick:function(){var e;return null===(e=r.current)||void 0===e?void 0:e.click()},className:"neeto-editor-fixed-menu__item"},m.a.createElement($d,{size:20,color:"#87929D",underlineColor:n}),m.a.createElement("input",{ref:r,type:"color",onChange:function(e){return i&&i(e.target.value)}}))},Xd=n(89),Jd=n.n(Xd),e_=function(e){return e.reduce((function(e,t){var n=t[0],i=t[1];return e[n]=i,e}),{})},t_="undefined"!=typeof window&&window.document&&window.document.createElement?p.useLayoutEffect:p.useEffect,n_=[],i_="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function r_(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function a_(e,t){for(var n=t.slice(0,t.length-1),i=0;i<n.length;i++)n[i]=e[n[i].toLowerCase()];return n}function o_(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var s_={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,"-":i_?173:189,"=":i_?61:187,";":i_?59:186,"'":222,"[":219,"]":221,"\\":220},l_={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},u_={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},d_={16:!1,18:!1,17:!1,91:!1},__={},c_=1;c_<20;c_++)s_["f".concat(c_)]=111+c_;var f_=[],g_="all",h_=[],p_=function(e){return s_[e.toLowerCase()]||l_[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function m_(e){g_=e||"all"}function F_(){return g_||"all"}var b_=function(e){var t=e.key,n=e.scope,i=e.method,r=e.splitKey,a=void 0===r?"+":r;o_(t).forEach((function(e){var t=e.split(a),r=t.length,o=t[r-1],s="*"===o?"*":p_(o);if(__[s]){n||(n=F_());var l=r>1?a_(l_,t):[];__[s]=__[s].map((function(e){return(!i||e.method===i)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,i=e.length>=t.length?t:e,r=!0,a=0;a<n.length;a++)-1===i.indexOf(n[a])&&(r=!1);return r}(e.mods,l)?{}:e}))}}))};function y_(e,t,n){var i;if(t.scope===n||"all"===t.scope){for(var r in i=t.mods.length>0,d_)Object.prototype.hasOwnProperty.call(d_,r)&&(!d_[r]&&t.mods.indexOf(+r)>-1||d_[r]&&-1===t.mods.indexOf(+r))&&(i=!1);(0!==t.mods.length||d_[16]||d_[18]||d_[17]||d_[91])&&!i&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function E_(e){var t=__["*"],n=e.keyCode||e.which||e.charCode;if(v_.filter.call(this,e)){if(93!==n&&224!==n||(n=91),-1===f_.indexOf(n)&&229!==n&&f_.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=u_[t];e[t]&&-1===f_.indexOf(n)?f_.push(n):!e[t]&&f_.indexOf(n)>-1?f_.splice(f_.indexOf(n),1):"metaKey"===t&&e[t]&&3===f_.length&&(e.ctrlKey||e.shiftKey||e.altKey||(f_=f_.slice(f_.indexOf(n))))})),n in d_){for(var i in d_[n]=!0,l_)l_[i]===n&&(v_[i]=!0);if(!t)return}for(var r in d_)Object.prototype.hasOwnProperty.call(d_,r)&&(d_[r]=e[u_[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===f_.indexOf(17)&&f_.push(17),-1===f_.indexOf(18)&&f_.push(18),d_[17]=!0,d_[18]=!0);var a=F_();if(t)for(var o=0;o<t.length;o++)t[o].scope===a&&("keydown"===e.type&&t[o].keydown||"keyup"===e.type&&t[o].keyup)&&y_(e,t[o],a);if(n in __)for(var s=0;s<__[n].length;s++)if(("keydown"===e.type&&__[n][s].keydown||"keyup"===e.type&&__[n][s].keyup)&&__[n][s].key){for(var l=__[n][s],u=l.splitKey,d=l.key.split(u),_=[],c=0;c<d.length;c++)_.push(p_(d[c]));_.sort().join("")===f_.sort().join("")&&y_(e,l,a)}}}function v_(e,t,n){f_=[];var i=o_(e),r=[],a="all",o=document,s=0,l=!1,u=!0,d="+";for(void 0===n&&"function"==typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(a=t.scope),t.element&&(o=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(u=t.keydown),"string"==typeof t.splitKey&&(d=t.splitKey)),"string"==typeof t&&(a=t);s<i.length;s++)r=[],(e=i[s].split(d)).length>1&&(r=a_(l_,e)),(e="*"===(e=e[e.length-1])?"*":p_(e))in __||(__[e]=[]),__[e].push({keyup:l,keydown:u,scope:a,mods:r,shortcut:i[s],method:n,key:i[s],splitKey:d});void 0!==o&&!function(e){return h_.indexOf(e)>-1}(o)&&window&&(h_.push(o),r_(o,"keydown",(function(e){E_(e)})),r_(window,"focus",(function(){f_=[]})),r_(o,"keyup",(function(e){E_(e),function(e){var t=e.keyCode||e.which||e.charCode,n=f_.indexOf(t);if(n>=0&&f_.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&f_.splice(0,f_.length),93!==t&&224!==t||(t=91),t in d_)for(var i in d_[t]=!1,l_)l_[i]===t&&(v_[i]=!1)}(e)})))}var k_={setScope:m_,getScope:F_,deleteScope:function(e,t){var n,i;for(var r in e||(e=F_()),__)if(Object.prototype.hasOwnProperty.call(__,r))for(n=__[r],i=0;i<n.length;)n[i].scope===e?n.splice(i,1):i++;F_()===e&&m_(t||"all")},getPressedKeyCodes:function(){return f_.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=p_(e)),-1!==f_.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,i=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(i=!1),i},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&b_(e)}));else if("object"==typeof e)e.key&&b_(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=n[0],a=n[1];"function"==typeof r&&(a=r,r=""),b_({key:e,scope:r,method:a,splitKey:"+"})}}else Object.keys(__).forEach((function(e){return delete __[e]}))}};for(var D_ in k_)Object.prototype.hasOwnProperty.call(k_,D_)&&(v_[D_]=k_[D_]);if("undefined"!=typeof window){var C_=window.hotkeys;v_.noConflict=function(e){return e&&window.hotkeys===v_&&(window.hotkeys=C_),v_},window.hotkeys=v_}var w_=v_;w_.filter=function(){return!0};var S_=function(e,t){var n=e.target,i=n&&n.tagName;return Boolean(i&&t&&t.includes(i))};function O_(e,t,n,i){n instanceof Array&&(i=n,n=void 0);var r=n||{},a=r.enableOnTags,o=r.filter,s=r.keyup,l=r.keydown,u=r.filterPreventDefault,d=void 0===u||u,_=r.enabled,c=void 0===_||_,f=r.enableOnContentEditable,g=void 0!==f&&f,h=Object(p.useRef)(null),m=Object(p.useCallback)((function(e,n){var i;return o&&!o(e)?!d:!!(S_(e,["INPUT","TEXTAREA","SELECT"])&&!S_(e,a)||null!=(i=e.target)&&i.isContentEditable&&!g)||(null===h.current||document.activeElement===h.current)&&(t(e,n),!0)}),i?[h,a,o].concat(i):[h,a,o]);return Object(p.useEffect)((function(){if(c)return s&&!0!==l&&(n.keydown=!1),w_(e,n||{},m),function(){return w_.unbind(e,m)};w_.unbind(e,m)}),[m,e,c]),h}w_.isPressed;var x_=function(e){return e&&e.replace?e.replace(/[\s_]/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/-+/g,"-").toLowerCase():"nui"},T_=function(e,t){Object(p.useEffect)((function(){var n=function(n){e.current&&!e.current.contains(n.target)&&t(n)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[e,t])},N_=["icon","label","isOpen","onVisible","onClose","ulProps","position","children","autoWidth","className","buttonStyle","buttonProps","customTarget","disabled","closeOnEsc","closeOnSelect","closeOnOutsideClick","dropdownModifiers"];function A_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function M_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A_(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R_=function(){},I_=Object(p.forwardRef)((function(e,t){e.icon;var n=e.label,i=e.isOpen,r=e.onVisible,a=void 0===r?R_:r,o=e.onClose,s=void 0===o?R_:o,l=e.ulProps,d=e.position,c=e.children,g=e.autoWidth,F=e.className,y=(e.buttonStyle,e.buttonProps),E=e.customTarget,v=(e.disabled,e.closeOnEsc),k=void 0===v||v,D=e.closeOnSelect,C=void 0===D||D,w=e.closeOnOutsideClick,S=void 0===w||w,O=e.dropdownModifiers,x=void 0===O?[]:O,T=h()(e,N_),N=Object(p.useRef)(),A=E(),M=!(null==i),R=Object(p.useState)(!1),I=f()(R,2),L=I[0],B=I[1],P=Object(p.useState)(null),j=f()(P,2),q=j[0],U=j[1],z=Object(p.useState)(null),H=f()(z,2),W=H[0],G=H[1],Y=function(e,t,n){void 0===n&&(n={});var i=p.useRef(null),r={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||n_},a=p.useState({styles:{popper:{position:r.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],s=a[1],l=p.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,n=Object.keys(t.elements);s({styles:e_(n.map((function(e){return[e,t.styles[e]||{}]}))),attributes:e_(n.map((function(e){return[e,t.attributes[e]]})))})},requires:["computeStyles"]}}),[]),u=p.useMemo((function(){var e={onFirstUpdate:r.onFirstUpdate,placement:r.placement,strategy:r.strategy,modifiers:[].concat(r.modifiers,[l,{name:"applyStyles",enabled:!1}])};return Jd()(i.current,e)?i.current||e:(i.current=e,e)}),[r.onFirstUpdate,r.placement,r.strategy,r.modifiers,l]),d=p.useRef();return t_((function(){d.current&&d.current.setOptions(u)}),[u]),t_((function(){if(null!=e&&null!=t){var i=(n.createPopper||wl)(e,t,u);return d.current=i,function(){i.destroy(),d.current=null}}}),[e,t,n.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}}(q,W,{placement:d||"bottom-end",modifiers:x}),V=Y.styles,$=Y.attributes;Object(p.useImperativeHandle)(t,(function(){return{close:function(){return B(!1)},visible:L}}));var K=function(){M||B(!1),s()},Q=function(){!M&&B(!L)};return k&&O_("esc",K),S&&T_(N,K),M||(y=M_(M_({},y),{},{onClick:function(){Q()}})),Object(p.useEffect)((function(){M&&B(i)}),[i]),Object(p.useEffect)((function(){L&&a()}),[L]),m.a.createElement("div",u()({ref:N,className:b()("ne-dropdown__wrapper",_()({"ne-dropdown__wrapper--auto-width":g},F,F))},T),E?m.a.createElement("div",{ref:U,onClick:Q},A):m.a.createElement("div",null,n,m.a.createElement(ju.Down,null)),L&&m.a.createElement("ul",u()({className:"ne-dropdown__popup",ref:G,onClick:function(){C&&K()},"data-cy":"".concat(x_(n),"-dropdown-container")},l,{style:M_(M_({display:"block"},V.offset),V.popper)},$.popper),c))})),L_=function(e){var t=e.editor;return m.a.createElement(I_,{customTarget:function(){return m.a.createElement("button",{type:"button",className:"neeto-editor-fixed-menu__item"},m.a.createElement(ju.TextSize,{size:20,color:t.isActive("heading")?"#2F3941":"#87929D"}))},className:"neeto-editor-font-size-wrapper",placement:"bottom"},[{label:"H1",value:1},{label:"H2",value:2},{label:"H3",value:3}].map((function(e){var n,i=e.label,r=e.value;return m.a.createElement("li",{onClick:function(){return e=r,t.chain().focus().toggleHeading({level:e}).run();var e},key:r,className:b()({active:(n=r,t.isActive("heading",{level:n}))})},i)})))};function B_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function P_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B_(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j_=function(e){var t=e.onClickVariable,n=e.variables,i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=[];return e.forEach((function(e){var i=e.category_key,r=e.category_label,a=e.variables;if(i&&a){var o=a.map((function(e){return P_(P_({},e),{},{category_key:i})}));n.push({label:r,variables:o})}else t.push(e)})),t.length&&n.push({label:n.length?"Others":null,variables:t}),n}(n);return n&&n.length?m.a.createElement("div",{className:"neeto-editor-variables-list"},i.map((function(e){var n=e.label,i=e.variables;return m.a.createElement(q_,{key:n,title:n,variables:i,onClickItem:t})}))):null},q_=function(e){var t=e.title,n=e.variables,i=e.onClickItem;return m.a.createElement("div",{className:"neeto-editor-variables-block"},t&&m.a.createElement("h6",null,t),m.a.createElement("div",{className:"neeto-editor-variables-row"},n.map((function(e){return m.a.createElement("button",{type:"button",onClick:function(){return i(e)},key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable"},e.label)}))))},U_=function(e){var t=e.editor,n=e.variables;return n&&n.length?m.a.createElement(I_,{customTarget:function(){return m.a.createElement("button",{type:"button",className:"neeto-editor-fixed-menu__item"},m.a.createElement(Qd,{size:20}))},autoWidth:!0},m.a.createElement(j_,{onClickVariable:function(e){var n=e.category_key,i=e.key,r=n?"".concat(n,".").concat(i):i;t.chain().focus().setVariable({label:r}).run()},variables:n})):null},z_=["size","user","isSquare","status","onClick","className"],H_={small:24,medium:32,large:40,xlarge:64},W_=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function G_(e){var t,n,i=e.size,r=e.user,a=e.isSquare,o=e.status,s=e.onClick,l=e.className,d=h()(e,z_),_=Object(p.useState)(!1),c=f()(_,2),g=c[0],F=c[1],y=r.name,E=void 0===y?"":y,v=r.imageUrl,k="medium"===i,D="large"===i,C="xlarge"===i,w=(t=E.trim().split(" ")).reduce((function(e,n,i){return 0!==i&&i!==t.length-1||(e="".concat(e).concat(n.charAt(0).toUpperCase())),e}),""),S={height:H_[i],width:H_[i],backgroundColor:(n=(w.charCodeAt(0)||0)+(w.charCodeAt(1)||0),W_[n%65%W_.length]||W_[0])},O=b()("ne-avatar",{"ne-avatar--medium":k,"ne-avatar--large":D,"ne-avatar--xlarge":C,"ne-avatar--round":!a,hidden:!g}),x=b()("ne-avatar__text",{"ne-avatar__text-medium":k,"ne-avatar__text-large":D,"ne-avatar__text-xlarge":C}),T=b()("ne-avatar__status","".concat(o),{"ne-avatar__status-medium":k,"ne-avatar__status-large":D,"ne-avatar__status-xlarge":C,"ne-avatar__status-square":a}),N=function(){return null==o?m.a.Fragment:m.a.createElement("span",{className:T})},A=function(){return m.a.createElement("span",{className:x},w)},M=w&&!v&&!g;return m.a.createElement("div",u()({onClick:s,style:S,className:b()("ne-avatar--container",{"ne-avatar--container-round":!a},l)},d),m.a.createElement(N,null),M?m.a.createElement(A,null):m.a.createElement("img",{className:O,onLoad:function(){return F(!0)},onError:function(){return F(!1)},src:v,alt:"avatar-".concat(w)}))}G_.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},G_.propTypes={size:Yd.a.oneOf(Object.keys(H_)),user:Yd.a.shape({imageUrl:Yd.a.string,name:Yd.a.string}),isSquare:Yd.a.bool,onClick:Yd.a.func,status:Yd.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:Yd.a.string};var Y_=G_,V_=function(e){var t=e.editor,n=e.mentions,i=e.showImageInMention,r=Object(p.useRef)();return n&&n.length?m.a.createElement(I_,{ref:r,customTarget:function(){var e;return m.a.createElement("button",{type:"button",className:"neeto-editor-fixed-menu__item"},m.a.createElement(ju.Email,{size:20,color:null!==(e=r.current)&&void 0!==e&&e.visible?"#2F3941":"#87929D"}))},autoWidth:!0},m.a.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},n.map((function(e){var n="string"==typeof e?e:e.label,r="string"==typeof e?"":e.imageUrl;return m.a.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:n,onClick:function(){return t.commands.setMention(n)}},i&&m.a.createElement(Y_,{size:"small",user:{name:n,imageUrl:r}}),m.a.createElement("p",null,n))})))):null},$_=["children","className","required","helpIconProps"],K_=["onClick","icon","tooltipProps","className"],Q_=function(e){var t=e.children,n=e.className,i=void 0===n?"":n,r=e.required,a=void 0!==r&&r,o=e.helpIconProps,s=void 0===o?null:o,l=h()(e,$_),d=s||{},c=d.onClick,f=d.icon,g=d.tooltipProps,p=d.className,F=h()(d,K_),y=f||ju.Info;return m.a.createElement("label",u()({className:b()("ne-label flex items-center",i)},l),t,a&&m.a.createElement("span",{"aria-hidden":!0},"*"),s&&m.a.createElement(Sd,u()({},g,{disabled:!g}),m.a.createElement("span",{className:b()("ml-1",_()({},p,p)),onClick:c},m.a.createElement(y,u()({size:16},F)))))},Z_=["id","size","type","label","error","suffix","prefix","disabled","helpText","className","nakedInput","contentSize","required"],X_=Object(p.forwardRef)((function(e,t){var n=e.id,i=e.size,r=void 0===i?"small":i,a=e.type,o=void 0===a?"text":a,s=e.label,l=e.error,d=void 0===l?null:l,_=e.suffix,c=void 0===_?null:_,f=e.prefix,g=void 0===f?null:f,p=e.disabled,F=void 0!==p&&p,y=e.helpText,E=void 0===y?"":y,v=e.className,k=void 0===v?"":v,D=e.nakedInput,C=void 0!==D&&D,w=e.contentSize,S=void 0===w?null:w,O=e.required,x=void 0!==O&&O,T=h()(e,Z_);return m.a.createElement("div",{className:b()(["ne-input__wrapper",k])},s&&m.a.createElement(Q_,{required:x,"data-cy":"".concat(x_(s),"-input-label"),htmlFor:n},s),m.a.createElement("div",{className:b()("ne-input",{"ne-input--naked":!!C,"ne-input--error":!!d,"ne-input--disabled":!!F,"ne-input--small":"small"===r})},g&&m.a.createElement("div",{className:"ne-input__prefix"},g),m.a.createElement("input",u()({ref:t,type:o,disabled:F,size:S,required:x,"aria-invalid":!!d,"data-cy":"input-field"},T)),c&&m.a.createElement("div",{className:"ne-input__suffix"},c)),!!d&&m.a.createElement("p",{"data-cy":"".concat(x_(s),"-input-error"),className:"ne-input__error"},d),E&&m.a.createElement("p",{className:"ne-input__help-text"},E))}));X_.displayName="Input";var J_=X_,ec=function(e){var t=e.editor,n=Object(p.useRef)(),i=Object(p.useRef)(),r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1],l=Object(p.useState)(""),u=f()(l,2),d=u[0],_=u[1],c=t.isActive("link"),g=function(){_(t.getAttributes("link").href||"")},h=function(){var e;jd.test(d)?(t.chain().focus().setLink({href:d}).run(),null===(e=n.current)||void 0===e||e.close()):s("Please enter a valid url")};return m.a.createElement(I_,{ref:n,onVisible:function(){var e;return null===(e=i.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:function(){return m.a.createElement("button",{type:"button",className:"neeto-editor-fixed-menu__item",onClick:g},m.a.createElement(ju.Link,{size:20,color:c?"#2F3941":"#87929D"}))},className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?n.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},m.a.createElement(J_,{ref:i,name:"url",value:d,placeholder:"Paste URL",onFocus:function(){return s("")},error:o,onChange:function(e){var t=e.target.value;return _(t)}}),m.a.createElement(Pd,{label:"Link",onClick:h}),c&&m.a.createElement(Pd,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=n.current)||void 0===e||e.close()}})))},tc=n(21),nc=n.n(tc),ic=n(22),rc=n.n(ic),ac=n(15),oc=n.n(ac),sc=n(23),lc=n.n(sc),uc=n(24),dc=n.n(uc),_c=n(18),cc=n.n(_c),fc=n(32),gc=n(10),hc=n.n(gc),pc=n(11),mc=n.n(pc),Fc=n(48),bc=n.n(Fc),yc={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"},Ec=function(e){var t=[],n=function(e,n){e&&(Array.isArray(e)?e:[e]).forEach((function(e){(n?e.split(/[-|_|\s]+/):[e]).forEach((function(e){e=e.toLowerCase(),-1==t.indexOf(e)&&t.push(e)}))}))};return n(e.short_names,!0),n(e.name,!0),n(e.keywords,!1),n(e.emoticons,!1),t.join(",")},vc=function(e){for(var t in e.compressed=!1,e.emojis){var n=e.emojis[t];for(var i in yc)n[i]=n[yc[i]],delete n[yc[i]];n.short_names||(n.short_names=[]),n.short_names.unshift(t),n.sheet_x=n.sheet[0],n.sheet_y=n.sheet[1],delete n.sheet,n.text||(n.text=""),n.added_in||(n.added_in=6),n.added_in=n.added_in.toFixed(1),n.search=Ec(n)}},kc=String.fromCodePoint||function(){var e,t,n=16384,i=[],r=-1,a=arguments.length;if(!a)return"";for(var o="";++r<a;){var s=Number(arguments[r]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?i.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,i.push(e,t)),(r+1===a||i.length>n)&&(o+=String.fromCharCode.apply(null,i),i.length=0)}return o},Dc=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,Cc=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function wc(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return kc.apply(null,t)}function Sc(e){var t=e.name,n=e.short_names,i=e.skin_tone,r=e.skin_variations,a=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,d=e.id||n[0],_=":".concat(d,":");return s?{id:d,name:t,short_names:n,colons:_,emoticons:a,custom:s,customCategory:l,imageUrl:u}:(i&&(_+=":skin-tone-".concat(i,":")),{id:d,name:t,short_names:n,colons:_,emoticons:a,unified:o.toLowerCase(),skin:i||(r?1:null),native:wc(o)})}function Oc(){return Sc(xc.apply(void 0,arguments))}function xc(e,t,n,i){var r={};if("string"==typeof e){var a=e.match(Dc);if(a&&(e=a[1],a[2]&&(t=parseInt(a[2],10))),i.aliases.hasOwnProperty(e)&&(e=i.aliases[e]),!i.emojis.hasOwnProperty(e))return null;r=i.emojis[e]}else e.id&&(i.aliases.hasOwnProperty(e.id)&&(e.id=i.aliases[e.id]),i.emojis.hasOwnProperty(e.id)&&(r=i.emojis[e.id],t||(t=e.skin)));if(Object.keys(r).length||((r=e).custom=!0,r.search||(r.search=Ec(e))),r.emoticons||(r.emoticons=[]),r.variations||(r.variations=[]),r.skin_variations&&t>1){r=JSON.parse(JSON.stringify(r));var o=Cc[t-1],s=r.skin_variations[o];if(s&&(!s.variations&&r.variations&&delete r.variations,n&&(null==s["has_img_".concat(n)]||s["has_img_".concat(n)])||!n))for(var l in r.skin_tone=t,s){var u=s[l];r[l]=u}}return r.variations&&r.variations.length&&((r=JSON.parse(JSON.stringify(r))).unified=r.variations.shift()),r}function Tc(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function Nc(e,t){var n=Tc(e),i=Tc(t);return n.filter((function(e){return i.indexOf(e)>=0}))}function Ac(e,t){var n={};for(var i in e){var r=e[i],a=r;t.hasOwnProperty(i)&&(a=t[i]),"object"===bc()(a)&&(a=Ac(r,a)),n[i]=a}return n}var Mc,Rc,Ic="emoji-mart",Lc="undefined"!=typeof window&&"localStorage"in window;function Bc(e,t){if(Rc)Rc(e,t);else{if(!Lc)return;try{window.localStorage["".concat(Ic,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var Pc={update:function(e){for(var t in e){Bc(t,e[t])}},set:Bc,get:function(e){if(Mc)return Mc(e);if(Lc)try{var t=window.localStorage["".concat(Ic,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){Ic=e},setHandlers:function(e){e||(e={}),Mc=e.getter,Rc=e.setter}},jc=function(){function e(t,n){hc()(this,e),t.compressed&&vc(t),this.data=t||{},this.set=n||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return mc()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var n=e.data.emojis[t],i=n.short_names,r=n.emoticons,a=n.skin_variations,o=i[0];if(r&&r.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),a){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=Oc({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=Oc(o,null,e.set,e.data);e.originalPool[o]=n};for(var n in this.data.emojis)t(n)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(n){var i=n.id||n.short_names[0];delete e[i],delete t.emojis[i]}))}},{key:"addCustomToPool",value:function(e,t){var n=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var i=e.id||e.short_names[0];i&&!t[i]&&(t[i]=xc(e,null,null,n.data),n.emojis[i]=Oc(e,null,null,n.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.emojisToShowFilter,r=n.maxResults,a=n.include,o=n.exclude,s=n.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=Pc.get("skin")||1;r||(r=75),a||(a=[]),o||(o=[]);var d=null,_=this.originalPool;if(e.length){if("-"==e||"-1"==e)return[this.emojis[-1][u]];var c=e.toLowerCase().split(/[\s|,|\-|_]+/),f=[];if(c.length>2&&(c=[c[0],c[1]]),(a.length||o.length)&&(_={},this.data.categories.forEach((function(e){var n=!a||!a.length||a.indexOf(e.id)>-1,i=!(!o||!o.length)&&o.indexOf(e.id)>-1;n&&!i&&e.emojis.forEach((function(e){return _[e]=t.data.emojis[e]}))})),l.length)){var g=!a||!a.length||a.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;g&&!h&&this.addCustomToPool(l,_)}d=(f=c.map((function(e){for(var n=_,i=t.index,r=0,a=0;a<e.length;a++){var o=e[a];r++,i[o]||(i[o]={}),(i=i[o]).results||function(){var a={};for(var o in i.results=[],i.pool={},n){var s=n[o],l=s.search,d=e.substr(0,r),_=l.indexOf(d);if(-1!=_){var c=_+1;d==o&&(c=0),t.emojis[o]&&t.emojis[o][u]?i.results.push(t.emojis[o][u]):i.results.push(t.emojis[o]),i.pool[o]=s,a[o]=c}}i.results.sort((function(e,t){var n=a[e.id],i=a[t.id];return n==i?e.id.localeCompare(t.id):n-i}))}(),n=i.pool}return i.results})).filter((function(e){return e}))).length>1?Nc.apply(null,f):f.length?f[0]:[]}return d&&(i&&(d=d.filter((function(e){return i(_[e.id])}))),d&&d.length>r&&(d=d.slice(0,r))),d}}]),e}(),qc=new jc(fc);var Uc,zc,Hc={search:function(){return qc.search.apply(qc,arguments)},emojis:qc.emojis,emoticons:qc.emoticons},Wc=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],Gc={};function Yc(){zc=!0,Uc=Pc.get("frequently")}var Vc={add:function(e){zc||Yc();var t=e.id;Uc||(Uc=Gc),Uc[t]||(Uc[t]=0),Uc[t]+=1,Pc.set("last",t),Pc.set("frequently",Uc)},get:function(e){if(zc||Yc(),!Uc){Gc={};for(var t=[],n=0;n<e;n++)Gc[Wc[n]]=e-n,t.push(Wc[n]);return t}var i=4*e,r=[];for(var a in Uc)Uc.hasOwnProperty(a)&&r.push(a);var o=r.sort((function(e,t){return Uc[e]-Uc[t]})).reverse().slice(0,i),s=Pc.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},$c=n(16),Kc=n.n($c),Qc=n(25),Zc=n.n(Qc),Xc=n(12),Jc=n.n(Xc),ef=n(13),tf=n.n(ef),nf=n(14),rf=n.n(nf),af=n(8),of=n.n(af),sf={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"}))}},lf={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"}))}},uf={data:Yd.a.object.isRequired,onOver:Yd.a.func,onLeave:Yd.a.func,onClick:Yd.a.func,fallback:Yd.a.func,backgroundImageFn:Yd.a.func,native:Yd.a.bool,forceSize:Yd.a.bool,tooltip:Yd.a.bool,useButton:Yd.a.bool,skin:Yd.a.oneOf([1,2,3,4,5,6]),sheetSize:Yd.a.oneOf([16,20,32,64]),sheetColumns:Yd.a.number,sheetRows:Yd.a.number,set:Yd.a.oneOf(["apple","google","twitter","facebook"]),size:Yd.a.number.isRequired,emoji:Yd.a.oneOfType([Yd.a.string,Yd.a.object]).isRequired},df={onClick:Yd.a.func,onSelect:Yd.a.func,onSkinChange:Yd.a.func,perLine:Yd.a.number,emojiSize:Yd.a.number,i18n:Yd.a.object,style:Yd.a.object,title:Yd.a.string,emoji:Yd.a.string,color:Yd.a.string,set:uf.set,skin:uf.skin,native:Yd.a.bool,backgroundImageFn:uf.backgroundImageFn,sheetSize:uf.sheetSize,emojisToShowFilter:Yd.a.func,showPreview:Yd.a.bool,showSkinTones:Yd.a.bool,emojiTooltip:uf.tooltip,useButton:uf.useButton,theme:Yd.a.oneOf(["auto","light","dark"]),include:Yd.a.arrayOf(Yd.a.string),exclude:Yd.a.arrayOf(Yd.a.string),recent:Yd.a.arrayOf(Yd.a.string),autoFocus:Yd.a.bool,enableFrequentEmojiSort:Yd.a.bool,custom:Yd.a.arrayOf(Yd.a.shape({name:Yd.a.string.isRequired,short_names:Yd.a.arrayOf(Yd.a.string).isRequired,emoticons:Yd.a.arrayOf(Yd.a.string),keywords:Yd.a.arrayOf(Yd.a.string),imageUrl:Yd.a.string,spriteUrl:Yd.a.string,sheet_x:Yd.a.number,sheet_y:Yd.a.number,size:Yd.a.number,sheetColumns:Yd.a.number,sheetRows:Yd.a.number})),skinEmoji:Yd.a.string,notFound:Yd.a.func,notFoundEmoji:Yd.a.string,icons:Yd.a.object},_f=function(e){function t(e){var n;hc()(this,t),n=Jc()(this,tf()(t).call(this,e));var i=e.categories.filter((function(e){return e.first}))[0];return n.state={selected:i.name},n.handleClick=n.handleClick.bind(of()(n)),n}return rf()(t,e),mc()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),n=this.props,i=n.categories;(0,n.onAnchorClick)(i[t],t)}},{key:"render",value:function(){var e=this,t=this.props,n=t.categories,i=t.color,r=t.i18n,a=t.icons,o=this.state.selected;return m.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":r.categorieslabel},n.map((function(t,n){var s=t.id,l=t.name,u=t.anchor,d=l==o;if(!1===u)return null;var _=s.startsWith("custom-")?"custom":s;return m.a.createElement("button",{key:s,"aria-label":r.categories[_],title:r.categories[_],"data-index":n,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(d?"emoji-mart-anchor-selected":""),style:{color:d?i:null}},m.a.createElement("div",{className:"emoji-mart-anchor-icon"},a.categories[_]()),m.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:i}}))})))}}]),t}(m.a.PureComponent);_f.propTypes={categories:Yd.a.array,onAnchorClick:Yd.a.func,icons:Yd.a.object},_f.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var cf={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")}},ff={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:cf.set,theme:"light",skin:null,defaultSkin:cf.skin,native:cf.native,sheetSize:cf.sheetSize,backgroundImageFn:cf.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:cf.tooltip,useButton:cf.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function gf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function hf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pf=function(e){return xc(e.emoji,e.skin,e.set,e.data)},mf=function(e){var t=pf(e),n=t.sheet_x,i=t.sheet_y,r=100/(e.sheetColumns-1),a=100/(e.sheetRows-1);return"".concat(r*n,"% ").concat(a*i,"%")},Ff=function(e){return Oc(e.emoji,e.skin,e.set,e.data)},bf=function(e){return!isNaN(e-parseFloat(e))},yf=function e(t){for(var n in t.data.compressed&&vc(t.data),e.defaultProps)null==t[n]&&null!=e.defaultProps[n]&&(t[n]=e.defaultProps[n]);var i=pf(t);if(!i)return t.fallback?t.fallback(null,t):null;var r=i.unified,a=i.custom,o=i.short_names,s=i.imageUrl,l={},u=t.children,d="emoji-mart-emoji",_=r&&wc(r),c=[_].concat(o).filter(Boolean).join(", "),f=null;if(!r&&!a)return t.fallback?t.fallback(i,t):null;if(t.tooltip&&(f=o[0]),t.native&&r)d+=" emoji-mart-emoji-native",l={fontSize:t.size},u=_,t.forceSize&&(l.display="inline-block",l.width=t.size,l.height=t.size,l.wordBreak="keep-all");else if(a)d+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=i.spriteUrl?hf({},l,{backgroundImage:"url(".concat(i.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:mf(t)}):hf({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==i["has_img_".concat(t.set)]||i["has_img_".concat(t.set)]))return t.fallback?t.fallback(i,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:mf(t)}}var g={name:"span",props:{}};return t.onClick&&t.useButton&&(g.name="button",g.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var n in e){var i=e[n];bf(i)&&(i+="px"),t.style[n]=i}return t.getAttribute("style")}(l),"<".concat(g.name," style='").concat(l,"' aria-label='").concat(c,"' ").concat(f?"title='".concat(f,"'"):""," class='").concat(d,"'>").concat(u||"","</").concat(g.name,">")):m.a.createElement(g.name,Zc()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(Ff(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(Ff(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(Ff(t),e)}(e,t)},"aria-label":c,title:f,className:d},g.props),m.a.createElement("span",{style:l},u))};yf.propTypes=hf({},uf,{data:Yd.a.object.isRequired}),yf.defaultProps=cf;var Ef=yf;function vf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var kf=function(e){function t(){return hc()(this,t),Jc()(this,tf()(t).apply(this,arguments))}return rf()(t,e),mc()(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.emojiProps,i=e.i18n,r=e.notFound,a=e.notFoundEmoji;return r&&r()||m.a.createElement("div",{className:"emoji-mart-no-results"},Ef(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({data:t},n,{size:38,emoji:a,onOver:null,onLeave:null,onClick:null})),m.a.createElement("div",{className:"emoji-mart-no-results-label"},i.notfound))}}]),t}(m.a.PureComponent);function Df(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}kf.propTypes={notFound:Yd.a.func.isRequired,emojiProps:Yd.a.object.isRequired};var Cf=function(e){function t(e){var n;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).data=e.data,n.setContainerRef=n.setContainerRef.bind(of()(n)),n.setLabelRef=n.setLabelRef.bind(of()(n)),n}return rf()(t,e),mc()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var n=this.props,i=n.name,r=n.perLine,a=n.native,o=n.hasStickyPosition,s=n.emojis,l=n.emojiProps,u=l.skin,d=l.size,_=l.set,c=e.perLine,f=e.native,g=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,y=!1;return"Recent"==i&&r!=c&&(y=!0),"Search"==i&&(y=!(s==h)),u==m&&d==F&&a==f&&_==b&&o==g||(y=!0),y}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),n=t.top,i=t.height,r=e.getBoundingClientRect().top,a=this.label.getBoundingClientRect().height;this.top=n-r+e.scrollTop,this.maxMargin=0==i?0:i-a}},{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,n=t.name,i=t.emojis,r=t.recent,a=t.perLine;if("Recent"==n){var o=this.props.custom,s=r||Vc.get(a);if(s.length&&(i=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!xc(t,null,null,e.data)}))),0===i.length&&s.length>0)return null}return i&&(i=i.slice(0)),i}},{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,n=t.id,i=t.name,r=t.hasStickyPosition,a=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,u=this.getEmojis(),d={},_={},c={};u||(c={display:"none"}),r||(d={height:28},_={position:"absolute"});var f=o.categories[n]||i;return m.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":f,style:c},m.a.createElement("div",{style:d,"data-name":i,className:"emoji-mart-category-label"},m.a.createElement("span",{style:_,ref:this.setLabelRef,"aria-hidden":!0},f)),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},Ef(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Df(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Df(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({emoji:t,data:e.data},a)))}))),u&&!u.length&&m.a.createElement(kf,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:a}))}}]),t}(m.a.Component);Cf.propTypes={emojis:Yd.a.array,hasStickyPosition:Yd.a.bool,name:Yd.a.string.isRequired,native:Yd.a.bool.isRequired,perLine:Yd.a.number.isRequired,emojiProps:Yd.a.object.isRequired,recent:Yd.a.arrayOf(Yd.a.string),notFound:Yd.a.func,notFoundEmoji:Yd.a.string.isRequired},Cf.defaultProps={emojis:[],hasStickyPosition:!0};var wf=function(e){function t(e){var n;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).state={opened:!1},n}return rf()(t,e),mc()(t,[{key:"handleClick",value:function(e){var t=parseInt(e.currentTarget.getAttribute("data-skin")),n=this.props.onChange;this.state.opened?(this.setState({opened:!1}),t!=this.props.skin&&n(t)):this.setState({opened:!0})}},{key:"render",value:function(){return null}}]),t}(m.a.PureComponent);wf.propTypes={onChange:Yd.a.func,skin:Yd.a.number.isRequired},wf.defaultProps={onChange:function(){}};var Sf=function(e){function t(e){var n;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).handleClick=n.handleClick.bind(of()(n)),n}return rf()(t,e),mc()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,n=e.emojiProps,i=e.data,r=e.skinEmoji,a=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)},Ef({emoji:r,data:i,skin:l,backgroundImageFn:n.backgroundImageFn,native:n.native,set:n.set,sheetSize:n.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":"")},a.skintext),s)}}]),t}(wf);Sf.propTypes={onChange:Yd.a.func,skin:Yd.a.number.isRequired,emojiProps:Yd.a.object.isRequired,skinTone:Yd.a.number,skinEmoji:Yd.a.string.isRequired,i18n:Yd.a.object},Sf.defaultProps={onChange:function(){},skinTone:null};var Of=function(e){function t(e){var n;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).handleClick=n.handleClick.bind(of()(n)),n.handleKeyDown=n.handleKeyDown.bind(of()(n)),n}return rf()(t,e),mc()(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,n=e.i18n,i=this.state.opened,r=[],a=1;a<=6;a++){var o=a===t,s=i||o;r.push(m.a.createElement("span",Zc()({key:"skin-tone-".concat(a),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":n.skintones[a],"aria-hidden":!s},i?{role:"menuitem"}:{}),m.a.createElement("span",Zc()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!i}:{},i?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":n.skintones[a],title:n.skintones[a],"data-skin":a,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(a)}))))}return m.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(i?" opened":""),"aria-label":n.skintext},m.a.createElement("div",i?{role:"menubar"}:{},r))}}]),t}(wf);function xf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Tf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Of.propTypes={onChange:Yd.a.func,skin:Yd.a.number.isRequired,i18n:Yd.a.object},Of.defaultProps={onChange:function(){}};var Nf=function(e){function t(e){var n;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).data=e.data,n.state={emoji:null},n}return rf()(t,e),mc()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,n=t.emojiProps,i=t.skinsProps,r=t.showSkinTones,a=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var u=xc(e,null,null,this.data),d=u.emoticons,_=[],c=[];return(void 0===d?[]:d).forEach((function(e){_.indexOf(e.toLowerCase())>=0||(_.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"},Ef(Tf({key:e.id,emoji:e,data:this.data},n))),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&&Ef(Tf({emoji:o,data:this.data},n))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("span",{className:"emoji-mart-title-label"},a)),r&&m.a.createElement("div",{className:"emoji-mart-preview-skins".concat(i.skinEmoji?" custom":"")},i.skinEmoji?m.a.createElement(Sf,{skin:i.skin,emojiProps:n,data:this.data,skinEmoji:i.skinEmoji,i18n:s,onChange:i.onChange}):m.a.createElement(Of,{skin:i.skin,i18n:s,onChange:i.onChange})))}}]),t}(m.a.PureComponent);Nf.propTypes={showSkinTones:Yd.a.bool,title:Yd.a.string.isRequired,emoji:Yd.a.string.isRequired,emojiProps:Yd.a.object.isRequired,skinsProps:Yd.a.object.isRequired},Nf.defaultProps={showSkinTones:!0,onChange:function(){}};var Af=0,Mf=function(e){function t(e){var n,i,r,a;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).state={icon:lf.search,isSearching:!1,id:++Af},n.data=e.data,n.emojiIndex=new jc(n.data),n.setRef=n.setRef.bind(of()(n)),n.clear=n.clear.bind(of()(n)),n.handleKeyUp=n.handleKeyUp.bind(of()(n)),n.handleChange=(i=n.handleChange.bind(of()(n)),r="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,a=!1,function(){a||(a=!0,r((function(){a=!1,i()})))}),n}return rf()(t,e),mc()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:lf.search,isSearching:!1}):this.setState({icon:lf.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,n=e.autoFocus,i=this.state,r=i.icon,a=i.isSearching,o=i.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:n}),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:!a},r()))}}]),t}(m.a.PureComponent);function Rf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function If(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Mf.propTypes={onSearch:Yd.a.func,maxResults:Yd.a.number,emojisToShowFilter:Yd.a.func,autoFocus:Yd.a.bool},Mf.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var Lf={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"}},Bf=function(e){function t(e){var n;hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).CUSTOM=[],n.RECENT_CATEGORY={id:"recent",name:"Recent",emojis:null},n.SEARCH_CATEGORY={id:"search",name:"Search",emojis:null,anchor:!1},e.data.compressed&&vc(e.data),n.data=e.data,n.i18n=Ac(Lf,e.i18n),n.icons=Ac(i,e.icons),n.state={firstRender:!0},n.categories=[];var r=[].concat(n.data.categories);if(e.custom.length>0){var a={},o=0;e.custom.forEach((function(e){a[e.customCategory]||(a[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=a[e.customCategory],i=If({},e,{id:e.short_names[0],custom:!0});t.emojis.push(i),n.CUSTOM.push(i)})),r=r.concat(Object.keys(a).map((function(e){return a[e]})))}n.hideRecent=!0,null!=e.include&&r.sort((function(t,n){return e.include.indexOf(t.id)>e.include.indexOf(n.id)?1:-1}));for(var s=0;s<r.length;s++){var l=r[s],u=!e.include||!e.include.length||e.include.indexOf(l.id)>-1,d=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(l.id)>-1;if(u&&!d)if(e.emojisToShowFilter){for(var _=[],c=l.emojis,f=0;f<c.length;f++){var g=c[f];e.emojisToShowFilter(n.data.emojis[g]||g)&&_.push(g)}if(_.length){var h={emojis:_,name:l.name,id:l.id};n.categories.push(h)}}else n.categories.push(l)}var p=!e.include||!e.include.length||e.include.indexOf(n.RECENT_CATEGORY.id)>-1,m=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(n.RECENT_CATEGORY.id)>-1;return p&&!m&&(n.hideRecent=!1,n.categories.unshift(n.RECENT_CATEGORY)),n.categories[0]&&(n.categories[0].first=!0),n.categories.unshift(n.SEARCH_CATEGORY),n.setAnchorsRef=n.setAnchorsRef.bind(of()(n)),n.handleAnchorClick=n.handleAnchorClick.bind(of()(n)),n.setSearchRef=n.setSearchRef.bind(of()(n)),n.handleSearch=n.handleSearch.bind(of()(n)),n.setScrollRef=n.setScrollRef.bind(of()(n)),n.handleScroll=n.handleScroll.bind(of()(n)),n.handleScrollPaint=n.handleScrollPaint.bind(of()(n)),n.handleEmojiOver=n.handleEmojiOver.bind(of()(n)),n.handleEmojiLeave=n.handleEmojiLeave.bind(of()(n)),n.handleEmojiClick=n.handleEmojiClick.bind(of()(n)),n.handleEmojiSelect=n.handleEmojiSelect.bind(of()(n)),n.setPreviewRef=n.setPreviewRef.bind(of()(n)),n.handleSkinChange=n.handleSkinChange.bind(of()(n)),n.handleKeyDown=n.handleKeyDown.bind(of()(n)),n.handleDarkMatchMediaChange=n.handleDarkMatchMediaChange.bind(of()(n)),n}return rf()(t,e),mc()(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?ff.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?ff.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 n=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i]);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||Vc.add(e);var n=this.categoryRefs["category-1"];if(n){var i=n.maxMargin;this.props.enableFrequentEmojiSort&&n.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(n.memoizeSize(),i!=n.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&n.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,n=t>(this.scrollTop||0),i=0,r=0,a=this.categories.length;r<a;r++){var o=n?this.categories.length-1-r:r,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!i||l.top<i)&&l.top>0&&(i=l.top),u&&!e&&(e=s)}}t<i?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 d=this.anchors,_=e.name;d.state.selected!=_&&d.setState({selected:_})}this.scrollTop=t}}},{key:"handleSearch",value:function(e){this.SEARCH_CATEGORY.emojis=e;for(var t=0,n=this.categories.length;t<n;t++){var i=this.categoryRefs["category-".concat(t)];if(i&&"Search"!=i.props.name){var r=e?"none":"inherit";i.updateDisplay(r)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var n,i=this.categoryRefs["category-".concat(t)],r=this.scroll;this.anchors;n=function(){if(i){var t=i.top;e.first?t=0:t+=1,r.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(n)):n()}},{key:"handleSkinChange",value:function(e){var t={skin:e},n=this.props.onSkinChange;this.setState(t),Pc.update(t),n(e)}},{key:"handleKeyDown",value:function(e){var t=!1;switch(e.keyCode){case 13:var n;this.SEARCH_CATEGORY.emojis&&this.SEARCH_CATEGORY.emojis.length&&(n=Oc(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(n),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var n=this.categoryRefs["category-".concat(e)];n&&n.memoizeSize()}if(this.scroll){var i=this.scroll;this.scrollHeight=i.scrollHeight,this.clientHeight=i.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,n=t.perLine,i=t.emojiSize,r=t.set,a=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,u=t.title,d=t.emoji,_=t.color,c=t.native,f=t.backgroundImageFn,g=t.emojisToShowFilter,h=t.showPreview,p=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,y=t.include,E=t.exclude,v=t.recent,k=t.autoFocus,D=t.skinEmoji,C=t.notFound,w=t.notFoundEmoji,S=n*(i+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}(),O=this.getPreferredTheme(),x=this.props.skin||this.state.skin||Pc.get("skin")||this.props.defaultSkin;return m.a.createElement("section",{style:If({width:S},l),className:"emoji-mart emoji-mart-".concat(O),"aria-label":u,onKeyDown:this.handleKeyDown},m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(_f,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:_,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),m.a.createElement(Mf,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:g,include:y,exclude:E,custom:this.CUSTOM,autoFocus:k}),m.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return m.a.createElement(Cf,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:n,native:c,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?v:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:c,skin:x,size:i,set:r,sheetSize:a,sheetColumns:o,sheetRows:s,forceSize:c,tooltip:F,backgroundImageFn:f,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:C,notFoundEmoji:w})}))),(h||p)&&m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(Nf,{ref:this.setPreviewRef,data:this.data,title:u,emoji:d,showSkinTones:p,showPreview:h,emojiProps:{native:c,size:38,skin:x,set:r,sheetSize:a,sheetColumns:o,sheetRows:s,backgroundImageFn:f},skinsProps:{skin:x,onChange:this.handleSkinChange,skinEmoji:D},i18n:this.i18n})))}}]),t}(m.a.PureComponent);function Pf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}Bf.propTypes=If({},df,{data:Yd.a.object.isRequired}),Bf.defaultProps=If({},ff);var jf=function(e){function t(){return hc()(this,t),Jc()(this,tf()(t).apply(this,arguments))}return rf()(t,e),mc()(t,[{key:"render",value:function(){return m.a.createElement(Bf,Zc()({},this.props,this.state))}}]),t}(m.a.PureComponent);function qf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Uf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}jf.propTypes=df,jf.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},ff,{data:fc});var zf=function e(t){for(var n in e.defaultProps)null==t[n]&&null!=e.defaultProps[n]&&(t[n]=e.defaultProps[n]);return Ef(Uf({},t))};zf.propTypes=uf,zf.defaultProps=Uf({},cf,{data:fc});var Hf=n(51),Wf={insert:"head",singleton:!1},Gf=(a()(Hf.a,Wf),Hf.a.locals,n(90));function Yf(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 n,i=cc()(e);if(t){var r=cc()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return dc()(this,n)}}var Vf=function(e){lc()(n,e);var t=Yf(n);function n(){var e;nc()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),_()(oc()(e),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),_()(oc()(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return rc()(n,[{key:"render",value:function(){return m.a.createElement(Bf,{style:{maxWidth:"100%"},data:Gf,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect})}}]),n}(m.a.Component);Vf.defaultProps={editor:{},range:{}},Vf.propTypes={editor:Yd.a.object.isRequired,range:Yd.a.object};var $f=Vf,Kf=function(e){var t=e.editor,n=Object(p.useRef)();return m.a.createElement(I_,{ref:n,closeOnSelect:!1,customTarget:function(){var e;return m.a.createElement("button",{className:"neeto-editor-fixed-menu__item"},m.a.createElement(ju.Smiley,{size:20,color:null!=n&&null!==(e=n.current)&&void 0!==e&&e.visible?"#2F3941":"#87929D"}))},position:"bottom-start"},m.a.createElement($f,{editor:t}))},Qf=["Icon","command","active","optionName","disabled"],Zf=function(e){var t=e.editor,n=e.variables,i=e.setImageUploadVisible,r=e.options,a=e.mentions,o=e.showImageInMention;if(!t)return null;var s=[{Icon:ju.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:ju.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:ju.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:ju.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:ju.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}].filter((function(e){return r.includes(e.optionName)})),l=[{Icon:ju.Quote,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:ju.Code,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"code-block"},{Icon:ju.Image,command:function(){return i(!0)},optionName:"image-upload"}].filter((function(e){return r.includes(e.optionName)})),d=[{Icon:ju.ListDot,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:ju.ListNumber,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}].filter((function(e){return r.includes(e.optionName)})),_=r.includes("font-color"),c=r.includes("font-size"),f=r.includes("emoji"),g=r.includes("link"),p=function(e){var t=e.Icon,n=e.command,i=e.active,r=e.optionName,a=e.disabled,o=h()(e,Qf);return m.a.createElement("button",{disabled:a,onClick:n,key:r,className:"neeto-editor-fixed-menu__item",type:"button"},m.a.createElement(t,u()({color:i?"#2F3941":"#87929D",size:20},o)))};return m.a.createElement("div",{className:"neeto-editor-fixed-menu"},c&&m.a.createElement(L_,{editor:t}),s.map(p),_&&m.a.createElement(Zd,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),f&&m.a.createElement(Kf,{editor:t}),g&&m.a.createElement(ec,{editor:t}),l.map(p),d.map(p),m.a.createElement("div",{className:"neeto-editor-fixed-menu-addons"},m.a.createElement(U_,{editor:t,variables:n}),m.a.createElement(V_,{editor:t,mentions:a,showImageInMention:o})))},Xf=n(19),Jf=n.n(Xf),eg=n(91),tg=n.n(eg),ng=function(e){var t=e.children,n=e.className,i=void 0===n?"root-portal":n,r=e.el,a=void 0===r?"div":r,o=document.getElementsByClassName(i)[0];return o||(o=document.createElement(a)).classList.add(i),m.a.useEffect((function(){document.body.appendChild(o)}),[]),Cu.a.createPortal(t,o)},ig=["children","className"],rg=function(e){var t=e.children,n=e.className,i=h()(e,ig);return m.a.createElement("div",u()({className:b()("ne-backdrop",_()({},n,n))},i),t)},ag=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"],og=function(){},sg="xs",lg="sm",ug="md",dg=function(e){var t=e.size,n=void 0===t?"sm":t,i=e.isOpen,r=void 0!==i&&i,a=e.onClose,o=void 0===a?og:a,s=e.loading,l=void 0!==s&&s,d=e.children,c=e.className,f=void 0===c?"":c,g=e.closeOnEsc,F=void 0===g||g,y=e.closeButton,E=void 0===y||y,v=e.backdropClassName,k=void 0===v?"":v,D=e.closeOnOutsideClick,C=void 0===D||D,w=h()(e,ag),S=Object(p.useRef)();return C&&T_(S,o),F&&O_("esc",o),m.a.createElement(ng,{className:"ne-portal"},r&&m.a.createElement(rg,{key:"modal-backdrop",className:b()("ne-modal__backdrop",k)},m.a.createElement("div",u()({ref:S,key:"modal-wrapper",className:b()("ne-modal__wrapper",_()({"ne-modal__wrapper--xs":n===sg,"ne-modal__wrapper--sm":n===lg,"ne-modal__wrapper--md":n===ug},f,f))},w),E&&m.a.createElement(Pd,{style:"text",icon:ju.Close,className:"ne-modal__close",onClick:o}),l?m.a.createElement(m.a.Fragment,null):d)))},_g=["children","size","noUnderline","className"],cg=["active","className","children","icon","onClick","activeClassName"],fg=function(){},gg="large",hg=function(e){var t=e.children,n=e.size,i=e.noUnderline,r=e.className,a=void 0===r?"":r,o=h()(e,_g);return m.a.createElement("div",u()({className:b()({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":n===gg},{"ne-tab__wrapper--underline-none":i},[a]),"data-cy":"tab-container"},o),t)};hg.Item=function(e){var t=e.active,n=e.className,i=void 0===n?"":n,r=e.children,a=e.icon,o=void 0===a?null:a,s=e.onClick,l=void 0===s?fg:s,d=e.activeClassName,_=void 0===d?"":d,c=h()(e,cg),f="button",g="string"==typeof o?function(){return m.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||m.a.Fragment;return _&&(f=cd),m.a.createElement(f,u()({className:b()(["ne-tab flex items-center justify-center select-none",i],{active:t}),onClick:l,"data-cy":"tab-item"},c),o&&m.a.createElement(g,{className:"ne-tab__icon"}),r)};var pg=hg,mg=function(e){var t,n=Object(p.useState)(null===(t=e[0])||void 0===t?void 0:t.key),i=f()(n,2),r=i[0],a=i[1];return[r,function(e){return a(e.key)}]},Fg=function(e){var t=e.buttonLabel,n=void 0===t?"Submit":t,i=e.placeholder,r=e.onSubmit,a=e.className,o=Object(p.useState)(""),s=f()(o,2),l=s[0],u=s[1],d=Object(p.useState)(""),c=f()(d,2),g=c[0],h=c[1];return m.a.createElement("div",{className:b()("neeto-editor-url-form__wrapper",_()({},a,a))},m.a.createElement(J_,{name:"url",value:l,placeholder:i,onFocus:function(){return h("")},error:g,onChange:function(e){var t=e.target.value;return u(t)}}),m.a.createElement(Pd,{size:"large",label:n,onClick:function(e){e.preventDefault(),jd.test(l)?r(l):h("Please enter a valid url")}}))},bg=(n(63),n(75),n(76)),yg=n.n(bg),Eg=(n(77),n(78),n(79),n(80),function(e){var t=e.uppy;return m.a.createElement(yg.a,{note:"Max. File Size: 5MB",uppy:t,locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},className:"neeto-editor-image-uploader__dnd"})}),vg=function(e){var t=e.uppy,n=Object(p.useState)(0),i=f()(n,2),r=i[0],a=i[1];Object(p.useEffect)((function(){t.on("progress",a)}),[t]);var o="".concat(r,"%");return m.a.createElement("div",{className:"neeto-editor-progress-bar__wrapper"},m.a.createElement("div",{className:"neeto-editor-progress-bar__percent"},m.a.createElement("p",null,o),m.a.createElement("button",{type:"button",onClick:t.cancelAll},m.a.createElement(ju.Close,{size:16}))),m.a.createElement("div",{className:"neeto-editor-progress-bar__indicator"},m.a.createElement("div",{style:{width:o},className:"neeto-editor-progress-bar__indicator-inner"})))},kg=n(36),Dg=n.n(kg),Cg=n(92),wg=n.n(Cg),Sg=n(52),Og=n.n(Sg),xg=n(93),Tg=n.n(xg),Ng=n(94),Ag=n.n(Ng),Mg=function(e){var t=e.pageNo,n=e.query,i=e.apiKey;return Ag.a.get("https://api.unsplash.com/search/photos",{headers:{Authorization:"Client-ID ".concat(i)},params:{page:t,per_page:30,order_by:"popular",query:n}})},Rg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,n=Object(p.useState)(e),i=f()(n,2),r=i[0],a=i[1];return Object(p.useEffect)((function(){var n=setTimeout((function(){a(e)}),t);return function(){clearTimeout(n)}}),[e]),r},Ig=function(){return m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__loader"},m.a.createElement("span",{className:"neeto-editor-unsplash-gallery__spinner-icon"}))},Lg=function(e){var t=e.onSubmit,n=e.unsplashApiKey,i=Object(p.useRef)(null),r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1],l=Object(p.useState)(!1),u=f()(l,2),d=u[0],_=u[1],c=Object(p.useState)([]),g=f()(c,2),h=g[0],F=g[1],b=Object(p.useState)(1),y=f()(b,2),E=y[0],v=y[1],k=Object(p.useState)(!0),D=f()(k,2),C=D[0],w=D[1],S=Object(p.useState)(!1),O=f()(S,2),x=O[0],T=O[1],N=Rg(o||"latest");Object(p.useEffect)((function(){A(1)}),[N]);var A=function(){var e=wg()(Og.a.mark((function e(t){var i,r,a,o;return Og.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,T(!0),_(!1),e.next=5,Mg({page:t,query:N,apiKey:n});case 5:i=e.sent,r=i.data,a=r.results,o=r.total_pages,F(1===t?a:[].concat(Dg()(h),Dg()(a))),v(t+1),w(t<o),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),_(!0);case 15:return e.prev=15,T(!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(J_,{name:"text",value:o,placeholder:"Search Unsplash",onChange:function(e){var t=e.target.value;s(t)}}),d&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"Something went wrong! Please try again later."),!d&&!x&&Hu()(h)&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"No results"),!d&&m.a.createElement("div",{className:"neeto-editor-unsplash-container"},m.a.createElement(Tg.a,{ref:i,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:C,loadMore:function(){!x&&C&&E>1&&A(E)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:m.a.createElement(Ig,{key:0})},h&&h.map((function(e,n){return m.a.createElement("div",{key:n,className:"neeto-editor-unsplash-gallery__item"},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(n)},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," "))))}))),!C&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},Bg=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}],Pg=function(e){var t,n=e.editor,i=e.imageUploadUrl,r=e.isVisible,a=e.setIsVisible,o=e.unsplashApiKey,s=e.isUnsplashImageUploadActive,l=Object(p.useState)(!1),u=f()(l,2),d=u[0],_=u[1],c=mg(Bg),g=f()(c,2),h=g[0],F=g[1],b=Object(p.useMemo)((function(){return new Jf.a({allowMultipleUploads:!1,autoProceed:!0,debug:!0}).use(tg.a,{endpoint:i||"/api/v1/direct_uploads",formData:!0,fieldName:"blob"}).on("upload",(function(){return _(!0)})).on("upload-success",(function(e,t){var i=t.body.imageURL;n.chain().focus().setImage({src:i}).run(),a(!1)})).on("cancel-all",(function(){return _(!1)})).on("complete",(function(){return _(!1)}))}),[n]),y=function(e){n.chain().focus().setImage({src:e}).run(),a(!1)},E={local:function(){return m.a.createElement(Eg,{uppy:b})},link:function(){return m.a.createElement(Fg,{onSubmit:y,buttonLabel:"Upload Image",placeholder:"Paste the image link"})},unsplash:function(){return m.a.createElement(Lg,{unsplashApiKey:o,onSubmit:y})}}[h];return m.a.createElement(dg,{isOpen:r,onClose:function(){return a(!1)},closeButton:!1},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement(pg,null,Bg.filter((function(e){return"unsplash"!==e.key||s})).map((function(e){return m.a.createElement(pg.Item,{key:e.key,active:h===e.key,onClick:function(){return F(e)}},e.title)}))),m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},d?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=b.getFiles()[0])||void 0===t?void 0:t.name),m.a.createElement(vg,{uppy:b})):m.a.createElement(E,null))))},jg=n(40),qg=n.n(jg),Ug=n(95);function zg(e,t){return Array(t+1).join(e)}var Hg=["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 Wg(e){return $g(e,Hg)}var Gg=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Yg(e){return $g(e,Gg)}var Vg=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function $g(e,t){return t.indexOf(e.nodeName)>=0}function Kg(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var Qg={};function Zg(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function Xg(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 Jg(e,t,n){for(var i=0;i<e.length;i++){var r=e[i];if(eh(r,t,n))return r}}function eh(e,t,n){var i=e.filter;if("string"==typeof i){if(i===t.nodeName.toLowerCase())return!0}else if(Array.isArray(i)){if(i.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof i)throw new TypeError("`filter` needs to be a string, array, or function");if(i.call(e,t,n))return!0}}function th(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function nh(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}Qg.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},Qg.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},Qg.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var i=Number(t.nodeName.charAt(1));return"setext"===n.headingStyle&&i<3?"\n\n"+e+"\n"+zg(1===i?"=":"-",e.length)+"\n\n":"\n\n"+zg("#",i)+" "+e+"\n\n"}},Qg.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},Qg.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},Qg.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var i=n.bulletListMarker+" ",r=t.parentNode;if("OL"===r.nodeName){var a=r.getAttribute("start"),o=Array.prototype.indexOf.call(r.children,t);i=(a?Number(a)+o:o+1)+". "}return i+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},Qg.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},Qg.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){for(var i,r=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],a=t.firstChild.textContent,o=n.fence.charAt(0),s=3,l=new RegExp("^"+o+"{3,}","gm");i=l.exec(a);)i[0].length>=s&&(s=i[0].length+1);var u=zg(o,s);return"\n\n"+u+r+"\n"+a.replace(/\n$/,"")+"\n"+u+"\n\n"}},Qg.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},Qg.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href"),i=Zg(t.getAttribute("title"));return i&&(i=' "'+i+'"'),"["+e+"]("+n+i+")"}},Qg.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var i,r,a=t.getAttribute("href"),o=Zg(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),n.linkReferenceStyle){case"collapsed":i="["+e+"][]",r="["+e+"]: "+a+o;break;case"shortcut":i="["+e+"]",r="["+e+"]: "+a+o;break;default:var s=this.references.length+1;i="["+e+"]["+s+"]",r="["+s+"]: "+a+o}return this.references.push(r),i},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},Qg.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},Qg.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},Qg.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",i=e.match(/`+/gm)||[];-1!==i.indexOf(n);)n+="`";return n+t+e+t+n}},Qg.image={filter:"img",replacement:function(e,t){var n=Zg(t.getAttribute("alt")),i=t.getAttribute("src")||"",r=Zg(t.getAttribute("title"));return i?"+")":""}},Xg.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=Jg(this.array,e,this.options))||(t=Jg(this._keep,e,this.options))||(t=Jg(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 ih="undefined"!=typeof window?window:{};var rh,ah,oh=function(){var e=ih.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?ih.DOMParser:(rh=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?rh.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:rh.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},rh);function sh(e,t){var n;"string"==typeof e?n=(ah=ah||new oh).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):n=e.cloneNode(!0);return function(e){var t=e.element,n=e.isBlock,i=e.isVoid,r=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!r(t)){for(var a=null,o=!1,s=null,l=nh(s,t,r);l!==t;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \r\n\t]+/g," ");if(a&&!/ $/.test(a.data)||o||" "!==u[0]||(u=u.substr(1)),!u){l=th(l);continue}l.data=u,a=l}else{if(1!==l.nodeType){l=th(l);continue}n(l)||"BR"===l.nodeName?(a&&(a.data=a.data.replace(/ $/,"")),a=null,o=!1):i(l)||r(l)?(a=null,o=!0):a&&(o=!1)}var d=nh(s,l,r);s=l,l=d}a&&(a.data=a.data.replace(/ $/,""),a.data||th(a))}}({element:n,isBlock:Wg,isVoid:Yg,isPre:t.preformattedCode?lh:null}),n}function lh(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function uh(e,t){return e.isBlock=Wg(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!Yg(e)&&!function(e){return $g(e,Vg)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return Kg(e,Gg)}(e)&&!function(e){return Kg(e,Vg)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=(i=e.textContent,r=i.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/),{leading:r[1],leadingAscii:r[2],leadingNonAscii:r[3],trailing:r[4],trailingNonAscii:r[5],trailingAscii:r[6]});var i,r;n.leadingAscii&&dh("left",e,t)&&(n.leading=n.leadingNonAscii);n.trailingAscii&&dh("right",e,t)&&(n.trailing=n.trailingNonAscii);return{leading:n.leading,trailing:n.trailing}}(e,t),e}function dh(e,t,n){var i,r,a;return"left"===e?(i=t.previousSibling,r=/ $/):(i=t.nextSibling,r=/^ /),i&&(3===i.nodeType?a=r.test(i.nodeValue):n.preformattedCode&&"CODE"===i.nodeName?a=!1:1!==i.nodeType||Wg(i)||(a=r.test(i.textContent))),a}var _h=Array.prototype.reduce,ch=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function fh(e){if(!(this instanceof fh))return new fh(e);var t={rules:Qg,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 n=arguments[t];for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])}return e}({},t,e),this.rules=new Xg(this.options)}function gh(e){var t=this;return _h.call(e.childNodes,(function(e,n){var i="";return 3===(n=new uh(n,t.options)).nodeType?i=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(i=ph.call(t,n)),mh(e,i)}),"")}function hh(e){var t=this;return this.rules.forEach((function(n){"function"==typeof n.append&&(e=mh(e,n.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function ph(e){var t=this.rules.forNode(e),n=gh.call(this,e),i=e.flankingWhitespace;return(i.leading||i.trailing)&&(n=n.trim()),i.leading+t.replacement(n,e,this.options)+i.trailing}function mh(e,t){var n=function(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),i=t.replace(/^\n*/,""),r=Math.max(e.length-n.length,t.length-i.length);return n+"\n\n".substring(0,r)+i}fh.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=gh.call(this,new sh(e,this.options));return hh.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 ch.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};var Fh=fh,bh=function(e){e=e.replaceAll(/^\\$/gm,"<p></p>");var t=Ug.marked.parse(e);return t=(t=(t=t.replace(/<p><img[^>]*><\/p>/g,(function(e){return e.replace(/<\/?p>/g,"")}))).replaceAll(/==([^=]+)==/g,"<mark>$1</mark>")).replaceAll(/--([^-]+)--/g,"<u>$1</u>"),qg.a.sanitize(t)},yh=["editor","className","style","strategy","onChange","onSubmit","initialValue"],Eh=function(e){var t=e.editor,n=e.className,i=e.style,r=e.strategy,a=e.onChange,o=e.onSubmit,s=e.initialValue,l=h()(e,yh),d=Object(p.useState)((function(){return e=(null==t?void 0:t.getHTML())||s,(n=new Fh({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){return t.isBlock?"\\\n":""}})).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~".concat(e,"~")}}),n.addRule("highlight",{filter:["mark"],replacement:function(e){return"==".concat(e,"==")}}),n.addRule("underline",{filter:["u"],replacement:function(e){return"--".concat(e,"--")}}),n.turndown(e);var e,n})),c=f()(d,2),g=c[0],F=c[1],y=Object(p.useRef)(),E=Object(p.useRef)(g);Object(p.useEffect)((function(){E.current=g}),[g]),Object(p.useEffect)((function(){return document.addEventListener("keydown",v),function(){null==t||t.commands.setContent(bh(E.current)),document.removeEventListener("keydown",v)}}),[]),Object(p.useLayoutEffect)((function(){y.current.style=i,"flexible"===r&&(y.current.style.height=y.current.scrollHeight+2+"px")}),[g]);var v=function(e){"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null==o||o(bh(E.current)),y.current.blur())};return m.a.createElement("textarea",u()({ref:y,value:g,onChange:function(e){F(e.target.value),null==a||a(e.target.value)},className:b()("ProseMirror neeto-editor-markdown",_()({},n,n))},l))};const vh=/^\s*>\s$/,kh=cs.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",rs(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:vh,type:this.type})]}}),Dh=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Ch=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,wh=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Sh=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Oh=fs.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",rs(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:Dh,type:this.type}),ps({find:wh,type:this.type})]},addPasteRules(){return[ys({find:Ch,type:this.type}),ys({find:Sh,type:this.type})]}}),xh=/^\s*([-+*])\s$/,Th=cs.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",rs(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:xh,type:this.type})]}}),Nh=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Ah=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Mh=fs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",rs(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:Nh,type:this.type})]},addPasteRules(){return[ys({find:Ah,type:this.type})]}}),Rh=/^```(?<language>[a-z]*)?[\s\n]$/,Ih=/^~~~(?<language>[a-z]*)?[\s\n]$/,Lh=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:n}=this.options,i=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return i||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,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[ms({find:Rh,type:this.type,getAttributes:({groups:e})=>e}),ms({find:Ih,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Mt({key:new Lt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),i=t.clipboardData.getData("vscode-editor-data"),r=i?JSON.parse(i):void 0,a=null==r?void 0:r.mode;if(!n||!a)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:a})),o.setSelection(mt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(n.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}});var Bh=cs.create({name:"doc",topNode:!0,content:"block+"});var Ph=function(e,t){var n=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 i=function(e){return n[t](e)};return e.dom.addEventListener(t,i),{name:t,handler:i}}))};Ph.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,i=t.handler;return e.editorView.dom.removeEventListener(n,i)}))},Ph.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())},Ph.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},Ph.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,i=t.nodeAfter;if(n||i){var r=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),a=n?r.bottom:r.top;n&&i&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:r.left,right:r.right,top:a-this.width/2,bottom:a+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 d=u.getBoundingClientRect();s=d.left-u.scrollLeft,l=d.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"},Ph.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},Ph.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var n=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=Je(this.editorView.state.doc,n,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}},Ph.prototype.dragend=function(){this.scheduleRemoval(20)},Ph.prototype.drop=function(){this.scheduleRemoval(20)},Ph.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const jh=ma.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Mt({view:function(t){return new Ph(t,e)}}))];var e}});var qh=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(n,i){var r=n.resolve(i.map(this.head));return t.valid(r)?new t(r):e.near(r)},t.prototype.content=function(){return x.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,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new Uh(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t);if(0!=n)for(var i=e.node(t).child(n-1);;i=i.lastChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),i=e.node(t);if(n!=i.childCount)for(var r=i.child(n);;r=r.firstChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock},t.findFrom=function(e,n,i){e:for(;;){if(!i&&t.valid(e))return e;for(var r=e.pos,a=null,o=e.depth;;o--){var s=e.node(o);if(n>0?e.indexAfter(o)<s.childCount:e.index(o)>0){a=s.child(n>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;r+=n;var l=e.doc.resolve(r);if(t.valid(l))return l}for(;;){var u=n>0?a.firstChild:a.lastChild;if(!u){if(a.isAtom&&!a.isText&&!bt.isSelectable(a)){e=e.doc.resolve(r+a.nodeSize*n),i=!1;continue e}break}a=u,r+=n;var d=e.doc.resolve(r);if(t.valid(d))return d}return null}},t}(gt);qh.prototype.visible=!1,gt.jsonID("gapcursor",qh);var Uh=function(e){this.pos=e};Uh.prototype.map=function(e){return new Uh(e.map(this.pos))},Uh.prototype.resolve=function(e){var t=e.resolve(this.pos);return qh.valid(t)?new qh(t):gt.near(t)};var zh=_a({ArrowLeft:Hh("horiz",-1),ArrowRight:Hh("horiz",1),ArrowUp:Hh("vert",-1),ArrowDown:Hh("vert",1)});function Hh(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,i,r){var a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof mt){if(!r.endOfTextblock(n)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=qh.findFrom(o,t,s);return!!l&&(i&&i(e.tr.setSelection(new qh(l))),!0)}}function Wh(e,t,n){if(!e.editable)return!1;var i=e.state.doc.resolve(t);if(!qh.valid(i))return!1;var r=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(r>-1&&bt.isSelectable(e.state.doc.nodeAt(r)))&&(e.dispatch(e.state.tr.setSelection(new qh(i))),!0)}function Gh(e){if(!(e.selection instanceof qh))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Rr.create(e.doc,[Tr.widget(e.selection.head,t,{key:"gapcursor"})])}const Yh=ma.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Mt({props:{decorations:Gh,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&qh.valid(n))return new qh(n)},handleClick:Wh,handleKeyDown:zh}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=ha(pa(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),Vh=cs.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",rs(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:i})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:r}=i.extensionManager,a=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&a&&e){const e=a.filter(e=>r.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),$h=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]),rs(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 Kh=function(){};Kh.prototype.append=function(e){return e.length?(e=Kh.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},Kh.prototype.prepend=function(e){return e.length?Kh.from(e).append(this):this},Kh.prototype.appendInner=function(e){return new Zh(this,e)},Kh.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Kh.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Kh.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Kh.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Kh.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var i=[];return this.forEach((function(t,n){return i.push(e(t,n))}),t,n),i},Kh.from=function(e){return e instanceof Kh?e:e&&e.length?new Qh(e):Kh.empty};var Qh=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 n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,i){for(var r=t;r<n;r++)if(!1===e(this.values[r],i+r))return!1},t.prototype.forEachInvertedInner=function(e,t,n,i){for(var r=t-1;r>=n;r--)if(!1===e(this.values[r],i+r))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))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Kh);Kh.empty=new Qh([]);var Zh=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.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,n,i){var r=this.left.length;return!(t<r&&!1===this.left.forEachInner(e,t,Math.min(n,r),i))&&(!(n>r&&!1===this.right.forEachInner(e,Math.max(t-r,0),Math.min(this.length,n)-r,i+r))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,i){var r=this.left.length;return!(t>r&&!1===this.right.forEachInvertedInner(e,t-r,Math.max(n,r)-r,i+r))&&(!(n<r&&!1===this.left.forEachInvertedInner(e,Math.min(t,r),n,i))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,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}(Kh),Xh=Kh,Jh=function(e,t){this.items=e,this.eventCount=t};Jh.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var i,r,a=this.items.length;;a--){if(this.items.get(a-1).selection){--a;break}}t&&(i=this.remapping(a,this.items.length),r=i.maps.length);var o,s,l=e.tr,u=[],d=[];return this.items.forEach((function(e,t){if(!e.step)return i||(i=n.remapping(a,t+1),r=i.maps.length),r--,void d.push(e);if(i){d.push(new ep(e.map));var _,c=e.step.map(i.slice(r));c&&l.maybeStep(c).doc&&(_=l.mapping.maps[l.mapping.maps.length-1],u.push(new ep(_,null,null,u.length+d.length))),r--,_&&i.appendMap(_,r)}else l.maybeStep(e.step);return e.selection?(o=i?e.selection.map(i.slice(r)):e.selection,s=new Jh(n.items.slice(0,a).append(d.reverse().concat(u)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}},Jh.prototype.addTransform=function(e,t,n,i){for(var r=[],a=this.eventCount,o=this.items,s=!i&&o.length?o.get(o.length-1):null,l=0;l<e.steps.length;l++){var u,d=e.steps[l].invert(e.docs[l]),_=new ep(e.mapping.maps[l],d,t);(u=s&&s.merge(_))&&(_=u,l?r.pop():o=o.slice(0,o.length-1)),r.push(_),t&&(a++,t=null),i||(s=_)}var c,f,g,h=a-n.depth;return h>np&&(f=h,(c=o).forEach((function(e,t){if(e.selection&&0==f--)return g=t,!1})),o=c.slice(g),a-=h),new Jh(o.append(r),a)},Jh.prototype.remapping=function(e,t){var n=new Ie;return this.items.forEach((function(t,i){var r=null!=t.mirrorOffset&&i-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,r)}),e,t),n},Jh.prototype.addMaps=function(e){return 0==this.eventCount?this:new Jh(this.items.append(e.map((function(e){return new ep(e)}))),this.eventCount)},Jh.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],i=Math.max(0,this.items.length-t),r=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),i);var s=t;this.items.forEach((function(t){var i=r.getMirror(--s);if(null!=i){a=Math.min(a,i);var l=r.maps[i];if(t.step){var u=e.steps[i].invert(e.docs[i]),d=t.selection&&t.selection.map(r.slice(s+1,i));d&&o++,n.push(new ep(l,u,d))}else n.push(new ep(l))}}),i);for(var l=[],u=t;u<a;u++)l.push(new ep(r.maps[u]));var d=this.items.slice(0,i).append(l).append(n),_=new Jh(d,o);return _.emptyItemCount()>500&&(_=_.compress(this.items.length-n.length)),_},Jh.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},Jh.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,i=[],r=0;return this.items.forEach((function(a,o){if(o>=e)i.push(a),a.selection&&r++;else if(a.step){var s=a.step.map(t.slice(n)),l=s&&s.getMap();if(n--,l&&t.appendMap(l,n),s){var u=a.selection&&a.selection.map(t.slice(n));u&&r++;var d,_=new ep(l.invert(),s,u),c=i.length-1;(d=i.length&&i[c].merge(_))?i[c]=d:i.push(_)}}else a.map&&n--}),this.items.length,0),new Jh(Xh.from(i.reverse()),r)},Jh.empty=new Jh(Xh.empty,0);var ep=function(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i};ep.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new ep(t.getMap().invert(),t,this.selection)}};var tp=function(e,t,n,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i},np=20;function ip(e){var t=[];return e.forEach((function(e,n,i,r){return t.push(i,r)})),t}function rp(e,t){if(!e)return null;for(var n=[],i=0;i<e.length;i+=2){var r=t.map(e[i],1),a=t.map(e[i+1],-1);r<=a&&n.push(r,a)}return n}function ap(e,t,n,i){var r=lp(t),a=up.get(t).spec.config,o=(i?e.undone:e.done).popEvent(t,r);if(o){var s=o.selection.resolve(o.transform.doc),l=(i?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),a,r),u=new tp(i?l:o.remaining,i?o.remaining:l,null,0);n(o.transform.setSelection(s).setMeta(up,{redo:i,historyState:u}).scrollIntoView())}}var op=!1,sp=null;function lp(e){var t=e.plugins;if(sp!=t){op=!1,sp=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){op=!0;break}}return op}var up=new Lt("history"),dp=new Lt("closeHistory");function _p(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Mt({key:up,state:{init:function(){return new tp(Jh.empty,Jh.empty,null,0)},apply:function(t,n,i){return function(e,t,n,i){var r,a=n.getMeta(up);if(a)return a.historyState;n.getMeta(dp)&&(e=new tp(e.done,e.undone,null,0));var o=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(o&&o.getMeta(up))return o.getMeta(up).redo?new tp(e.done.addTransform(n,null,i,lp(t)),e.undone,ip(n.mapping.maps[n.steps.length-1]),e.prevTime):new tp(e.done,e.undone.addTransform(n,null,i,lp(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new tp(e.done.rebased(n,r),e.undone.rebased(n,r),rp(e.prevRanges,n.mapping),e.prevTime):new tp(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),rp(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(n.time||0)-i.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,i){for(var r=0;r<t.length;r+=2)e<=t[r+1]&&i>=t[r]&&(n=!0)})),n}(n,e.prevRanges)),l=o?rp(e.prevRanges,n.mapping):ip(n.mapping.maps[n.steps.length-1]);return new tp(e.done.addTransform(n,s?t.selection.getBookmark():null,i,lp(t)),Jh.empty,l,n.time)}(n,i,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n="historyUndo"==t.inputType?cp(e.state,e.dispatch):"historyRedo"==t.inputType&&fp(e.state,e.dispatch);return n&&t.preventDefault(),n}}}})}function cp(e,t){var n=up.getState(e);return!(!n||0==n.done.eventCount)&&(t&&ap(n,e,t,!1),!0)}function fp(e,t){var n=up.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&ap(n,e,t,!0),!0)}const gp=ma.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>cp(e,t),redo:()=>({state:e,dispatch:t})=>fp(e,t)}),addProseMirrorPlugins(){return[_p(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()}}}),hp=cs.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",rs(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:i,$anchor:r}=n,a=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;if(!i||!a||!t)return!0;const o=r.before(),s=r.start();return e.deleteRange(o,s),e.setSelection(mt.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var n;if(t){const{parent:t,pos:i}=e.selection.$from,r=i+1;if(!e.doc.nodeAt(r)){const i=null===(n=t.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(e.insert(r,i),e.setSelection(mt.create(e.doc,r)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[gs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),pp=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,mp=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Fp=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,bp=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,yp=fs.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",rs(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:pp,type:this.type}),ps({find:Fp,type:this.type})]},addPasteRules(){return[ys({find:mp,type:this.type}),ys({find:bp,type:this.type})]}}),Ep=cs.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",rs(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")}}}),vp=/^(\d+)\.\s$/,kp=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,...n}=e;return 1===t?["ol",rs(this.options.HTMLAttributes,n),0]:["ol",rs(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:vp,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),Dp=cs.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",rs(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Cp=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,wp=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Sp=fs.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",rs(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:Cp,type:this.type})]},addPasteRules(){return[ys({find:wp,type:this.type})]}});var Op=cs.create({name:"text",group:"inline"});const xp=ma.create({name:"starterKit",addExtensions(){var e,t,n,i,r,a,o,s,l,u,d,_,c,f,g,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(kh.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(Oh.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(Th.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&F.push(Mh.configure(null===(i=this.options)||void 0===i?void 0:i.code)),!1!==this.options.codeBlock&&F.push(Lh.configure(null===(r=this.options)||void 0===r?void 0:r.codeBlock)),!1!==this.options.document&&F.push(Bh.configure(null===(a=this.options)||void 0===a?void 0:a.document)),!1!==this.options.dropcursor&&F.push(jh.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(Yh.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(Vh.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push($h.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push(gp.configure(null===(d=this.options)||void 0===d?void 0:d.history)),!1!==this.options.horizontalRule&&F.push(hp.configure(null===(_=this.options)||void 0===_?void 0:_.horizontalRule)),!1!==this.options.italic&&F.push(yp.configure(null===(c=this.options)||void 0===c?void 0:c.italic)),!1!==this.options.listItem&&F.push(Ep.configure(null===(f=this.options)||void 0===f?void 0:f.listItem)),!1!==this.options.orderedList&&F.push(kp.configure(null===(g=this.options)||void 0===g?void 0:g.orderedList)),!1!==this.options.paragraph&&F.push(Dp.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(Sp.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(Op.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),Tp=Fs({find:/--$/,replace:"—"}),Np=Fs({find:/\.\.\.$/,replace:"…"}),Ap=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),Mp=Fs({find:/"$/,replace:"”"}),Rp=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),Ip=Fs({find:/'$/,replace:"’"}),Lp=Fs({find:/<-$/,replace:"←"}),Bp=Fs({find:/->$/,replace:"→"}),Pp=Fs({find:/\(c\)$/,replace:"©"}),jp=Fs({find:/\(tm\)$/,replace:"™"}),qp=Fs({find:/\(r\)$/,replace:"®"}),Up=Fs({find:/1\/2$/,replace:"½"}),zp=Fs({find:/\+\/-$/,replace:"±"}),Hp=Fs({find:/!=$/,replace:"≠"}),Wp=Fs({find:/<<$/,replace:"«"}),Gp=Fs({find:/>>$/,replace:"»"}),Yp=Fs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),Vp=Fs({find:/\^2$/,replace:"²"}),$p=Fs({find:/\^3$/,replace:"³"}),Kp=Fs({find:/1\/4$/,replace:"¼"}),Qp=Fs({find:/3\/4$/,replace:"¾"}),Zp=ma.create({name:"typography",addInputRules:()=>[Tp,Np,Ap,Mp,Rp,Ip,Lp,Bp,Pp,jp,qp,Up,zp,Hp,Wp,Gp,Yp,Vp,$p,Kp,Qp]}),Xp=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,Jp=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,em=fs.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",rs(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:Xp,type:this.type})]},addPasteRules(){return[ys({find:Jp,type:this.type})]}});var tm=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},nm={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};tm.prototype.nodesBetween=function(e,t,n,i,r){void 0===i&&(i=0);for(var a=0,o=0;o<t;a++){var s=this.content[a],l=o+s.nodeSize;if(l>e&&!1!==n(s,i+o,r,a)&&s.content.size){var u=o+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),n,i+u)}o=l}},tm.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},tm.prototype.textBetween=function(e,t,n,i){var r="",a=!0;return this.nodesBetween(e,t,(function(o,s){o.isText?(r+=o.text.slice(Math.max(e,s)-s,t-s),a=!n):o.isLeaf&&i?(r+="function"==typeof i?i(o):i,a=!n):!a&&o.isBlock&&(r+=n,a=!0)}),0),r},tm.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,i=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),r=1);r<e.content.length;r++)i.push(e.content[r]);return new tm(i,this.size+e.size)},tm.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var n=[],i=0;if(t>e)for(var r=0,a=0;a<t;r++){var o=this.content[r],s=a+o.nodeSize;s>e&&((a<e||s>t)&&(o=o.isText?o.cut(Math.max(0,e-a),Math.min(o.text.length,t-a)):o.cut(Math.max(0,e-a-1),Math.min(o.content.size,t-a-1))),n.push(o),i+=o.nodeSize),a=s}return new tm(n,i)},tm.prototype.cutByIndex=function(e,t){return e==t?tm.empty:0==e&&t==this.content.length?this:new tm(this.content.slice(e,t))},tm.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var i=this.content.slice(),r=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new tm(i,r)},tm.prototype.addToStart=function(e){return new tm([e].concat(this.content),this.size+e.nodeSize)},tm.prototype.addToEnd=function(e){return new tm(this.content.concat(e),this.size+e.nodeSize)},tm.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},nm.firstChild.get=function(){return this.content.length?this.content[0]:null},nm.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},nm.childCount.get=function(){return this.content.length},tm.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},tm.prototype.maybeChild=function(e){return this.content[e]},tm.prototype.forEach=function(e){for(var t=0,n=0;t<this.content.length;t++){var i=this.content[t];e(i,n,t),n+=i.nodeSize}},tm.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,n,i){for(var r=0;;r++){if(r==t.childCount||r==n.childCount)return t.childCount==n.childCount?null:i;var a=t.child(r),o=n.child(r);if(a!=o){if(!a.sameMarkup(o))return i;if(a.isText&&a.text!=o.text){for(var s=0;a.text[s]==o.text[s];s++)i++;return i}if(a.content.size||o.content.size){var l=e(a.content,o.content,i+1);if(null!=l)return l}i+=a.nodeSize}else i+=a.nodeSize}}(this,e,t)},tm.prototype.findDiffEnd=function(e,t,n){return void 0===t&&(t=this.size),void 0===n&&(n=e.size),function e(t,n,i,r){for(var a=t.childCount,o=n.childCount;;){if(0==a||0==o)return a==o?null:{a:i,b:r};var s=t.child(--a),l=n.child(--o),u=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:i,b:r};if(s.isText&&s.text!=l.text){for(var d=0,_=Math.min(s.text.length,l.text.length);d<_&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,i--,r--;return{a:i,b:r}}if(s.content.size||l.content.size){var c=e(s.content,l.content,i-1,r-1);if(c)return c}i-=u,r-=u}else i-=u,r-=u}}(this,e,t,n)},tm.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return rm(0,e);if(e==this.size)return rm(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,i=0;;n++){var r=i+this.child(n).nodeSize;if(r>=e)return r==e||t>0?rm(n+1,r):rm(n,i);i=r}},tm.prototype.toString=function(){return"<"+this.toStringInner()+">"},tm.prototype.toStringInner=function(){return this.content.join(", ")},tm.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},tm.fromJSON=function(e,t){if(!t)return tm.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new tm(t.map(e.nodeFromJSON))},tm.fromArray=function(e){if(!e.length)return tm.empty;for(var t,n=0,i=0;i<e.length;i++){var r=e[i];n+=r.nodeSize,i&&r.isText&&e[i-1].sameMarkup(r)?(t||(t=e.slice(0,i)),t[t.length-1]=r.withText(t[t.length-1].text+r.text)):t&&t.push(r)}return new tm(t||e,n)},tm.from=function(e){if(!e)return tm.empty;if(e instanceof tm)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new tm([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(tm.prototype,nm);var im={index:0,offset:0};function rm(e,t){return im.index=e,im.offset=t,im}function am(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!am(e[i],t[i]))return!1}else{for(var r in e)if(!(r in t)||!am(e[r],t[r]))return!1;for(var a in t)if(!(a in e))return!1}return!0}tm.empty=new tm([],0);var om=function(e,t){this.type=e,this.attrs=t};function sm(e){var t=Error.call(this,e);return t.__proto__=sm.prototype,t}om.prototype.addToSet=function(e){for(var t,n=!1,i=0;i<e.length;i++){var r=e[i];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,i));else{if(r.type.excludes(this.type))return e;!n&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(r)}}return t||(t=e.slice()),n||t.push(this),t},om.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},om.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},om.prototype.eq=function(e){return this==e||this.type==e.type&&am(this.attrs,e.attrs)},om.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},om.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type "+t.type+" in this schema");return n.create(t.attrs)},om.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0},om.setFrom=function(e){if(!e||0==e.length)return om.none;if(e instanceof om)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},om.none=[],sm.prototype=Object.create(Error.prototype),sm.prototype.constructor=sm,sm.prototype.name="ReplaceError";var lm=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},um={size:{configurable:!0}};function dm(e,t,n){if(n.openStart>e.depth)throw new sm("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new sm("Inconsistent open depths");return function e(t,n,i,r){var a=t.index(r),o=t.node(r);if(a==n.index(r)&&r<t.depth-i.openStart){var s=e(t,n,i,r+1);return o.copy(o.content.replaceChild(a,s))}if(i.content.size){if(i.openStart||i.openEnd||t.depth!=r||n.depth!=r){var l=function(e,t){for(var n=t.depth-e.openStart,i=t.node(n).copy(e.content),r=n-1;r>=0;r--)i=t.node(r).copy(tm.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(i,t),u=l.start,d=l.end;return hm(o,function e(t,n,i,r,a){var o=t.depth>a&&cm(t,n,a+1),s=r.depth>a&&cm(i,r,a+1),l=[];gm(null,t,a,l),o&&s&&n.index(a)==i.index(a)?(_m(o,s),fm(hm(o,e(t,n,i,r,a+1)),l)):(o&&fm(hm(o,pm(t,n,a+1)),l),gm(n,i,a,l),s&&fm(hm(s,pm(i,r,a+1)),l));return gm(r,null,a,l),new tm(l)}(t,u,d,n,r))}var _=t.parent,c=_.content;return hm(_,c.cut(0,t.parentOffset).append(i.content).append(c.cut(n.parentOffset)))}return hm(o,pm(t,n,r))}(e,t,n,0)}function _m(e,t){if(!t.type.compatibleContent(e.type))throw new sm("Cannot join "+t.type.name+" onto "+e.type.name)}function cm(e,t,n){var i=e.node(n);return _m(i,t.node(n)),i}function fm(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function gm(e,t,n,i){var r=(t||e).node(n),a=0,o=t?t.index(n):r.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(fm(e.nodeAfter,i),a++));for(var s=a;s<o;s++)fm(r.child(s),i);t&&t.depth==n&&t.textOffset&&fm(t.nodeBefore,i)}function hm(e,t){if(!e.type.validContent(t))throw new sm("Invalid content for node "+e.type.name);return e.copy(t)}function pm(e,t,n){var i=[];(gm(null,e,n,i),e.depth>n)&&fm(hm(cm(e,t,n+1),pm(e,t,n+1)),i);return gm(t,null,n,i),new tm(i)}um.size.get=function(){return this.content.size-this.openStart-this.openEnd},lm.prototype.insertAt=function(e,t){var n=function e(t,n,i,r){var a=t.findIndex(n),o=a.index,s=a.offset,l=t.maybeChild(o);if(s==n||l.isText)return r&&!r.canReplace(o,o,i)?null:t.cut(0,n).append(i).append(t.cut(n));var u=e(l.content,n-s-1,i);return u&&t.replaceChild(o,l.copy(u))}(this.content,e+this.openStart,t,null);return n&&new lm(n,this.openStart,this.openEnd)},lm.prototype.removeBetween=function(e,t){return new lm(function e(t,n,i){var r=t.findIndex(n),a=r.index,o=r.offset,s=t.maybeChild(a),l=t.findIndex(i),u=l.index,d=l.offset;if(o==n||s.isText){if(d!=i&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(i))}if(a!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(a,s.copy(e(s.content,n-o-1,i-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},lm.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},lm.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},lm.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},lm.fromJSON=function(e,t){if(!t)return lm.empty;var n=t.openStart||0,i=t.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new lm(tm.fromJSON(e,t.content),n,i)},lm.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,i=0,r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(var a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new lm(e,n,i)},Object.defineProperties(lm.prototype,um),lm.empty=new lm(tm.empty,0,0);var mm=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},Fm={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};mm.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},Fm.parent.get=function(){return this.node(this.depth)},Fm.doc.get=function(){return this.node(0)},mm.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},mm.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},mm.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},mm.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},mm.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},mm.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]},mm.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},Fm.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Fm.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i},Fm.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)},mm.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],i=0==t?0:this.path[3*t-1]+1,r=0;r<e;r++)i+=n.child(r).nodeSize;return i},mm.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return om.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){var r=n;n=i,i=r}for(var a=n.marks,o=0;o<a.length;o++)!1!==a[o].type.spec.inclusive||i&&a[o].isInSet(i.marks)||(a=a[o--].removeFromSet(a));return a},mm.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,i=e.parent.maybeChild(e.index()),r=0;r<n.length;r++)!1!==n[r].type.spec.inclusive||i&&n[r].isInSet(i.marks)||(n=n[r--].removeFromSet(n));return n},mm.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},mm.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new vm(this,e,n)},mm.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},mm.prototype.max=function(e){return e.pos>this.pos?e:this},mm.prototype.min=function(e){return e.pos<this.pos?e:this},mm.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},mm.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],i=0,r=t,a=e;;){var o=a.content.findIndex(r),s=o.index,l=o.offset,u=r-l;if(n.push(a,s,i+l),!u)break;if((a=a.child(s)).isText)break;r=u-1,i+=l+1}return new mm(t,n,r)},mm.resolveCached=function(e,t){for(var n=0;n<bm.length;n++){var i=bm[n];if(i.pos==t&&i.doc==e)return i}var r=bm[ym]=mm.resolve(e,t);return ym=(ym+1)%Em,r},Object.defineProperties(mm.prototype,Fm);var bm=[],ym=0,Em=12,vm=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},km={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};km.start.get=function(){return this.$from.before(this.depth+1)},km.end.get=function(){return this.$to.after(this.depth+1)},km.parent.get=function(){return this.$from.node(this.depth)},km.startIndex.get=function(){return this.$from.index(this.depth)},km.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(vm.prototype,km);var Dm=Object.create(null),Cm=function(e,t,n,i){this.type=e,this.attrs=t,this.content=n||tm.empty,this.marks=i||om.none},wm={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}};wm.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},wm.childCount.get=function(){return this.content.childCount},Cm.prototype.child=function(e){return this.content.child(e)},Cm.prototype.maybeChild=function(e){return this.content.maybeChild(e)},Cm.prototype.forEach=function(e){this.content.forEach(e)},Cm.prototype.nodesBetween=function(e,t,n,i){void 0===i&&(i=0),this.content.nodesBetween(e,t,n,i,this)},Cm.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},wm.textContent.get=function(){return this.textBetween(0,this.content.size,"")},Cm.prototype.textBetween=function(e,t,n,i){return this.content.textBetween(e,t,n,i)},wm.firstChild.get=function(){return this.content.firstChild},wm.lastChild.get=function(){return this.content.lastChild},Cm.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},Cm.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},Cm.prototype.hasMarkup=function(e,t,n){return this.type==e&&am(this.attrs,t||e.defaultAttrs||Dm)&&om.sameSet(this.marks,n||om.none)},Cm.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},Cm.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},Cm.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},Cm.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return lm.empty;var i=this.resolve(e),r=this.resolve(t),a=n?0:i.sharedDepth(t),o=i.start(a),s=i.node(a).content.cut(i.pos-o,r.pos-o);return new lm(s,i.depth-a,r.depth-a)},Cm.prototype.replace=function(e,t,n){return dm(this.resolve(e),this.resolve(t),n)},Cm.prototype.nodeAt=function(e){for(var t=this;;){var n=t.content.findIndex(e),i=n.index,r=n.offset;if(!(t=t.maybeChild(i)))return null;if(r==e||t.isText)return t;e-=r+1}},Cm.prototype.childAfter=function(e){var t=this.content.findIndex(e),n=t.index,i=t.offset;return{node:this.content.maybeChild(n),index:n,offset:i}},Cm.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,i=t.offset;if(i<e)return{node:this.content.child(n),index:n,offset:i};var r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}},Cm.prototype.resolve=function(e){return mm.resolveCached(this,e)},Cm.prototype.resolveNoCache=function(e){return mm.resolve(this,e)},Cm.prototype.rangeHasMark=function(e,t,n){var i=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(i=!0),!i})),i},wm.isBlock.get=function(){return this.type.isBlock},wm.isTextblock.get=function(){return this.type.isTextblock},wm.inlineContent.get=function(){return this.type.inlineContent},wm.isInline.get=function(){return this.type.isInline},wm.isText.get=function(){return this.type.isText},wm.isLeaf.get=function(){return this.type.isLeaf},wm.isAtom.get=function(){return this.type.isAtom},Cm.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 n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}(this.marks,e)},Cm.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},Cm.prototype.canReplace=function(e,t,n,i,r){void 0===n&&(n=tm.empty),void 0===i&&(i=0),void 0===r&&(r=n.childCount);var a=this.contentMatchAt(e).matchFragment(n,i,r),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(var s=i;s<r;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0},Cm.prototype.canReplaceWith=function(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;var r=this.contentMatchAt(e).matchType(n),a=r&&r.matchFragment(this.content,t);return!!a&&a.validEnd},Cm.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},Cm.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=om.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!om.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()}))},Cm.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},Cm.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=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,n)}var i=tm.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)},Object.defineProperties(Cm.prototype,wm);var Sm=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},Om={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};Sm.parse=function(e,t){var n=new xm(e,t);if(null==n.next)return Sm.empty;var i=Nm(n);n.next&&n.err("Unexpected trailing text");var r=function(e){var t=Object.create(null);return function n(i){var r=[];i.forEach((function(t){e[t].forEach((function(t){var n=t.term,i=t.to;if(n){var a=r.indexOf(n),o=a>-1&&r[a+1];Bm(e,i).forEach((function(e){o||r.push(n,o=[]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var a=t[i.join(",")]=new Sm(i.indexOf(e.length-1)>-1),o=0;o<r.length;o+=2){var s=r[o+1].sort(Lm);a.next.push(r[o],t[s.join(",")]||n(s))}return a}(Bm(e,0))}(function(e){var t=[[]];return r(function e(t,a){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(e(n,a))}),[]);if("seq"==t.type)for(var o=0;;o++){var s=e(t.exprs[o],a);if(o==t.exprs.length-1)return s;r(s,a=n())}else{if("star"==t.type){var l=n();return i(a,l),r(e(t.expr,l),l),[i(l)]}if("plus"==t.type){var u=n();return r(e(t.expr,a),u),r(e(t.expr,u),u),[i(u)]}if("opt"==t.type)return[i(a)].concat(e(t.expr,a));if("range"==t.type){for(var d=a,_=0;_<t.min;_++){var c=n();r(e(t.expr,d),c),d=c}if(-1==t.max)r(e(t.expr,d),d);else for(var f=t.min;f<t.max;f++){var g=n();i(d,g),r(e(t.expr,d),g),d=g}return[i(d)]}if("name"==t.type)return[i(a,null,t.value)]}}(e,0),n()),t;function n(){return t.push([])-1}function i(e,n,i){var r={term:i,to:n};return t[e].push(r),r}function r(e,t){e.forEach((function(e){return e.to=t}))}}(i));return function(e,t){for(var n=0,i=[e];n<i.length;n++){for(var r=i[n],a=!r.validEnd,o=[],s=0;s<r.next.length;s+=2){var l=r.next[s],u=r.next[s+1];o.push(l.name),!a||l.isText||l.hasRequiredAttrs()||(a=!1),-1==i.indexOf(u)&&i.push(u)}a&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(r,n),r},Sm.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},Sm.prototype.matchFragment=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.childCount);for(var i=this,r=t;i&&r<n;r++)i=i.matchType(e.child(r).type);return i},Om.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},Om.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}},Sm.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[t]==e.next[n])return!0;return!1},Sm.prototype.fillBefore=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=0);var i=[this];return function r(a,o){var s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return tm.from(o.map((function(e){return e.createAndFill()})));for(var l=0;l<a.next.length;l+=2){var u=a.next[l],d=a.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==i.indexOf(d)){i.push(d);var _=r(d,o.concat(u));if(_)return _}}}(this,[])},Sm.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 n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},Sm.prototype.computeWrapping=function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var i=n.shift(),r=i.match;if(r.matchType(e)){for(var a=[],o=i;o.type;o=o.via)a.push(o.type);return a.reverse()}for(var s=0;s<r.next.length;s+=2){var l=r.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||i.type&&!r.next[s+1].validEnd||(n.push({match:l.contentMatch,type:l,via:i}),t[l.name]=!0)}}},Om.edgeCount.get=function(){return this.next.length>>1},Sm.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]}},Sm.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var i=1;i<n.next.length;i+=2)-1==e.indexOf(n.next[i])&&t(n.next[i])}(this),e.map((function(t,n){for(var i=n+(t.validEnd?"*":" ")+" ",r=0;r<t.next.length;r+=2)i+=(r?", ":"")+t.next[r].name+"->"+e.indexOf(t.next[r+1]);return i})).join("\n")},Object.defineProperties(Sm.prototype,Om),Sm.empty=new Sm(!0);var xm=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()},Tm={next:{configurable:!0}};function Nm(e){var t=[];do{t.push(Am(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Am(e){var t=[];do{t.push(Mm(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Mm(e){for(var t=function(e){if(e.eat("(")){var t=Nm(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,i=n[t];if(i)return[i];var r=[];for(var a in n){var o=n[a];o.groups.indexOf(t)>-1&&r.push(o)}0==r.length&&e.err("No node type or group '"+t+"' found");return r}(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==n.length?n[0]:{type:"choice",exprs:n}}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=Im(e,t)}return t}function Rm(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Im(e,t){var n=Rm(e),i=n;return e.eat(",")&&(i="}"!=e.next?Rm(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function Lm(e,t){return t-e}function Bm(e,t){var n=[];return function t(i){var r=e[i];if(1==r.length&&!r[0].term)return t(r[0].to);n.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=o.term,l=o.to;s||-1!=n.indexOf(l)||t(l)}}(t),n.sort(Lm)}function Pm(e){var t=Object.create(null);for(var n in e){var i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function jm(e,t){var n=Object.create(null);for(var i in e){var r=t&&t[i];if(void 0===r){var a=e[i];if(!a.hasDefault)throw new RangeError("No value supplied for attribute "+i);r=a.default}n[i]=r}return n}function qm(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new Hm(e[n]);return t}Tm.next.get=function(){return this.tokens[this.pos]},xm.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},xm.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(xm.prototype,Tm);var Um=function(e,t,n){this.name=e,this.schema=t,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=qm(n.attrs),this.defaultAttrs=Pm(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e},zm={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};zm.isInline.get=function(){return!this.isBlock},zm.isTextblock.get=function(){return this.isBlock&&this.inlineContent},zm.isLeaf.get=function(){return this.contentMatch==Sm.empty},zm.isAtom.get=function(){return this.isLeaf||this.spec.atom},Um.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},Um.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},Um.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:jm(this.attrs,e)},Um.prototype.create=function(e,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Cm(this,this.computeAttrs(e),tm.from(t),om.setFrom(n))},Um.prototype.createChecked=function(e,t,n){if(t=tm.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Cm(this,this.computeAttrs(e),t,om.setFrom(n))},Um.prototype.createAndFill=function(e,t,n){if(e=this.computeAttrs(e),(t=tm.from(t)).size){var i=this.contentMatch.fillBefore(t);if(!i)return null;t=i.append(t)}var r=this.contentMatch.matchFragment(t).fillBefore(tm.empty,!0);return r?new Cm(this,e,t.append(r),om.setFrom(n)):null},Um.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},Um.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},Um.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},Um.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:om.empty:e},Um.compile=function(e,t){var n=Object.create(null);e.forEach((function(e,i){return n[e]=new Um(e,t,i)}));var i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var r in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(Um.prototype,zm);var Hm=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},Wm={isRequired:{configurable:!0}};Wm.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(Hm.prototype,Wm);var Gm=function(e,t,n,i){this.name=e,this.schema=n,this.spec=i,this.attrs=qm(i.attrs),this.rank=t,this.excluded=null;var r=Pm(this.attrs);this.instance=r&&new om(this,r)};Gm.prototype.create=function(e){return!e&&this.instance?this.instance:new om(this,jm(this.attrs,e))},Gm.compile=function(e,t){var n=Object.create(null),i=0;return e.forEach((function(e,r){return n[e]=new Gm(e,i++,t,r)})),n},Gm.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},Gm.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},Gm.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var Ym={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},Vm={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},$m={ol:!0,ul:!0};function Km(e){return(e?1:0)|("full"===e?2:0)}var Qm=function(e,t,n,i,r,a,o){this.type=e,this.attrs=t,this.solid=r,this.match=a||(4&o?null:e.contentMatch),this.options=o,this.content=[],this.marks=n,this.activeMarks=om.none,this.pendingMarks=i,this.stashMarks=[]};Qm.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(tm.from(e));if(!t){var n,i=this.type.contentMatch;return(n=i.findWrapping(e.type))?(this.match=i,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},Qm.prototype.finish=function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length)))}var i=tm.from(this.content);return!e&&this.match&&(i=i.append(this.match.fillBefore(tm.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i},Qm.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]},Qm.prototype.applyPending=function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var i=n[t];(this.type?this.type.allowsMarkType(i.type):Jm(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}},Qm.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ym.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var Zm=function(e,t,n){this.parser=e,this.options=t,this.isOpen=n;var i,r=t.topNode,a=Km(t.preserveWhitespace)|(n?4:0);i=r?new Qm(r.type,r.attrs,om.none,om.none,!0,t.topMatch||r.type.contentMatch,a):new Qm(n?null:e.schema.topNodeType,null,om.none,om.none,!0,null,a),this.nodes=[i],this.open=0,this.find=t.findPositions,this.needsBlock=!1},Xm={top:{configurable:!0},currentPos:{configurable:!0}};function Jm(e,t){var n=t.schema.nodes,i=function(i){var r=n[i];if(r.allowsMarkType(e)){var a=[],o=function(e){a.push(e);for(var n=0;n<e.edgeCount;n++){var i=e.edge(n),r=i.type,s=i.next;if(r==t)return!0;if(a.indexOf(s)<0&&o(s))return!0}};return o(r.contentMatch)?{v:!0}:void 0}};for(var r in n){var a=i(r);if(a)return a.v}}Xm.top.get=function(){return this.nodes[this.open]},Zm.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,i=[];for(;t=n.exec(e);)i.push(t[1],t[2].trim());return i}(t)):null,i=this.top;if(null!=n)for(var r=0;r<n.length;r++)this.addPendingMark(n[r]);if(this.addElement(e),null!=n)for(var a=0;a<n.length;a++)this.removePendingMark(n[a],i)}},Zm.prototype.addTextNode=function(e){var t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.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 i=n.content[n.content.length-1],r=e.previousSibling;(!i||r&&"BR"==r.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},Zm.prototype.addElement=function(e,t){var n,i=e.nodeName.toLowerCase();$m.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var i=1==t.nodeType?t.nodeName.toLowerCase():null;i&&$m.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):"li"==i?n=t:i&&(n=null)}}(e);var r=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(r?r.ignore:Vm.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!r||r.skip||r.closeParent){r&&r.closeParent?this.open=Math.max(0,this.open-1):r&&r.skip.nodeType&&(e=r.skip);var a,o=this.top,s=this.needsBlock;if(Ym.hasOwnProperty(i))a=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),a&&this.sync(o),this.needsBlock=s}else this.addElementByRule(e,r,!1===r.consuming?n:null)},Zm.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},Zm.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},Zm.prototype.readStyles=function(e){var t=om.none;e:for(var n=0;n<e.length;n+=2)for(var i=null;;){var r=this.parser.matchStyle(e[n],e[n+1],this,i);if(!r)continue e;if(r.ignore)return null;if(t=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(t),!1!==r.consuming)break;i=r}return t},Zm.prototype.addElementByRule=function(e,t,n){var i,r,a,o=this;t.node?(r=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(r.create(t.attrs))||this.leafFallback(e):i=this.enter(r,t.attrs,t.preserveWhitespace):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));var s=this.top;if(r&&r.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);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,i)}i&&(this.sync(s),this.open--),a&&this.removePendingMark(a,s)},Zm.prototype.addAll=function(e,t,n,i){for(var r=n||0,a=n?e.childNodes[n]:e.firstChild,o=null==i?null:e.childNodes[i];a!=o;a=a.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(a),t&&Ym.hasOwnProperty(a.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,r)},Zm.prototype.findPlace=function(e){for(var t,n,i=this.open;i>=0;i--){var r=this.nodes[i],a=r.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,n=r,!a.length))break;if(r.solid)break}if(!t)return!1;this.sync(n);for(var o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0},Zm.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 n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var i=n.activeMarks,r=0;r<e.marks.length;r++)n.type&&!n.type.allowsMarkType(e.marks[r].type)||(i=e.marks[r].addToSet(i));return n.content.push(e.mark(i)),!0}return!1},Zm.prototype.enter=function(e,t,n){var i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,n),i},Zm.prototype.enterInner=function(e,t,n,i){this.closeExtra();var r=this.top;r.applyPending(e),r.match=r.match&&r.match.matchType(e,t);var a=null==i?-5&r.options:Km(i);4&r.options&&0==r.content.length&&(a|=4),this.nodes.push(new Qm(e,t,r.activeMarks,r.pendingMarks,n,null,a)),this.open++},Zm.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}},Zm.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},Zm.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},Xm.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e},Zm.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)},Zm.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)},Zm.prototype.findAround=function(e,t,n){if(e!=t&&this.find)for(var i=0;i<this.find.length;i++){if(null==this.find[i].pos&&1==e.nodeType&&e.contains(this.find[i].node))t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}},Zm.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))},Zm.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),i=this.options.context,r=!(this.isOpen||i&&i.parent.type!=this.nodes[0].type),a=-(i?i.depth+1:0)+(r?0:1),o=function(e,s){for(;e>=0;e--){var l=n[e];if(""==l){if(e==n.length-1||0==e)continue;for(;s>=a;s--)if(o(e-1,s))return!0;return!1}var u=s>0||0==s&&r?t.nodes[s].type:i&&s>=a?i.node(s-a).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0};return o(n.length-1,this.open)},Zm.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var i in this.parser.schema.nodes){var r=this.parser.schema.nodes[i];if(r.isTextblock&&r.defaultAttrs)return r}},Zm.prototype.addPendingMark=function(e){var t=function(e,t){for(var n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},Zm.prototype.removePendingMark=function(e,t){for(var n=this.open;n>=0;n--){var i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);var r=i.popFromStashMark(e);r&&i.type&&i.type.allowsMarkType(r.type)&&(i.activeMarks=r.addToSet(i.activeMarks))}if(i==t)break}},Object.defineProperties(Zm.prototype,Xm);var eF=Math.pow(2,16);function tF(e){return 65535&e}var nF=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},iF=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};iF.prototype.recover=function(e){var t=0,n=tF(e);if(!this.inverted)for(var i=0;i<n;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/eF}(e)},iF.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},iF.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},iF.prototype._map=function(e,t,n){for(var i=0,r=this.inverted?2:1,a=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+r],u=this.ranges[o+a],d=s+l;if(e<=d){var _=s+i+((l?e==s?-1:e==d?1:t:t)<0?0:u);if(n)return _;var c=e==(t<0?s:d)?null:o/3+(e-s)*eF;return new nF(_,t<0?e!=s:e!=d,c)}i+=u-l}return n?e+i:new nF(e+i)},iF.prototype.touches=function(e,t){for(var n=0,i=tF(t),r=this.inverted?2:1,a=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+r];if(e<=s+l&&o==3*i)return!0;n+=this.ranges[o+a]-l}return!1},iF.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,i=0,r=0;i<this.ranges.length;i+=3){var a=this.ranges[i],o=a-(this.inverted?r:0),s=a+(this.inverted?0:r),l=this.ranges[i+t],u=this.ranges[i+n];e(o,o+l,s,s+u),r+=u-l}},iF.prototype.invert=function(){return new iF(this.ranges,!this.inverted)},iF.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},iF.offset=function(e){return 0==e?iF.empty:new iF(e<0?[0,-e,0]:[0,0,e])},iF.empty=new iF([]);var rF=function(e,t,n,i){this.maps=e||[],this.from=n||0,this.to=null==i?this.maps.length:i,this.mirror=t};function aF(e){var t=Error.call(this,e);return t.__proto__=aF.prototype,t}rF.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new rF(this.maps,this.mirror,e,t)},rF.prototype.copy=function(){return new rF(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},rF.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},rF.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var i=e.getMirror(t);this.appendMap(e.maps[t],null!=i&&i<t?n+i:null)}},rF.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)]},rF.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},rF.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var i=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=i&&i>t?n-i-1:null)}},rF.prototype.invert=function(){var e=new rF;return e.appendMappingInverted(this),e},rF.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},rF.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},rF.prototype._map=function(e,t,n){for(var i=!1,r=this.from;r<this.to;r++){var a=this.maps[r].mapResult(e,t);if(null!=a.recover){var o=this.getMirror(r);if(null!=o&&o>r&&o<this.to){r=o,e=this.maps[o].recover(a.recover);continue}}a.deleted&&(i=!0),e=a.pos}return n?e:new nF(e,i)},aF.prototype=Object.create(Error.prototype),aF.prototype.constructor=aF,aF.prototype.name="TransformError";var oF=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new rF},sF={before:{configurable:!0},docChanged:{configurable:!0}};function lF(){throw new Error("Override me")}sF.before.get=function(){return this.docs.length?this.docs[0]:this.doc},oF.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new aF(t.failed);return this},oF.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},sF.docChanged.get=function(){return this.steps.length>0},oF.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(oF.prototype,sF);var uF=Object.create(null),dF=function(){};dF.prototype.apply=function(e){return lF()},dF.prototype.getMap=function(){return iF.empty},dF.prototype.invert=function(e){return lF()},dF.prototype.map=function(e){return lF()},dF.prototype.merge=function(e){return null},dF.prototype.toJSON=function(){return lF()},dF.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=uF[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},dF.jsonID=function(e,t){if(e in uF)throw new RangeError("Duplicate use of step JSON ID "+e);return uF[e]=t,t.prototype.jsonID=e,t};var _F=function(e,t){this.doc=e,this.failed=t};_F.ok=function(e){return new _F(e,null)},_F.fail=function(e){return new _F(null,e)},_F.fromReplace=function(e,t,n,i){try{return _F.ok(e.replace(t,n,i))}catch(e){if(e instanceof sm)return _F.fail(e.message);throw e}};var cF=function(e){function t(t,n,i,r){e.call(this),this.from=t,this.to=n,this.slice=i,this.structure=!!r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&gF(e,this.from,this.to)?_F.fail("Structure replace would overwrite content"):_F.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new iF([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 n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted?null:new t(n.pos,Math.max(n.pos,i.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 n=this.slice.size+e.slice.size==0?lm.empty:new lm(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var i=this.slice.size+e.slice.size==0?lm.empty:new lm(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),i,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,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,lm.fromJSON(e,n.slice),!!n.structure)},t}(dF);dF.jsonID("replace",cF);var fF=function(e){function t(t,n,i,r,a,o,s){e.call(this),this.from=t,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=a,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&&(gF(e,this.from,this.gapFrom)||gF(e,this.gapTo,this.to)))return _F.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return _F.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?_F.fromReplace(e,this.from,this.to,n):_F.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new iF([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 n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),a=e.map(this.gapTo,1);return n.deleted&&i.deleted||r<n.pos||a>i.pos?null:new t(n.pos,i.pos,r,a,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,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,lm.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(dF);function gF(e,t,n){for(var i=e.resolve(t),r=n-t,a=i.depth;r>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,r--;if(r>0)for(var o=i.node(a).maybeChild(i.indexAfter(a));r>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,r--}return!1}function hF(e,t,n){for(var i=[],r=0;r<e.childCount;r++){var a=e.child(r);a.content.size&&(a=a.copy(hF(a.content,t,a))),a.isInline&&(a=t(a,n,r)),i.push(a)}return tm.fromArray(i)}dF.jsonID("replaceAround",fF),oF.prototype.lift=function(e,t){for(var n=e.$from,i=e.$to,r=e.depth,a=n.before(r+1),o=i.after(r+1),s=a,l=o,u=tm.empty,d=0,_=r,c=!1;_>t;_--)c||n.index(_)>0?(c=!0,u=tm.from(n.node(_).copy(u)),d++):s--;for(var f=tm.empty,g=0,h=r,p=!1;h>t;h--)p||i.after(h+1)<i.end(h)?(p=!0,f=tm.from(i.node(h).copy(f)),g++):l++;return this.step(new fF(s,l,a,o,new lm(u.append(f),d,g),u.size-d,!0))},oF.prototype.wrap=function(e,t){for(var n=tm.empty,i=t.length-1;i>=0;i--)n=tm.from(t[i].type.create(t[i].attrs,n));var r=e.start,a=e.end;return this.step(new fF(r,a,r,a,new lm(n,0,0),t.length,!0))},oF.prototype.setBlockType=function(e,t,n,i){var r=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,i)&&function(e,t,n){var i=e.resolve(t),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}(r.doc,r.mapping.slice(a).map(t),n)){r.clearIncompatible(r.mapping.slice(a).map(t,1),n);var o=r.mapping.slice(a),s=o.map(t,1),l=o.map(t+e.nodeSize,1);return r.step(new fF(s,l,s+1,l-1,new lm(tm.from(n.create(i,null,e.marks)),0,0),1,!0)),!1}})),this},oF.prototype.setNodeMarkup=function(e,t,n,i){var r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at given position");t||(t=r.type);var a=t.create(n,null,i||r.marks);if(r.isLeaf)return this.replaceWith(e,e+r.nodeSize,a);if(!t.validContent(r.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new fF(e,e+r.nodeSize,e+1,e+r.nodeSize-1,new lm(tm.from(a),0,0),1,!0))},oF.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var i=this.doc.resolve(e),r=tm.empty,a=tm.empty,o=i.depth,s=i.depth-t,l=t-1;o>s;o--,l--){r=tm.from(i.node(o).copy(r));var u=n&&n[l];a=tm.from(u?u.type.create(u.attrs,a):i.node(o).copy(a))}return this.step(new cF(e,e,new lm(r.append(a),t,t),!0))},oF.prototype.join=function(e,t){void 0===t&&(t=1);var n=new cF(e-t,e+t,lm.empty,!0);return this.step(n)};var pF=function(e){function t(t,n,i){e.call(this),this.from=t,this.to=n,this.mark=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=e.resolve(this.from),r=i.node(i.sharedDepth(this.to)),a=new lm(hF(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),r),n.openStart,n.openEnd);return _F.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new mF(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.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,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(dF);dF.jsonID("addMark",pF);var mF=function(e){function t(t,n,i){e.call(this),this.from=t,this.to=n,this.mark=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=new lm(hF(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return _F.fromReplace(e,this.from,this.to,i)},t.prototype.invert=function(){return new pF(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.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,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(dF);function FF(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}dF.jsonID("removeMark",mF),oF.prototype.addMark=function(e,t,n){var i=this,r=[],a=[],o=null,s=null;return this.doc.nodesBetween(e,t,(function(i,l,u){if(i.isInline){var d=i.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){for(var _=Math.max(l,e),c=Math.min(l+i.nodeSize,t),f=n.addToSet(d),g=0;g<d.length;g++)d[g].isInSet(f)||(o&&o.to==_&&o.mark.eq(d[g])?o.to=c:r.push(o=new mF(_,c,d[g])));s&&s.to==_?s.to=c:a.push(s=new pF(_,c,n))}}})),r.forEach((function(e){return i.step(e)})),a.forEach((function(e){return i.step(e)})),this},oF.prototype.removeMark=function(e,t,n){var i=this;void 0===n&&(n=null);var r=[],a=0;return this.doc.nodesBetween(e,t,(function(i,o){if(i.isInline){a++;var s=null;if(n instanceof Gm)for(var l,u=i.marks;l=n.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else n?n.isInSet(i.marks)&&(s=[n]):s=i.marks;if(s&&s.length)for(var d=Math.min(o+i.nodeSize,t),_=0;_<s.length;_++){for(var c=s[_],f=void 0,g=0;g<r.length;g++){var h=r[g];h.step==a-1&&c.eq(r[g].style)&&(f=h)}f?(f.to=d,f.step=a):r.push({style:c,from:Math.max(o,e),to:d,step:a})}}})),r.forEach((function(e){return i.step(new mF(e.from,e.to,e.style))})),this},oF.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var i=this.doc.nodeAt(e),r=[],a=e+1,o=0;o<i.childCount;o++){var s=i.child(o),l=a+s.nodeSize,u=n.matchType(s.type,s.attrs);if(u){n=u;for(var d=0;d<s.marks.length;d++)t.allowsMarkType(s.marks[d].type)||this.step(new mF(a,l,s.marks[d]))}else r.push(new cF(a,l,lm.empty));a=l}if(!n.validEnd){var _=n.fillBefore(tm.empty,!0);this.replace(a,a,new lm(_,0,0))}for(var c=r.length-1;c>=0;c--)this.step(r[c]);return this},oF.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=lm.empty);var i=function(e,t,n,i){if(void 0===n&&(n=t),void 0===i&&(i=lm.empty),t==n&&!i.size)return null;var r=e.resolve(t),a=e.resolve(n);return FF(r,a,i)?new cF(t,n,i):new bF(r,a,i).fit()}(this.doc,e,t,n);return i&&this.step(i),this},oF.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new lm(tm.from(n),0,0))},oF.prototype.delete=function(e,t){return this.replace(e,t,lm.empty)},oF.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var bF=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var i=0;i<=e.depth;i++){var r=e.node(i);this.frontier.push({type:r.type,match:r.contentMatchAt(e.indexAfter(i))})}this.placed=tm.empty;for(var a=e.depth;a>0;a--)this.placed=tm.from(e.node(a).copy(this.placed))},yF={depth:{configurable:!0}};function EF(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(EF(e.firstChild.content,t-1,n)))}function vF(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(vF(e.lastChild.content,t-1,n)))}function kF(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function DF(e,t,n){if(t<=0)return e;var i=e.content;return t>1&&(i=i.replaceChild(0,DF(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(tm.empty,!0)))),e.copy(i)}function CF(e,t,n,i,r){var a=e.node(t),o=r?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;var s=i.fillBefore(a.content,!0,o);return s&&!function(e,t,n){for(var i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}(n,a.content,o)?s:null}function wF(e,t,n,i,r){if(t<n){var a=e.firstChild;e=e.replaceChild(0,a.copy(wF(a.content,t+1,n,i,a)))}if(t>i){var o=r.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(tm.empty,!0))}return e}function SF(e,t){for(var n=[],i=Math.min(e.depth,t.depth);i>=0;i--){var r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}yF.depth.get=function(){return this.frontier.length-1},bF.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(t<0?this.$to:i.doc.resolve(t));if(!r)return null;for(var a=this.placed,o=i.depth,s=r.depth;o&&s&&1==a.childCount;)a=a.firstChild.content,o--,s--;var l=new lm(a,o,s);return t>-1?new fF(i.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||i.pos!=this.$to.pos?new cF(i.pos,r.pos,l):void 0},bF.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,i=(t?(n=kF(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,r=this.depth;r>=0;r--){var a=this.frontier[r],o=a.type,s=a.match,l=void 0,u=void 0;if(1==e&&(i?s.matchType(i.type)||(u=s.fillBefore(tm.from(i),!1)):o.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:r,parent:n,inject:u};if(2==e&&i&&(l=s.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:r,parent:n,wrap:l};if(n&&s.matchType(n.type))break}},bF.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,r=kF(t,n);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new lm(t,n+1,Math.max(i,r.size+n>=t.size-i?n+1:0)),!0)},bF.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,r=kF(t,n);if(r.childCount<=1&&n>0){var a=t.size-n<=n+r.size;this.unplaced=new lm(EF(t,n-1,1),n-1,a?n-1:i)}else this.unplaced=new lm(EF(t,n,1),n,i)},bF.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,i=e.parent,r=e.inject,a=e.wrap;this.depth>n;)this.closeFrontierNode();if(a)for(var o=0;o<a.length;o++)this.openFrontierNode(a[o]);var s=this.unplaced,l=i?i.content:s.content,u=s.openStart-t,d=0,_=[],c=this.frontier[n],f=c.match,g=c.type;if(r){for(var h=0;h<r.childCount;h++)_.push(r.child(h));f=f.matchFragment(r)}for(var p=l.size+t-(s.content.size-s.openEnd);d<l.childCount;){var m=l.child(d),F=f.matchType(m.type);if(!F)break;(++d>1||0==u||m.content.size)&&(f=F,_.push(DF(m.mark(g.allowedMarks(m.marks)),1==d?u:0,d==l.childCount?p:-1)))}var b=d==l.childCount;b||(p=-1),this.placed=vF(this.placed,n,tm.from(_)),this.frontier[n].match=f,b&&p<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var y=0,E=l;y<p;y++){var v=E.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),E=v.content}this.unplaced=b?0==t?lm.empty:new lm(EF(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new lm(EF(s.content,t,d),s.openStart,s.openEnd)},bF.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||!CF(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 n=this.$to.depth,i=this.$to.after(n);n>1&&i==this.$to.end(--n);)++i;return i},bF.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],i=n.match,r=n.type,a=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=CF(e,t,r,i,a);if(o){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,d=CF(e,s,l.type,u,!0);if(!d||d.childCount)continue e}return{depth:t,fit:o,move:a?e.doc.resolve(e.after(t+1)):e}}}},bF.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=vF(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var i=e.node(n),r=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,r)}return e},bF.prototype.openFrontierNode=function(e,t,n){var i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=vF(this.placed,this.depth,tm.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},bF.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(tm.empty,!0);e.childCount&&(this.placed=vF(this.placed,this.frontier.length,e))},Object.defineProperties(bF.prototype,yF),oF.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var i=this.doc.resolve(e),r=this.doc.resolve(t);if(FF(i,r,n))return this.step(new cF(e,t,n));var a=SF(i,this.doc.resolve(t));0==a[a.length-1]&&a.pop();var o=-(i.depth+1);a.unshift(o);for(var s=i.depth,l=i.pos-1;s>0;s--,l--){var u=i.node(s).type.spec;if(u.defining||u.isolating)break;a.indexOf(s)>-1?o=s:i.before(s)==l&&a.splice(1,0,-s)}for(var d=a.indexOf(o),_=[],c=n.openStart,f=n.content,g=0;;g++){var h=f.firstChild;if(_.push(h),g==n.openStart)break;f=h.content}c>0&&_[c-1].type.spec.defining&&i.node(d).type!=_[c-1].type?c-=1:c>=2&&_[c-1].isTextblock&&_[c-2].type.spec.defining&&i.node(d).type!=_[c-2].type&&(c-=2);for(var p=n.openStart;p>=0;p--){var m=(p+c+1)%(n.openStart+1),F=_[m];if(F)for(var b=0;b<a.length;b++){var y=a[(b+d)%a.length],E=!0;y<0&&(E=!1,y=-y);var v=i.node(y-1),k=i.index(y-1);if(v.canReplaceWith(k,k,F.type,F.marks))return this.replace(i.before(y),E?r.after(y):t,new lm(wF(n.content,0,n.openStart,m),m,n.openEnd))}}for(var D=this.steps.length,C=a.length-1;C>=0&&(this.replace(e,t,n),!(this.steps.length>D));C--){var w=a[C];w<0||(e=i.before(w),t=r.after(w))}return this},oF.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var i=function(e,t,n){var i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(0==i.parentOffset)for(var r=i.depth-1;r>=0;r--){var a=i.index(r);if(i.node(r).canReplaceWith(a,a,n))return i.before(r+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(var o=i.depth-1;o>=0;o--){var s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s<i.node(o).childCount)return null}}(this.doc,e,n.type);null!=i&&(e=t=i)}return this.replaceRange(e,t,new lm(tm.from(n),0,0))},oF.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),i=this.doc.resolve(t),r=SF(n,i),a=0;a<r.length;a++){var o=r[a],s=a==r.length-1;if(s&&0==o||n.node(o).type.contentMatch.validEnd)return this.delete(n.start(o),i.end(o));if(o>0&&(s||n.node(o-1).canReplace(n.index(o-1),i.indexAfter(o-1))))return this.delete(n.before(o),i.after(o))}for(var l=1;l<=n.depth&&l<=i.depth;l++)if(e-n.start(l)==n.depth-l&&t>n.end(l)&&i.end(l)-t!=i.depth-l)return this.delete(n.before(l),t);return this.delete(e,t)};var OF=Object.create(null),xF=function(e,t,n){this.ranges=n||[new NF(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},TF={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};TF.anchor.get=function(){return this.$anchor.pos},TF.head.get=function(){return this.$head.pos},TF.from.get=function(){return this.$from.pos},TF.to.get=function(){return this.$to.pos},TF.$from.get=function(){return this.ranges[0].$from},TF.$to.get=function(){return this.ranges[0].$to},TF.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},xF.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},xF.prototype.replace=function(e,t){void 0===t&&(t=lm.empty);for(var n=t.content.lastChild,i=null,r=0;r<t.openEnd;r++)i=n,n=n.lastChild;for(var a=e.steps.length,o=this.ranges,s=0;s<o.length;s++){var l=o[s],u=l.$from,d=l.$to,_=e.mapping.slice(a);e.replaceRange(_.map(u.pos),_.map(d.pos),s?lm.empty:t),0==s&&jF(e,a,(n?n.isInline:i&&i.isTextblock)?-1:1)}},xF.prototype.replaceWith=function(e,t){for(var n=e.steps.length,i=this.ranges,r=0;r<i.length;r++){var a=i[r],o=a.$from,s=a.$to,l=e.mapping.slice(n),u=l.map(o.pos),d=l.map(s.pos);r?e.deleteRange(u,d):(e.replaceRangeWith(u,d,t),jF(e,n,t.isInline?-1:1))}},xF.findFrom=function(e,t,n){var i=e.parent.inlineContent?new AF(e):PF(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(var r=e.depth-1;r>=0;r--){var a=t<0?PF(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):PF(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(a)return a}},xF.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new LF(e.node(0))},xF.atStart=function(e){return PF(e,e,0,0,1)||new LF(e)},xF.atEnd=function(e){return PF(e,e,e.content.size,e.childCount,-1)||new LF(e)},xF.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=OF[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},xF.jsonID=function(e,t){if(e in OF)throw new RangeError("Duplicate use of selection JSON ID "+e);return OF[e]=t,t.prototype.jsonID=e,t},xF.prototype.getBookmark=function(){return AF.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(xF.prototype,TF),xF.prototype.visible=!0;var NF=function(e,t){this.$from=e,this.$to=t},AF=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,i){var r=n.resolve(i.map(this.head));if(!r.parent.inlineContent)return e.near(r);var a=n.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:r,r)},t.prototype.replace=function(t,n){if(void 0===n&&(n=lm.empty),e.prototype.replace.call(this,t,n),n==lm.empty){var i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new MF(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))},t.between=function(n,i,r){var a=n.pos-i.pos;if(r&&!a||(r=a>=0?1:-1),!i.parent.inlineContent){var o=e.findFrom(i,r,!0)||e.findFrom(i,-r,!0);if(!o)return e.near(i,r);i=o.$head}return n.parent.inlineContent||(0==a||(n=(e.findFrom(n,-r,!0)||e.findFrom(n,r,!0)).$anchor).pos<i.pos!=a<0)&&(n=i),new t(n,i)},Object.defineProperties(t.prototype,n),t}(xF);xF.jsonID("text",AF);var MF=function(e,t){this.anchor=e,this.head=t};MF.prototype.map=function(e){return new MF(e.map(this.anchor),e.map(this.head))},MF.prototype.resolve=function(e){return AF.between(e.resolve(this.anchor),e.resolve(this.head))};var RF=function(e){function t(t){var n=t.nodeAfter,i=t.node(0).resolve(t.pos+n.nodeSize);e.call(this,t,i),this.node=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,i){var r=i.mapResult(this.anchor),a=r.deleted,o=r.pos,s=n.resolve(o);return a?e.near(s):new t(s)},t.prototype.content=function(){return new lm(tm.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 IF(this.anchor)},t.fromJSON=function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.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}(xF);RF.prototype.visible=!1,xF.jsonID("node",RF);var IF=function(e){this.anchor=e};IF.prototype.map=function(e){var t=e.mapResult(this.anchor),n=t.deleted,i=t.pos;return n?new MF(i,i):new IF(i)},IF.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&RF.isSelectable(n)?new RF(t):xF.near(t)};var LF=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,n){if(void 0===n&&(n=lm.empty),n==lm.empty){t.delete(0,t.doc.content.size);var i=e.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else e.prototype.replace.call(this,t,n)},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 BF},t}(xF);xF.jsonID("all",LF);var BF={map:function(){return this},resolve:function(e){return new LF(e)}};function PF(e,t,n,i,r,a){if(t.inlineContent)return AF.create(e,n);for(var o=i-(r>0?0:1);r>0?o<t.childCount:o>=0;o+=r){var s=t.child(o);if(s.isAtom){if(!a&&RF.isSelectable(s))return RF.create(e,n-(r<0?s.nodeSize:0))}else{var l=PF(e,s,n+r,r<0?s.childCount:0,r,a);if(l)return l}n+=s.nodeSize*r}}function jF(e,t,n){var i=e.steps.length-1;if(!(i<t)){var r,a=e.steps[i];if(a instanceof cF||a instanceof fF)e.mapping.maps[i].forEach((function(e,t,n,i){null==r&&(r=i)})),e.setSelection(xF.near(e.doc.resolve(r),n))}}var qF=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 n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.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},n.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 om.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()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),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 n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||om.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var r=this.storedMarks;if(!r){var a=this.doc.resolve(t);r=n==t?a.marks():a.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,r)),this.selection.empty||this.setSelection(xF.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]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(oF);function UF(e,t){return t&&e?e.bind(t):e}var zF=function(e,t,n){this.name=e,this.init=UF(t.init,n),this.apply=UF(t.apply,n)},HF=[new zF("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new zF("selection",{init:function(e,t){return e.selection||xF.atStart(t.doc)},apply:function(e){return e.selection}}),new zF("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new zF("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],WF=function(e,t){var n=this;this.schema=e,this.fields=HF.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new zF(e.key,e.spec.state,e))}))},GF=function(e){this.config=e},YF={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};YF.schema.get=function(){return this.config.schema},YF.plugins.get=function(){return this.config.plugins},GF.prototype.apply=function(e){return this.applyTransaction(e).state},GF.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=t){var i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0},GF.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),i=null;;){for(var r=!1,a=0;a<this.config.plugins.length;a++){var o=this.config.plugins[a];if(o.spec.appendTransaction){var s=i?i[a].n:0,l=i?i[a].state:this,u=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,l,n);if(u&&n.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(var d=0;d<this.config.plugins.length;d++)i.push(d<a?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),r=!0}i&&(i[a]={state:n,n:t.length})}}if(!r)return{state:n,transactions:t}}},GF.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new GF(this.config),n=this.config.fields,i=0;i<n.length;i++){var r=n[i];t[r.name]=r.apply(e,this[r.name],this,t)}for(var a=0;a<VF.length;a++)VF[a](this,e,t);return t},YF.tr.get=function(){return new qF(this)},GF.create=function(e){for(var t=new WF(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new GF(t),i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n},GF.prototype.reconfigure=function(e){for(var t=new WF(this.schema,e.plugins),n=t.fields,i=new GF(t),r=0;r<n.length;r++){var a=n[r].name;i[a]=this.hasOwnProperty(a)?this[a]:n[r].init(e,i)}return i},GF.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 n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var i=e[n],r=i.spec.state;r&&r.toJSON&&(t[n]=r.toJSON.call(i,this[i.key]))}return t},GF.fromJSON=function(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var i=new WF(e.schema,e.plugins),r=new GF(i);return i.fields.forEach((function(i){if("doc"==i.name)r.doc=Cm.fromJSON(e.schema,t.doc);else if("selection"==i.name)r.selection=xF.fromJSON(r.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(r.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var a in n){var o=n[a],s=o.spec.state;if(o.key==i.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(r[i.name]=s.fromJSON.call(o,e,t[a],r))}r[i.name]=i.init(e,r)}})),r},GF.addApplyListener=function(e){VF.push(e)},GF.removeApplyListener=function(e){var t=VF.indexOf(e);t>-1&&VF.splice(t,1)},Object.defineProperties(GF.prototype,YF);var VF=[];var $F=function(e){this.props={},e.props&&function e(t,n,i){for(var r in t){var a=t[r];a instanceof Function?a=a.bind(n):"handleDOMEvents"==r&&(a=e(a,n,{})),i[r]=a}return i}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:QF("plugin")};$F.prototype.getState=function(e){return e[this.key]};var KF=Object.create(null);function QF(e){return e in KF?e+"$"+ ++KF[e]:(KF[e]=0,e+"$")}var ZF=function(e){void 0===e&&(e="key"),this.key=QF(e)};ZF.prototype.get=function(e){return e.config.pluginsByKey[this.key]},ZF.prototype.getState=function(e){return e[this.key]};const XF=ma.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 $F({key:new ZF("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const i=this.storage.characters({node:t.doc}),r=this.storage.characters({node:e.doc});if(r<=n)return!0;if(i>n&&r>n&&r<=i)return!0;if(i>n&&r>n&&r>i)return!1;if(!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,o=a-(r-n),s=a;e.deleteRange(o,s);return!(this.storage.characters({node:e.doc})>n)}})]}});var JF=n(53);const eb=fs.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",rs(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[ys({find:e=>Object(JF.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 Mt({key:new Lt("handleClickLink"),props:{handleClick:(e,t,n)=>{var i;const r=this.editor.getAttributes("link");return!(!(null===(i=n.target)||void 0===i?void 0:i.closest("a"))||!r.href)&&(window.open(r.href,r.target),!0)}}})),this.options.linkOnPaste&&e.push(new Mt({key:new Lt("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:r}=i,{empty:a}=r;if(a)return!1;let o="";n.content.forEach(e=>{o+=e.textContent});const s=Object(JF.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),tb=fs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",rs(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=po(e,this.type);return!!Object.entries(n).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),nb=ma.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 ib=cs.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Mt({key:new Lt("eventHandler"),props:{handleClick:function(t,n){var i=t.state,r=i.doc.lastChild,a=i.doc.resolve(n).nodeBefore;if(r&&a){var o=r.eq(a),s=r.isInline,l=["paragraph","text"].includes(r.type.name);!o||s||l||e.commands.insertContentAt(n,{type:"paragraph",content:""})}}}})]}}),rb=$h.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",rs(this.options.HTMLAttributes,t),0]}});const ab=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,ob=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",rs(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[gs({find:ab,type:this.type,getAttributes:e=>{const[,,t,n,i]=e;return{src:n,alt:t,title:i}}})]}});function sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function lb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sb(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ub=ob.extend({name:"image",addAttributes:function(){return lb(lb({},ob.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(n){var i,r,a,o=n.tr,s=n.commands;return"image"==(null===(i=o.selection)||void 0===i||null===(r=i.node)||void 0===r||null===(a=r.type)||void 0===a?void 0:a.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}}}},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return n.class=" image-"+t.attrs.size,n.class+=" image-float-"+t.attrs.float,["img",rs(this.options.HTMLAttributes,n)]}});const db=fs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",rs(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()}}});var _b=function(e){var t=e.wrapperRef,n=e.index;if(t.current&&!(n>=t.current.children.length)){var i=t.current,r=i.children[n],a=r.clientHeight+8,o=i.scrollTop;r.offsetTop+a>o+i.clientHeight?o=r.offsetTop-i.clientHeight+a:o>r.offsetTop&&(o=r.offsetTop-8),t.current.scrollTop=o}};function cb(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 n,i=cc()(e);if(t){var r=cc()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return dc()(this,n)}}var fb=function(e){lc()(n,e);var t=cb(n);function n(e){var i;return nc()(this,n),i=t.call(this,e),_()(oc()(i),"onKeyDown",(function(e){var t=e.event;return"ArrowUp"===t.key?(i.upHandler(),!0):"ArrowDown"===t.key?(i.downHandler(),!0):"Enter"===t.key&&(i.enterHandler(),!0)})),_()(oc()(i),"upHandler",(function(){i.setState({selectedIndex:(i.state.selectedIndex+i.props.items.length-1)%i.props.items.length})})),_()(oc()(i),"downHandler",(function(){i.setState({selectedIndex:(i.state.selectedIndex+1)%i.props.items.length})})),_()(oc()(i),"enterHandler",(function(){i.selectItem(i.state.selectedIndex)})),_()(oc()(i),"selectItem",(function(e){var t=i.props.items[e];if(t){var n=i.props,r=n.editor,a=n.range;t.command({editor:r,range:a})}})),i.state={selectedIndex:0},i.menuRef=m.a.createRef(),i}return rc()(n,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),_b({wrapperRef:this.menuRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this;return m.a.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},this.props.items.map((function(t,n){return m.a.createElement(gb,{key:t.title,item:t,index:n,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(n)}})})))}}]),n}(m.a.Component),gb=function(e){var t=e.item,n=e.selectedIndex,i=e.index,r=e.selectItem,a=t.Icon;return m.a.createElement("div",{className:b()("neeto-editor-slash-commands__item",{active:i===n}),onClick:function(){return r(i)}},a&&m.a.createElement(a,{size:20}),m.a.createElement("div",{className:"neeto-editor-slash-commands__item-content"},m.a.createElement("h5",null,t.title),m.a.createElement("p",null,t.description)))},hb=fb;const pb=new Lt("suggestion");function mb({pluginKey:e=pb,editor:t,char:n="@",allowSpaces:i=!1,prefixSpace:r=!0,startOfLine:a=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:_=(()=>!0)}){const c=null==d?void 0:d();return new Mt({key:e,view(){return{update:async(e,n)=>{var i,r,a,o,s;const d=null===(i=this.key)||void 0===i?void 0:i.getState(n),_=null===(r=this.key)||void 0===r?void 0:r.getState(e.state),f=d.active&&_.active&&d.range.from!==_.range.from,g=!d.active&&_.active,h=d.active&&!_.active,p=g||f,m=!g&&!h&&d.query!==_.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:_,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={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:y,clientRect:y?()=>{var e;const{decorationId:n}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${n}"]`).getBoundingClientRect()}:null};F&&(null===(a=null==c?void 0:c.onExit)||void 0===a||a.call(c,E)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,E)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,E))}}},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:d}=l,c={...o};if(c.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:i,startOfLine:r,$position:a}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=r?"^":"",u=n?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=a.depth<=0?0:a.before(),_=a.pos,c=a.doc.textBetween(d,_,"\0","\0"),f=Array.from(c.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(i&&!h)return null;const p=f.index+a.start();let m=p+f[0].length;return n&&s.test(c.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<a.pos&&m>=a.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:n,allowSpaces:i,prefixSpace:r,startOfLine:a,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&_({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 n;const{active:i,range:r}=this.getState(e.state);return i&&(null===(n=null==c?void 0:c.onKeyDown)||void 0===n?void 0:n.call(c,{view:e,event:t,range:r}))||!1},decorations(e){const{active:t,range:n,decorationId:i}=this.getState(e);return t?Rr.create(e.doc,[Tr.inline(n.from,n.to,{nodeName:o,class:s,"data-decoration-id":i})]):null}}})}function Fb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function bb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fb(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yb=new Lt("commands"),Eb=function(e){var t=e.setImageUploadVisible,n=e.mentions,i=e.options;return ma.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:yb,command:function(e){var t=e.editor,n=e.range;e.props.command({editor:t,range:n})},items:function(e){var r=e.query,a=[{title:"Paragraph",description:"Add a plain text block",Icon:ju.Paragraph,optionName:"font-size",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("paragraph").run()}},{title:"H1",description:"Add a big heading",Icon:ju.TextH1,optionName:"font-size",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("heading",{level:1}).run()}},{title:"H2",description:"Add a sub-heading",Icon:ju.TextH2,optionName:"font-size",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("heading",{level:2}).run()}},{title:"Numbered list",description:"Add a list with numbering",Icon:ju.ListNumber,optionName:"ordered-list",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleOrderedList().run()}},{title:"Bulleted list",description:"Add an list bullets",Icon:ju.ListDot,optionName:"bullet-list",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBulletList().run()}},{title:"Blockquote",description:"Add a quote",Icon:ju.Blockquote,optionName:"block-quote",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBlockquote().run()}},{title:"Image",description:"Add an image",Icon:ju.Image,optionName:"image-upload",command:function(e){var n=e.editor,i=e.range;t(!0),n.chain().focus().deleteRange(i).run()}},{title:"Code block",description:"Add a code block with syntax highlighting",Icon:ju.Code,optionName:"code-block",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleCodeBlock().run()}},{title:"Emoji",description:"Add an emoji",Icon:ju.Smiley,optionName:"emoji",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).insertContent("::").run()}},{title:"Divider",description:"Add an horizontal line to separate sections",optionName:"divider",Icon:ju.Minus,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setHorizontalRule().run()}},{title:"Embed Youtube/Vimeo",description:"Embed a video from major services",Icon:ju.Video,optionName:"video-embed",command:function(e){var t,n=e.editor,i=e.range,r=prompt("Please enter Youtube/Vimeo embed URL"),a=(t=r.match(qd))&&"https://www.youtube.com/embed/".concat(t[5])||function(e){var t=e.match(Ud);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])}(r);a?n.chain().focus().deleteRange(i).setExternalVideo({src:a}).run():n.chain().focus().deleteRange(i).insertContent("#invalid").run()}}].filter((function(e){return i.includes(e.optionName)})),o={title:"Mention",description:"Mention a user",optionName:"mention",Icon:ju.Email,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).insertContent("@").run()}};Hu()(n)||a.push(o);var s=a.filter((function(e){return e.title.toLowerCase().includes(r.toLowerCase())}));return Hu()(s)?[{title:"No results",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).run()}}]:s},render:function(){var e,t;return{onStart:function(n){e=new xu(hb,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[mb(bb({editor:this.editor},this.options.suggestion))]}})},vb={};function kb(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 n=e[t];"object"!=typeof n||Object.isFrozen(n)||kb(n)})),e}var Db=kb,Cb=kb;Db.default=Cb;class wb{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Sb(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ob(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const xb=e=>!!e.kind;class Tb{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Sb(e)}openNode(e){if(!xb(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){xb(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class Nb{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=>{Nb._collapse(e)}))}}class Ab extends Nb{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 n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new Tb(this,this.options).value()}finalize(){return!0}}function Mb(e){return e?"string"==typeof e?e:e.source:null}const Rb=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const Ib="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Lb={begin:"\\\\[\\s\\S]",relevance:0},Bb={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[Lb]},Pb={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[Lb]},jb={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/},qb=function(e,t,n={}){const i=Ob({className:"comment",begin:e,end:t,contains:[]},n);return i.contains.push(jb),i.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),i},Ub=qb("//","$"),zb=qb("/\\*","\\*/"),Hb=qb("#","$"),Wb={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},Gb={className:"number",begin:Ib,relevance:0},Yb={className:"number",begin:"\\b(0b[01]+)",relevance:0},Vb={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},$b={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Lb,{begin:/\[/,end:/\]/,relevance:0,contains:[Lb]}]}]},Kb={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},Qb={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},Zb={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var Xb=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:Ib,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>Mb(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),Ob({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:Lb,APOS_STRING_MODE:Bb,QUOTE_STRING_MODE:Pb,PHRASAL_WORDS_MODE:jb,COMMENT:qb,C_LINE_COMMENT_MODE:Ub,C_BLOCK_COMMENT_MODE:zb,HASH_COMMENT_MODE:Hb,NUMBER_MODE:Wb,C_NUMBER_MODE:Gb,BINARY_NUMBER_MODE:Yb,CSS_NUMBER_MODE:Vb,REGEXP_MODE:$b,TITLE_MODE:Kb,UNDERSCORE_TITLE_MODE:Qb,METHOD_GUARD:Zb,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 Jb(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function ey(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Jb,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function ty(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>Mb(e)).join("|")+")"}(...e.illegal))}function ny(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 iy(e,t){void 0===e.relevance&&(e.relevance=1)}const ry=["of","and","for","in","not","or","if","then","parent","list","value"];function ay(e,t){return t?Number(t):function(e){return ry.includes(e.toLowerCase())}(e)?0:1}function oy(e,{plugins:t}){function n(t,n){return new RegExp(Mb(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class i{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=n(function(e,t="|"){let n=0;return e.map(e=>{n+=1;const t=n;let i=Mb(e),r="";for(;i.length>0;){const e=Rb.exec(i);if(!e){r+=i;break}r+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+t):(r+=e[0],"("===e[0]&&n++)}return r}).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 n=t.findIndex((e,t)=>t>0&&void 0!==e),i=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,i)}}class r{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 i;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),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 n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}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=Ob(e.classNameAliases||{}),function t(i,a){const o=i;if(i.isCompiled)return o;[ny].forEach(e=>e(i,a)),e.compilerExtensions.forEach(e=>e(i,a)),i.__beforeBegin=null,[ey,ty,iy].forEach(e=>e(i,a)),i.isCompiled=!0;let s=null;if("object"==typeof i.keywords&&(s=i.keywords.$pattern,delete i.keywords.$pattern),i.keywords&&(i.keywords=function e(t,n,i="keyword"){const r={};return"string"==typeof t?a(i,t.split(" ")):Array.isArray(t)?a(i,t):Object.keys(t).forEach((function(i){Object.assign(r,e(t[i],n,i))})),r;function a(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const n=t.split("|");r[n[0]]=[e,ay(n[0],n[1])]}))}}(i.keywords,e.case_insensitive)),i.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||i.lexemes||/\w+/,o.keywordPatternRe=n(s,!0),a&&(i.begin||(i.begin=/\B|\b/),o.beginRe=n(i.begin),i.endSameAsBegin&&(i.end=i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(o.endRe=n(i.end)),o.terminatorEnd=Mb(i.end)||"",i.endsWithParent&&a.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(o.illegalRe=n(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return Ob(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return Ob(e,{starts:e.starts?Ob(e.starts):null});if(Object.isFrozen(e))return Ob(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){t(e,o)})),i.starts&&t(i.starts,a),o.matcher=function(e){const t=new r;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 sy(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,Sb(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 ly={"after:highlightElement":({el:e,result:t,text:n})=>{const i=dy(e);if(!i.length)return;const r=document.createElement("div");r.innerHTML=t.value,t.value=function(e,t,n){let i=0,r="";const a=[];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){r+="<"+uy(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+Sb(e.value)+'"'})).join("")+">"}function l(e){r+="</"+uy(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(r+=Sb(n.substring(i,t[0].offset)),i=t[0].offset,t===e){a.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===i);a.reverse().forEach(s)}else"start"===t[0].event?a.push(t[0].node):a.pop(),u(t.splice(0,1)[0])}return r+Sb(n.substr(i))}(i,dy(r),n)}};function uy(e){return e.nodeName.toLowerCase()}function dy(e){const t=[];return function e(n,i){for(let r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?i+=r.nodeValue.length:1===r.nodeType&&(t.push({event:"start",offset:i,node:r}),i=e(r,i),uy(r).match(/br|hr|img|input/)||t.push({event:"stop",offset:i,node:r}));return i}(e,0),t}const _y={},cy=e=>{console.error(e)},fy=(e,...t)=>{console.log("WARN: "+e,...t)},gy=(e,t)=>{_y[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),_y[`${e}/${t}`]=!0)},hy=Sb,py=Ob,my=Symbol("nomatch");var Fy=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const a=/(^(<[^>]+>|\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:Ab};function u(e){return l.noHighlightRe.test(e)}function d(e,t,n,i){let r="",a="";"object"==typeof t?(r=e,n=t.ignoreIllegals,a=t.language,i=void 0):(gy("10.7.0","highlight(lang, code, ...args) has been deprecated."),gy("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),a=e,r=t);const o={code:r,language:a};k("before:highlight",o);const s=o.result?o.result:_(o.language,o.code,n,i);return s.code=o.code,k("after:highlight",s),s}function _(e,n,a,s){function u(e,t){const n=b.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function d(){null!=k.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void C.addText(w);e=_(k.subLanguage,w,!0,D[k.subLanguage]),D[k.subLanguage]=e.top}else e=c(w,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),C.addSublanguage(e.emitter,e.language)}():function(){if(!k.keywords)return void C.addText(w);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(w),n="";for(;t;){n+=w.substring(e,t.index);const i=u(k,t);if(i){const[e,r]=i;if(C.addText(n),n="",S+=r,e.startsWith("_"))n+=t[0];else{const n=b.classNameAliases[e]||e;C.addKeyword(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(w)}n+=w.substr(e),C.addText(n)}(),w=""}function f(e){return e.className&&C.openNode(b.classNameAliases[e.className]||e.className),k=Object.create(e,{parent:{value:k}}),k}function g(e){return 0===k.matcher.regexIndex?(w+=e[0],1):(T=!0,0)}function h(e){const t=e[0],n=e.rule,i=new wb(n),r=[n.__beforeBegin,n["on:begin"]];for(const n of r)if(n&&(n(e,i),i.isMatchIgnored))return g(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?w+=t:(n.excludeBegin&&(w+=t),d(),n.returnBegin||n.excludeBegin||(w=t)),f(n),n.returnBegin?0:t.length}function p(e){const t=e[0],i=n.substr(e.index),r=function e(t,n,i){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(t.endRe,i);if(r){if(t["on:end"]){const e=new wb(t);t["on:end"](n,e),e.isMatchIgnored&&(r=!1)}if(r){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,i)}(k,e,i);if(!r)return my;const a=k;a.skip?w+=t:(a.returnEnd||a.excludeEnd||(w+=t),d(),a.excludeEnd&&(w=t));do{k.className&&C.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent}while(k!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.endRe=r.endRe),f(r.starts)),a.returnEnd?0:t.length}let m={};function F(t,i){const o=i&&i[0];if(w+=t,null==o)return d(),0;if("begin"===m.type&&"end"===i.type&&m.index===i.index&&""===o){if(w+=n.slice(i.index,i.index+1),!r){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=i,"begin"===i.type)return h(i);if("illegal"===i.type&&!a){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(k.className||"<unnamed>")+'"');throw e.mode=k,e}if("end"===i.type){const e=p(i);if(e!==my)return e}if("illegal"===i.type&&""===o)return 1;if(x>1e5&&x>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=y(e);if(!b)throw cy(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const E=oy(b,{plugins:i});let v="",k=s||E;const D={},C=new l.__emitter(l);!function(){const e=[];for(let t=k;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>C.openNode(e))}();let w="",S=0,O=0,x=0,T=!1;try{for(k.matcher.considerAll();;){x++,T?T=!1:k.matcher.considerAll(),k.matcher.lastIndex=O;const e=k.matcher.exec(n);if(!e)break;const t=F(n.substring(O,e.index),e);O=e.index+t}return F(n.substr(O)),C.closeAllNodes(),C.finalize(),v=C.toHTML(),{relevance:Math.floor(S),value:v,language:e,illegal:!1,emitter:C,top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(O-100,O+100),mode:t.mode},sofar:v,relevance:0,value:hy(n),emitter:C};if(r)return{illegal:!1,relevance:0,value:hy(n),emitter:C,language:e,top:k,errorRaised:t};throw t}}function c(e,n){n=n||l.languages||Object.keys(t);const i=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:hy(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),r=n.filter(y).filter(v).map(t=>_(t,e,!1));r.unshift(i);const a=r.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(y(e.language).supersetOf===t.language)return 1;if(y(t.language).supersetOf===e.language)return-1}return 0}),[o,u]=a,d=o;return d.second_best=u,d}const f={"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>"))}},g=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(g,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const i=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=l.languageDetectRe.exec(t);if(n){const t=y(n[1]);return t||(fy(o.replace("{}",n[1])),fy("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||y(e))}(e);if(u(i))return;k("before:highlightElement",{el:e,language:i}),t=e;const r=t.textContent,a=i?d(r,{language:i,ignoreIllegals:!0}):c(r);k("after:highlightElement",{el:e,result:a,text:r}),e.innerHTML=a.value,function(e,t,i){const r=t?n[t]:i;e.classList.add("hljs"),r&&e.classList.add(r)}(e,i,a.language),e.result={language:a.language,re:a.relevance,relavance:a.relevance},a.second_best&&(e.second_best={language:a.second_best.language,re:a.second_best.relevance,relavance:a.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,gy("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 y(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function E(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function v(e){const t=y(e);return t&&!t.disableAutodetect}function k(e,t){const n=e;i.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){F&&b()}),!1),Object.assign(e,{highlight:d,highlightAuto:c,highlightAll:b,fixMarkup:function(e){return gy("10.2.0","fixMarkup will be removed entirely in v11.0"),gy("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(a,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 gy("10.7.0","highlightBlock will be removed entirely in v12.0"),gy("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(gy("10.3.0","'useBR' will be removed entirely in v11.0"),gy("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=py(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){gy("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(n,i){let a=null;try{a=i(e)}catch(e){if(cy("Language definition for '{}' could not be registered.".replace("{}",n)),!r)throw e;cy(e),a=s}a.name||(a.name=n),t[n]=a,a.rawDefinition=i.bind(null,e),a.aliases&&E(a.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:y,registerAliases:E,requireLanguage:function(e){gy("10.4.0","requireLanguage will be removed entirely in v11."),gy("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=y(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:v,inherit:py,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),i.push(e)},vuePlugin:sy(e).VuePlugin}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString="10.7.3";for(const e in Xb)"object"==typeof Xb[e]&&Db(Xb[e]);return Object.assign(e,Xb),e.addPlugin(f),e.addPlugin(ly),e.addPlugin(h),e}({}),by={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,i,r,a=1,o=[].slice.call(arguments),s=0,l=e.length,u="",d=!1,_=!1,c=function(){return o[a++]},f=function(){for(var n="";/\d/.test(e[s]);)n+=e[s++],t=e[s];return n.length>0?parseInt(n):null};s<l;++s)if(t=e[s],d)switch(d=!1,"."==t?(_=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(_=!0,t=e[s+=2]):_=!0,r=f(),t){case"b":u+=parseInt(c(),10).toString(2);break;case"c":u+="string"==typeof(n=c())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":u+=parseInt(c(),10);break;case"f":i=String(parseFloat(c()).toFixed(r||6)),u+=_?i:i.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?d=!0:u+=t;return u}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()}(by);var yy=by.exports,Ey=ky(Error),vy=Ey;function ky(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=yy.apply(null,arguments)),new e(t)}}Ey.eval=ky(EvalError),Ey.range=ky(RangeError),Ey.reference=ky(ReferenceError),Ey.syntax=ky(SyntaxError),Ey.type=ky(TypeError),Ey.uri=ky(URIError),Ey.create=ky;var Dy=Fy,Cy=vy;vb.highlight=wy,vb.highlightAuto=function(e,t){var n=t||{},i=n.subset||Dy.listLanguages();n.prefix;var r,a,o,s,l=i.length,u=-1;if("string"!=typeof e)throw Cy("Expected `string` for value, got `%s`",e);a={relevance:0,language:null,value:[]},r={relevance:0,language:null,value:[]};for(;++u<l;)s=i[u],Dy.getLanguage(s)&&((o=wy(s,e,t)).language=s,o.relevance>a.relevance&&(a=o),o.relevance>r.relevance&&(a=r,r=o));a.language&&(r.secondBest=a);return r},vb.registerLanguage=function(e,t){Dy.registerLanguage(e,t)},vb.listLanguages=function(){return Dy.listLanguages()},vb.registerAlias=function(e,t){var n,i=e;t&&((i={})[e]=t);for(n in i)Dy.registerAliases(i[n],{languageName:n})},Sy.prototype.addText=function(e){var t,n,i=this.stack;if(""===e)return;t=i[i.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},Sy.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},Sy.prototype.addSublanguage=function(e,t){var n=this.stack,i=n[n.length-1],r=e.rootNode.children,a=t?{type:"element",tagName:"span",properties:{className:[t]},children:r}:r;i.children=i.children.concat(a)},Sy.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,i=t[t.length-1],r={type:"element",tagName:"span",properties:{className:[n]},children:[]};i.children.push(r),t.push(r)},Sy.prototype.closeNode=function(){this.stack.pop()},Sy.prototype.closeAllNodes=Oy,Sy.prototype.finalize=Oy,Sy.prototype.toHTML=function(){return""};function wy(e,t,n){var i,r=Dy.configure({}),a=(n||{}).prefix;if("string"!=typeof e)throw Cy("Expected `string` for name, got `%s`",e);if(!Dy.getLanguage(e))throw Cy("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw Cy("Expected `string` for value, got `%s`",t);if(null==a&&(a="hljs-"),Dy.configure({__emitter:Sy,classPrefix:a}),i=Dy.highlight(t,{language:e,ignoreIllegals:!0}),Dy.configure(r||{}),i.errorRaised)throw i.errorRaised;return{relevance:i.relevance,language:i.language,value:i.emitter.rootNode.children}}function Sy(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function Oy(){}function xy(e){return e.value||e.children||[]}function Ty({doc:e,name:t,lowlight:n}){const i=[];return Es(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:r}=e.node.attrs,a=n.listLanguages();(function e(t,n=[]){return t.map(t=>{const i=[...n,...t.properties?t.properties.className:[]];return t.children?e(t.children,i):{text:t.value,classes:i}}).flat()})(r&&a.includes(r)?xy(n.highlight(r,e.node.textContent)):xy(n.highlightAuto(e.node.textContent))).forEach(e=>{const n=t+e.text.length;if(e.classes.length){const r=Tr.inline(t,n,{class:e.classes.join(" ")});i.push(r)}t=n})}),Rr.create(e,i)}function Ny({name:e,lowlight:t}){return new Mt({key:new Lt("lowlight"),state:{init:(n,{doc:i})=>Ty({doc:i,name:e,lowlight:t}),apply:(n,i,r,a)=>{const o=r.selection.$head.parent.type.name,s=a.selection.$head.parent.type.name,l=Es(r.doc,t=>t.type.name===e),u=Es(a.doc,t=>t.type.name===e);return n.docChanged&&([o,s].includes(e)||u.length!==l.length||n.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)))?Ty({doc:n.doc,name:e,lowlight:t}):i.map(n.mapping,n.doc)}},props:{decorations(e){return this.getState(e)}}})}const Ay=Lh.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:vb}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],Ny({name:this.name,lowlight:this.options.lowlight})]}});function My(){return m.a.createElement(Bu,null,m.a.createElement("pre",null,m.a.createElement(Pu,{as:"code"})))}var Ry=n(96),Iy=n.n(Ry),Ly=Ay.extend({addNodeView:function(){return new Mu(My)}}).configure({lowlight:Iy.a}),By=function(e){var t=e.items,n=e.command;return m.a.createElement("div",{className:"neeto-editor-variables-suggestion"},m.a.createElement(j_,{variables:t,onClickVariable:function(e){var t=e.category_key,i=e.key,r=t?"".concat(t,".").concat(i):i;n({label:r,id:r})}}))};function Py(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function jy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Py(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Py(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qy=new Lt("variables"),Uy=cs.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel:function(e){var t=e.options,n=e.node;return"".concat(t.charOpen).concat(n.attrs.label||n.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,n=e.HTMLAttributes;return["span",rs({"data-variable":""},this.options.HTMLAttributes,n),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(n){(0,n.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 n=t.tr,i=t.state,r=!1,a=i.selection,o=a.empty,s=a.anchor;return!!o&&(i.doc.nodesBetween(s-1,s,(function(t,i){if(t.type.name===e.name)return r=!0,n.insertText("",i,i+t.nodeSize),!1})),r)}))}}},addProseMirrorPlugins:function(){return[mb(jy({editor:this.editor},this.options.suggestion))]}}),zy={char:"{{",startOfLine:!1,pluginKey:qy,command:function(e){var t=e.editor,n=e.range,i=e.props;t.chain().focus().deleteRange(n).setVariable(i).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu(By,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Hy=function(e){var t=e.suggestion,n=void 0===t?{}:t;return Uy.configure({suggestion:jy(jy({},zy),n)})},Wy=n(35),Gy=n.n(Wy),Yy=n(97),Vy=n.n(Yy),$y=function(e){var t=Gy()(e);return"string"===t||"funtion"===t?e:Vy()(e)?function(t){var n=t.node.type.name;return e[n]}:""},Ky=ma.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 Mt({props:{decorations:function(t){var n=t.doc,i=t.selection,r=e.editor.isEditable||!e.options.showOnlyWhenEditable,a=i.anchor,o=[];if(r)return n.descendants((function(t,n){var i=a>=n&&a<=n+t.nodeSize,r=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((i||!e.options.showOnlyCurrent)&&!s&&r){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=Tr.node(n,n+t.nodeSize,{class:l.join(" "),"data-placeholder":"function"==typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:n}):e.options.placeholder});o.push(u)}return e.options.includeChildren})),Rr.create(n,o)}}})]}});const Qy=new Lt("suggestion");function Zy({pluginKey:e=Qy,editor:t,char:n="@",allowSpaces:i=!1,prefixSpace:r=!0,startOfLine:a=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:_=(()=>!0)}){const c=null==d?void 0:d();return new Mt({key:e,view(){return{update:async(e,n)=>{var i,r,a,o,s;const d=null===(i=this.key)||void 0===i?void 0:i.getState(n),_=null===(r=this.key)||void 0===r?void 0:r.getState(e.state),f=d.active&&_.active&&d.range.from!==_.range.from,g=!d.active&&_.active,h=d.active&&!_.active,p=g||f,m=!g&&!h&&d.query!==_.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:_,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={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:y,clientRect:y?()=>{var e;const{decorationId:n}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${n}"]`).getBoundingClientRect()}:null};F&&(null===(a=null==c?void 0:c.onExit)||void 0===a||a.call(c,E)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,E)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,E))}}},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:d}=l,c={...o};if(c.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:i,startOfLine:r,$position:a}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=r?"^":"",u=n?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=a.depth<=0?0:a.before(),_=a.pos,c=a.doc.textBetween(d,_,"\0","\0"),f=Array.from(c.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(i&&!h)return null;const p=f.index+a.start();let m=p+f[0].length;return n&&s.test(c.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<a.pos&&m>=a.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:n,allowSpaces:i,prefixSpace:r,startOfLine:a,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&_({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 n;const{active:i,range:r}=this.getState(e.state);return i&&(null===(n=null==c?void 0:c.onKeyDown)||void 0===n?void 0:n.call(c,{view:e,event:t,range:r}))||!1},decorations(e){const{active:t,range:n,decorationId:i}=this.getState(e);return t?Rr.create(e.doc,[Tr.inline(n.from,n.to,{nodeName:o,class:s,"data-decoration-id":i})]):null}}})}const Xy=new Lt("mention"),Jy=cs.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var n;return`${e.suggestion.char}${null!==(n=t.attrs.label)&&void 0!==n?n:t.attrs.id}`},suggestion:{char:"@",pluginKey:Xy,command:({editor:e,range:t,props:n})=>{var i;const r=e.view.state.selection.$to.nodeAfter;(null===(i=null==r?void 0:r.text)||void 0===i?void 0:i.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const n=e.state.doc.resolve(t.from),i=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},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",rs({"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 n=!1;const{selection:i}=t,{empty:r,anchor:a}=i;return!!r&&(t.doc.nodesBetween(a-1,a,(t,i)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",i,i+t.nodeSize),!1}),n)})}},addProseMirrorPlugins(){return[Zy({editor:this.editor,...this.options.suggestion})]}});function eE(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 n,i=cc()(e);if(t){var r=cc()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return dc()(this,n)}}var tE=function(e){lc()(n,e);var t=eE(n);function n(e){var i;return nc()(this,n),i=t.call(this,e),_()(oc()(i),"selectItem",(function(e){var t=i.props,n=t.items,r=t.command,a=n[e];a&&r({label:a.label,id:a.key})})),_()(oc()(i),"upHandler",(function(){var e=i.props.items;i.setState((function(t){return{selectedIndex:(t.selectedIndex+e.length-1)%e.length}}))})),_()(oc()(i),"downHandler",(function(){var e=i.props.items;i.setState((function(t){return{selectedIndex:(t.selectedIndex+1)%e.length}}))})),_()(oc()(i),"enterHandler",(function(){var e=i.state.selectedIndex;i.selectItem(e)})),_()(oc()(i),"onKeyDown",(function(e){var t=e.event,n={ArrowUp:i.upHandler,ArrowDown:i.downHandler,Enter:i.enterHandler};return!!n.hasOwnProperty(t.key)&&(n[t.key](),!0)})),i.state={selectedIndex:0},i.mentionRef=m.a.createRef(),i}return rc()(n,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),_b({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,n=this.props.items;return 0===n.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"},n.map((function(n,i){var r=n.label,a=n.imageUrl,o=n.showImage;return m.a.createElement("button",{className:b()("neeto-editor-mentions__item",{active:i===t}),key:r,onClick:function(){return e.selectItem(i)}},o&&m.a.createElement(Y_,{user:{name:r,imageUrl:a}}),m.a.createElement("p",null,r))})))}}]),n}(m.a.Component);function nE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function iE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nE(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var rE=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.showImage,i=void 0!==n&&n,r=e.map((function(e){var t;return"string"==typeof e?t={key:e,label:e}:"object"===Gy()(e)&&(t=iE({},e)),t.showImage=i,t}));return function(e){var t=e.query;return r.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())}))}},aE=["suggestion"];function oE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function sE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oE(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var lE={render:function(){var e,t;return{onStart:function(n){e=new xu(tE,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(n){var i;return"Escape"===n.event.key?(t[0].hide(),!0):null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(n)},onExit:function(){t[0].destroy(),e.destroy()}}}},uE=Jy.extend({addCommands:function(){var e=this;return{setMention:function(t){return function(n){(0,n.chain)().focus().insertContent([{type:e.name,attrs:{id:t,label:t}},{type:"text",text:" "}]).run()}}}}}),dE=function(e){var t=e.suggestion,n=void 0===t?{}:t,i=h()(e,aE);return uE.configure(sE(sE({},i),{},{suggestion:sE(sE({},lE),n)}))},_E=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["div",{class:"video-wrapper"},["iframe",rs(this.options.HTMLAttributes,t)]]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}}}}}),cE=n(98);function fE(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 n,i=cc()(e);if(t){var r=cc()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return dc()(this,n)}}var gE=function(e){lc()(n,e);var t=fE(n);function n(){var e;nc()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),_()(oc()(e),"state",{selectedIndex:0,emojiSuggestions:Hc.search(e.props.query||"smile").slice(0,5)}),_()(oc()(e),"onKeyDown",(function(t){var n=t.event;if("ArrowLeft"===n.key||"ArrowDown"===n.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===n.key||"ArrowUp"===n.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===n.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===n.key){var i;if(Object(cE.isEmpty)(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(i=Hc.search(e.props.query))||void 0===i?void 0:i[0]).run();return!0}return"Escape"===n.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),_()(oc()(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return rc()(n,[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:Hc.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,n){return m.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(n)},className:b()("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--highlight":n===e.state.selectedIndex})},t.native)})):m.a.createElement("p",null,"No results"))}}]),n}(m.a.Component);function hE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function pE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hE(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mE=new Lt("emoji-suggestion"),FE=cs.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:mE,items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu(gE,{props:n,editor:n.editor}),t=bu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.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[mb(pE({editor:this.editor},this.options.suggestion))]}});function bE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function yE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bE(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var EE=new Lt("emoji-picker"),vE=cs.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:EE,items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu($f,{props:n,editor:n.editor}),t=bu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown:function(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[mb(yE({editor:this.editor},this.options.suggestion))]}}),kE=function(e){return function(e){var t=e.handleSubmit;return ma.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 DE=function(e){var t,n,i,r,a,o,s=e.editor,l=e.limit,u=e.strategy;if("hidden"===u)return null;var d="limit"===u&&l;return m.a.createElement("p",{className:"neeto-editor-character-count"},d?"".concat(l-(null==s||null===(t=s.storage)||void 0===t||null===(n=t.characterCount)||void 0===n?void 0:n.characters())," characters remaining"):"".concat(null==s||null===(i=s.storage)||void 0===i||null===(r=i.characterCount)||void 0===r?void 0:r.characters()," characters, ").concat(null==s||null===(a=s.storage)||void 0===a||null===(o=a.characterCount)||void 0===o?void 0:o.words()," words"))},CE=["forceTitle","titleError","hideSlashCommands","addons","markdownMode","className","uploadEndpoint","initialValue","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName","characterLimit","editorSecrets","rows","autoFocus","onSubmit","heightStrategy","characterCountStrategy"],wE=function(e,t){var n=e.forceTitle,i=void 0!==n&&n,r=e.titleError,a=void 0!==r&&r,o=e.hideSlashCommands,s=void 0!==o&&o,l=e.addons,d=void 0===l?[]:l,c=e.markdownMode,g=void 0!==c&&c,F=e.className,y=e.uploadEndpoint,E=e.initialValue,v=void 0===E?"":E,k=e.onChange,D=void 0===k?function(){}:k,C=e.menuType,w=void 0===C?"fixed":C,S=e.variables,O=e.mentions,x=e.showImageInMention,T=void 0!==x&&x,N=e.placeholder,A=void 0===N?i?{title:"Untitled"}:null:N,M=e.extensions,R=e.contentClassName,I=e.characterLimit,L=e.editorSecrets,B=e.rows,P=void 0===B?6:B,j=e.autoFocus,q=void 0!==j&&j,U=e.onSubmit,z=e.heightStrategy,H=void 0===z?"fixed":z,W=e.characterCountStrategy,G=void 0===W?"hidden":W,Y=h()(e,CE),V=Object(p.useState)(!1),$=f()(V,2),K=$[0],Q=$[1],Z=!1;if(A){var X=Object.keys(A).length;Z="string"==typeof A||(1===X?!A.title:!!X)}var J="fixed"===w,ee="bubble"===w,te=!s,ne=!Z&&te,ie=d.includes("image-upload-unsplash"),re=d.map((function(e){return e.toLowerCase()}));ie&&re.push("image-upload");var ae=["font-color","font-size","bold","italic","underline","strike","link","bullet-list","ordered-list"].concat(re),oe=function(e){var t,n=e.forceTitle,i=e.placeholder,r=e.extensions,a=e.mentions,o=e.variables,s=e.isSlashCommandsActive,l=e.showImageInMention,u=e.setImageUploadVisible,d=e.options,_=e.characterLimit,c=e.onSubmit;return r?t=Dg()(r):(t=[rb,ib.extend({content:n?"title block*":"block+"}),xp.configure({document:!1,codeBlock:!1}),db,Zp,tb,em,Ly,ub,jh,_E,eb,nb,Ky.configure({placeholder:$y(i)}),FE,vE,XF.configure({limit:_}),kE({handleSubmit:c})],s&&t.push(Eb({setImageUploadVisible:u,options:d,mentions:a})),Hu()(a)||t.push(dE({suggestion:{items:rE(a.sort((function(e,t){var n="string"==typeof e?e:e.label,i="string"==typeof t?t:t.label;return n.localeCompare(i)})),{showImage:l})}})),Hu()(o)||t.push(Hy({suggestion:{items:function(){return o}}}))),t}({contentClassName:R,forceTitle:i,placeholder:A,extensions:M,mentions:O,variables:S,isSlashCommandsActive:te,showImageInMention:T,setImageUploadVisible:Q,options:ae,characterLimit:I,onSubmit:U}),se=b()("neeto-editor",_()({"slash-active":ne,"fixed-menu-active border":J,"bubble-menu-active":ee,"force-title":i,"force-title--error":a,"placeholder-active":Z},F,F)),le=21*P+26,ue="\n ".concat("flexible"===H?"min-height":"height",": ").concat(le,"px;\n "),de=Ou({extensions:oe,content:v,injectCSS:!1,editorProps:{attributes:{class:se,style:ue}},onUpdate:function(e){var t=e.editor;return D(t.getHTML())}});return Object(p.useEffect)((function(){q&&(null==de||de.commands.focus("end"))}),[de]),m.a.useImperativeHandle(t,(function(){return{editor:de}})),m.a.createElement("div",{className:"neeto-editor-wrapper"},J&&m.a.createElement(Zf,{editor:de,variables:S,setImageUploadVisible:Q,options:ae,mentions:O,showImageInMention:T}),ee&&m.a.createElement(Hd,{editor:de,options:ae}),m.a.createElement(Pg,{isVisible:K,setIsVisible:Q,editor:de,imageUploadUrl:y,isUnsplashImageUploadActive:ie,unsplashApiKey:null==L?void 0:L.unsplash}),g&&m.a.createElement(Eh,u()({editor:de,strategy:H,style:ue,className:se,onChange:D,onSubmit:U,initialValue:v},Y)),m.a.createElement("div",{className:b()({"neeto-editor-content--hidden":g})},m.a.createElement(Lu,u()({editor:de},Y))),m.a.createElement(DE,{editor:de,limit:I,strategy:G}))},SE=m.a.forwardRef(wE),OE=n(99),xE=n.n(OE);var TE=["content","classNames"],NE=function(e){var t=e.content,n=void 0===t?"":t,i=e.classNames,r=h()(e,TE);return Object(p.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){xE.a.highlightElement(e)}))}),[n]),m.a.createElement("div",u()({className:b()("neeto-editor-content",_()({},i,i)),dangerouslySetInnerHTML:{__html:qg.a.sanitize(n)}},r))}}])}));
|
|
59
|
+
*/;function sd(){return(sd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function ld(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}const ud=["onClick","reloadDocument","replace","state","target","to"],dd=["aria-current","caseSensitive","className","end","style","to"];const _d=Object(p.forwardRef)((function(e,t){let{onClick:n,reloadDocument:i,replace:r=!1,state:a,target:o,to:s}=e,l=ld(e,ud),u=Xu(s),d=function(e,t){let{target:n,replace:i,state:r}=void 0===t?{}:t,a=td(),o=ed(),s=nd(e);return Object(p.useCallback)(t=>{if(!(0!==t.button||n&&"_self"!==n||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t))){t.preventDefault();let n=!!i||Yu(o)===Yu(s);a(e,{replace:n,state:r})}},[o,a,s,i,r,n,e])}(s,{replace:r,state:a,target:o});return Object(p.createElement)("a",sd({},l,{href:u,onClick:function(e){n&&n(e),e.defaultPrevented||i||d(e)},ref:t,target:o}))}));const cd=Object(p.forwardRef)((function(e,t){let{"aria-current":n="page",caseSensitive:i=!1,className:r="",end:a=!1,style:o,to:s}=e,l=ld(e,dd),u=ed(),d=nd(s),_=u.pathname,c=d.pathname;i||(_=_.toLowerCase(),c=c.toLowerCase());let f,g=_===c||!a&&_.startsWith(c)&&"/"===_.charAt(c.length),h=g?n:void 0;f="function"==typeof r?r({isActive:g}):[r,g?"active":null].filter(Boolean).join(" ");let m="function"==typeof o?o({isActive:g}):o;return Object(p.createElement)(_d,sd({},l,{"aria-current":h,className:f,ref:t,style:m,to:s}))}));function fd(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}var gd="undefined"!=typeof window&&"undefined"!=typeof document;function hd(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function pd(){return gd&&document.createElement("div")}function md(e){var t=[];return e.forEach((function(e){t.find((function(t){return function e(t,n){if(t===n)return!0;if("object"==typeof t&&null!=t&&"object"==typeof n&&null!=n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var i in t){if(!n.hasOwnProperty(i))return!1;if(!e(t[i],n[i]))return!1}return!0}return!1}(e,t)}))||t.push(e)})),t}function Fd(e,t){var n,i;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:md([].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],(null==(i=t.popperOptions)?void 0:i.modifiers)||[]))})})}var bd=gd?p.useLayoutEffect:p.useEffect;function yd(e){var t=Object(p.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function Ed(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var vd={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function i(){e.props.className&&!n()||Ed(t,"add",e.props.className)}return{onCreate:i,onBeforeUpdate:function(){n()&&Ed(t,"remove",e.props.className)},onAfterUpdate:i}}};function kd(e){return function(t){var n=t.children,i=t.content,r=t.visible,a=t.singleton,o=t.render,s=t.reference,l=t.disabled,u=void 0!==l&&l,d=t.ignoreAttributes,_=void 0===d||d,c=(t.__source,t.__self,fd(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),f=void 0!==r,g=void 0!==a,h=Object(p.useState)(!1),F=h[0],b=h[1],y=Object(p.useState)({}),E=y[0],v=y[1],k=Object(p.useState)(),D=k[0],C=k[1],w=yd((function(){return{container:pd(),renders:1}})),S=Object.assign({ignoreAttributes:_},c,{content:w.container});f&&(S.trigger="manual",S.hideOnClick=!1),g&&(u=!0);var O=S,x=S.plugins||[];o&&(O=Object.assign({},S,{plugins:g&&null!=a.data?[].concat(x,[{fn:function(){return{onTrigger:function(e,t){var n=a.data.children.find((function(e){return e.instance.reference===t.currentTarget}));e.state.$$activeSingletonInstance=n.instance,C(n.content)}}}}]):x,render:function(){return{popper:w.container}}}));var T=[s].concat(n?[n.type]:[]);return bd((function(){var t=s;s&&s.hasOwnProperty("current")&&(t=s.current);var n=e(t||w.ref||pd(),Object.assign({},O,{plugins:[vd].concat(S.plugins||[])}));return w.instance=n,u&&n.disable(),r&&n.show(),g&&a.hook({instance:n,content:i,props:O,setSingletonContent:C}),b(!0),function(){n.destroy(),null==a||a.cleanup(n)}}),T),bd((function(){var e;if(1!==w.renders){var t=w.instance;t.setProps(Fd(t.props,O)),null==(e=t.popperInstance)||e.forceUpdate(),u?t.disable():t.enable(),f&&(r?t.show():t.hide()),g&&a.hook({instance:t,content:i,props:O,setSingletonContent:C})}else w.renders++})),bd((function(){var e;if(o){var t=w.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,i=null==(t=n.modifiersData)?void 0:t.hide;E.placement===n.placement&&E.referenceHidden===(null==i?void 0:i.isReferenceHidden)&&E.escaped===(null==i?void 0:i.hasPopperEscaped)||v({placement:n.placement,referenceHidden:null==i?void 0:i.isReferenceHidden,escaped:null==i?void 0:i.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[E.placement,E.referenceHidden,E.escaped].concat(T)),m.a.createElement(m.a.Fragment,null,n?Object(p.cloneElement)(n,{ref:function(e){w.ref=e,hd(n.ref,e)}}):null,F&&Object(Du.createPortal)(o?o(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(E),D,w.instance):i,w.container))}}var Dd=function(e,t){return Object(p.forwardRef)((function(n,i){var r=n.children,a=fd(n,["children"]);return m.a.createElement(e,Object.assign({},t,a),r?Object(p.cloneElement)(r,{ref:function(e){hd(i,e),hd(r.ref,e)}}):null)}))},Cd=Dd(kd(bu)),wd=["content","children","theme","disabled","placement","position","interactive"],Sd=function(e){var t=e.content,n=e.children,i=e.theme,r=void 0===i?"dark":i,a=e.disabled,o=void 0!==a&&a,s=e.placement,l=e.position,d=void 0===l?"auto":l,_=e.interactive,c=void 0!==_&&_,f=h()(e,wd);return m.a.createElement(Cd,u()({role:"tooltip",theme:r,content:t,arrow:"<svg width='10' height='5' viewBox='0 0 10 5' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M10 5H0.926697L3.95208 1.63847C4.74227 0.760478 6.11722 0.754951 6.91445 1.62656L10 5Z' /></svg>",disabled:o,animation:"scale-subtle",placement:s||d,plugins:[Fu],interactive:c,duration:[100,200],zIndex:100001},f),n)},Od=["icon","iconPosition","iconSize","label","loading","onClick","to","type","style","fullWidth","className","disabled","size","href","tooltipProps"],xd=function(){},Td="primary",Nd="secondary",Ad="danger",Md="text",Rd="link",Id="large",Ld="left",Bd=Object(p.forwardRef)((function(e,t){var n,i,r=e.icon,a=void 0===r?null:r,o=e.iconPosition,s=void 0===o?"right":o,l=e.iconSize,d=void 0===l?16:l,_=e.label,c=void 0===_?"":_,f=e.loading,g=void 0!==f&&f,p=e.onClick,F=void 0===p?xd:p,y=e.to,E=void 0===y?null:y,v=e.type,k=void 0===v?"button":v,D=e.style,C=void 0===D?"primary":D,w=e.fullWidth,S=void 0!==w&&w,O=e.className,x=void 0===O?"":O,T=e.disabled,N=void 0!==T&&T,A=e.size,M=void 0===A?null:A,R=e.href,I=void 0===R?null:R,L=e.tooltipProps,B=void 0===L?null:L,P=h()(e,Od);E?(n=_d,i={to:E}):I?(n="a",i={href:I}):(n="button",i={type:k});var j="string"==typeof a?function(){return m.a.createElement("i",{className:b()("ne-btn__icon",[a])})}:a||m.a.Fragment;return m.a.createElement(Sd,u()({},B,{disabled:!B}),m.a.createElement(n,u()({ref:t,onClick:function(e){g||N||F(e)},className:b()("ne-btn",[x],{"ne-btn--style-primary":C===Td,"ne-btn--style-secondary":C===Nd,"ne-btn--style-danger":C===Ad,"ne-btn--style-text":C===Md,"ne-btn--style-link":C===Rd,"ne-btn--size-large":M===Id,"ne-btn--width-full":S,"ne-btn--icon-left":s==Ld,"ne-btn--icon-only":!c,disabled:N}),disabled:N},i,P),c&&m.a.createElement("span",null,c),a?m.a.createElement(j,{key:"2",size:d,className:"ne-btn__icon"}):null))}));Bd.displayName="Button";var Pd=Bd,jd=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,qd=/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,Ud=/((?:http|https):\/\/)?(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|(?:manage\/)?videos?\/|)(\d+)(?:(?:\/|\?h=)(\w+))?(?:|\/\?)/,zd=function(e){var t=e.editor,n=e.handleClose,i=e.handleAnimateInvalidLink,r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1];Object(p.useEffect)((function(){s(t.getAttributes("link").href||"")}),[]);var l=function(){jd.test(o)?(t.chain().focus().setLink({href:o}).run(),n()):Hu()(o)?(t.chain().focus().unsetLink().run(),n()):(s(""),i())};return m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?n():"Enter"===e.key&&l()},className:"neeto-editor-bubble-menu__link"},m.a.createElement("input",{autoFocus:!0,name:"url",value:o,placeholder:"Paste or type a link...",onChange:function(e){var t=e.target.value;return s(t)},className:"neeto-editor-bubble-menu-link__input"}),m.a.createElement(Pd,{style:"icon",icon:ju.Close,onClick:function(){o?(s(""),t.chain().focus().unsetLink().run()):n()}}))};function Hd(e){var t=e.editor,n=e.options,i=Object(p.useState)(!1),r=f()(i,2),a=r[0],o=r[1],s=Object(p.useState)(!1),l=f()(s,2),d=l[0],_=l[1];if(!t)return null;var c=[{Icon:ju.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:ju.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:ju.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:ju.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:ju.Link,command:function(){o(!0)},active:t.isActive("link"),optionName:"link"},{Icon:ju.Code,command:function(){return t.chain().focus().toggleCode().run()},active:t.isActive("code"),optionName:"code-block"},{Icon:ju.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}];return m.a.createElement(wu,{editor:t,tippyOptions:{arrow:'<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',placement:"top-start",zIndex:99999,onHide:function(){return o(!1)}},className:b()("neeto-editor-bubble-menu",{"neeto-editor-bubble-menu-animate-shake":d})},a?m.a.createElement(zd,{editor:t,handleClose:function(){return o(!1)},handleAnimateInvalidLink:function(){_(!0);var e=setTimeout((function(){_(!1),clearTimeout(e)}),1e3)}}):c.filter((function(e){var t=e.optionName;return n.includes(t)})).map((function(e){return m.a.createElement(Wd,u()({},e,{key:e.optionName}))})))}var Wd=function(e){var t=e.Icon,n=e.command,i=e.active,r=e.iconSize;return m.a.createElement("div",{className:b()("neeto-editor-bubble-menu__item",{active:i}),onClick:n},m.a.createElement(t,{size:r||20}))},Gd=n(1),Yd=n.n(Gd),Vd=["size","color","underlineColor"];function $d(e){var t=e.size,n=e.color,i=e.underlineColor,r=h()(e,Vd);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},r),m.a.createElement("path",{d:"M21 20H3",stroke:i||n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M17.3125 15L12.1562 4L7 15M8.03125 12.8H16.2812",stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}$d.defaultProps={color:"currentColor",size:24},$d.propTypes={color:Yd.a.string,size:Yd.a.oneOfType([Yd.a.string,Yd.a.number])};var Kd=["size","color","bgColor"];function Qd(e){var t=e.size,n=e.color,i=e.bgColor,r=h()(e,Kd);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},r),m.a.createElement("path",{d:"M21 7V17C21 19.209 19.209 21 17 21H7C4.791 21 3 19.209 3 17V7C3 4.791 4.791 3 7 3H17C19.209 3 21 4.791 21 7Z",fill:i,stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M10 8V16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M14 8V16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 14H16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 10H16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}))}Qd.defaultProps={color:"white",bgColor:"#68737D",size:24},Qd.propTypes={color:Yd.a.string,bgColor:Yd.a.string,size:Yd.a.oneOfType([Yd.a.string,Yd.a.number])};var Zd=function(e){var t=e.color,n=void 0===t?"#000":t,i=e.onChange,r=Object(p.useRef)();return m.a.createElement("div",{onClick:function(){var e;return null===(e=r.current)||void 0===e?void 0:e.click()},className:"neeto-editor-fixed-menu__item"},m.a.createElement($d,{size:20,color:"#87929D",underlineColor:n}),m.a.createElement("input",{ref:r,type:"color",onChange:function(e){return i&&i(e.target.value)}}))},Xd=n(89),Jd=n.n(Xd),e_=function(e){return e.reduce((function(e,t){var n=t[0],i=t[1];return e[n]=i,e}),{})},t_="undefined"!=typeof window&&window.document&&window.document.createElement?p.useLayoutEffect:p.useEffect,n_=[],i_="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function r_(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function a_(e,t){for(var n=t.slice(0,t.length-1),i=0;i<n.length;i++)n[i]=e[n[i].toLowerCase()];return n}function o_(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var s_={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,"-":i_?173:189,"=":i_?61:187,";":i_?59:186,"'":222,"[":219,"]":221,"\\":220},l_={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},u_={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},d_={16:!1,18:!1,17:!1,91:!1},__={},c_=1;c_<20;c_++)s_["f".concat(c_)]=111+c_;var f_=[],g_="all",h_=[],p_=function(e){return s_[e.toLowerCase()]||l_[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function m_(e){g_=e||"all"}function F_(){return g_||"all"}var b_=function(e){var t=e.key,n=e.scope,i=e.method,r=e.splitKey,a=void 0===r?"+":r;o_(t).forEach((function(e){var t=e.split(a),r=t.length,o=t[r-1],s="*"===o?"*":p_(o);if(__[s]){n||(n=F_());var l=r>1?a_(l_,t):[];__[s]=__[s].map((function(e){return(!i||e.method===i)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,i=e.length>=t.length?t:e,r=!0,a=0;a<n.length;a++)-1===i.indexOf(n[a])&&(r=!1);return r}(e.mods,l)?{}:e}))}}))};function y_(e,t,n){var i;if(t.scope===n||"all"===t.scope){for(var r in i=t.mods.length>0,d_)Object.prototype.hasOwnProperty.call(d_,r)&&(!d_[r]&&t.mods.indexOf(+r)>-1||d_[r]&&-1===t.mods.indexOf(+r))&&(i=!1);(0!==t.mods.length||d_[16]||d_[18]||d_[17]||d_[91])&&!i&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function E_(e){var t=__["*"],n=e.keyCode||e.which||e.charCode;if(v_.filter.call(this,e)){if(93!==n&&224!==n||(n=91),-1===f_.indexOf(n)&&229!==n&&f_.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=u_[t];e[t]&&-1===f_.indexOf(n)?f_.push(n):!e[t]&&f_.indexOf(n)>-1?f_.splice(f_.indexOf(n),1):"metaKey"===t&&e[t]&&3===f_.length&&(e.ctrlKey||e.shiftKey||e.altKey||(f_=f_.slice(f_.indexOf(n))))})),n in d_){for(var i in d_[n]=!0,l_)l_[i]===n&&(v_[i]=!0);if(!t)return}for(var r in d_)Object.prototype.hasOwnProperty.call(d_,r)&&(d_[r]=e[u_[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===f_.indexOf(17)&&f_.push(17),-1===f_.indexOf(18)&&f_.push(18),d_[17]=!0,d_[18]=!0);var a=F_();if(t)for(var o=0;o<t.length;o++)t[o].scope===a&&("keydown"===e.type&&t[o].keydown||"keyup"===e.type&&t[o].keyup)&&y_(e,t[o],a);if(n in __)for(var s=0;s<__[n].length;s++)if(("keydown"===e.type&&__[n][s].keydown||"keyup"===e.type&&__[n][s].keyup)&&__[n][s].key){for(var l=__[n][s],u=l.splitKey,d=l.key.split(u),_=[],c=0;c<d.length;c++)_.push(p_(d[c]));_.sort().join("")===f_.sort().join("")&&y_(e,l,a)}}}function v_(e,t,n){f_=[];var i=o_(e),r=[],a="all",o=document,s=0,l=!1,u=!0,d="+";for(void 0===n&&"function"==typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(a=t.scope),t.element&&(o=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(u=t.keydown),"string"==typeof t.splitKey&&(d=t.splitKey)),"string"==typeof t&&(a=t);s<i.length;s++)r=[],(e=i[s].split(d)).length>1&&(r=a_(l_,e)),(e="*"===(e=e[e.length-1])?"*":p_(e))in __||(__[e]=[]),__[e].push({keyup:l,keydown:u,scope:a,mods:r,shortcut:i[s],method:n,key:i[s],splitKey:d});void 0!==o&&!function(e){return h_.indexOf(e)>-1}(o)&&window&&(h_.push(o),r_(o,"keydown",(function(e){E_(e)})),r_(window,"focus",(function(){f_=[]})),r_(o,"keyup",(function(e){E_(e),function(e){var t=e.keyCode||e.which||e.charCode,n=f_.indexOf(t);if(n>=0&&f_.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&f_.splice(0,f_.length),93!==t&&224!==t||(t=91),t in d_)for(var i in d_[t]=!1,l_)l_[i]===t&&(v_[i]=!1)}(e)})))}var k_={setScope:m_,getScope:F_,deleteScope:function(e,t){var n,i;for(var r in e||(e=F_()),__)if(Object.prototype.hasOwnProperty.call(__,r))for(n=__[r],i=0;i<n.length;)n[i].scope===e?n.splice(i,1):i++;F_()===e&&m_(t||"all")},getPressedKeyCodes:function(){return f_.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=p_(e)),-1!==f_.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,i=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(i=!1),i},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&b_(e)}));else if("object"==typeof e)e.key&&b_(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=n[0],a=n[1];"function"==typeof r&&(a=r,r=""),b_({key:e,scope:r,method:a,splitKey:"+"})}}else Object.keys(__).forEach((function(e){return delete __[e]}))}};for(var D_ in k_)Object.prototype.hasOwnProperty.call(k_,D_)&&(v_[D_]=k_[D_]);if("undefined"!=typeof window){var C_=window.hotkeys;v_.noConflict=function(e){return e&&window.hotkeys===v_&&(window.hotkeys=C_),v_},window.hotkeys=v_}var w_=v_;w_.filter=function(){return!0};var S_=function(e,t){var n=e.target,i=n&&n.tagName;return Boolean(i&&t&&t.includes(i))};function O_(e,t,n,i){n instanceof Array&&(i=n,n=void 0);var r=n||{},a=r.enableOnTags,o=r.filter,s=r.keyup,l=r.keydown,u=r.filterPreventDefault,d=void 0===u||u,_=r.enabled,c=void 0===_||_,f=r.enableOnContentEditable,g=void 0!==f&&f,h=Object(p.useRef)(null),m=Object(p.useCallback)((function(e,n){var i;return o&&!o(e)?!d:!!(S_(e,["INPUT","TEXTAREA","SELECT"])&&!S_(e,a)||null!=(i=e.target)&&i.isContentEditable&&!g)||(null===h.current||document.activeElement===h.current)&&(t(e,n),!0)}),i?[h,a,o].concat(i):[h,a,o]);return Object(p.useEffect)((function(){if(c)return s&&!0!==l&&(n.keydown=!1),w_(e,n||{},m),function(){return w_.unbind(e,m)};w_.unbind(e,m)}),[m,e,c]),h}w_.isPressed;var x_=function(e){return e&&e.replace?e.replace(/[\s_]/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/-+/g,"-").toLowerCase():"nui"},T_=function(e,t){Object(p.useEffect)((function(){var n=function(n){e.current&&!e.current.contains(n.target)&&t(n)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[e,t])},N_=["icon","label","isOpen","onVisible","onClose","ulProps","position","children","autoWidth","className","buttonStyle","buttonProps","customTarget","disabled","closeOnEsc","closeOnSelect","closeOnOutsideClick","dropdownModifiers"];function A_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function M_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A_(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R_=function(){},I_=Object(p.forwardRef)((function(e,t){e.icon;var n=e.label,i=e.isOpen,r=e.onVisible,a=void 0===r?R_:r,o=e.onClose,s=void 0===o?R_:o,l=e.ulProps,d=e.position,c=e.children,g=e.autoWidth,F=e.className,y=(e.buttonStyle,e.buttonProps),E=e.customTarget,v=(e.disabled,e.closeOnEsc),k=void 0===v||v,D=e.closeOnSelect,C=void 0===D||D,w=e.closeOnOutsideClick,S=void 0===w||w,O=e.dropdownModifiers,x=void 0===O?[]:O,T=h()(e,N_),N=Object(p.useRef)(),A=E(),M=!(null==i),R=Object(p.useState)(!1),I=f()(R,2),L=I[0],B=I[1],P=Object(p.useState)(null),j=f()(P,2),q=j[0],U=j[1],z=Object(p.useState)(null),H=f()(z,2),W=H[0],G=H[1],Y=function(e,t,n){void 0===n&&(n={});var i=p.useRef(null),r={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||n_},a=p.useState({styles:{popper:{position:r.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],s=a[1],l=p.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,n=Object.keys(t.elements);s({styles:e_(n.map((function(e){return[e,t.styles[e]||{}]}))),attributes:e_(n.map((function(e){return[e,t.attributes[e]]})))})},requires:["computeStyles"]}}),[]),u=p.useMemo((function(){var e={onFirstUpdate:r.onFirstUpdate,placement:r.placement,strategy:r.strategy,modifiers:[].concat(r.modifiers,[l,{name:"applyStyles",enabled:!1}])};return Jd()(i.current,e)?i.current||e:(i.current=e,e)}),[r.onFirstUpdate,r.placement,r.strategy,r.modifiers,l]),d=p.useRef();return t_((function(){d.current&&d.current.setOptions(u)}),[u]),t_((function(){if(null!=e&&null!=t){var i=(n.createPopper||wl)(e,t,u);return d.current=i,function(){i.destroy(),d.current=null}}}),[e,t,n.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}}(q,W,{placement:d||"bottom-end",modifiers:x}),V=Y.styles,$=Y.attributes;Object(p.useImperativeHandle)(t,(function(){return{close:function(){return B(!1)},visible:L}}));var K=function(){M||B(!1),s()},Q=function(){!M&&B(!L)};return k&&O_("esc",K),S&&T_(N,K),M||(y=M_(M_({},y),{},{onClick:function(){Q()}})),Object(p.useEffect)((function(){M&&B(i)}),[i]),Object(p.useEffect)((function(){L&&a()}),[L]),m.a.createElement("div",u()({ref:N,className:b()("ne-dropdown__wrapper",_()({"ne-dropdown__wrapper--auto-width":g},F,F))},T),E?m.a.createElement("div",{ref:U,onClick:Q},A):m.a.createElement("div",null,n,m.a.createElement(ju.Down,null)),L&&m.a.createElement("ul",u()({className:"ne-dropdown__popup",ref:G,onClick:function(){C&&K()},"data-cy":"".concat(x_(n),"-dropdown-container")},l,{style:M_(M_({display:"block"},V.offset),V.popper)},$.popper),c))})),L_=function(e){var t=e.editor;return m.a.createElement(I_,{customTarget:function(){return m.a.createElement("button",{type:"button",className:"neeto-editor-fixed-menu__item"},m.a.createElement(ju.TextSize,{size:20,color:t.isActive("heading")?"#2F3941":"#87929D"}))},className:"neeto-editor-font-size-wrapper",placement:"bottom"},[{label:"H1",value:1},{label:"H2",value:2},{label:"H3",value:3}].map((function(e){var n,i=e.label,r=e.value;return m.a.createElement("li",{onClick:function(){return e=r,t.chain().focus().toggleHeading({level:e}).run();var e},key:r,className:b()({active:(n=r,t.isActive("heading",{level:n}))})},i)})))};function B_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function P_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B_(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j_=function(e){var t=e.onClickVariable,n=e.variables,i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=[];return e.forEach((function(e){var i=e.category_key,r=e.category_label,a=e.variables;if(i&&a){var o=a.map((function(e){return P_(P_({},e),{},{category_key:i})}));n.push({label:r,variables:o})}else t.push(e)})),t.length&&n.push({label:n.length?"Others":null,variables:t}),n}(n);return n&&n.length?m.a.createElement("div",{className:"neeto-editor-variables-list"},i.map((function(e){var n=e.label,i=e.variables;return m.a.createElement(q_,{key:n,title:n,variables:i,onClickItem:t})}))):null},q_=function(e){var t=e.title,n=e.variables,i=e.onClickItem;return m.a.createElement("div",{className:"neeto-editor-variables-block"},t&&m.a.createElement("h6",null,t),m.a.createElement("div",{className:"neeto-editor-variables-row"},n.map((function(e){return m.a.createElement("button",{type:"button",onClick:function(){return i(e)},key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable"},e.label)}))))},U_=function(e){var t=e.editor,n=e.variables;return n&&n.length?m.a.createElement(I_,{customTarget:function(){return m.a.createElement("button",{type:"button",className:"neeto-editor-fixed-menu__item"},m.a.createElement(Qd,{size:20}))},autoWidth:!0},m.a.createElement(j_,{onClickVariable:function(e){var n=e.category_key,i=e.key,r=n?"".concat(n,".").concat(i):i;t.chain().focus().setVariable({label:r}).run()},variables:n})):null},z_=["size","user","isSquare","status","onClick","className"],H_={small:24,medium:32,large:40,xlarge:64},W_=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function G_(e){var t,n,i=e.size,r=e.user,a=e.isSquare,o=e.status,s=e.onClick,l=e.className,d=h()(e,z_),_=Object(p.useState)(!1),c=f()(_,2),g=c[0],F=c[1],y=r.name,E=void 0===y?"":y,v=r.imageUrl,k="medium"===i,D="large"===i,C="xlarge"===i,w=(t=E.trim().split(" ")).reduce((function(e,n,i){return 0!==i&&i!==t.length-1||(e="".concat(e).concat(n.charAt(0).toUpperCase())),e}),""),S={height:H_[i],width:H_[i],backgroundColor:(n=(w.charCodeAt(0)||0)+(w.charCodeAt(1)||0),W_[n%65%W_.length]||W_[0])},O=b()("ne-avatar",{"ne-avatar--medium":k,"ne-avatar--large":D,"ne-avatar--xlarge":C,"ne-avatar--round":!a,hidden:!g}),x=b()("ne-avatar__text",{"ne-avatar__text-medium":k,"ne-avatar__text-large":D,"ne-avatar__text-xlarge":C}),T=b()("ne-avatar__status","".concat(o),{"ne-avatar__status-medium":k,"ne-avatar__status-large":D,"ne-avatar__status-xlarge":C,"ne-avatar__status-square":a}),N=function(){return null==o?m.a.Fragment:m.a.createElement("span",{className:T})},A=function(){return m.a.createElement("span",{className:x},w)},M=w&&!v&&!g;return m.a.createElement("div",u()({onClick:s,style:S,className:b()("ne-avatar--container",{"ne-avatar--container-round":!a},l)},d),m.a.createElement(N,null),M?m.a.createElement(A,null):m.a.createElement("img",{className:O,onLoad:function(){return F(!0)},onError:function(){return F(!1)},src:v,alt:"avatar-".concat(w)}))}G_.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},G_.propTypes={size:Yd.a.oneOf(Object.keys(H_)),user:Yd.a.shape({imageUrl:Yd.a.string,name:Yd.a.string}),isSquare:Yd.a.bool,onClick:Yd.a.func,status:Yd.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:Yd.a.string};var Y_=G_,V_=function(e){var t=e.editor,n=e.mentions,i=e.showImageInMention,r=Object(p.useRef)();return n&&n.length?m.a.createElement(I_,{ref:r,customTarget:function(){var e;return m.a.createElement("button",{type:"button",className:"neeto-editor-fixed-menu__item"},m.a.createElement(ju.Email,{size:20,color:null!==(e=r.current)&&void 0!==e&&e.visible?"#2F3941":"#87929D"}))},autoWidth:!0},m.a.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},n.map((function(e){var n="string"==typeof e?e:e.label,r="string"==typeof e?"":e.imageUrl;return m.a.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:n,onClick:function(){return t.commands.setMention(n)}},i&&m.a.createElement(Y_,{size:"small",user:{name:n,imageUrl:r}}),m.a.createElement("p",null,n))})))):null},$_=["children","className","required","helpIconProps"],K_=["onClick","icon","tooltipProps","className"],Q_=function(e){var t=e.children,n=e.className,i=void 0===n?"":n,r=e.required,a=void 0!==r&&r,o=e.helpIconProps,s=void 0===o?null:o,l=h()(e,$_),d=s||{},c=d.onClick,f=d.icon,g=d.tooltipProps,p=d.className,F=h()(d,K_),y=f||ju.Info;return m.a.createElement("label",u()({className:b()("ne-label flex items-center",i)},l),t,a&&m.a.createElement("span",{"aria-hidden":!0},"*"),s&&m.a.createElement(Sd,u()({},g,{disabled:!g}),m.a.createElement("span",{className:b()("ml-1",_()({},p,p)),onClick:c},m.a.createElement(y,u()({size:16},F)))))},Z_=["id","size","type","label","error","suffix","prefix","disabled","helpText","className","nakedInput","contentSize","required"],X_=Object(p.forwardRef)((function(e,t){var n=e.id,i=e.size,r=void 0===i?"small":i,a=e.type,o=void 0===a?"text":a,s=e.label,l=e.error,d=void 0===l?null:l,_=e.suffix,c=void 0===_?null:_,f=e.prefix,g=void 0===f?null:f,p=e.disabled,F=void 0!==p&&p,y=e.helpText,E=void 0===y?"":y,v=e.className,k=void 0===v?"":v,D=e.nakedInput,C=void 0!==D&&D,w=e.contentSize,S=void 0===w?null:w,O=e.required,x=void 0!==O&&O,T=h()(e,Z_);return m.a.createElement("div",{className:b()(["ne-input__wrapper",k])},s&&m.a.createElement(Q_,{required:x,"data-cy":"".concat(x_(s),"-input-label"),htmlFor:n},s),m.a.createElement("div",{className:b()("ne-input",{"ne-input--naked":!!C,"ne-input--error":!!d,"ne-input--disabled":!!F,"ne-input--small":"small"===r})},g&&m.a.createElement("div",{className:"ne-input__prefix"},g),m.a.createElement("input",u()({ref:t,type:o,disabled:F,size:S,required:x,"aria-invalid":!!d,"data-cy":"input-field"},T)),c&&m.a.createElement("div",{className:"ne-input__suffix"},c)),!!d&&m.a.createElement("p",{"data-cy":"".concat(x_(s),"-input-error"),className:"ne-input__error"},d),E&&m.a.createElement("p",{className:"ne-input__help-text"},E))}));X_.displayName="Input";var J_=X_,ec=function(e){var t=e.editor,n=Object(p.useRef)(),i=Object(p.useRef)(),r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1],l=Object(p.useState)(""),u=f()(l,2),d=u[0],_=u[1],c=t.isActive("link"),g=function(){_(t.getAttributes("link").href||"")},h=function(){var e;jd.test(d)?(t.chain().focus().setLink({href:d}).run(),null===(e=n.current)||void 0===e||e.close()):s("Please enter a valid url")};return m.a.createElement(I_,{ref:n,onVisible:function(){var e;return null===(e=i.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:function(){return m.a.createElement("button",{type:"button",className:"neeto-editor-fixed-menu__item",onClick:g},m.a.createElement(ju.Link,{size:20,color:c?"#2F3941":"#87929D"}))},className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?n.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},m.a.createElement(J_,{ref:i,name:"url",value:d,placeholder:"Paste URL",onFocus:function(){return s("")},error:o,onChange:function(e){var t=e.target.value;return _(t)}}),m.a.createElement(Pd,{label:"Link",onClick:h}),c&&m.a.createElement(Pd,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=n.current)||void 0===e||e.close()}})))},tc=n(21),nc=n.n(tc),ic=n(22),rc=n.n(ic),ac=n(15),oc=n.n(ac),sc=n(23),lc=n.n(sc),uc=n(24),dc=n.n(uc),_c=n(18),cc=n.n(_c),fc=n(32),gc=n(10),hc=n.n(gc),pc=n(11),mc=n.n(pc),Fc=n(48),bc=n.n(Fc),yc={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"},Ec=function(e){var t=[],n=function(e,n){e&&(Array.isArray(e)?e:[e]).forEach((function(e){(n?e.split(/[-|_|\s]+/):[e]).forEach((function(e){e=e.toLowerCase(),-1==t.indexOf(e)&&t.push(e)}))}))};return n(e.short_names,!0),n(e.name,!0),n(e.keywords,!1),n(e.emoticons,!1),t.join(",")},vc=function(e){for(var t in e.compressed=!1,e.emojis){var n=e.emojis[t];for(var i in yc)n[i]=n[yc[i]],delete n[yc[i]];n.short_names||(n.short_names=[]),n.short_names.unshift(t),n.sheet_x=n.sheet[0],n.sheet_y=n.sheet[1],delete n.sheet,n.text||(n.text=""),n.added_in||(n.added_in=6),n.added_in=n.added_in.toFixed(1),n.search=Ec(n)}},kc=String.fromCodePoint||function(){var e,t,n=16384,i=[],r=-1,a=arguments.length;if(!a)return"";for(var o="";++r<a;){var s=Number(arguments[r]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?i.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,i.push(e,t)),(r+1===a||i.length>n)&&(o+=String.fromCharCode.apply(null,i),i.length=0)}return o},Dc=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,Cc=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function wc(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return kc.apply(null,t)}function Sc(e){var t=e.name,n=e.short_names,i=e.skin_tone,r=e.skin_variations,a=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,d=e.id||n[0],_=":".concat(d,":");return s?{id:d,name:t,short_names:n,colons:_,emoticons:a,custom:s,customCategory:l,imageUrl:u}:(i&&(_+=":skin-tone-".concat(i,":")),{id:d,name:t,short_names:n,colons:_,emoticons:a,unified:o.toLowerCase(),skin:i||(r?1:null),native:wc(o)})}function Oc(){return Sc(xc.apply(void 0,arguments))}function xc(e,t,n,i){var r={};if("string"==typeof e){var a=e.match(Dc);if(a&&(e=a[1],a[2]&&(t=parseInt(a[2],10))),i.aliases.hasOwnProperty(e)&&(e=i.aliases[e]),!i.emojis.hasOwnProperty(e))return null;r=i.emojis[e]}else e.id&&(i.aliases.hasOwnProperty(e.id)&&(e.id=i.aliases[e.id]),i.emojis.hasOwnProperty(e.id)&&(r=i.emojis[e.id],t||(t=e.skin)));if(Object.keys(r).length||((r=e).custom=!0,r.search||(r.search=Ec(e))),r.emoticons||(r.emoticons=[]),r.variations||(r.variations=[]),r.skin_variations&&t>1){r=JSON.parse(JSON.stringify(r));var o=Cc[t-1],s=r.skin_variations[o];if(s&&(!s.variations&&r.variations&&delete r.variations,n&&(null==s["has_img_".concat(n)]||s["has_img_".concat(n)])||!n))for(var l in r.skin_tone=t,s){var u=s[l];r[l]=u}}return r.variations&&r.variations.length&&((r=JSON.parse(JSON.stringify(r))).unified=r.variations.shift()),r}function Tc(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function Nc(e,t){var n=Tc(e),i=Tc(t);return n.filter((function(e){return i.indexOf(e)>=0}))}function Ac(e,t){var n={};for(var i in e){var r=e[i],a=r;t.hasOwnProperty(i)&&(a=t[i]),"object"===bc()(a)&&(a=Ac(r,a)),n[i]=a}return n}var Mc,Rc,Ic="emoji-mart",Lc="undefined"!=typeof window&&"localStorage"in window;function Bc(e,t){if(Rc)Rc(e,t);else{if(!Lc)return;try{window.localStorage["".concat(Ic,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var Pc={update:function(e){for(var t in e){Bc(t,e[t])}},set:Bc,get:function(e){if(Mc)return Mc(e);if(Lc)try{var t=window.localStorage["".concat(Ic,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){Ic=e},setHandlers:function(e){e||(e={}),Mc=e.getter,Rc=e.setter}},jc=function(){function e(t,n){hc()(this,e),t.compressed&&vc(t),this.data=t||{},this.set=n||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return mc()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var n=e.data.emojis[t],i=n.short_names,r=n.emoticons,a=n.skin_variations,o=i[0];if(r&&r.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),a){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=Oc({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=Oc(o,null,e.set,e.data);e.originalPool[o]=n};for(var n in this.data.emojis)t(n)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(n){var i=n.id||n.short_names[0];delete e[i],delete t.emojis[i]}))}},{key:"addCustomToPool",value:function(e,t){var n=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var i=e.id||e.short_names[0];i&&!t[i]&&(t[i]=xc(e,null,null,n.data),n.emojis[i]=Oc(e,null,null,n.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.emojisToShowFilter,r=n.maxResults,a=n.include,o=n.exclude,s=n.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=Pc.get("skin")||1;r||(r=75),a||(a=[]),o||(o=[]);var d=null,_=this.originalPool;if(e.length){if("-"==e||"-1"==e)return[this.emojis[-1][u]];var c=e.toLowerCase().split(/[\s|,|\-|_]+/),f=[];if(c.length>2&&(c=[c[0],c[1]]),(a.length||o.length)&&(_={},this.data.categories.forEach((function(e){var n=!a||!a.length||a.indexOf(e.id)>-1,i=!(!o||!o.length)&&o.indexOf(e.id)>-1;n&&!i&&e.emojis.forEach((function(e){return _[e]=t.data.emojis[e]}))})),l.length)){var g=!a||!a.length||a.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;g&&!h&&this.addCustomToPool(l,_)}d=(f=c.map((function(e){for(var n=_,i=t.index,r=0,a=0;a<e.length;a++){var o=e[a];r++,i[o]||(i[o]={}),(i=i[o]).results||function(){var a={};for(var o in i.results=[],i.pool={},n){var s=n[o],l=s.search,d=e.substr(0,r),_=l.indexOf(d);if(-1!=_){var c=_+1;d==o&&(c=0),t.emojis[o]&&t.emojis[o][u]?i.results.push(t.emojis[o][u]):i.results.push(t.emojis[o]),i.pool[o]=s,a[o]=c}}i.results.sort((function(e,t){var n=a[e.id],i=a[t.id];return n==i?e.id.localeCompare(t.id):n-i}))}(),n=i.pool}return i.results})).filter((function(e){return e}))).length>1?Nc.apply(null,f):f.length?f[0]:[]}return d&&(i&&(d=d.filter((function(e){return i(_[e.id])}))),d&&d.length>r&&(d=d.slice(0,r))),d}}]),e}(),qc=new jc(fc);var Uc,zc,Hc={search:function(){return qc.search.apply(qc,arguments)},emojis:qc.emojis,emoticons:qc.emoticons},Wc=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],Gc={};function Yc(){zc=!0,Uc=Pc.get("frequently")}var Vc={add:function(e){zc||Yc();var t=e.id;Uc||(Uc=Gc),Uc[t]||(Uc[t]=0),Uc[t]+=1,Pc.set("last",t),Pc.set("frequently",Uc)},get:function(e){if(zc||Yc(),!Uc){Gc={};for(var t=[],n=0;n<e;n++)Gc[Wc[n]]=e-n,t.push(Wc[n]);return t}var i=4*e,r=[];for(var a in Uc)Uc.hasOwnProperty(a)&&r.push(a);var o=r.sort((function(e,t){return Uc[e]-Uc[t]})).reverse().slice(0,i),s=Pc.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},$c=n(16),Kc=n.n($c),Qc=n(25),Zc=n.n(Qc),Xc=n(12),Jc=n.n(Xc),ef=n(13),tf=n.n(ef),nf=n(14),rf=n.n(nf),af=n(8),of=n.n(af),sf={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"}))}},lf={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"}))}},uf={data:Yd.a.object.isRequired,onOver:Yd.a.func,onLeave:Yd.a.func,onClick:Yd.a.func,fallback:Yd.a.func,backgroundImageFn:Yd.a.func,native:Yd.a.bool,forceSize:Yd.a.bool,tooltip:Yd.a.bool,useButton:Yd.a.bool,skin:Yd.a.oneOf([1,2,3,4,5,6]),sheetSize:Yd.a.oneOf([16,20,32,64]),sheetColumns:Yd.a.number,sheetRows:Yd.a.number,set:Yd.a.oneOf(["apple","google","twitter","facebook"]),size:Yd.a.number.isRequired,emoji:Yd.a.oneOfType([Yd.a.string,Yd.a.object]).isRequired},df={onClick:Yd.a.func,onSelect:Yd.a.func,onSkinChange:Yd.a.func,perLine:Yd.a.number,emojiSize:Yd.a.number,i18n:Yd.a.object,style:Yd.a.object,title:Yd.a.string,emoji:Yd.a.string,color:Yd.a.string,set:uf.set,skin:uf.skin,native:Yd.a.bool,backgroundImageFn:uf.backgroundImageFn,sheetSize:uf.sheetSize,emojisToShowFilter:Yd.a.func,showPreview:Yd.a.bool,showSkinTones:Yd.a.bool,emojiTooltip:uf.tooltip,useButton:uf.useButton,theme:Yd.a.oneOf(["auto","light","dark"]),include:Yd.a.arrayOf(Yd.a.string),exclude:Yd.a.arrayOf(Yd.a.string),recent:Yd.a.arrayOf(Yd.a.string),autoFocus:Yd.a.bool,enableFrequentEmojiSort:Yd.a.bool,custom:Yd.a.arrayOf(Yd.a.shape({name:Yd.a.string.isRequired,short_names:Yd.a.arrayOf(Yd.a.string).isRequired,emoticons:Yd.a.arrayOf(Yd.a.string),keywords:Yd.a.arrayOf(Yd.a.string),imageUrl:Yd.a.string,spriteUrl:Yd.a.string,sheet_x:Yd.a.number,sheet_y:Yd.a.number,size:Yd.a.number,sheetColumns:Yd.a.number,sheetRows:Yd.a.number})),skinEmoji:Yd.a.string,notFound:Yd.a.func,notFoundEmoji:Yd.a.string,icons:Yd.a.object},_f=function(e){function t(e){var n;hc()(this,t),n=Jc()(this,tf()(t).call(this,e));var i=e.categories.filter((function(e){return e.first}))[0];return n.state={selected:i.name},n.handleClick=n.handleClick.bind(of()(n)),n}return rf()(t,e),mc()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),n=this.props,i=n.categories;(0,n.onAnchorClick)(i[t],t)}},{key:"render",value:function(){var e=this,t=this.props,n=t.categories,i=t.color,r=t.i18n,a=t.icons,o=this.state.selected;return m.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":r.categorieslabel},n.map((function(t,n){var s=t.id,l=t.name,u=t.anchor,d=l==o;if(!1===u)return null;var _=s.startsWith("custom-")?"custom":s;return m.a.createElement("button",{key:s,"aria-label":r.categories[_],title:r.categories[_],"data-index":n,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(d?"emoji-mart-anchor-selected":""),style:{color:d?i:null}},m.a.createElement("div",{className:"emoji-mart-anchor-icon"},a.categories[_]()),m.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:i}}))})))}}]),t}(m.a.PureComponent);_f.propTypes={categories:Yd.a.array,onAnchorClick:Yd.a.func,icons:Yd.a.object},_f.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var cf={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")}},ff={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:cf.set,theme:"light",skin:null,defaultSkin:cf.skin,native:cf.native,sheetSize:cf.sheetSize,backgroundImageFn:cf.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:cf.tooltip,useButton:cf.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function gf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function hf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pf=function(e){return xc(e.emoji,e.skin,e.set,e.data)},mf=function(e){var t=pf(e),n=t.sheet_x,i=t.sheet_y,r=100/(e.sheetColumns-1),a=100/(e.sheetRows-1);return"".concat(r*n,"% ").concat(a*i,"%")},Ff=function(e){return Oc(e.emoji,e.skin,e.set,e.data)},bf=function(e){return!isNaN(e-parseFloat(e))},yf=function e(t){for(var n in t.data.compressed&&vc(t.data),e.defaultProps)null==t[n]&&null!=e.defaultProps[n]&&(t[n]=e.defaultProps[n]);var i=pf(t);if(!i)return t.fallback?t.fallback(null,t):null;var r=i.unified,a=i.custom,o=i.short_names,s=i.imageUrl,l={},u=t.children,d="emoji-mart-emoji",_=r&&wc(r),c=[_].concat(o).filter(Boolean).join(", "),f=null;if(!r&&!a)return t.fallback?t.fallback(i,t):null;if(t.tooltip&&(f=o[0]),t.native&&r)d+=" emoji-mart-emoji-native",l={fontSize:t.size},u=_,t.forceSize&&(l.display="inline-block",l.width=t.size,l.height=t.size,l.wordBreak="keep-all");else if(a)d+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=i.spriteUrl?hf({},l,{backgroundImage:"url(".concat(i.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:mf(t)}):hf({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==i["has_img_".concat(t.set)]||i["has_img_".concat(t.set)]))return t.fallback?t.fallback(i,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:mf(t)}}var g={name:"span",props:{}};return t.onClick&&t.useButton&&(g.name="button",g.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var n in e){var i=e[n];bf(i)&&(i+="px"),t.style[n]=i}return t.getAttribute("style")}(l),"<".concat(g.name," style='").concat(l,"' aria-label='").concat(c,"' ").concat(f?"title='".concat(f,"'"):""," class='").concat(d,"'>").concat(u||"","</").concat(g.name,">")):m.a.createElement(g.name,Zc()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(Ff(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(Ff(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(Ff(t),e)}(e,t)},"aria-label":c,title:f,className:d},g.props),m.a.createElement("span",{style:l},u))};yf.propTypes=hf({},uf,{data:Yd.a.object.isRequired}),yf.defaultProps=cf;var Ef=yf;function vf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var kf=function(e){function t(){return hc()(this,t),Jc()(this,tf()(t).apply(this,arguments))}return rf()(t,e),mc()(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.emojiProps,i=e.i18n,r=e.notFound,a=e.notFoundEmoji;return r&&r()||m.a.createElement("div",{className:"emoji-mart-no-results"},Ef(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({data:t},n,{size:38,emoji:a,onOver:null,onLeave:null,onClick:null})),m.a.createElement("div",{className:"emoji-mart-no-results-label"},i.notfound))}}]),t}(m.a.PureComponent);function Df(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}kf.propTypes={notFound:Yd.a.func.isRequired,emojiProps:Yd.a.object.isRequired};var Cf=function(e){function t(e){var n;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).data=e.data,n.setContainerRef=n.setContainerRef.bind(of()(n)),n.setLabelRef=n.setLabelRef.bind(of()(n)),n}return rf()(t,e),mc()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var n=this.props,i=n.name,r=n.perLine,a=n.native,o=n.hasStickyPosition,s=n.emojis,l=n.emojiProps,u=l.skin,d=l.size,_=l.set,c=e.perLine,f=e.native,g=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,y=!1;return"Recent"==i&&r!=c&&(y=!0),"Search"==i&&(y=!(s==h)),u==m&&d==F&&a==f&&_==b&&o==g||(y=!0),y}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),n=t.top,i=t.height,r=e.getBoundingClientRect().top,a=this.label.getBoundingClientRect().height;this.top=n-r+e.scrollTop,this.maxMargin=0==i?0:i-a}},{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,n=t.name,i=t.emojis,r=t.recent,a=t.perLine;if("Recent"==n){var o=this.props.custom,s=r||Vc.get(a);if(s.length&&(i=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!xc(t,null,null,e.data)}))),0===i.length&&s.length>0)return null}return i&&(i=i.slice(0)),i}},{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,n=t.id,i=t.name,r=t.hasStickyPosition,a=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,u=this.getEmojis(),d={},_={},c={};u||(c={display:"none"}),r||(d={height:28},_={position:"absolute"});var f=o.categories[n]||i;return m.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":f,style:c},m.a.createElement("div",{style:d,"data-name":i,className:"emoji-mart-category-label"},m.a.createElement("span",{style:_,ref:this.setLabelRef,"aria-hidden":!0},f)),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},Ef(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Df(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Df(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({emoji:t,data:e.data},a)))}))),u&&!u.length&&m.a.createElement(kf,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:a}))}}]),t}(m.a.Component);Cf.propTypes={emojis:Yd.a.array,hasStickyPosition:Yd.a.bool,name:Yd.a.string.isRequired,native:Yd.a.bool.isRequired,perLine:Yd.a.number.isRequired,emojiProps:Yd.a.object.isRequired,recent:Yd.a.arrayOf(Yd.a.string),notFound:Yd.a.func,notFoundEmoji:Yd.a.string.isRequired},Cf.defaultProps={emojis:[],hasStickyPosition:!0};var wf=function(e){function t(e){var n;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).state={opened:!1},n}return rf()(t,e),mc()(t,[{key:"handleClick",value:function(e){var t=parseInt(e.currentTarget.getAttribute("data-skin")),n=this.props.onChange;this.state.opened?(this.setState({opened:!1}),t!=this.props.skin&&n(t)):this.setState({opened:!0})}},{key:"render",value:function(){return null}}]),t}(m.a.PureComponent);wf.propTypes={onChange:Yd.a.func,skin:Yd.a.number.isRequired},wf.defaultProps={onChange:function(){}};var Sf=function(e){function t(e){var n;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).handleClick=n.handleClick.bind(of()(n)),n}return rf()(t,e),mc()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,n=e.emojiProps,i=e.data,r=e.skinEmoji,a=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)},Ef({emoji:r,data:i,skin:l,backgroundImageFn:n.backgroundImageFn,native:n.native,set:n.set,sheetSize:n.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":"")},a.skintext),s)}}]),t}(wf);Sf.propTypes={onChange:Yd.a.func,skin:Yd.a.number.isRequired,emojiProps:Yd.a.object.isRequired,skinTone:Yd.a.number,skinEmoji:Yd.a.string.isRequired,i18n:Yd.a.object},Sf.defaultProps={onChange:function(){},skinTone:null};var Of=function(e){function t(e){var n;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).handleClick=n.handleClick.bind(of()(n)),n.handleKeyDown=n.handleKeyDown.bind(of()(n)),n}return rf()(t,e),mc()(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,n=e.i18n,i=this.state.opened,r=[],a=1;a<=6;a++){var o=a===t,s=i||o;r.push(m.a.createElement("span",Zc()({key:"skin-tone-".concat(a),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":n.skintones[a],"aria-hidden":!s},i?{role:"menuitem"}:{}),m.a.createElement("span",Zc()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!i}:{},i?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":n.skintones[a],title:n.skintones[a],"data-skin":a,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(a)}))))}return m.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(i?" opened":""),"aria-label":n.skintext},m.a.createElement("div",i?{role:"menubar"}:{},r))}}]),t}(wf);function xf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Tf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Of.propTypes={onChange:Yd.a.func,skin:Yd.a.number.isRequired,i18n:Yd.a.object},Of.defaultProps={onChange:function(){}};var Nf=function(e){function t(e){var n;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).data=e.data,n.state={emoji:null},n}return rf()(t,e),mc()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,n=t.emojiProps,i=t.skinsProps,r=t.showSkinTones,a=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var u=xc(e,null,null,this.data),d=u.emoticons,_=[],c=[];return(void 0===d?[]:d).forEach((function(e){_.indexOf(e.toLowerCase())>=0||(_.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"},Ef(Tf({key:e.id,emoji:e,data:this.data},n))),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&&Ef(Tf({emoji:o,data:this.data},n))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("span",{className:"emoji-mart-title-label"},a)),r&&m.a.createElement("div",{className:"emoji-mart-preview-skins".concat(i.skinEmoji?" custom":"")},i.skinEmoji?m.a.createElement(Sf,{skin:i.skin,emojiProps:n,data:this.data,skinEmoji:i.skinEmoji,i18n:s,onChange:i.onChange}):m.a.createElement(Of,{skin:i.skin,i18n:s,onChange:i.onChange})))}}]),t}(m.a.PureComponent);Nf.propTypes={showSkinTones:Yd.a.bool,title:Yd.a.string.isRequired,emoji:Yd.a.string.isRequired,emojiProps:Yd.a.object.isRequired,skinsProps:Yd.a.object.isRequired},Nf.defaultProps={showSkinTones:!0,onChange:function(){}};var Af=0,Mf=function(e){function t(e){var n,i,r,a;return hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).state={icon:lf.search,isSearching:!1,id:++Af},n.data=e.data,n.emojiIndex=new jc(n.data),n.setRef=n.setRef.bind(of()(n)),n.clear=n.clear.bind(of()(n)),n.handleKeyUp=n.handleKeyUp.bind(of()(n)),n.handleChange=(i=n.handleChange.bind(of()(n)),r="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,a=!1,function(){a||(a=!0,r((function(){a=!1,i()})))}),n}return rf()(t,e),mc()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:lf.search,isSearching:!1}):this.setState({icon:lf.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,n=e.autoFocus,i=this.state,r=i.icon,a=i.isSearching,o=i.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:n}),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:!a},r()))}}]),t}(m.a.PureComponent);function Rf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function If(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Mf.propTypes={onSearch:Yd.a.func,maxResults:Yd.a.number,emojisToShowFilter:Yd.a.func,autoFocus:Yd.a.bool},Mf.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var Lf={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"}},Bf=function(e){function t(e){var n;hc()(this,t),(n=Jc()(this,tf()(t).call(this,e))).CUSTOM=[],n.RECENT_CATEGORY={id:"recent",name:"Recent",emojis:null},n.SEARCH_CATEGORY={id:"search",name:"Search",emojis:null,anchor:!1},e.data.compressed&&vc(e.data),n.data=e.data,n.i18n=Ac(Lf,e.i18n),n.icons=Ac(i,e.icons),n.state={firstRender:!0},n.categories=[];var r=[].concat(n.data.categories);if(e.custom.length>0){var a={},o=0;e.custom.forEach((function(e){a[e.customCategory]||(a[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=a[e.customCategory],i=If({},e,{id:e.short_names[0],custom:!0});t.emojis.push(i),n.CUSTOM.push(i)})),r=r.concat(Object.keys(a).map((function(e){return a[e]})))}n.hideRecent=!0,null!=e.include&&r.sort((function(t,n){return e.include.indexOf(t.id)>e.include.indexOf(n.id)?1:-1}));for(var s=0;s<r.length;s++){var l=r[s],u=!e.include||!e.include.length||e.include.indexOf(l.id)>-1,d=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(l.id)>-1;if(u&&!d)if(e.emojisToShowFilter){for(var _=[],c=l.emojis,f=0;f<c.length;f++){var g=c[f];e.emojisToShowFilter(n.data.emojis[g]||g)&&_.push(g)}if(_.length){var h={emojis:_,name:l.name,id:l.id};n.categories.push(h)}}else n.categories.push(l)}var p=!e.include||!e.include.length||e.include.indexOf(n.RECENT_CATEGORY.id)>-1,m=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(n.RECENT_CATEGORY.id)>-1;return p&&!m&&(n.hideRecent=!1,n.categories.unshift(n.RECENT_CATEGORY)),n.categories[0]&&(n.categories[0].first=!0),n.categories.unshift(n.SEARCH_CATEGORY),n.setAnchorsRef=n.setAnchorsRef.bind(of()(n)),n.handleAnchorClick=n.handleAnchorClick.bind(of()(n)),n.setSearchRef=n.setSearchRef.bind(of()(n)),n.handleSearch=n.handleSearch.bind(of()(n)),n.setScrollRef=n.setScrollRef.bind(of()(n)),n.handleScroll=n.handleScroll.bind(of()(n)),n.handleScrollPaint=n.handleScrollPaint.bind(of()(n)),n.handleEmojiOver=n.handleEmojiOver.bind(of()(n)),n.handleEmojiLeave=n.handleEmojiLeave.bind(of()(n)),n.handleEmojiClick=n.handleEmojiClick.bind(of()(n)),n.handleEmojiSelect=n.handleEmojiSelect.bind(of()(n)),n.setPreviewRef=n.setPreviewRef.bind(of()(n)),n.handleSkinChange=n.handleSkinChange.bind(of()(n)),n.handleKeyDown=n.handleKeyDown.bind(of()(n)),n.handleDarkMatchMediaChange=n.handleDarkMatchMediaChange.bind(of()(n)),n}return rf()(t,e),mc()(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?ff.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?ff.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 n=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i]);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||Vc.add(e);var n=this.categoryRefs["category-1"];if(n){var i=n.maxMargin;this.props.enableFrequentEmojiSort&&n.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(n.memoizeSize(),i!=n.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&n.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,n=t>(this.scrollTop||0),i=0,r=0,a=this.categories.length;r<a;r++){var o=n?this.categories.length-1-r:r,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!i||l.top<i)&&l.top>0&&(i=l.top),u&&!e&&(e=s)}}t<i?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 d=this.anchors,_=e.name;d.state.selected!=_&&d.setState({selected:_})}this.scrollTop=t}}},{key:"handleSearch",value:function(e){this.SEARCH_CATEGORY.emojis=e;for(var t=0,n=this.categories.length;t<n;t++){var i=this.categoryRefs["category-".concat(t)];if(i&&"Search"!=i.props.name){var r=e?"none":"inherit";i.updateDisplay(r)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var n,i=this.categoryRefs["category-".concat(t)],r=this.scroll;this.anchors;n=function(){if(i){var t=i.top;e.first?t=0:t+=1,r.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(n)):n()}},{key:"handleSkinChange",value:function(e){var t={skin:e},n=this.props.onSkinChange;this.setState(t),Pc.update(t),n(e)}},{key:"handleKeyDown",value:function(e){var t=!1;switch(e.keyCode){case 13:var n;this.SEARCH_CATEGORY.emojis&&this.SEARCH_CATEGORY.emojis.length&&(n=Oc(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(n),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var n=this.categoryRefs["category-".concat(e)];n&&n.memoizeSize()}if(this.scroll){var i=this.scroll;this.scrollHeight=i.scrollHeight,this.clientHeight=i.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,n=t.perLine,i=t.emojiSize,r=t.set,a=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,u=t.title,d=t.emoji,_=t.color,c=t.native,f=t.backgroundImageFn,g=t.emojisToShowFilter,h=t.showPreview,p=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,y=t.include,E=t.exclude,v=t.recent,k=t.autoFocus,D=t.skinEmoji,C=t.notFound,w=t.notFoundEmoji,S=n*(i+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}(),O=this.getPreferredTheme(),x=this.props.skin||this.state.skin||Pc.get("skin")||this.props.defaultSkin;return m.a.createElement("section",{style:If({width:S},l),className:"emoji-mart emoji-mart-".concat(O),"aria-label":u,onKeyDown:this.handleKeyDown},m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(_f,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:_,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),m.a.createElement(Mf,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:g,include:y,exclude:E,custom:this.CUSTOM,autoFocus:k}),m.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return m.a.createElement(Cf,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:n,native:c,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?v:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:c,skin:x,size:i,set:r,sheetSize:a,sheetColumns:o,sheetRows:s,forceSize:c,tooltip:F,backgroundImageFn:f,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:C,notFoundEmoji:w})}))),(h||p)&&m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(Nf,{ref:this.setPreviewRef,data:this.data,title:u,emoji:d,showSkinTones:p,showPreview:h,emojiProps:{native:c,size:38,skin:x,set:r,sheetSize:a,sheetColumns:o,sheetRows:s,backgroundImageFn:f},skinsProps:{skin:x,onChange:this.handleSkinChange,skinEmoji:D},i18n:this.i18n})))}}]),t}(m.a.PureComponent);function Pf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}Bf.propTypes=If({},df,{data:Yd.a.object.isRequired}),Bf.defaultProps=If({},ff);var jf=function(e){function t(){return hc()(this,t),Jc()(this,tf()(t).apply(this,arguments))}return rf()(t,e),mc()(t,[{key:"render",value:function(){return m.a.createElement(Bf,Zc()({},this.props,this.state))}}]),t}(m.a.PureComponent);function qf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Uf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}jf.propTypes=df,jf.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pf(Object(n),!0).forEach((function(t){Kc()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},ff,{data:fc});var zf=function e(t){for(var n in e.defaultProps)null==t[n]&&null!=e.defaultProps[n]&&(t[n]=e.defaultProps[n]);return Ef(Uf({},t))};zf.propTypes=uf,zf.defaultProps=Uf({},cf,{data:fc});var Hf=n(51),Wf={insert:"head",singleton:!1},Gf=(a()(Hf.a,Wf),Hf.a.locals,n(90));function Yf(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 n,i=cc()(e);if(t){var r=cc()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return dc()(this,n)}}var Vf=function(e){lc()(n,e);var t=Yf(n);function n(){var e;nc()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),_()(oc()(e),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),_()(oc()(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return rc()(n,[{key:"render",value:function(){return m.a.createElement(Bf,{style:{maxWidth:"100%"},data:Gf,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect})}}]),n}(m.a.Component);Vf.defaultProps={editor:{},range:{}},Vf.propTypes={editor:Yd.a.object.isRequired,range:Yd.a.object};var $f=Vf,Kf=function(e){var t=e.editor,n=Object(p.useRef)();return m.a.createElement(I_,{ref:n,closeOnSelect:!1,customTarget:function(){var e;return m.a.createElement("button",{className:"neeto-editor-fixed-menu__item"},m.a.createElement(ju.Smiley,{size:20,color:null!=n&&null!==(e=n.current)&&void 0!==e&&e.visible?"#2F3941":"#87929D"}))},position:"bottom-start"},m.a.createElement($f,{editor:t}))},Qf=["Icon","command","active","optionName","disabled"],Zf=function(e){var t=e.editor,n=e.variables,i=e.setImageUploadVisible,r=e.options,a=e.mentions,o=e.showImageInMention;if(!t)return null;var s=[{Icon:ju.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:ju.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:ju.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:ju.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:ju.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}].filter((function(e){return r.includes(e.optionName)})),l=[{Icon:ju.Quote,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:ju.Code,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"code-block"},{Icon:ju.Image,command:function(){return i(!0)},optionName:"image-upload"}].filter((function(e){return r.includes(e.optionName)})),d=[{Icon:ju.ListDot,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:ju.ListNumber,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}].filter((function(e){return r.includes(e.optionName)})),_=r.includes("font-color"),c=r.includes("font-size"),f=r.includes("emoji"),g=r.includes("link"),p=function(e){var t=e.Icon,n=e.command,i=e.active,r=e.optionName,a=e.disabled,o=h()(e,Qf);return m.a.createElement("button",{disabled:a,onClick:n,key:r,className:"neeto-editor-fixed-menu__item",type:"button"},m.a.createElement(t,u()({color:i?"#2F3941":"#87929D",size:20},o)))};return m.a.createElement("div",{className:"neeto-editor-fixed-menu"},c&&m.a.createElement(L_,{editor:t}),s.map(p),_&&m.a.createElement(Zd,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),f&&m.a.createElement(Kf,{editor:t}),g&&m.a.createElement(ec,{editor:t}),l.map(p),d.map(p),m.a.createElement("div",{className:"neeto-editor-fixed-menu-addons"},m.a.createElement(U_,{editor:t,variables:n}),m.a.createElement(V_,{editor:t,mentions:a,showImageInMention:o})))},Xf=n(19),Jf=n.n(Xf),eg=n(91),tg=n.n(eg),ng=function(e){var t=e.children,n=e.className,i=void 0===n?"root-portal":n,r=e.el,a=void 0===r?"div":r,o=document.getElementsByClassName(i)[0];return o||(o=document.createElement(a)).classList.add(i),m.a.useEffect((function(){document.body.appendChild(o)}),[]),Cu.a.createPortal(t,o)},ig=["children","className"],rg=function(e){var t=e.children,n=e.className,i=h()(e,ig);return m.a.createElement("div",u()({className:b()("ne-backdrop",_()({},n,n))},i),t)},ag=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"],og=function(){},sg="xs",lg="sm",ug="md",dg=function(e){var t=e.size,n=void 0===t?"sm":t,i=e.isOpen,r=void 0!==i&&i,a=e.onClose,o=void 0===a?og:a,s=e.loading,l=void 0!==s&&s,d=e.children,c=e.className,f=void 0===c?"":c,g=e.closeOnEsc,F=void 0===g||g,y=e.closeButton,E=void 0===y||y,v=e.backdropClassName,k=void 0===v?"":v,D=e.closeOnOutsideClick,C=void 0===D||D,w=h()(e,ag),S=Object(p.useRef)();return C&&T_(S,o),F&&O_("esc",o),m.a.createElement(ng,{className:"ne-portal"},r&&m.a.createElement(rg,{key:"modal-backdrop",className:b()("ne-modal__backdrop",k)},m.a.createElement("div",u()({ref:S,key:"modal-wrapper",className:b()("ne-modal__wrapper",_()({"ne-modal__wrapper--xs":n===sg,"ne-modal__wrapper--sm":n===lg,"ne-modal__wrapper--md":n===ug},f,f))},w),E&&m.a.createElement(Pd,{style:"text",icon:ju.Close,className:"ne-modal__close",onClick:o}),l?m.a.createElement(m.a.Fragment,null):d)))},_g=["children","size","noUnderline","className"],cg=["active","className","children","icon","onClick","activeClassName"],fg=function(){},gg="large",hg=function(e){var t=e.children,n=e.size,i=e.noUnderline,r=e.className,a=void 0===r?"":r,o=h()(e,_g);return m.a.createElement("div",u()({className:b()({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":n===gg},{"ne-tab__wrapper--underline-none":i},[a]),"data-cy":"tab-container"},o),t)};hg.Item=function(e){var t=e.active,n=e.className,i=void 0===n?"":n,r=e.children,a=e.icon,o=void 0===a?null:a,s=e.onClick,l=void 0===s?fg:s,d=e.activeClassName,_=void 0===d?"":d,c=h()(e,cg),f="button",g="string"==typeof o?function(){return m.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||m.a.Fragment;return _&&(f=cd),m.a.createElement(f,u()({className:b()(["ne-tab flex items-center justify-center select-none",i],{active:t}),onClick:l,"data-cy":"tab-item"},c),o&&m.a.createElement(g,{className:"ne-tab__icon"}),r)};var pg=hg,mg=function(e){var t,n=Object(p.useState)(null===(t=e[0])||void 0===t?void 0:t.key),i=f()(n,2),r=i[0],a=i[1];return[r,function(e){return a(e.key)}]},Fg=function(e){var t=e.buttonLabel,n=void 0===t?"Submit":t,i=e.placeholder,r=e.onSubmit,a=e.className,o=Object(p.useState)(""),s=f()(o,2),l=s[0],u=s[1],d=Object(p.useState)(""),c=f()(d,2),g=c[0],h=c[1];return m.a.createElement("div",{className:b()("neeto-editor-url-form__wrapper",_()({},a,a))},m.a.createElement(J_,{name:"url",value:l,placeholder:i,onFocus:function(){return h("")},error:g,onChange:function(e){var t=e.target.value;return u(t)}}),m.a.createElement(Pd,{size:"large",label:n,onClick:function(e){e.preventDefault(),jd.test(l)?r(l):h("Please enter a valid url")}}))},bg=(n(63),n(75),n(76)),yg=n.n(bg),Eg=(n(77),n(78),n(79),n(80),function(e){var t=e.uppy;return m.a.createElement(yg.a,{note:"Max. File Size: 5MB",uppy:t,locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},className:"neeto-editor-image-uploader__dnd"})}),vg=function(e){var t=e.uppy,n=Object(p.useState)(0),i=f()(n,2),r=i[0],a=i[1];Object(p.useEffect)((function(){t.on("progress",a)}),[t]);var o="".concat(r,"%");return m.a.createElement("div",{className:"neeto-editor-progress-bar__wrapper"},m.a.createElement("div",{className:"neeto-editor-progress-bar__percent"},m.a.createElement("p",null,o),m.a.createElement("button",{type:"button",onClick:t.cancelAll},m.a.createElement(ju.Close,{size:16}))),m.a.createElement("div",{className:"neeto-editor-progress-bar__indicator"},m.a.createElement("div",{style:{width:o},className:"neeto-editor-progress-bar__indicator-inner"})))},kg=n(36),Dg=n.n(kg),Cg=n(92),wg=n.n(Cg),Sg=n(52),Og=n.n(Sg),xg=n(93),Tg=n.n(xg),Ng=n(94),Ag=n.n(Ng),Mg=function(e){var t=e.pageNo,n=e.query,i=e.apiKey;return Ag.a.get("https://api.unsplash.com/search/photos",{headers:{Authorization:"Client-ID ".concat(i)},params:{page:t,per_page:30,order_by:"popular",query:n}})},Rg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,n=Object(p.useState)(e),i=f()(n,2),r=i[0],a=i[1];return Object(p.useEffect)((function(){var n=setTimeout((function(){a(e)}),t);return function(){clearTimeout(n)}}),[e]),r},Ig=function(){return m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__loader"},m.a.createElement("span",{className:"neeto-editor-unsplash-gallery__spinner-icon"}))},Lg=function(e){var t=e.onSubmit,n=e.unsplashApiKey,i=Object(p.useRef)(null),r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1],l=Object(p.useState)(!1),u=f()(l,2),d=u[0],_=u[1],c=Object(p.useState)([]),g=f()(c,2),h=g[0],F=g[1],b=Object(p.useState)(1),y=f()(b,2),E=y[0],v=y[1],k=Object(p.useState)(!0),D=f()(k,2),C=D[0],w=D[1],S=Object(p.useState)(!1),O=f()(S,2),x=O[0],T=O[1],N=Rg(o||"latest");Object(p.useEffect)((function(){A(1)}),[N]);var A=function(){var e=wg()(Og.a.mark((function e(t){var i,r,a,o;return Og.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,T(!0),_(!1),e.next=5,Mg({page:t,query:N,apiKey:n});case 5:i=e.sent,r=i.data,a=r.results,o=r.total_pages,F(1===t?a:[].concat(Dg()(h),Dg()(a))),v(t+1),w(t<o),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),_(!0);case 15:return e.prev=15,T(!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(J_,{name:"text",value:o,placeholder:"Search Unsplash",onChange:function(e){var t=e.target.value;s(t)}}),d&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"Something went wrong! Please try again later."),!d&&!x&&Hu()(h)&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"No results"),!d&&m.a.createElement("div",{className:"neeto-editor-unsplash-container"},m.a.createElement(Tg.a,{ref:i,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:C,loadMore:function(){!x&&C&&E>1&&A(E)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:m.a.createElement(Ig,{key:0})},h&&h.map((function(e,n){return m.a.createElement("div",{key:n,className:"neeto-editor-unsplash-gallery__item"},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(n)},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," "))))}))),!C&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},Bg=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}],Pg=function(e){var t,n=e.editor,i=e.imageUploadUrl,r=e.isVisible,a=e.setIsVisible,o=e.unsplashApiKey,s=e.isUnsplashImageUploadActive,l=Object(p.useState)(!1),u=f()(l,2),d=u[0],_=u[1],c=mg(Bg),g=f()(c,2),h=g[0],F=g[1],b=Object(p.useMemo)((function(){return new Jf.a({allowMultipleUploads:!1,autoProceed:!0,debug:!0}).use(tg.a,{endpoint:i||"/api/v1/direct_uploads",formData:!0,fieldName:"blob"}).on("upload",(function(){return _(!0)})).on("upload-success",(function(e,t){var i=t.body.imageURL;n.chain().focus().setImage({src:i}).run(),a(!1)})).on("cancel-all",(function(){return _(!1)})).on("complete",(function(){return _(!1)}))}),[n]),y=function(e){n.chain().focus().setImage({src:e}).run(),a(!1)},E={local:function(){return m.a.createElement(Eg,{uppy:b})},link:function(){return m.a.createElement(Fg,{onSubmit:y,buttonLabel:"Upload Image",placeholder:"Paste the image link"})},unsplash:function(){return m.a.createElement(Lg,{unsplashApiKey:o,onSubmit:y})}}[h];return m.a.createElement(dg,{isOpen:r,onClose:function(){return a(!1)},closeButton:!1},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement(pg,null,Bg.filter((function(e){return"unsplash"!==e.key||s})).map((function(e){return m.a.createElement(pg.Item,{key:e.key,active:h===e.key,onClick:function(){return F(e)}},e.title)}))),m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},d?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=b.getFiles()[0])||void 0===t?void 0:t.name),m.a.createElement(vg,{uppy:b})):m.a.createElement(E,null))))},jg=n(40),qg=n.n(jg),Ug=n(95);function zg(e,t){return Array(t+1).join(e)}var Hg=["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 Wg(e){return $g(e,Hg)}var Gg=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Yg(e){return $g(e,Gg)}var Vg=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function $g(e,t){return t.indexOf(e.nodeName)>=0}function Kg(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var Qg={};function Zg(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function Xg(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 Jg(e,t,n){for(var i=0;i<e.length;i++){var r=e[i];if(eh(r,t,n))return r}}function eh(e,t,n){var i=e.filter;if("string"==typeof i){if(i===t.nodeName.toLowerCase())return!0}else if(Array.isArray(i)){if(i.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof i)throw new TypeError("`filter` needs to be a string, array, or function");if(i.call(e,t,n))return!0}}function th(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function nh(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}Qg.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},Qg.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},Qg.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var i=Number(t.nodeName.charAt(1));return"setext"===n.headingStyle&&i<3?"\n\n"+e+"\n"+zg(1===i?"=":"-",e.length)+"\n\n":"\n\n"+zg("#",i)+" "+e+"\n\n"}},Qg.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},Qg.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},Qg.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var i=n.bulletListMarker+" ",r=t.parentNode;if("OL"===r.nodeName){var a=r.getAttribute("start"),o=Array.prototype.indexOf.call(r.children,t);i=(a?Number(a)+o:o+1)+". "}return i+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},Qg.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},Qg.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){for(var i,r=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],a=t.firstChild.textContent,o=n.fence.charAt(0),s=3,l=new RegExp("^"+o+"{3,}","gm");i=l.exec(a);)i[0].length>=s&&(s=i[0].length+1);var u=zg(o,s);return"\n\n"+u+r+"\n"+a.replace(/\n$/,"")+"\n"+u+"\n\n"}},Qg.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},Qg.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href"),i=Zg(t.getAttribute("title"));return i&&(i=' "'+i+'"'),"["+e+"]("+n+i+")"}},Qg.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var i,r,a=t.getAttribute("href"),o=Zg(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),n.linkReferenceStyle){case"collapsed":i="["+e+"][]",r="["+e+"]: "+a+o;break;case"shortcut":i="["+e+"]",r="["+e+"]: "+a+o;break;default:var s=this.references.length+1;i="["+e+"]["+s+"]",r="["+s+"]: "+a+o}return this.references.push(r),i},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},Qg.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},Qg.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},Qg.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",i=e.match(/`+/gm)||[];-1!==i.indexOf(n);)n+="`";return n+t+e+t+n}},Qg.image={filter:"img",replacement:function(e,t){var n=Zg(t.getAttribute("alt")),i=t.getAttribute("src")||"",r=Zg(t.getAttribute("title"));return i?"+")":""}},Xg.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=Jg(this.array,e,this.options))||(t=Jg(this._keep,e,this.options))||(t=Jg(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 ih="undefined"!=typeof window?window:{};var rh,ah,oh=function(){var e=ih.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?ih.DOMParser:(rh=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?rh.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:rh.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},rh);function sh(e,t){var n;"string"==typeof e?n=(ah=ah||new oh).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):n=e.cloneNode(!0);return function(e){var t=e.element,n=e.isBlock,i=e.isVoid,r=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!r(t)){for(var a=null,o=!1,s=null,l=nh(s,t,r);l!==t;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \r\n\t]+/g," ");if(a&&!/ $/.test(a.data)||o||" "!==u[0]||(u=u.substr(1)),!u){l=th(l);continue}l.data=u,a=l}else{if(1!==l.nodeType){l=th(l);continue}n(l)||"BR"===l.nodeName?(a&&(a.data=a.data.replace(/ $/,"")),a=null,o=!1):i(l)||r(l)?(a=null,o=!0):a&&(o=!1)}var d=nh(s,l,r);s=l,l=d}a&&(a.data=a.data.replace(/ $/,""),a.data||th(a))}}({element:n,isBlock:Wg,isVoid:Yg,isPre:t.preformattedCode?lh:null}),n}function lh(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function uh(e,t){return e.isBlock=Wg(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!Yg(e)&&!function(e){return $g(e,Vg)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return Kg(e,Gg)}(e)&&!function(e){return Kg(e,Vg)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=(i=e.textContent,r=i.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/),{leading:r[1],leadingAscii:r[2],leadingNonAscii:r[3],trailing:r[4],trailingNonAscii:r[5],trailingAscii:r[6]});var i,r;n.leadingAscii&&dh("left",e,t)&&(n.leading=n.leadingNonAscii);n.trailingAscii&&dh("right",e,t)&&(n.trailing=n.trailingNonAscii);return{leading:n.leading,trailing:n.trailing}}(e,t),e}function dh(e,t,n){var i,r,a;return"left"===e?(i=t.previousSibling,r=/ $/):(i=t.nextSibling,r=/^ /),i&&(3===i.nodeType?a=r.test(i.nodeValue):n.preformattedCode&&"CODE"===i.nodeName?a=!1:1!==i.nodeType||Wg(i)||(a=r.test(i.textContent))),a}var _h=Array.prototype.reduce,ch=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function fh(e){if(!(this instanceof fh))return new fh(e);var t={rules:Qg,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 n=arguments[t];for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])}return e}({},t,e),this.rules=new Xg(this.options)}function gh(e){var t=this;return _h.call(e.childNodes,(function(e,n){var i="";return 3===(n=new uh(n,t.options)).nodeType?i=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(i=ph.call(t,n)),mh(e,i)}),"")}function hh(e){var t=this;return this.rules.forEach((function(n){"function"==typeof n.append&&(e=mh(e,n.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function ph(e){var t=this.rules.forNode(e),n=gh.call(this,e),i=e.flankingWhitespace;return(i.leading||i.trailing)&&(n=n.trim()),i.leading+t.replacement(n,e,this.options)+i.trailing}function mh(e,t){var n=function(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),i=t.replace(/^\n*/,""),r=Math.max(e.length-n.length,t.length-i.length);return n+"\n\n".substring(0,r)+i}fh.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=gh.call(this,new sh(e,this.options));return hh.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 ch.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};var Fh=fh,bh=function(e){e=e.replaceAll(/^\\$/gm,"<p></p>");var t=Ug.marked.parse(e);return t=(t=(t=t.replace(/<p><img[^>]*><\/p>/g,(function(e){return e.replace(/<\/?p>/g,"")}))).replaceAll(/==([^=]+)==/g,"<mark>$1</mark>")).replaceAll(/--([^-]+)--/g,"<u>$1</u>"),qg.a.sanitize(t)},yh=["editor","className","style","strategy","onChange","onSubmit","initialValue"],Eh=function(e){var t=e.editor,n=e.className,i=e.style,r=e.strategy,a=e.onChange,o=e.onSubmit,s=e.initialValue,l=h()(e,yh),d=Object(p.useState)((function(){return e=(null==t?void 0:t.getHTML())||s,(n=new Fh({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){return t.isBlock?"\\\n":""}})).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~".concat(e,"~")}}),n.addRule("highlight",{filter:["mark"],replacement:function(e){return"==".concat(e,"==")}}),n.addRule("underline",{filter:["u"],replacement:function(e){return"--".concat(e,"--")}}),n.turndown(e);var e,n})),c=f()(d,2),g=c[0],F=c[1],y=Object(p.useRef)(),E=Object(p.useRef)(g);Object(p.useEffect)((function(){E.current=g}),[g]),Object(p.useEffect)((function(){return document.addEventListener("keydown",v),function(){null==t||t.commands.setContent(bh(E.current)),document.removeEventListener("keydown",v)}}),[]),Object(p.useLayoutEffect)((function(){y.current.style=i,"flexible"===r&&(y.current.style.height=y.current.scrollHeight+2+"px")}),[g]);var v=function(e){"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null==o||o(bh(E.current)),y.current.blur())};return m.a.createElement("textarea",u()({ref:y,value:g,onChange:function(e){F(e.target.value),null==a||a(e.target.value)},className:b()("ProseMirror neeto-editor-markdown",_()({},n,n))},l))};const vh=/^\s*>\s$/,kh=cs.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",rs(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:vh,type:this.type})]}}),Dh=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Ch=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,wh=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Sh=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Oh=fs.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",rs(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:Dh,type:this.type}),ps({find:wh,type:this.type})]},addPasteRules(){return[ys({find:Ch,type:this.type}),ys({find:Sh,type:this.type})]}}),xh=/^\s*([-+*])\s$/,Th=cs.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",rs(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:xh,type:this.type})]}}),Nh=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Ah=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Mh=fs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",rs(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:Nh,type:this.type})]},addPasteRules(){return[ys({find:Ah,type:this.type})]}}),Rh=/^```(?<language>[a-z]*)?[\s\n]$/,Ih=/^~~~(?<language>[a-z]*)?[\s\n]$/,Lh=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:n}=this.options,i=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return i||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,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[ms({find:Rh,type:this.type,getAttributes:({groups:e})=>e}),ms({find:Ih,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Mt({key:new Lt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),i=t.clipboardData.getData("vscode-editor-data"),r=i?JSON.parse(i):void 0,a=null==r?void 0:r.mode;if(!n||!a)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:a})),o.setSelection(mt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(n.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}});var Bh=cs.create({name:"doc",topNode:!0,content:"block+"});var Ph=function(e,t){var n=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 i=function(e){return n[t](e)};return e.dom.addEventListener(t,i),{name:t,handler:i}}))};Ph.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,i=t.handler;return e.editorView.dom.removeEventListener(n,i)}))},Ph.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())},Ph.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},Ph.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,i=t.nodeAfter;if(n||i){var r=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),a=n?r.bottom:r.top;n&&i&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:r.left,right:r.right,top:a-this.width/2,bottom:a+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 d=u.getBoundingClientRect();s=d.left-u.scrollLeft,l=d.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"},Ph.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},Ph.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var n=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=Je(this.editorView.state.doc,n,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}},Ph.prototype.dragend=function(){this.scheduleRemoval(20)},Ph.prototype.drop=function(){this.scheduleRemoval(20)},Ph.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const jh=ma.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Mt({view:function(t){return new Ph(t,e)}}))];var e}});var qh=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(n,i){var r=n.resolve(i.map(this.head));return t.valid(r)?new t(r):e.near(r)},t.prototype.content=function(){return x.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,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new Uh(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t);if(0!=n)for(var i=e.node(t).child(n-1);;i=i.lastChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),i=e.node(t);if(n!=i.childCount)for(var r=i.child(n);;r=r.firstChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock},t.findFrom=function(e,n,i){e:for(;;){if(!i&&t.valid(e))return e;for(var r=e.pos,a=null,o=e.depth;;o--){var s=e.node(o);if(n>0?e.indexAfter(o)<s.childCount:e.index(o)>0){a=s.child(n>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;r+=n;var l=e.doc.resolve(r);if(t.valid(l))return l}for(;;){var u=n>0?a.firstChild:a.lastChild;if(!u){if(a.isAtom&&!a.isText&&!bt.isSelectable(a)){e=e.doc.resolve(r+a.nodeSize*n),i=!1;continue e}break}a=u,r+=n;var d=e.doc.resolve(r);if(t.valid(d))return d}return null}},t}(gt);qh.prototype.visible=!1,gt.jsonID("gapcursor",qh);var Uh=function(e){this.pos=e};Uh.prototype.map=function(e){return new Uh(e.map(this.pos))},Uh.prototype.resolve=function(e){var t=e.resolve(this.pos);return qh.valid(t)?new qh(t):gt.near(t)};var zh=_a({ArrowLeft:Hh("horiz",-1),ArrowRight:Hh("horiz",1),ArrowUp:Hh("vert",-1),ArrowDown:Hh("vert",1)});function Hh(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,i,r){var a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof mt){if(!r.endOfTextblock(n)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=qh.findFrom(o,t,s);return!!l&&(i&&i(e.tr.setSelection(new qh(l))),!0)}}function Wh(e,t,n){if(!e.editable)return!1;var i=e.state.doc.resolve(t);if(!qh.valid(i))return!1;var r=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(r>-1&&bt.isSelectable(e.state.doc.nodeAt(r)))&&(e.dispatch(e.state.tr.setSelection(new qh(i))),!0)}function Gh(e){if(!(e.selection instanceof qh))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Rr.create(e.doc,[Tr.widget(e.selection.head,t,{key:"gapcursor"})])}const Yh=ma.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Mt({props:{decorations:Gh,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&qh.valid(n))return new qh(n)},handleClick:Wh,handleKeyDown:zh}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=ha(pa(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),Vh=cs.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",rs(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:i})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:r}=i.extensionManager,a=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&a&&e){const e=a.filter(e=>r.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),$h=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]),rs(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 Kh=function(){};Kh.prototype.append=function(e){return e.length?(e=Kh.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},Kh.prototype.prepend=function(e){return e.length?Kh.from(e).append(this):this},Kh.prototype.appendInner=function(e){return new Zh(this,e)},Kh.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Kh.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Kh.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Kh.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Kh.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var i=[];return this.forEach((function(t,n){return i.push(e(t,n))}),t,n),i},Kh.from=function(e){return e instanceof Kh?e:e&&e.length?new Qh(e):Kh.empty};var Qh=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 n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,i){for(var r=t;r<n;r++)if(!1===e(this.values[r],i+r))return!1},t.prototype.forEachInvertedInner=function(e,t,n,i){for(var r=t-1;r>=n;r--)if(!1===e(this.values[r],i+r))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))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Kh);Kh.empty=new Qh([]);var Zh=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.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,n,i){var r=this.left.length;return!(t<r&&!1===this.left.forEachInner(e,t,Math.min(n,r),i))&&(!(n>r&&!1===this.right.forEachInner(e,Math.max(t-r,0),Math.min(this.length,n)-r,i+r))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,i){var r=this.left.length;return!(t>r&&!1===this.right.forEachInvertedInner(e,t-r,Math.max(n,r)-r,i+r))&&(!(n<r&&!1===this.left.forEachInvertedInner(e,Math.min(t,r),n,i))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,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}(Kh),Xh=Kh,Jh=function(e,t){this.items=e,this.eventCount=t};Jh.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var i,r,a=this.items.length;;a--){if(this.items.get(a-1).selection){--a;break}}t&&(i=this.remapping(a,this.items.length),r=i.maps.length);var o,s,l=e.tr,u=[],d=[];return this.items.forEach((function(e,t){if(!e.step)return i||(i=n.remapping(a,t+1),r=i.maps.length),r--,void d.push(e);if(i){d.push(new ep(e.map));var _,c=e.step.map(i.slice(r));c&&l.maybeStep(c).doc&&(_=l.mapping.maps[l.mapping.maps.length-1],u.push(new ep(_,null,null,u.length+d.length))),r--,_&&i.appendMap(_,r)}else l.maybeStep(e.step);return e.selection?(o=i?e.selection.map(i.slice(r)):e.selection,s=new Jh(n.items.slice(0,a).append(d.reverse().concat(u)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}},Jh.prototype.addTransform=function(e,t,n,i){for(var r=[],a=this.eventCount,o=this.items,s=!i&&o.length?o.get(o.length-1):null,l=0;l<e.steps.length;l++){var u,d=e.steps[l].invert(e.docs[l]),_=new ep(e.mapping.maps[l],d,t);(u=s&&s.merge(_))&&(_=u,l?r.pop():o=o.slice(0,o.length-1)),r.push(_),t&&(a++,t=null),i||(s=_)}var c,f,g,h=a-n.depth;return h>np&&(f=h,(c=o).forEach((function(e,t){if(e.selection&&0==f--)return g=t,!1})),o=c.slice(g),a-=h),new Jh(o.append(r),a)},Jh.prototype.remapping=function(e,t){var n=new Ie;return this.items.forEach((function(t,i){var r=null!=t.mirrorOffset&&i-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,r)}),e,t),n},Jh.prototype.addMaps=function(e){return 0==this.eventCount?this:new Jh(this.items.append(e.map((function(e){return new ep(e)}))),this.eventCount)},Jh.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],i=Math.max(0,this.items.length-t),r=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),i);var s=t;this.items.forEach((function(t){var i=r.getMirror(--s);if(null!=i){a=Math.min(a,i);var l=r.maps[i];if(t.step){var u=e.steps[i].invert(e.docs[i]),d=t.selection&&t.selection.map(r.slice(s+1,i));d&&o++,n.push(new ep(l,u,d))}else n.push(new ep(l))}}),i);for(var l=[],u=t;u<a;u++)l.push(new ep(r.maps[u]));var d=this.items.slice(0,i).append(l).append(n),_=new Jh(d,o);return _.emptyItemCount()>500&&(_=_.compress(this.items.length-n.length)),_},Jh.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},Jh.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,i=[],r=0;return this.items.forEach((function(a,o){if(o>=e)i.push(a),a.selection&&r++;else if(a.step){var s=a.step.map(t.slice(n)),l=s&&s.getMap();if(n--,l&&t.appendMap(l,n),s){var u=a.selection&&a.selection.map(t.slice(n));u&&r++;var d,_=new ep(l.invert(),s,u),c=i.length-1;(d=i.length&&i[c].merge(_))?i[c]=d:i.push(_)}}else a.map&&n--}),this.items.length,0),new Jh(Xh.from(i.reverse()),r)},Jh.empty=new Jh(Xh.empty,0);var ep=function(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i};ep.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new ep(t.getMap().invert(),t,this.selection)}};var tp=function(e,t,n,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i},np=20;function ip(e){var t=[];return e.forEach((function(e,n,i,r){return t.push(i,r)})),t}function rp(e,t){if(!e)return null;for(var n=[],i=0;i<e.length;i+=2){var r=t.map(e[i],1),a=t.map(e[i+1],-1);r<=a&&n.push(r,a)}return n}function ap(e,t,n,i){var r=lp(t),a=up.get(t).spec.config,o=(i?e.undone:e.done).popEvent(t,r);if(o){var s=o.selection.resolve(o.transform.doc),l=(i?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),a,r),u=new tp(i?l:o.remaining,i?o.remaining:l,null,0);n(o.transform.setSelection(s).setMeta(up,{redo:i,historyState:u}).scrollIntoView())}}var op=!1,sp=null;function lp(e){var t=e.plugins;if(sp!=t){op=!1,sp=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){op=!0;break}}return op}var up=new Lt("history"),dp=new Lt("closeHistory");function _p(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Mt({key:up,state:{init:function(){return new tp(Jh.empty,Jh.empty,null,0)},apply:function(t,n,i){return function(e,t,n,i){var r,a=n.getMeta(up);if(a)return a.historyState;n.getMeta(dp)&&(e=new tp(e.done,e.undone,null,0));var o=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(o&&o.getMeta(up))return o.getMeta(up).redo?new tp(e.done.addTransform(n,null,i,lp(t)),e.undone,ip(n.mapping.maps[n.steps.length-1]),e.prevTime):new tp(e.done,e.undone.addTransform(n,null,i,lp(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new tp(e.done.rebased(n,r),e.undone.rebased(n,r),rp(e.prevRanges,n.mapping),e.prevTime):new tp(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),rp(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(n.time||0)-i.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,i){for(var r=0;r<t.length;r+=2)e<=t[r+1]&&i>=t[r]&&(n=!0)})),n}(n,e.prevRanges)),l=o?rp(e.prevRanges,n.mapping):ip(n.mapping.maps[n.steps.length-1]);return new tp(e.done.addTransform(n,s?t.selection.getBookmark():null,i,lp(t)),Jh.empty,l,n.time)}(n,i,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n="historyUndo"==t.inputType?cp(e.state,e.dispatch):"historyRedo"==t.inputType&&fp(e.state,e.dispatch);return n&&t.preventDefault(),n}}}})}function cp(e,t){var n=up.getState(e);return!(!n||0==n.done.eventCount)&&(t&&ap(n,e,t,!1),!0)}function fp(e,t){var n=up.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&ap(n,e,t,!0),!0)}const gp=ma.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>cp(e,t),redo:()=>({state:e,dispatch:t})=>fp(e,t)}),addProseMirrorPlugins(){return[_p(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()}}}),hp=cs.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",rs(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:i,$anchor:r}=n,a=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;if(!i||!a||!t)return!0;const o=r.before(),s=r.start();return e.deleteRange(o,s),e.setSelection(mt.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var n;if(t){const{parent:t,pos:i}=e.selection.$from,r=i+1;if(!e.doc.nodeAt(r)){const i=null===(n=t.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(e.insert(r,i),e.setSelection(mt.create(e.doc,r)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[gs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),pp=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,mp=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Fp=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,bp=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,yp=fs.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",rs(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:pp,type:this.type}),ps({find:Fp,type:this.type})]},addPasteRules(){return[ys({find:mp,type:this.type}),ys({find:bp,type:this.type})]}}),Ep=cs.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",rs(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")}}}),vp=/^(\d+)\.\s$/,kp=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,...n}=e;return 1===t?["ol",rs(this.options.HTMLAttributes,n),0]:["ol",rs(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:vp,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),Dp=cs.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",rs(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Cp=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,wp=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Sp=fs.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",rs(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:Cp,type:this.type})]},addPasteRules(){return[ys({find:wp,type:this.type})]}});var Op=cs.create({name:"text",group:"inline"});const xp=ma.create({name:"starterKit",addExtensions(){var e,t,n,i,r,a,o,s,l,u,d,_,c,f,g,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(kh.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(Oh.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(Th.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&F.push(Mh.configure(null===(i=this.options)||void 0===i?void 0:i.code)),!1!==this.options.codeBlock&&F.push(Lh.configure(null===(r=this.options)||void 0===r?void 0:r.codeBlock)),!1!==this.options.document&&F.push(Bh.configure(null===(a=this.options)||void 0===a?void 0:a.document)),!1!==this.options.dropcursor&&F.push(jh.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(Yh.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(Vh.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push($h.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push(gp.configure(null===(d=this.options)||void 0===d?void 0:d.history)),!1!==this.options.horizontalRule&&F.push(hp.configure(null===(_=this.options)||void 0===_?void 0:_.horizontalRule)),!1!==this.options.italic&&F.push(yp.configure(null===(c=this.options)||void 0===c?void 0:c.italic)),!1!==this.options.listItem&&F.push(Ep.configure(null===(f=this.options)||void 0===f?void 0:f.listItem)),!1!==this.options.orderedList&&F.push(kp.configure(null===(g=this.options)||void 0===g?void 0:g.orderedList)),!1!==this.options.paragraph&&F.push(Dp.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(Sp.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(Op.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),Tp=Fs({find:/--$/,replace:"—"}),Np=Fs({find:/\.\.\.$/,replace:"…"}),Ap=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),Mp=Fs({find:/"$/,replace:"”"}),Rp=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),Ip=Fs({find:/'$/,replace:"’"}),Lp=Fs({find:/<-$/,replace:"←"}),Bp=Fs({find:/->$/,replace:"→"}),Pp=Fs({find:/\(c\)$/,replace:"©"}),jp=Fs({find:/\(tm\)$/,replace:"™"}),qp=Fs({find:/\(r\)$/,replace:"®"}),Up=Fs({find:/1\/2$/,replace:"½"}),zp=Fs({find:/\+\/-$/,replace:"±"}),Hp=Fs({find:/!=$/,replace:"≠"}),Wp=Fs({find:/<<$/,replace:"«"}),Gp=Fs({find:/>>$/,replace:"»"}),Yp=Fs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),Vp=Fs({find:/\^2$/,replace:"²"}),$p=Fs({find:/\^3$/,replace:"³"}),Kp=Fs({find:/1\/4$/,replace:"¼"}),Qp=Fs({find:/3\/4$/,replace:"¾"}),Zp=ma.create({name:"typography",addInputRules:()=>[Tp,Np,Ap,Mp,Rp,Ip,Lp,Bp,Pp,jp,qp,Up,zp,Hp,Wp,Gp,Yp,Vp,$p,Kp,Qp]}),Xp=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,Jp=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,em=fs.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",rs(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:Xp,type:this.type})]},addPasteRules(){return[ys({find:Jp,type:this.type})]}});var tm=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},nm={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};tm.prototype.nodesBetween=function(e,t,n,i,r){void 0===i&&(i=0);for(var a=0,o=0;o<t;a++){var s=this.content[a],l=o+s.nodeSize;if(l>e&&!1!==n(s,i+o,r,a)&&s.content.size){var u=o+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),n,i+u)}o=l}},tm.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},tm.prototype.textBetween=function(e,t,n,i){var r="",a=!0;return this.nodesBetween(e,t,(function(o,s){o.isText?(r+=o.text.slice(Math.max(e,s)-s,t-s),a=!n):o.isLeaf&&i?(r+="function"==typeof i?i(o):i,a=!n):!a&&o.isBlock&&(r+=n,a=!0)}),0),r},tm.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,i=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),r=1);r<e.content.length;r++)i.push(e.content[r]);return new tm(i,this.size+e.size)},tm.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var n=[],i=0;if(t>e)for(var r=0,a=0;a<t;r++){var o=this.content[r],s=a+o.nodeSize;s>e&&((a<e||s>t)&&(o=o.isText?o.cut(Math.max(0,e-a),Math.min(o.text.length,t-a)):o.cut(Math.max(0,e-a-1),Math.min(o.content.size,t-a-1))),n.push(o),i+=o.nodeSize),a=s}return new tm(n,i)},tm.prototype.cutByIndex=function(e,t){return e==t?tm.empty:0==e&&t==this.content.length?this:new tm(this.content.slice(e,t))},tm.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var i=this.content.slice(),r=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new tm(i,r)},tm.prototype.addToStart=function(e){return new tm([e].concat(this.content),this.size+e.nodeSize)},tm.prototype.addToEnd=function(e){return new tm(this.content.concat(e),this.size+e.nodeSize)},tm.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},nm.firstChild.get=function(){return this.content.length?this.content[0]:null},nm.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},nm.childCount.get=function(){return this.content.length},tm.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},tm.prototype.maybeChild=function(e){return this.content[e]},tm.prototype.forEach=function(e){for(var t=0,n=0;t<this.content.length;t++){var i=this.content[t];e(i,n,t),n+=i.nodeSize}},tm.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,n,i){for(var r=0;;r++){if(r==t.childCount||r==n.childCount)return t.childCount==n.childCount?null:i;var a=t.child(r),o=n.child(r);if(a!=o){if(!a.sameMarkup(o))return i;if(a.isText&&a.text!=o.text){for(var s=0;a.text[s]==o.text[s];s++)i++;return i}if(a.content.size||o.content.size){var l=e(a.content,o.content,i+1);if(null!=l)return l}i+=a.nodeSize}else i+=a.nodeSize}}(this,e,t)},tm.prototype.findDiffEnd=function(e,t,n){return void 0===t&&(t=this.size),void 0===n&&(n=e.size),function e(t,n,i,r){for(var a=t.childCount,o=n.childCount;;){if(0==a||0==o)return a==o?null:{a:i,b:r};var s=t.child(--a),l=n.child(--o),u=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:i,b:r};if(s.isText&&s.text!=l.text){for(var d=0,_=Math.min(s.text.length,l.text.length);d<_&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,i--,r--;return{a:i,b:r}}if(s.content.size||l.content.size){var c=e(s.content,l.content,i-1,r-1);if(c)return c}i-=u,r-=u}else i-=u,r-=u}}(this,e,t,n)},tm.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return rm(0,e);if(e==this.size)return rm(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,i=0;;n++){var r=i+this.child(n).nodeSize;if(r>=e)return r==e||t>0?rm(n+1,r):rm(n,i);i=r}},tm.prototype.toString=function(){return"<"+this.toStringInner()+">"},tm.prototype.toStringInner=function(){return this.content.join(", ")},tm.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},tm.fromJSON=function(e,t){if(!t)return tm.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new tm(t.map(e.nodeFromJSON))},tm.fromArray=function(e){if(!e.length)return tm.empty;for(var t,n=0,i=0;i<e.length;i++){var r=e[i];n+=r.nodeSize,i&&r.isText&&e[i-1].sameMarkup(r)?(t||(t=e.slice(0,i)),t[t.length-1]=r.withText(t[t.length-1].text+r.text)):t&&t.push(r)}return new tm(t||e,n)},tm.from=function(e){if(!e)return tm.empty;if(e instanceof tm)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new tm([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(tm.prototype,nm);var im={index:0,offset:0};function rm(e,t){return im.index=e,im.offset=t,im}function am(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!am(e[i],t[i]))return!1}else{for(var r in e)if(!(r in t)||!am(e[r],t[r]))return!1;for(var a in t)if(!(a in e))return!1}return!0}tm.empty=new tm([],0);var om=function(e,t){this.type=e,this.attrs=t};function sm(e){var t=Error.call(this,e);return t.__proto__=sm.prototype,t}om.prototype.addToSet=function(e){for(var t,n=!1,i=0;i<e.length;i++){var r=e[i];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,i));else{if(r.type.excludes(this.type))return e;!n&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(r)}}return t||(t=e.slice()),n||t.push(this),t},om.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},om.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},om.prototype.eq=function(e){return this==e||this.type==e.type&&am(this.attrs,e.attrs)},om.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},om.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type "+t.type+" in this schema");return n.create(t.attrs)},om.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0},om.setFrom=function(e){if(!e||0==e.length)return om.none;if(e instanceof om)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},om.none=[],sm.prototype=Object.create(Error.prototype),sm.prototype.constructor=sm,sm.prototype.name="ReplaceError";var lm=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},um={size:{configurable:!0}};function dm(e,t,n){if(n.openStart>e.depth)throw new sm("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new sm("Inconsistent open depths");return function e(t,n,i,r){var a=t.index(r),o=t.node(r);if(a==n.index(r)&&r<t.depth-i.openStart){var s=e(t,n,i,r+1);return o.copy(o.content.replaceChild(a,s))}if(i.content.size){if(i.openStart||i.openEnd||t.depth!=r||n.depth!=r){var l=function(e,t){for(var n=t.depth-e.openStart,i=t.node(n).copy(e.content),r=n-1;r>=0;r--)i=t.node(r).copy(tm.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(i,t),u=l.start,d=l.end;return hm(o,function e(t,n,i,r,a){var o=t.depth>a&&cm(t,n,a+1),s=r.depth>a&&cm(i,r,a+1),l=[];gm(null,t,a,l),o&&s&&n.index(a)==i.index(a)?(_m(o,s),fm(hm(o,e(t,n,i,r,a+1)),l)):(o&&fm(hm(o,pm(t,n,a+1)),l),gm(n,i,a,l),s&&fm(hm(s,pm(i,r,a+1)),l));return gm(r,null,a,l),new tm(l)}(t,u,d,n,r))}var _=t.parent,c=_.content;return hm(_,c.cut(0,t.parentOffset).append(i.content).append(c.cut(n.parentOffset)))}return hm(o,pm(t,n,r))}(e,t,n,0)}function _m(e,t){if(!t.type.compatibleContent(e.type))throw new sm("Cannot join "+t.type.name+" onto "+e.type.name)}function cm(e,t,n){var i=e.node(n);return _m(i,t.node(n)),i}function fm(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function gm(e,t,n,i){var r=(t||e).node(n),a=0,o=t?t.index(n):r.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(fm(e.nodeAfter,i),a++));for(var s=a;s<o;s++)fm(r.child(s),i);t&&t.depth==n&&t.textOffset&&fm(t.nodeBefore,i)}function hm(e,t){if(!e.type.validContent(t))throw new sm("Invalid content for node "+e.type.name);return e.copy(t)}function pm(e,t,n){var i=[];(gm(null,e,n,i),e.depth>n)&&fm(hm(cm(e,t,n+1),pm(e,t,n+1)),i);return gm(t,null,n,i),new tm(i)}um.size.get=function(){return this.content.size-this.openStart-this.openEnd},lm.prototype.insertAt=function(e,t){var n=function e(t,n,i,r){var a=t.findIndex(n),o=a.index,s=a.offset,l=t.maybeChild(o);if(s==n||l.isText)return r&&!r.canReplace(o,o,i)?null:t.cut(0,n).append(i).append(t.cut(n));var u=e(l.content,n-s-1,i);return u&&t.replaceChild(o,l.copy(u))}(this.content,e+this.openStart,t,null);return n&&new lm(n,this.openStart,this.openEnd)},lm.prototype.removeBetween=function(e,t){return new lm(function e(t,n,i){var r=t.findIndex(n),a=r.index,o=r.offset,s=t.maybeChild(a),l=t.findIndex(i),u=l.index,d=l.offset;if(o==n||s.isText){if(d!=i&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(i))}if(a!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(a,s.copy(e(s.content,n-o-1,i-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},lm.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},lm.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},lm.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},lm.fromJSON=function(e,t){if(!t)return lm.empty;var n=t.openStart||0,i=t.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new lm(tm.fromJSON(e,t.content),n,i)},lm.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,i=0,r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(var a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new lm(e,n,i)},Object.defineProperties(lm.prototype,um),lm.empty=new lm(tm.empty,0,0);var mm=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},Fm={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};mm.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},Fm.parent.get=function(){return this.node(this.depth)},Fm.doc.get=function(){return this.node(0)},mm.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},mm.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},mm.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},mm.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},mm.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},mm.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]},mm.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},Fm.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Fm.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i},Fm.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)},mm.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],i=0==t?0:this.path[3*t-1]+1,r=0;r<e;r++)i+=n.child(r).nodeSize;return i},mm.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return om.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){var r=n;n=i,i=r}for(var a=n.marks,o=0;o<a.length;o++)!1!==a[o].type.spec.inclusive||i&&a[o].isInSet(i.marks)||(a=a[o--].removeFromSet(a));return a},mm.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,i=e.parent.maybeChild(e.index()),r=0;r<n.length;r++)!1!==n[r].type.spec.inclusive||i&&n[r].isInSet(i.marks)||(n=n[r--].removeFromSet(n));return n},mm.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},mm.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new vm(this,e,n)},mm.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},mm.prototype.max=function(e){return e.pos>this.pos?e:this},mm.prototype.min=function(e){return e.pos<this.pos?e:this},mm.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},mm.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],i=0,r=t,a=e;;){var o=a.content.findIndex(r),s=o.index,l=o.offset,u=r-l;if(n.push(a,s,i+l),!u)break;if((a=a.child(s)).isText)break;r=u-1,i+=l+1}return new mm(t,n,r)},mm.resolveCached=function(e,t){for(var n=0;n<bm.length;n++){var i=bm[n];if(i.pos==t&&i.doc==e)return i}var r=bm[ym]=mm.resolve(e,t);return ym=(ym+1)%Em,r},Object.defineProperties(mm.prototype,Fm);var bm=[],ym=0,Em=12,vm=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},km={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};km.start.get=function(){return this.$from.before(this.depth+1)},km.end.get=function(){return this.$to.after(this.depth+1)},km.parent.get=function(){return this.$from.node(this.depth)},km.startIndex.get=function(){return this.$from.index(this.depth)},km.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(vm.prototype,km);var Dm=Object.create(null),Cm=function(e,t,n,i){this.type=e,this.attrs=t,this.content=n||tm.empty,this.marks=i||om.none},wm={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}};wm.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},wm.childCount.get=function(){return this.content.childCount},Cm.prototype.child=function(e){return this.content.child(e)},Cm.prototype.maybeChild=function(e){return this.content.maybeChild(e)},Cm.prototype.forEach=function(e){this.content.forEach(e)},Cm.prototype.nodesBetween=function(e,t,n,i){void 0===i&&(i=0),this.content.nodesBetween(e,t,n,i,this)},Cm.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},wm.textContent.get=function(){return this.textBetween(0,this.content.size,"")},Cm.prototype.textBetween=function(e,t,n,i){return this.content.textBetween(e,t,n,i)},wm.firstChild.get=function(){return this.content.firstChild},wm.lastChild.get=function(){return this.content.lastChild},Cm.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},Cm.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},Cm.prototype.hasMarkup=function(e,t,n){return this.type==e&&am(this.attrs,t||e.defaultAttrs||Dm)&&om.sameSet(this.marks,n||om.none)},Cm.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},Cm.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},Cm.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},Cm.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return lm.empty;var i=this.resolve(e),r=this.resolve(t),a=n?0:i.sharedDepth(t),o=i.start(a),s=i.node(a).content.cut(i.pos-o,r.pos-o);return new lm(s,i.depth-a,r.depth-a)},Cm.prototype.replace=function(e,t,n){return dm(this.resolve(e),this.resolve(t),n)},Cm.prototype.nodeAt=function(e){for(var t=this;;){var n=t.content.findIndex(e),i=n.index,r=n.offset;if(!(t=t.maybeChild(i)))return null;if(r==e||t.isText)return t;e-=r+1}},Cm.prototype.childAfter=function(e){var t=this.content.findIndex(e),n=t.index,i=t.offset;return{node:this.content.maybeChild(n),index:n,offset:i}},Cm.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,i=t.offset;if(i<e)return{node:this.content.child(n),index:n,offset:i};var r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}},Cm.prototype.resolve=function(e){return mm.resolveCached(this,e)},Cm.prototype.resolveNoCache=function(e){return mm.resolve(this,e)},Cm.prototype.rangeHasMark=function(e,t,n){var i=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(i=!0),!i})),i},wm.isBlock.get=function(){return this.type.isBlock},wm.isTextblock.get=function(){return this.type.isTextblock},wm.inlineContent.get=function(){return this.type.inlineContent},wm.isInline.get=function(){return this.type.isInline},wm.isText.get=function(){return this.type.isText},wm.isLeaf.get=function(){return this.type.isLeaf},wm.isAtom.get=function(){return this.type.isAtom},Cm.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 n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}(this.marks,e)},Cm.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},Cm.prototype.canReplace=function(e,t,n,i,r){void 0===n&&(n=tm.empty),void 0===i&&(i=0),void 0===r&&(r=n.childCount);var a=this.contentMatchAt(e).matchFragment(n,i,r),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(var s=i;s<r;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0},Cm.prototype.canReplaceWith=function(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;var r=this.contentMatchAt(e).matchType(n),a=r&&r.matchFragment(this.content,t);return!!a&&a.validEnd},Cm.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},Cm.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=om.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!om.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()}))},Cm.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},Cm.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=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,n)}var i=tm.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)},Object.defineProperties(Cm.prototype,wm);var Sm=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},Om={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};Sm.parse=function(e,t){var n=new xm(e,t);if(null==n.next)return Sm.empty;var i=Nm(n);n.next&&n.err("Unexpected trailing text");var r=function(e){var t=Object.create(null);return function n(i){var r=[];i.forEach((function(t){e[t].forEach((function(t){var n=t.term,i=t.to;if(n){var a=r.indexOf(n),o=a>-1&&r[a+1];Bm(e,i).forEach((function(e){o||r.push(n,o=[]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var a=t[i.join(",")]=new Sm(i.indexOf(e.length-1)>-1),o=0;o<r.length;o+=2){var s=r[o+1].sort(Lm);a.next.push(r[o],t[s.join(",")]||n(s))}return a}(Bm(e,0))}(function(e){var t=[[]];return r(function e(t,a){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(e(n,a))}),[]);if("seq"==t.type)for(var o=0;;o++){var s=e(t.exprs[o],a);if(o==t.exprs.length-1)return s;r(s,a=n())}else{if("star"==t.type){var l=n();return i(a,l),r(e(t.expr,l),l),[i(l)]}if("plus"==t.type){var u=n();return r(e(t.expr,a),u),r(e(t.expr,u),u),[i(u)]}if("opt"==t.type)return[i(a)].concat(e(t.expr,a));if("range"==t.type){for(var d=a,_=0;_<t.min;_++){var c=n();r(e(t.expr,d),c),d=c}if(-1==t.max)r(e(t.expr,d),d);else for(var f=t.min;f<t.max;f++){var g=n();i(d,g),r(e(t.expr,d),g),d=g}return[i(d)]}if("name"==t.type)return[i(a,null,t.value)]}}(e,0),n()),t;function n(){return t.push([])-1}function i(e,n,i){var r={term:i,to:n};return t[e].push(r),r}function r(e,t){e.forEach((function(e){return e.to=t}))}}(i));return function(e,t){for(var n=0,i=[e];n<i.length;n++){for(var r=i[n],a=!r.validEnd,o=[],s=0;s<r.next.length;s+=2){var l=r.next[s],u=r.next[s+1];o.push(l.name),!a||l.isText||l.hasRequiredAttrs()||(a=!1),-1==i.indexOf(u)&&i.push(u)}a&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(r,n),r},Sm.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},Sm.prototype.matchFragment=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.childCount);for(var i=this,r=t;i&&r<n;r++)i=i.matchType(e.child(r).type);return i},Om.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},Om.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}},Sm.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[t]==e.next[n])return!0;return!1},Sm.prototype.fillBefore=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=0);var i=[this];return function r(a,o){var s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return tm.from(o.map((function(e){return e.createAndFill()})));for(var l=0;l<a.next.length;l+=2){var u=a.next[l],d=a.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==i.indexOf(d)){i.push(d);var _=r(d,o.concat(u));if(_)return _}}}(this,[])},Sm.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 n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},Sm.prototype.computeWrapping=function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var i=n.shift(),r=i.match;if(r.matchType(e)){for(var a=[],o=i;o.type;o=o.via)a.push(o.type);return a.reverse()}for(var s=0;s<r.next.length;s+=2){var l=r.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||i.type&&!r.next[s+1].validEnd||(n.push({match:l.contentMatch,type:l,via:i}),t[l.name]=!0)}}},Om.edgeCount.get=function(){return this.next.length>>1},Sm.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]}},Sm.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var i=1;i<n.next.length;i+=2)-1==e.indexOf(n.next[i])&&t(n.next[i])}(this),e.map((function(t,n){for(var i=n+(t.validEnd?"*":" ")+" ",r=0;r<t.next.length;r+=2)i+=(r?", ":"")+t.next[r].name+"->"+e.indexOf(t.next[r+1]);return i})).join("\n")},Object.defineProperties(Sm.prototype,Om),Sm.empty=new Sm(!0);var xm=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()},Tm={next:{configurable:!0}};function Nm(e){var t=[];do{t.push(Am(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Am(e){var t=[];do{t.push(Mm(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Mm(e){for(var t=function(e){if(e.eat("(")){var t=Nm(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,i=n[t];if(i)return[i];var r=[];for(var a in n){var o=n[a];o.groups.indexOf(t)>-1&&r.push(o)}0==r.length&&e.err("No node type or group '"+t+"' found");return r}(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==n.length?n[0]:{type:"choice",exprs:n}}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=Im(e,t)}return t}function Rm(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Im(e,t){var n=Rm(e),i=n;return e.eat(",")&&(i="}"!=e.next?Rm(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function Lm(e,t){return t-e}function Bm(e,t){var n=[];return function t(i){var r=e[i];if(1==r.length&&!r[0].term)return t(r[0].to);n.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=o.term,l=o.to;s||-1!=n.indexOf(l)||t(l)}}(t),n.sort(Lm)}function Pm(e){var t=Object.create(null);for(var n in e){var i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function jm(e,t){var n=Object.create(null);for(var i in e){var r=t&&t[i];if(void 0===r){var a=e[i];if(!a.hasDefault)throw new RangeError("No value supplied for attribute "+i);r=a.default}n[i]=r}return n}function qm(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new Hm(e[n]);return t}Tm.next.get=function(){return this.tokens[this.pos]},xm.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},xm.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(xm.prototype,Tm);var Um=function(e,t,n){this.name=e,this.schema=t,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=qm(n.attrs),this.defaultAttrs=Pm(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e},zm={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};zm.isInline.get=function(){return!this.isBlock},zm.isTextblock.get=function(){return this.isBlock&&this.inlineContent},zm.isLeaf.get=function(){return this.contentMatch==Sm.empty},zm.isAtom.get=function(){return this.isLeaf||this.spec.atom},Um.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},Um.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},Um.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:jm(this.attrs,e)},Um.prototype.create=function(e,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Cm(this,this.computeAttrs(e),tm.from(t),om.setFrom(n))},Um.prototype.createChecked=function(e,t,n){if(t=tm.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Cm(this,this.computeAttrs(e),t,om.setFrom(n))},Um.prototype.createAndFill=function(e,t,n){if(e=this.computeAttrs(e),(t=tm.from(t)).size){var i=this.contentMatch.fillBefore(t);if(!i)return null;t=i.append(t)}var r=this.contentMatch.matchFragment(t).fillBefore(tm.empty,!0);return r?new Cm(this,e,t.append(r),om.setFrom(n)):null},Um.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},Um.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},Um.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},Um.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:om.empty:e},Um.compile=function(e,t){var n=Object.create(null);e.forEach((function(e,i){return n[e]=new Um(e,t,i)}));var i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var r in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(Um.prototype,zm);var Hm=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},Wm={isRequired:{configurable:!0}};Wm.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(Hm.prototype,Wm);var Gm=function(e,t,n,i){this.name=e,this.schema=n,this.spec=i,this.attrs=qm(i.attrs),this.rank=t,this.excluded=null;var r=Pm(this.attrs);this.instance=r&&new om(this,r)};Gm.prototype.create=function(e){return!e&&this.instance?this.instance:new om(this,jm(this.attrs,e))},Gm.compile=function(e,t){var n=Object.create(null),i=0;return e.forEach((function(e,r){return n[e]=new Gm(e,i++,t,r)})),n},Gm.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},Gm.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},Gm.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var Ym={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},Vm={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},$m={ol:!0,ul:!0};function Km(e){return(e?1:0)|("full"===e?2:0)}var Qm=function(e,t,n,i,r,a,o){this.type=e,this.attrs=t,this.solid=r,this.match=a||(4&o?null:e.contentMatch),this.options=o,this.content=[],this.marks=n,this.activeMarks=om.none,this.pendingMarks=i,this.stashMarks=[]};Qm.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(tm.from(e));if(!t){var n,i=this.type.contentMatch;return(n=i.findWrapping(e.type))?(this.match=i,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},Qm.prototype.finish=function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length)))}var i=tm.from(this.content);return!e&&this.match&&(i=i.append(this.match.fillBefore(tm.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i},Qm.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]},Qm.prototype.applyPending=function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var i=n[t];(this.type?this.type.allowsMarkType(i.type):Jm(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}},Qm.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ym.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var Zm=function(e,t,n){this.parser=e,this.options=t,this.isOpen=n;var i,r=t.topNode,a=Km(t.preserveWhitespace)|(n?4:0);i=r?new Qm(r.type,r.attrs,om.none,om.none,!0,t.topMatch||r.type.contentMatch,a):new Qm(n?null:e.schema.topNodeType,null,om.none,om.none,!0,null,a),this.nodes=[i],this.open=0,this.find=t.findPositions,this.needsBlock=!1},Xm={top:{configurable:!0},currentPos:{configurable:!0}};function Jm(e,t){var n=t.schema.nodes,i=function(i){var r=n[i];if(r.allowsMarkType(e)){var a=[],o=function(e){a.push(e);for(var n=0;n<e.edgeCount;n++){var i=e.edge(n),r=i.type,s=i.next;if(r==t)return!0;if(a.indexOf(s)<0&&o(s))return!0}};return o(r.contentMatch)?{v:!0}:void 0}};for(var r in n){var a=i(r);if(a)return a.v}}Xm.top.get=function(){return this.nodes[this.open]},Zm.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,i=[];for(;t=n.exec(e);)i.push(t[1],t[2].trim());return i}(t)):null,i=this.top;if(null!=n)for(var r=0;r<n.length;r++)this.addPendingMark(n[r]);if(this.addElement(e),null!=n)for(var a=0;a<n.length;a++)this.removePendingMark(n[a],i)}},Zm.prototype.addTextNode=function(e){var t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.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 i=n.content[n.content.length-1],r=e.previousSibling;(!i||r&&"BR"==r.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},Zm.prototype.addElement=function(e,t){var n,i=e.nodeName.toLowerCase();$m.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var i=1==t.nodeType?t.nodeName.toLowerCase():null;i&&$m.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):"li"==i?n=t:i&&(n=null)}}(e);var r=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(r?r.ignore:Vm.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!r||r.skip||r.closeParent){r&&r.closeParent?this.open=Math.max(0,this.open-1):r&&r.skip.nodeType&&(e=r.skip);var a,o=this.top,s=this.needsBlock;if(Ym.hasOwnProperty(i))a=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),a&&this.sync(o),this.needsBlock=s}else this.addElementByRule(e,r,!1===r.consuming?n:null)},Zm.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},Zm.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},Zm.prototype.readStyles=function(e){var t=om.none;e:for(var n=0;n<e.length;n+=2)for(var i=null;;){var r=this.parser.matchStyle(e[n],e[n+1],this,i);if(!r)continue e;if(r.ignore)return null;if(t=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(t),!1!==r.consuming)break;i=r}return t},Zm.prototype.addElementByRule=function(e,t,n){var i,r,a,o=this;t.node?(r=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(r.create(t.attrs))||this.leafFallback(e):i=this.enter(r,t.attrs,t.preserveWhitespace):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));var s=this.top;if(r&&r.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);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,i)}i&&(this.sync(s),this.open--),a&&this.removePendingMark(a,s)},Zm.prototype.addAll=function(e,t,n,i){for(var r=n||0,a=n?e.childNodes[n]:e.firstChild,o=null==i?null:e.childNodes[i];a!=o;a=a.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(a),t&&Ym.hasOwnProperty(a.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,r)},Zm.prototype.findPlace=function(e){for(var t,n,i=this.open;i>=0;i--){var r=this.nodes[i],a=r.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,n=r,!a.length))break;if(r.solid)break}if(!t)return!1;this.sync(n);for(var o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0},Zm.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 n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var i=n.activeMarks,r=0;r<e.marks.length;r++)n.type&&!n.type.allowsMarkType(e.marks[r].type)||(i=e.marks[r].addToSet(i));return n.content.push(e.mark(i)),!0}return!1},Zm.prototype.enter=function(e,t,n){var i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,n),i},Zm.prototype.enterInner=function(e,t,n,i){this.closeExtra();var r=this.top;r.applyPending(e),r.match=r.match&&r.match.matchType(e,t);var a=null==i?-5&r.options:Km(i);4&r.options&&0==r.content.length&&(a|=4),this.nodes.push(new Qm(e,t,r.activeMarks,r.pendingMarks,n,null,a)),this.open++},Zm.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}},Zm.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},Zm.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},Xm.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e},Zm.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)},Zm.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)},Zm.prototype.findAround=function(e,t,n){if(e!=t&&this.find)for(var i=0;i<this.find.length;i++){if(null==this.find[i].pos&&1==e.nodeType&&e.contains(this.find[i].node))t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}},Zm.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))},Zm.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),i=this.options.context,r=!(this.isOpen||i&&i.parent.type!=this.nodes[0].type),a=-(i?i.depth+1:0)+(r?0:1),o=function(e,s){for(;e>=0;e--){var l=n[e];if(""==l){if(e==n.length-1||0==e)continue;for(;s>=a;s--)if(o(e-1,s))return!0;return!1}var u=s>0||0==s&&r?t.nodes[s].type:i&&s>=a?i.node(s-a).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0};return o(n.length-1,this.open)},Zm.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var i in this.parser.schema.nodes){var r=this.parser.schema.nodes[i];if(r.isTextblock&&r.defaultAttrs)return r}},Zm.prototype.addPendingMark=function(e){var t=function(e,t){for(var n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},Zm.prototype.removePendingMark=function(e,t){for(var n=this.open;n>=0;n--){var i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);var r=i.popFromStashMark(e);r&&i.type&&i.type.allowsMarkType(r.type)&&(i.activeMarks=r.addToSet(i.activeMarks))}if(i==t)break}},Object.defineProperties(Zm.prototype,Xm);var eF=Math.pow(2,16);function tF(e){return 65535&e}var nF=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},iF=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};iF.prototype.recover=function(e){var t=0,n=tF(e);if(!this.inverted)for(var i=0;i<n;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/eF}(e)},iF.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},iF.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},iF.prototype._map=function(e,t,n){for(var i=0,r=this.inverted?2:1,a=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+r],u=this.ranges[o+a],d=s+l;if(e<=d){var _=s+i+((l?e==s?-1:e==d?1:t:t)<0?0:u);if(n)return _;var c=e==(t<0?s:d)?null:o/3+(e-s)*eF;return new nF(_,t<0?e!=s:e!=d,c)}i+=u-l}return n?e+i:new nF(e+i)},iF.prototype.touches=function(e,t){for(var n=0,i=tF(t),r=this.inverted?2:1,a=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+r];if(e<=s+l&&o==3*i)return!0;n+=this.ranges[o+a]-l}return!1},iF.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,i=0,r=0;i<this.ranges.length;i+=3){var a=this.ranges[i],o=a-(this.inverted?r:0),s=a+(this.inverted?0:r),l=this.ranges[i+t],u=this.ranges[i+n];e(o,o+l,s,s+u),r+=u-l}},iF.prototype.invert=function(){return new iF(this.ranges,!this.inverted)},iF.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},iF.offset=function(e){return 0==e?iF.empty:new iF(e<0?[0,-e,0]:[0,0,e])},iF.empty=new iF([]);var rF=function(e,t,n,i){this.maps=e||[],this.from=n||0,this.to=null==i?this.maps.length:i,this.mirror=t};function aF(e){var t=Error.call(this,e);return t.__proto__=aF.prototype,t}rF.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new rF(this.maps,this.mirror,e,t)},rF.prototype.copy=function(){return new rF(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},rF.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},rF.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var i=e.getMirror(t);this.appendMap(e.maps[t],null!=i&&i<t?n+i:null)}},rF.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)]},rF.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},rF.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var i=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=i&&i>t?n-i-1:null)}},rF.prototype.invert=function(){var e=new rF;return e.appendMappingInverted(this),e},rF.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},rF.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},rF.prototype._map=function(e,t,n){for(var i=!1,r=this.from;r<this.to;r++){var a=this.maps[r].mapResult(e,t);if(null!=a.recover){var o=this.getMirror(r);if(null!=o&&o>r&&o<this.to){r=o,e=this.maps[o].recover(a.recover);continue}}a.deleted&&(i=!0),e=a.pos}return n?e:new nF(e,i)},aF.prototype=Object.create(Error.prototype),aF.prototype.constructor=aF,aF.prototype.name="TransformError";var oF=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new rF},sF={before:{configurable:!0},docChanged:{configurable:!0}};function lF(){throw new Error("Override me")}sF.before.get=function(){return this.docs.length?this.docs[0]:this.doc},oF.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new aF(t.failed);return this},oF.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},sF.docChanged.get=function(){return this.steps.length>0},oF.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(oF.prototype,sF);var uF=Object.create(null),dF=function(){};dF.prototype.apply=function(e){return lF()},dF.prototype.getMap=function(){return iF.empty},dF.prototype.invert=function(e){return lF()},dF.prototype.map=function(e){return lF()},dF.prototype.merge=function(e){return null},dF.prototype.toJSON=function(){return lF()},dF.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=uF[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},dF.jsonID=function(e,t){if(e in uF)throw new RangeError("Duplicate use of step JSON ID "+e);return uF[e]=t,t.prototype.jsonID=e,t};var _F=function(e,t){this.doc=e,this.failed=t};_F.ok=function(e){return new _F(e,null)},_F.fail=function(e){return new _F(null,e)},_F.fromReplace=function(e,t,n,i){try{return _F.ok(e.replace(t,n,i))}catch(e){if(e instanceof sm)return _F.fail(e.message);throw e}};var cF=function(e){function t(t,n,i,r){e.call(this),this.from=t,this.to=n,this.slice=i,this.structure=!!r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&gF(e,this.from,this.to)?_F.fail("Structure replace would overwrite content"):_F.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new iF([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 n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted?null:new t(n.pos,Math.max(n.pos,i.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 n=this.slice.size+e.slice.size==0?lm.empty:new lm(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var i=this.slice.size+e.slice.size==0?lm.empty:new lm(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),i,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,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,lm.fromJSON(e,n.slice),!!n.structure)},t}(dF);dF.jsonID("replace",cF);var fF=function(e){function t(t,n,i,r,a,o,s){e.call(this),this.from=t,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=a,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&&(gF(e,this.from,this.gapFrom)||gF(e,this.gapTo,this.to)))return _F.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return _F.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?_F.fromReplace(e,this.from,this.to,n):_F.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new iF([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 n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),a=e.map(this.gapTo,1);return n.deleted&&i.deleted||r<n.pos||a>i.pos?null:new t(n.pos,i.pos,r,a,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,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,lm.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(dF);function gF(e,t,n){for(var i=e.resolve(t),r=n-t,a=i.depth;r>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,r--;if(r>0)for(var o=i.node(a).maybeChild(i.indexAfter(a));r>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,r--}return!1}function hF(e,t,n){for(var i=[],r=0;r<e.childCount;r++){var a=e.child(r);a.content.size&&(a=a.copy(hF(a.content,t,a))),a.isInline&&(a=t(a,n,r)),i.push(a)}return tm.fromArray(i)}dF.jsonID("replaceAround",fF),oF.prototype.lift=function(e,t){for(var n=e.$from,i=e.$to,r=e.depth,a=n.before(r+1),o=i.after(r+1),s=a,l=o,u=tm.empty,d=0,_=r,c=!1;_>t;_--)c||n.index(_)>0?(c=!0,u=tm.from(n.node(_).copy(u)),d++):s--;for(var f=tm.empty,g=0,h=r,p=!1;h>t;h--)p||i.after(h+1)<i.end(h)?(p=!0,f=tm.from(i.node(h).copy(f)),g++):l++;return this.step(new fF(s,l,a,o,new lm(u.append(f),d,g),u.size-d,!0))},oF.prototype.wrap=function(e,t){for(var n=tm.empty,i=t.length-1;i>=0;i--)n=tm.from(t[i].type.create(t[i].attrs,n));var r=e.start,a=e.end;return this.step(new fF(r,a,r,a,new lm(n,0,0),t.length,!0))},oF.prototype.setBlockType=function(e,t,n,i){var r=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,i)&&function(e,t,n){var i=e.resolve(t),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}(r.doc,r.mapping.slice(a).map(t),n)){r.clearIncompatible(r.mapping.slice(a).map(t,1),n);var o=r.mapping.slice(a),s=o.map(t,1),l=o.map(t+e.nodeSize,1);return r.step(new fF(s,l,s+1,l-1,new lm(tm.from(n.create(i,null,e.marks)),0,0),1,!0)),!1}})),this},oF.prototype.setNodeMarkup=function(e,t,n,i){var r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at given position");t||(t=r.type);var a=t.create(n,null,i||r.marks);if(r.isLeaf)return this.replaceWith(e,e+r.nodeSize,a);if(!t.validContent(r.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new fF(e,e+r.nodeSize,e+1,e+r.nodeSize-1,new lm(tm.from(a),0,0),1,!0))},oF.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var i=this.doc.resolve(e),r=tm.empty,a=tm.empty,o=i.depth,s=i.depth-t,l=t-1;o>s;o--,l--){r=tm.from(i.node(o).copy(r));var u=n&&n[l];a=tm.from(u?u.type.create(u.attrs,a):i.node(o).copy(a))}return this.step(new cF(e,e,new lm(r.append(a),t,t),!0))},oF.prototype.join=function(e,t){void 0===t&&(t=1);var n=new cF(e-t,e+t,lm.empty,!0);return this.step(n)};var pF=function(e){function t(t,n,i){e.call(this),this.from=t,this.to=n,this.mark=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=e.resolve(this.from),r=i.node(i.sharedDepth(this.to)),a=new lm(hF(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),r),n.openStart,n.openEnd);return _F.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new mF(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.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,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(dF);dF.jsonID("addMark",pF);var mF=function(e){function t(t,n,i){e.call(this),this.from=t,this.to=n,this.mark=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=new lm(hF(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return _F.fromReplace(e,this.from,this.to,i)},t.prototype.invert=function(){return new pF(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.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,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(dF);function FF(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}dF.jsonID("removeMark",mF),oF.prototype.addMark=function(e,t,n){var i=this,r=[],a=[],o=null,s=null;return this.doc.nodesBetween(e,t,(function(i,l,u){if(i.isInline){var d=i.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){for(var _=Math.max(l,e),c=Math.min(l+i.nodeSize,t),f=n.addToSet(d),g=0;g<d.length;g++)d[g].isInSet(f)||(o&&o.to==_&&o.mark.eq(d[g])?o.to=c:r.push(o=new mF(_,c,d[g])));s&&s.to==_?s.to=c:a.push(s=new pF(_,c,n))}}})),r.forEach((function(e){return i.step(e)})),a.forEach((function(e){return i.step(e)})),this},oF.prototype.removeMark=function(e,t,n){var i=this;void 0===n&&(n=null);var r=[],a=0;return this.doc.nodesBetween(e,t,(function(i,o){if(i.isInline){a++;var s=null;if(n instanceof Gm)for(var l,u=i.marks;l=n.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else n?n.isInSet(i.marks)&&(s=[n]):s=i.marks;if(s&&s.length)for(var d=Math.min(o+i.nodeSize,t),_=0;_<s.length;_++){for(var c=s[_],f=void 0,g=0;g<r.length;g++){var h=r[g];h.step==a-1&&c.eq(r[g].style)&&(f=h)}f?(f.to=d,f.step=a):r.push({style:c,from:Math.max(o,e),to:d,step:a})}}})),r.forEach((function(e){return i.step(new mF(e.from,e.to,e.style))})),this},oF.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var i=this.doc.nodeAt(e),r=[],a=e+1,o=0;o<i.childCount;o++){var s=i.child(o),l=a+s.nodeSize,u=n.matchType(s.type,s.attrs);if(u){n=u;for(var d=0;d<s.marks.length;d++)t.allowsMarkType(s.marks[d].type)||this.step(new mF(a,l,s.marks[d]))}else r.push(new cF(a,l,lm.empty));a=l}if(!n.validEnd){var _=n.fillBefore(tm.empty,!0);this.replace(a,a,new lm(_,0,0))}for(var c=r.length-1;c>=0;c--)this.step(r[c]);return this},oF.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=lm.empty);var i=function(e,t,n,i){if(void 0===n&&(n=t),void 0===i&&(i=lm.empty),t==n&&!i.size)return null;var r=e.resolve(t),a=e.resolve(n);return FF(r,a,i)?new cF(t,n,i):new bF(r,a,i).fit()}(this.doc,e,t,n);return i&&this.step(i),this},oF.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new lm(tm.from(n),0,0))},oF.prototype.delete=function(e,t){return this.replace(e,t,lm.empty)},oF.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var bF=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var i=0;i<=e.depth;i++){var r=e.node(i);this.frontier.push({type:r.type,match:r.contentMatchAt(e.indexAfter(i))})}this.placed=tm.empty;for(var a=e.depth;a>0;a--)this.placed=tm.from(e.node(a).copy(this.placed))},yF={depth:{configurable:!0}};function EF(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(EF(e.firstChild.content,t-1,n)))}function vF(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(vF(e.lastChild.content,t-1,n)))}function kF(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function DF(e,t,n){if(t<=0)return e;var i=e.content;return t>1&&(i=i.replaceChild(0,DF(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(tm.empty,!0)))),e.copy(i)}function CF(e,t,n,i,r){var a=e.node(t),o=r?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;var s=i.fillBefore(a.content,!0,o);return s&&!function(e,t,n){for(var i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}(n,a.content,o)?s:null}function wF(e,t,n,i,r){if(t<n){var a=e.firstChild;e=e.replaceChild(0,a.copy(wF(a.content,t+1,n,i,a)))}if(t>i){var o=r.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(tm.empty,!0))}return e}function SF(e,t){for(var n=[],i=Math.min(e.depth,t.depth);i>=0;i--){var r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}yF.depth.get=function(){return this.frontier.length-1},bF.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(t<0?this.$to:i.doc.resolve(t));if(!r)return null;for(var a=this.placed,o=i.depth,s=r.depth;o&&s&&1==a.childCount;)a=a.firstChild.content,o--,s--;var l=new lm(a,o,s);return t>-1?new fF(i.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||i.pos!=this.$to.pos?new cF(i.pos,r.pos,l):void 0},bF.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,i=(t?(n=kF(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,r=this.depth;r>=0;r--){var a=this.frontier[r],o=a.type,s=a.match,l=void 0,u=void 0;if(1==e&&(i?s.matchType(i.type)||(u=s.fillBefore(tm.from(i),!1)):o.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:r,parent:n,inject:u};if(2==e&&i&&(l=s.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:r,parent:n,wrap:l};if(n&&s.matchType(n.type))break}},bF.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,r=kF(t,n);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new lm(t,n+1,Math.max(i,r.size+n>=t.size-i?n+1:0)),!0)},bF.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,r=kF(t,n);if(r.childCount<=1&&n>0){var a=t.size-n<=n+r.size;this.unplaced=new lm(EF(t,n-1,1),n-1,a?n-1:i)}else this.unplaced=new lm(EF(t,n,1),n,i)},bF.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,i=e.parent,r=e.inject,a=e.wrap;this.depth>n;)this.closeFrontierNode();if(a)for(var o=0;o<a.length;o++)this.openFrontierNode(a[o]);var s=this.unplaced,l=i?i.content:s.content,u=s.openStart-t,d=0,_=[],c=this.frontier[n],f=c.match,g=c.type;if(r){for(var h=0;h<r.childCount;h++)_.push(r.child(h));f=f.matchFragment(r)}for(var p=l.size+t-(s.content.size-s.openEnd);d<l.childCount;){var m=l.child(d),F=f.matchType(m.type);if(!F)break;(++d>1||0==u||m.content.size)&&(f=F,_.push(DF(m.mark(g.allowedMarks(m.marks)),1==d?u:0,d==l.childCount?p:-1)))}var b=d==l.childCount;b||(p=-1),this.placed=vF(this.placed,n,tm.from(_)),this.frontier[n].match=f,b&&p<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var y=0,E=l;y<p;y++){var v=E.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),E=v.content}this.unplaced=b?0==t?lm.empty:new lm(EF(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new lm(EF(s.content,t,d),s.openStart,s.openEnd)},bF.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||!CF(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 n=this.$to.depth,i=this.$to.after(n);n>1&&i==this.$to.end(--n);)++i;return i},bF.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],i=n.match,r=n.type,a=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=CF(e,t,r,i,a);if(o){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,d=CF(e,s,l.type,u,!0);if(!d||d.childCount)continue e}return{depth:t,fit:o,move:a?e.doc.resolve(e.after(t+1)):e}}}},bF.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=vF(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var i=e.node(n),r=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,r)}return e},bF.prototype.openFrontierNode=function(e,t,n){var i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=vF(this.placed,this.depth,tm.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},bF.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(tm.empty,!0);e.childCount&&(this.placed=vF(this.placed,this.frontier.length,e))},Object.defineProperties(bF.prototype,yF),oF.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var i=this.doc.resolve(e),r=this.doc.resolve(t);if(FF(i,r,n))return this.step(new cF(e,t,n));var a=SF(i,this.doc.resolve(t));0==a[a.length-1]&&a.pop();var o=-(i.depth+1);a.unshift(o);for(var s=i.depth,l=i.pos-1;s>0;s--,l--){var u=i.node(s).type.spec;if(u.defining||u.isolating)break;a.indexOf(s)>-1?o=s:i.before(s)==l&&a.splice(1,0,-s)}for(var d=a.indexOf(o),_=[],c=n.openStart,f=n.content,g=0;;g++){var h=f.firstChild;if(_.push(h),g==n.openStart)break;f=h.content}c>0&&_[c-1].type.spec.defining&&i.node(d).type!=_[c-1].type?c-=1:c>=2&&_[c-1].isTextblock&&_[c-2].type.spec.defining&&i.node(d).type!=_[c-2].type&&(c-=2);for(var p=n.openStart;p>=0;p--){var m=(p+c+1)%(n.openStart+1),F=_[m];if(F)for(var b=0;b<a.length;b++){var y=a[(b+d)%a.length],E=!0;y<0&&(E=!1,y=-y);var v=i.node(y-1),k=i.index(y-1);if(v.canReplaceWith(k,k,F.type,F.marks))return this.replace(i.before(y),E?r.after(y):t,new lm(wF(n.content,0,n.openStart,m),m,n.openEnd))}}for(var D=this.steps.length,C=a.length-1;C>=0&&(this.replace(e,t,n),!(this.steps.length>D));C--){var w=a[C];w<0||(e=i.before(w),t=r.after(w))}return this},oF.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var i=function(e,t,n){var i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(0==i.parentOffset)for(var r=i.depth-1;r>=0;r--){var a=i.index(r);if(i.node(r).canReplaceWith(a,a,n))return i.before(r+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(var o=i.depth-1;o>=0;o--){var s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s<i.node(o).childCount)return null}}(this.doc,e,n.type);null!=i&&(e=t=i)}return this.replaceRange(e,t,new lm(tm.from(n),0,0))},oF.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),i=this.doc.resolve(t),r=SF(n,i),a=0;a<r.length;a++){var o=r[a],s=a==r.length-1;if(s&&0==o||n.node(o).type.contentMatch.validEnd)return this.delete(n.start(o),i.end(o));if(o>0&&(s||n.node(o-1).canReplace(n.index(o-1),i.indexAfter(o-1))))return this.delete(n.before(o),i.after(o))}for(var l=1;l<=n.depth&&l<=i.depth;l++)if(e-n.start(l)==n.depth-l&&t>n.end(l)&&i.end(l)-t!=i.depth-l)return this.delete(n.before(l),t);return this.delete(e,t)};var OF=Object.create(null),xF=function(e,t,n){this.ranges=n||[new NF(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},TF={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};TF.anchor.get=function(){return this.$anchor.pos},TF.head.get=function(){return this.$head.pos},TF.from.get=function(){return this.$from.pos},TF.to.get=function(){return this.$to.pos},TF.$from.get=function(){return this.ranges[0].$from},TF.$to.get=function(){return this.ranges[0].$to},TF.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},xF.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},xF.prototype.replace=function(e,t){void 0===t&&(t=lm.empty);for(var n=t.content.lastChild,i=null,r=0;r<t.openEnd;r++)i=n,n=n.lastChild;for(var a=e.steps.length,o=this.ranges,s=0;s<o.length;s++){var l=o[s],u=l.$from,d=l.$to,_=e.mapping.slice(a);e.replaceRange(_.map(u.pos),_.map(d.pos),s?lm.empty:t),0==s&&jF(e,a,(n?n.isInline:i&&i.isTextblock)?-1:1)}},xF.prototype.replaceWith=function(e,t){for(var n=e.steps.length,i=this.ranges,r=0;r<i.length;r++){var a=i[r],o=a.$from,s=a.$to,l=e.mapping.slice(n),u=l.map(o.pos),d=l.map(s.pos);r?e.deleteRange(u,d):(e.replaceRangeWith(u,d,t),jF(e,n,t.isInline?-1:1))}},xF.findFrom=function(e,t,n){var i=e.parent.inlineContent?new AF(e):PF(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(var r=e.depth-1;r>=0;r--){var a=t<0?PF(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):PF(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(a)return a}},xF.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new LF(e.node(0))},xF.atStart=function(e){return PF(e,e,0,0,1)||new LF(e)},xF.atEnd=function(e){return PF(e,e,e.content.size,e.childCount,-1)||new LF(e)},xF.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=OF[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},xF.jsonID=function(e,t){if(e in OF)throw new RangeError("Duplicate use of selection JSON ID "+e);return OF[e]=t,t.prototype.jsonID=e,t},xF.prototype.getBookmark=function(){return AF.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(xF.prototype,TF),xF.prototype.visible=!0;var NF=function(e,t){this.$from=e,this.$to=t},AF=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,i){var r=n.resolve(i.map(this.head));if(!r.parent.inlineContent)return e.near(r);var a=n.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:r,r)},t.prototype.replace=function(t,n){if(void 0===n&&(n=lm.empty),e.prototype.replace.call(this,t,n),n==lm.empty){var i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new MF(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))},t.between=function(n,i,r){var a=n.pos-i.pos;if(r&&!a||(r=a>=0?1:-1),!i.parent.inlineContent){var o=e.findFrom(i,r,!0)||e.findFrom(i,-r,!0);if(!o)return e.near(i,r);i=o.$head}return n.parent.inlineContent||(0==a||(n=(e.findFrom(n,-r,!0)||e.findFrom(n,r,!0)).$anchor).pos<i.pos!=a<0)&&(n=i),new t(n,i)},Object.defineProperties(t.prototype,n),t}(xF);xF.jsonID("text",AF);var MF=function(e,t){this.anchor=e,this.head=t};MF.prototype.map=function(e){return new MF(e.map(this.anchor),e.map(this.head))},MF.prototype.resolve=function(e){return AF.between(e.resolve(this.anchor),e.resolve(this.head))};var RF=function(e){function t(t){var n=t.nodeAfter,i=t.node(0).resolve(t.pos+n.nodeSize);e.call(this,t,i),this.node=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,i){var r=i.mapResult(this.anchor),a=r.deleted,o=r.pos,s=n.resolve(o);return a?e.near(s):new t(s)},t.prototype.content=function(){return new lm(tm.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 IF(this.anchor)},t.fromJSON=function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.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}(xF);RF.prototype.visible=!1,xF.jsonID("node",RF);var IF=function(e){this.anchor=e};IF.prototype.map=function(e){var t=e.mapResult(this.anchor),n=t.deleted,i=t.pos;return n?new MF(i,i):new IF(i)},IF.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&RF.isSelectable(n)?new RF(t):xF.near(t)};var LF=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,n){if(void 0===n&&(n=lm.empty),n==lm.empty){t.delete(0,t.doc.content.size);var i=e.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else e.prototype.replace.call(this,t,n)},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 BF},t}(xF);xF.jsonID("all",LF);var BF={map:function(){return this},resolve:function(e){return new LF(e)}};function PF(e,t,n,i,r,a){if(t.inlineContent)return AF.create(e,n);for(var o=i-(r>0?0:1);r>0?o<t.childCount:o>=0;o+=r){var s=t.child(o);if(s.isAtom){if(!a&&RF.isSelectable(s))return RF.create(e,n-(r<0?s.nodeSize:0))}else{var l=PF(e,s,n+r,r<0?s.childCount:0,r,a);if(l)return l}n+=s.nodeSize*r}}function jF(e,t,n){var i=e.steps.length-1;if(!(i<t)){var r,a=e.steps[i];if(a instanceof cF||a instanceof fF)e.mapping.maps[i].forEach((function(e,t,n,i){null==r&&(r=i)})),e.setSelection(xF.near(e.doc.resolve(r),n))}}var qF=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 n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.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},n.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 om.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()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),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 n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||om.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var r=this.storedMarks;if(!r){var a=this.doc.resolve(t);r=n==t?a.marks():a.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,r)),this.selection.empty||this.setSelection(xF.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]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(oF);function UF(e,t){return t&&e?e.bind(t):e}var zF=function(e,t,n){this.name=e,this.init=UF(t.init,n),this.apply=UF(t.apply,n)},HF=[new zF("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new zF("selection",{init:function(e,t){return e.selection||xF.atStart(t.doc)},apply:function(e){return e.selection}}),new zF("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new zF("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],WF=function(e,t){var n=this;this.schema=e,this.fields=HF.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new zF(e.key,e.spec.state,e))}))},GF=function(e){this.config=e},YF={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};YF.schema.get=function(){return this.config.schema},YF.plugins.get=function(){return this.config.plugins},GF.prototype.apply=function(e){return this.applyTransaction(e).state},GF.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=t){var i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0},GF.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),i=null;;){for(var r=!1,a=0;a<this.config.plugins.length;a++){var o=this.config.plugins[a];if(o.spec.appendTransaction){var s=i?i[a].n:0,l=i?i[a].state:this,u=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,l,n);if(u&&n.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(var d=0;d<this.config.plugins.length;d++)i.push(d<a?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),r=!0}i&&(i[a]={state:n,n:t.length})}}if(!r)return{state:n,transactions:t}}},GF.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new GF(this.config),n=this.config.fields,i=0;i<n.length;i++){var r=n[i];t[r.name]=r.apply(e,this[r.name],this,t)}for(var a=0;a<VF.length;a++)VF[a](this,e,t);return t},YF.tr.get=function(){return new qF(this)},GF.create=function(e){for(var t=new WF(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new GF(t),i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n},GF.prototype.reconfigure=function(e){for(var t=new WF(this.schema,e.plugins),n=t.fields,i=new GF(t),r=0;r<n.length;r++){var a=n[r].name;i[a]=this.hasOwnProperty(a)?this[a]:n[r].init(e,i)}return i},GF.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 n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var i=e[n],r=i.spec.state;r&&r.toJSON&&(t[n]=r.toJSON.call(i,this[i.key]))}return t},GF.fromJSON=function(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var i=new WF(e.schema,e.plugins),r=new GF(i);return i.fields.forEach((function(i){if("doc"==i.name)r.doc=Cm.fromJSON(e.schema,t.doc);else if("selection"==i.name)r.selection=xF.fromJSON(r.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(r.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var a in n){var o=n[a],s=o.spec.state;if(o.key==i.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(r[i.name]=s.fromJSON.call(o,e,t[a],r))}r[i.name]=i.init(e,r)}})),r},GF.addApplyListener=function(e){VF.push(e)},GF.removeApplyListener=function(e){var t=VF.indexOf(e);t>-1&&VF.splice(t,1)},Object.defineProperties(GF.prototype,YF);var VF=[];var $F=function(e){this.props={},e.props&&function e(t,n,i){for(var r in t){var a=t[r];a instanceof Function?a=a.bind(n):"handleDOMEvents"==r&&(a=e(a,n,{})),i[r]=a}return i}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:QF("plugin")};$F.prototype.getState=function(e){return e[this.key]};var KF=Object.create(null);function QF(e){return e in KF?e+"$"+ ++KF[e]:(KF[e]=0,e+"$")}var ZF=function(e){void 0===e&&(e="key"),this.key=QF(e)};ZF.prototype.get=function(e){return e.config.pluginsByKey[this.key]},ZF.prototype.getState=function(e){return e[this.key]};const XF=ma.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 $F({key:new ZF("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const i=this.storage.characters({node:t.doc}),r=this.storage.characters({node:e.doc});if(r<=n)return!0;if(i>n&&r>n&&r<=i)return!0;if(i>n&&r>n&&r>i)return!1;if(!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,o=a-(r-n),s=a;e.deleteRange(o,s);return!(this.storage.characters({node:e.doc})>n)}})]}});var JF=n(53);const eb=fs.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",rs(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[ys({find:e=>Object(JF.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 Mt({key:new Lt("handleClickLink"),props:{handleClick:(e,t,n)=>{var i;const r=this.editor.getAttributes("link");return!(!(null===(i=n.target)||void 0===i?void 0:i.closest("a"))||!r.href)&&(window.open(r.href,r.target),!0)}}})),this.options.linkOnPaste&&e.push(new Mt({key:new Lt("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:r}=i,{empty:a}=r;if(a)return!1;let o="";n.content.forEach(e=>{o+=e.textContent});const s=Object(JF.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),tb=fs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",rs(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=po(e,this.type);return!!Object.entries(n).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),nb=ma.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 ib=cs.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Mt({key:new Lt("eventHandler"),props:{handleClick:function(t,n){var i=t.state,r=i.doc.lastChild,a=i.doc.resolve(n).nodeBefore;if(r&&a){var o=r.eq(a),s=r.isInline,l=["paragraph","text"].includes(r.type.name);!o||s||l||e.commands.insertContentAt(n,{type:"paragraph",content:""})}}}})]}}),rb=$h.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",rs(this.options.HTMLAttributes,t),0]}});const ab=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,ob=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",rs(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[gs({find:ab,type:this.type,getAttributes:e=>{const[,,t,n,i]=e;return{src:n,alt:t,title:i}}})]}});function sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function lb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sb(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ub=ob.extend({name:"image",addAttributes:function(){return lb(lb({},ob.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(n){var i,r,a,o=n.tr,s=n.commands;return"image"==(null===(i=o.selection)||void 0===i||null===(r=i.node)||void 0===r||null===(a=r.type)||void 0===a?void 0:a.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}}}},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return n.class=" image-"+t.attrs.size,n.class+=" image-float-"+t.attrs.float,["img",rs(this.options.HTMLAttributes,n)]}});const db=fs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",rs(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()}}});var _b=function(e){var t=e.wrapperRef,n=e.index;if(t.current&&!(n>=t.current.children.length)){var i=t.current,r=i.children[n],a=r.clientHeight+8,o=i.scrollTop;r.offsetTop+a>o+i.clientHeight?o=r.offsetTop-i.clientHeight+a:o>r.offsetTop&&(o=r.offsetTop-8),t.current.scrollTop=o}};function cb(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 n,i=cc()(e);if(t){var r=cc()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return dc()(this,n)}}var fb=function(e){lc()(n,e);var t=cb(n);function n(e){var i;return nc()(this,n),i=t.call(this,e),_()(oc()(i),"onKeyDown",(function(e){var t=e.event;return"ArrowUp"===t.key?(i.upHandler(),!0):"ArrowDown"===t.key?(i.downHandler(),!0):"Enter"===t.key&&(i.enterHandler(),!0)})),_()(oc()(i),"upHandler",(function(){i.setState({selectedIndex:(i.state.selectedIndex+i.props.items.length-1)%i.props.items.length})})),_()(oc()(i),"downHandler",(function(){i.setState({selectedIndex:(i.state.selectedIndex+1)%i.props.items.length})})),_()(oc()(i),"enterHandler",(function(){i.selectItem(i.state.selectedIndex)})),_()(oc()(i),"selectItem",(function(e){var t=i.props.items[e];if(t){var n=i.props,r=n.editor,a=n.range;t.command({editor:r,range:a})}})),i.state={selectedIndex:0},i.menuRef=m.a.createRef(),i}return rc()(n,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),_b({wrapperRef:this.menuRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this;return m.a.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},this.props.items.map((function(t,n){return m.a.createElement(gb,{key:t.title,item:t,index:n,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(n)}})})))}}]),n}(m.a.Component),gb=function(e){var t=e.item,n=e.selectedIndex,i=e.index,r=e.selectItem,a=t.Icon;return m.a.createElement("div",{className:b()("neeto-editor-slash-commands__item",{active:i===n}),onClick:function(){return r(i)}},a&&m.a.createElement(a,{size:20}),m.a.createElement("div",{className:"neeto-editor-slash-commands__item-content"},m.a.createElement("h5",null,t.title),m.a.createElement("p",null,t.description)))},hb=fb;const pb=new Lt("suggestion");function mb({pluginKey:e=pb,editor:t,char:n="@",allowSpaces:i=!1,prefixSpace:r=!0,startOfLine:a=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:_=(()=>!0)}){const c=null==d?void 0:d();return new Mt({key:e,view(){return{update:async(e,n)=>{var i,r,a,o,s;const d=null===(i=this.key)||void 0===i?void 0:i.getState(n),_=null===(r=this.key)||void 0===r?void 0:r.getState(e.state),f=d.active&&_.active&&d.range.from!==_.range.from,g=!d.active&&_.active,h=d.active&&!_.active,p=g||f,m=!g&&!h&&d.query!==_.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:_,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={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:y,clientRect:y?()=>{var e;const{decorationId:n}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${n}"]`).getBoundingClientRect()}:null};F&&(null===(a=null==c?void 0:c.onExit)||void 0===a||a.call(c,E)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,E)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,E))}}},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:d}=l,c={...o};if(c.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:i,startOfLine:r,$position:a}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=r?"^":"",u=n?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=a.depth<=0?0:a.before(),_=a.pos,c=a.doc.textBetween(d,_,"\0","\0"),f=Array.from(c.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(i&&!h)return null;const p=f.index+a.start();let m=p+f[0].length;return n&&s.test(c.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<a.pos&&m>=a.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:n,allowSpaces:i,prefixSpace:r,startOfLine:a,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&_({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 n;const{active:i,range:r}=this.getState(e.state);return i&&(null===(n=null==c?void 0:c.onKeyDown)||void 0===n?void 0:n.call(c,{view:e,event:t,range:r}))||!1},decorations(e){const{active:t,range:n,decorationId:i}=this.getState(e);return t?Rr.create(e.doc,[Tr.inline(n.from,n.to,{nodeName:o,class:s,"data-decoration-id":i})]):null}}})}function Fb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function bb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fb(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yb=new Lt("commands"),Eb=function(e){var t=e.setImageUploadVisible,n=e.mentions,i=e.options;return ma.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:yb,command:function(e){var t=e.editor,n=e.range;e.props.command({editor:t,range:n})},items:function(e){var r=e.query,a=[{title:"Paragraph",description:"Add a plain text block",Icon:ju.Paragraph,optionName:"font-size",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("paragraph").run()}},{title:"H1",description:"Add a big heading",Icon:ju.TextH1,optionName:"font-size",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("heading",{level:1}).run()}},{title:"H2",description:"Add a sub-heading",Icon:ju.TextH2,optionName:"font-size",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("heading",{level:2}).run()}},{title:"Numbered list",description:"Add a list with numbering",Icon:ju.ListNumber,optionName:"ordered-list",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleOrderedList().run()}},{title:"Bulleted list",description:"Add an list bullets",Icon:ju.ListDot,optionName:"bullet-list",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBulletList().run()}},{title:"Blockquote",description:"Add a quote",Icon:ju.Blockquote,optionName:"block-quote",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBlockquote().run()}},{title:"Image",description:"Add an image",Icon:ju.Image,optionName:"image-upload",command:function(e){var n=e.editor,i=e.range;t(!0),n.chain().focus().deleteRange(i).run()}},{title:"Code block",description:"Add a code block with syntax highlighting",Icon:ju.Code,optionName:"code-block",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleCodeBlock().run()}},{title:"Emoji",description:"Add an emoji",Icon:ju.Smiley,optionName:"emoji",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).insertContent("::").run()}},{title:"Divider",description:"Add an horizontal line to separate sections",optionName:"divider",Icon:ju.Minus,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setHorizontalRule().run()}},{title:"Embed Youtube/Vimeo",description:"Embed a video from major services",Icon:ju.Video,optionName:"video-embed",command:function(e){var t,n=e.editor,i=e.range,r=prompt("Please enter Youtube/Vimeo embed URL"),a=(t=r.match(qd))&&"https://www.youtube.com/embed/".concat(t[5])||function(e){var t=e.match(Ud);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])}(r);a?n.chain().focus().deleteRange(i).setExternalVideo({src:a}).run():n.chain().focus().deleteRange(i).insertContent("#invalid").run()}}].filter((function(e){return i.includes(e.optionName)})),o={title:"Mention",description:"Mention a user",optionName:"mention",Icon:ju.Email,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).insertContent("@").run()}};Hu()(n)||a.push(o);var s=a.filter((function(e){return e.title.toLowerCase().includes(r.toLowerCase())}));return Hu()(s)?[{title:"No results",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).run()}}]:s},render:function(){var e,t;return{onStart:function(n){e=new xu(hb,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[mb(bb({editor:this.editor},this.options.suggestion))]}})},vb={};function kb(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 n=e[t];"object"!=typeof n||Object.isFrozen(n)||kb(n)})),e}var Db=kb,Cb=kb;Db.default=Cb;class wb{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Sb(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ob(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const xb=e=>!!e.kind;class Tb{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Sb(e)}openNode(e){if(!xb(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){xb(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class Nb{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=>{Nb._collapse(e)}))}}class Ab extends Nb{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 n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new Tb(this,this.options).value()}finalize(){return!0}}function Mb(e){return e?"string"==typeof e?e:e.source:null}const Rb=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const Ib="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Lb={begin:"\\\\[\\s\\S]",relevance:0},Bb={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[Lb]},Pb={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[Lb]},jb={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/},qb=function(e,t,n={}){const i=Ob({className:"comment",begin:e,end:t,contains:[]},n);return i.contains.push(jb),i.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),i},Ub=qb("//","$"),zb=qb("/\\*","\\*/"),Hb=qb("#","$"),Wb={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},Gb={className:"number",begin:Ib,relevance:0},Yb={className:"number",begin:"\\b(0b[01]+)",relevance:0},Vb={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},$b={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Lb,{begin:/\[/,end:/\]/,relevance:0,contains:[Lb]}]}]},Kb={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},Qb={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},Zb={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var Xb=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:Ib,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>Mb(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),Ob({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:Lb,APOS_STRING_MODE:Bb,QUOTE_STRING_MODE:Pb,PHRASAL_WORDS_MODE:jb,COMMENT:qb,C_LINE_COMMENT_MODE:Ub,C_BLOCK_COMMENT_MODE:zb,HASH_COMMENT_MODE:Hb,NUMBER_MODE:Wb,C_NUMBER_MODE:Gb,BINARY_NUMBER_MODE:Yb,CSS_NUMBER_MODE:Vb,REGEXP_MODE:$b,TITLE_MODE:Kb,UNDERSCORE_TITLE_MODE:Qb,METHOD_GUARD:Zb,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 Jb(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function ey(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Jb,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function ty(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>Mb(e)).join("|")+")"}(...e.illegal))}function ny(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 iy(e,t){void 0===e.relevance&&(e.relevance=1)}const ry=["of","and","for","in","not","or","if","then","parent","list","value"];function ay(e,t){return t?Number(t):function(e){return ry.includes(e.toLowerCase())}(e)?0:1}function oy(e,{plugins:t}){function n(t,n){return new RegExp(Mb(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class i{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=n(function(e,t="|"){let n=0;return e.map(e=>{n+=1;const t=n;let i=Mb(e),r="";for(;i.length>0;){const e=Rb.exec(i);if(!e){r+=i;break}r+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+t):(r+=e[0],"("===e[0]&&n++)}return r}).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 n=t.findIndex((e,t)=>t>0&&void 0!==e),i=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,i)}}class r{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 i;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),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 n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}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=Ob(e.classNameAliases||{}),function t(i,a){const o=i;if(i.isCompiled)return o;[ny].forEach(e=>e(i,a)),e.compilerExtensions.forEach(e=>e(i,a)),i.__beforeBegin=null,[ey,ty,iy].forEach(e=>e(i,a)),i.isCompiled=!0;let s=null;if("object"==typeof i.keywords&&(s=i.keywords.$pattern,delete i.keywords.$pattern),i.keywords&&(i.keywords=function e(t,n,i="keyword"){const r={};return"string"==typeof t?a(i,t.split(" ")):Array.isArray(t)?a(i,t):Object.keys(t).forEach((function(i){Object.assign(r,e(t[i],n,i))})),r;function a(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const n=t.split("|");r[n[0]]=[e,ay(n[0],n[1])]}))}}(i.keywords,e.case_insensitive)),i.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||i.lexemes||/\w+/,o.keywordPatternRe=n(s,!0),a&&(i.begin||(i.begin=/\B|\b/),o.beginRe=n(i.begin),i.endSameAsBegin&&(i.end=i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(o.endRe=n(i.end)),o.terminatorEnd=Mb(i.end)||"",i.endsWithParent&&a.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(o.illegalRe=n(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return Ob(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return Ob(e,{starts:e.starts?Ob(e.starts):null});if(Object.isFrozen(e))return Ob(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){t(e,o)})),i.starts&&t(i.starts,a),o.matcher=function(e){const t=new r;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 sy(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,Sb(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 ly={"after:highlightElement":({el:e,result:t,text:n})=>{const i=dy(e);if(!i.length)return;const r=document.createElement("div");r.innerHTML=t.value,t.value=function(e,t,n){let i=0,r="";const a=[];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){r+="<"+uy(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+Sb(e.value)+'"'})).join("")+">"}function l(e){r+="</"+uy(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(r+=Sb(n.substring(i,t[0].offset)),i=t[0].offset,t===e){a.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===i);a.reverse().forEach(s)}else"start"===t[0].event?a.push(t[0].node):a.pop(),u(t.splice(0,1)[0])}return r+Sb(n.substr(i))}(i,dy(r),n)}};function uy(e){return e.nodeName.toLowerCase()}function dy(e){const t=[];return function e(n,i){for(let r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?i+=r.nodeValue.length:1===r.nodeType&&(t.push({event:"start",offset:i,node:r}),i=e(r,i),uy(r).match(/br|hr|img|input/)||t.push({event:"stop",offset:i,node:r}));return i}(e,0),t}const _y={},cy=e=>{console.error(e)},fy=(e,...t)=>{console.log("WARN: "+e,...t)},gy=(e,t)=>{_y[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),_y[`${e}/${t}`]=!0)},hy=Sb,py=Ob,my=Symbol("nomatch");var Fy=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const a=/(^(<[^>]+>|\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:Ab};function u(e){return l.noHighlightRe.test(e)}function d(e,t,n,i){let r="",a="";"object"==typeof t?(r=e,n=t.ignoreIllegals,a=t.language,i=void 0):(gy("10.7.0","highlight(lang, code, ...args) has been deprecated."),gy("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),a=e,r=t);const o={code:r,language:a};k("before:highlight",o);const s=o.result?o.result:_(o.language,o.code,n,i);return s.code=o.code,k("after:highlight",s),s}function _(e,n,a,s){function u(e,t){const n=b.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function d(){null!=k.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void C.addText(w);e=_(k.subLanguage,w,!0,D[k.subLanguage]),D[k.subLanguage]=e.top}else e=c(w,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),C.addSublanguage(e.emitter,e.language)}():function(){if(!k.keywords)return void C.addText(w);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(w),n="";for(;t;){n+=w.substring(e,t.index);const i=u(k,t);if(i){const[e,r]=i;if(C.addText(n),n="",S+=r,e.startsWith("_"))n+=t[0];else{const n=b.classNameAliases[e]||e;C.addKeyword(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(w)}n+=w.substr(e),C.addText(n)}(),w=""}function f(e){return e.className&&C.openNode(b.classNameAliases[e.className]||e.className),k=Object.create(e,{parent:{value:k}}),k}function g(e){return 0===k.matcher.regexIndex?(w+=e[0],1):(T=!0,0)}function h(e){const t=e[0],n=e.rule,i=new wb(n),r=[n.__beforeBegin,n["on:begin"]];for(const n of r)if(n&&(n(e,i),i.isMatchIgnored))return g(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?w+=t:(n.excludeBegin&&(w+=t),d(),n.returnBegin||n.excludeBegin||(w=t)),f(n),n.returnBegin?0:t.length}function p(e){const t=e[0],i=n.substr(e.index),r=function e(t,n,i){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(t.endRe,i);if(r){if(t["on:end"]){const e=new wb(t);t["on:end"](n,e),e.isMatchIgnored&&(r=!1)}if(r){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,i)}(k,e,i);if(!r)return my;const a=k;a.skip?w+=t:(a.returnEnd||a.excludeEnd||(w+=t),d(),a.excludeEnd&&(w=t));do{k.className&&C.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent}while(k!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.endRe=r.endRe),f(r.starts)),a.returnEnd?0:t.length}let m={};function F(t,i){const o=i&&i[0];if(w+=t,null==o)return d(),0;if("begin"===m.type&&"end"===i.type&&m.index===i.index&&""===o){if(w+=n.slice(i.index,i.index+1),!r){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=i,"begin"===i.type)return h(i);if("illegal"===i.type&&!a){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(k.className||"<unnamed>")+'"');throw e.mode=k,e}if("end"===i.type){const e=p(i);if(e!==my)return e}if("illegal"===i.type&&""===o)return 1;if(x>1e5&&x>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=y(e);if(!b)throw cy(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const E=oy(b,{plugins:i});let v="",k=s||E;const D={},C=new l.__emitter(l);!function(){const e=[];for(let t=k;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>C.openNode(e))}();let w="",S=0,O=0,x=0,T=!1;try{for(k.matcher.considerAll();;){x++,T?T=!1:k.matcher.considerAll(),k.matcher.lastIndex=O;const e=k.matcher.exec(n);if(!e)break;const t=F(n.substring(O,e.index),e);O=e.index+t}return F(n.substr(O)),C.closeAllNodes(),C.finalize(),v=C.toHTML(),{relevance:Math.floor(S),value:v,language:e,illegal:!1,emitter:C,top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(O-100,O+100),mode:t.mode},sofar:v,relevance:0,value:hy(n),emitter:C};if(r)return{illegal:!1,relevance:0,value:hy(n),emitter:C,language:e,top:k,errorRaised:t};throw t}}function c(e,n){n=n||l.languages||Object.keys(t);const i=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:hy(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),r=n.filter(y).filter(v).map(t=>_(t,e,!1));r.unshift(i);const a=r.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(y(e.language).supersetOf===t.language)return 1;if(y(t.language).supersetOf===e.language)return-1}return 0}),[o,u]=a,d=o;return d.second_best=u,d}const f={"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>"))}},g=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(g,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const i=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=l.languageDetectRe.exec(t);if(n){const t=y(n[1]);return t||(fy(o.replace("{}",n[1])),fy("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||y(e))}(e);if(u(i))return;k("before:highlightElement",{el:e,language:i}),t=e;const r=t.textContent,a=i?d(r,{language:i,ignoreIllegals:!0}):c(r);k("after:highlightElement",{el:e,result:a,text:r}),e.innerHTML=a.value,function(e,t,i){const r=t?n[t]:i;e.classList.add("hljs"),r&&e.classList.add(r)}(e,i,a.language),e.result={language:a.language,re:a.relevance,relavance:a.relevance},a.second_best&&(e.second_best={language:a.second_best.language,re:a.second_best.relevance,relavance:a.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,gy("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 y(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function E(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function v(e){const t=y(e);return t&&!t.disableAutodetect}function k(e,t){const n=e;i.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){F&&b()}),!1),Object.assign(e,{highlight:d,highlightAuto:c,highlightAll:b,fixMarkup:function(e){return gy("10.2.0","fixMarkup will be removed entirely in v11.0"),gy("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(a,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 gy("10.7.0","highlightBlock will be removed entirely in v12.0"),gy("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(gy("10.3.0","'useBR' will be removed entirely in v11.0"),gy("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=py(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){gy("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(n,i){let a=null;try{a=i(e)}catch(e){if(cy("Language definition for '{}' could not be registered.".replace("{}",n)),!r)throw e;cy(e),a=s}a.name||(a.name=n),t[n]=a,a.rawDefinition=i.bind(null,e),a.aliases&&E(a.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:y,registerAliases:E,requireLanguage:function(e){gy("10.4.0","requireLanguage will be removed entirely in v11."),gy("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=y(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:v,inherit:py,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),i.push(e)},vuePlugin:sy(e).VuePlugin}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString="10.7.3";for(const e in Xb)"object"==typeof Xb[e]&&Db(Xb[e]);return Object.assign(e,Xb),e.addPlugin(f),e.addPlugin(ly),e.addPlugin(h),e}({}),by={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,i,r,a=1,o=[].slice.call(arguments),s=0,l=e.length,u="",d=!1,_=!1,c=function(){return o[a++]},f=function(){for(var n="";/\d/.test(e[s]);)n+=e[s++],t=e[s];return n.length>0?parseInt(n):null};s<l;++s)if(t=e[s],d)switch(d=!1,"."==t?(_=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(_=!0,t=e[s+=2]):_=!0,r=f(),t){case"b":u+=parseInt(c(),10).toString(2);break;case"c":u+="string"==typeof(n=c())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":u+=parseInt(c(),10);break;case"f":i=String(parseFloat(c()).toFixed(r||6)),u+=_?i:i.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?d=!0:u+=t;return u}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()}(by);var yy=by.exports,Ey=ky(Error),vy=Ey;function ky(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=yy.apply(null,arguments)),new e(t)}}Ey.eval=ky(EvalError),Ey.range=ky(RangeError),Ey.reference=ky(ReferenceError),Ey.syntax=ky(SyntaxError),Ey.type=ky(TypeError),Ey.uri=ky(URIError),Ey.create=ky;var Dy=Fy,Cy=vy;vb.highlight=wy,vb.highlightAuto=function(e,t){var n=t||{},i=n.subset||Dy.listLanguages();n.prefix;var r,a,o,s,l=i.length,u=-1;if("string"!=typeof e)throw Cy("Expected `string` for value, got `%s`",e);a={relevance:0,language:null,value:[]},r={relevance:0,language:null,value:[]};for(;++u<l;)s=i[u],Dy.getLanguage(s)&&((o=wy(s,e,t)).language=s,o.relevance>a.relevance&&(a=o),o.relevance>r.relevance&&(a=r,r=o));a.language&&(r.secondBest=a);return r},vb.registerLanguage=function(e,t){Dy.registerLanguage(e,t)},vb.listLanguages=function(){return Dy.listLanguages()},vb.registerAlias=function(e,t){var n,i=e;t&&((i={})[e]=t);for(n in i)Dy.registerAliases(i[n],{languageName:n})},Sy.prototype.addText=function(e){var t,n,i=this.stack;if(""===e)return;t=i[i.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},Sy.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},Sy.prototype.addSublanguage=function(e,t){var n=this.stack,i=n[n.length-1],r=e.rootNode.children,a=t?{type:"element",tagName:"span",properties:{className:[t]},children:r}:r;i.children=i.children.concat(a)},Sy.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,i=t[t.length-1],r={type:"element",tagName:"span",properties:{className:[n]},children:[]};i.children.push(r),t.push(r)},Sy.prototype.closeNode=function(){this.stack.pop()},Sy.prototype.closeAllNodes=Oy,Sy.prototype.finalize=Oy,Sy.prototype.toHTML=function(){return""};function wy(e,t,n){var i,r=Dy.configure({}),a=(n||{}).prefix;if("string"!=typeof e)throw Cy("Expected `string` for name, got `%s`",e);if(!Dy.getLanguage(e))throw Cy("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw Cy("Expected `string` for value, got `%s`",t);if(null==a&&(a="hljs-"),Dy.configure({__emitter:Sy,classPrefix:a}),i=Dy.highlight(t,{language:e,ignoreIllegals:!0}),Dy.configure(r||{}),i.errorRaised)throw i.errorRaised;return{relevance:i.relevance,language:i.language,value:i.emitter.rootNode.children}}function Sy(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function Oy(){}function xy(e){return e.value||e.children||[]}function Ty({doc:e,name:t,lowlight:n}){const i=[];return Es(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:r}=e.node.attrs,a=n.listLanguages();(function e(t,n=[]){return t.map(t=>{const i=[...n,...t.properties?t.properties.className:[]];return t.children?e(t.children,i):{text:t.value,classes:i}}).flat()})(r&&a.includes(r)?xy(n.highlight(r,e.node.textContent)):xy(n.highlightAuto(e.node.textContent))).forEach(e=>{const n=t+e.text.length;if(e.classes.length){const r=Tr.inline(t,n,{class:e.classes.join(" ")});i.push(r)}t=n})}),Rr.create(e,i)}function Ny({name:e,lowlight:t}){return new Mt({key:new Lt("lowlight"),state:{init:(n,{doc:i})=>Ty({doc:i,name:e,lowlight:t}),apply:(n,i,r,a)=>{const o=r.selection.$head.parent.type.name,s=a.selection.$head.parent.type.name,l=Es(r.doc,t=>t.type.name===e),u=Es(a.doc,t=>t.type.name===e);return n.docChanged&&([o,s].includes(e)||u.length!==l.length||n.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)))?Ty({doc:n.doc,name:e,lowlight:t}):i.map(n.mapping,n.doc)}},props:{decorations(e){return this.getState(e)}}})}const Ay=Lh.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:vb}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],Ny({name:this.name,lowlight:this.options.lowlight})]}});function My(){return m.a.createElement(Bu,null,m.a.createElement("pre",null,m.a.createElement(Pu,{as:"code"})))}var Ry=n(96),Iy=n.n(Ry),Ly=Ay.extend({addNodeView:function(){return new Mu(My)}}).configure({lowlight:Iy.a}),By=function(e){var t=e.items,n=e.command;return m.a.createElement("div",{className:"neeto-editor-variables-suggestion"},m.a.createElement(j_,{variables:t,onClickVariable:function(e){var t=e.category_key,i=e.key,r=t?"".concat(t,".").concat(i):i;n({label:r,id:r})}}))};function Py(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function jy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Py(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Py(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qy=new Lt("variables"),Uy=cs.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel:function(e){var t=e.options,n=e.node;return"".concat(t.charOpen).concat(n.attrs.label||n.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,n=e.HTMLAttributes;return["span",rs({"data-variable":""},this.options.HTMLAttributes,n),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(n){(0,n.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 n=t.tr,i=t.state,r=!1,a=i.selection,o=a.empty,s=a.anchor;return!!o&&(i.doc.nodesBetween(s-1,s,(function(t,i){if(t.type.name===e.name)return r=!0,n.insertText("",i,i+t.nodeSize),!1})),r)}))}}},addProseMirrorPlugins:function(){return[mb(jy({editor:this.editor},this.options.suggestion))]}}),zy={char:"{{",startOfLine:!1,pluginKey:qy,command:function(e){var t=e.editor,n=e.range,i=e.props;t.chain().focus().deleteRange(n).setVariable(i).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu(By,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Hy=function(e){var t=e.suggestion,n=void 0===t?{}:t;return Uy.configure({suggestion:jy(jy({},zy),n)})},Wy=n(35),Gy=n.n(Wy),Yy=n(97),Vy=n.n(Yy),$y=function(e){var t=Gy()(e);return"string"===t||"funtion"===t?e:Vy()(e)?function(t){var n=t.node.type.name;return e[n]}:""},Ky=ma.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 Mt({props:{decorations:function(t){var n=t.doc,i=t.selection,r=e.editor.isEditable||!e.options.showOnlyWhenEditable,a=i.anchor,o=[];if(r)return n.descendants((function(t,n){var i=a>=n&&a<=n+t.nodeSize,r=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((i||!e.options.showOnlyCurrent)&&!s&&r){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=Tr.node(n,n+t.nodeSize,{class:l.join(" "),"data-placeholder":"function"==typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:n}):e.options.placeholder});o.push(u)}return e.options.includeChildren})),Rr.create(n,o)}}})]}});const Qy=new Lt("suggestion");function Zy({pluginKey:e=Qy,editor:t,char:n="@",allowSpaces:i=!1,prefixSpace:r=!0,startOfLine:a=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:_=(()=>!0)}){const c=null==d?void 0:d();return new Mt({key:e,view(){return{update:async(e,n)=>{var i,r,a,o,s;const d=null===(i=this.key)||void 0===i?void 0:i.getState(n),_=null===(r=this.key)||void 0===r?void 0:r.getState(e.state),f=d.active&&_.active&&d.range.from!==_.range.from,g=!d.active&&_.active,h=d.active&&!_.active,p=g||f,m=!g&&!h&&d.query!==_.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:_,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={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:y,clientRect:y?()=>{var e;const{decorationId:n}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${n}"]`).getBoundingClientRect()}:null};F&&(null===(a=null==c?void 0:c.onExit)||void 0===a||a.call(c,E)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,E)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,E))}}},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:d}=l,c={...o};if(c.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:i,startOfLine:r,$position:a}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=r?"^":"",u=n?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=a.depth<=0?0:a.before(),_=a.pos,c=a.doc.textBetween(d,_,"\0","\0"),f=Array.from(c.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(i&&!h)return null;const p=f.index+a.start();let m=p+f[0].length;return n&&s.test(c.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<a.pos&&m>=a.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:n,allowSpaces:i,prefixSpace:r,startOfLine:a,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&_({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 n;const{active:i,range:r}=this.getState(e.state);return i&&(null===(n=null==c?void 0:c.onKeyDown)||void 0===n?void 0:n.call(c,{view:e,event:t,range:r}))||!1},decorations(e){const{active:t,range:n,decorationId:i}=this.getState(e);return t?Rr.create(e.doc,[Tr.inline(n.from,n.to,{nodeName:o,class:s,"data-decoration-id":i})]):null}}})}const Xy=new Lt("mention"),Jy=cs.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var n;return`${e.suggestion.char}${null!==(n=t.attrs.label)&&void 0!==n?n:t.attrs.id}`},suggestion:{char:"@",pluginKey:Xy,command:({editor:e,range:t,props:n})=>{var i;const r=e.view.state.selection.$to.nodeAfter;(null===(i=null==r?void 0:r.text)||void 0===i?void 0:i.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const n=e.state.doc.resolve(t.from),i=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},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",rs({"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 n=!1;const{selection:i}=t,{empty:r,anchor:a}=i;return!!r&&(t.doc.nodesBetween(a-1,a,(t,i)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",i,i+t.nodeSize),!1}),n)})}},addProseMirrorPlugins(){return[Zy({editor:this.editor,...this.options.suggestion})]}});function eE(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 n,i=cc()(e);if(t){var r=cc()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return dc()(this,n)}}var tE=function(e){lc()(n,e);var t=eE(n);function n(e){var i;return nc()(this,n),i=t.call(this,e),_()(oc()(i),"selectItem",(function(e){var t=i.props,n=t.items,r=t.command,a=n[e];a&&r({label:a.label,id:a.key})})),_()(oc()(i),"upHandler",(function(){var e=i.props.items;i.setState((function(t){return{selectedIndex:(t.selectedIndex+e.length-1)%e.length}}))})),_()(oc()(i),"downHandler",(function(){var e=i.props.items;i.setState((function(t){return{selectedIndex:(t.selectedIndex+1)%e.length}}))})),_()(oc()(i),"enterHandler",(function(){var e=i.state.selectedIndex;i.selectItem(e)})),_()(oc()(i),"onKeyDown",(function(e){var t=e.event,n={ArrowUp:i.upHandler,ArrowDown:i.downHandler,Enter:i.enterHandler};return!!n.hasOwnProperty(t.key)&&(n[t.key](),!0)})),i.state={selectedIndex:0},i.mentionRef=m.a.createRef(),i}return rc()(n,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),_b({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,n=this.props.items;return 0===n.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"},n.map((function(n,i){var r=n.label,a=n.imageUrl,o=n.showImage;return m.a.createElement("button",{className:b()("neeto-editor-mentions__item",{active:i===t}),key:r,onClick:function(){return e.selectItem(i)}},o&&m.a.createElement(Y_,{user:{name:r,imageUrl:a}}),m.a.createElement("p",null,r))})))}}]),n}(m.a.Component);function nE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function iE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nE(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var rE=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.showImage,i=void 0!==n&&n,r=e.map((function(e){var t;return"string"==typeof e?t={key:e,label:e}:"object"===Gy()(e)&&(t=iE({},e)),t.showImage=i,t}));return function(e){var t=e.query;return r.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())}))}},aE=["suggestion"];function oE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function sE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oE(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var lE={render:function(){var e,t;return{onStart:function(n){e=new xu(tE,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(n){var i;return"Escape"===n.event.key?(t[0].hide(),!0):null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(n)},onExit:function(){t[0].destroy(),e.destroy()}}}},uE=Jy.extend({addCommands:function(){var e=this;return{setMention:function(t){return function(n){(0,n.chain)().focus().insertContent([{type:e.name,attrs:{id:t,label:t}},{type:"text",text:" "}]).run()}}}}}),dE=function(e){var t=e.suggestion,n=void 0===t?{}:t,i=h()(e,aE);return uE.configure(sE(sE({},i),{},{suggestion:sE(sE({},lE),n)}))},_E=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["div",{class:"video-wrapper"},["iframe",rs(this.options.HTMLAttributes,t)]]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}}}}}),cE=n(98);function fE(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 n,i=cc()(e);if(t){var r=cc()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return dc()(this,n)}}var gE=function(e){lc()(n,e);var t=fE(n);function n(){var e;nc()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),_()(oc()(e),"state",{selectedIndex:0,emojiSuggestions:Hc.search(e.props.query||"smile").slice(0,5)}),_()(oc()(e),"onKeyDown",(function(t){var n=t.event;if("ArrowLeft"===n.key||"ArrowDown"===n.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===n.key||"ArrowUp"===n.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===n.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===n.key){var i;if(Object(cE.isEmpty)(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(i=Hc.search(e.props.query))||void 0===i?void 0:i[0]).run();return!0}return"Escape"===n.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),_()(oc()(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return rc()(n,[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:Hc.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,n){return m.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(n)},className:b()("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--highlight":n===e.state.selectedIndex})},t.native)})):m.a.createElement("p",null,"No results"))}}]),n}(m.a.Component);function hE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function pE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hE(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mE=new Lt("emoji-suggestion"),FE=cs.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:mE,items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu(gE,{props:n,editor:n.editor}),t=bu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.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[mb(pE({editor:this.editor},this.options.suggestion))]}});function bE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function yE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bE(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var EE=new Lt("emoji-picker"),vE=cs.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:EE,items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu($f,{props:n,editor:n.editor}),t=bu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown:function(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[mb(yE({editor:this.editor},this.options.suggestion))]}}),kE=function(e){return function(e){var t=e.handleSubmit;return ma.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 DE=function(e){var t,n,i,r,a,o,s=e.editor,l=e.limit,u=e.strategy;if("hidden"===u)return null;var d="limit"===u&&l;return m.a.createElement("p",{className:"neeto-editor-character-count"},d?"".concat(l-(null==s||null===(t=s.storage)||void 0===t||null===(n=t.characterCount)||void 0===n?void 0:n.characters())," characters remaining"):"".concat(null==s||null===(i=s.storage)||void 0===i||null===(r=i.characterCount)||void 0===r?void 0:r.characters()," characters, ").concat(null==s||null===(a=s.storage)||void 0===a||null===(o=a.characterCount)||void 0===o?void 0:o.words()," words"))},CE=["forceTitle","titleError","hideSlashCommands","addons","markdownMode","className","uploadEndpoint","value","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName","characterLimit","editorSecrets","rows","autoFocus","onSubmit","heightStrategy","characterCountStrategy"],wE=function(e,t){var n=e.forceTitle,i=void 0!==n&&n,r=e.titleError,a=void 0!==r&&r,o=e.hideSlashCommands,s=void 0!==o&&o,l=e.addons,d=void 0===l?[]:l,c=e.markdownMode,g=void 0!==c&&c,F=e.className,y=e.uploadEndpoint,E=e.value,v=void 0===E?"":E,k=e.onChange,D=void 0===k?function(){}:k,C=e.menuType,w=void 0===C?"fixed":C,S=e.variables,O=e.mentions,x=e.showImageInMention,T=void 0!==x&&x,N=e.placeholder,A=void 0===N?i?{title:"Untitled"}:null:N,M=e.extensions,R=e.contentClassName,I=e.characterLimit,L=e.editorSecrets,B=e.rows,P=void 0===B?6:B,j=e.autoFocus,q=void 0!==j&&j,U=e.onSubmit,z=e.heightStrategy,H=void 0===z?"fixed":z,W=e.characterCountStrategy,G=void 0===W?"hidden":W,Y=h()(e,CE),V=Object(p.useState)(!1),$=f()(V,2),K=$[0],Q=$[1],Z=!1;if(A){var X=Object.keys(A).length;Z="string"==typeof A||(1===X?!A.title:!!X)}var J="fixed"===w,ee="bubble"===w,te=!s,ne=!Z&&te,ie=d.includes("image-upload-unsplash"),re=d.map((function(e){return e.toLowerCase()}));ie&&re.push("image-upload");var ae=["font-color","font-size","bold","italic","underline","strike","link","bullet-list","ordered-list"].concat(re),oe=function(e){var t,n=e.forceTitle,i=e.placeholder,r=e.extensions,a=e.mentions,o=e.variables,s=e.isSlashCommandsActive,l=e.showImageInMention,u=e.setImageUploadVisible,d=e.options,_=e.characterLimit,c=e.onSubmit;return r?t=Dg()(r):(t=[rb,ib.extend({content:n?"title block*":"block+"}),xp.configure({document:!1,codeBlock:!1}),db,Zp,tb,em,Ly,ub,jh,_E,eb,nb,Ky.configure({placeholder:$y(i)}),FE,vE,XF.configure({limit:_}),kE({handleSubmit:c})],s&&t.push(Eb({setImageUploadVisible:u,options:d,mentions:a})),Hu()(a)||t.push(dE({suggestion:{items:rE(a.sort((function(e,t){var n="string"==typeof e?e:e.label,i="string"==typeof t?t:t.label;return n.localeCompare(i)})),{showImage:l})}})),Hu()(o)||t.push(Hy({suggestion:{items:function(){return o}}}))),t}({contentClassName:R,forceTitle:i,placeholder:A,extensions:M,mentions:O,variables:S,isSlashCommandsActive:te,showImageInMention:T,setImageUploadVisible:Q,options:ae,characterLimit:I,onSubmit:U}),se=b()("neeto-editor",_()({"slash-active":ne,"fixed-menu-active border":J,"bubble-menu-active":ee,"force-title":i,"force-title--error":a,"placeholder-active":Z},F,F)),le=21*P+26,ue="\n ".concat("flexible"===H?"min-height":"height",": ").concat(le,"px;\n "),de=Ou({extensions:oe,content:v,injectCSS:!1,editorProps:{attributes:{class:se,style:ue}},onUpdate:function(e){var t=e.editor;return D(t.getHTML())}});return Object(p.useEffect)((function(){q&&(null==de||de.commands.focus("end"))}),[de]),Object(p.useEffect)((function(){"string"==typeof v?null==de||de.commands.setContent(v):null==de||de.commands.setContent("")}),[v]),m.a.useImperativeHandle(t,(function(){return{editor:de}})),m.a.createElement("div",{className:"neeto-editor-wrapper"},J&&m.a.createElement(Zf,{editor:de,variables:S,setImageUploadVisible:Q,options:ae,mentions:O,showImageInMention:T}),ee&&m.a.createElement(Hd,{editor:de,options:ae}),m.a.createElement(Pg,{isVisible:K,setIsVisible:Q,editor:de,imageUploadUrl:y,isUnsplashImageUploadActive:ie,unsplashApiKey:null==L?void 0:L.unsplash}),g&&m.a.createElement(Eh,u()({editor:de,strategy:H,style:ue,className:se,onChange:D,onSubmit:U,initialValue:initialValue},Y)),m.a.createElement("div",{className:b()({"neeto-editor-content--hidden":g})},m.a.createElement(Lu,u()({editor:de},Y))),m.a.createElement(DE,{editor:de,limit:I,strategy:G}))},SE=m.a.forwardRef(wE),OE=n(99),xE=n.n(OE);var TE=["content","classNames"],NE=function(e){var t=e.content,n=void 0===t?"":t,i=e.classNames,r=h()(e,TE);return Object(p.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){xE.a.highlightElement(e)}))}),[n]),m.a.createElement("div",u()({className:b()("neeto-editor-content",_()({},i,i)),dangerouslySetInnerHTML:{__html:qg.a.sanitize(n)}},r))}}])}));
|