@bigbinary/neeto-editor 0.3.35 → 0.3.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/index.js +1 -1
  2. package/package.json +2 -2
package/build/index.js CHANGED
@@ -63,4 +63,4 @@ function lc(e,t){if(!e)throw new Error(t)}const uc=Object(p.createContext)(null)
63
63
  * LICENSE.md file in the root directory of this source tree.
64
64
  *
65
65
  * @license MIT
66
- */;function yc(){return(yc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e}).apply(this,arguments)}function Dc(e,t){if(null==e)return{};var i,a,n={},r=Object.keys(e);for(a=0;a<r.length;a++)i=r[a],t.indexOf(i)>=0||(n[i]=e[i]);return n}const vc=["onClick","reloadDocument","replace","state","target","to"],kc=["aria-current","caseSensitive","className","end","style","to"];const Sc=Object(p.forwardRef)((function(e,t){let{onClick:i,reloadDocument:a,replace:n=!1,state:r,target:o,to:s}=e,l=Dc(e,vc),u=cc(s),d=function(e,t){let{target:i,replace:a,state:n}=void 0===t?{}:t,r=hc(),o=fc(),s=pc(e);return Object(p.useCallback)(t=>{if(!(0!==t.button||i&&"_self"!==i||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t))){t.preventDefault();let i=!!a||oc(o)===oc(s);r(e,{replace:i,state:n})}},[o,r,s,a,n,i,e])}(s,{replace:n,state:r,target:o});return Object(p.createElement)("a",yc({},l,{href:u,onClick:function(e){i&&i(e),e.defaultPrevented||a||d(e)},ref:t,target:o}))}));const wc=Object(p.forwardRef)((function(e,t){let{"aria-current":i="page",caseSensitive:a=!1,className:n="",end:r=!1,style:o,to:s}=e,l=Dc(e,kc),u=fc(),d=pc(s),_=u.pathname,c=d.pathname;a||(_=_.toLowerCase(),c=c.toLowerCase());let g,f=_===c||!r&&_.startsWith(c)&&"/"===_.charAt(c.length),h=f?i:void 0;g="function"==typeof n?n({isActive:f}):[n,f?"active":null].filter(Boolean).join(" ");let m="function"==typeof o?o({isActive:f}):o;return Object(p.createElement)(Sc,yc({},l,{"aria-current":h,className:g,ref:t,style:m,to:s}))}));function Cc(e,t){if(null==e)return{};var i,a,n={},r=Object.keys(e);for(a=0;a<r.length;a++)i=r[a],t.indexOf(i)>=0||(n[i]=e[i]);return n}var xc="undefined"!=typeof window&&"undefined"!=typeof document;function Tc(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function Oc(){return xc&&document.createElement("div")}function Nc(e){var t=[];return e.forEach((function(e){t.find((function(t){return function e(t,i){if(t===i)return!0;if("object"==typeof t&&null!=t&&"object"==typeof i&&null!=i){if(Object.keys(t).length!==Object.keys(i).length)return!1;for(var a in t){if(!i.hasOwnProperty(a))return!1;if(!e(t[a],i[a]))return!1}return!0}return!1}(e,t)}))||t.push(e)})),t}function Ac(e,t){var i,a;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:Nc([].concat((null==(i=e.popperOptions)?void 0:i.modifiers)||[],(null==(a=t.popperOptions)?void 0:a.modifiers)||[]))})})}var Rc=xc?p.useLayoutEffect:p.useEffect;function Mc(e){var t=Object(p.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function Ic(e,t,i){i.split(/\s+/).forEach((function(i){i&&e.classList[t](i)}))}var Bc={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,i=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function a(){e.props.className&&!i()||Ic(t,"add",e.props.className)}return{onCreate:a,onBeforeUpdate:function(){i()&&Ic(t,"remove",e.props.className)},onAfterUpdate:a}}};function Lc(e){return function(t){var i=t.children,a=t.content,n=t.visible,r=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,Cc(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),g=void 0!==n,f=void 0!==r,h=Object(p.useState)(!1),F=h[0],b=h[1],E=Object(p.useState)({}),y=E[0],D=E[1],v=Object(p.useState)(),k=v[0],S=v[1],w=Mc((function(){return{container:Oc(),renders:1}})),C=Object.assign({ignoreAttributes:_},c,{content:w.container});g&&(C.trigger="manual",C.hideOnClick=!1),f&&(u=!0);var x=C,T=C.plugins||[];o&&(x=Object.assign({},C,{plugins:f&&null!=r.data?[].concat(T,[{fn:function(){return{onTrigger:function(e,t){var i=r.data.children.find((function(e){return e.instance.reference===t.currentTarget}));e.state.$$activeSingletonInstance=i.instance,S(i.content)}}}}]):T,render:function(){return{popper:w.container}}}));var O=[s].concat(i?[i.type]:[]);return Rc((function(){var t=s;s&&s.hasOwnProperty("current")&&(t=s.current);var i=e(t||w.ref||Oc(),Object.assign({},x,{plugins:[Bc].concat(C.plugins||[])}));return w.instance=i,u&&i.disable(),n&&i.show(),f&&r.hook({instance:i,content:a,props:x,setSingletonContent:S}),b(!0),function(){i.destroy(),null==r||r.cleanup(i)}}),O),Rc((function(){var e;if(1!==w.renders){var t=w.instance;t.setProps(Ac(t.props,x)),null==(e=t.popperInstance)||e.forceUpdate(),u?t.disable():t.enable(),g&&(n?t.show():t.hide()),f&&r.hook({instance:t,content:a,props:x,setSingletonContent:S})}else w.renders++})),Rc((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,i=e.state,a=null==(t=i.modifiersData)?void 0:t.hide;y.placement===i.placement&&y.referenceHidden===(null==a?void 0:a.isReferenceHidden)&&y.escaped===(null==a?void 0:a.hasPopperEscaped)||D({placement:i.placement,referenceHidden:null==a?void 0:a.isReferenceHidden,escaped:null==a?void 0:a.hasPopperEscaped}),i.attributes.popper={}}}])})})}}),[y.placement,y.referenceHidden,y.escaped].concat(O)),m.a.createElement(m.a.Fragment,null,i?Object(p.cloneElement)(i,{ref:function(e){w.ref=e,Tc(i.ref,e)}}):null,F&&Object(ku.createPortal)(o?o(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(y),k,w.instance):a,w.container))}}var Pc=function(e,t){return Object(p.forwardRef)((function(i,a){var n=i.children,r=Cc(i,["children"]);return m.a.createElement(e,Object.assign({},t,r),n?Object(p.cloneElement)(n,{ref:function(e){Tc(a,e),Tc(n.ref,e)}}):null)}))},jc=Pc(Lc(bu)),qc=["content","children","theme","disabled","placement","position","interactive","delay"],Uc=function(e){var t=e.content,i=e.children,a=e.theme,n=void 0===a?"dark":a,r=e.disabled,o=void 0!==r&&r,s=e.placement,l=e.position,d=void 0===l?"auto":l,_=e.interactive,c=void 0!==_&&_,g=e.delay,f=void 0===g?0:g,p=h()(e,qc);return m.a.createElement(jc,u()({role:"tooltip",theme:n,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,delay:f},p),i)},zc=["icon","iconPosition","iconSize","label","loading","onClick","to","type","style","fullWidth","className","disabled","size","href","tooltipProps"],Gc=function(){},Hc="primary",Yc="secondary",Wc="danger",Vc="text",$c="link",Kc="large",Qc="left",Zc=Object(p.forwardRef)((function(e,t){var i,a,n=e.icon,r=void 0===n?null:n,o=e.iconPosition,s=void 0===o?"right":o,l=e.iconSize,d=void 0===l?16:l,_=e.label,c=void 0===_?"":_,g=e.loading,f=void 0!==g&&g,p=e.onClick,F=void 0===p?Gc:p,E=e.to,y=void 0===E?null:E,D=e.type,v=void 0===D?"button":D,k=e.style,S=void 0===k?"primary":k,w=e.fullWidth,C=void 0!==w&&w,x=e.className,T=void 0===x?"":x,O=e.disabled,N=void 0!==O&&O,A=e.size,R=void 0===A?null:A,M=e.href,I=void 0===M?null:M,B=e.tooltipProps,L=void 0===B?null:B,P=h()(e,zc);y?(i=Sc,a={to:y}):I?(i="a",a={href:I}):(i="button",a={type:v});var j="string"==typeof r?function(){return m.a.createElement("i",{className:b()("ne-btn__icon",[r])})}:r||m.a.Fragment;return m.a.createElement(Uc,u()({},L,{disabled:!L}),m.a.createElement(i,u()({ref:t,onClick:function(e){f||N||F(e)},className:b()("ne-btn",[T],{"ne-btn--style-primary":S===Hc,"ne-btn--style-secondary":S===Yc,"ne-btn--style-danger":S===Wc,"ne-btn--style-text":S===Vc,"ne-btn--style-link":S===$c,"ne-btn--size-large":R===Kc,"ne-btn--width-full":C,"ne-btn--icon-left":s==Qc,"ne-btn--icon-only":!c,disabled:N}),disabled:N},a,P),c&&m.a.createElement("span",null,c),r?m.a.createElement(j,{key:"2",size:d,className:"ne-btn__icon"}):null))}));Zc.displayName="Button";var Xc=Zc,Jc=function(e){var t=e.children,i=e.className,a=void 0===i?"root-portal":i,n=e.el,r=void 0===n?"div":n,o=document.getElementsByClassName(a)[0];return o||(o=document.createElement(r)).classList.add(a),m.a.useEffect((function(){document.body.appendChild(o)}),[]),Su.a.createPortal(t,o)},eg=["children","className"],tg=function(e){var t=e.children,i=e.className,a=h()(e,eg);return m.a.createElement("div",u()({className:b()("ne-backdrop",_()({},i,i))},a),t)},ig=function(e,t){Object(p.useEffect)((function(){var i=function(i){e.current&&!e.current.contains(i.target)&&t(i)};return document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),function(){document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}}),[e,t])},ag=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"],ng=function(){},rg="xs",og="sm",sg="md",lg=function(e){var t=e.size,i=void 0===t?"sm":t,a=e.isOpen,n=void 0!==a&&a,r=e.onClose,o=void 0===r?ng:r,s=e.loading,l=void 0!==s&&s,d=e.children,c=e.className,g=void 0===c?"":c,f=e.closeOnEsc,F=void 0===f||f,E=e.closeButton,y=void 0===E||E,D=e.backdropClassName,v=void 0===D?"":D,k=e.closeOnOutsideClick,S=void 0===k||k,w=h()(e,ag),C=Object(p.useRef)();return S&&ig(C,o),F&&zd("esc",o),m.a.createElement(Jc,{className:"ne-portal"},n&&m.a.createElement(tg,{key:"modal-backdrop",className:b()("ne-modal__backdrop",v)},m.a.createElement("div",u()({ref:C,key:"modal-wrapper",className:b()("ne-modal__wrapper",_()({"ne-modal__wrapper--xs":i===rg,"ne-modal__wrapper--sm":i===og,"ne-modal__wrapper--md":i===sg},g,g))},w),y&&m.a.createElement(Xc,{style:"text",icon:ac,className:"ne-modal__close",onClick:o}),l?m.a.createElement(m.a.Fragment,null):d)))},ug=["size","color","strokeWidth"];function dg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,ug);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M11.009 11.249H12.159V15.499",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M11 15.4986H13.3093",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M12.1 8.24587C12.1 8.29532 12.0853 8.34365 12.0579 8.38477C12.0304 8.42588 11.9914 8.45792 11.9457 8.47684C11.9 8.49576 11.8497 8.50071 11.8012 8.49107C11.7527 8.48142 11.7082 8.45761 11.6732 8.42265C11.6383 8.38769 11.6145 8.34314 11.6048 8.29464C11.5952 8.24615 11.6001 8.19588 11.619 8.1502C11.638 8.10452 11.67 8.06548 11.7111 8.03801C11.7522 8.01053 11.8006 7.99587 11.85 7.99587",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M11.85 7.99587C11.9163 7.99587 11.9799 8.02221 12.0268 8.0691C12.0737 8.11598 12.1 8.17957 12.1 8.24587",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M16 2.99862H8C5.23858 2.99862 3 5.2372 3 7.99862V15.9986C3 18.76 5.23858 20.9986 8 20.9986H16C18.7614 20.9986 21 18.76 21 15.9986V7.99862C21 5.2372 18.7614 2.99862 16 2.99862Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}dg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},dg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var _g=["children","className","required","helpIconProps"],cg=["onClick","icon","tooltipProps","className"],gg=function(e){var t=e.children,i=e.className,a=void 0===i?"":i,n=e.required,r=void 0!==n&&n,o=e.helpIconProps,s=void 0===o?null:o,l=h()(e,_g),d=s||{},c=d.onClick,g=d.icon,f=d.tooltipProps,p=d.className,F=h()(d,cg),E=g||dg;return m.a.createElement("label",u()({className:b()("ne-label flex items-center",a)},l),t,r&&m.a.createElement("span",{"aria-hidden":!0},"*"),s&&m.a.createElement(Uc,u()({},f,{disabled:!f}),m.a.createElement("span",{className:b()("ml-1",_()({},p,p)),onClick:c},m.a.createElement(E,u()({size:16},F)))))},fg=["id","size","type","label","error","suffix","prefix","disabled","helpText","className","nakedInput","contentSize","required"],hg=Object(p.forwardRef)((function(e,t){var i=e.id,a=e.size,n=void 0===a?"small":a,r=e.type,o=void 0===r?"text":r,s=e.label,l=e.error,d=void 0===l?null:l,_=e.suffix,c=void 0===_?null:_,g=e.prefix,f=void 0===g?null:g,p=e.disabled,F=void 0!==p&&p,E=e.helpText,y=void 0===E?"":E,D=e.className,v=void 0===D?"":D,k=e.nakedInput,S=void 0!==k&&k,w=e.contentSize,C=void 0===w?null:w,x=e.required,T=void 0!==x&&x,O=h()(e,fg);return m.a.createElement("div",{className:b()(["ne-input__wrapper",v])},s&&m.a.createElement(gg,{required:T,"data-cy":"neeto-editor-".concat(cd(s),"-input-label"),htmlFor:i},s),m.a.createElement("div",{className:b()("ne-input",{"ne-input--naked":!!S,"ne-input--error":!!d,"ne-input--disabled":!!F,"ne-input--small":"small"===n})},f&&m.a.createElement("div",{className:"ne-input__prefix"},f),m.a.createElement("input",u()({ref:t,type:o,disabled:F,size:C,required:T,"aria-invalid":!!d,"data-cy":"".concat(cd(s),"-input-field")},O)),c&&m.a.createElement("div",{className:"ne-input__suffix"},c)),!!d&&m.a.createElement("p",{"data-cy":"".concat(cd(s),"-input-error"),className:"ne-input__error"},d),y&&m.a.createElement("p",{className:"ne-input__help-text"},y))}));hg.displayName="Input";var pg=hg,mg=function(e){var t=e.url,i=e.editor,a=e.onClose,n=e.alt,r=Object(p.useState)(n||""),o=g()(r,2),s=o[0],l=o[1],u=function(){i.chain().focus().setImage({src:t,alt:s}).run(),a()};return m.a.createElement("div",{className:"neeto-editor-image-editor",onKeyDown:function(e){"Enter"===e.key&&u()}},m.a.createElement("img",{src:t}),m.a.createElement(pg,{value:s,onChange:function(e){return l(e.target.value)},placeholder:"Brand Image",label:"Alt Text"}),m.a.createElement("div",{className:"neeto-editor-image-editor__footer"},m.a.createElement(Xc,{label:"Save Changes",onClick:u}),m.a.createElement(Xc,{label:"Cancel",style:"text",onClick:a})))},Fg=function(e){var t=e.editor,i=e.isOpen,a=e.onClose,n=t&&t.view.state.selection.node;return m.a.createElement(lg,{isOpen:i,onClose:a},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},m.a.createElement(mg,{editor:t,onClose:a,url:null==n?void 0:n.attrs.src,alt:null==n?void 0:n.attrs.alt}))))},bg=["size","color","strokeWidth"];function Eg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,bg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M7 6H12.875C13.6706 6 14.4337 6.31607 14.9963 6.87868C15.5589 7.44129 15.875 8.20435 15.875 9V9C15.875 9.79565 15.5589 10.5587 14.9963 11.1213C14.4337 11.6839 13.6706 12 12.875 12H7V6ZM7 12H14C14.7956 12 15.5587 12.3161 16.1213 12.8787C16.6839 13.4413 17 14.2044 17 15V15C17 15.7956 16.6839 16.5587 16.1213 17.1213C15.5587 17.6839 14.7956 18 14 18H7V12Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Eg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Eg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var yg=["size","color","strokeWidth"];function Dg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,yg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M10 6H17M13.5 6L10.5 18L13.5 6ZM14 18H7H14Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Dg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Dg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var vg=["size","color","strokeWidth"];function kg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,vg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M15 5V11.6667C15 12.5507 14.6313 13.3986 13.9749 14.0237C13.3185 14.6488 12.4283 15 11.5 15V15",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M8 5V11.6667C8 12.5507 8.36875 13.3986 9.02513 14.0237C9.6815 14.6488 10.5717 15 11.5 15V15",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M19 18.5H5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}kg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},kg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Sg=["size","color","strokeWidth"];function wg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Sg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M8 18H14C14.7956 18 15.5587 17.6839 16.1213 17.1213C16.6839 16.5587 17 15.7956 17 15V15",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M19 12H5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M16 6H11C10.2044 6 9.44129 6.31607 8.87868 6.87868C8.31607 7.44129 8 8.20435 8 9",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}wg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},wg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Cg=["size","color","strokeWidth"];function xg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Cg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M17.7166 12.3594L19.4466 10.6294C21.1392 8.9873 21.1801 6.284 19.538 4.59141C17.8959 2.89882 15.1926 2.85789 13.5 4.5C13.4691 4.53001 13.4386 4.56048 13.4086 4.59141L10.0109 7.951C8.34355 9.61717 8.3426 12.3195 10.0088 13.9869L10.0109 13.989L9.9999 14C10.3445 14.3381 10.7447 14.6144 11.1829 14.817",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M12.806 9.193C13.2443 9.39593 13.6445 9.67262 13.989 10.011C15.6564 11.6772 15.6573 14.3795 13.9912 16.0469L13.989 16.049L10.8082 19.268C9.11565 20.9101 6.41235 20.8692 4.77024 19.1766C3.16318 17.5201 3.16318 14.8865 4.77024 13.23L6.50024 11.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}xg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},xg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Tg=["size","color","strokeWidth"];function Og(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Tg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M13.78 4L10.22 20M18 8L22 12L18 16M6 16L2 12L6 8",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Og.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Og.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Ng=["size","color","strokeWidth"];function Ag(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Ng);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M10.523 20H6V15.477C6 15.0134 6.18428 14.5684 6.51226 14.2407L17.5294 4.00237C18.211 3.31947 19.3171 3.31841 20 4L20.0024 4.00237L21.5 5.527C22.1829 6.20859 22.184 7.31473 21.5024 7.99763L21.5 8L11.759 19.488C11.431 19.8156 10.9865 19.9997 10.523 20Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M2 20H3",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M9 12L13.5 16.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Ag.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Ag.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Rg=["size","color","strokeWidth"];function Mg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Rg);return C_.createElement("svg",Gd({viewBox:"0 0 18 19",fill:"none",height:t,width:t},n),C_.createElement("g",{clipPath:"url(#clip0_1047_4040)"},C_.createElement("rect",{x:"4.5",y:"11.333",width:"11.5714",height:"3.85714",rx:"1",fill:i}),C_.createElement("mask",{id:"path-2-inside-1_1047_4040",fill:i},C_.createElement("rect",{x:"4.5",y:"6.19043",width:"9",height:"3.85714",rx:"1"})),C_.createElement("rect",{x:"4.5",y:"6.19043",width:"9",height:"3.85714",rx:"1",stroke:i,mask:"url(#path-2-inside-1_1047_4040)",strokeWidth:"3"}),C_.createElement("line",{x1:"2.25",y1:"2.97607",x2:"2.25",y2:"17.1189",stroke:i,strokeWidth:a})),C_.createElement("defs",null,C_.createElement("clipPath",{id:"clip0_1047_4040"},C_.createElement("rect",{width:"18",height:"18",fill:i,transform:"translate(0 0.619141)"}))))}Mg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Mg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Ig=["size","color","strokeWidth"];function Bg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Ig);return C_.createElement("svg",Gd({viewBox:"0 0 18 19",fill:"none",height:t,width:t},n),C_.createElement("g",{clipPath:"url(#clip0_1047_4338)"},C_.createElement("rect",{x:"3",y:"11.3335",width:"11.5714",height:"3.85714",rx:"1",fill:i}),C_.createElement("mask",{id:"path-2-inside-1_1047_4338",fill:i},C_.createElement("rect",{x:"4.5",y:"6.19043",width:"9",height:"3.85714",rx:"1"})),C_.createElement("rect",{x:"4.5",y:"6.19043",width:"9",height:"3.85714",rx:"1",stroke:i,mask:"url(#path-2-inside-1_1047_4338)",strokeWidth:"3"}),C_.createElement("line",{x1:"9",y1:"9.61914",x2:"9",y2:"17.1191",stroke:i,strokeWidth:a}),C_.createElement("line",{x1:"9",y1:"2.86914",x2:"9",y2:"6.61914",stroke:i,strokeWidth:a})),C_.createElement("defs",null,C_.createElement("clipPath",{id:"clip0_1047_4338"},C_.createElement("rect",{width:"18",height:"18",fill:i,transform:"translate(0 0.619141)"}))))}Bg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Bg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Lg=["size","color","strokeWidth"];function Pg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Lg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M18 3H6C4.34315 3 3 3.97683 3 5.18182V12.8182C3 14.0232 4.34315 15 6 15H18C19.6569 15 21 14.0232 21 12.8182V5.18182C21 3.97683 19.6569 3 18 3Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("line",{x1:"3",y1:"11.25",x2:"21",y2:"11.25",stroke:i,strokeWidth:a}),C_.createElement("line",{x1:"8.75",y1:"19.25",x2:"15.25",y2:"19.25",stroke:i,strokeWidth:a,strokeLinecap:"round"}))}Pg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Pg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var jg=["size","color","strokeWidth"];function qg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,jg);return C_.createElement("svg",Gd({viewBox:"0 0 18 19",fill:"none",height:t,width:t},n),C_.createElement("g",{clipPath:"url(#clip0_1047_4017)"},C_.createElement("rect",{x:"1.5",y:"11.333",width:"11.5714",height:"3.85714",rx:"1",fill:i}),C_.createElement("mask",{id:"path-2-inside-1_1047_4017",fill:i},C_.createElement("rect",{x:"4.07129",y:"6.19043",width:"9",height:"3.85714",rx:"1"})),C_.createElement("rect",{x:"4.07129",y:"6.19043",width:"9",height:"3.85714",rx:"1",stroke:i,mask:"url(#path-2-inside-1_1047_4017)",strokeWidth:"3"}),C_.createElement("line",{x1:"15.75",y1:"2.97607",x2:"15.75",y2:"17.1189",stroke:i,strokeWidth:a})),C_.createElement("defs",null,C_.createElement("clipPath",{id:"clip0_1047_4017"},C_.createElement("rect",{width:"18",height:"18",fill:i,transform:"translate(0 0.619141)"}))))}qg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},qg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Ug=["size","color","strokeWidth"];function zg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Ug);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M18 10L15 7",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M6 20H15",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M16.0174 5.68275L9.87375 11.8262C9.53712 12.1628 9.31876 12.5996 9.25146 13.0708L9.01095 14.7549C8.98726 14.9208 9.00212 15.09 9.05437 15.2492C9.10662 15.4085 9.19487 15.5535 9.31225 15.6731C9.42964 15.7928 9.57301 15.8837 9.73124 15.939C9.88948 15.9943 10.0583 16.0123 10.2247 15.9918L11.8503 15.791C12.3369 15.7309 12.7894 15.5101 13.1362 15.1634L19.3163 8.98528C19.533 8.76863 19.705 8.51141 19.8223 8.22831C19.9396 7.94521 20 7.64178 20 7.33534C20 7.0289 19.9397 6.72546 19.8224 6.44235C19.7052 6.15923 19.5333 5.90198 19.3166 5.6853L19.314 5.68275C19.0976 5.46629 18.8406 5.29459 18.5578 5.17744C18.2749 5.06029 17.9718 5 17.6657 5C17.3596 5 17.0564 5.06029 16.7736 5.17744C16.4908 5.29459 16.2338 5.46629 16.0174 5.68275Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}zg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},zg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Gg=function(e){var t=e.editor,i=e.isImageEditorModalOpen,a=e.setIsImageEditorModalOpen;return[{Icon:Mg,command:function(){return t.chain().focus().setImageAttributes({size:"small",float:"left",align:"none"}).run()},active:t.isActive("image",{size:"small",float:"left",align:"none"}),optionName:"Float Left"},{Icon:Bg,command:function(){return t.chain().focus().setImageAttributes({size:"small",float:"none",align:"center"}).run()},active:t.isActive("image",{size:"small",float:"none",align:"center"}),optionName:"Align Center"},{Icon:Pg,command:function(){return t.chain().focus().setImageAttributes({size:"large",float:"none",align:"center"}).run()},active:t.isActive("image",{size:"large",float:"none",align:"center"}),optionName:"Banner"},{Icon:qg,command:function(){return t.chain().focus().setImageAttributes({size:"small",float:"right",align:"none"}).run()},active:t.isActive("image",{size:"small",float:"right",align:"center"}),optionName:"Float Right"},{Icon:zg,command:function(){return a(!0)},active:i,optionName:"Alt Text"}]},Hg=function(e){var t=e.Icon,i=e.command,a=e.active,n=e.optionName;return m.a.createElement(Uc,{content:_d(n),position:"top",delay:[500]},m.a.createElement("div",{className:b()("neeto-editor-bubble-menu__item",{active:a}),onClick:i,"data-cy":"neeto-editor-bubble-menu-".concat(n,"-option")},m.a.createElement(t,{size:20})))},Yg=function(e){var t=e.editor,i=e.isImageEditorModalOpen,a=e.setIsImageEditorModalOpen;return Gg({editor:t,isImageEditorModalOpen:i,setIsImageEditorModalOpen:a}).map((function(e){return m.a.createElement(Hg,u()({key:e.optionName},e))}))},Wg=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,Vg=/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,$g=/((?:http|https):\/\/)?(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|(?:manage\/)?videos?\/|)(\d+)(?:(?:\/|\?h=)(\w+))?(?:|\/\?)/,Kg=function(e){var t=e.editor,i=e.handleClose,a=e.handleAnimateInvalidLink,n=Object(p.useState)(""),r=g()(n,2),o=r[0],s=r[1];Object(p.useEffect)((function(){s(t.getAttributes("link").href||"")}),[]);var l=function(){Wg.test(o)?(t.chain().focus().setLink({href:o}).run(),i()):fd(o)?(t.chain().focus().unsetLink().run(),i()):(s(""),a())};return m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?i():"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","data-cy":"neeto-editor-link-input"}),m.a.createElement(Xc,{style:"icon",icon:ac,onClick:function(){o?(s(""),t.chain().focus().unsetLink().run()):i()},"data-cy":"neeto-editor-link-submit-button"}))},Qg=function(e){var t=e.editor,i=e.options,a=e.setIsInvalidLink,n=e.isLinkOptionActive,r=e.setIsLinkOptionActive;return n?m.a.createElement(Kg,{editor:t,handleClose:function(){return r(!1)},handleAnimateInvalidLink:function(){a(!0),setTimeout((function(){a(!1)}),1e3)}}):function(e){var t=e.editor,i=e.setIsLinkOptionActive;return[{Icon:Eg,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Dg,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:kg,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:wg,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:xg,command:function(){return i(!0)},active:t.isActive("link"),optionName:"link"},{Icon:Og,command:function(){return t.chain().focus().toggleCode().run()},active:t.isActive("code"),optionName:"code-block"},{Icon:Ag,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}]}({editor:t,setIsLinkOptionActive:r}).filter((function(e){var t=e.optionName;return i.includes(t)})).map((function(e){return m.a.createElement(Hg,u()({},e,{key:e.optionName}))}))};function Zg(e){var t=e.editor,i=e.options,a=Object(p.useState)(!1),n=g()(a,2),r=n[0],o=n[1],s=Object(p.useState)(!1),l=g()(s,2),u=l[0],d=l[1],_=Object(p.useState)(!1),c=g()(_,2),f=c[0],h=c[1],F=t&&t.view.state.selection.node,E=F&&"image"===F.type.name;return t?m.a.createElement("div",null,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>',zIndex:99999,onHide:function(){return d(!1)}},className:b()("neeto-editor-bubble-menu",{"neeto-editor-bubble-menu-animate-shake":r})},E?m.a.createElement(Yg,{editor:t,isImageEditorModalOpen:f,setIsImageEditorModalOpen:h}):m.a.createElement(Qg,{editor:t,options:i,setIsInvalidLink:o,isLinkOptionActive:u,setIsLinkOptionActive:d})),m.a.createElement(Fg,{editor:t,isOpen:f,onClose:function(){return h(!1)}})):null}var Xg=["size","color","strokeWidth"];function Jg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Xg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M14 13.5H19C19.552 13.5 20 13.948 20 14.5V18.5C20 19.052 19.552 19.5 19 19.5H15C14.448 19.5 14 19.052 14 18.5V13.5ZM14 13.5C14 7.5 15 6.5 18 4.5M4 13.5H9C9.552 13.5 10 13.948 10 14.5V18.5C10 19.052 9.552 19.5 9 19.5H5C4.448 19.5 4 19.052 4 18.5V13.5ZM4 13.5C4 7.5 5 6.5 8 4.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Jg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Jg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var ef=["size","color","strokeWidth"];function tf(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,ef);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("g",{clipPath:"url(#clip0)"},C_.createElement("path",{d:"M21 16.014L16.707 11.721C16.316 11.33 15.683 11.33 15.293 11.721L11 16.014",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M18 21.014H6C4.343 21.014 3 19.671 3 18.014V6.014C3 4.357 4.343 3.014 6 3.014H18C19.657 3.014 21 4.357 21 6.014V18.014C21 19.671 19.657 21.014 18 21.014Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M15.9998 21.014L9.7068 14.721C9.3158 14.33 8.6828 14.33 8.2928 14.721L3.4458 19.568M9.26497 8.74883C9.41142 8.89527 9.41142 9.13271 9.26497 9.27916C9.11852 9.4256 8.88109 9.4256 8.73464 9.27916C8.58819 9.13271 8.58819 8.89527 8.73464 8.74883C8.88109 8.60238 9.11852 8.60238 9.26497 8.74883Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"})),C_.createElement("defs",null,C_.createElement("clipPath",{id:"clip0"},C_.createElement("rect",{width:"24",height:"24",fill:i}))))}tf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},tf.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var af=["size","color","strokeWidth"];function nf(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,af);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M12 5H20",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M6 7C7.10457 7 8 6.10457 8 5C8 3.89543 7.10457 3 6 3C4.89543 3 4 3.89543 4 5C4 6.10457 4.89543 7 6 7Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M12 19H20M12 12H20H12Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M6 14C7.10457 14 8 13.1046 8 12C8 10.8954 7.10457 10 6 10C4.89543 10 4 10.8954 4 12C4 13.1046 4.89543 14 6 14Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M6 21C7.10457 21 8 20.1046 8 19C8 17.8954 7.10457 17 6 17C4.89543 17 4 17.8954 4 19C4 20.1046 4.89543 21 6 21Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}nf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},nf.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var rf=["size","color","strokeWidth"];function of(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,rf);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M11 4H20M11.15 9H20M5.25 9V4L4 5.25M11 14H20M11.15 19H20M4 15C4 14.7348 4.10536 14.4804 4.29289 14.2929C4.48043 14.1054 4.73478 14 5 14H5.61448C5.87234 14 6.12365 14.0811 6.33284 14.2319C6.54202 14.3827 6.69846 14.5955 6.78 14.8401C6.84709 15.0414 6.86091 15.2566 6.82013 15.4648C6.77935 15.673 6.68534 15.8671 6.54727 16.0282L4 19H7M4 9H6.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}of.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},of.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var sf=i(1),lf=i.n(sf),uf=["icon","iconActive","tooltipProps"],df=function(e){var t=e.icon,i=e.iconActive,a=void 0===i||i,n=e.tooltipProps,r=h()(e,uf);return m.a.createElement(Uc,n,m.a.createElement("button",u()({className:"neeto-editor-fixed-menu__item",type:"button"},r),m.a.createElement(t,{color:a?"#2F3941":"#87929D",size:20})))};df.propTypes={icon:lf.a.oneOfType([lf.a.element,lf.a.func]),iconActive:lf.a.bool,onClick:lf.a.func,tooltipProps:lf.a.object};var _f=df,cf=["size","color","underlineColor"];function gf(e){var t=e.size,i=e.color,a=e.underlineColor,n=h()(e,cf);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),m.a.createElement("path",{d:"M21 20H3",stroke:a||i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M17.3125 15L12.1562 4L7 15M8.03125 12.8H16.2812",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}gf.defaultProps={color:"currentColor",size:24},gf.propTypes={color:lf.a.string,size:lf.a.oneOfType([lf.a.string,lf.a.number])};var ff=["size","color","bgColor"];function hf(e){var t=e.size,i=e.color,a=e.bgColor,n=h()(e,ff);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),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:a,stroke:a,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M10 8V16",stroke:i,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M14 8V16",stroke:i,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 14H16",stroke:i,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 10H16",stroke:i,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}))}hf.defaultProps={color:"white",bgColor:"#68737D",size:24},hf.propTypes={color:lf.a.string,bgColor:lf.a.string,size:lf.a.oneOfType([lf.a.string,lf.a.number])};var pf=function(e){var t=e.color,i=void 0===t?"#000":t,a=e.onChange,n=Object(p.useRef)();return m.a.createElement(_f,{icon:function(e){var t=e.color,r=e.size;return m.a.createElement(m.a.Fragment,null,m.a.createElement(gf,{size:r,color:t,underlineColor:i}),m.a.createElement("input",{ref:n,type:"color",onChange:function(e){return a&&a(e.target.value)}}))},iconActive:!1,onClick:function(){var e;return null===(e=n.current)||void 0===e?void 0:e.click()},tooltipProps:{content:"Text Color",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-text-color-option"})},mf=["size","color","strokeWidth"];function Ff(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,mf);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M13.3125 17L8.15625 6L3 17M4.03125 14.8H12.2812",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M21 17L18.5006 12L16 17M16.4996 16.1667H20.4992",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Ff.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Ff.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var bf=i(89),Ef=i.n(bf),yf=function(e){return e.reduce((function(e,t){var i=t[0],a=t[1];return e[i]=a,e}),{})},Df="undefined"!=typeof window&&window.document&&window.document.createElement?p.useLayoutEffect:p.useEffect,vf=[],kf=["size","color","strokeWidth"];function Sf(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,kf);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M6 9L12 15L18 9",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Sf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Sf.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var wf=["icon","label","isOpen","onVisible","onClose","ulProps","position","children","className","buttonStyle","buttonProps","customTarget","disabled","closeOnEsc","closeOnSelect","closeOnOutsideClick","dropdownModifiers"];function Cf(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function xf(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Cf(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Cf(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Tf=function(){},Of=Object(p.forwardRef)((function(e,t){e.icon;var i=e.label,a=e.isOpen,n=e.onVisible,r=void 0===n?Tf:n,o=e.onClose,s=void 0===o?Tf:o,l=e.ulProps,d=e.position,c=e.children,f=e.className,F=(e.buttonStyle,e.buttonProps),E=e.customTarget,y=(e.disabled,e.closeOnEsc),D=void 0===y||y,v=e.closeOnSelect,k=void 0===v||v,S=e.closeOnOutsideClick,w=void 0===S||S,C=e.dropdownModifiers,x=void 0===C?[]:C,T=h()(e,wf),O=Object(p.useRef)(),N=E(),A=!(null==a),R=Object(p.useState)(!1),M=g()(R,2),I=M[0],B=M[1],L=Object(p.useState)(null),P=g()(L,2),j=P[0],q=P[1],U=Object(p.useState)(null),z=g()(U,2),G=z[0],H=z[1],Y=function(e,t,i){void 0===i&&(i={});var a=p.useRef(null),n={onFirstUpdate:i.onFirstUpdate,placement:i.placement||"bottom",strategy:i.strategy||"absolute",modifiers:i.modifiers||vf},r=p.useState({styles:{popper:{position:n.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=r[0],s=r[1],l=p.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,i=Object.keys(t.elements);s({styles:yf(i.map((function(e){return[e,t.styles[e]||{}]}))),attributes:yf(i.map((function(e){return[e,t.attributes[e]]})))})},requires:["computeStyles"]}}),[]),u=p.useMemo((function(){var e={onFirstUpdate:n.onFirstUpdate,placement:n.placement,strategy:n.strategy,modifiers:[].concat(n.modifiers,[l,{name:"applyStyles",enabled:!1}])};return Ef()(a.current,e)?a.current||e:(a.current=e,e)}),[n.onFirstUpdate,n.placement,n.strategy,n.modifiers,l]),d=p.useRef();return Df((function(){d.current&&d.current.setOptions(u)}),[u]),Df((function(){if(null!=e&&null!=t){var a=(i.createPopper||wl)(e,t,u);return d.current=a,function(){a.destroy(),d.current=null}}}),[e,t,i.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}}(j,G,{placement:d||"bottom-end",modifiers:x}),W=Y.styles,V=Y.attributes;Object(p.useImperativeHandle)(t,(function(){return{close:function(){return B(!1)},visible:I}}));var $=function(){A||B(!1),s()},K=function(){!A&&B(!I)};return D&&zd("esc",$),w&&ig(O,$),A||(F=xf(xf({},F),{},{onClick:function(){K()}})),Object(p.useEffect)((function(){A&&B(a)}),[a]),Object(p.useEffect)((function(){I&&r()}),[I]),m.a.createElement("div",u()({ref:O,className:b()("ne-dropdown__wrapper",_()({},f,f))},T),E?m.a.createElement("div",{ref:q,onClick:K},N):m.a.createElement("div",null,i,m.a.createElement(Sf,null)),I&&m.a.createElement("ul",u()({className:"ne-dropdown__popup",ref:H,onClick:function(){k&&$()},"data-cy":"neeto-editor-".concat(cd(i),"-dropdown-container")},l,{style:xf(xf({display:"block"},W.offset),W.popper)},V.popper),c))})),Nf=function(e){var t=e.editor;return m.a.createElement(Of,{customTarget:function(){return m.a.createElement(_f,{icon:Ff,iconActive:t.isActive("heading"),tooltipProps:{content:"Font Size",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-font-size-option"})},className:"neeto-editor-font-size-wrapper",placement:"bottom"},[{label:"H1",value:1},{label:"H2",value:2},{label:"H3",value:3}].map((function(e){var i,a=e.label,n=e.value;return m.a.createElement("li",{onClick:function(){return e=n,t.chain().focus().toggleHeading({level:e}).run();var e},key:n,className:b()({active:(i=n,t.isActive("heading",{level:i}))}),"data-cy":"neeto-editor-fixed-menu-font-size-option-".concat(a)},a)})))};function Af(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Rf(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Af(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Af(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Mf=function(e){var t=e.onClickVariable,i=e.variables,a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=[];return e.forEach((function(e){var a=e.category_key,n=e.category_label,r=e.variables;if(a&&r){var o=r.map((function(e){return Rf(Rf({},e),{},{category_key:a})}));i.push({label:n,variables:o})}else t.push(e)})),t.length&&i.push({label:i.length?"Others":null,variables:t}),i}(i);return i&&i.length?m.a.createElement("div",{className:"neeto-editor-variables-list"},a.map((function(e,i){var a=e.label,n=e.variables;return m.a.createElement(If,{key:i,index:i,title:a,variables:n,onClickItem:t})}))):null},If=function(e){var t=e.index,i=e.title,a=e.variables,n=e.onClickItem;return m.a.createElement("div",{className:"neeto-editor-variables-block","data-cy":"neeto-editor-variable-option-category-".concat(t)},i&&m.a.createElement("h6",null,i),m.a.createElement("div",{className:"neeto-editor-variables-row"},a.map((function(e){return m.a.createElement("button",{type:"button",onClick:function(){return n(e)},key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable","data-cy":"neeto-editor-variable-option-item-".concat(e.label,"--").concat(e.value)},e.label)}))))},Bf=["color"],Lf=function(e){var t=e.editor,i=e.variables;return i&&i.length?m.a.createElement(Of,{customTarget:function(){return m.a.createElement(_f,{icon:function(e){e.color;var t=h()(e,Bf);return m.a.createElement(hf,t)},tooltipProps:{content:"Variables",position:"bottom",delay:[500]},"data-cy":"neeto-editor-variable-option"})}},m.a.createElement(Mf,{onClickVariable:function(e){var i=e.category_key,a=e.key,n=i?"".concat(i,".").concat(a):a;t.chain().focus().setVariable({label:n}).run()},variables:i})):null},Pf=["size","color","strokeWidth"];function jf(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Pf);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M17 21H12C10.22 21 8.47991 20.4722 6.99987 19.4832C5.51983 18.4943 4.36628 17.0887 3.68509 15.4442C3.0039 13.7996 2.82567 11.99 3.17294 10.2442C3.5202 8.49836 4.37737 6.89472 5.63604 5.63604C6.89472 4.37737 8.49836 3.5202 10.2442 3.17294C11.99 2.82567 13.7996 3.0039 15.4442 3.68509C17.0887 4.36628 18.4943 5.51983 19.4832 6.99987C20.4722 8.47991 21 10.22 21 12V13.5C21 14.163 20.7366 14.7989 20.2678 15.2678C19.7989 15.7366 19.163 16 18.5 16C17.837 16 17.2011 15.7366 16.7322 15.2678C16.2634 14.7989 16 14.163 16 13.5V12C16 10.9391 15.5786 9.92172 14.8284 9.17158C14.0783 8.42143 13.0609 8 12 8V8C11.2089 8 10.4355 8.2346 9.77772 8.67413C9.11993 9.11365 8.60724 9.73837 8.30449 10.4693C8.00174 11.2002 7.92252 12.0044 8.07686 12.7804C8.2312 13.5563 8.61217 14.269 9.17158 14.8284C9.73099 15.3878 10.4437 15.7688 11.2196 15.9231C11.9956 16.0775 12.7998 15.9983 13.5307 15.6955C14.2616 15.3928 14.8864 14.8801 15.3259 14.2223C15.7654 13.5645 16 12.7911 16 12",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}jf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},jf.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var qf=["size","user","isSquare","status","onClick","className"],Uf={small:24,medium:32,large:40,xlarge:64},zf=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function Gf(e){var t,i,a=e.size,n=e.user,r=e.isSquare,o=e.status,s=e.onClick,l=e.className,d=h()(e,qf),_=Object(p.useState)(!1),c=g()(_,2),f=c[0],F=c[1],E=n.name,y=void 0===E?"":E,D=n.imageUrl,v="medium"===a,k="large"===a,S="xlarge"===a,w=(t=y.trim().split(" ")).reduce((function(e,i,a){return 0!==a&&a!==t.length-1||(e="".concat(e).concat(i.charAt(0).toUpperCase())),e}),""),C={height:Uf[a],width:Uf[a],backgroundColor:(i=(w.charCodeAt(0)||0)+(w.charCodeAt(1)||0),zf[i%65%zf.length]||zf[0])},x=b()("ne-avatar",{"ne-avatar--medium":v,"ne-avatar--large":k,"ne-avatar--xlarge":S,"ne-avatar--round":!r,hidden:!f}),T=b()("ne-avatar__text",{"ne-avatar__text-medium":v,"ne-avatar__text-large":k,"ne-avatar__text-xlarge":S}),O=b()("ne-avatar__status","".concat(o),{"ne-avatar__status-medium":v,"ne-avatar__status-large":k,"ne-avatar__status-xlarge":S,"ne-avatar__status-square":r}),N=function(){return null==o?m.a.Fragment:m.a.createElement("span",{className:O})},A=function(){return m.a.createElement("span",{className:T},w)},R=w&&!D&&!f;return m.a.createElement("div",u()({onClick:s,style:C,className:b()("ne-avatar--container",{"ne-avatar--container-round":!r},l)},d),m.a.createElement(N,null),R?m.a.createElement(A,null):m.a.createElement("img",{className:x,onLoad:function(){return F(!0)},onError:function(){return F(!1)},src:D,alt:"avatar-".concat(w)}))}Gf.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},Gf.propTypes={size:lf.a.oneOf(Object.keys(Uf)),user:lf.a.shape({imageUrl:lf.a.string,name:lf.a.string}),isSquare:lf.a.bool,onClick:lf.a.func,status:lf.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:lf.a.string};var Hf=Gf,Yf=function(e){var t=e.editor,i=e.mentions,a=e.showImageInMention,n=Object(p.useRef)();return i&&i.length?m.a.createElement(Of,{ref:n,customTarget:function(){var e;return m.a.createElement(_f,{icon:jf,iconActive:null===(e=n.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Mention",position:"bottom",delay:[500]},"data-cy":"neeto-editor-mention-option"})}},m.a.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},i.map((function(e){var i=e.key,n=e.name,r=e.imageUrl;return m.a.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:i,onClick:function(){return t.commands.setMention(n)},type:"button","data-cy":"neeto-editor-mention-option-".concat(i)},a&&m.a.createElement(Hf,{size:"small",user:{name:n,imageUrl:r}}),m.a.createElement("p",null,n))})))):null},Wf=function(e){var t=e.editor,i=Object(p.useRef)(),a=Object(p.useRef)(),n=Object(p.useState)(""),r=g()(n,2),o=r[0],s=r[1],l=Object(p.useState)(""),u=g()(l,2),d=u[0],_=u[1],c=t.isActive("link"),f=function(){_(t.getAttributes("link").href||"")},h=function(){var e;Wg.test(d)?(t.chain().focus().setLink({href:d}).run(),null===(e=i.current)||void 0===e||e.close()):s("Please enter a valid url")};return m.a.createElement(Of,{ref:i,onVisible:function(){var e;return null===(e=a.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:function(){return m.a.createElement(_f,{icon:xg,iconActive:c,onClick:f,tooltipProps:{content:"Link",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-link-option"})},className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?i.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},m.a.createElement(pg,{ref:a,name:"url",value:d,placeholder:"Paste URL",onFocus:function(){return s("")},error:o,onChange:function(e){var t=e.target.value;return _(t)},"data-cy":"neeto-editor-fixed-menu-link-option-input"}),m.a.createElement(Xc,{label:"Link",onClick:h,"data-cy":"neeto-editor-fixed-menu-link-option-link-button"}),c&&m.a.createElement(Xc,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=i.current)||void 0===e||e.close()},"data-cy":"neeto-editor-fixed-menu-link-option-unlink-button"})))},Vf=["size","color","strokeWidth"];function $f(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Vf);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M12 3C7.037 3 3 7.037 3 12C3 16.963 7.037 21 12 21C16.963 21 21 16.962 21 12C21 7.038 16.962 3 12 3Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M15.5006 15.688C15.5006 15.688 14.1876 17 12.0006 17C9.81263 17 8.50063 15.688 8.50063 15.688M15.3286 9.5C15.1906 9.5 15.0786 9.612 15.0796 9.75C15.0796 9.888 15.1916 10 15.3296 10C15.4676 10 15.5796 9.888 15.5796 9.75C15.5796 9.612 15.4676 9.5 15.3286 9.5ZM8.63963 9.5C8.50163 9.5 8.38963 9.612 8.39063 9.75C8.39063 9.888 8.50263 10 8.64063 10C8.77863 10 8.89063 9.888 8.89063 9.75C8.89063 9.612 8.77863 9.5 8.63963 9.5Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}$f.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},$f.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Kf=i(20),Qf=i.n(Kf),Zf=i(21),Xf=i.n(Zf),Jf=i(9),eh=i.n(Jf),th=i(22),ih=i.n(th),ah=i(23),nh=i.n(ah),rh=i(15),oh=i.n(rh),sh=i(30),lh=i(10),uh=i.n(lh),dh=i(11),_h=i.n(dh),ch=i(46),gh=i.n(ch),fh={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"},hh=function(e){var t=[],i=function(e,i){e&&(Array.isArray(e)?e:[e]).forEach((function(e){(i?e.split(/[-|_|\s]+/):[e]).forEach((function(e){e=e.toLowerCase(),-1==t.indexOf(e)&&t.push(e)}))}))};return i(e.short_names,!0),i(e.name,!0),i(e.keywords,!1),i(e.emoticons,!1),t.join(",")},ph=function(e){for(var t in e.compressed=!1,e.emojis){var i=e.emojis[t];for(var a in fh)i[a]=i[fh[a]],delete i[fh[a]];i.short_names||(i.short_names=[]),i.short_names.unshift(t),i.sheet_x=i.sheet[0],i.sheet_y=i.sheet[1],delete i.sheet,i.text||(i.text=""),i.added_in||(i.added_in=6),i.added_in=i.added_in.toFixed(1),i.search=hh(i)}},mh=String.fromCodePoint||function(){var e,t,i=16384,a=[],n=-1,r=arguments.length;if(!r)return"";for(var o="";++n<r;){var s=Number(arguments[n]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?a.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,a.push(e,t)),(n+1===r||a.length>i)&&(o+=String.fromCharCode.apply(null,a),a.length=0)}return o},Fh=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,bh=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function Eh(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return mh.apply(null,t)}function yh(e){var t=e.name,i=e.short_names,a=e.skin_tone,n=e.skin_variations,r=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,d=e.id||i[0],_=":".concat(d,":");return s?{id:d,name:t,short_names:i,colons:_,emoticons:r,custom:s,customCategory:l,imageUrl:u}:(a&&(_+=":skin-tone-".concat(a,":")),{id:d,name:t,short_names:i,colons:_,emoticons:r,unified:o.toLowerCase(),skin:a||(n?1:null),native:Eh(o)})}function Dh(){return yh(vh.apply(void 0,arguments))}function vh(e,t,i,a){var n={};if("string"==typeof e){var r=e.match(Fh);if(r&&(e=r[1],r[2]&&(t=parseInt(r[2],10))),a.aliases.hasOwnProperty(e)&&(e=a.aliases[e]),!a.emojis.hasOwnProperty(e))return null;n=a.emojis[e]}else e.id&&(a.aliases.hasOwnProperty(e.id)&&(e.id=a.aliases[e.id]),a.emojis.hasOwnProperty(e.id)&&(n=a.emojis[e.id],t||(t=e.skin)));if(Object.keys(n).length||((n=e).custom=!0,n.search||(n.search=hh(e))),n.emoticons||(n.emoticons=[]),n.variations||(n.variations=[]),n.skin_variations&&t>1){n=JSON.parse(JSON.stringify(n));var o=bh[t-1],s=n.skin_variations[o];if(s&&(!s.variations&&n.variations&&delete n.variations,i&&(null==s["has_img_".concat(i)]||s["has_img_".concat(i)])||!i))for(var l in n.skin_tone=t,s){var u=s[l];n[l]=u}}return n.variations&&n.variations.length&&((n=JSON.parse(JSON.stringify(n))).unified=n.variations.shift()),n}function kh(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function Sh(e,t){var i=kh(e),a=kh(t);return i.filter((function(e){return a.indexOf(e)>=0}))}function wh(e,t){var i={};for(var a in e){var n=e[a],r=n;t.hasOwnProperty(a)&&(r=t[a]),"object"===gh()(r)&&(r=wh(n,r)),i[a]=r}return i}var Ch,xh,Th="emoji-mart",Oh="undefined"!=typeof window&&"localStorage"in window;function Nh(e,t){if(xh)xh(e,t);else{if(!Oh)return;try{window.localStorage["".concat(Th,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var Ah={update:function(e){for(var t in e){Nh(t,e[t])}},set:Nh,get:function(e){if(Ch)return Ch(e);if(Oh)try{var t=window.localStorage["".concat(Th,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){Th=e},setHandlers:function(e){e||(e={}),Ch=e.getter,xh=e.setter}},Rh=function(){function e(t,i){uh()(this,e),t.compressed&&ph(t),this.data=t||{},this.set=i||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return _h()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var i=e.data.emojis[t],a=i.short_names,n=i.emoticons,r=i.skin_variations,o=a[0];if(n&&n.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),r){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=Dh({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=Dh(o,null,e.set,e.data);e.originalPool[o]=i};for(var i in this.data.emojis)t(i)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(i){var a=i.id||i.short_names[0];delete e[a],delete t.emojis[a]}))}},{key:"addCustomToPool",value:function(e,t){var i=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var a=e.id||e.short_names[0];a&&!t[a]&&(t[a]=vh(e,null,null,i.data),i.emojis[a]=Dh(e,null,null,i.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.emojisToShowFilter,n=i.maxResults,r=i.include,o=i.exclude,s=i.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=Ah.get("skin")||1;n||(n=75),r||(r=[]),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|,|\-|_]+/),g=[];if(c.length>2&&(c=[c[0],c[1]]),(r.length||o.length)&&(_={},this.data.categories.forEach((function(e){var i=!r||!r.length||r.indexOf(e.id)>-1,a=!(!o||!o.length)&&o.indexOf(e.id)>-1;i&&!a&&e.emojis.forEach((function(e){return _[e]=t.data.emojis[e]}))})),l.length)){var f=!r||!r.length||r.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;f&&!h&&this.addCustomToPool(l,_)}d=(g=c.map((function(e){for(var i=_,a=t.index,n=0,r=0;r<e.length;r++){var o=e[r];n++,a[o]||(a[o]={}),(a=a[o]).results||function(){var r={};for(var o in a.results=[],a.pool={},i){var s=i[o],l=s.search,d=e.substr(0,n),_=l.indexOf(d);if(-1!=_){var c=_+1;d==o&&(c=0),t.emojis[o]&&t.emojis[o][u]?a.results.push(t.emojis[o][u]):a.results.push(t.emojis[o]),a.pool[o]=s,r[o]=c}}a.results.sort((function(e,t){var i=r[e.id],a=r[t.id];return i==a?e.id.localeCompare(t.id):i-a}))}(),i=a.pool}return a.results})).filter((function(e){return e}))).length>1?Sh.apply(null,g):g.length?g[0]:[]}return d&&(a&&(d=d.filter((function(e){return a(_[e.id])}))),d&&d.length>n&&(d=d.slice(0,n))),d}}]),e}(),Mh=new Rh(sh);var Ih,Bh,Lh={search:function(){return Mh.search.apply(Mh,arguments)},emojis:Mh.emojis,emoticons:Mh.emoticons},Ph=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],jh={};function qh(){Bh=!0,Ih=Ah.get("frequently")}var Uh={add:function(e){Bh||qh();var t=e.id;Ih||(Ih=jh),Ih[t]||(Ih[t]=0),Ih[t]+=1,Ah.set("last",t),Ah.set("frequently",Ih)},get:function(e){if(Bh||qh(),!Ih){jh={};for(var t=[],i=0;i<e;i++)jh[Ph[i]]=e-i,t.push(Ph[i]);return t}var a=4*e,n=[];for(var r in Ih)Ih.hasOwnProperty(r)&&n.push(r);var o=n.sort((function(e,t){return Ih[e]-Ih[t]})).reverse().slice(0,a),s=Ah.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},zh=i(16),Gh=i.n(zh),Hh=i(24),Yh=i.n(Hh),Wh=i(12),Vh=i.n(Wh),$h=i(13),Kh=i.n($h),Qh=i(14),Zh=i.n(Qh),Xh=i(7),Jh=i.n(Xh),ep={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"}))}},tp={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"}))}},ip={data:lf.a.object.isRequired,onOver:lf.a.func,onLeave:lf.a.func,onClick:lf.a.func,fallback:lf.a.func,backgroundImageFn:lf.a.func,native:lf.a.bool,forceSize:lf.a.bool,tooltip:lf.a.bool,useButton:lf.a.bool,skin:lf.a.oneOf([1,2,3,4,5,6]),sheetSize:lf.a.oneOf([16,20,32,64]),sheetColumns:lf.a.number,sheetRows:lf.a.number,set:lf.a.oneOf(["apple","google","twitter","facebook"]),size:lf.a.number.isRequired,emoji:lf.a.oneOfType([lf.a.string,lf.a.object]).isRequired},ap={onClick:lf.a.func,onSelect:lf.a.func,onSkinChange:lf.a.func,perLine:lf.a.number,emojiSize:lf.a.number,i18n:lf.a.object,style:lf.a.object,title:lf.a.string,emoji:lf.a.string,color:lf.a.string,set:ip.set,skin:ip.skin,native:lf.a.bool,backgroundImageFn:ip.backgroundImageFn,sheetSize:ip.sheetSize,emojisToShowFilter:lf.a.func,showPreview:lf.a.bool,showSkinTones:lf.a.bool,emojiTooltip:ip.tooltip,useButton:ip.useButton,theme:lf.a.oneOf(["auto","light","dark"]),include:lf.a.arrayOf(lf.a.string),exclude:lf.a.arrayOf(lf.a.string),recent:lf.a.arrayOf(lf.a.string),autoFocus:lf.a.bool,enableFrequentEmojiSort:lf.a.bool,custom:lf.a.arrayOf(lf.a.shape({name:lf.a.string.isRequired,short_names:lf.a.arrayOf(lf.a.string).isRequired,emoticons:lf.a.arrayOf(lf.a.string),keywords:lf.a.arrayOf(lf.a.string),imageUrl:lf.a.string,spriteUrl:lf.a.string,sheet_x:lf.a.number,sheet_y:lf.a.number,size:lf.a.number,sheetColumns:lf.a.number,sheetRows:lf.a.number})),skinEmoji:lf.a.string,notFound:lf.a.func,notFoundEmoji:lf.a.string,icons:lf.a.object},np=function(e){function t(e){var i;uh()(this,t),i=Vh()(this,Kh()(t).call(this,e));var a=e.categories.filter((function(e){return e.first}))[0];return i.state={selected:a.name},i.handleClick=i.handleClick.bind(Jh()(i)),i}return Zh()(t,e),_h()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),i=this.props,a=i.categories;(0,i.onAnchorClick)(a[t],t)}},{key:"render",value:function(){var e=this,t=this.props,i=t.categories,a=t.color,n=t.i18n,r=t.icons,o=this.state.selected;return m.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":n.categorieslabel},i.map((function(t,i){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":n.categories[_],title:n.categories[_],"data-index":i,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(d?"emoji-mart-anchor-selected":""),style:{color:d?a:null}},m.a.createElement("div",{className:"emoji-mart-anchor-icon"},r.categories[_]()),m.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:a}}))})))}}]),t}(m.a.PureComponent);np.propTypes={categories:lf.a.array,onAnchorClick:lf.a.func,icons:lf.a.object},np.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var rp={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")}},op={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:rp.set,theme:"light",skin:null,defaultSkin:rp.skin,native:rp.native,sheetSize:rp.sheetSize,backgroundImageFn:rp.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:rp.tooltip,useButton:rp.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function sp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function lp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var up=function(e){return vh(e.emoji,e.skin,e.set,e.data)},dp=function(e){var t=up(e),i=t.sheet_x,a=t.sheet_y,n=100/(e.sheetColumns-1),r=100/(e.sheetRows-1);return"".concat(n*i,"% ").concat(r*a,"%")},_p=function(e){return Dh(e.emoji,e.skin,e.set,e.data)},cp=function(e){return!isNaN(e-parseFloat(e))},gp=function e(t){for(var i in t.data.compressed&&ph(t.data),e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);var a=up(t);if(!a)return t.fallback?t.fallback(null,t):null;var n=a.unified,r=a.custom,o=a.short_names,s=a.imageUrl,l={},u=t.children,d="emoji-mart-emoji",_=n&&Eh(n),c=[_].concat(o).filter(Boolean).join(", "),g=null;if(!n&&!r)return t.fallback?t.fallback(a,t):null;if(t.tooltip&&(g=o[0]),t.native&&n)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(r)d+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=a.spriteUrl?lp({},l,{backgroundImage:"url(".concat(a.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:dp(t)}):lp({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==a["has_img_".concat(t.set)]||a["has_img_".concat(t.set)]))return t.fallback?t.fallback(a,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:dp(t)}}var f={name:"span",props:{}};return t.onClick&&t.useButton&&(f.name="button",f.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var i in e){var a=e[i];cp(a)&&(a+="px"),t.style[i]=a}return t.getAttribute("style")}(l),"<".concat(f.name," style='").concat(l,"' aria-label='").concat(c,"' ").concat(g?"title='".concat(g,"'"):""," class='").concat(d,"'>").concat(u||"","</").concat(f.name,">")):m.a.createElement(f.name,Yh()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(_p(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(_p(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(_p(t),e)}(e,t)},"aria-label":c,title:g,className:d},f.props),m.a.createElement("span",{style:l},u))};gp.propTypes=lp({},ip,{data:lf.a.object.isRequired}),gp.defaultProps=rp;var fp=gp;function hp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}var pp=function(e){function t(){return uh()(this,t),Vh()(this,Kh()(t).apply(this,arguments))}return Zh()(t,e),_h()(t,[{key:"render",value:function(){var e=this.props,t=e.data,i=e.emojiProps,a=e.i18n,n=e.notFound,r=e.notFoundEmoji;return n&&n()||m.a.createElement("div",{className:"emoji-mart-no-results"},fp(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?hp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):hp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({data:t},i,{size:38,emoji:r,onOver:null,onLeave:null,onClick:null})),m.a.createElement("div",{className:"emoji-mart-no-results-label"},a.notfound))}}]),t}(m.a.PureComponent);function mp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}pp.propTypes={notFound:lf.a.func.isRequired,emojiProps:lf.a.object.isRequired};var Fp=function(e){function t(e){var i;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).data=e.data,i.setContainerRef=i.setContainerRef.bind(Jh()(i)),i.setLabelRef=i.setLabelRef.bind(Jh()(i)),i}return Zh()(t,e),_h()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var i=this.props,a=i.name,n=i.perLine,r=i.native,o=i.hasStickyPosition,s=i.emojis,l=i.emojiProps,u=l.skin,d=l.size,_=l.set,c=e.perLine,g=e.native,f=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,E=!1;return"Recent"==a&&n!=c&&(E=!0),"Search"==a&&(E=!(s==h)),u==m&&d==F&&r==g&&_==b&&o==f||(E=!0),E}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),i=t.top,a=t.height,n=e.getBoundingClientRect().top,r=this.label.getBoundingClientRect().height;this.top=i-n+e.scrollTop,this.maxMargin=0==a?0:a-r}},{key:"handleScroll",value:function(e){var t=e-this.top;if((t=(t=t<this.minMargin?this.minMargin:t)>this.maxMargin?this.maxMargin:t)!=this.margin)return this.props.hasStickyPosition||(this.label.style.top="".concat(t,"px")),this.margin=t,!0}},{key:"getEmojis",value:function(){var e=this,t=this.props,i=t.name,a=t.emojis,n=t.recent,r=t.perLine;if("Recent"==i){var o=this.props.custom,s=n||Uh.get(r);if(s.length&&(a=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!vh(t,null,null,e.data)}))),0===a.length&&s.length>0)return null}return a&&(a=a.slice(0)),a}},{key:"updateDisplay",value:function(e){this.getEmojis()&&this.container&&(this.container.style.display=e)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setLabelRef",value:function(e){this.label=e}},{key:"render",value:function(){var e=this,t=this.props,i=t.id,a=t.name,n=t.hasStickyPosition,r=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,u=this.getEmojis(),d={},_={},c={};u||(c={display:"none"}),n||(d={height:28},_={position:"absolute"});var g=o.categories[i]||a;return m.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":g,style:c},m.a.createElement("div",{style:d,"data-name":a,className:"emoji-mart-category-label"},m.a.createElement("span",{style:_,ref:this.setLabelRef,"aria-hidden":!0},g)),m.a.createElement("ul",{className:"emoji-mart-category-list"},u&&u.map((function(t){return m.a.createElement("li",{key:t.short_names&&t.short_names.join("_")||t},fp(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?mp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):mp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({emoji:t,data:e.data},r)))}))),u&&!u.length&&m.a.createElement(pp,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:r}))}}]),t}(m.a.Component);Fp.propTypes={emojis:lf.a.array,hasStickyPosition:lf.a.bool,name:lf.a.string.isRequired,native:lf.a.bool.isRequired,perLine:lf.a.number.isRequired,emojiProps:lf.a.object.isRequired,recent:lf.a.arrayOf(lf.a.string),notFound:lf.a.func,notFoundEmoji:lf.a.string.isRequired},Fp.defaultProps={emojis:[],hasStickyPosition:!0};var bp=function(e){function t(e){var i;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).state={opened:!1},i}return Zh()(t,e),_h()(t,[{key:"handleClick",value:function(e){var t=parseInt(e.currentTarget.getAttribute("data-skin")),i=this.props.onChange;this.state.opened?(this.setState({opened:!1}),t!=this.props.skin&&i(t)):this.setState({opened:!0})}},{key:"render",value:function(){return null}}]),t}(m.a.PureComponent);bp.propTypes={onChange:lf.a.func,skin:lf.a.number.isRequired},bp.defaultProps={onChange:function(){}};var Ep=function(e){function t(e){var i;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).handleClick=i.handleClick.bind(Jh()(i)),i}return Zh()(t,e),_h()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.emojiProps,a=e.data,n=e.skinEmoji,r=e.i18n,o=this.state.opened,s=[],l=1;l<=6;l++){var u=l===t;s.push(m.a.createElement("span",{key:"skin-tone-".concat(l),className:"emoji-mart-skin-swatch custom".concat(u?" selected":"")},m.a.createElement("span",{onClick:this.handleClick,"data-skin":l,className:"emoji-mart-skin-tone-".concat(l)},fp({emoji:n,data:a,skin:l,backgroundImageFn:i.backgroundImageFn,native:i.native,set:i.set,sheetSize:i.sheetSize,size:23}))))}return m.a.createElement("div",{className:"emoji-mart-skin-swatches custom".concat(o?" opened":"")},m.a.createElement("div",{className:"emoji-mart-skin-text".concat(o?" opened":"")},r.skintext),s)}}]),t}(bp);Ep.propTypes={onChange:lf.a.func,skin:lf.a.number.isRequired,emojiProps:lf.a.object.isRequired,skinTone:lf.a.number,skinEmoji:lf.a.string.isRequired,i18n:lf.a.object},Ep.defaultProps={onChange:function(){},skinTone:null};var yp=function(e){function t(e){var i;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).handleClick=i.handleClick.bind(Jh()(i)),i.handleKeyDown=i.handleKeyDown.bind(Jh()(i)),i}return Zh()(t,e),_h()(t,[{key:"handleKeyDown",value:function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),this.handleClick(e))}},{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.i18n,a=this.state.opened,n=[],r=1;r<=6;r++){var o=r===t,s=a||o;n.push(m.a.createElement("span",Yh()({key:"skin-tone-".concat(r),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":i.skintones[r],"aria-hidden":!s},a?{role:"menuitem"}:{}),m.a.createElement("span",Yh()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!a}:{},a?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":i.skintones[r],title:i.skintones[r],"data-skin":r,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(r)}))))}return m.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(a?" opened":""),"aria-label":i.skintext},m.a.createElement("div",a?{role:"menubar"}:{},n))}}]),t}(bp);function Dp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function vp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Dp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Dp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}yp.propTypes={onChange:lf.a.func,skin:lf.a.number.isRequired,i18n:lf.a.object},yp.defaultProps={onChange:function(){}};var kp=function(e){function t(e){var i;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).data=e.data,i.state={emoji:null},i}return Zh()(t,e),_h()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,i=t.emojiProps,a=t.skinsProps,n=t.showSkinTones,r=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var u=vh(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"},fp(vp({key:e.id,emoji:e,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("div",{className:"emoji-mart-preview-name"},e.name),m.a.createElement("div",{className:"emoji-mart-preview-shortnames"},u.short_names.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-shortname"},":",e,":")}))),m.a.createElement("div",{className:"emoji-mart-preview-emoticons"},c.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-emoticon"},e)})))))}return m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},o&&o.length&&fp(vp({emoji:o,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("span",{className:"emoji-mart-title-label"},r)),n&&m.a.createElement("div",{className:"emoji-mart-preview-skins".concat(a.skinEmoji?" custom":"")},a.skinEmoji?m.a.createElement(Ep,{skin:a.skin,emojiProps:i,data:this.data,skinEmoji:a.skinEmoji,i18n:s,onChange:a.onChange}):m.a.createElement(yp,{skin:a.skin,i18n:s,onChange:a.onChange})))}}]),t}(m.a.PureComponent);kp.propTypes={showSkinTones:lf.a.bool,title:lf.a.string.isRequired,emoji:lf.a.string.isRequired,emojiProps:lf.a.object.isRequired,skinsProps:lf.a.object.isRequired},kp.defaultProps={showSkinTones:!0,onChange:function(){}};var Sp=0,wp=function(e){function t(e){var i,a,n,r;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).state={icon:tp.search,isSearching:!1,id:++Sp},i.data=e.data,i.emojiIndex=new Rh(i.data),i.setRef=i.setRef.bind(Jh()(i)),i.clear=i.clear.bind(Jh()(i)),i.handleKeyUp=i.handleKeyUp.bind(Jh()(i)),i.handleChange=(a=i.handleChange.bind(Jh()(i)),n="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,r=!1,function(){r||(r=!0,n((function(){r=!1,a()})))}),i}return Zh()(t,e),_h()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:tp.search,isSearching:!1}):this.setState({icon:tp.delete,isSearching:!0}),this.props.onSearch(this.emojiIndex.search(e,{emojisToShowFilter:this.props.emojisToShowFilter,maxResults:this.props.maxResults,include:this.props.include,exclude:this.props.exclude,custom:this.props.custom}))}},{key:"clear",value:function(){""!=this.input.value&&(this.input.value="",this.input.focus(),this.search(""))}},{key:"handleChange",value:function(){this.input&&this.search(this.input.value)}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.clear()}},{key:"setRef",value:function(e){this.input=e}},{key:"render",value:function(){var e=this.props,t=e.i18n,i=e.autoFocus,a=this.state,n=a.icon,r=a.isSearching,o=a.id,s="emoji-mart-search-".concat(o);return m.a.createElement("section",{className:"emoji-mart-search","aria-label":t.search},m.a.createElement("input",{id:s,ref:this.setRef,type:"search",onChange:this.handleChange,placeholder:t.search,autoFocus:i}),m.a.createElement("label",{className:"emoji-mart-sr-only",htmlFor:s},t.search),m.a.createElement("button",{className:"emoji-mart-search-icon",onClick:this.clear,onKeyUp:this.handleKeyUp,"aria-label":t.clear,disabled:!r},n()))}}]),t}(m.a.PureComponent);function Cp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function xp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Cp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Cp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}wp.propTypes={onSearch:lf.a.func,maxResults:lf.a.number,emojisToShowFilter:lf.a.func,autoFocus:lf.a.bool},wp.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var Tp={search:"Search",clear:"Clear",notfound:"No Emoji Found",skintext:"Choose your default skin tone",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"},categorieslabel:"Emoji categories",skintones:{1:"Default Skin Tone",2:"Light Skin Tone",3:"Medium-Light Skin Tone",4:"Medium Skin Tone",5:"Medium-Dark Skin Tone",6:"Dark Skin Tone"}},Op=function(e){function t(e){var i;uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).CUSTOM=[],i.RECENT_CATEGORY={id:"recent",name:"Recent",emojis:null},i.SEARCH_CATEGORY={id:"search",name:"Search",emojis:null,anchor:!1},e.data.compressed&&ph(e.data),i.data=e.data,i.i18n=wh(Tp,e.i18n),i.icons=wh(a,e.icons),i.state={firstRender:!0},i.categories=[];var n=[].concat(i.data.categories);if(e.custom.length>0){var r={},o=0;e.custom.forEach((function(e){r[e.customCategory]||(r[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=r[e.customCategory],a=xp({},e,{id:e.short_names[0],custom:!0});t.emojis.push(a),i.CUSTOM.push(a)})),n=n.concat(Object.keys(r).map((function(e){return r[e]})))}i.hideRecent=!0,null!=e.include&&n.sort((function(t,i){return e.include.indexOf(t.id)>e.include.indexOf(i.id)?1:-1}));for(var s=0;s<n.length;s++){var l=n[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,g=0;g<c.length;g++){var f=c[g];e.emojisToShowFilter(i.data.emojis[f]||f)&&_.push(f)}if(_.length){var h={emojis:_,name:l.name,id:l.id};i.categories.push(h)}}else i.categories.push(l)}var p=!e.include||!e.include.length||e.include.indexOf(i.RECENT_CATEGORY.id)>-1,m=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(i.RECENT_CATEGORY.id)>-1;return p&&!m&&(i.hideRecent=!1,i.categories.unshift(i.RECENT_CATEGORY)),i.categories[0]&&(i.categories[0].first=!0),i.categories.unshift(i.SEARCH_CATEGORY),i.setAnchorsRef=i.setAnchorsRef.bind(Jh()(i)),i.handleAnchorClick=i.handleAnchorClick.bind(Jh()(i)),i.setSearchRef=i.setSearchRef.bind(Jh()(i)),i.handleSearch=i.handleSearch.bind(Jh()(i)),i.setScrollRef=i.setScrollRef.bind(Jh()(i)),i.handleScroll=i.handleScroll.bind(Jh()(i)),i.handleScrollPaint=i.handleScrollPaint.bind(Jh()(i)),i.handleEmojiOver=i.handleEmojiOver.bind(Jh()(i)),i.handleEmojiLeave=i.handleEmojiLeave.bind(Jh()(i)),i.handleEmojiClick=i.handleEmojiClick.bind(Jh()(i)),i.handleEmojiSelect=i.handleEmojiSelect.bind(Jh()(i)),i.setPreviewRef=i.setPreviewRef.bind(Jh()(i)),i.handleSkinChange=i.handleSkinChange.bind(Jh()(i)),i.handleKeyDown=i.handleKeyDown.bind(Jh()(i)),i.handleDarkMatchMediaChange=i.handleDarkMatchMediaChange.bind(Jh()(i)),i}return Zh()(t,e),_h()(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?op.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?op.theme:this.darkMatchMedia.matches?"dark":"light")}},{key:"handleDarkMatchMediaChange",value:function(){this.setState({theme:this.darkMatchMedia.matches?"dark":"light"})}},{key:"handleEmojiOver",value:function(e){var t=this.preview;if(t){var i=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a]);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||Uh.add(e);var i=this.categoryRefs["category-1"];if(i){var a=i.maxMargin;this.props.enableFrequentEmojiSort&&i.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(i.memoizeSize(),a!=i.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&i.updateDisplay("none")))}))}}},{key:"handleScroll",value:function(){this.waitingForPaint||(this.waitingForPaint=!0,requestAnimationFrame(this.handleScrollPaint))}},{key:"handleScrollPaint",value:function(){if(this.waitingForPaint=!1,this.scroll){var e=null;if(this.SEARCH_CATEGORY.emojis)e=this.SEARCH_CATEGORY;else{for(var t=this.scroll.scrollTop,i=t>(this.scrollTop||0),a=0,n=0,r=this.categories.length;n<r;n++){var o=i?this.categories.length-1-n:n,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!a||l.top<a)&&l.top>0&&(a=l.top),u&&!e&&(e=s)}}t<a?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,i=this.categories.length;t<i;t++){var a=this.categoryRefs["category-".concat(t)];if(a&&"Search"!=a.props.name){var n=e?"none":"inherit";a.updateDisplay(n)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var i,a=this.categoryRefs["category-".concat(t)],n=this.scroll;this.anchors;i=function(){if(a){var t=a.top;e.first?t=0:t+=1,n.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(i)):i()}},{key:"handleSkinChange",value:function(e){var t={skin:e},i=this.props.onSkinChange;this.setState(t),Ah.update(t),i(e)}},{key:"handleKeyDown",value:function(e){var t=!1;switch(e.keyCode){case 13:var i;this.SEARCH_CATEGORY.emojis&&this.SEARCH_CATEGORY.emojis.length&&(i=Dh(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(i),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var i=this.categoryRefs["category-".concat(e)];i&&i.memoizeSize()}if(this.scroll){var a=this.scroll;this.scrollHeight=a.scrollHeight,this.clientHeight=a.clientHeight}}},{key:"getCategories",value:function(){return this.state.firstRender?this.categories.slice(0,3):this.categories}},{key:"setAnchorsRef",value:function(e){this.anchors=e}},{key:"setSearchRef",value:function(e){this.search=e}},{key:"setPreviewRef",value:function(e){this.preview=e}},{key:"setScrollRef",value:function(e){this.scroll=e}},{key:"setCategoryRef",value:function(e,t){this.categoryRefs||(this.categoryRefs={}),this.categoryRefs[e]=t}},{key:"render",value:function(){var e=this,t=this.props,i=t.perLine,a=t.emojiSize,n=t.set,r=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,u=t.title,d=t.emoji,_=t.color,c=t.native,g=t.backgroundImageFn,f=t.emojisToShowFilter,h=t.showPreview,p=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,E=t.include,y=t.exclude,D=t.recent,v=t.autoFocus,k=t.skinEmoji,S=t.notFound,w=t.notFoundEmoji,C=i*(a+12)+12+2+function(){if("undefined"==typeof document)return 0;var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}(),x=this.getPreferredTheme(),T=this.props.skin||this.state.skin||Ah.get("skin")||this.props.defaultSkin;return m.a.createElement("section",{style:xp({width:C},l),className:"emoji-mart emoji-mart-".concat(x),"aria-label":u,onKeyDown:this.handleKeyDown},m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(np,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:_,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),m.a.createElement(wp,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:f,include:E,exclude:y,custom:this.CUSTOM,autoFocus:v}),m.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return m.a.createElement(Fp,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:i,native:c,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?D:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:c,skin:T,size:a,set:n,sheetSize:r,sheetColumns:o,sheetRows:s,forceSize:c,tooltip:F,backgroundImageFn:g,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:S,notFoundEmoji:w})}))),(h||p)&&m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(kp,{ref:this.setPreviewRef,data:this.data,title:u,emoji:d,showSkinTones:p,showPreview:h,emojiProps:{native:c,size:38,skin:T,set:n,sheetSize:r,sheetColumns:o,sheetRows:s,backgroundImageFn:g},skinsProps:{skin:T,onChange:this.handleSkinChange,skinEmoji:k},i18n:this.i18n})))}}]),t}(m.a.PureComponent);function Np(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}Op.propTypes=xp({},ap,{data:lf.a.object.isRequired}),Op.defaultProps=xp({},op);var Ap=function(e){function t(){return uh()(this,t),Vh()(this,Kh()(t).apply(this,arguments))}return Zh()(t,e),_h()(t,[{key:"render",value:function(){return m.a.createElement(Op,Yh()({},this.props,this.state))}}]),t}(m.a.PureComponent);function Rp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Mp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Rp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Rp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}Ap.propTypes=ap,Ap.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Np(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Np(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},op,{data:sh});var Ip=function e(t){for(var i in e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);return fp(Mp({},t))};Ip.propTypes=ip,Ip.defaultProps=Mp({},rp,{data:sh});var Bp=i(49),Lp={insert:"head",singleton:!1},Pp=(r()(Bp.a,Lp),Bp.a.locals,i(90));function jp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=oh()(e);if(t){var n=oh()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return nh()(this,i)}}var qp=function(e){ih()(i,e);var t=jp(i);function i(){var e;Qf()(this,i);for(var a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return e=t.call.apply(t,[this].concat(n)),_()(eh()(e),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),_()(eh()(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return Xf()(i,[{key:"render",value:function(){return m.a.createElement(Op,{style:{maxWidth:"100%"},data:Pp,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect,"data-cy":"neeto-editor-emoji-picker"})}}]),i}(m.a.Component);qp.defaultProps={editor:{},range:{}},qp.propTypes={editor:lf.a.object.isRequired,range:lf.a.object};var Up=qp,zp=function(e){var t=e.editor,i=Object(p.useRef)();return m.a.createElement(Of,{ref:i,closeOnSelect:!1,customTarget:function(){var e;return m.a.createElement(_f,{icon:$f,iconActive:null==i||null===(e=i.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Emoji",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-emoji-option-button"})},position:"bottom-start"},m.a.createElement(Up,{editor:t}))},Gp=function(e){var t=e.editor,i=e.variables,a=e.setImageUploadVisible,n=e.options,r=e.mentions,o=e.showImageInMention,s=Object(p.useState)(!1),l=g()(s,2),u=l[0],d=l[1],_=t&&t.view.state.selection.node,c=_&&"image"===_.type.name;if(!t)return null;var f=[{Icon:Eg,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Dg,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:kg,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:wg,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Ag,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}].filter((function(e){return n.includes(e.optionName)})),h=[{Icon:Jg,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:Og,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"code-block"},{Icon:tf,command:function(){return a(!0)},active:t.isActive("imageUpload"),optionName:"image-upload"}].filter((function(e){return n.includes(e.optionName)})),F=[{Icon:nf,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:of,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}].filter((function(e){return n.includes(e.optionName)})),b=n.includes("font-color"),E=n.includes("font-size"),y=n.includes("emoji"),D=n.includes("link"),v=function(e,t){var i=e.Icon,a=e.command,n=e.active,r=e.optionName;return m.a.createElement(_f,{key:t,icon:i,iconActive:n,onClick:a,tooltipProps:{content:_d(r),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(r,"-option")})};return m.a.createElement("div",{className:"neeto-editor-fixed-menu"},E&&m.a.createElement(Nf,{editor:t}),f.map(v),b&&m.a.createElement(pf,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),y&&m.a.createElement(zp,{editor:t}),D&&m.a.createElement(Wf,{editor:t}),h.map(v),F.map(v),c&&Gg({editor:t,isImageEditorModalOpen:u,setIsImageEditorModalOpen:d}).map((function(e,t){var i=e.Icon,a=e.command,n=e.active,r=e.optionName;return m.a.createElement(_f,{key:t,icon:i,iconActive:n,onClick:a,tooltipProps:{content:_d(r),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(r,"-option")})})),m.a.createElement("div",{className:"neeto-editor-fixed-menu-addons"},m.a.createElement(Lf,{editor:t,variables:i}),m.a.createElement(Yf,{editor:t,mentions:r,showImageInMention:o})),m.a.createElement(lg,{isOpen:u,onClose:function(){return d(!1)}},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},m.a.createElement(mg,{editor:t,onClose:function(){return d(!1)},url:null==_?void 0:_.attrs.src,alt:null==_?void 0:_.attrs.alt})))))},Hp=["children","size","noUnderline","className"],Yp=["active","className","children","icon","onClick","activeClassName"],Wp=function(){},Vp="large",$p=function(e){var t=e.children,i=e.size,a=e.noUnderline,n=e.className,r=void 0===n?"":n,o=h()(e,Hp);return m.a.createElement("div",u()({className:b()({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":i===Vp},{"ne-tab__wrapper--underline-none":a},[r]),"data-cy":"tab-container"},o),t)};$p.Item=function(e){var t=e.active,i=e.className,a=void 0===i?"":i,n=e.children,r=e.icon,o=void 0===r?null:r,s=e.onClick,l=void 0===s?Wp:s,d=e.activeClassName,_=void 0===d?"":d,c=h()(e,Yp),g="button",f="string"==typeof o?function(){return m.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||m.a.Fragment;return _&&(g=wc),m.a.createElement(g,u()({className:b()(["ne-tab flex items-center justify-center select-none",a],{active:t}),onClick:l,"data-cy":"tab-item"},c),o&&m.a.createElement(f,{className:"ne-tab__icon"}),n)};var Kp=$p,Qp=function(e){var t,i=Object(p.useState)(null===(t=e[0])||void 0===t?void 0:t.key),a=g()(i,2),n=a[0],r=a[1];return[n,function(e){return r(e.key)}]},Zp=function(e){var t=e.buttonLabel,i=void 0===t?"Submit":t,a=e.placeholder,n=e.onSubmit,r=e.className,o=Object(p.useState)(""),s=g()(o,2),l=s[0],u=s[1],d=Object(p.useState)(""),c=g()(d,2),f=c[0],h=c[1];return m.a.createElement("div",{className:b()("neeto-editor-url-form__wrapper",_()({},r,r))},m.a.createElement(pg,{name:"url",value:l,placeholder:a,onFocus:function(){return h("")},error:f,onChange:function(e){var t=e.target.value;return u(t)},"data-cy":"neeto-editor-image-upload-url-input"}),m.a.createElement(Xc,{size:"large",label:i,onClick:function(e){e.preventDefault(),Wg.test(l)?n(l):h("Please enter a valid url")},"data-cy":"neeto-editor-image-upload-url-submit"}))},Xp=i(19),Jp=i.n(Xp),em=(i(61),i(74),i(75)),tm=i.n(em),im=(i(76),i(77),i(78),i(79)),am=i.n(im),nm=i(91),rm=i.n(nm),om={autoProceed:!0,allowMultipleUploads:!1,restrictions:{maxFileSize:5242880,allowedFileTypes:[".jpg",".jpeg",".png",".gif"]}},sm={formData:!0,fieldName:"blob"},lm=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}],um=function(e){var t,i=e.uppy,a=Object(p.useState)(0),n=g()(a,2),r=n[0],o=n[1];Object(p.useEffect)((function(){i.on("progress",o)}),[i]);var s="".concat(r,"%");return m.a.createElement("div",{className:"neeto-editor-image-uploader__progress"},m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(t=i.getFiles()[0])||void 0===t?void 0:t.name),m.a.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},m.a.createElement("div",{className:"neeto-editor-progress-bar__percent"},m.a.createElement("p",null,s),m.a.createElement(Xc,{icon:ac,onClick:function(){return i.cancelAll()},size:"small",style:"text"})),m.a.createElement("div",{className:"neeto-editor-progress-bar__indicator"},m.a.createElement("div",{style:{width:s},className:"neeto-editor-progress-bar__indicator-inner"}))))},dm=function(e){for(var t=["B","KB","MB","GB"],i=0;e>=1024&&i<t.length;)e/=1024,++i;return"".concat(e.toFixed(1)," ").concat(t[i])};function _m(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function cm(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?_m(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):_m(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var gm=function(e){var t=e.endpoint,i=void 0===t?"/api/v1/direct_uploads/image_upload":t,a=e.onSuccess,n=e.uploadConfig,r=Object(p.useState)(!1),o=g()(r,2),s=o[0],l=o[1],u=Object(p.useState)(""),d=g()(u,2),_=d[0],c=d[1],f=cm(cm({},om),n),h=am()((function(){return new Jp.a(cm(cm({},f),{},{onBeforeFileAdded:function(e){var t=f.restrictions,i=t.maxFileSize,a=t.allowedFileTypes;return e.size>i?(c("File size is too large. Max size is ".concat(dm(f.restrictions.maxFileSize),".")),!1):!!a.includes(".".concat(e.extension))||(c("File type is not permitted. Allowed file types are: ".concat(a.join(", "),".")),!1)}})).use(rm.a,cm({endpoint:i},sm)).on("upload",(function(){return l(!0)})).on("upload-success",(function(e,t){return a(t.body.imageURL)})).on("cancel-all",(function(){return l(!1)})).on("complete",(function(){return l(!1)}))}));return s?m.a.createElement(um,{uppy:h}):m.a.createElement("div",{className:"neeto-editor-image-uploader__dnd-wrapper"},m.a.createElement(tm.a,{className:"neeto-editor-image-uploader__dnd",note:"Max. File Size: ".concat(dm(f.restrictions.maxFileSize)),locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:h,"data-cy":"neeto-editor-image-local-uploader"}),_&&m.a.createElement("p",{className:"neeto-editor-image-uploader__dnd--error"},_))},fm=i(50),hm=i.n(fm),pm=i(92),mm=i.n(pm),Fm=i(51),bm=i.n(Fm),Em=i(93),ym=i.n(Em),Dm=i(94),vm=i.n(Dm),km={FONT_COLOR:"font-color",FONT_SIZE:"font-size",BOLD:"bold",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"strike",BLOCKQUOTE:"block-quote",CODE_BLOCK:"code-block",LINK:"link",LIST_BULLETS:"bullet-list",LIST_ORDERED:"ordered-list",IMAGE_UPLOAD:"image-upload",VIDEO_EMBED:"video-embed",EMOJI:"emoji",DIVIDER:"divider",MENTION:"mention"},Sm=function(e){var t=e.pageNo,i=e.query,a=e.apiKey;return vm.a.get("https://api.unsplash.com/search/photos",{headers:{Authorization:"Client-ID ".concat(a)},params:{page:t,per_page:30,order_by:"popular",query:i}})},wm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,i=Object(p.useState)(e),a=g()(i,2),n=a[0],r=a[1];return Object(p.useEffect)((function(){var i=setTimeout((function(){r(e)}),t);return function(){clearTimeout(i)}}),[e]),n},Cm=function(){return m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__loader"},m.a.createElement("span",{className:"neeto-editor-unsplash-gallery__spinner-icon"}))},xm=function(e){var t=e.onSubmit,i=e.unsplashApiKey,a=Object(p.useRef)(null),n=Object(p.useState)(""),r=g()(n,2),o=r[0],s=r[1],l=Object(p.useState)(!1),u=g()(l,2),d=u[0],_=u[1],c=Object(p.useState)([]),f=g()(c,2),h=f[0],F=f[1],b=Object(p.useState)(1),E=g()(b,2),y=E[0],D=E[1],v=Object(p.useState)(!0),k=g()(v,2),S=k[0],w=k[1],C=Object(p.useState)(!1),x=g()(C,2),T=x[0],O=x[1],N=wm(o||"latest");Object(p.useEffect)((function(){A(1)}),[N]);var A=function(){var e=mm()(bm.a.mark((function e(t){var a,n,r,o;return bm.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,O(!0),_(!1),e.next=5,Sm({page:t,query:N,apiKey:i});case 5:a=e.sent,n=a.data,r=n.results,o=n.total_pages,F(1===t?r:[].concat(hm()(h),hm()(r))),D(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,O(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,12,15,18]])})));return function(t){return e.apply(this,arguments)}}();return m.a.createElement("div",{className:"neeto-editor-unsplash-wrapper"},m.a.createElement(pg,{name:"text",value:o,placeholder:"Search Unsplash",onChange:function(e){var t=e.target.value;s(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),d&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!d&&!T&&fd(h)&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!d&&m.a.createElement("div",{className:"neeto-editor-unsplash-container"},m.a.createElement(ym.a,{ref:a,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:S,loadMore:function(){!T&&S&&y>1&&A(y)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:m.a.createElement(Cm,{key:0})},h&&h.map((function(e,i){return m.a.createElement("div",{key:i,className:"neeto-editor-unsplash-gallery__item","data-cy":"neeto-editor-unsplash-image-picker-result-".concat(i)},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:"".concat(e.height/e.width*100,"%")}},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:"unsplashImage".concat(i)},m.a.createElement("img",{src:e.urls.regular,onClick:function(){return t(e.urls.small)}}),m.a.createElement("a",{href:"https://unsplash.com/@".concat(e.user.username),target:"_blank",rel:"noreferrer"},e.user.name," "))))}))),!S&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},Tm=function(e){var t=e.editor,i=e.imageUploadUrl,a=e.uploadConfig,n=e.isVisible,r=e.setIsVisible,o=e.unsplashApiKey,s=e.isUnsplashImageUploadActive,l=Qp(lm),u=g()(l,2),d=u[0],_=u[1],c=Object(p.useState)(""),f=g()(c,2),h=f[0],F=f[1],b=function(e){F(e)},E={local:function(){return m.a.createElement(gm,{endpoint:i,onSuccess:b,uploadConfig:a})},link:function(){return m.a.createElement(Zp,{onSubmit:b,buttonLabel:"Upload Image",placeholder:"Paste the image link"})},unsplash:function(){return m.a.createElement(xm,{unsplashApiKey:o,onSubmit:b})}}[d];return m.a.createElement(lg,{isOpen:n,onClose:function(){return r(!1)},closeButton:!1},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement(Kp,null,lm.filter((function(e){return"unsplash"!==e.key||s})).map((function(e){return m.a.createElement(Kp.Item,{key:e.key,active:d===e.key,onClick:function(){return _(e)}},e.title)}))),m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},h?m.a.createElement(mg,{url:h,editor:t,onClose:function(){F(null),r(!1)}}):m.a.createElement(E,null))))};function Om(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}var Nm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=t,a=e.current;if(a){var n=a.selectionStart,r=a.selectionEnd,o=i.length,s=a.value.substring(0,n),l=a.value.substring(n,r),u=a.value.substring(r,a.value.length);n!==r&&(s.endsWith(i)&&u.startsWith(i)?(i="",s=s.substring(0,s.length-o),u=u.substring(o,u.length)):l.startsWith(i)&&l.endsWith(i)&&(i="",l=l.substring(o,l.length-o)),a.value=s+i+l+i+u,a.selectionStart=a.selectionEnd=s.length)}},Am=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.current;if(a){var n=a.value.substring(0,a.selectionStart).lastIndexOf("\n"),r=a.value.substring(a.selectionEnd,a.value.length).indexOf("\n");n=-1===n?0:n+1,r=-1===r?a.value.length:r+a.selectionEnd;var o=a.value.substring(0,n),s=a.value.substring(n,r),l=a.value.substring(r,a.value.length);if(0===s.indexOf(t)||i&&0===s.indexOf("1.")){var u=i?s.replaceAll(/^\d+\.\s/gm,""):s.replaceAll(t,"");a.value=o+u+l}else{var d=1,_=i?s.replaceAll("\n",(function(){return"\n".concat(++d,". ")})):s.replaceAll("\n","\n".concat(t));a.value=o+(t||"1. ")+_+l}}},Rm=function(e){var t=e.strategy,i=e.style,a=e.ref,n=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Om(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Om(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},i);return n["min-height"]&&(n.minHeight=n["min-height"],delete n["min-height"]),"flexible"===t&&a.current&&(n.height=a.current.scrollHeight),n},Mm=["editor","className","style","strategy","limit","onFocus","onBlur"],Im=function(e){var t=e.editor,i=e.className,a=e.style,n=e.strategy,r=e.limit,o=e.onFocus,s=e.onBlur,l=h()(e,Mm),d=t.inputFieldRef,c=t.onChange,g=t.state.length;return m.a.createElement("textarea",u()({ref:d,onChange:function(e){return c(e.target.value)},onKeyDown:function(e){return function(e){var t=e.event,i=e.inputFieldRef,a=e.length,n=e.limit,r=e.onChange;if(a>=n&&"Backspace"!==t.key)t.preventDefault();else if("b"===t.key&&(t.metaKey||t.ctrlKey)&&t.shiftKey)Am(i,"> ");else if("b"===t.key&&(t.metaKey||t.ctrlKey))Nm(i,"**");else if("i"===t.key&&(t.metaKey||t.ctrlKey))Nm(i,"_");else if("u"===t.key&&(t.metaKey||t.ctrlKey))Nm(i,"--");else if("x"===t.key&&(t.metaKey||t.ctrlKey)&&t.shiftKey)Nm(i,"~");else if("h"===t.key&&(t.metaKey||t.ctrlKey)&&t.shiftKey)Nm(i,"==");else if("7"===t.key&&(t.metaKey||t.ctrlKey)&&t.shiftKey)Am(i,null,!0);else{if("8"!==t.key||!t.metaKey&&!t.ctrlKey||!t.shiftKey)return;Am(i,"- ")}r(i.current.value)}({event:e,inputFieldRef:d,length:g,limit:r,onChange:c})},onFocus:o,onBlur:s,className:b()("ProseMirror neeto-editor-markdown",_()({},i,i)),style:Rm({style:a,strategy:n,ref:d}),"data-cy":"neeto-editor-markdown-editor",role:"textbox"},l))},Bm=function(e){var t=e.count,i=e.limit,a="limit"===e.strategy&&i;return m.a.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},a?"".concat(i-t," characters remaining"):"".concat(t," characters"))},Lm=i(38),Pm=i.n(Lm),jm=i(95);function qm(e,t){return Array(t+1).join(e)}var Um=["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 zm(e){return Wm(e,Um)}var Gm=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Hm(e){return Wm(e,Gm)}var Ym=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Wm(e,t){return t.indexOf(e.nodeName)>=0}function Vm(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var $m={};function Km(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function Qm(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 Zm(e,t,i){for(var a=0;a<e.length;a++){var n=e[a];if(Xm(n,t,i))return n}}function Xm(e,t,i){var a=e.filter;if("string"==typeof a){if(a===t.nodeName.toLowerCase())return!0}else if(Array.isArray(a)){if(a.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof a)throw new TypeError("`filter` needs to be a string, array, or function");if(a.call(e,t,i))return!0}}function Jm(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function eF(e,t,i){return e&&e.parentNode===t||i(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}$m.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},$m.lineBreak={filter:"br",replacement:function(e,t,i){return i.br+"\n"}},$m.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,i){var a=Number(t.nodeName.charAt(1));return"setext"===i.headingStyle&&a<3?"\n\n"+e+"\n"+qm(1===a?"=":"-",e.length)+"\n\n":"\n\n"+qm("#",a)+" "+e+"\n\n"}},$m.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},$m.list={filter:["ul","ol"],replacement:function(e,t){var i=t.parentNode;return"LI"===i.nodeName&&i.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},$m.listItem={filter:"li",replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var a=i.bulletListMarker+" ",n=t.parentNode;if("OL"===n.nodeName){var r=n.getAttribute("start"),o=Array.prototype.indexOf.call(n.children,t);a=(r?Number(r)+o:o+1)+". "}return a+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},$m.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},$m.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){for(var a,n=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],r=t.firstChild.textContent,o=i.fence.charAt(0),s=3,l=new RegExp("^"+o+"{3,}","gm");a=l.exec(r);)a[0].length>=s&&(s=a[0].length+1);var u=qm(o,s);return"\n\n"+u+n+"\n"+r.replace(/\n$/,"")+"\n"+u+"\n\n"}},$m.horizontalRule={filter:"hr",replacement:function(e,t,i){return"\n\n"+i.hr+"\n\n"}},$m.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var i=t.getAttribute("href"),a=Km(t.getAttribute("title"));return a&&(a=' "'+a+'"'),"["+e+"]("+i+a+")"}},$m.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,i){var a,n,r=t.getAttribute("href"),o=Km(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),i.linkReferenceStyle){case"collapsed":a="["+e+"][]",n="["+e+"]: "+r+o;break;case"shortcut":a="["+e+"]",n="["+e+"]: "+r+o;break;default:var s=this.references.length+1;a="["+e+"]["+s+"]",n="["+s+"]: "+r+o}return this.references.push(n),a},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},$m.emphasis={filter:["em","i"],replacement:function(e,t,i){return e.trim()?i.emDelimiter+e+i.emDelimiter:""}},$m.strong={filter:["strong","b"],replacement:function(e,t,i){return e.trim()?i.strongDelimiter+e+i.strongDelimiter:""}},$m.code={filter:function(e){var t=e.previousSibling||e.nextSibling,i="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!i},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",i="`",a=e.match(/`+/gm)||[];-1!==a.indexOf(i);)i+="`";return i+t+e+t+i}},$m.image={filter:"img",replacement:function(e,t){var i=Km(t.getAttribute("alt")),a=t.getAttribute("src")||"",n=Km(t.getAttribute("title"));return a?"!["+i+"]("+a+(n?' "'+n+'"':"")+")":""}},Qm.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=Zm(this.array,e,this.options))||(t=Zm(this._keep,e,this.options))||(t=Zm(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 tF="undefined"!=typeof window?window:{};var iF,aF,nF=function(){var e=tF.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?tF.DOMParser:(iF=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?iF.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:iF.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},iF);function rF(e,t){var i;"string"==typeof e?i=(aF=aF||new nF).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):i=e.cloneNode(!0);return function(e){var t=e.element,i=e.isBlock,a=e.isVoid,n=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!n(t)){for(var r=null,o=!1,s=null,l=eF(s,t,n);l!==t;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \r\n\t]+/g," ");if(r&&!/ $/.test(r.data)||o||" "!==u[0]||(u=u.substr(1)),!u){l=Jm(l);continue}l.data=u,r=l}else{if(1!==l.nodeType){l=Jm(l);continue}i(l)||"BR"===l.nodeName?(r&&(r.data=r.data.replace(/ $/,"")),r=null,o=!1):a(l)||n(l)?(r=null,o=!0):r&&(o=!1)}var d=eF(s,l,n);s=l,l=d}r&&(r.data=r.data.replace(/ $/,""),r.data||Jm(r))}}({element:i,isBlock:zm,isVoid:Hm,isPre:t.preformattedCode?oF:null}),i}function oF(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function sF(e,t){return e.isBlock=zm(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!Hm(e)&&!function(e){return Wm(e,Ym)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return Vm(e,Gm)}(e)&&!function(e){return Vm(e,Ym)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var i=(a=e.textContent,n=a.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/),{leading:n[1],leadingAscii:n[2],leadingNonAscii:n[3],trailing:n[4],trailingNonAscii:n[5],trailingAscii:n[6]});var a,n;i.leadingAscii&&lF("left",e,t)&&(i.leading=i.leadingNonAscii);i.trailingAscii&&lF("right",e,t)&&(i.trailing=i.trailingNonAscii);return{leading:i.leading,trailing:i.trailing}}(e,t),e}function lF(e,t,i){var a,n,r;return"left"===e?(a=t.previousSibling,n=/ $/):(a=t.nextSibling,n=/^ /),a&&(3===a.nodeType?r=n.test(a.nodeValue):i.preformattedCode&&"CODE"===a.nodeName?r=!1:1!==a.nodeType||zm(a)||(r=n.test(a.textContent))),r}var uF=Array.prototype.reduce,dF=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function _F(e){if(!(this instanceof _F))return new _F(e);var t={rules:$m,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}({},t,e),this.rules=new Qm(this.options)}function cF(e){var t=this;return uF.call(e.childNodes,(function(e,i){var a="";return 3===(i=new sF(i,t.options)).nodeType?a=i.isCode?i.nodeValue:t.escape(i.nodeValue):1===i.nodeType&&(a=fF.call(t,i)),hF(e,a)}),"")}function gF(e){var t=this;return this.rules.forEach((function(i){"function"==typeof i.append&&(e=hF(e,i.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function fF(e){var t=this.rules.forNode(e),i=cF.call(this,e),a=e.flankingWhitespace;return(a.leading||a.trailing)&&(i=i.trim()),a.leading+t.replacement(i,e,this.options)+a.trailing}function hF(e,t){var i=function(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),a=t.replace(/^\n*/,""),n=Math.max(e.length-i.length,t.length-a.length);return i+"\n\n".substring(0,n)+a}_F.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=cF.call(this,new rF(e,this.options));return gF.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 dF.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};var pF=_F,mF=function(e){e=e.replaceAll(/^\\$/gm,"<p></p>");var t=jm.marked.parse(e,{sanitize:!1});return t=(t=(t=(t=t.replaceAll(/<p><img[^>]*><\/p>/g,(function(e){return e.replace(/<\/?p>/g,"")}))).replaceAll(/!\[(.*?)\]\((.*?)\)/g,(function(e,t,i){return'<img src="'.concat(i,'" alt="').concat(t,'">')}))).replaceAll(/==([^=]+)==/g,"<mark>$1</mark>")).replaceAll(/--([^-]+)--/g,"<u>$1</u>"),Pm.a.sanitize(t,{ADD_TAGS:["iframe"]})},FF=function(e){var t=new pF({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){return t.isBlock?"\\\n":""}});return t.keep(["iframe"]),t.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~".concat(e,"~")}}),t.addRule("highlight",{filter:["mark"],replacement:function(e){return"==".concat(e,"==")}}),t.addRule("underline",{filter:["u"],replacement:function(e){return"--".concat(e,"--")}}),t.turndown(e)},bF=function(e){var t=document.createElement("div");return t.innerHTML=e,t.textContent},EF=function(e){var t=e.content,i=e.onUpdate,a=e.onSubmit,n=e.markdownMode,r=Object(p.useState)((function(){return t?{content:FF(t),length:bF(t).length}:{content:"",length:0}})),o=g()(r,2),s=o[0],l=o[1],u=Object(p.useRef)(),d=Object(p.useRef)();d.current=s.content;var _=Object(p.useCallback)((function(e){if(u.current){var t=FF(e),i=bF(e);l({content:t,length:i.length}),u.current.textContent=t}}),[l]),c=Object(p.useCallback)((function(){return mF(d.current)}),[d]),f=Object(p.useCallback)((function(){var e=c();return bF(e)}),[d]),h=Object(p.useCallback)((function(e){var t;if(n&&"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null===(t=u.current)||void 0===t||t.blur(),a)){var i=c();a({markdown:d.current,html:i})}}),[d,n]);Object(p.useEffect)((function(){return document.addEventListener("keydown",h),function(){document.removeEventListener("keydown",h)}}),[h]),Object(p.useEffect)((function(){u.current&&(u.current.textContent=d.current)}),[u,d]);var m=Object(p.useMemo)((function(){return{setContent:_}}),[_]);return{inputFieldRef:u,state:s,onChange:function(e){var t=mF(e),a=bF(t);l({content:e,length:a.length}),i({markdown:e,html:t})},isEmpty:s.length<=0,getHTML:c,getText:f,commands:m}};const yF=/^\s*>\s$/,DF=cs.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",ns(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:yF,type:this.type})]}}),vF=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,kF=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,SF=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,wF=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,CF=gs.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",ns(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:vF,type:this.type}),ps({find:SF,type:this.type})]},addPasteRules(){return[Es({find:kF,type:this.type}),Es({find:wF,type:this.type})]}}),xF=/^\s*([-+*])\s$/,TF=cs.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",ns(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:xF,type:this.type})]}}),OF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,NF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,AF=gs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",ns(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:OF,type:this.type})]},addPasteRules(){return[Es({find:NF,type:this.type})]}}),RF=/^```(?<language>[a-z]*)?[\s\n]$/,MF=/^~~~(?<language>[a-z]*)?[\s\n]$/,IF=cs.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:i}=this.options,a=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(i)).map(e=>e.replace(i,""))[0];return a||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands:()=>({setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,i=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!i&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[ms({find:RF,type:this.type,getAttributes:({groups:e})=>e}),ms({find:MF,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Rt({key:new Bt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const i=t.clipboardData.getData("text/plain"),a=t.clipboardData.getData("vscode-editor-data"),n=a?JSON.parse(a):void 0,r=null==n?void 0:n.mode;if(!i||!r)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:r})),o.setSelection(mt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(i.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}});var BF=cs.create({name:"doc",topNode:!0,content:"block+"});var LF=function(e,t){var i=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var a=function(e){return i[t](e)};return e.dom.addEventListener(t,a),{name:t,handler:a}}))};LF.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var i=t.name,a=t.handler;return e.editorView.dom.removeEventListener(i,a)}))},LF.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())},LF.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},LF.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var i=t.nodeBefore,a=t.nodeAfter;if(i||a){var n=this.editorView.nodeDOM(this.cursorPos-(i?i.nodeSize:0)).getBoundingClientRect(),r=i?n.bottom:n.top;i&&a&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:n.left,right:n.right,top:r-this.width/2,bottom:r+this.width/2}}}if(!e){var o=this.editorView.coordsAtPos(this.cursorPos);e={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var 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"},LF.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},LF.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Je(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},LF.prototype.dragend=function(){this.scheduleRemoval(20)},LF.prototype.drop=function(){this.scheduleRemoval(20)},LF.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const PF=mr.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Rt({view:function(t){return new LF(t,e)}}))];var e}});var jF=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,a){var n=i.resolve(a.map(this.head));return t.valid(n)?new t(n):e.near(n)},t.prototype.content=function(){return T.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(i.pos))},t.prototype.getBookmark=function(){return new qF(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var i=e.index(t);if(0!=i)for(var a=e.node(t).child(i-1);;a=a.lastChild){if(0==a.childCount&&!a.inlineContent||a.isAtom||a.type.spec.isolating)return!0;if(a.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var i=e.indexAfter(t),a=e.node(t);if(i!=a.childCount)for(var n=a.child(i);;n=n.firstChild){if(0==n.childCount&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}(e))return!1;var i=t.type.spec.allowGapCursor;if(null!=i)return i;var a=t.contentMatchAt(e.index()).defaultType;return a&&a.isTextblock},t.findFrom=function(e,i,a){e:for(;;){if(!a&&t.valid(e))return e;for(var n=e.pos,r=null,o=e.depth;;o--){var s=e.node(o);if(i>0?e.indexAfter(o)<s.childCount:e.index(o)>0){r=s.child(i>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;n+=i;var l=e.doc.resolve(n);if(t.valid(l))return l}for(;;){var u=i>0?r.firstChild:r.lastChild;if(!u){if(r.isAtom&&!r.isText&&!bt.isSelectable(r)){e=e.doc.resolve(n+r.nodeSize*i),a=!1;continue e}break}r=u,n+=i;var d=e.doc.resolve(n);if(t.valid(d))return d}return null}},t}(ft);jF.prototype.visible=!1,ft.jsonID("gapcursor",jF);var qF=function(e){this.pos=e};qF.prototype.map=function(e){return new qF(e.map(this.pos))},qF.prototype.resolve=function(e){var t=e.resolve(this.pos);return jF.valid(t)?new jF(t):ft.near(t)};var UF=_r({ArrowLeft:zF("horiz",-1),ArrowRight:zF("horiz",1),ArrowUp:zF("vert",-1),ArrowDown:zF("vert",1)});function zF(e,t){var i="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,a,n){var r=e.selection,o=t>0?r.$to:r.$from,s=r.empty;if(r instanceof mt){if(!n.endOfTextblock(i)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=jF.findFrom(o,t,s);return!!l&&(a&&a(e.tr.setSelection(new jF(l))),!0)}}function GF(e,t,i){if(!e.editable)return!1;var a=e.state.doc.resolve(t);if(!jF.valid(a))return!1;var n=e.posAtCoords({left:i.clientX,top:i.clientY}).inside;return!(n>-1&&bt.isSelectable(e.state.doc.nodeAt(n)))&&(e.dispatch(e.state.tr.setSelection(new jF(a))),!0)}function HF(e){if(!(e.selection instanceof jF))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Mn.create(e.doc,[On.widget(e.selection.head,t,{key:"gapcursor"})])}const YF=mr.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Rt({props:{decorations:HF,createSelectionBetween:function(e,t,i){if(t.pos==i.pos&&jF.valid(i))return new jF(i)},handleClick:GF,handleKeyDown:UF}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=hr(pr(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),WF=cs.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",ns(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:i,editor:a})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:n}=a.extensionManager,r=i.storedMarks||i.selection.$to.parentOffset&&i.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:i})=>{if(i&&r&&e){const e=r.filter(e=>n.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),VF=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]),ns(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 $F=function(){};$F.prototype.append=function(e){return e.length?(e=$F.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},$F.prototype.prepend=function(e){return e.length?$F.from(e).append(this):this},$F.prototype.appendInner=function(e){return new QF(this,e)},$F.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?$F.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},$F.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},$F.prototype.forEach=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length),t<=i?this.forEachInner(e,t,i,0):this.forEachInvertedInner(e,t,i,0)},$F.prototype.map=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length);var a=[];return this.forEach((function(t,i){return a.push(e(t,i))}),t,i),a},$F.from=function(e){return e instanceof $F?e:e&&e.length?new KF(e):$F.empty};var KF=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,i){return 0==e&&i==this.length?this:new t(this.values.slice(e,i))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,i,a){for(var n=t;n<i;n++)if(!1===e(this.values[n],a+n))return!1},t.prototype.forEachInvertedInner=function(e,t,i,a){for(var n=t-1;n>=i;n--)if(!1===e(this.values[n],a+n))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},i.length.get=function(){return this.values.length},i.depth.get=function(){return 0},Object.defineProperties(t.prototype,i),t}($F);$F.empty=new KF([]);var QF=function(e){function t(t,i){e.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,i,a){var n=this.left.length;return!(t<n&&!1===this.left.forEachInner(e,t,Math.min(i,n),a))&&(!(i>n&&!1===this.right.forEachInner(e,Math.max(t-n,0),Math.min(this.length,i)-n,a+n))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,i,a){var n=this.left.length;return!(t>n&&!1===this.right.forEachInvertedInner(e,t-n,Math.max(i,n)-n,a+n))&&(!(i<n&&!1===this.left.forEachInvertedInner(e,Math.min(t,n),i,a))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var i=this.left.length;return t<=i?this.left.slice(e,t):e>=i?this.right.slice(e-i,t-i):this.left.slice(e,i).append(this.right.slice(0,t-i))},t.prototype.leafAppend=function(e){var i=this.right.leafAppend(e);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(e){var i=this.left.leafPrepend(e);if(i)return new t(i,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}($F),ZF=$F,XF=function(e,t){this.items=e,this.eventCount=t};XF.prototype.popEvent=function(e,t){var i=this;if(0==this.eventCount)return null;for(var a,n,r=this.items.length;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(a=this.remapping(r,this.items.length),n=a.maps.length);var o,s,l=e.tr,u=[],d=[];return this.items.forEach((function(e,t){if(!e.step)return a||(a=i.remapping(r,t+1),n=a.maps.length),n--,void d.push(e);if(a){d.push(new JF(e.map));var _,c=e.step.map(a.slice(n));c&&l.maybeStep(c).doc&&(_=l.mapping.maps[l.mapping.maps.length-1],u.push(new JF(_,null,null,u.length+d.length))),n--,_&&a.appendMap(_,n)}else l.maybeStep(e.step);return e.selection?(o=a?e.selection.map(a.slice(n)):e.selection,s=new XF(i.items.slice(0,r).append(d.reverse().concat(u)),i.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}},XF.prototype.addTransform=function(e,t,i,a){for(var n=[],r=this.eventCount,o=this.items,s=!a&&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 JF(e.mapping.maps[l],d,t);(u=s&&s.merge(_))&&(_=u,l?n.pop():o=o.slice(0,o.length-1)),n.push(_),t&&(r++,t=null),a||(s=_)}var c,g,f,h=r-i.depth;return h>tb&&(g=h,(c=o).forEach((function(e,t){if(e.selection&&0==g--)return f=t,!1})),o=c.slice(f),r-=h),new XF(o.append(n),r)},XF.prototype.remapping=function(e,t){var i=new Ie;return this.items.forEach((function(t,a){var n=null!=t.mirrorOffset&&a-t.mirrorOffset>=e?i.maps.length-t.mirrorOffset:null;i.appendMap(t.map,n)}),e,t),i},XF.prototype.addMaps=function(e){return 0==this.eventCount?this:new XF(this.items.append(e.map((function(e){return new JF(e)}))),this.eventCount)},XF.prototype.rebased=function(e,t){if(!this.eventCount)return this;var i=[],a=Math.max(0,this.items.length-t),n=e.mapping,r=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),a);var s=t;this.items.forEach((function(t){var a=n.getMirror(--s);if(null!=a){r=Math.min(r,a);var l=n.maps[a];if(t.step){var u=e.steps[a].invert(e.docs[a]),d=t.selection&&t.selection.map(n.slice(s+1,a));d&&o++,i.push(new JF(l,u,d))}else i.push(new JF(l))}}),a);for(var l=[],u=t;u<r;u++)l.push(new JF(n.maps[u]));var d=this.items.slice(0,a).append(l).append(i),_=new XF(d,o);return _.emptyItemCount()>500&&(_=_.compress(this.items.length-i.length)),_},XF.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},XF.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),i=t.maps.length,a=[],n=0;return this.items.forEach((function(r,o){if(o>=e)a.push(r),r.selection&&n++;else if(r.step){var s=r.step.map(t.slice(i)),l=s&&s.getMap();if(i--,l&&t.appendMap(l,i),s){var u=r.selection&&r.selection.map(t.slice(i));u&&n++;var d,_=new JF(l.invert(),s,u),c=a.length-1;(d=a.length&&a[c].merge(_))?a[c]=d:a.push(_)}}else r.map&&i--}),this.items.length,0),new XF(ZF.from(a.reverse()),n)},XF.empty=new XF(ZF.empty,0);var JF=function(e,t,i,a){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=a};JF.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new JF(t.getMap().invert(),t,this.selection)}};var eb=function(e,t,i,a){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=a},tb=20;function ib(e){var t=[];return e.forEach((function(e,i,a,n){return t.push(a,n)})),t}function ab(e,t){if(!e)return null;for(var i=[],a=0;a<e.length;a+=2){var n=t.map(e[a],1),r=t.map(e[a+1],-1);n<=r&&i.push(n,r)}return i}function nb(e,t,i,a){var n=sb(t),r=lb.get(t).spec.config,o=(a?e.undone:e.done).popEvent(t,n);if(o){var s=o.selection.resolve(o.transform.doc),l=(a?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),r,n),u=new eb(a?l:o.remaining,a?o.remaining:l,null,0);i(o.transform.setSelection(s).setMeta(lb,{redo:a,historyState:u}).scrollIntoView())}}var rb=!1,ob=null;function sb(e){var t=e.plugins;if(ob!=t){rb=!1,ob=t;for(var i=0;i<t.length;i++)if(t[i].spec.historyPreserveItems){rb=!0;break}}return rb}var lb=new Bt("history"),ub=new Bt("closeHistory");function db(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Rt({key:lb,state:{init:function(){return new eb(XF.empty,XF.empty,null,0)},apply:function(t,i,a){return function(e,t,i,a){var n,r=i.getMeta(lb);if(r)return r.historyState;i.getMeta(ub)&&(e=new eb(e.done,e.undone,null,0));var o=i.getMeta("appendedTransaction");if(0==i.steps.length)return e;if(o&&o.getMeta(lb))return o.getMeta(lb).redo?new eb(e.done.addTransform(i,null,a,sb(t)),e.undone,ib(i.mapping.maps[i.steps.length-1]),e.prevTime):new eb(e.done,e.undone.addTransform(i,null,a,sb(t)),null,e.prevTime);if(!1===i.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(n=i.getMeta("rebased"))?new eb(e.done.rebased(i,n),e.undone.rebased(i,n),ab(e.prevRanges,i.mapping),e.prevTime):new eb(e.done.addMaps(i.mapping.maps),e.undone.addMaps(i.mapping.maps),ab(e.prevRanges,i.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(i.time||0)-a.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var i=!1;return e.mapping.maps[0].forEach((function(e,a){for(var n=0;n<t.length;n+=2)e<=t[n+1]&&a>=t[n]&&(i=!0)})),i}(i,e.prevRanges)),l=o?ab(e.prevRanges,i.mapping):ib(i.mapping.maps[i.steps.length-1]);return new eb(e.done.addTransform(i,s?t.selection.getBookmark():null,a,sb(t)),XF.empty,l,i.time)}(i,a,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var i="historyUndo"==t.inputType?_b(e.state,e.dispatch):"historyRedo"==t.inputType&&cb(e.state,e.dispatch);return i&&t.preventDefault(),i}}}})}function _b(e,t){var i=lb.getState(e);return!(!i||0==i.done.eventCount)&&(t&&nb(i,e,t,!1),!0)}function cb(e,t){var i=lb.getState(e);return!(!i||0==i.undone.eventCount)&&(t&&nb(i,e,t,!0),!0)}const gb=mr.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>_b(e,t),redo:()=>({state:e,dispatch:t})=>cb(e,t)}),addProseMirrorPlugins(){return[db(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()}}}),fb=cs.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",ns(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:i}=e,{empty:a,$anchor:n}=i,r=n.parent.isTextblock&&!n.parent.type.spec.code&&!n.parent.textContent;if(!a||!r||!t)return!0;const o=n.before(),s=n.start();return e.deleteRange(o,s),e.setSelection(mt.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var i;if(t){const{parent:t,pos:a}=e.selection.$from,n=a+1;if(!e.doc.nodeAt(n)){const a=null===(i=t.type.contentMatch.defaultType)||void 0===i?void 0:i.create();a&&(e.insert(n,a),e.setSelection(mt.create(e.doc,n)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[fs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),hb=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,pb=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,mb=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Fb=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,bb=gs.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",ns(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:hb,type:this.type}),ps({find:mb,type:this.type})]},addPasteRules(){return[Es({find:pb,type:this.type}),Es({find:Fb,type:this.type})]}}),Eb=cs.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",ns(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")}}}),yb=/^(\d+)\.\s$/,Db=cs.create({name:"orderedList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...i}=e;return 1===t?["ol",ns(this.options.HTMLAttributes,i),0]:["ol",ns(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:yb,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),vb=cs.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),kb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Sb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,wb=gs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",ns(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:kb,type:this.type})]},addPasteRules(){return[Es({find:Sb,type:this.type})]}});var Cb=cs.create({name:"text",group:"inline"});const xb=mr.create({name:"starterKit",addExtensions(){var e,t,i,a,n,r,o,s,l,u,d,_,c,g,f,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(DF.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(CF.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(TF.configure(null===(i=this.options)||void 0===i?void 0:i.bulletList)),!1!==this.options.code&&F.push(AF.configure(null===(a=this.options)||void 0===a?void 0:a.code)),!1!==this.options.codeBlock&&F.push(IF.configure(null===(n=this.options)||void 0===n?void 0:n.codeBlock)),!1!==this.options.document&&F.push(BF.configure(null===(r=this.options)||void 0===r?void 0:r.document)),!1!==this.options.dropcursor&&F.push(PF.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(YF.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(WF.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push(VF.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push(gb.configure(null===(d=this.options)||void 0===d?void 0:d.history)),!1!==this.options.horizontalRule&&F.push(fb.configure(null===(_=this.options)||void 0===_?void 0:_.horizontalRule)),!1!==this.options.italic&&F.push(bb.configure(null===(c=this.options)||void 0===c?void 0:c.italic)),!1!==this.options.listItem&&F.push(Eb.configure(null===(g=this.options)||void 0===g?void 0:g.listItem)),!1!==this.options.orderedList&&F.push(Db.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&F.push(vb.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(wb.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(Cb.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),Tb=Fs({find:/--$/,replace:"—"}),Ob=Fs({find:/\.\.\.$/,replace:"…"}),Nb=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),Ab=Fs({find:/"$/,replace:"”"}),Rb=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),Mb=Fs({find:/'$/,replace:"’"}),Ib=Fs({find:/<-$/,replace:"←"}),Bb=Fs({find:/->$/,replace:"→"}),Lb=Fs({find:/\(c\)$/,replace:"©"}),Pb=Fs({find:/\(tm\)$/,replace:"™"}),jb=Fs({find:/\(r\)$/,replace:"®"}),qb=Fs({find:/1\/2$/,replace:"½"}),Ub=Fs({find:/\+\/-$/,replace:"±"}),zb=Fs({find:/!=$/,replace:"≠"}),Gb=Fs({find:/<<$/,replace:"«"}),Hb=Fs({find:/>>$/,replace:"»"}),Yb=Fs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),Wb=Fs({find:/\^2$/,replace:"²"}),Vb=Fs({find:/\^3$/,replace:"³"}),$b=Fs({find:/1\/4$/,replace:"¼"}),Kb=Fs({find:/3\/4$/,replace:"¾"}),Qb=mr.create({name:"typography",addInputRules:()=>[Tb,Ob,Nb,Ab,Rb,Mb,Ib,Bb,Lb,Pb,jb,qb,Ub,zb,Gb,Hb,Yb,Wb,Vb,$b,Kb]}),Zb=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,Xb=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,Jb=gs.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:"background-color: "+e.color}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",ns(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:Zb,type:this.type})]},addPasteRules(){return[Es({find:Xb,type:this.type})]}});var eE=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var i=0;i<e.length;i++)this.size+=e[i].nodeSize},tE={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};eE.prototype.nodesBetween=function(e,t,i,a,n){void 0===a&&(a=0);for(var r=0,o=0;o<t;r++){var s=this.content[r],l=o+s.nodeSize;if(l>e&&!1!==i(s,a+o,n,r)&&s.content.size){var u=o+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),i,a+u)}o=l}},eE.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},eE.prototype.textBetween=function(e,t,i,a){var n="",r=!0;return this.nodesBetween(e,t,(function(o,s){o.isText?(n+=o.text.slice(Math.max(e,s)-s,t-s),r=!i):o.isLeaf&&a?(n+="function"==typeof a?a(o):a,r=!i):!r&&o.isBlock&&(n+=i,r=!0)}),0),n},eE.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,i=e.firstChild,a=this.content.slice(),n=0;for(t.isText&&t.sameMarkup(i)&&(a[a.length-1]=t.withText(t.text+i.text),n=1);n<e.content.length;n++)a.push(e.content[n]);return new eE(a,this.size+e.size)},eE.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var i=[],a=0;if(t>e)for(var n=0,r=0;r<t;n++){var o=this.content[n],s=r+o.nodeSize;s>e&&((r<e||s>t)&&(o=o.isText?o.cut(Math.max(0,e-r),Math.min(o.text.length,t-r)):o.cut(Math.max(0,e-r-1),Math.min(o.content.size,t-r-1))),i.push(o),a+=o.nodeSize),r=s}return new eE(i,a)},eE.prototype.cutByIndex=function(e,t){return e==t?eE.empty:0==e&&t==this.content.length?this:new eE(this.content.slice(e,t))},eE.prototype.replaceChild=function(e,t){var i=this.content[e];if(i==t)return this;var a=this.content.slice(),n=this.size+t.nodeSize-i.nodeSize;return a[e]=t,new eE(a,n)},eE.prototype.addToStart=function(e){return new eE([e].concat(this.content),this.size+e.nodeSize)},eE.prototype.addToEnd=function(e){return new eE(this.content.concat(e),this.size+e.nodeSize)},eE.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},tE.firstChild.get=function(){return this.content.length?this.content[0]:null},tE.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},tE.childCount.get=function(){return this.content.length},eE.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},eE.prototype.maybeChild=function(e){return this.content[e]},eE.prototype.forEach=function(e){for(var t=0,i=0;t<this.content.length;t++){var a=this.content[t];e(a,i,t),i+=a.nodeSize}},eE.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,i,a){for(var n=0;;n++){if(n==t.childCount||n==i.childCount)return t.childCount==i.childCount?null:a;var r=t.child(n),o=i.child(n);if(r!=o){if(!r.sameMarkup(o))return a;if(r.isText&&r.text!=o.text){for(var s=0;r.text[s]==o.text[s];s++)a++;return a}if(r.content.size||o.content.size){var l=e(r.content,o.content,a+1);if(null!=l)return l}a+=r.nodeSize}else a+=r.nodeSize}}(this,e,t)},eE.prototype.findDiffEnd=function(e,t,i){return void 0===t&&(t=this.size),void 0===i&&(i=e.size),function e(t,i,a,n){for(var r=t.childCount,o=i.childCount;;){if(0==r||0==o)return r==o?null:{a:a,b:n};var s=t.child(--r),l=i.child(--o),u=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:a,b:n};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++,a--,n--;return{a:a,b:n}}if(s.content.size||l.content.size){var c=e(s.content,l.content,a-1,n-1);if(c)return c}a-=u,n-=u}else a-=u,n-=u}}(this,e,t,i)},eE.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return aE(0,e);if(e==this.size)return aE(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var i=0,a=0;;i++){var n=a+this.child(i).nodeSize;if(n>=e)return n==e||t>0?aE(i+1,n):aE(i,a);a=n}},eE.prototype.toString=function(){return"<"+this.toStringInner()+">"},eE.prototype.toStringInner=function(){return this.content.join(", ")},eE.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},eE.fromJSON=function(e,t){if(!t)return eE.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new eE(t.map(e.nodeFromJSON))},eE.fromArray=function(e){if(!e.length)return eE.empty;for(var t,i=0,a=0;a<e.length;a++){var n=e[a];i+=n.nodeSize,a&&n.isText&&e[a-1].sameMarkup(n)?(t||(t=e.slice(0,a)),t[t.length-1]=n.withText(t[t.length-1].text+n.text)):t&&t.push(n)}return new eE(t||e,i)},eE.from=function(e){if(!e)return eE.empty;if(e instanceof eE)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new eE([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(eE.prototype,tE);var iE={index:0,offset:0};function aE(e,t){return iE.index=e,iE.offset=t,iE}function nE(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var i=Array.isArray(e);if(Array.isArray(t)!=i)return!1;if(i){if(e.length!=t.length)return!1;for(var a=0;a<e.length;a++)if(!nE(e[a],t[a]))return!1}else{for(var n in e)if(!(n in t)||!nE(e[n],t[n]))return!1;for(var r in t)if(!(r in e))return!1}return!0}eE.empty=new eE([],0);var rE=function(e,t){this.type=e,this.attrs=t};function oE(e){var t=Error.call(this,e);return t.__proto__=oE.prototype,t}rE.prototype.addToSet=function(e){for(var t,i=!1,a=0;a<e.length;a++){var n=e[a];if(this.eq(n))return e;if(this.type.excludes(n.type))t||(t=e.slice(0,a));else{if(n.type.excludes(this.type))return e;!i&&n.type.rank>this.type.rank&&(t||(t=e.slice(0,a)),t.push(this),i=!0),t&&t.push(n)}}return t||(t=e.slice()),i||t.push(this),t},rE.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},rE.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},rE.prototype.eq=function(e){return this==e||this.type==e.type&&nE(this.attrs,e.attrs)},rE.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},rE.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var i=e.marks[t.type];if(!i)throw new RangeError("There is no mark type "+t.type+" in this schema");return i.create(t.attrs)},rE.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0},rE.setFrom=function(e){if(!e||0==e.length)return rE.none;if(e instanceof rE)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},rE.none=[],oE.prototype=Object.create(Error.prototype),oE.prototype.constructor=oE,oE.prototype.name="ReplaceError";var sE=function(e,t,i){this.content=e,this.openStart=t,this.openEnd=i},lE={size:{configurable:!0}};function uE(e,t,i){if(i.openStart>e.depth)throw new oE("Inserted content deeper than insertion position");if(e.depth-i.openStart!=t.depth-i.openEnd)throw new oE("Inconsistent open depths");return function e(t,i,a,n){var r=t.index(n),o=t.node(n);if(r==i.index(n)&&n<t.depth-a.openStart){var s=e(t,i,a,n+1);return o.copy(o.content.replaceChild(r,s))}if(a.content.size){if(a.openStart||a.openEnd||t.depth!=n||i.depth!=n){var l=function(e,t){for(var i=t.depth-e.openStart,a=t.node(i).copy(e.content),n=i-1;n>=0;n--)a=t.node(n).copy(eE.from(a));return{start:a.resolveNoCache(e.openStart+i),end:a.resolveNoCache(a.content.size-e.openEnd-i)}}(a,t),u=l.start,d=l.end;return fE(o,function e(t,i,a,n,r){var o=t.depth>r&&_E(t,i,r+1),s=n.depth>r&&_E(a,n,r+1),l=[];gE(null,t,r,l),o&&s&&i.index(r)==a.index(r)?(dE(o,s),cE(fE(o,e(t,i,a,n,r+1)),l)):(o&&cE(fE(o,hE(t,i,r+1)),l),gE(i,a,r,l),s&&cE(fE(s,hE(a,n,r+1)),l));return gE(n,null,r,l),new eE(l)}(t,u,d,i,n))}var _=t.parent,c=_.content;return fE(_,c.cut(0,t.parentOffset).append(a.content).append(c.cut(i.parentOffset)))}return fE(o,hE(t,i,n))}(e,t,i,0)}function dE(e,t){if(!t.type.compatibleContent(e.type))throw new oE("Cannot join "+t.type.name+" onto "+e.type.name)}function _E(e,t,i){var a=e.node(i);return dE(a,t.node(i)),a}function cE(e,t){var i=t.length-1;i>=0&&e.isText&&e.sameMarkup(t[i])?t[i]=e.withText(t[i].text+e.text):t.push(e)}function gE(e,t,i,a){var n=(t||e).node(i),r=0,o=t?t.index(i):n.childCount;e&&(r=e.index(i),e.depth>i?r++:e.textOffset&&(cE(e.nodeAfter,a),r++));for(var s=r;s<o;s++)cE(n.child(s),a);t&&t.depth==i&&t.textOffset&&cE(t.nodeBefore,a)}function fE(e,t){if(!e.type.validContent(t))throw new oE("Invalid content for node "+e.type.name);return e.copy(t)}function hE(e,t,i){var a=[];(gE(null,e,i,a),e.depth>i)&&cE(fE(_E(e,t,i+1),hE(e,t,i+1)),a);return gE(t,null,i,a),new eE(a)}lE.size.get=function(){return this.content.size-this.openStart-this.openEnd},sE.prototype.insertAt=function(e,t){var i=function e(t,i,a,n){var r=t.findIndex(i),o=r.index,s=r.offset,l=t.maybeChild(o);if(s==i||l.isText)return n&&!n.canReplace(o,o,a)?null:t.cut(0,i).append(a).append(t.cut(i));var u=e(l.content,i-s-1,a);return u&&t.replaceChild(o,l.copy(u))}(this.content,e+this.openStart,t,null);return i&&new sE(i,this.openStart,this.openEnd)},sE.prototype.removeBetween=function(e,t){return new sE(function e(t,i,a){var n=t.findIndex(i),r=n.index,o=n.offset,s=t.maybeChild(r),l=t.findIndex(a),u=l.index,d=l.offset;if(o==i||s.isText){if(d!=a&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,i).append(t.cut(a))}if(r!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(e(s.content,i-o-1,a-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},sE.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},sE.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},sE.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},sE.fromJSON=function(e,t){if(!t)return sE.empty;var i=t.openStart||0,a=t.openEnd||0;if("number"!=typeof i||"number"!=typeof a)throw new RangeError("Invalid input for Slice.fromJSON");return new sE(eE.fromJSON(e,t.content),i,a)},sE.maxOpen=function(e,t){void 0===t&&(t=!0);for(var i=0,a=0,n=e.firstChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.firstChild)i++;for(var r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)a++;return new sE(e,i,a)},Object.defineProperties(sE.prototype,lE),sE.empty=new sE(eE.empty,0,0);var pE=function(e,t,i){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=i},mE={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};pE.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},mE.parent.get=function(){return this.node(this.depth)},mE.doc.get=function(){return this.node(0)},pE.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},pE.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},pE.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},pE.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},pE.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},pE.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]},pE.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},mE.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},mE.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var i=this.pos-this.path[this.path.length-1],a=e.child(t);return i?e.child(t).cut(i):a},mE.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)},pE.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var i=this.path[3*t],a=0==t?0:this.path[3*t-1]+1,n=0;n<e;n++)a+=i.child(n).nodeSize;return a},pE.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return rE.none;if(this.textOffset)return e.child(t).marks;var i=e.maybeChild(t-1),a=e.maybeChild(t);if(!i){var n=i;i=a,a=n}for(var r=i.marks,o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||a&&r[o].isInSet(a.marks)||(r=r[o--].removeFromSet(r));return r},pE.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var i=t.marks,a=e.parent.maybeChild(e.index()),n=0;n<i.length;n++)!1!==i[n].type.spec.inclusive||a&&i[n].isInSet(a.marks)||(i=i[n--].removeFromSet(i));return i},pE.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},pE.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new yE(this,e,i)},pE.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},pE.prototype.max=function(e){return e.pos>this.pos?e:this},pE.prototype.min=function(e){return e.pos<this.pos?e:this},pE.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},pE.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var i=[],a=0,n=t,r=e;;){var o=r.content.findIndex(n),s=o.index,l=o.offset,u=n-l;if(i.push(r,s,a+l),!u)break;if((r=r.child(s)).isText)break;n=u-1,a+=l+1}return new pE(t,i,n)},pE.resolveCached=function(e,t){for(var i=0;i<FE.length;i++){var a=FE[i];if(a.pos==t&&a.doc==e)return a}var n=FE[bE]=pE.resolve(e,t);return bE=(bE+1)%EE,n},Object.defineProperties(pE.prototype,mE);var FE=[],bE=0,EE=12,yE=function(e,t,i){this.$from=e,this.$to=t,this.depth=i},DE={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};DE.start.get=function(){return this.$from.before(this.depth+1)},DE.end.get=function(){return this.$to.after(this.depth+1)},DE.parent.get=function(){return this.$from.node(this.depth)},DE.startIndex.get=function(){return this.$from.index(this.depth)},DE.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(yE.prototype,DE);var vE=Object.create(null),kE=function(e,t,i,a){this.type=e,this.attrs=t,this.content=i||eE.empty,this.marks=a||rE.none},SE={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}};SE.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},SE.childCount.get=function(){return this.content.childCount},kE.prototype.child=function(e){return this.content.child(e)},kE.prototype.maybeChild=function(e){return this.content.maybeChild(e)},kE.prototype.forEach=function(e){this.content.forEach(e)},kE.prototype.nodesBetween=function(e,t,i,a){void 0===a&&(a=0),this.content.nodesBetween(e,t,i,a,this)},kE.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},SE.textContent.get=function(){return this.textBetween(0,this.content.size,"")},kE.prototype.textBetween=function(e,t,i,a){return this.content.textBetween(e,t,i,a)},SE.firstChild.get=function(){return this.content.firstChild},SE.lastChild.get=function(){return this.content.lastChild},kE.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},kE.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},kE.prototype.hasMarkup=function(e,t,i){return this.type==e&&nE(this.attrs,t||e.defaultAttrs||vE)&&rE.sameSet(this.marks,i||rE.none)},kE.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},kE.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},kE.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},kE.prototype.slice=function(e,t,i){if(void 0===t&&(t=this.content.size),void 0===i&&(i=!1),e==t)return sE.empty;var a=this.resolve(e),n=this.resolve(t),r=i?0:a.sharedDepth(t),o=a.start(r),s=a.node(r).content.cut(a.pos-o,n.pos-o);return new sE(s,a.depth-r,n.depth-r)},kE.prototype.replace=function(e,t,i){return uE(this.resolve(e),this.resolve(t),i)},kE.prototype.nodeAt=function(e){for(var t=this;;){var i=t.content.findIndex(e),a=i.index,n=i.offset;if(!(t=t.maybeChild(a)))return null;if(n==e||t.isText)return t;e-=n+1}},kE.prototype.childAfter=function(e){var t=this.content.findIndex(e),i=t.index,a=t.offset;return{node:this.content.maybeChild(i),index:i,offset:a}},kE.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),i=t.index,a=t.offset;if(a<e)return{node:this.content.child(i),index:i,offset:a};var n=this.content.child(i-1);return{node:n,index:i-1,offset:a-n.nodeSize}},kE.prototype.resolve=function(e){return pE.resolveCached(this,e)},kE.prototype.resolveNoCache=function(e){return pE.resolve(this,e)},kE.prototype.rangeHasMark=function(e,t,i){var a=!1;return t>e&&this.nodesBetween(e,t,(function(e){return i.isInSet(e.marks)&&(a=!0),!a})),a},SE.isBlock.get=function(){return this.type.isBlock},SE.isTextblock.get=function(){return this.type.isTextblock},SE.inlineContent.get=function(){return this.type.inlineContent},SE.isInline.get=function(){return this.type.isInline},SE.isText.get=function(){return this.type.isText},SE.isLeaf.get=function(){return this.type.isLeaf},SE.isAtom.get=function(){return this.type.isAtom},kE.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),function(e,t){for(var i=e.length-1;i>=0;i--)t=e[i].type.name+"("+t+")";return t}(this.marks,e)},kE.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},kE.prototype.canReplace=function(e,t,i,a,n){void 0===i&&(i=eE.empty),void 0===a&&(a=0),void 0===n&&(n=i.childCount);var r=this.contentMatchAt(e).matchFragment(i,a,n),o=r&&r.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(var s=a;s<n;s++)if(!this.type.allowsMarks(i.child(s).marks))return!1;return!0},kE.prototype.canReplaceWith=function(e,t,i,a){if(a&&!this.type.allowsMarks(a))return!1;var n=this.contentMatchAt(e).matchType(i),r=n&&n.matchFragment(this.content,t);return!!r&&r.validEnd},kE.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},kE.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=rE.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!rE.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()}))},kE.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},kE.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var i=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}var a=eE.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,a,i)},Object.defineProperties(kE.prototype,SE);var wE=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},CE={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};wE.parse=function(e,t){var i=new xE(e,t);if(null==i.next)return wE.empty;var a=OE(i);i.next&&i.err("Unexpected trailing text");var n=function(e){var t=Object.create(null);return function i(a){var n=[];a.forEach((function(t){e[t].forEach((function(t){var i=t.term,a=t.to;if(i){var r=n.indexOf(i),o=r>-1&&n[r+1];BE(e,a).forEach((function(e){o||n.push(i,o=[]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var r=t[a.join(",")]=new wE(a.indexOf(e.length-1)>-1),o=0;o<n.length;o+=2){var s=n[o+1].sort(IE);r.next.push(n[o],t[s.join(",")]||i(s))}return r}(BE(e,0))}(function(e){var t=[[]];return n(function e(t,r){if("choice"==t.type)return t.exprs.reduce((function(t,i){return t.concat(e(i,r))}),[]);if("seq"==t.type)for(var o=0;;o++){var s=e(t.exprs[o],r);if(o==t.exprs.length-1)return s;n(s,r=i())}else{if("star"==t.type){var l=i();return a(r,l),n(e(t.expr,l),l),[a(l)]}if("plus"==t.type){var u=i();return n(e(t.expr,r),u),n(e(t.expr,u),u),[a(u)]}if("opt"==t.type)return[a(r)].concat(e(t.expr,r));if("range"==t.type){for(var d=r,_=0;_<t.min;_++){var c=i();n(e(t.expr,d),c),d=c}if(-1==t.max)n(e(t.expr,d),d);else for(var g=t.min;g<t.max;g++){var f=i();a(d,f),n(e(t.expr,d),f),d=f}return[a(d)]}if("name"==t.type)return[a(r,null,t.value)]}}(e,0),i()),t;function i(){return t.push([])-1}function a(e,i,a){var n={term:a,to:i};return t[e].push(n),n}function n(e,t){e.forEach((function(e){return e.to=t}))}}(a));return function(e,t){for(var i=0,a=[e];i<a.length;i++){for(var n=a[i],r=!n.validEnd,o=[],s=0;s<n.next.length;s+=2){var l=n.next[s],u=n.next[s+1];o.push(l.name),!r||l.isText||l.hasRequiredAttrs()||(r=!1),-1==a.indexOf(u)&&a.push(u)}r&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(n,i),n},wE.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},wE.prototype.matchFragment=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.childCount);for(var a=this,n=t;a&&n<i;n++)a=a.matchType(e.child(n).type);return a},CE.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},CE.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}},wE.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var i=0;i<e.next.length;i+=2)if(this.next[t]==e.next[i])return!0;return!1},wE.prototype.fillBefore=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=0);var a=[this];return function n(r,o){var s=r.matchFragment(e,i);if(s&&(!t||s.validEnd))return eE.from(o.map((function(e){return e.createAndFill()})));for(var l=0;l<r.next.length;l+=2){var u=r.next[l],d=r.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==a.indexOf(d)){a.push(d);var _=n(d,o.concat(u));if(_)return _}}}(this,[])},wE.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var i=this.computeWrapping(e);return this.wrapCache.push(e,i),i},wE.prototype.computeWrapping=function(e){for(var t=Object.create(null),i=[{match:this,type:null,via:null}];i.length;){var a=i.shift(),n=a.match;if(n.matchType(e)){for(var r=[],o=a;o.type;o=o.via)r.push(o.type);return r.reverse()}for(var s=0;s<n.next.length;s+=2){var l=n.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||a.type&&!n.next[s+1].validEnd||(i.push({match:l.contentMatch,type:l,via:a}),t[l.name]=!0)}}},CE.edgeCount.get=function(){return this.next.length>>1},wE.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]}},wE.prototype.toString=function(){var e=[];return function t(i){e.push(i);for(var a=1;a<i.next.length;a+=2)-1==e.indexOf(i.next[a])&&t(i.next[a])}(this),e.map((function(t,i){for(var a=i+(t.validEnd?"*":" ")+" ",n=0;n<t.next.length;n+=2)a+=(n?", ":"")+t.next[n].name+"->"+e.indexOf(t.next[n+1]);return a})).join("\n")},Object.defineProperties(wE.prototype,CE),wE.empty=new wE(!0);var xE=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()},TE={next:{configurable:!0}};function OE(e){var t=[];do{t.push(NE(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function NE(e){var t=[];do{t.push(AE(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function AE(e){for(var t=function(e){if(e.eat("(")){var t=OE(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var i=function(e,t){var i=e.nodeTypes,a=i[t];if(a)return[a];var n=[];for(var r in i){var o=i[r];o.groups.indexOf(t)>-1&&n.push(o)}0==n.length&&e.err("No node type or group '"+t+"' found");return n}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==i.length?i[0]:{type:"choice",exprs:i}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=ME(e,t)}return t}function RE(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function ME(e,t){var i=RE(e),a=i;return e.eat(",")&&(a="}"!=e.next?RE(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:i,max:a,expr:t}}function IE(e,t){return t-e}function BE(e,t){var i=[];return function t(a){var n=e[a];if(1==n.length&&!n[0].term)return t(n[0].to);i.push(a);for(var r=0;r<n.length;r++){var o=n[r],s=o.term,l=o.to;s||-1!=i.indexOf(l)||t(l)}}(t),i.sort(IE)}function LE(e){var t=Object.create(null);for(var i in e){var a=e[i];if(!a.hasDefault)return null;t[i]=a.default}return t}function PE(e,t){var i=Object.create(null);for(var a in e){var n=t&&t[a];if(void 0===n){var r=e[a];if(!r.hasDefault)throw new RangeError("No value supplied for attribute "+a);n=r.default}i[a]=n}return i}function jE(e){var t=Object.create(null);if(e)for(var i in e)t[i]=new zE(e[i]);return t}TE.next.get=function(){return this.tokens[this.pos]},xE.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},xE.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(xE.prototype,TE);var qE=function(e,t,i){this.name=e,this.schema=t,this.spec=i,this.groups=i.group?i.group.split(" "):[],this.attrs=jE(i.attrs),this.defaultAttrs=LE(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(i.inline||"text"==e),this.isText="text"==e},UE={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};UE.isInline.get=function(){return!this.isBlock},UE.isTextblock.get=function(){return this.isBlock&&this.inlineContent},UE.isLeaf.get=function(){return this.contentMatch==wE.empty},UE.isAtom.get=function(){return this.isLeaf||this.spec.atom},qE.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},qE.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},qE.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:PE(this.attrs,e)},qE.prototype.create=function(e,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new kE(this,this.computeAttrs(e),eE.from(t),rE.setFrom(i))},qE.prototype.createChecked=function(e,t,i){if(t=eE.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new kE(this,this.computeAttrs(e),t,rE.setFrom(i))},qE.prototype.createAndFill=function(e,t,i){if(e=this.computeAttrs(e),(t=eE.from(t)).size){var a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}var n=this.contentMatch.matchFragment(t).fillBefore(eE.empty,!0);return n?new kE(this,e,t.append(n),rE.setFrom(i)):null},qE.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0},qE.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},qE.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},qE.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:rE.empty:e},qE.compile=function(e,t){var i=Object.create(null);e.forEach((function(e,a){return i[e]=new qE(e,t,a)}));var a=t.spec.topNode||"doc";if(!i[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(var n in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i},Object.defineProperties(qE.prototype,UE);var zE=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},GE={isRequired:{configurable:!0}};GE.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(zE.prototype,GE);var HE=function(e,t,i,a){this.name=e,this.schema=i,this.spec=a,this.attrs=jE(a.attrs),this.rank=t,this.excluded=null;var n=LE(this.attrs);this.instance=n&&new rE(this,n)};HE.prototype.create=function(e){return!e&&this.instance?this.instance:new rE(this,PE(this.attrs,e))},HE.compile=function(e,t){var i=Object.create(null),a=0;return e.forEach((function(e,n){return i[e]=new HE(e,a++,t,n)})),i},HE.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},HE.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},HE.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var YE={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},WE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},VE={ol:!0,ul:!0};function $E(e){return(e?1:0)|("full"===e?2:0)}var KE=function(e,t,i,a,n,r,o){this.type=e,this.attrs=t,this.solid=n,this.match=r||(4&o?null:e.contentMatch),this.options=o,this.content=[],this.marks=i,this.activeMarks=rE.none,this.pendingMarks=a,this.stashMarks=[]};KE.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(eE.from(e));if(!t){var i,a=this.type.contentMatch;return(i=a.findWrapping(e.type))?(this.match=a,i):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},KE.prototype.finish=function(e){if(!(1&this.options)){var t,i=this.content[this.content.length-1];i&&i.isText&&(t=/[ \t\r\n\u000c]+$/.exec(i.text))&&(i.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-t[0].length)))}var a=eE.from(this.content);return!e&&this.match&&(a=a.append(this.match.fillBefore(eE.empty,!0))),this.type?this.type.create(this.attrs,a,this.marks):a},KE.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]},KE.prototype.applyPending=function(e){for(var t=0,i=this.pendingMarks;t<i.length;t++){var a=i[t];(this.type?this.type.allowsMarkType(a.type):XE(a.type,e))&&!a.isInSet(this.activeMarks)&&(this.activeMarks=a.addToSet(this.activeMarks),this.pendingMarks=a.removeFromSet(this.pendingMarks))}},KE.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!YE.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var QE=function(e,t,i){this.parser=e,this.options=t,this.isOpen=i;var a,n=t.topNode,r=$E(t.preserveWhitespace)|(i?4:0);a=n?new KE(n.type,n.attrs,rE.none,rE.none,!0,t.topMatch||n.type.contentMatch,r):new KE(i?null:e.schema.topNodeType,null,rE.none,rE.none,!0,null,r),this.nodes=[a],this.open=0,this.find=t.findPositions,this.needsBlock=!1},ZE={top:{configurable:!0},currentPos:{configurable:!0}};function XE(e,t){var i=t.schema.nodes,a=function(a){var n=i[a];if(n.allowsMarkType(e)){var r=[],o=function(e){r.push(e);for(var i=0;i<e.edgeCount;i++){var a=e.edge(i),n=a.type,s=a.next;if(n==t)return!0;if(r.indexOf(s)<0&&o(s))return!0}};return o(n.contentMatch)?{v:!0}:void 0}};for(var n in i){var r=a(n);if(r)return r.v}}ZE.top.get=function(){return this.nodes[this.open]},QE.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),i=t?this.readStyles(function(e){var t,i=/\s*([\w-]+)\s*:\s*([^;]+)/g,a=[];for(;t=i.exec(e);)a.push(t[1],t[2].trim());return a}(t)):null,a=this.top;if(null!=i)for(var n=0;n<i.length;n++)this.addPendingMark(i[n]);if(this.addElement(e),null!=i)for(var r=0;r<i.length;r++)this.removePendingMark(i[r],a)}},QE.prototype.addTextNode=function(e){var t=e.nodeValue,i=this.top;if(2&i.options||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&i.options)t=2&i.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var a=i.content[i.content.length-1],n=e.previousSibling;(!a||n&&"BR"==n.nodeName||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},QE.prototype.addElement=function(e,t){var i,a=e.nodeName.toLowerCase();VE.hasOwnProperty(a)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,i=null;t;t=t.nextSibling){var a=1==t.nodeType?t.nodeName.toLowerCase():null;a&&VE.hasOwnProperty(a)&&i?(i.appendChild(t),t=i):"li"==a?i=t:a&&(i=null)}}(e);var n=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(n?n.ignore:WE.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e);else if(!n||n.skip||n.closeParent){n&&n.closeParent?this.open=Math.max(0,this.open-1):n&&n.skip.nodeType&&(e=n.skip);var r,o=this.top,s=this.needsBlock;if(YE.hasOwnProperty(a))r=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),r&&this.sync(o),this.needsBlock=s}else this.addElementByRule(e,n,!1===n.consuming?i:null)},QE.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},QE.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},QE.prototype.readStyles=function(e){var t=rE.none;e:for(var i=0;i<e.length;i+=2)for(var a=null;;){var n=this.parser.matchStyle(e[i],e[i+1],this,a);if(!n)continue e;if(n.ignore)return null;if(t=this.parser.schema.marks[n.mark].create(n.attrs).addToSet(t),!1!==n.consuming)break;a=n}return t},QE.prototype.addElementByRule=function(e,t,i){var a,n,r,o=this;t.node?(n=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(n.create(t.attrs))||this.leafFallback(e):a=this.enter(n,t.attrs,t.preserveWhitespace):(r=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(r));var s=this.top;if(n&&n.isLeaf)this.findInside(e);else if(i)this.addElement(e,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return o.insertNode(e)}));else{var l=t.contentElement;"string"==typeof l?l=e.querySelector(l):"function"==typeof l&&(l=l(e)),l||(l=e),this.findAround(e,l,!0),this.addAll(l,a)}a&&(this.sync(s),this.open--),r&&this.removePendingMark(r,s)},QE.prototype.addAll=function(e,t,i,a){for(var n=i||0,r=i?e.childNodes[i]:e.firstChild,o=null==a?null:e.childNodes[a];r!=o;r=r.nextSibling,++n)this.findAtPoint(e,n),this.addDOM(r),t&&YE.hasOwnProperty(r.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,n)},QE.prototype.findPlace=function(e){for(var t,i,a=this.open;a>=0;a--){var n=this.nodes[a],r=n.findWrapping(e);if(r&&(!t||t.length>r.length)&&(t=r,i=n,!r.length))break;if(n.solid)break}if(!t)return!1;this.sync(i);for(var o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0},QE.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var i=this.top;i.applyPending(e.type),i.match&&(i.match=i.match.matchType(e.type));for(var a=i.activeMarks,n=0;n<e.marks.length;n++)i.type&&!i.type.allowsMarkType(e.marks[n].type)||(a=e.marks[n].addToSet(a));return i.content.push(e.mark(a)),!0}return!1},QE.prototype.enter=function(e,t,i){var a=this.findPlace(e.create(t));return a&&this.enterInner(e,t,!0,i),a},QE.prototype.enterInner=function(e,t,i,a){this.closeExtra();var n=this.top;n.applyPending(e),n.match=n.match&&n.match.matchType(e,t);var r=null==a?-5&n.options:$E(a);4&n.options&&0==n.content.length&&(r|=4),this.nodes.push(new KE(e,t,n.activeMarks,n.pendingMarks,i,null,r)),this.open++},QE.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}},QE.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},QE.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},ZE.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var i=this.nodes[t].content,a=i.length-1;a>=0;a--)e+=i[a].nodeSize;t&&e++}return e},QE.prototype.findAtPoint=function(e,t){if(this.find)for(var i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==t&&(this.find[i].pos=this.currentPos)},QE.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)},QE.prototype.findAround=function(e,t,i){if(e!=t&&this.find)for(var a=0;a<this.find.length;a++){if(null==this.find[a].pos&&1==e.nodeType&&e.contains(this.find[a].node))t.compareDocumentPosition(this.find[a].node)&(i?2:4)&&(this.find[a].pos=this.currentPos)}},QE.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))},QE.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var i=e.split("/"),a=this.options.context,n=!(this.isOpen||a&&a.parent.type!=this.nodes[0].type),r=-(a?a.depth+1:0)+(n?0:1),o=function(e,s){for(;e>=0;e--){var l=i[e];if(""==l){if(e==i.length-1||0==e)continue;for(;s>=r;s--)if(o(e-1,s))return!0;return!1}var u=s>0||0==s&&n?t.nodes[s].type:a&&s>=r?a.node(s-r).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0};return o(i.length-1,this.open)},QE.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var i=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(var a in this.parser.schema.nodes){var n=this.parser.schema.nodes[a];if(n.isTextblock&&n.defaultAttrs)return n}},QE.prototype.addPendingMark=function(e){var t=function(e,t){for(var i=0;i<t.length;i++)if(e.eq(t[i]))return t[i]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},QE.prototype.removePendingMark=function(e,t){for(var i=this.open;i>=0;i--){var a=this.nodes[i];if(a.pendingMarks.lastIndexOf(e)>-1)a.pendingMarks=e.removeFromSet(a.pendingMarks);else{a.activeMarks=e.removeFromSet(a.activeMarks);var n=a.popFromStashMark(e);n&&a.type&&a.type.allowsMarkType(n.type)&&(a.activeMarks=n.addToSet(a.activeMarks))}if(a==t)break}},Object.defineProperties(QE.prototype,ZE);var JE=Math.pow(2,16);function ey(e){return 65535&e}var ty=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null),this.pos=e,this.deleted=t,this.recover=i},iy=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};iy.prototype.recover=function(e){var t=0,i=ey(e);if(!this.inverted)for(var a=0;a<i;a++)t+=this.ranges[3*a+2]-this.ranges[3*a+1];return this.ranges[3*i]+t+function(e){return(e-(65535&e))/JE}(e)},iy.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},iy.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},iy.prototype._map=function(e,t,i){for(var a=0,n=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?a:0);if(s>e)break;var l=this.ranges[o+n],u=this.ranges[o+r],d=s+l;if(e<=d){var _=s+a+((l?e==s?-1:e==d?1:t:t)<0?0:u);if(i)return _;var c=e==(t<0?s:d)?null:o/3+(e-s)*JE;return new ty(_,t<0?e!=s:e!=d,c)}a+=u-l}return i?e+a:new ty(e+a)},iy.prototype.touches=function(e,t){for(var i=0,a=ey(t),n=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?i:0);if(s>e)break;var l=this.ranges[o+n];if(e<=s+l&&o==3*a)return!0;i+=this.ranges[o+r]-l}return!1},iy.prototype.forEach=function(e){for(var t=this.inverted?2:1,i=this.inverted?1:2,a=0,n=0;a<this.ranges.length;a+=3){var r=this.ranges[a],o=r-(this.inverted?n:0),s=r+(this.inverted?0:n),l=this.ranges[a+t],u=this.ranges[a+i];e(o,o+l,s,s+u),n+=u-l}},iy.prototype.invert=function(){return new iy(this.ranges,!this.inverted)},iy.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},iy.offset=function(e){return 0==e?iy.empty:new iy(e<0?[0,-e,0]:[0,0,e])},iy.empty=new iy([]);var ay=function(e,t,i,a){this.maps=e||[],this.from=i||0,this.to=null==a?this.maps.length:a,this.mirror=t};function ny(e){var t=Error.call(this,e);return t.__proto__=ny.prototype,t}ay.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new ay(this.maps,this.mirror,e,t)},ay.prototype.copy=function(){return new ay(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},ay.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},ay.prototype.appendMapping=function(e){for(var t=0,i=this.maps.length;t<e.maps.length;t++){var a=e.getMirror(t);this.appendMap(e.maps[t],null!=a&&a<t?i+a:null)}},ay.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)]},ay.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},ay.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,i=this.maps.length+e.maps.length;t>=0;t--){var a=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=a&&a>t?i-a-1:null)}},ay.prototype.invert=function(){var e=new ay;return e.appendMappingInverted(this),e},ay.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var i=this.from;i<this.to;i++)e=this.maps[i].map(e,t);return e},ay.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},ay.prototype._map=function(e,t,i){for(var a=!1,n=this.from;n<this.to;n++){var r=this.maps[n].mapResult(e,t);if(null!=r.recover){var o=this.getMirror(n);if(null!=o&&o>n&&o<this.to){n=o,e=this.maps[o].recover(r.recover);continue}}r.deleted&&(a=!0),e=r.pos}return i?e:new ty(e,a)},ny.prototype=Object.create(Error.prototype),ny.prototype.constructor=ny,ny.prototype.name="TransformError";var ry=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ay},oy={before:{configurable:!0},docChanged:{configurable:!0}};function sy(){throw new Error("Override me")}oy.before.get=function(){return this.docs.length?this.docs[0]:this.doc},ry.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new ny(t.failed);return this},ry.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},oy.docChanged.get=function(){return this.steps.length>0},ry.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(ry.prototype,oy);var ly=Object.create(null),uy=function(){};uy.prototype.apply=function(e){return sy()},uy.prototype.getMap=function(){return iy.empty},uy.prototype.invert=function(e){return sy()},uy.prototype.map=function(e){return sy()},uy.prototype.merge=function(e){return null},uy.prototype.toJSON=function(){return sy()},uy.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var i=ly[t.stepType];if(!i)throw new RangeError("No step type "+t.stepType+" defined");return i.fromJSON(e,t)},uy.jsonID=function(e,t){if(e in ly)throw new RangeError("Duplicate use of step JSON ID "+e);return ly[e]=t,t.prototype.jsonID=e,t};var dy=function(e,t){this.doc=e,this.failed=t};dy.ok=function(e){return new dy(e,null)},dy.fail=function(e){return new dy(null,e)},dy.fromReplace=function(e,t,i,a){try{return dy.ok(e.replace(t,i,a))}catch(e){if(e instanceof oE)return dy.fail(e.message);throw e}};var _y=function(e){function t(t,i,a,n){e.call(this),this.from=t,this.to=i,this.slice=a,this.structure=!!n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&gy(e,this.from,this.to)?dy.fail("Structure replace would overwrite content"):dy.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new iy([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted?null:new t(i.pos,Math.max(i.pos,a.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var i=this.slice.size+e.slice.size==0?sE.empty:new sE(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,i,this.structure)}var a=this.slice.size+e.slice.size==0?sE.empty:new sE(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),a,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(i.from,i.to,sE.fromJSON(e,i.slice),!!i.structure)},t}(uy);uy.jsonID("replace",_y);var cy=function(e){function t(t,i,a,n,r,o,s){e.call(this),this.from=t,this.to=i,this.gapFrom=a,this.gapTo=n,this.slice=r,this.insert=o,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(gy(e,this.from,this.gapFrom)||gy(e,this.gapTo,this.to)))return dy.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return dy.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,t.content);return i?dy.fromReplace(e,this.from,this.to,i):dy.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new iy([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var i=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+i,this.from+this.insert,this.from+this.insert+i,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1),n=e.map(this.gapFrom,-1),r=e.map(this.gapTo,1);return i.deleted&&a.deleted||n<i.pos||r>a.pos?null:new t(i.pos,a.pos,n,r,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to||"number"!=typeof i.gapFrom||"number"!=typeof i.gapTo||"number"!=typeof i.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(i.from,i.to,i.gapFrom,i.gapTo,sE.fromJSON(e,i.slice),i.insert,!!i.structure)},t}(uy);function gy(e,t,i){for(var a=e.resolve(t),n=i-t,r=a.depth;n>0&&r>0&&a.indexAfter(r)==a.node(r).childCount;)r--,n--;if(n>0)for(var o=a.node(r).maybeChild(a.indexAfter(r));n>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,n--}return!1}function fy(e,t,i){for(var a=[],n=0;n<e.childCount;n++){var r=e.child(n);r.content.size&&(r=r.copy(fy(r.content,t,r))),r.isInline&&(r=t(r,i,n)),a.push(r)}return eE.fromArray(a)}uy.jsonID("replaceAround",cy),ry.prototype.lift=function(e,t){for(var i=e.$from,a=e.$to,n=e.depth,r=i.before(n+1),o=a.after(n+1),s=r,l=o,u=eE.empty,d=0,_=n,c=!1;_>t;_--)c||i.index(_)>0?(c=!0,u=eE.from(i.node(_).copy(u)),d++):s--;for(var g=eE.empty,f=0,h=n,p=!1;h>t;h--)p||a.after(h+1)<a.end(h)?(p=!0,g=eE.from(a.node(h).copy(g)),f++):l++;return this.step(new cy(s,l,r,o,new sE(u.append(g),d,f),u.size-d,!0))},ry.prototype.wrap=function(e,t){for(var i=eE.empty,a=t.length-1;a>=0;a--)i=eE.from(t[a].type.create(t[a].attrs,i));var n=e.start,r=e.end;return this.step(new cy(n,r,n,r,new sE(i,0,0),t.length,!0))},ry.prototype.setBlockType=function(e,t,i,a){var n=this;if(void 0===t&&(t=e),!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var r=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(i,a)&&function(e,t,i){var a=e.resolve(t),n=a.index();return a.parent.canReplaceWith(n,n+1,i)}(n.doc,n.mapping.slice(r).map(t),i)){n.clearIncompatible(n.mapping.slice(r).map(t,1),i);var o=n.mapping.slice(r),s=o.map(t,1),l=o.map(t+e.nodeSize,1);return n.step(new cy(s,l,s+1,l-1,new sE(eE.from(i.create(a,null,e.marks)),0,0),1,!0)),!1}})),this},ry.prototype.setNodeMarkup=function(e,t,i,a){var n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at given position");t||(t=n.type);var r=t.create(i,null,a||n.marks);if(n.isLeaf)return this.replaceWith(e,e+n.nodeSize,r);if(!t.validContent(n.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new cy(e,e+n.nodeSize,e+1,e+n.nodeSize-1,new sE(eE.from(r),0,0),1,!0))},ry.prototype.split=function(e,t,i){void 0===t&&(t=1);for(var a=this.doc.resolve(e),n=eE.empty,r=eE.empty,o=a.depth,s=a.depth-t,l=t-1;o>s;o--,l--){n=eE.from(a.node(o).copy(n));var u=i&&i[l];r=eE.from(u?u.type.create(u.attrs,r):a.node(o).copy(r))}return this.step(new _y(e,e,new sE(n.append(r),t,t),!0))},ry.prototype.join=function(e,t){void 0===t&&(t=1);var i=new _y(e-t,e+t,sE.empty,!0);return this.step(i)};var hy=function(e){function t(t,i,a){e.call(this),this.from=t,this.to=i,this.mark=a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),a=e.resolve(this.from),n=a.node(a.sharedDepth(this.to)),r=new sE(fy(i.content,(function(e,i){return e.isAtom&&i.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),n),i.openStart,i.openEnd);return dy.fromReplace(e,this.from,this.to,r)},t.prototype.invert=function(){return new py(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted||i.pos>=a.pos?null:new t(i.pos,a.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(uy);uy.jsonID("addMark",hy);var py=function(e){function t(t,i,a){e.call(this),this.from=t,this.to=i,this.mark=a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),a=new sE(fy(i.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),i.openStart,i.openEnd);return dy.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new hy(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted||i.pos>=a.pos?null:new t(i.pos,a.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(uy);function my(e,t,i){return!i.openStart&&!i.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),i.content)}uy.jsonID("removeMark",py),ry.prototype.addMark=function(e,t,i){var a=this,n=[],r=[],o=null,s=null;return this.doc.nodesBetween(e,t,(function(a,l,u){if(a.isInline){var d=a.marks;if(!i.isInSet(d)&&u.type.allowsMarkType(i.type)){for(var _=Math.max(l,e),c=Math.min(l+a.nodeSize,t),g=i.addToSet(d),f=0;f<d.length;f++)d[f].isInSet(g)||(o&&o.to==_&&o.mark.eq(d[f])?o.to=c:n.push(o=new py(_,c,d[f])));s&&s.to==_?s.to=c:r.push(s=new hy(_,c,i))}}})),n.forEach((function(e){return a.step(e)})),r.forEach((function(e){return a.step(e)})),this},ry.prototype.removeMark=function(e,t,i){var a=this;void 0===i&&(i=null);var n=[],r=0;return this.doc.nodesBetween(e,t,(function(a,o){if(a.isInline){r++;var s=null;if(i instanceof HE)for(var l,u=a.marks;l=i.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else i?i.isInSet(a.marks)&&(s=[i]):s=a.marks;if(s&&s.length)for(var d=Math.min(o+a.nodeSize,t),_=0;_<s.length;_++){for(var c=s[_],g=void 0,f=0;f<n.length;f++){var h=n[f];h.step==r-1&&c.eq(n[f].style)&&(g=h)}g?(g.to=d,g.step=r):n.push({style:c,from:Math.max(o,e),to:d,step:r})}}})),n.forEach((function(e){return a.step(new py(e.from,e.to,e.style))})),this},ry.prototype.clearIncompatible=function(e,t,i){void 0===i&&(i=t.contentMatch);for(var a=this.doc.nodeAt(e),n=[],r=e+1,o=0;o<a.childCount;o++){var s=a.child(o),l=r+s.nodeSize,u=i.matchType(s.type,s.attrs);if(u){i=u;for(var d=0;d<s.marks.length;d++)t.allowsMarkType(s.marks[d].type)||this.step(new py(r,l,s.marks[d]))}else n.push(new _y(r,l,sE.empty));r=l}if(!i.validEnd){var _=i.fillBefore(eE.empty,!0);this.replace(r,r,new sE(_,0,0))}for(var c=n.length-1;c>=0;c--)this.step(n[c]);return this},ry.prototype.replace=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=sE.empty);var a=function(e,t,i,a){if(void 0===i&&(i=t),void 0===a&&(a=sE.empty),t==i&&!a.size)return null;var n=e.resolve(t),r=e.resolve(i);return my(n,r,a)?new _y(t,i,a):new Fy(n,r,a).fit()}(this.doc,e,t,i);return a&&this.step(a),this},ry.prototype.replaceWith=function(e,t,i){return this.replace(e,t,new sE(eE.from(i),0,0))},ry.prototype.delete=function(e,t){return this.replace(e,t,sE.empty)},ry.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var Fy=function(e,t,i){this.$to=t,this.$from=e,this.unplaced=i,this.frontier=[];for(var a=0;a<=e.depth;a++){var n=e.node(a);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(a))})}this.placed=eE.empty;for(var r=e.depth;r>0;r--)this.placed=eE.from(e.node(r).copy(this.placed))},by={depth:{configurable:!0}};function Ey(e,t,i){return 0==t?e.cutByIndex(i):e.replaceChild(0,e.firstChild.copy(Ey(e.firstChild.content,t-1,i)))}function yy(e,t,i){return 0==t?e.append(i):e.replaceChild(e.childCount-1,e.lastChild.copy(yy(e.lastChild.content,t-1,i)))}function Dy(e,t){for(var i=0;i<t;i++)e=e.firstChild.content;return e}function vy(e,t,i){if(t<=0)return e;var a=e.content;return t>1&&(a=a.replaceChild(0,vy(a.firstChild,t-1,1==a.childCount?i-1:0))),t>0&&(a=e.type.contentMatch.fillBefore(a).append(a),i<=0&&(a=a.append(e.type.contentMatch.matchFragment(a).fillBefore(eE.empty,!0)))),e.copy(a)}function ky(e,t,i,a,n){var r=e.node(t),o=n?e.indexAfter(t):e.index(t);if(o==r.childCount&&!i.compatibleContent(r.type))return null;var s=a.fillBefore(r.content,!0,o);return s&&!function(e,t,i){for(var a=i;a<t.childCount;a++)if(!e.allowsMarks(t.child(a).marks))return!0;return!1}(i,r.content,o)?s:null}function Sy(e,t,i,a,n){if(t<i){var r=e.firstChild;e=e.replaceChild(0,r.copy(Sy(r.content,t+1,i,a,r)))}if(t>a){var o=n.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(eE.empty,!0))}return e}function wy(e,t){for(var i=[],a=Math.min(e.depth,t.depth);a>=0;a--){var n=e.start(a);if(n<e.pos-(e.depth-a)||t.end(a)>t.pos+(t.depth-a)||e.node(a).type.spec.isolating||t.node(a).type.spec.isolating)break;(n==t.start(a)||a==e.depth&&a==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&a&&t.start(a-1)==n-1)&&i.push(a)}return i}by.depth.get=function(){return this.frontier.length-1},Fy.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),i=this.placed.size-this.depth-this.$from.depth,a=this.$from,n=this.close(t<0?this.$to:a.doc.resolve(t));if(!n)return null;for(var r=this.placed,o=a.depth,s=n.depth;o&&s&&1==r.childCount;)r=r.firstChild.content,o--,s--;var l=new sE(r,o,s);return t>-1?new cy(a.pos,t,this.$to.pos,this.$to.end(),l,i):l.size||a.pos!=this.$to.pos?new _y(a.pos,n.pos,l):void 0},Fy.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var i=void 0,a=(t?(i=Dy(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,n=this.depth;n>=0;n--){var r=this.frontier[n],o=r.type,s=r.match,l=void 0,u=void 0;if(1==e&&(a?s.matchType(a.type)||(u=s.fillBefore(eE.from(a),!1)):o.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:n,parent:i,inject:u};if(2==e&&a&&(l=s.findWrapping(a.type)))return{sliceDepth:t,frontierDepth:n,parent:i,wrap:l};if(i&&s.matchType(i.type))break}},Fy.prototype.openMore=function(){var e=this.unplaced,t=e.content,i=e.openStart,a=e.openEnd,n=Dy(t,i);return!(!n.childCount||n.firstChild.isLeaf)&&(this.unplaced=new sE(t,i+1,Math.max(a,n.size+i>=t.size-a?i+1:0)),!0)},Fy.prototype.dropNode=function(){var e=this.unplaced,t=e.content,i=e.openStart,a=e.openEnd,n=Dy(t,i);if(n.childCount<=1&&i>0){var r=t.size-i<=i+n.size;this.unplaced=new sE(Ey(t,i-1,1),i-1,r?i-1:a)}else this.unplaced=new sE(Ey(t,i,1),i,a)},Fy.prototype.placeNodes=function(e){for(var t=e.sliceDepth,i=e.frontierDepth,a=e.parent,n=e.inject,r=e.wrap;this.depth>i;)this.closeFrontierNode();if(r)for(var o=0;o<r.length;o++)this.openFrontierNode(r[o]);var s=this.unplaced,l=a?a.content:s.content,u=s.openStart-t,d=0,_=[],c=this.frontier[i],g=c.match,f=c.type;if(n){for(var h=0;h<n.childCount;h++)_.push(n.child(h));g=g.matchFragment(n)}for(var p=l.size+t-(s.content.size-s.openEnd);d<l.childCount;){var m=l.child(d),F=g.matchType(m.type);if(!F)break;(++d>1||0==u||m.content.size)&&(g=F,_.push(vy(m.mark(f.allowedMarks(m.marks)),1==d?u:0,d==l.childCount?p:-1)))}var b=d==l.childCount;b||(p=-1),this.placed=yy(this.placed,i,eE.from(_)),this.frontier[i].match=g,b&&p<0&&a&&a.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var E=0,y=l;E<p;E++){var D=y.lastChild;this.frontier.push({type:D.type,match:D.contentMatchAt(D.childCount)}),y=D.content}this.unplaced=b?0==t?sE.empty:new sE(Ey(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new sE(Ey(s.content,t,d),s.openStart,s.openEnd)},Fy.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||!ky(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var i=this.$to.depth,a=this.$to.after(i);i>1&&a==this.$to.end(--i);)++a;return a},Fy.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var i=this.frontier[t],a=i.match,n=i.type,r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=ky(e,t,n,a,r);if(o){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,d=ky(e,s,l.type,u,!0);if(!d||d.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}},Fy.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=yy(this.placed,t.depth,t.fit)),e=t.move;for(var i=t.depth+1;i<=e.depth;i++){var a=e.node(i),n=a.type.contentMatch.fillBefore(a.content,!0,e.index(i));this.openFrontierNode(a.type,a.attrs,n)}return e},Fy.prototype.openFrontierNode=function(e,t,i){var a=this.frontier[this.depth];a.match=a.match.matchType(e),this.placed=yy(this.placed,this.depth,eE.from(e.create(t,i))),this.frontier.push({type:e,match:e.contentMatch})},Fy.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(eE.empty,!0);e.childCount&&(this.placed=yy(this.placed,this.frontier.length,e))},Object.defineProperties(Fy.prototype,by),ry.prototype.replaceRange=function(e,t,i){if(!i.size)return this.deleteRange(e,t);var a=this.doc.resolve(e),n=this.doc.resolve(t);if(my(a,n,i))return this.step(new _y(e,t,i));var r=wy(a,this.doc.resolve(t));0==r[r.length-1]&&r.pop();var o=-(a.depth+1);r.unshift(o);for(var s=a.depth,l=a.pos-1;s>0;s--,l--){var u=a.node(s).type.spec;if(u.defining||u.isolating)break;r.indexOf(s)>-1?o=s:a.before(s)==l&&r.splice(1,0,-s)}for(var d=r.indexOf(o),_=[],c=i.openStart,g=i.content,f=0;;f++){var h=g.firstChild;if(_.push(h),f==i.openStart)break;g=h.content}c>0&&_[c-1].type.spec.defining&&a.node(d).type!=_[c-1].type?c-=1:c>=2&&_[c-1].isTextblock&&_[c-2].type.spec.defining&&a.node(d).type!=_[c-2].type&&(c-=2);for(var p=i.openStart;p>=0;p--){var m=(p+c+1)%(i.openStart+1),F=_[m];if(F)for(var b=0;b<r.length;b++){var E=r[(b+d)%r.length],y=!0;E<0&&(y=!1,E=-E);var D=a.node(E-1),v=a.index(E-1);if(D.canReplaceWith(v,v,F.type,F.marks))return this.replace(a.before(E),y?n.after(E):t,new sE(Sy(i.content,0,i.openStart,m),m,i.openEnd))}}for(var k=this.steps.length,S=r.length-1;S>=0&&(this.replace(e,t,i),!(this.steps.length>k));S--){var w=r[S];w<0||(e=a.before(w),t=n.after(w))}return this},ry.prototype.replaceRangeWith=function(e,t,i){if(!i.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var a=function(e,t,i){var a=e.resolve(t);if(a.parent.canReplaceWith(a.index(),a.index(),i))return t;if(0==a.parentOffset)for(var n=a.depth-1;n>=0;n--){var r=a.index(n);if(a.node(n).canReplaceWith(r,r,i))return a.before(n+1);if(r>0)return null}if(a.parentOffset==a.parent.content.size)for(var o=a.depth-1;o>=0;o--){var s=a.indexAfter(o);if(a.node(o).canReplaceWith(s,s,i))return a.after(o+1);if(s<a.node(o).childCount)return null}}(this.doc,e,i.type);null!=a&&(e=t=a)}return this.replaceRange(e,t,new sE(eE.from(i),0,0))},ry.prototype.deleteRange=function(e,t){for(var i=this.doc.resolve(e),a=this.doc.resolve(t),n=wy(i,a),r=0;r<n.length;r++){var o=n[r],s=r==n.length-1;if(s&&0==o||i.node(o).type.contentMatch.validEnd)return this.delete(i.start(o),a.end(o));if(o>0&&(s||i.node(o-1).canReplace(i.index(o-1),a.indexAfter(o-1))))return this.delete(i.before(o),a.after(o))}for(var l=1;l<=i.depth&&l<=a.depth;l++)if(e-i.start(l)==i.depth-l&&t>i.end(l)&&a.end(l)-t!=a.depth-l)return this.delete(i.before(l),t);return this.delete(e,t)};var Cy=Object.create(null),xy=function(e,t,i){this.ranges=i||[new Oy(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},Ty={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Ty.anchor.get=function(){return this.$anchor.pos},Ty.head.get=function(){return this.$head.pos},Ty.from.get=function(){return this.$from.pos},Ty.to.get=function(){return this.$to.pos},Ty.$from.get=function(){return this.ranges[0].$from},Ty.$to.get=function(){return this.ranges[0].$to},Ty.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},xy.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},xy.prototype.replace=function(e,t){void 0===t&&(t=sE.empty);for(var i=t.content.lastChild,a=null,n=0;n<t.openEnd;n++)a=i,i=i.lastChild;for(var r=e.steps.length,o=this.ranges,s=0;s<o.length;s++){var l=o[s],u=l.$from,d=l.$to,_=e.mapping.slice(r);e.replaceRange(_.map(u.pos),_.map(d.pos),s?sE.empty:t),0==s&&Py(e,r,(i?i.isInline:a&&a.isTextblock)?-1:1)}},xy.prototype.replaceWith=function(e,t){for(var i=e.steps.length,a=this.ranges,n=0;n<a.length;n++){var r=a[n],o=r.$from,s=r.$to,l=e.mapping.slice(i),u=l.map(o.pos),d=l.map(s.pos);n?e.deleteRange(u,d):(e.replaceRangeWith(u,d,t),Py(e,i,t.isInline?-1:1))}},xy.findFrom=function(e,t,i){var a=e.parent.inlineContent?new Ny(e):Ly(e.node(0),e.parent,e.pos,e.index(),t,i);if(a)return a;for(var n=e.depth-1;n>=0;n--){var r=t<0?Ly(e.node(0),e.node(n),e.before(n+1),e.index(n),t,i):Ly(e.node(0),e.node(n),e.after(n+1),e.index(n)+1,t,i);if(r)return r}},xy.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new Iy(e.node(0))},xy.atStart=function(e){return Ly(e,e,0,0,1)||new Iy(e)},xy.atEnd=function(e){return Ly(e,e,e.content.size,e.childCount,-1)||new Iy(e)},xy.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var i=Cy[t.type];if(!i)throw new RangeError("No selection type "+t.type+" defined");return i.fromJSON(e,t)},xy.jsonID=function(e,t){if(e in Cy)throw new RangeError("Duplicate use of selection JSON ID "+e);return Cy[e]=t,t.prototype.jsonID=e,t},xy.prototype.getBookmark=function(){return Ny.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(xy.prototype,Ty),xy.prototype.visible=!0;var Oy=function(e,t){this.$from=e,this.$to=t},Ny=function(e){function t(t,i){void 0===i&&(i=t),e.call(this,t,i)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={$cursor:{configurable:!0}};return i.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(i,a){var n=i.resolve(a.map(this.head));if(!n.parent.inlineContent)return e.near(n);var r=i.resolve(a.map(this.anchor));return new t(r.parent.inlineContent?r:n,n)},t.prototype.replace=function(t,i){if(void 0===i&&(i=sE.empty),e.prototype.replace.call(this,t,i),i==sE.empty){var a=this.$from.marksAcross(this.$to);a&&t.ensureMarks(a)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new Ay(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.anchor||"number"!=typeof i.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(i.anchor),e.resolve(i.head))},t.create=function(e,t,i){void 0===i&&(i=t);var a=e.resolve(t);return new this(a,i==t?a:e.resolve(i))},t.between=function(i,a,n){var r=i.pos-a.pos;if(n&&!r||(n=r>=0?1:-1),!a.parent.inlineContent){var o=e.findFrom(a,n,!0)||e.findFrom(a,-n,!0);if(!o)return e.near(a,n);a=o.$head}return i.parent.inlineContent||(0==r||(i=(e.findFrom(i,-n,!0)||e.findFrom(i,n,!0)).$anchor).pos<a.pos!=r<0)&&(i=a),new t(i,a)},Object.defineProperties(t.prototype,i),t}(xy);xy.jsonID("text",Ny);var Ay=function(e,t){this.anchor=e,this.head=t};Ay.prototype.map=function(e){return new Ay(e.map(this.anchor),e.map(this.head))},Ay.prototype.resolve=function(e){return Ny.between(e.resolve(this.anchor),e.resolve(this.head))};var Ry=function(e){function t(t){var i=t.nodeAfter,a=t.node(0).resolve(t.pos+i.nodeSize);e.call(this,t,a),this.node=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,a){var n=a.mapResult(this.anchor),r=n.deleted,o=n.pos,s=i.resolve(o);return r?e.near(s):new t(s)},t.prototype.content=function(){return new sE(eE.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 My(this.anchor)},t.fromJSON=function(e,i){if("number"!=typeof i.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(i.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(xy);Ry.prototype.visible=!1,xy.jsonID("node",Ry);var My=function(e){this.anchor=e};My.prototype.map=function(e){var t=e.mapResult(this.anchor),i=t.deleted,a=t.pos;return i?new Ay(a,a):new My(a)},My.prototype.resolve=function(e){var t=e.resolve(this.anchor),i=t.nodeAfter;return i&&Ry.isSelectable(i)?new Ry(t):xy.near(t)};var Iy=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,i){if(void 0===i&&(i=sE.empty),i==sE.empty){t.delete(0,t.doc.content.size);var a=e.atStart(t.doc);a.eq(t.selection)||t.setSelection(a)}else e.prototype.replace.call(this,t,i)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return By},t}(xy);xy.jsonID("all",Iy);var By={map:function(){return this},resolve:function(e){return new Iy(e)}};function Ly(e,t,i,a,n,r){if(t.inlineContent)return Ny.create(e,i);for(var o=a-(n>0?0:1);n>0?o<t.childCount:o>=0;o+=n){var s=t.child(o);if(s.isAtom){if(!r&&Ry.isSelectable(s))return Ry.create(e,i-(n<0?s.nodeSize:0))}else{var l=Ly(e,s,i+n,n<0?s.childCount:0,n,r);if(l)return l}i+=s.nodeSize*n}}function Py(e,t,i){var a=e.steps.length-1;if(!(a<t)){var n,r=e.steps[a];if(r instanceof _y||r instanceof cy)e.mapping.maps[a].forEach((function(e,t,i,a){null==n&&(n=a)})),e.setSelection(xy.near(e.doc.resolve(n),i))}}var jy=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return i.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},t.prototype.setSelection=function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},i.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return rE.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},i.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,i){e.prototype.addStep.call(this,t,i),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var i=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||rE.none))),i.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,i){void 0===i&&(i=t);var a=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(a.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,i);var n=this.storedMarks;if(!n){var r=this.doc.resolve(t);n=i==t?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(t,i,a.text(e,n)),this.selection.empty||this.setSelection(xy.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},i.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},i.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,i),t}(ry);function qy(e,t){return t&&e?e.bind(t):e}var Uy=function(e,t,i){this.name=e,this.init=qy(t.init,i),this.apply=qy(t.apply,i)},zy=[new Uy("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new Uy("selection",{init:function(e,t){return e.selection||xy.atStart(t.doc)},apply:function(e){return e.selection}}),new Uy("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,i,a){return a.selection.$cursor?e.storedMarks:null}}),new Uy("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],Gy=function(e,t){var i=this;this.schema=e,this.fields=zy.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(i.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");i.plugins.push(e),i.pluginsByKey[e.key]=e,e.spec.state&&i.fields.push(new Uy(e.key,e.spec.state,e))}))},Hy=function(e){this.config=e},Yy={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};Yy.schema.get=function(){return this.config.schema},Yy.plugins.get=function(){return this.config.plugins},Hy.prototype.apply=function(e){return this.applyTransaction(e).state},Hy.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var i=0;i<this.config.plugins.length;i++)if(i!=t){var a=this.config.plugins[i];if(a.spec.filterTransaction&&!a.spec.filterTransaction.call(a,e,this))return!1}return!0},Hy.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],i=this.applyInner(e),a=null;;){for(var n=!1,r=0;r<this.config.plugins.length;r++){var o=this.config.plugins[r];if(o.spec.appendTransaction){var s=a?a[r].n:0,l=a?a[r].state:this,u=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,l,i);if(u&&i.filterTransaction(u,r)){if(u.setMeta("appendedTransaction",e),!a){a=[];for(var d=0;d<this.config.plugins.length;d++)a.push(d<r?{state:i,n:t.length}:{state:this,n:0})}t.push(u),i=i.applyInner(u),n=!0}a&&(a[r]={state:i,n:t.length})}}if(!n)return{state:i,transactions:t}}},Hy.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new Hy(this.config),i=this.config.fields,a=0;a<i.length;a++){var n=i[a];t[n.name]=n.apply(e,this[n.name],this,t)}for(var r=0;r<Wy.length;r++)Wy[r](this,e,t);return t},Yy.tr.get=function(){return new jy(this)},Hy.create=function(e){for(var t=new Gy(e.doc?e.doc.type.schema:e.schema,e.plugins),i=new Hy(t),a=0;a<t.fields.length;a++)i[t.fields[a].name]=t.fields[a].init(e,i);return i},Hy.prototype.reconfigure=function(e){for(var t=new Gy(this.schema,e.plugins),i=t.fields,a=new Hy(t),n=0;n<i.length;n++){var r=i[n].name;a[r]=this.hasOwnProperty(r)?this[r]:i[n].init(e,a)}return a},Hy.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var i in e){if("doc"==i||"selection"==i)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var a=e[i],n=a.spec.state;n&&n.toJSON&&(t[i]=n.toJSON.call(a,this[a.key]))}return t},Hy.fromJSON=function(e,t,i){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var a=new Gy(e.schema,e.plugins),n=new Hy(a);return a.fields.forEach((function(a){if("doc"==a.name)n.doc=kE.fromJSON(e.schema,t.doc);else if("selection"==a.name)n.selection=xy.fromJSON(n.doc,t.selection);else if("storedMarks"==a.name)t.storedMarks&&(n.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(i)for(var r in i){var o=i[r],s=o.spec.state;if(o.key==a.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(n[a.name]=s.fromJSON.call(o,e,t[r],n))}n[a.name]=a.init(e,n)}})),n},Hy.addApplyListener=function(e){Wy.push(e)},Hy.removeApplyListener=function(e){var t=Wy.indexOf(e);t>-1&&Wy.splice(t,1)},Object.defineProperties(Hy.prototype,Yy);var Wy=[];var Vy=function(e){this.props={},e.props&&function e(t,i,a){for(var n in t){var r=t[n];r instanceof Function?r=r.bind(i):"handleDOMEvents"==n&&(r=e(r,i,{})),a[n]=r}return a}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:Ky("plugin")};Vy.prototype.getState=function(e){return e[this.key]};var $y=Object.create(null);function Ky(e){return e in $y?e+"$"+ ++$y[e]:($y[e]=0,e+"$")}var Qy=function(e){void 0===e&&(e="key"),this.key=Ky(e)};Qy.prototype.get=function(e){return e.config.pluginsByKey[this.key]},Qy.prototype.getState=function(e){return e[this.key]};const Zy=mr.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter(e=>""!==e).length}},addProseMirrorPlugins(){return[new Vy({key:new Qy("characterCount"),filterTransaction:(e,t)=>{const i=this.options.limit;if(!e.docChanged||0===i||null==i)return!0;const a=this.storage.characters({node:t.doc}),n=this.storage.characters({node:e.doc});if(n<=i)return!0;if(a>i&&n>i&&n<=a)return!0;if(a>i&&n>i&&n>a)return!1;if(!e.getMeta("paste"))return!1;const r=e.selection.$head.pos,o=r-(n-i),s=r;e.deleteRange(o,s);return!(this.storage.characters({node:e.doc})>i)}})]}});var Xy=i(52);const Jy=gs.create({name:"link",priority:1e3,inclusive:!1,addOptions:()=>({openOnClick:!0,linkOnPaste:!0,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target}}},parseHTML:()=>[{tag:"a[href]"}],renderHTML({HTMLAttributes:e}){return["a",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setLink:e=>({commands:t})=>t.setMark("link",e),toggleLink:e=>({commands:t})=>t.toggleMark("link",e,{extendEmptyMarkRange:!0}),unsetLink:()=>({commands:e})=>e.unsetMark("link",{extendEmptyMarkRange:!0})}),addPasteRules(){return[Es({find:e=>Object(Xy.find)(e).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.openOnClick&&e.push(new Rt({key:new Bt("handleClickLink"),props:{handleClick:(e,t,i)=>{var a;const n=this.editor.getAttributes("link");return!(!(null===(a=i.target)||void 0===a?void 0:a.closest("a"))||!n.href)&&(window.open(n.href,n.target),!0)}}})),this.options.linkOnPaste&&e.push(new Rt({key:new Bt("handlePasteLink"),props:{handlePaste:(e,t,i)=>{const{state:a}=e,{selection:n}=a,{empty:r}=n;if(r)return!1;let o="";i.content.forEach(e=>{o+=e.textContent});const s=Object(Xy.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),eD=gs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",ns(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const i=po(e,this.type);return!!Object.entries(i).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),tD=mr.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>e.style.color.replace(/['"]+/g,""),renderHTML:e=>e.color?{style:"color: "+e.color}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})});var iD=cs.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Rt({key:new Bt("eventHandler"),props:{handleClick:function(t,i){var a=t.state,n=a.doc.lastChild,r=a.doc.resolve(i).nodeBefore;if(n&&r){var o=n.eq(r),s=n.isInline,l=["paragraph","text"].includes(n.type.name);!o||s||l||e.commands.insertContentAt(i,{type:"paragraph",content:""})}}}})]}}),aD=VF.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",ns(this.options.HTMLAttributes,t),0]}});const nD=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,rD=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",ns(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[fs({find:nD,type:this.type,getAttributes:e=>{const[,,t,i,a]=e;return{src:i,alt:t,title:a}}})]}});function oD(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function sD(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?oD(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):oD(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var lD=rD.extend({name:"image",addAttributes:function(){return sD(sD({},rD.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1},align:{default:"center",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(i){var a,n,r,o=i.tr,s=i.commands;return"image"==(null===(a=o.selection)||void 0===a||null===(n=a.node)||void 0===n||null===(r=n.type)||void 0===r?void 0:r.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}},setImageAttributes:function(t){return function(i){var a=i.tr,n=a.selection,r=sD(sD({},n.node.attrs),t),o=e.type.create(r);a.replaceRangeWith(n.from,n.to,o)}}}},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes,a=i.src,n=i.alt,r="large"===t.attrs.size?"image-banner":"";return i.class=" image-size-"+t.attrs.size,i.class+=" image-float-"+t.attrs.float,i.class+=" image-align-"+t.attrs.align,delete i.src,delete i.alt,["figure",ns(this.options.HTMLAttributes,i),["img",{src:a,class:r}],["figcaption",n||""]]}});const uD=gs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setUnderline:()=>({commands:e})=>e.setMark("underline"),toggleUnderline:()=>({commands:e})=>e.toggleMark("underline"),unsetUnderline:()=>({commands:e})=>e.unsetMark("underline")}),addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});const dD=new Bt("suggestion");function _D({pluginKey:e=dD,editor:t,char:i="@",allowSpaces:a=!1,prefixSpace:n=!0,startOfLine:r=!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 Rt({key:e,view(){return{update:async(e,i)=>{var a,n,r,o,s;const d=null===(a=this.key)||void 0===a?void 0:a.getState(i),_=null===(n=this.key)||void 0===n?void 0:n.getState(e.state),g=d.active&&_.active&&d.range.from!==_.range.from,f=!d.active&&_.active,h=d.active&&!_.active,p=f||g,m=!f&&!h&&d.query!==_.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?d:_,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from: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:i,prefixSpace:a,startOfLine:n,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=n?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=r.depth<=0?0:r.before(),_=r.pos,c=r.doc.textBetween(d,_,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(a&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:a,prefixSpace:n,startOfLine:r,$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 i;const{active:a,range:n}=this.getState(e.state);return a&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:n}))||!1},decorations(e){const{active:t,range:i,decorationId:a}=this.getState(e);return t?Mn.create(e.doc,[On.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":a})]):null}}})}var cD=function(e){var t=e.wrapperRef,i=e.index;if(t.current&&!(i>=t.current.children.length)){var a=t.current,n=a.children[i],r=n.clientHeight+8,o=a.scrollTop;n.offsetTop+r>o+a.clientHeight?o=n.offsetTop-a.clientHeight+r:o>n.offsetTop&&(o=n.offsetTop-8),t.current.scrollTop=o}};function gD(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=oh()(e);if(t){var n=oh()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return nh()(this,i)}}var fD=function(e){ih()(i,e);var t=gD(i);function i(e){var a;return Qf()(this,i),a=t.call(this,e),_()(eh()(a),"keydownHandler",(function(e){var t={Enter:a.enterHandler,ArrowUp:a.upHandler,ArrowDown:a.downHandler,ArrowLeft:a.leftArrowHandler,ArrowRight:a.rightArrowHandler};e.key in t&&t[e.key](e)})),_()(eh()(a),"selectItem",(function(e){var t=a.props,i=t.items,n=t.editor,r=t.range,o=i[e],s=o&&o.command,l=fd(o.items);s&&l&&o.command({editor:n,range:r})})),_()(eh()(a),"upHandler",(function(){var e=a.props.items,t=a.state.selectedIndex;a.setState({selectedIndex:(t+e.length-1)%e.length})})),_()(eh()(a),"downHandler",(function(){var e=a.props.items,t=a.state.selectedIndex;a.setState({selectedIndex:(t+1)%e.length})})),_()(eh()(a),"enterHandler",(function(){var e=a.state.selectedIndex;a.selectItem(e)})),_()(eh()(a),"leftArrowHandler",(function(){var e=a.props,t=e.menuIndex,i=e.setActiveMenuIndex;t>0&&i(t-1)})),_()(eh()(a),"rightArrowHandler",(function(){var e=a.props,t=e.menuIndex,i=e.setActiveMenuIndex,n=e.items[a.state.selectedIndex];n&&!fd(n.items)&&i(t+1)})),a.state={selectedIndex:0},a.menuRef=m.a.createRef(),a}return Xf()(i,[{key:"componentDidMount",value:function(){var e=this.props;e.menuIndex===e.activeMenuIndex&&document.addEventListener("keydown",this.keydownHandler)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.keydownHandler)}},{key:"componentDidUpdate",value:function(e){var t=this.props,i=t.items,a=t.menuIndex===t.activeMenuIndex;i!==e.items&&this.setState({selectedIndex:0}),cD({wrapperRef:this.menuRef,index:this.state.selectedIndex}),a?document.addEventListener("keydown",this.keydownHandler):document.removeEventListener("keydown",this.keydownHandler)}},{key:"render",value:function(){var e=this,t=this.props,a=t.items,n=t.menuIndex,r=t.activeMenuIndex,o=this.state.selectedIndex,s=n===r;return m.a.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},a.map((function(t,a){var r=fd(t.items),l=m.a.createElement(hD,{key:t.title,item:t,index:a,selectedIndex:s?o:-1,selectItem:function(){return r&&e.selectItem(a)},onHover:function(){return e.setState({selectedIndex:a})}});return r?l:m.a.createElement(jc,{key:t.title,interactive:!0,placement:"right",content:m.a.createElement(i,u()({},e.props,{items:t.items,menuIndex:n+1})),onCreate:function(e){return e.popper.style.width="max-content"},visible:o===a,onShow:function(){e.isSubmenuOpened=!0},onHide:function(){e.isSubmenuOpened=!1}},l)})))}}]),i}(m.a.Component),hD=Object(p.forwardRef)((function(e,t){var i=e.item,a=e.selectedIndex,n=e.index,r=e.selectItem,o=e.onHover,s=i.Icon;return m.a.createElement("div",{className:b()("neeto-editor-slash-commands__item",{active:n===a}),onClick:r,ref:t,"data-cy":"neeto-editor-command-list-item-".concat(n),onMouseEnter:o},s&&m.a.createElement(s,{size:20}),m.a.createElement("div",{className:"neeto-editor-slash-commands__item-content"},m.a.createElement("h5",null,i.title),m.a.createElement("p",null,i.description)))})),pD=fD;function mD(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=oh()(e);if(t){var n=oh()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return nh()(this,i)}}var FD=function(e){ih()(i,e);var t=mD(i);function i(){var e;Qf()(this,i);for(var a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return e=t.call.apply(t,[this].concat(n)),_()(eh()(e),"state",{activeMenuIndex:0}),_()(eh()(e),"onKeyDown",(function(e){var t=e.event;return["Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)})),_()(eh()(e),"setActiveMenuIndex",(function(t){return e.setState({activeMenuIndex:t})})),e}return Xf()(i,[{key:"render",value:function(){return m.a.createElement(pD,u()({},this.props,{menuIndex:0,activeMenuIndex:this.state.activeMenuIndex,setActiveMenuIndex:this.setActiveMenuIndex}))}}]),i}(m.a.Component),bD=["size","color","strokeWidth"];function ED(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,bD);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M13 4.5H20M13 9.5H20M4 14.5H20M4 19.5H20M9 9.5L6.5 4.5L4 9.5M4.5 8.5H6.5H8.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}ED.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},ED.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var yD=["size","color","strokeWidth"];function DD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,yD);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M5 6V18M13 6V18M5 12H13M18.5 18V13L17.25 14.25M20 18H17",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}DD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},DD.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var vD=["size","color","strokeWidth"];function kD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,vD);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M17 14C17 13.7348 17.1054 13.4804 17.2929 13.2929C17.4804 13.1054 17.7348 13 18 13H18.6145C18.8723 13 19.1237 13.0811 19.3329 13.2319C19.542 13.3827 19.6985 13.5955 19.78 13.8401C19.8471 14.0414 19.8609 14.2566 19.8202 14.4648C19.7794 14.673 19.6854 14.8671 19.5473 15.0281L17 18H20M5 6V18M13 6V18M5 12H13",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}kD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},kD.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var SD=["size","color","strokeWidth"];function wD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,SD);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M20.667 20.125H3.33301M20.667 14.708H3.33301M20.667 9.292H16.334M20.667 3.875H16.334M9.29201 6.042H12C12.299 6.042 12.542 6.285 12.542 6.584V8.75C12.542 9.049 12.299 9.292 12 9.292H9.83301C9.53401 9.292 9.29101 9.049 9.29101 8.75L9.29201 6.042ZM9.29201 6.042C9.29201 3.875 9.69801 3.515 10.917 2.792M3.33301 6.042H6.04101C6.34001 6.042 6.58301 6.285 6.58301 6.584V8.75C6.58301 9.049 6.34001 9.292 6.04101 9.292H3.87501C3.57601 9.292 3.33301 9.049 3.33301 8.75V6.042ZM3.33301 6.042C3.33301 3.875 3.73901 3.515 4.95801 2.792",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}wD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},wD.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var CD=["size","color","strokeWidth"];function xD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,CD);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M17 12H7",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}xD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},xD.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var TD=["size","color","strokeWidth"];function OD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,TD);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M15.375 13.097L19.17 16.151C19.906 16.744 21 16.22 21 15.275V8.725C21 7.78 19.906 7.256 19.17 7.849L15.375 10.903M13.125 17.75H5.25C4.007 17.75 3 16.743 3 15.5V8.5C3 7.257 4.007 6.25 5.25 6.25H13.125C14.368 6.25 15.375 7.257 15.375 8.5V15.5C15.375 16.743 14.368 17.75 13.125 17.75Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}OD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},OD.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var ND={PARAGRAPH:{optionName:km.FONT_SIZE,title:"Paragraph",description:"Add a plain text block.",Icon:ED,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("paragraph").run()}},H1:{optionName:km.FONT_SIZE,title:"H1",description:"Add a big heading.",Icon:DD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:1}).run()}},H2:{optionName:km.FONT_SIZE,title:"H2",description:"Add a sub-heading.",Icon:kD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:2}).run()}},LIST_ORDERED:{optionName:km.LIST_ORDERED,title:"Numbered list",description:"Add a list with numbering.",Icon:of,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleOrderedList().run()}},LIST_BULLETS:{optionName:km.LIST_BULLETS,title:"Bulleted list",description:"Add an list bullets.",Icon:nf,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBulletList().run()}},BLOCKQUOTE:{optionName:km.BLOCKQUOTE,title:"Blockquote",description:"Add a quote.",Icon:wD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBlockquote().run()}},IMAGE:{optionName:km.IMAGE_UPLOAD,title:"Image",description:"Add an image.",Icon:tf,command:function(e){var t=e.editor,i=e.range;return t.chain().focus().deleteRange(i).run()}},CODE:{optionName:km.CODE_BLOCK,title:"Code block",description:"Add a code block with syntax highlighting.",Icon:Og,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleCodeBlock().run()}},EMOJI:{optionName:km.EMOJI,title:"Emoji",description:"Add an emoji.",Icon:$f,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("::").run()}},DIVIDER:{optionName:km.DIVIDER,title:"Divider",description:"Add an horizontal line to separate sections.",Icon:xD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setHorizontalRule().run()}},VIDEO:{optionName:km.VIDEO_EMBED,title:"Embed Youtube/Vimeo",description:"Embed a video from major services.",Icon:OD,command:function(e){var t,i=e.editor,a=e.range,n=prompt("Please enter Youtube/Vimeo embed URL."),r=(t=n.match(Vg))&&"https://www.youtube.com/embed/".concat(t[5])||function(e){var t=e.match($g);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])}(n);r?i.chain().focus().deleteRange(a).setExternalVideo({src:r}).run():i.chain().focus().deleteRange(a).insertContent("#invalid").run()}},MENTION:{optionName:km.MENTION,title:"Mention",description:"Mention a user.",Icon:jf,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("@").run()}},NO_RESULT:{title:"No results",command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).run()}}};function AD(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function RD(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?AD(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):AD(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var MD=new Bt("commands"),ID=function(e){var t=e.setImageUploadVisible,i=e.mentions,a=e.addonCommands,n=e.options,r=[ND.PARAGRAPH,ND.H1,ND.H2,ND.LIST_ORDERED,ND.LIST_BULLETS,ND.BLOCKQUOTE,RD(RD({},ND.IMAGE),{},{command:function(){var e;t(!0),(e=ND.IMAGE).command.apply(e,arguments)}}),ND.CODE,ND.EMOJI,ND.DIVIDER,ND.VIDEO];return fd(i)||r.push(ND.MENTION),fd(n)||(r=r.filter((function(e){var t=e.optionName;return n.includes(t)}))),fd(a)||(r=r.concat(a)),mr.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:MD,command:function(e){var t=e.editor,i=e.range;e.props.command({editor:t,range:i})},items:function(e){var t=e.query,i=r.filter((function(e){return e.title.toLowerCase().includes(t.toLowerCase())}));return fd(i)?[ND.NO_RESULT]:i},render:function(){var e,t;return{onStart:function(i){e=new Tu(FD,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t&&t[0].destroy(),e&&e.destroy()}}}}}},addProseMirrorPlugins:function(){return[_D(RD({editor:this.editor},this.options.suggestion))]}})},BD={};function LD(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var i=e[t];"object"!=typeof i||Object.isFrozen(i)||LD(i)})),e}var PD=LD,jD=LD;PD.default=jD;class qD{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function UD(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function zD(e,...t){const i=Object.create(null);for(const t in e)i[t]=e[t];return t.forEach((function(e){for(const t in e)i[t]=e[t]})),i}const GD=e=>!!e.kind;class HD{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=UD(e)}openNode(e){if(!GD(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){GD(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class YD{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=>{YD._collapse(e)}))}}class WD extends YD{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const i=e.root;i.kind=t,i.sublanguage=!0,this.add(i)}toHTML(){return new HD(this,this.options).value()}finalize(){return!0}}function VD(e){return e?"string"==typeof e?e:e.source:null}const $D=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const KD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",QD={begin:"\\\\[\\s\\S]",relevance:0},ZD={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[QD]},XD={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[QD]},JD={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/},ev=function(e,t,i={}){const a=zD({className:"comment",begin:e,end:t,contains:[]},i);return a.contains.push(JD),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},tv=ev("//","$"),iv=ev("/\\*","\\*/"),av=ev("#","$"),nv={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},rv={className:"number",begin:KD,relevance:0},ov={className:"number",begin:"\\b(0b[01]+)",relevance:0},sv={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},lv={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[QD,{begin:/\[/,end:/\]/,relevance:0,contains:[QD]}]}]},uv={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},dv={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},_v={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var cv=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:KD,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>VD(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),zD({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:QD,APOS_STRING_MODE:ZD,QUOTE_STRING_MODE:XD,PHRASAL_WORDS_MODE:JD,COMMENT:ev,C_LINE_COMMENT_MODE:tv,C_BLOCK_COMMENT_MODE:iv,HASH_COMMENT_MODE:av,NUMBER_MODE:nv,C_NUMBER_MODE:rv,BINARY_NUMBER_MODE:ov,CSS_NUMBER_MODE:sv,REGEXP_MODE:lv,TITLE_MODE:uv,UNDERSCORE_TITLE_MODE:dv,METHOD_GUARD:_v,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 gv(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function fv(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=gv,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function hv(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>VD(e)).join("|")+")"}(...e.illegal))}function pv(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 mv(e,t){void 0===e.relevance&&(e.relevance=1)}const Fv=["of","and","for","in","not","or","if","then","parent","list","value"];function bv(e,t){return t?Number(t):function(e){return Fv.includes(e.toLowerCase())}(e)?0:1}function Ev(e,{plugins:t}){function i(t,i){return new RegExp(VD(t),"m"+(e.case_insensitive?"i":"")+(i?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=i(function(e,t="|"){let i=0;return e.map(e=>{i+=1;const t=i;let a=VD(e),n="";for(;a.length>0;){const e=$D.exec(a);if(!e){n+=a;break}n+=a.substring(0,e.index),a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?n+="\\"+String(Number(e[1])+t):(n+=e[0],"("===e[0]&&i++)}return n}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex((e,t)=>t>0&&void 0!==e),a=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,a)}}class n{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 a;return this.rules.slice(e).forEach(([e,i])=>t.addRule(e,i)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=zD(e.classNameAliases||{}),function t(a,r){const o=a;if(a.isCompiled)return o;[pv].forEach(e=>e(a,r)),e.compilerExtensions.forEach(e=>e(a,r)),a.__beforeBegin=null,[fv,hv,mv].forEach(e=>e(a,r)),a.isCompiled=!0;let s=null;if("object"==typeof a.keywords&&(s=a.keywords.$pattern,delete a.keywords.$pattern),a.keywords&&(a.keywords=function e(t,i,a="keyword"){const n={};return"string"==typeof t?r(a,t.split(" ")):Array.isArray(t)?r(a,t):Object.keys(t).forEach((function(a){Object.assign(n,e(t[a],i,a))})),n;function r(e,t){i&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const i=t.split("|");n[i[0]]=[e,bv(i[0],i[1])]}))}}(a.keywords,e.case_insensitive)),a.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||a.lexemes||/\w+/,o.keywordPatternRe=i(s,!0),r&&(a.begin||(a.begin=/\B|\b/),o.beginRe=i(a.begin),a.endSameAsBegin&&(a.end=a.begin),a.end||a.endsWithParent||(a.end=/\B|\b/),a.end&&(o.endRe=i(a.end)),o.terminatorEnd=VD(a.end)||"",a.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(a.end?"|":"")+r.terminatorEnd)),a.illegal&&(o.illegalRe=i(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return zD(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return zD(e,{starts:e.starts?zD(e.starts):null});if(Object.isFrozen(e))return zD(e);return e}("self"===e?a:e)}))),a.contains.forEach((function(e){t(e,o)})),a.starts&&t(a.starts,r),o.matcher=function(e){const t=new n;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 yv(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,UD(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 Dv={"after:highlightElement":({el:e,result:t,text:i})=>{const a=kv(e);if(!a.length)return;const n=document.createElement("div");n.innerHTML=t.value,t.value=function(e,t,i){let a=0,n="";const r=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){n+="<"+vv(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+UD(e.value)+'"'})).join("")+">"}function l(e){n+="</"+vv(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(n+=UD(i.substring(a,t[0].offset)),a=t[0].offset,t===e){r.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===a);r.reverse().forEach(s)}else"start"===t[0].event?r.push(t[0].node):r.pop(),u(t.splice(0,1)[0])}return n+UD(i.substr(a))}(a,kv(n),i)}};function vv(e){return e.nodeName.toLowerCase()}function kv(e){const t=[];return function e(i,a){for(let n=i.firstChild;n;n=n.nextSibling)3===n.nodeType?a+=n.nodeValue.length:1===n.nodeType&&(t.push({event:"start",offset:a,node:n}),a=e(n,a),vv(n).match(/br|hr|img|input/)||t.push({event:"stop",offset:a,node:n}));return a}(e,0),t}const Sv={},wv=e=>{console.error(e)},Cv=(e,...t)=>{console.log("WARN: "+e,...t)},xv=(e,t)=>{Sv[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Sv[`${e}/${t}`]=!0)},Tv=UD,Ov=zD,Nv=Symbol("nomatch");var Av=function(e){const t=Object.create(null),i=Object.create(null),a=[];let n=!0;const r=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:WD};function u(e){return l.noHighlightRe.test(e)}function d(e,t,i,a){let n="",r="";"object"==typeof t?(n=e,i=t.ignoreIllegals,r=t.language,a=void 0):(xv("10.7.0","highlight(lang, code, ...args) has been deprecated."),xv("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,n=t);const o={code:n,language:r};v("before:highlight",o);const s=o.result?o.result:_(o.language,o.code,i,a);return s.code=o.code,v("after:highlight",s),s}function _(e,i,r,s){function u(e,t){const i=b.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,i)&&e.keywords[i]}function d(){null!=v.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof v.subLanguage){if(!t[v.subLanguage])return void S.addText(w);e=_(v.subLanguage,w,!0,k[v.subLanguage]),k[v.subLanguage]=e.top}else e=c(w,v.subLanguage.length?v.subLanguage:null);v.relevance>0&&(C+=e.relevance),S.addSublanguage(e.emitter,e.language)}():function(){if(!v.keywords)return void S.addText(w);let e=0;v.keywordPatternRe.lastIndex=0;let t=v.keywordPatternRe.exec(w),i="";for(;t;){i+=w.substring(e,t.index);const a=u(v,t);if(a){const[e,n]=a;if(S.addText(i),i="",C+=n,e.startsWith("_"))i+=t[0];else{const i=b.classNameAliases[e]||e;S.addKeyword(t[0],i)}}else i+=t[0];e=v.keywordPatternRe.lastIndex,t=v.keywordPatternRe.exec(w)}i+=w.substr(e),S.addText(i)}(),w=""}function g(e){return e.className&&S.openNode(b.classNameAliases[e.className]||e.className),v=Object.create(e,{parent:{value:v}}),v}function f(e){return 0===v.matcher.regexIndex?(w+=e[0],1):(O=!0,0)}function h(e){const t=e[0],i=e.rule,a=new qD(i),n=[i.__beforeBegin,i["on:begin"]];for(const i of n)if(i&&(i(e,a),a.isMatchIgnored))return f(t);return i&&i.endSameAsBegin&&(i.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),i.skip?w+=t:(i.excludeBegin&&(w+=t),d(),i.returnBegin||i.excludeBegin||(w=t)),g(i),i.returnBegin?0:t.length}function p(e){const t=e[0],a=i.substr(e.index),n=function e(t,i,a){let n=function(e,t){const i=e&&e.exec(t);return i&&0===i.index}(t.endRe,a);if(n){if(t["on:end"]){const e=new qD(t);t["on:end"](i,e),e.isMatchIgnored&&(n=!1)}if(n){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,i,a)}(v,e,a);if(!n)return Nv;const r=v;r.skip?w+=t:(r.returnEnd||r.excludeEnd||(w+=t),d(),r.excludeEnd&&(w=t));do{v.className&&S.closeNode(),v.skip||v.subLanguage||(C+=v.relevance),v=v.parent}while(v!==n.parent);return n.starts&&(n.endSameAsBegin&&(n.starts.endRe=n.endRe),g(n.starts)),r.returnEnd?0:t.length}let m={};function F(t,a){const o=a&&a[0];if(w+=t,null==o)return d(),0;if("begin"===m.type&&"end"===a.type&&m.index===a.index&&""===o){if(w+=i.slice(a.index,a.index+1),!n){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=a,"begin"===a.type)return h(a);if("illegal"===a.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(v.className||"<unnamed>")+'"');throw e.mode=v,e}if("end"===a.type){const e=p(a);if(e!==Nv)return e}if("illegal"===a.type&&""===o)return 1;if(T>1e5&&T>3*a.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=E(e);if(!b)throw wv(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const y=Ev(b,{plugins:a});let D="",v=s||y;const k={},S=new l.__emitter(l);!function(){const e=[];for(let t=v;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>S.openNode(e))}();let w="",C=0,x=0,T=0,O=!1;try{for(v.matcher.considerAll();;){T++,O?O=!1:v.matcher.considerAll(),v.matcher.lastIndex=x;const e=v.matcher.exec(i);if(!e)break;const t=F(i.substring(x,e.index),e);x=e.index+t}return F(i.substr(x)),S.closeAllNodes(),S.finalize(),D=S.toHTML(),{relevance:Math.floor(C),value:D,language:e,illegal:!1,emitter:S,top:v}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:i.slice(x-100,x+100),mode:t.mode},sofar:D,relevance:0,value:Tv(i),emitter:S};if(n)return{illegal:!1,relevance:0,value:Tv(i),emitter:S,language:e,top:v,errorRaised:t};throw t}}function c(e,i){i=i||l.languages||Object.keys(t);const a=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:Tv(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),n=i.filter(E).filter(D).map(t=>_(t,e,!1));n.unshift(a);const r=n.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(E(e.language).supersetOf===t.language)return 1;if(E(t.language).supersetOf===e.language)return-1}return 0}),[o,u]=r,d=o;return d.second_best=u,d}const g={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},f=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(f,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const a=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=l.languageDetectRe.exec(t);if(i){const t=E(i[1]);return t||(Cv(o.replace("{}",i[1])),Cv("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||E(e))}(e);if(u(a))return;v("before:highlightElement",{el:e,language:a}),t=e;const n=t.textContent,r=a?d(n,{language:a,ignoreIllegals:!0}):c(n);v("after:highlightElement",{el:e,result:r,text:n}),e.innerHTML=r.value,function(e,t,a){const n=t?i[t]:a;e.classList.add("hljs"),n&&e.classList.add(n)}(e,a,r.language),e.result={language:r.language,re:r.relevance,relavance:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance,relavance:r.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,xv("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(p)};let F=!1;function b(){if("loading"===document.readyState)return void(F=!0);document.querySelectorAll("pre code").forEach(p)}function E(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function y(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function D(e){const t=E(e);return t&&!t.disableAutodetect}function v(e,t){const i=e;a.forEach((function(e){e[i]&&e[i](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 xv("10.2.0","fixMarkup will be removed entirely in v11.0"),xv("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(r,e=>"\n"===e?l.useBR?"<br>":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:p,highlightBlock:function(e){return xv("10.7.0","highlightBlock will be removed entirely in v12.0"),xv("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(xv("10.3.0","'useBR' will be removed entirely in v11.0"),xv("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=Ov(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){xv("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(i,a){let r=null;try{r=a(e)}catch(e){if(wv("Language definition for '{}' could not be registered.".replace("{}",i)),!n)throw e;wv(e),r=s}r.name||(r.name=i),t[i]=r,r.rawDefinition=a.bind(null,e),r.aliases&&y(r.aliases,{languageName:i})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(i))i[t]===e&&delete i[t]},listLanguages:function(){return Object.keys(t)},getLanguage:E,registerAliases:y,requireLanguage:function(e){xv("10.4.0","requireLanguage will be removed entirely in v11."),xv("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=E(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:D,inherit:Ov,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),a.push(e)},vuePlugin:yv(e).VuePlugin}),e.debugMode=function(){n=!1},e.safeMode=function(){n=!0},e.versionString="10.7.3";for(const e in cv)"object"==typeof cv[e]&&PD(cv[e]);return Object.assign(e,cv),e.addPlugin(g),e.addPlugin(Dv),e.addPlugin(h),e}({}),Rv={exports:{}};!function(e){!function(){var t;function i(e){for(var t,i,a,n,r=1,o=[].slice.call(arguments),s=0,l=e.length,u="",d=!1,_=!1,c=function(){return o[r++]},g=function(){for(var i="";/\d/.test(e[s]);)i+=e[s++],t=e[s];return i.length>0?parseInt(i):null};s<l;++s)if(t=e[s],d)switch(d=!1,"."==t?(_=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(_=!0,t=e[s+=2]):_=!0,n=g(),t){case"b":u+=parseInt(c(),10).toString(2);break;case"c":u+="string"==typeof(i=c())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case"d":u+=parseInt(c(),10);break;case"f":a=String(parseFloat(c()).toFixed(n||6)),u+=_?a:a.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=i).format=i,t.vsprintf=function(e,t){return i.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(i.apply(null,arguments))})}()}(Rv);var Mv=Rv.exports,Iv=Lv(Error),Bv=Iv;function Lv(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=Mv.apply(null,arguments)),new e(t)}}Iv.eval=Lv(EvalError),Iv.range=Lv(RangeError),Iv.reference=Lv(ReferenceError),Iv.syntax=Lv(SyntaxError),Iv.type=Lv(TypeError),Iv.uri=Lv(URIError),Iv.create=Lv;var Pv=Av,jv=Bv;BD.highlight=qv,BD.highlightAuto=function(e,t){var i=t||{},a=i.subset||Pv.listLanguages();i.prefix;var n,r,o,s,l=a.length,u=-1;if("string"!=typeof e)throw jv("Expected `string` for value, got `%s`",e);r={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};for(;++u<l;)s=a[u],Pv.getLanguage(s)&&((o=qv(s,e,t)).language=s,o.relevance>r.relevance&&(r=o),o.relevance>n.relevance&&(r=n,n=o));r.language&&(n.secondBest=r);return n},BD.registerLanguage=function(e,t){Pv.registerLanguage(e,t)},BD.listLanguages=function(){return Pv.listLanguages()},BD.registerAlias=function(e,t){var i,a=e;t&&((a={})[e]=t);for(i in a)Pv.registerAliases(a[i],{languageName:i})},Uv.prototype.addText=function(e){var t,i,a=this.stack;if(""===e)return;t=a[a.length-1],(i=t.children[t.children.length-1])&&"text"===i.type?i.value+=e:t.children.push({type:"text",value:e})},Uv.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},Uv.prototype.addSublanguage=function(e,t){var i=this.stack,a=i[i.length-1],n=e.rootNode.children,r=t?{type:"element",tagName:"span",properties:{className:[t]},children:n}:n;a.children=a.children.concat(r)},Uv.prototype.openNode=function(e){var t=this.stack,i=this.options.classPrefix+e,a=t[t.length-1],n={type:"element",tagName:"span",properties:{className:[i]},children:[]};a.children.push(n),t.push(n)},Uv.prototype.closeNode=function(){this.stack.pop()},Uv.prototype.closeAllNodes=zv,Uv.prototype.finalize=zv,Uv.prototype.toHTML=function(){return""};function qv(e,t,i){var a,n=Pv.configure({}),r=(i||{}).prefix;if("string"!=typeof e)throw jv("Expected `string` for name, got `%s`",e);if(!Pv.getLanguage(e))throw jv("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw jv("Expected `string` for value, got `%s`",t);if(null==r&&(r="hljs-"),Pv.configure({__emitter:Uv,classPrefix:r}),a=Pv.highlight(t,{language:e,ignoreIllegals:!0}),Pv.configure(n||{}),a.errorRaised)throw a.errorRaised;return{relevance:a.relevance,language:a.language,value:a.emitter.rootNode.children}}function Uv(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function zv(){}function Gv(e){return e.value||e.children||[]}function Hv({doc:e,name:t,lowlight:i}){const a=[];return ys(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:n}=e.node.attrs,r=i.listLanguages();(function e(t,i=[]){return t.map(t=>{const a=[...i,...t.properties?t.properties.className:[]];return t.children?e(t.children,a):{text:t.value,classes:a}}).flat()})(n&&r.includes(n)?Gv(i.highlight(n,e.node.textContent)):Gv(i.highlightAuto(e.node.textContent))).forEach(e=>{const i=t+e.text.length;if(e.classes.length){const n=On.inline(t,i,{class:e.classes.join(" ")});a.push(n)}t=i})}),Mn.create(e,a)}function Yv({name:e,lowlight:t}){return new Rt({key:new Bt("lowlight"),state:{init:(i,{doc:a})=>Hv({doc:a,name:e,lowlight:t}),apply:(i,a,n,r)=>{const o=n.selection.$head.parent.type.name,s=r.selection.$head.parent.type.name,l=ys(n.doc,t=>t.type.name===e),u=ys(r.doc,t=>t.type.name===e);return i.docChanged&&([o,s].includes(e)||u.length!==l.length||i.steps.some(e=>void 0!==e.from&&void 0!==e.to&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?Hv({doc:i.doc,name:e,lowlight:t}):a.map(i.mapping,i.doc)}},props:{decorations(e){return this.getState(e)}}})}const Wv=IF.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:BD}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],Yv({name:this.name,lowlight:this.options.lowlight})]}});function Vv(){return m.a.createElement(Lu,{"data-cy":"neeto-editor-code-block"},m.a.createElement("pre",null,m.a.createElement(Pu,{as:"code"})))}var $v=i(96),Kv=i.n($v),Qv=Wv.extend({addNodeView:function(){return new Ru(Vv)}}).configure({lowlight:Kv.a}),Zv=function(e){var t=e.items,i=e.command;return m.a.createElement("div",{className:"neeto-editor-variables-suggestion"},m.a.createElement(Mf,{variables:t,onClickVariable:function(e){var t=e.category_key,a=e.key,n=t?"".concat(t,".").concat(a):a;i({label:n,id:n})}}))};function Xv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Jv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Xv(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Xv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var ek=new Bt("variables"),tk=cs.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel:function(e){var t=e.options,i=e.node;return"".concat(t.charOpen).concat(i.attrs.label||i.attrs.id).concat(t.charClose)},suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:function(e){return e.getAttribute("data-id")},renderHTML:function(e){return e.id?{"data-id":e.id}:{}}},label:{default:null,parseHTML:function(e){return e.getAttribute("data-label")},renderHTML:function(e){return e.label?{"data-label":e.label}:{}}}}},parseHTML:function(){return[{tag:"span[data-variable]"}]},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return["span",ns({"data-variable":""},this.options.HTMLAttributes,i),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addCommands:function(){var e=this;return{setVariable:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:t},{type:"text",text:" "}]).run()}}}},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var i=t.tr,a=t.state,n=!1,r=a.selection,o=r.empty,s=r.anchor;return!!o&&(a.doc.nodesBetween(s-1,s,(function(t,a){if(t.type.name===e.name)return n=!0,i.insertText("",a,a+t.nodeSize),!1})),n)}))}}},addProseMirrorPlugins:function(){return[_D(Jv({editor:this.editor},this.options.suggestion))]}}),ik={char:"{{",startOfLine:!1,pluginKey:ek,command:function(e){var t=e.editor,i=e.range,a=e.props;t.chain().focus().deleteRange(i).setVariable(a).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(Zv,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},ak=function(e){var t=e.suggestion,i=void 0===t?{}:t;return tk.configure({suggestion:Jv(Jv({},ik),i)})},nk=i(33),rk=i.n(nk),ok=i(97),sk=i.n(ok),lk=function(e){var t=rk()(e);return"string"===t||"funtion"===t?e:sk()(e)?function(t){var i=t.node.type.name;return e[i]}:""},uk=mr.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Rt({props:{decorations:function(t){var i=t.doc,a=t.selection,n=e.editor.isEditable||!e.options.showOnlyWhenEditable,r=a.anchor,o=[];if(n)return i.descendants((function(t,i){var a=r>=i&&r<=i+t.nodeSize,n=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((a||!e.options.showOnlyCurrent)&&!s&&n){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=On.node(i,i+t.nodeSize,{class:l.join(" "),"data-placeholder":"function"==typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:i}):e.options.placeholder});o.push(u)}return e.options.includeChildren})),Mn.create(i,o)}}})]}});const dk=new Bt("suggestion");function _k({pluginKey:e=dk,editor:t,char:i="@",allowSpaces:a=!1,prefixSpace:n=!0,startOfLine:r=!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 Rt({key:e,view(){return{update:async(e,i)=>{var a,n,r,o,s;const d=null===(a=this.key)||void 0===a?void 0:a.getState(i),_=null===(n=this.key)||void 0===n?void 0:n.getState(e.state),g=d.active&&_.active&&d.range.from!==_.range.from,f=!d.active&&_.active,h=d.active&&!_.active,p=f||g,m=!f&&!h&&d.query!==_.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?d:_,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from: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:i,prefixSpace:a,startOfLine:n,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=n?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=r.depth<=0?0:r.before(),_=r.pos,c=r.doc.textBetween(d,_,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(a&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:a,prefixSpace:n,startOfLine:r,$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 i;const{active:a,range:n}=this.getState(e.state);return a&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:n}))||!1},decorations(e){const{active:t,range:i,decorationId:a}=this.getState(e);return t?Mn.create(e.doc,[On.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":a})]):null}}})}const ck=new Bt("mention"),gk=cs.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var i;return`${e.suggestion.char}${null!==(i=t.attrs.label)&&void 0!==i?i:t.attrs.id}`},suggestion:{char:"@",pluginKey:ck,command:({editor:e,range:t,props:i})=>{var a;const n=e.view.state.selection.$to.nodeAfter;(null===(a=null==n?void 0:n.text)||void 0===a?void 0:a.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:i},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const i=e.state.doc.resolve(t.from),a=e.schema.nodes[this.name];return!!i.parent.type.contentMatch.matchType(a)}}}},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",ns({"data-mention":""},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let i=!1;const{selection:a}=t,{empty:n,anchor:r}=a;return!!n&&(t.doc.nodesBetween(r-1,r,(t,a)=>{if(t.type.name===this.name)return i=!0,e.insertText(this.options.suggestion.char||"",a,a+t.nodeSize),!1}),i)})}},addProseMirrorPlugins(){return[_k({editor:this.editor,...this.options.suggestion})]}});function fk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=oh()(e);if(t){var n=oh()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return nh()(this,i)}}var hk=function(e){ih()(i,e);var t=fk(i);function i(e){var a;return Qf()(this,i),a=t.call(this,e),_()(eh()(a),"selectItem",(function(e){var t=a.props,i=t.items,n=t.command,r=i[e];r&&n({label:r.name,id:r.key})})),_()(eh()(a),"upHandler",(function(){var e=a.props.items;a.setState((function(t){return{selectedIndex:(t.selectedIndex+e.length-1)%e.length}}))})),_()(eh()(a),"downHandler",(function(){var e=a.props.items;a.setState((function(t){return{selectedIndex:(t.selectedIndex+1)%e.length}}))})),_()(eh()(a),"enterHandler",(function(){var e=a.state.selectedIndex;a.selectItem(e)})),_()(eh()(a),"onKeyDown",(function(e){var t=e.event,i={ArrowUp:a.upHandler,ArrowDown:a.downHandler,Enter:a.enterHandler};return!!i.hasOwnProperty(t.key)&&(i[t.key](),!0)})),a.state={selectedIndex:0},a.mentionRef=m.a.createRef(),a}return Xf()(i,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),cD({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,i=this.props.items;return 0===i.length?m.a.createElement("div",{className:"neeto-editor-mentions__wrapper"},m.a.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):m.a.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},i.map((function(i,a){var n=i.key,r=i.name,o=i.imageUrl,s=i.showImage;return m.a.createElement("button",{className:b()("neeto-editor-mentions__item",{active:a===t}),key:n,onClick:function(){return e.selectItem(a)},type:"button","data-cy":"neeto-editor-mention-list-".concat(r)},s&&m.a.createElement(Hf,{user:{name:r,imageUrl:o}}),m.a.createElement("p",null,r))})))}}]),i}(m.a.Component);function pk(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function mk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?pk(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):pk(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Fk=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.showImage,a=void 0!==i&&i,n=e.map((function(e,t){return mk({showImage:a,key:"".concat(cd(e.name),"-").concat(t)},e)})).sort((function(e,t){return e.name.localeCompare(t.name)}));return function(e){var t=e.query;return n.filter((function(e){return e.name.toLowerCase().includes(t.toLowerCase())}))}},bk=["suggestion"];function Ek(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function yk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ek(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ek(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Dk={render:function(){var e,t;return{onStart:function(i){e=new Tu(hk,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(i){var a;return"Escape"===i.event.key?(t[0].hide(),!0):null===(a=e.ref)||void 0===a?void 0:a.onKeyDown(i)},onExit:function(){t[0].destroy(),e.destroy()}}}},vk=gk.extend({addCommands:function(){var e=this;return{setMention:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:{id:t,label:t}},{type:"text",text:" "}]).run()}}}}}),kk=function(e){var t=e.suggestion,i=void 0===t?{}:t,a=h()(e,bk);return vk.configure(yk(yk({},a),{},{suggestion:yk(yk({},Dk),i)}))};function Sk(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function wk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Sk(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Sk(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Ck=cs.create({name:"external-video",addOptions:function(){return{inline:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["iframe",ns(this.options.HTMLAttributes,wk(wk({},t),{},{class:"video-wrapper"}))]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(i){return i.commands.insertContent({type:e.name,attrs:t})}}}}});function xk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=oh()(e);if(t){var n=oh()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return nh()(this,i)}}var Tk=function(e){ih()(i,e);var t=xk(i);function i(){var e;Qf()(this,i);for(var a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return e=t.call.apply(t,[this].concat(n)),_()(eh()(e),"state",{selectedIndex:0,emojiSuggestions:Lh.search(e.props.query||"smile").slice(0,5)}),_()(eh()(e),"onKeyDown",(function(t){var i=t.event;if("ArrowLeft"===i.key||"ArrowDown"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===i.key||"ArrowUp"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===i.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===i.key){var a;if(fd(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(a=Lh.search(e.props.query))||void 0===a?void 0:a[0]).run();return!0}return"Escape"===i.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),_()(eh()(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return Xf()(i,[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:Lh.search(this.props.query||"smile").slice(0,5)})}},{key:"render",value:function(){var e=this;return m.a.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map((function(t,i){return m.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(i)},className:b()("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":i===e.state.selectedIndex}),"data-cy":"neeto-editor-emoji-suggestion-".concat(t.id)},t.native)})):m.a.createElement("p",null,"No results"))}}]),i}(m.a.Component);function Ok(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Nk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ok(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ok(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Ak=new Bt("emoji-suggestion"),Rk=cs.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:Ak,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(Tk,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addCommands:function(){return{setEmoji:function(e){return function(t){(0,t.chain)().focus().insertContent("".concat((null==e?void 0:e.native)||""," ")).run()}}}},addProseMirrorPlugins:function(){return[_D(Nk({editor:this.editor},this.options.suggestion))]}});function Mk(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Ik(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Mk(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Mk(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Bk=new Bt("emoji-picker"),Lk=cs.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:Bk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(Up,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[_D(Ik({editor:this.editor},this.options.suggestion))]}});function Pk(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}var jk=function(e){var t=e.handleSubmit,i=e.shortcuts;return mr.create({addKeyboardShortcuts:function(){var e=this;return function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Pk(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Pk(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({"Mod-Enter":function(){return null==t||t(e.editor.getHTML()),e.editor.commands.blur(),!0}},i)}})},qk=function(e){var t=e.handleSubmit,i=e.shortcuts;return jk({handleSubmit:t,shortcuts:i})};var Uk=[km.FONT_COLOR,km.FONT_SIZE,km.BOLD,km.ITALIC,km.UNDERLINE,km.STRIKETHROUGH,km.LINK,km.LIST_BULLETS,km.LIST_ORDERED],zk=function(e,t){var i=[];e.split(/\n/).forEach((function(e){var a={type:"paragraph"};e.length>0&&(a.content=[{type:"text",text:e}]);var n=W.fromJSON(t.doc.type.schema,a);i.push(n)}));var a=D.fromArray(i);return T.maxOpen(a)},Gk=["forceTitle","titleError","hideSlashCommands","addons","addonCommands","markdownMode","className","uploadEndpoint","uploadConfig","initialValue","onChange","onFocus","onBlur","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName","characterLimit","editorSecrets","rows","autoFocus","onSubmit","heightStrategy","characterCountStrategy","keyboardShortcuts"],Hk=function(e,t){var i=e.forceTitle,a=void 0!==i&&i,n=e.titleError,r=void 0!==n&&n,o=e.hideSlashCommands,s=void 0!==o&&o,l=e.addons,d=void 0===l?[]:l,c=e.addonCommands,f=e.markdownMode,F=void 0!==f&&f,E=e.className,y=e.uploadEndpoint,D=e.uploadConfig,v=void 0===D?{}:D,k=e.initialValue,S=void 0===k?"":k,w=e.onChange,C=void 0===w?function(){}:w,x=e.onFocus,T=void 0===x?function(){}:x,O=e.onBlur,N=void 0===O?function(){}:O,A=e.menuType,R=void 0===A?"fixed":A,M=e.variables,I=e.mentions,B=e.showImageInMention,L=void 0!==B&&B,P=e.placeholder,j=void 0===P?a?{title:"Untitled"}:null:P,q=e.extensions,U=e.contentClassName,z=e.characterLimit,G=e.editorSecrets,H=e.rows,Y=void 0===H?6:H,W=e.autoFocus,V=void 0!==W&&W,$=e.onSubmit,K=e.heightStrategy,Q=void 0===K?"fixed":K,Z=e.characterCountStrategy,X=void 0===Z?"hidden":Z,J=e.keyboardShortcuts,ee=void 0===J?[]:J,te=h()(e,Gk),ie=Object(p.useState)(!1),ae=g()(ie,2),ne=ae[0],re=ae[1],oe=!F&&"fixed"===R,se=!F&&"bubble"===R,le=!F&&!s,ue=function(e){if(e){if("string"==typeof e&&e.length)return!0;if("object"===rk()(e)&&Object.keys(e).length)return!0;if("function"==typeof e)return!0}return!1}(j),de=!ue&&le,_e=d.includes("image-upload-unsplash"),ce=!F&&"hidden"!==X,ge=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=t.includeImageUpload,a=e.map((function(e){return e.toLowerCase()}));return i&&a.push(km.IMAGE_UPLOAD),[].concat(Uk,a)}(d,{includeImageUpload:_e}),fe=function(e){var t=e.forceTitle,i=e.placeholder,a=e.extensions,n=e.mentions,r=e.variables,o=e.isSlashCommandsActive,s=e.showImageInMention,l=e.setImageUploadVisible,u=e.options,d=e.addonCommands,_=e.characterLimit,c=e.onSubmit,g=e.keyboardShortcuts,f=[aD,iD.extend({content:t?"title block*":"block+"}),xb.configure({document:!1,codeBlock:!1}),uD,Qb,eD,Jb,Qv,lD,PF,Ck,Jy,tD,uk.configure({placeholder:lk(i)}),Rk,Lk,Zy.configure({limit:_}),qk({handleSubmit:c,shortcuts:g})];return o&&f.push(ID({setImageUploadVisible:l,options:u,addonCommands:d,mentions:n})),fd(n)||f.push(kk({suggestion:{items:Fk(n,{showImage:s})}})),fd(r)||f.push(ak({suggestion:{items:function(){return r}}})),fd(a)||(f=f.concat(a)),f}({contentClassName:U,forceTitle:a,placeholder:j,extensions:q,mentions:I,variables:M,isSlashCommandsActive:le,showImageInMention:L,setImageUploadVisible:re,options:ge,addonCommands:c,characterLimit:z,keyboardShortcuts:ee,onSubmit:$}),he=b()("neeto-editor",_()({"slash-active":de,"fixed-menu-active border":oe,"bubble-menu-active":se,"force-title":a,"force-title--error":r,"placeholder-active":ue},E,E)),pe=function(e){var t=e.heightStrategy,i={},a=21*e.rows+26;return"flexible"===t?i["min-height"]=a+"px":i.height=a+"px",i}({heightStrategy:Q,rows:Y}),me=xu({extensions:fe,content:S,injectCSS:!1,autofocus:V&&"end",editorProps:{attributes:{class:he,style:gd(pe)},clipboardTextParser:zk},parseOptions:{preserveWhitespace:!0},onUpdate:function(e){var t=e.editor;return C(t.getHTML())},onFocus:T,onBlur:N}),Fe=EF({content:S,onUpdate:function(e){var t=e.html;return C(t)},onSubmit:function(e){var t=e.html;return $&&$(t)},markdownMode:F});return m.a.useImperativeHandle(t,(function(){return{editor:F?Fe:me}})),Object(p.useEffect)((function(){if(me){var e=F?me.getHTML():Fe.getHTML();(F?Fe.commands.setContent:me.commands.setContent)(e)}}),[F]),m.a.createElement("div",{className:"neeto-editor-wrapper"},oe&&m.a.createElement(Gp,{editor:me,variables:M,setImageUploadVisible:re,options:ge,mentions:I,showImageInMention:L}),se&&m.a.createElement(Zg,{editor:me,options:ge}),m.a.createElement(Tm,{isVisible:ne,setIsVisible:re,editor:me,imageUploadUrl:y,uploadConfig:v,isUnsplashImageUploadActive:_e,unsplashApiKey:null==G?void 0:G.unsplash}),F&&m.a.createElement(Im,u()({editor:Fe,strategy:Q,style:pe,limit:z,className:he,onFocus:T,onBlur:N},te)),m.a.createElement("div",{className:b()({"neeto-editor-content--hidden":F})},m.a.createElement(Bu,u()({editor:me},te))),ce&&m.a.createElement(Bm,{count:null==me?void 0:me.storage.characterCount.characters(),limit:z,strategy:X}))},Yk=m.a.forwardRef(Hk),Wk=i(98),Vk=i.n(Wk);var $k=["content","className"],Kk=function(e){var t=e.content,i=void 0===t?"":t,a=e.className,n=h()(e,$k);return Object(p.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){Vk.a.highlightElement(e)}))}),[i]),m.a.createElement("div",u()({className:b()("neeto-editor-content",_()({},a,a)),dangerouslySetInnerHTML:{__html:Pm.a.sanitize(i,{ADD_ATTR:["target"]})},"data-cy":"neeto-editor-content"},n))}}])}));
66
+ */;function yc(){return(yc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e}).apply(this,arguments)}function Dc(e,t){if(null==e)return{};var i,a,n={},r=Object.keys(e);for(a=0;a<r.length;a++)i=r[a],t.indexOf(i)>=0||(n[i]=e[i]);return n}const vc=["onClick","reloadDocument","replace","state","target","to"],kc=["aria-current","caseSensitive","className","end","style","to"];const Sc=Object(p.forwardRef)((function(e,t){let{onClick:i,reloadDocument:a,replace:n=!1,state:r,target:o,to:s}=e,l=Dc(e,vc),u=cc(s),d=function(e,t){let{target:i,replace:a,state:n}=void 0===t?{}:t,r=hc(),o=fc(),s=pc(e);return Object(p.useCallback)(t=>{if(!(0!==t.button||i&&"_self"!==i||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t))){t.preventDefault();let i=!!a||oc(o)===oc(s);r(e,{replace:i,state:n})}},[o,r,s,a,n,i,e])}(s,{replace:n,state:r,target:o});return Object(p.createElement)("a",yc({},l,{href:u,onClick:function(e){i&&i(e),e.defaultPrevented||a||d(e)},ref:t,target:o}))}));const wc=Object(p.forwardRef)((function(e,t){let{"aria-current":i="page",caseSensitive:a=!1,className:n="",end:r=!1,style:o,to:s}=e,l=Dc(e,kc),u=fc(),d=pc(s),_=u.pathname,c=d.pathname;a||(_=_.toLowerCase(),c=c.toLowerCase());let g,f=_===c||!r&&_.startsWith(c)&&"/"===_.charAt(c.length),h=f?i:void 0;g="function"==typeof n?n({isActive:f}):[n,f?"active":null].filter(Boolean).join(" ");let m="function"==typeof o?o({isActive:f}):o;return Object(p.createElement)(Sc,yc({},l,{"aria-current":h,className:g,ref:t,style:m,to:s}))}));function Cc(e,t){if(null==e)return{};var i,a,n={},r=Object.keys(e);for(a=0;a<r.length;a++)i=r[a],t.indexOf(i)>=0||(n[i]=e[i]);return n}var xc="undefined"!=typeof window&&"undefined"!=typeof document;function Tc(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function Oc(){return xc&&document.createElement("div")}function Nc(e){var t=[];return e.forEach((function(e){t.find((function(t){return function e(t,i){if(t===i)return!0;if("object"==typeof t&&null!=t&&"object"==typeof i&&null!=i){if(Object.keys(t).length!==Object.keys(i).length)return!1;for(var a in t){if(!i.hasOwnProperty(a))return!1;if(!e(t[a],i[a]))return!1}return!0}return!1}(e,t)}))||t.push(e)})),t}function Ac(e,t){var i,a;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:Nc([].concat((null==(i=e.popperOptions)?void 0:i.modifiers)||[],(null==(a=t.popperOptions)?void 0:a.modifiers)||[]))})})}var Rc=xc?p.useLayoutEffect:p.useEffect;function Mc(e){var t=Object(p.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function Ic(e,t,i){i.split(/\s+/).forEach((function(i){i&&e.classList[t](i)}))}var Bc={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,i=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function a(){e.props.className&&!i()||Ic(t,"add",e.props.className)}return{onCreate:a,onBeforeUpdate:function(){i()&&Ic(t,"remove",e.props.className)},onAfterUpdate:a}}};function Lc(e){return function(t){var i=t.children,a=t.content,n=t.visible,r=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,Cc(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),g=void 0!==n,f=void 0!==r,h=Object(p.useState)(!1),F=h[0],b=h[1],E=Object(p.useState)({}),y=E[0],D=E[1],v=Object(p.useState)(),k=v[0],S=v[1],w=Mc((function(){return{container:Oc(),renders:1}})),C=Object.assign({ignoreAttributes:_},c,{content:w.container});g&&(C.trigger="manual",C.hideOnClick=!1),f&&(u=!0);var x=C,T=C.plugins||[];o&&(x=Object.assign({},C,{plugins:f&&null!=r.data?[].concat(T,[{fn:function(){return{onTrigger:function(e,t){var i=r.data.children.find((function(e){return e.instance.reference===t.currentTarget}));e.state.$$activeSingletonInstance=i.instance,S(i.content)}}}}]):T,render:function(){return{popper:w.container}}}));var O=[s].concat(i?[i.type]:[]);return Rc((function(){var t=s;s&&s.hasOwnProperty("current")&&(t=s.current);var i=e(t||w.ref||Oc(),Object.assign({},x,{plugins:[Bc].concat(C.plugins||[])}));return w.instance=i,u&&i.disable(),n&&i.show(),f&&r.hook({instance:i,content:a,props:x,setSingletonContent:S}),b(!0),function(){i.destroy(),null==r||r.cleanup(i)}}),O),Rc((function(){var e;if(1!==w.renders){var t=w.instance;t.setProps(Ac(t.props,x)),null==(e=t.popperInstance)||e.forceUpdate(),u?t.disable():t.enable(),g&&(n?t.show():t.hide()),f&&r.hook({instance:t,content:a,props:x,setSingletonContent:S})}else w.renders++})),Rc((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,i=e.state,a=null==(t=i.modifiersData)?void 0:t.hide;y.placement===i.placement&&y.referenceHidden===(null==a?void 0:a.isReferenceHidden)&&y.escaped===(null==a?void 0:a.hasPopperEscaped)||D({placement:i.placement,referenceHidden:null==a?void 0:a.isReferenceHidden,escaped:null==a?void 0:a.hasPopperEscaped}),i.attributes.popper={}}}])})})}}),[y.placement,y.referenceHidden,y.escaped].concat(O)),m.a.createElement(m.a.Fragment,null,i?Object(p.cloneElement)(i,{ref:function(e){w.ref=e,Tc(i.ref,e)}}):null,F&&Object(ku.createPortal)(o?o(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(y),k,w.instance):a,w.container))}}var Pc=function(e,t){return Object(p.forwardRef)((function(i,a){var n=i.children,r=Cc(i,["children"]);return m.a.createElement(e,Object.assign({},t,r),n?Object(p.cloneElement)(n,{ref:function(e){Tc(a,e),Tc(n.ref,e)}}):null)}))},jc=Pc(Lc(bu)),qc=["content","children","theme","disabled","placement","position","interactive","delay"],Uc=function(e){var t=e.content,i=e.children,a=e.theme,n=void 0===a?"dark":a,r=e.disabled,o=void 0!==r&&r,s=e.placement,l=e.position,d=void 0===l?"auto":l,_=e.interactive,c=void 0!==_&&_,g=e.delay,f=void 0===g?0:g,p=h()(e,qc);return m.a.createElement(jc,u()({role:"tooltip",theme:n,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,delay:f},p),i)},zc=["icon","iconPosition","iconSize","label","loading","onClick","to","type","style","fullWidth","className","disabled","size","href","tooltipProps"],Gc=function(){},Hc="primary",Yc="secondary",Wc="danger",Vc="text",$c="link",Kc="large",Qc="left",Zc=Object(p.forwardRef)((function(e,t){var i,a,n=e.icon,r=void 0===n?null:n,o=e.iconPosition,s=void 0===o?"right":o,l=e.iconSize,d=void 0===l?16:l,_=e.label,c=void 0===_?"":_,g=e.loading,f=void 0!==g&&g,p=e.onClick,F=void 0===p?Gc:p,E=e.to,y=void 0===E?null:E,D=e.type,v=void 0===D?"button":D,k=e.style,S=void 0===k?"primary":k,w=e.fullWidth,C=void 0!==w&&w,x=e.className,T=void 0===x?"":x,O=e.disabled,N=void 0!==O&&O,A=e.size,R=void 0===A?null:A,M=e.href,I=void 0===M?null:M,B=e.tooltipProps,L=void 0===B?null:B,P=h()(e,zc);y?(i=Sc,a={to:y}):I?(i="a",a={href:I}):(i="button",a={type:v});var j="string"==typeof r?function(){return m.a.createElement("i",{className:b()("ne-btn__icon",[r])})}:r||m.a.Fragment;return m.a.createElement(Uc,u()({},L,{disabled:!L}),m.a.createElement(i,u()({ref:t,onClick:function(e){f||N||F(e)},className:b()("ne-btn",[T],{"ne-btn--style-primary":S===Hc,"ne-btn--style-secondary":S===Yc,"ne-btn--style-danger":S===Wc,"ne-btn--style-text":S===Vc,"ne-btn--style-link":S===$c,"ne-btn--size-large":R===Kc,"ne-btn--width-full":C,"ne-btn--icon-left":s==Qc,"ne-btn--icon-only":!c,disabled:N}),disabled:N},a,P),c&&m.a.createElement("span",null,c),r?m.a.createElement(j,{key:"2",size:d,className:"ne-btn__icon"}):null))}));Zc.displayName="Button";var Xc=Zc,Jc=function(e){var t=e.children,i=e.className,a=void 0===i?"root-portal":i,n=e.el,r=void 0===n?"div":n,o=document.getElementsByClassName(a)[0];return o||(o=document.createElement(r)).classList.add(a),m.a.useEffect((function(){document.body.appendChild(o)}),[]),Su.a.createPortal(t,o)},eg=["children","className"],tg=function(e){var t=e.children,i=e.className,a=h()(e,eg);return m.a.createElement("div",u()({className:b()("ne-backdrop",_()({},i,i))},a),t)},ig=function(e,t){Object(p.useEffect)((function(){var i=function(i){e.current&&!e.current.contains(i.target)&&t(i)};return document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),function(){document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}}),[e,t])},ag=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"],ng=function(){},rg="xs",og="sm",sg="md",lg=function(e){var t=e.size,i=void 0===t?"sm":t,a=e.isOpen,n=void 0!==a&&a,r=e.onClose,o=void 0===r?ng:r,s=e.loading,l=void 0!==s&&s,d=e.children,c=e.className,g=void 0===c?"":c,f=e.closeOnEsc,F=void 0===f||f,E=e.closeButton,y=void 0===E||E,D=e.backdropClassName,v=void 0===D?"":D,k=e.closeOnOutsideClick,S=void 0===k||k,w=h()(e,ag),C=Object(p.useRef)();return S&&ig(C,o),F&&zd("esc",o),m.a.createElement(Jc,{className:"ne-portal"},n&&m.a.createElement(tg,{key:"modal-backdrop",className:b()("ne-modal__backdrop",v)},m.a.createElement("div",u()({ref:C,key:"modal-wrapper",className:b()("ne-modal__wrapper",_()({"ne-modal__wrapper--xs":i===rg,"ne-modal__wrapper--sm":i===og,"ne-modal__wrapper--md":i===sg},g,g))},w),y&&m.a.createElement(Xc,{style:"text",icon:ac,className:"ne-modal__close",onClick:o}),l?m.a.createElement(m.a.Fragment,null):d)))},ug=["size","color","strokeWidth"];function dg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,ug);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M11.009 11.249H12.159V15.499",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M11 15.4986H13.3093",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M12.1 8.24587C12.1 8.29532 12.0853 8.34365 12.0579 8.38477C12.0304 8.42588 11.9914 8.45792 11.9457 8.47684C11.9 8.49576 11.8497 8.50071 11.8012 8.49107C11.7527 8.48142 11.7082 8.45761 11.6732 8.42265C11.6383 8.38769 11.6145 8.34314 11.6048 8.29464C11.5952 8.24615 11.6001 8.19588 11.619 8.1502C11.638 8.10452 11.67 8.06548 11.7111 8.03801C11.7522 8.01053 11.8006 7.99587 11.85 7.99587",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M11.85 7.99587C11.9163 7.99587 11.9799 8.02221 12.0268 8.0691C12.0737 8.11598 12.1 8.17957 12.1 8.24587",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M16 2.99862H8C5.23858 2.99862 3 5.2372 3 7.99862V15.9986C3 18.76 5.23858 20.9986 8 20.9986H16C18.7614 20.9986 21 18.76 21 15.9986V7.99862C21 5.2372 18.7614 2.99862 16 2.99862Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}dg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},dg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var _g=["children","className","required","helpIconProps"],cg=["onClick","icon","tooltipProps","className"],gg=function(e){var t=e.children,i=e.className,a=void 0===i?"":i,n=e.required,r=void 0!==n&&n,o=e.helpIconProps,s=void 0===o?null:o,l=h()(e,_g),d=s||{},c=d.onClick,g=d.icon,f=d.tooltipProps,p=d.className,F=h()(d,cg),E=g||dg;return m.a.createElement("label",u()({className:b()("ne-label flex items-center",a)},l),t,r&&m.a.createElement("span",{"aria-hidden":!0},"*"),s&&m.a.createElement(Uc,u()({},f,{disabled:!f}),m.a.createElement("span",{className:b()("ml-1",_()({},p,p)),onClick:c},m.a.createElement(E,u()({size:16},F)))))},fg=["id","size","type","label","error","suffix","prefix","disabled","helpText","className","nakedInput","contentSize","required"],hg=Object(p.forwardRef)((function(e,t){var i=e.id,a=e.size,n=void 0===a?"small":a,r=e.type,o=void 0===r?"text":r,s=e.label,l=e.error,d=void 0===l?null:l,_=e.suffix,c=void 0===_?null:_,g=e.prefix,f=void 0===g?null:g,p=e.disabled,F=void 0!==p&&p,E=e.helpText,y=void 0===E?"":E,D=e.className,v=void 0===D?"":D,k=e.nakedInput,S=void 0!==k&&k,w=e.contentSize,C=void 0===w?null:w,x=e.required,T=void 0!==x&&x,O=h()(e,fg);return m.a.createElement("div",{className:b()(["ne-input__wrapper",v])},s&&m.a.createElement(gg,{required:T,"data-cy":"neeto-editor-".concat(cd(s),"-input-label"),htmlFor:i},s),m.a.createElement("div",{className:b()("ne-input",{"ne-input--naked":!!S,"ne-input--error":!!d,"ne-input--disabled":!!F,"ne-input--small":"small"===n})},f&&m.a.createElement("div",{className:"ne-input__prefix"},f),m.a.createElement("input",u()({ref:t,type:o,disabled:F,size:C,required:T,"aria-invalid":!!d,"data-cy":"".concat(cd(s),"-input-field")},O)),c&&m.a.createElement("div",{className:"ne-input__suffix"},c)),!!d&&m.a.createElement("p",{"data-cy":"".concat(cd(s),"-input-error"),className:"ne-input__error"},d),y&&m.a.createElement("p",{className:"ne-input__help-text"},y))}));hg.displayName="Input";var pg=hg,mg=function(e){var t=e.url,i=e.editor,a=e.onClose,n=e.alt,r=Object(p.useState)(n||""),o=g()(r,2),s=o[0],l=o[1],u=function(){i.chain().focus().setImage({src:t,alt:s}).run(),a()};return m.a.createElement("div",{className:"neeto-editor-image-editor",onKeyDown:function(e){"Enter"===e.key&&u()}},m.a.createElement("img",{src:t}),m.a.createElement(pg,{value:s,onChange:function(e){return l(e.target.value)},placeholder:"Brand Image",label:"Alt Text"}),m.a.createElement("div",{className:"neeto-editor-image-editor__footer"},m.a.createElement(Xc,{label:"Save Changes",onClick:u}),m.a.createElement(Xc,{label:"Cancel",style:"text",onClick:a})))},Fg=function(e){var t=e.editor,i=e.isOpen,a=e.onClose,n=t&&t.view.state.selection.node;return m.a.createElement(lg,{isOpen:i,onClose:a},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},m.a.createElement(mg,{editor:t,onClose:a,url:null==n?void 0:n.attrs.src,alt:null==n?void 0:n.attrs.alt}))))},bg=["size","color","strokeWidth"];function Eg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,bg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M7 6H12.875C13.6706 6 14.4337 6.31607 14.9963 6.87868C15.5589 7.44129 15.875 8.20435 15.875 9V9C15.875 9.79565 15.5589 10.5587 14.9963 11.1213C14.4337 11.6839 13.6706 12 12.875 12H7V6ZM7 12H14C14.7956 12 15.5587 12.3161 16.1213 12.8787C16.6839 13.4413 17 14.2044 17 15V15C17 15.7956 16.6839 16.5587 16.1213 17.1213C15.5587 17.6839 14.7956 18 14 18H7V12Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Eg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Eg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var yg=["size","color","strokeWidth"];function Dg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,yg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M10 6H17M13.5 6L10.5 18L13.5 6ZM14 18H7H14Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Dg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Dg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var vg=["size","color","strokeWidth"];function kg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,vg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M15 5V11.6667C15 12.5507 14.6313 13.3986 13.9749 14.0237C13.3185 14.6488 12.4283 15 11.5 15V15",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M8 5V11.6667C8 12.5507 8.36875 13.3986 9.02513 14.0237C9.6815 14.6488 10.5717 15 11.5 15V15",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M19 18.5H5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}kg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},kg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Sg=["size","color","strokeWidth"];function wg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Sg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M8 18H14C14.7956 18 15.5587 17.6839 16.1213 17.1213C16.6839 16.5587 17 15.7956 17 15V15",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M19 12H5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M16 6H11C10.2044 6 9.44129 6.31607 8.87868 6.87868C8.31607 7.44129 8 8.20435 8 9",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}wg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},wg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Cg=["size","color","strokeWidth"];function xg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Cg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M17.7166 12.3594L19.4466 10.6294C21.1392 8.9873 21.1801 6.284 19.538 4.59141C17.8959 2.89882 15.1926 2.85789 13.5 4.5C13.4691 4.53001 13.4386 4.56048 13.4086 4.59141L10.0109 7.951C8.34355 9.61717 8.3426 12.3195 10.0088 13.9869L10.0109 13.989L9.9999 14C10.3445 14.3381 10.7447 14.6144 11.1829 14.817",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M12.806 9.193C13.2443 9.39593 13.6445 9.67262 13.989 10.011C15.6564 11.6772 15.6573 14.3795 13.9912 16.0469L13.989 16.049L10.8082 19.268C9.11565 20.9101 6.41235 20.8692 4.77024 19.1766C3.16318 17.5201 3.16318 14.8865 4.77024 13.23L6.50024 11.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}xg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},xg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Tg=["size","color","strokeWidth"];function Og(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Tg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M13.78 4L10.22 20M18 8L22 12L18 16M6 16L2 12L6 8",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Og.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Og.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Ng=["size","color","strokeWidth"];function Ag(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Ng);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M10.523 20H6V15.477C6 15.0134 6.18428 14.5684 6.51226 14.2407L17.5294 4.00237C18.211 3.31947 19.3171 3.31841 20 4L20.0024 4.00237L21.5 5.527C22.1829 6.20859 22.184 7.31473 21.5024 7.99763L21.5 8L11.759 19.488C11.431 19.8156 10.9865 19.9997 10.523 20Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M2 20H3",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M9 12L13.5 16.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Ag.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Ag.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Rg=["size","color","strokeWidth"];function Mg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Rg);return C_.createElement("svg",Gd({viewBox:"0 0 18 19",fill:"none",height:t,width:t},n),C_.createElement("g",{clipPath:"url(#clip0_1047_4040)"},C_.createElement("rect",{x:"4.5",y:"11.333",width:"11.5714",height:"3.85714",rx:"1",fill:i}),C_.createElement("mask",{id:"path-2-inside-1_1047_4040",fill:i},C_.createElement("rect",{x:"4.5",y:"6.19043",width:"9",height:"3.85714",rx:"1"})),C_.createElement("rect",{x:"4.5",y:"6.19043",width:"9",height:"3.85714",rx:"1",stroke:i,mask:"url(#path-2-inside-1_1047_4040)",strokeWidth:"3"}),C_.createElement("line",{x1:"2.25",y1:"2.97607",x2:"2.25",y2:"17.1189",stroke:i,strokeWidth:a})),C_.createElement("defs",null,C_.createElement("clipPath",{id:"clip0_1047_4040"},C_.createElement("rect",{width:"18",height:"18",fill:i,transform:"translate(0 0.619141)"}))))}Mg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Mg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Ig=["size","color","strokeWidth"];function Bg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Ig);return C_.createElement("svg",Gd({viewBox:"0 0 18 19",fill:"none",height:t,width:t},n),C_.createElement("g",{clipPath:"url(#clip0_1047_4338)"},C_.createElement("rect",{x:"3",y:"11.3335",width:"11.5714",height:"3.85714",rx:"1",fill:i}),C_.createElement("mask",{id:"path-2-inside-1_1047_4338",fill:i},C_.createElement("rect",{x:"4.5",y:"6.19043",width:"9",height:"3.85714",rx:"1"})),C_.createElement("rect",{x:"4.5",y:"6.19043",width:"9",height:"3.85714",rx:"1",stroke:i,mask:"url(#path-2-inside-1_1047_4338)",strokeWidth:"3"}),C_.createElement("line",{x1:"9",y1:"9.61914",x2:"9",y2:"17.1191",stroke:i,strokeWidth:a}),C_.createElement("line",{x1:"9",y1:"2.86914",x2:"9",y2:"6.61914",stroke:i,strokeWidth:a})),C_.createElement("defs",null,C_.createElement("clipPath",{id:"clip0_1047_4338"},C_.createElement("rect",{width:"18",height:"18",fill:i,transform:"translate(0 0.619141)"}))))}Bg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Bg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Lg=["size","color","strokeWidth"];function Pg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Lg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M18 3H6C4.34315 3 3 3.97683 3 5.18182V12.8182C3 14.0232 4.34315 15 6 15H18C19.6569 15 21 14.0232 21 12.8182V5.18182C21 3.97683 19.6569 3 18 3Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("line",{x1:"3",y1:"11.25",x2:"21",y2:"11.25",stroke:i,strokeWidth:a}),C_.createElement("line",{x1:"8.75",y1:"19.25",x2:"15.25",y2:"19.25",stroke:i,strokeWidth:a,strokeLinecap:"round"}))}Pg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Pg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var jg=["size","color","strokeWidth"];function qg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,jg);return C_.createElement("svg",Gd({viewBox:"0 0 18 19",fill:"none",height:t,width:t},n),C_.createElement("g",{clipPath:"url(#clip0_1047_4017)"},C_.createElement("rect",{x:"1.5",y:"11.333",width:"11.5714",height:"3.85714",rx:"1",fill:i}),C_.createElement("mask",{id:"path-2-inside-1_1047_4017",fill:i},C_.createElement("rect",{x:"4.07129",y:"6.19043",width:"9",height:"3.85714",rx:"1"})),C_.createElement("rect",{x:"4.07129",y:"6.19043",width:"9",height:"3.85714",rx:"1",stroke:i,mask:"url(#path-2-inside-1_1047_4017)",strokeWidth:"3"}),C_.createElement("line",{x1:"15.75",y1:"2.97607",x2:"15.75",y2:"17.1189",stroke:i,strokeWidth:a})),C_.createElement("defs",null,C_.createElement("clipPath",{id:"clip0_1047_4017"},C_.createElement("rect",{width:"18",height:"18",fill:i,transform:"translate(0 0.619141)"}))))}qg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},qg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Ug=["size","color","strokeWidth"];function zg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Ug);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M18 10L15 7",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M6 20H15",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M16.0174 5.68275L9.87375 11.8262C9.53712 12.1628 9.31876 12.5996 9.25146 13.0708L9.01095 14.7549C8.98726 14.9208 9.00212 15.09 9.05437 15.2492C9.10662 15.4085 9.19487 15.5535 9.31225 15.6731C9.42964 15.7928 9.57301 15.8837 9.73124 15.939C9.88948 15.9943 10.0583 16.0123 10.2247 15.9918L11.8503 15.791C12.3369 15.7309 12.7894 15.5101 13.1362 15.1634L19.3163 8.98528C19.533 8.76863 19.705 8.51141 19.8223 8.22831C19.9396 7.94521 20 7.64178 20 7.33534C20 7.0289 19.9397 6.72546 19.8224 6.44235C19.7052 6.15923 19.5333 5.90198 19.3166 5.6853L19.314 5.68275C19.0976 5.46629 18.8406 5.29459 18.5578 5.17744C18.2749 5.06029 17.9718 5 17.6657 5C17.3596 5 17.0564 5.06029 16.7736 5.17744C16.4908 5.29459 16.2338 5.46629 16.0174 5.68275Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}zg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},zg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Gg=function(e){var t=e.editor,i=e.isImageEditorModalOpen,a=e.setIsImageEditorModalOpen;return[{Icon:Mg,command:function(){return t.chain().focus().setImageAttributes({size:"small",float:"left",align:"none"}).run()},active:t.isActive("image",{size:"small",float:"left",align:"none"}),optionName:"Float Left"},{Icon:Bg,command:function(){return t.chain().focus().setImageAttributes({size:"small",float:"none",align:"center"}).run()},active:t.isActive("image",{size:"small",float:"none",align:"center"}),optionName:"Align Center"},{Icon:Pg,command:function(){return t.chain().focus().setImageAttributes({size:"large",float:"none",align:"center"}).run()},active:t.isActive("image",{size:"large",float:"none",align:"center"}),optionName:"Banner"},{Icon:qg,command:function(){return t.chain().focus().setImageAttributes({size:"small",float:"right",align:"none"}).run()},active:t.isActive("image",{size:"small",float:"right",align:"center"}),optionName:"Float Right"},{Icon:zg,command:function(){return a(!0)},active:i,optionName:"Alt Text"}]},Hg=function(e){var t=e.Icon,i=e.command,a=e.active,n=e.optionName;return m.a.createElement(Uc,{content:_d(n),position:"top",delay:[500]},m.a.createElement("div",{className:b()("neeto-editor-bubble-menu__item",{active:a}),onClick:i,"data-cy":"neeto-editor-bubble-menu-".concat(n,"-option")},m.a.createElement(t,{size:20})))},Yg=function(e){var t=e.editor,i=e.isImageEditorModalOpen,a=e.setIsImageEditorModalOpen;return Gg({editor:t,isImageEditorModalOpen:i,setIsImageEditorModalOpen:a}).map((function(e){return m.a.createElement(Hg,u()({key:e.optionName},e))}))},Wg=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,Vg=/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,$g=/((?:http|https):\/\/)?(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|(?:manage\/)?videos?\/|)(\d+)(?:(?:\/|\?h=)(\w+))?(?:|\/\?)/,Kg=function(e){var t=e.editor,i=e.handleClose,a=e.handleAnimateInvalidLink,n=Object(p.useState)(""),r=g()(n,2),o=r[0],s=r[1];Object(p.useEffect)((function(){s(t.getAttributes("link").href||"")}),[]);var l=function(){Wg.test(o)?(t.chain().focus().setLink({href:o}).run(),i()):fd(o)?(t.chain().focus().unsetLink().run(),i()):(s(""),a())};return m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?i():"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","data-cy":"neeto-editor-link-input"}),m.a.createElement(Xc,{style:"icon",icon:ac,onClick:function(){o?(s(""),t.chain().focus().unsetLink().run()):i()},"data-cy":"neeto-editor-link-submit-button"}))},Qg=function(e){var t=e.editor,i=e.options,a=e.setIsInvalidLink,n=e.isLinkOptionActive,r=e.setIsLinkOptionActive;return n?m.a.createElement(Kg,{editor:t,handleClose:function(){return r(!1)},handleAnimateInvalidLink:function(){a(!0),setTimeout((function(){a(!1)}),1e3)}}):function(e){var t=e.editor,i=e.setIsLinkOptionActive;return[{Icon:Eg,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Dg,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:kg,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:wg,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:xg,command:function(){return i(!0)},active:t.isActive("link"),optionName:"link"},{Icon:Og,command:function(){return t.chain().focus().toggleCode().run()},active:t.isActive("code"),optionName:"code-block"},{Icon:Ag,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}]}({editor:t,setIsLinkOptionActive:r}).filter((function(e){var t=e.optionName;return i.includes(t)})).map((function(e){return m.a.createElement(Hg,u()({},e,{key:e.optionName}))}))};function Zg(e){var t=e.editor,i=e.options,a=Object(p.useState)(!1),n=g()(a,2),r=n[0],o=n[1],s=Object(p.useState)(!1),l=g()(s,2),u=l[0],d=l[1],_=Object(p.useState)(!1),c=g()(_,2),f=c[0],h=c[1],F=t&&t.view.state.selection.node,E=F&&"image"===F.type.name;return t?m.a.createElement("div",null,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>',zIndex:99999,onHide:function(){return d(!1)}},className:b()("neeto-editor-bubble-menu",{"neeto-editor-bubble-menu-animate-shake":r})},E?m.a.createElement(Yg,{editor:t,isImageEditorModalOpen:f,setIsImageEditorModalOpen:h}):m.a.createElement(Qg,{editor:t,options:i,setIsInvalidLink:o,isLinkOptionActive:u,setIsLinkOptionActive:d})),m.a.createElement(Fg,{editor:t,isOpen:f,onClose:function(){return h(!1)}})):null}var Xg=["size","color","strokeWidth"];function Jg(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Xg);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M14 13.5H19C19.552 13.5 20 13.948 20 14.5V18.5C20 19.052 19.552 19.5 19 19.5H15C14.448 19.5 14 19.052 14 18.5V13.5ZM14 13.5C14 7.5 15 6.5 18 4.5M4 13.5H9C9.552 13.5 10 13.948 10 14.5V18.5C10 19.052 9.552 19.5 9 19.5H5C4.448 19.5 4 19.052 4 18.5V13.5ZM4 13.5C4 7.5 5 6.5 8 4.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Jg.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Jg.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var ef=["size","color","strokeWidth"];function tf(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,ef);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("g",{clipPath:"url(#clip0)"},C_.createElement("path",{d:"M21 16.014L16.707 11.721C16.316 11.33 15.683 11.33 15.293 11.721L11 16.014",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M18 21.014H6C4.343 21.014 3 19.671 3 18.014V6.014C3 4.357 4.343 3.014 6 3.014H18C19.657 3.014 21 4.357 21 6.014V18.014C21 19.671 19.657 21.014 18 21.014Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M15.9998 21.014L9.7068 14.721C9.3158 14.33 8.6828 14.33 8.2928 14.721L3.4458 19.568M9.26497 8.74883C9.41142 8.89527 9.41142 9.13271 9.26497 9.27916C9.11852 9.4256 8.88109 9.4256 8.73464 9.27916C8.58819 9.13271 8.58819 8.89527 8.73464 8.74883C8.88109 8.60238 9.11852 8.60238 9.26497 8.74883Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"})),C_.createElement("defs",null,C_.createElement("clipPath",{id:"clip0"},C_.createElement("rect",{width:"24",height:"24",fill:i}))))}tf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},tf.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var af=["size","color","strokeWidth"];function nf(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,af);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M12 5H20",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M6 7C7.10457 7 8 6.10457 8 5C8 3.89543 7.10457 3 6 3C4.89543 3 4 3.89543 4 5C4 6.10457 4.89543 7 6 7Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M12 19H20M12 12H20H12Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M6 14C7.10457 14 8 13.1046 8 12C8 10.8954 7.10457 10 6 10C4.89543 10 4 10.8954 4 12C4 13.1046 4.89543 14 6 14Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M6 21C7.10457 21 8 20.1046 8 19C8 17.8954 7.10457 17 6 17C4.89543 17 4 17.8954 4 19C4 20.1046 4.89543 21 6 21Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}nf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},nf.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var rf=["size","color","strokeWidth"];function of(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,rf);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M11 4H20M11.15 9H20M5.25 9V4L4 5.25M11 14H20M11.15 19H20M4 15C4 14.7348 4.10536 14.4804 4.29289 14.2929C4.48043 14.1054 4.73478 14 5 14H5.61448C5.87234 14 6.12365 14.0811 6.33284 14.2319C6.54202 14.3827 6.69846 14.5955 6.78 14.8401C6.84709 15.0414 6.86091 15.2566 6.82013 15.4648C6.77935 15.673 6.68534 15.8671 6.54727 16.0282L4 19H7M4 9H6.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}of.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},of.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var sf=i(1),lf=i.n(sf),uf=["icon","iconActive","tooltipProps"],df=function(e){var t=e.icon,i=e.iconActive,a=void 0===i||i,n=e.tooltipProps,r=h()(e,uf);return m.a.createElement(Uc,n,m.a.createElement("button",u()({className:"neeto-editor-fixed-menu__item",type:"button"},r),m.a.createElement(t,{color:a?"#2F3941":"#87929D",size:20})))};df.propTypes={icon:lf.a.oneOfType([lf.a.element,lf.a.func]),iconActive:lf.a.bool,onClick:lf.a.func,tooltipProps:lf.a.object};var _f=df,cf=["size","color","underlineColor"];function gf(e){var t=e.size,i=e.color,a=e.underlineColor,n=h()(e,cf);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),m.a.createElement("path",{d:"M21 20H3",stroke:a||i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M17.3125 15L12.1562 4L7 15M8.03125 12.8H16.2812",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}gf.defaultProps={color:"currentColor",size:24},gf.propTypes={color:lf.a.string,size:lf.a.oneOfType([lf.a.string,lf.a.number])};var ff=["size","color","bgColor"];function hf(e){var t=e.size,i=e.color,a=e.bgColor,n=h()(e,ff);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),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:a,stroke:a,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M10 8V16",stroke:i,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M14 8V16",stroke:i,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 14H16",stroke:i,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 10H16",stroke:i,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}))}hf.defaultProps={color:"white",bgColor:"#68737D",size:24},hf.propTypes={color:lf.a.string,bgColor:lf.a.string,size:lf.a.oneOfType([lf.a.string,lf.a.number])};var pf=function(e){var t=e.color,i=void 0===t?"#000":t,a=e.onChange,n=Object(p.useRef)();return m.a.createElement(_f,{icon:function(e){var t=e.color,r=e.size;return m.a.createElement(m.a.Fragment,null,m.a.createElement(gf,{size:r,color:t,underlineColor:i}),m.a.createElement("input",{ref:n,type:"color",onChange:function(e){return a&&a(e.target.value)}}))},iconActive:!1,onClick:function(){var e;return null===(e=n.current)||void 0===e?void 0:e.click()},tooltipProps:{content:"Text Color",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-text-color-option"})},mf=["size","color","strokeWidth"];function Ff(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,mf);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M13.3125 17L8.15625 6L3 17M4.03125 14.8H12.2812",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M21 17L18.5006 12L16 17M16.4996 16.1667H20.4992",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Ff.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Ff.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var bf=i(89),Ef=i.n(bf),yf=function(e){return e.reduce((function(e,t){var i=t[0],a=t[1];return e[i]=a,e}),{})},Df="undefined"!=typeof window&&window.document&&window.document.createElement?p.useLayoutEffect:p.useEffect,vf=[],kf=["size","color","strokeWidth"];function Sf(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,kf);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M6 9L12 15L18 9",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Sf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Sf.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var wf=["icon","label","isOpen","onVisible","onClose","ulProps","position","children","className","buttonStyle","buttonProps","customTarget","disabled","closeOnEsc","closeOnSelect","closeOnOutsideClick","dropdownModifiers"];function Cf(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function xf(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Cf(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Cf(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Tf=function(){},Of=Object(p.forwardRef)((function(e,t){e.icon;var i=e.label,a=e.isOpen,n=e.onVisible,r=void 0===n?Tf:n,o=e.onClose,s=void 0===o?Tf:o,l=e.ulProps,d=e.position,c=e.children,f=e.className,F=(e.buttonStyle,e.buttonProps),E=e.customTarget,y=(e.disabled,e.closeOnEsc),D=void 0===y||y,v=e.closeOnSelect,k=void 0===v||v,S=e.closeOnOutsideClick,w=void 0===S||S,C=e.dropdownModifiers,x=void 0===C?[]:C,T=h()(e,wf),O=Object(p.useRef)(),N=E(),A=!(null==a),R=Object(p.useState)(!1),M=g()(R,2),I=M[0],B=M[1],L=Object(p.useState)(null),P=g()(L,2),j=P[0],q=P[1],U=Object(p.useState)(null),z=g()(U,2),G=z[0],H=z[1],Y=function(e,t,i){void 0===i&&(i={});var a=p.useRef(null),n={onFirstUpdate:i.onFirstUpdate,placement:i.placement||"bottom",strategy:i.strategy||"absolute",modifiers:i.modifiers||vf},r=p.useState({styles:{popper:{position:n.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=r[0],s=r[1],l=p.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,i=Object.keys(t.elements);s({styles:yf(i.map((function(e){return[e,t.styles[e]||{}]}))),attributes:yf(i.map((function(e){return[e,t.attributes[e]]})))})},requires:["computeStyles"]}}),[]),u=p.useMemo((function(){var e={onFirstUpdate:n.onFirstUpdate,placement:n.placement,strategy:n.strategy,modifiers:[].concat(n.modifiers,[l,{name:"applyStyles",enabled:!1}])};return Ef()(a.current,e)?a.current||e:(a.current=e,e)}),[n.onFirstUpdate,n.placement,n.strategy,n.modifiers,l]),d=p.useRef();return Df((function(){d.current&&d.current.setOptions(u)}),[u]),Df((function(){if(null!=e&&null!=t){var a=(i.createPopper||wl)(e,t,u);return d.current=a,function(){a.destroy(),d.current=null}}}),[e,t,i.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}}(j,G,{placement:d||"bottom-end",modifiers:x}),W=Y.styles,V=Y.attributes;Object(p.useImperativeHandle)(t,(function(){return{close:function(){return B(!1)},visible:I}}));var $=function(){A||B(!1),s()},K=function(){!A&&B(!I)};return D&&zd("esc",$),w&&ig(O,$),A||(F=xf(xf({},F),{},{onClick:function(){K()}})),Object(p.useEffect)((function(){A&&B(a)}),[a]),Object(p.useEffect)((function(){I&&r()}),[I]),m.a.createElement("div",u()({ref:O,className:b()("ne-dropdown__wrapper",_()({},f,f))},T),E?m.a.createElement("div",{ref:q,onClick:K},N):m.a.createElement("div",null,i,m.a.createElement(Sf,null)),I&&m.a.createElement("ul",u()({className:"ne-dropdown__popup",ref:H,onClick:function(){k&&$()},"data-cy":"neeto-editor-".concat(cd(i),"-dropdown-container")},l,{style:xf(xf({display:"block"},W.offset),W.popper)},V.popper),c))})),Nf=function(e){var t=e.editor;return m.a.createElement(Of,{customTarget:function(){return m.a.createElement(_f,{icon:Ff,iconActive:t.isActive("heading"),tooltipProps:{content:"Font Size",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-font-size-option"})},className:"neeto-editor-font-size-wrapper",placement:"bottom"},[{label:"H1",value:1},{label:"H2",value:2},{label:"H3",value:3}].map((function(e){var i,a=e.label,n=e.value;return m.a.createElement("li",{onClick:function(){return e=n,t.chain().focus().toggleHeading({level:e}).run();var e},key:n,className:b()({active:(i=n,t.isActive("heading",{level:i}))}),"data-cy":"neeto-editor-fixed-menu-font-size-option-".concat(a)},a)})))};function Af(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Rf(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Af(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Af(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Mf=function(e){var t=e.onClickVariable,i=e.variables,a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=[];return e.forEach((function(e){var a=e.category_key,n=e.category_label,r=e.variables;if(a&&r){var o=r.map((function(e){return Rf(Rf({},e),{},{category_key:a})}));i.push({label:n,variables:o})}else t.push(e)})),t.length&&i.push({label:i.length?"Others":null,variables:t}),i}(i);return i&&i.length?m.a.createElement("div",{className:"neeto-editor-variables-list"},a.map((function(e,i){var a=e.label,n=e.variables;return m.a.createElement(If,{key:i,index:i,title:a,variables:n,onClickItem:t})}))):null},If=function(e){var t=e.index,i=e.title,a=e.variables,n=e.onClickItem;return m.a.createElement("div",{className:"neeto-editor-variables-block","data-cy":"neeto-editor-variable-option-category-".concat(t)},i&&m.a.createElement("h6",null,i),m.a.createElement("div",{className:"neeto-editor-variables-row"},a.map((function(e){return m.a.createElement("button",{type:"button",onClick:function(){return n(e)},key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable","data-cy":"neeto-editor-variable-option-item-".concat(e.label,"--").concat(e.value)},e.label)}))))},Bf=["color"],Lf=function(e){var t=e.editor,i=e.variables;return i&&i.length?m.a.createElement(Of,{customTarget:function(){return m.a.createElement(_f,{icon:function(e){e.color;var t=h()(e,Bf);return m.a.createElement(hf,t)},tooltipProps:{content:"Variables",position:"bottom",delay:[500]},"data-cy":"neeto-editor-variable-option"})}},m.a.createElement(Mf,{onClickVariable:function(e){var i=e.category_key,a=e.key,n=i?"".concat(i,".").concat(a):a;t.chain().focus().setVariable({label:n}).run()},variables:i})):null},Pf=["size","color","strokeWidth"];function jf(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Pf);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M17 21H12C10.22 21 8.47991 20.4722 6.99987 19.4832C5.51983 18.4943 4.36628 17.0887 3.68509 15.4442C3.0039 13.7996 2.82567 11.99 3.17294 10.2442C3.5202 8.49836 4.37737 6.89472 5.63604 5.63604C6.89472 4.37737 8.49836 3.5202 10.2442 3.17294C11.99 2.82567 13.7996 3.0039 15.4442 3.68509C17.0887 4.36628 18.4943 5.51983 19.4832 6.99987C20.4722 8.47991 21 10.22 21 12V13.5C21 14.163 20.7366 14.7989 20.2678 15.2678C19.7989 15.7366 19.163 16 18.5 16C17.837 16 17.2011 15.7366 16.7322 15.2678C16.2634 14.7989 16 14.163 16 13.5V12C16 10.9391 15.5786 9.92172 14.8284 9.17158C14.0783 8.42143 13.0609 8 12 8V8C11.2089 8 10.4355 8.2346 9.77772 8.67413C9.11993 9.11365 8.60724 9.73837 8.30449 10.4693C8.00174 11.2002 7.92252 12.0044 8.07686 12.7804C8.2312 13.5563 8.61217 14.269 9.17158 14.8284C9.73099 15.3878 10.4437 15.7688 11.2196 15.9231C11.9956 16.0775 12.7998 15.9983 13.5307 15.6955C14.2616 15.3928 14.8864 14.8801 15.3259 14.2223C15.7654 13.5645 16 12.7911 16 12",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}jf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},jf.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var qf=["size","user","isSquare","status","onClick","className"],Uf={small:24,medium:32,large:40,xlarge:64},zf=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function Gf(e){var t,i,a=e.size,n=e.user,r=e.isSquare,o=e.status,s=e.onClick,l=e.className,d=h()(e,qf),_=Object(p.useState)(!1),c=g()(_,2),f=c[0],F=c[1],E=n.name,y=void 0===E?"":E,D=n.imageUrl,v="medium"===a,k="large"===a,S="xlarge"===a,w=(t=y.trim().split(" ")).reduce((function(e,i,a){return 0!==a&&a!==t.length-1||(e="".concat(e).concat(i.charAt(0).toUpperCase())),e}),""),C={height:Uf[a],width:Uf[a],backgroundColor:(i=(w.charCodeAt(0)||0)+(w.charCodeAt(1)||0),zf[i%65%zf.length]||zf[0])},x=b()("ne-avatar",{"ne-avatar--medium":v,"ne-avatar--large":k,"ne-avatar--xlarge":S,"ne-avatar--round":!r,hidden:!f}),T=b()("ne-avatar__text",{"ne-avatar__text-medium":v,"ne-avatar__text-large":k,"ne-avatar__text-xlarge":S}),O=b()("ne-avatar__status","".concat(o),{"ne-avatar__status-medium":v,"ne-avatar__status-large":k,"ne-avatar__status-xlarge":S,"ne-avatar__status-square":r}),N=function(){return null==o?m.a.Fragment:m.a.createElement("span",{className:O})},A=function(){return m.a.createElement("span",{className:T},w)},R=w&&!D&&!f;return m.a.createElement("div",u()({onClick:s,style:C,className:b()("ne-avatar--container",{"ne-avatar--container-round":!r},l)},d),m.a.createElement(N,null),R?m.a.createElement(A,null):m.a.createElement("img",{className:x,onLoad:function(){return F(!0)},onError:function(){return F(!1)},src:D,alt:"avatar-".concat(w)}))}Gf.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},Gf.propTypes={size:lf.a.oneOf(Object.keys(Uf)),user:lf.a.shape({imageUrl:lf.a.string,name:lf.a.string}),isSquare:lf.a.bool,onClick:lf.a.func,status:lf.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:lf.a.string};var Hf=Gf,Yf=function(e){var t=e.editor,i=e.mentions,a=e.showImageInMention,n=Object(p.useRef)();return i&&i.length?m.a.createElement(Of,{ref:n,customTarget:function(){var e;return m.a.createElement(_f,{icon:jf,iconActive:null===(e=n.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Mention",position:"bottom",delay:[500]},"data-cy":"neeto-editor-mention-option"})}},m.a.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},i.map((function(e){var i=e.key,n=e.name,r=e.imageUrl;return m.a.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:i,onClick:function(){return t.commands.setMention(n)},type:"button","data-cy":"neeto-editor-mention-option-".concat(i)},a&&m.a.createElement(Hf,{size:"small",user:{name:n,imageUrl:r}}),m.a.createElement("p",null,n))})))):null},Wf=function(e){var t=e.editor,i=Object(p.useRef)(),a=Object(p.useRef)(),n=Object(p.useState)(""),r=g()(n,2),o=r[0],s=r[1],l=Object(p.useState)(""),u=g()(l,2),d=u[0],_=u[1],c=t.isActive("link"),f=function(){_(t.getAttributes("link").href||"")},h=function(){var e;Wg.test(d)?(t.chain().focus().setLink({href:d}).run(),null===(e=i.current)||void 0===e||e.close()):s("Please enter a valid url")};return m.a.createElement(Of,{ref:i,onVisible:function(){var e;return null===(e=a.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:function(){return m.a.createElement(_f,{icon:xg,iconActive:c,onClick:f,tooltipProps:{content:"Link",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-link-option"})},className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?i.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},m.a.createElement(pg,{ref:a,name:"url",value:d,placeholder:"Paste URL",onFocus:function(){return s("")},error:o,onChange:function(e){var t=e.target.value;return _(t)},"data-cy":"neeto-editor-fixed-menu-link-option-input"}),m.a.createElement(Xc,{label:"Link",onClick:h,"data-cy":"neeto-editor-fixed-menu-link-option-link-button"}),c&&m.a.createElement(Xc,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=i.current)||void 0===e||e.close()},"data-cy":"neeto-editor-fixed-menu-link-option-unlink-button"})))},Vf=["size","color","strokeWidth"];function $f(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Vf);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M12 3C7.037 3 3 7.037 3 12C3 16.963 7.037 21 12 21C16.963 21 21 16.962 21 12C21 7.038 16.962 3 12 3Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),C_.createElement("path",{d:"M15.5006 15.688C15.5006 15.688 14.1876 17 12.0006 17C9.81263 17 8.50063 15.688 8.50063 15.688M15.3286 9.5C15.1906 9.5 15.0786 9.612 15.0796 9.75C15.0796 9.888 15.1916 10 15.3296 10C15.4676 10 15.5796 9.888 15.5796 9.75C15.5796 9.612 15.4676 9.5 15.3286 9.5ZM8.63963 9.5C8.50163 9.5 8.38963 9.612 8.39063 9.75C8.39063 9.888 8.50263 10 8.64063 10C8.77863 10 8.89063 9.888 8.89063 9.75C8.89063 9.612 8.77863 9.5 8.63963 9.5Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}$f.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},$f.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Kf=i(20),Qf=i.n(Kf),Zf=i(21),Xf=i.n(Zf),Jf=i(9),eh=i.n(Jf),th=i(22),ih=i.n(th),ah=i(23),nh=i.n(ah),rh=i(15),oh=i.n(rh),sh=i(30),lh=i(10),uh=i.n(lh),dh=i(11),_h=i.n(dh),ch=i(46),gh=i.n(ch),fh={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"},hh=function(e){var t=[],i=function(e,i){e&&(Array.isArray(e)?e:[e]).forEach((function(e){(i?e.split(/[-|_|\s]+/):[e]).forEach((function(e){e=e.toLowerCase(),-1==t.indexOf(e)&&t.push(e)}))}))};return i(e.short_names,!0),i(e.name,!0),i(e.keywords,!1),i(e.emoticons,!1),t.join(",")},ph=function(e){for(var t in e.compressed=!1,e.emojis){var i=e.emojis[t];for(var a in fh)i[a]=i[fh[a]],delete i[fh[a]];i.short_names||(i.short_names=[]),i.short_names.unshift(t),i.sheet_x=i.sheet[0],i.sheet_y=i.sheet[1],delete i.sheet,i.text||(i.text=""),i.added_in||(i.added_in=6),i.added_in=i.added_in.toFixed(1),i.search=hh(i)}},mh=String.fromCodePoint||function(){var e,t,i=16384,a=[],n=-1,r=arguments.length;if(!r)return"";for(var o="";++n<r;){var s=Number(arguments[n]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?a.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,a.push(e,t)),(n+1===r||a.length>i)&&(o+=String.fromCharCode.apply(null,a),a.length=0)}return o},Fh=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,bh=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function Eh(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return mh.apply(null,t)}function yh(e){var t=e.name,i=e.short_names,a=e.skin_tone,n=e.skin_variations,r=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,d=e.id||i[0],_=":".concat(d,":");return s?{id:d,name:t,short_names:i,colons:_,emoticons:r,custom:s,customCategory:l,imageUrl:u}:(a&&(_+=":skin-tone-".concat(a,":")),{id:d,name:t,short_names:i,colons:_,emoticons:r,unified:o.toLowerCase(),skin:a||(n?1:null),native:Eh(o)})}function Dh(){return yh(vh.apply(void 0,arguments))}function vh(e,t,i,a){var n={};if("string"==typeof e){var r=e.match(Fh);if(r&&(e=r[1],r[2]&&(t=parseInt(r[2],10))),a.aliases.hasOwnProperty(e)&&(e=a.aliases[e]),!a.emojis.hasOwnProperty(e))return null;n=a.emojis[e]}else e.id&&(a.aliases.hasOwnProperty(e.id)&&(e.id=a.aliases[e.id]),a.emojis.hasOwnProperty(e.id)&&(n=a.emojis[e.id],t||(t=e.skin)));if(Object.keys(n).length||((n=e).custom=!0,n.search||(n.search=hh(e))),n.emoticons||(n.emoticons=[]),n.variations||(n.variations=[]),n.skin_variations&&t>1){n=JSON.parse(JSON.stringify(n));var o=bh[t-1],s=n.skin_variations[o];if(s&&(!s.variations&&n.variations&&delete n.variations,i&&(null==s["has_img_".concat(i)]||s["has_img_".concat(i)])||!i))for(var l in n.skin_tone=t,s){var u=s[l];n[l]=u}}return n.variations&&n.variations.length&&((n=JSON.parse(JSON.stringify(n))).unified=n.variations.shift()),n}function kh(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function Sh(e,t){var i=kh(e),a=kh(t);return i.filter((function(e){return a.indexOf(e)>=0}))}function wh(e,t){var i={};for(var a in e){var n=e[a],r=n;t.hasOwnProperty(a)&&(r=t[a]),"object"===gh()(r)&&(r=wh(n,r)),i[a]=r}return i}var Ch,xh,Th="emoji-mart",Oh="undefined"!=typeof window&&"localStorage"in window;function Nh(e,t){if(xh)xh(e,t);else{if(!Oh)return;try{window.localStorage["".concat(Th,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var Ah={update:function(e){for(var t in e){Nh(t,e[t])}},set:Nh,get:function(e){if(Ch)return Ch(e);if(Oh)try{var t=window.localStorage["".concat(Th,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){Th=e},setHandlers:function(e){e||(e={}),Ch=e.getter,xh=e.setter}},Rh=function(){function e(t,i){uh()(this,e),t.compressed&&ph(t),this.data=t||{},this.set=i||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return _h()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var i=e.data.emojis[t],a=i.short_names,n=i.emoticons,r=i.skin_variations,o=a[0];if(n&&n.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),r){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=Dh({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=Dh(o,null,e.set,e.data);e.originalPool[o]=i};for(var i in this.data.emojis)t(i)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(i){var a=i.id||i.short_names[0];delete e[a],delete t.emojis[a]}))}},{key:"addCustomToPool",value:function(e,t){var i=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var a=e.id||e.short_names[0];a&&!t[a]&&(t[a]=vh(e,null,null,i.data),i.emojis[a]=Dh(e,null,null,i.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.emojisToShowFilter,n=i.maxResults,r=i.include,o=i.exclude,s=i.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=Ah.get("skin")||1;n||(n=75),r||(r=[]),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|,|\-|_]+/),g=[];if(c.length>2&&(c=[c[0],c[1]]),(r.length||o.length)&&(_={},this.data.categories.forEach((function(e){var i=!r||!r.length||r.indexOf(e.id)>-1,a=!(!o||!o.length)&&o.indexOf(e.id)>-1;i&&!a&&e.emojis.forEach((function(e){return _[e]=t.data.emojis[e]}))})),l.length)){var f=!r||!r.length||r.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;f&&!h&&this.addCustomToPool(l,_)}d=(g=c.map((function(e){for(var i=_,a=t.index,n=0,r=0;r<e.length;r++){var o=e[r];n++,a[o]||(a[o]={}),(a=a[o]).results||function(){var r={};for(var o in a.results=[],a.pool={},i){var s=i[o],l=s.search,d=e.substr(0,n),_=l.indexOf(d);if(-1!=_){var c=_+1;d==o&&(c=0),t.emojis[o]&&t.emojis[o][u]?a.results.push(t.emojis[o][u]):a.results.push(t.emojis[o]),a.pool[o]=s,r[o]=c}}a.results.sort((function(e,t){var i=r[e.id],a=r[t.id];return i==a?e.id.localeCompare(t.id):i-a}))}(),i=a.pool}return a.results})).filter((function(e){return e}))).length>1?Sh.apply(null,g):g.length?g[0]:[]}return d&&(a&&(d=d.filter((function(e){return a(_[e.id])}))),d&&d.length>n&&(d=d.slice(0,n))),d}}]),e}(),Mh=new Rh(sh);var Ih,Bh,Lh={search:function(){return Mh.search.apply(Mh,arguments)},emojis:Mh.emojis,emoticons:Mh.emoticons},Ph=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],jh={};function qh(){Bh=!0,Ih=Ah.get("frequently")}var Uh={add:function(e){Bh||qh();var t=e.id;Ih||(Ih=jh),Ih[t]||(Ih[t]=0),Ih[t]+=1,Ah.set("last",t),Ah.set("frequently",Ih)},get:function(e){if(Bh||qh(),!Ih){jh={};for(var t=[],i=0;i<e;i++)jh[Ph[i]]=e-i,t.push(Ph[i]);return t}var a=4*e,n=[];for(var r in Ih)Ih.hasOwnProperty(r)&&n.push(r);var o=n.sort((function(e,t){return Ih[e]-Ih[t]})).reverse().slice(0,a),s=Ah.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},zh=i(16),Gh=i.n(zh),Hh=i(24),Yh=i.n(Hh),Wh=i(12),Vh=i.n(Wh),$h=i(13),Kh=i.n($h),Qh=i(14),Zh=i.n(Qh),Xh=i(7),Jh=i.n(Xh),ep={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"}))}},tp={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"}))}},ip={data:lf.a.object.isRequired,onOver:lf.a.func,onLeave:lf.a.func,onClick:lf.a.func,fallback:lf.a.func,backgroundImageFn:lf.a.func,native:lf.a.bool,forceSize:lf.a.bool,tooltip:lf.a.bool,useButton:lf.a.bool,skin:lf.a.oneOf([1,2,3,4,5,6]),sheetSize:lf.a.oneOf([16,20,32,64]),sheetColumns:lf.a.number,sheetRows:lf.a.number,set:lf.a.oneOf(["apple","google","twitter","facebook"]),size:lf.a.number.isRequired,emoji:lf.a.oneOfType([lf.a.string,lf.a.object]).isRequired},ap={onClick:lf.a.func,onSelect:lf.a.func,onSkinChange:lf.a.func,perLine:lf.a.number,emojiSize:lf.a.number,i18n:lf.a.object,style:lf.a.object,title:lf.a.string,emoji:lf.a.string,color:lf.a.string,set:ip.set,skin:ip.skin,native:lf.a.bool,backgroundImageFn:ip.backgroundImageFn,sheetSize:ip.sheetSize,emojisToShowFilter:lf.a.func,showPreview:lf.a.bool,showSkinTones:lf.a.bool,emojiTooltip:ip.tooltip,useButton:ip.useButton,theme:lf.a.oneOf(["auto","light","dark"]),include:lf.a.arrayOf(lf.a.string),exclude:lf.a.arrayOf(lf.a.string),recent:lf.a.arrayOf(lf.a.string),autoFocus:lf.a.bool,enableFrequentEmojiSort:lf.a.bool,custom:lf.a.arrayOf(lf.a.shape({name:lf.a.string.isRequired,short_names:lf.a.arrayOf(lf.a.string).isRequired,emoticons:lf.a.arrayOf(lf.a.string),keywords:lf.a.arrayOf(lf.a.string),imageUrl:lf.a.string,spriteUrl:lf.a.string,sheet_x:lf.a.number,sheet_y:lf.a.number,size:lf.a.number,sheetColumns:lf.a.number,sheetRows:lf.a.number})),skinEmoji:lf.a.string,notFound:lf.a.func,notFoundEmoji:lf.a.string,icons:lf.a.object},np=function(e){function t(e){var i;uh()(this,t),i=Vh()(this,Kh()(t).call(this,e));var a=e.categories.filter((function(e){return e.first}))[0];return i.state={selected:a.name},i.handleClick=i.handleClick.bind(Jh()(i)),i}return Zh()(t,e),_h()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),i=this.props,a=i.categories;(0,i.onAnchorClick)(a[t],t)}},{key:"render",value:function(){var e=this,t=this.props,i=t.categories,a=t.color,n=t.i18n,r=t.icons,o=this.state.selected;return m.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":n.categorieslabel},i.map((function(t,i){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":n.categories[_],title:n.categories[_],"data-index":i,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(d?"emoji-mart-anchor-selected":""),style:{color:d?a:null}},m.a.createElement("div",{className:"emoji-mart-anchor-icon"},r.categories[_]()),m.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:a}}))})))}}]),t}(m.a.PureComponent);np.propTypes={categories:lf.a.array,onAnchorClick:lf.a.func,icons:lf.a.object},np.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var rp={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")}},op={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:rp.set,theme:"light",skin:null,defaultSkin:rp.skin,native:rp.native,sheetSize:rp.sheetSize,backgroundImageFn:rp.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:rp.tooltip,useButton:rp.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function sp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function lp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var up=function(e){return vh(e.emoji,e.skin,e.set,e.data)},dp=function(e){var t=up(e),i=t.sheet_x,a=t.sheet_y,n=100/(e.sheetColumns-1),r=100/(e.sheetRows-1);return"".concat(n*i,"% ").concat(r*a,"%")},_p=function(e){return Dh(e.emoji,e.skin,e.set,e.data)},cp=function(e){return!isNaN(e-parseFloat(e))},gp=function e(t){for(var i in t.data.compressed&&ph(t.data),e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);var a=up(t);if(!a)return t.fallback?t.fallback(null,t):null;var n=a.unified,r=a.custom,o=a.short_names,s=a.imageUrl,l={},u=t.children,d="emoji-mart-emoji",_=n&&Eh(n),c=[_].concat(o).filter(Boolean).join(", "),g=null;if(!n&&!r)return t.fallback?t.fallback(a,t):null;if(t.tooltip&&(g=o[0]),t.native&&n)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(r)d+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=a.spriteUrl?lp({},l,{backgroundImage:"url(".concat(a.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:dp(t)}):lp({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==a["has_img_".concat(t.set)]||a["has_img_".concat(t.set)]))return t.fallback?t.fallback(a,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:dp(t)}}var f={name:"span",props:{}};return t.onClick&&t.useButton&&(f.name="button",f.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var i in e){var a=e[i];cp(a)&&(a+="px"),t.style[i]=a}return t.getAttribute("style")}(l),"<".concat(f.name," style='").concat(l,"' aria-label='").concat(c,"' ").concat(g?"title='".concat(g,"'"):""," class='").concat(d,"'>").concat(u||"","</").concat(f.name,">")):m.a.createElement(f.name,Yh()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(_p(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(_p(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(_p(t),e)}(e,t)},"aria-label":c,title:g,className:d},f.props),m.a.createElement("span",{style:l},u))};gp.propTypes=lp({},ip,{data:lf.a.object.isRequired}),gp.defaultProps=rp;var fp=gp;function hp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}var pp=function(e){function t(){return uh()(this,t),Vh()(this,Kh()(t).apply(this,arguments))}return Zh()(t,e),_h()(t,[{key:"render",value:function(){var e=this.props,t=e.data,i=e.emojiProps,a=e.i18n,n=e.notFound,r=e.notFoundEmoji;return n&&n()||m.a.createElement("div",{className:"emoji-mart-no-results"},fp(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?hp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):hp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({data:t},i,{size:38,emoji:r,onOver:null,onLeave:null,onClick:null})),m.a.createElement("div",{className:"emoji-mart-no-results-label"},a.notfound))}}]),t}(m.a.PureComponent);function mp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}pp.propTypes={notFound:lf.a.func.isRequired,emojiProps:lf.a.object.isRequired};var Fp=function(e){function t(e){var i;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).data=e.data,i.setContainerRef=i.setContainerRef.bind(Jh()(i)),i.setLabelRef=i.setLabelRef.bind(Jh()(i)),i}return Zh()(t,e),_h()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var i=this.props,a=i.name,n=i.perLine,r=i.native,o=i.hasStickyPosition,s=i.emojis,l=i.emojiProps,u=l.skin,d=l.size,_=l.set,c=e.perLine,g=e.native,f=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,E=!1;return"Recent"==a&&n!=c&&(E=!0),"Search"==a&&(E=!(s==h)),u==m&&d==F&&r==g&&_==b&&o==f||(E=!0),E}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),i=t.top,a=t.height,n=e.getBoundingClientRect().top,r=this.label.getBoundingClientRect().height;this.top=i-n+e.scrollTop,this.maxMargin=0==a?0:a-r}},{key:"handleScroll",value:function(e){var t=e-this.top;if((t=(t=t<this.minMargin?this.minMargin:t)>this.maxMargin?this.maxMargin:t)!=this.margin)return this.props.hasStickyPosition||(this.label.style.top="".concat(t,"px")),this.margin=t,!0}},{key:"getEmojis",value:function(){var e=this,t=this.props,i=t.name,a=t.emojis,n=t.recent,r=t.perLine;if("Recent"==i){var o=this.props.custom,s=n||Uh.get(r);if(s.length&&(a=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!vh(t,null,null,e.data)}))),0===a.length&&s.length>0)return null}return a&&(a=a.slice(0)),a}},{key:"updateDisplay",value:function(e){this.getEmojis()&&this.container&&(this.container.style.display=e)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setLabelRef",value:function(e){this.label=e}},{key:"render",value:function(){var e=this,t=this.props,i=t.id,a=t.name,n=t.hasStickyPosition,r=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,u=this.getEmojis(),d={},_={},c={};u||(c={display:"none"}),n||(d={height:28},_={position:"absolute"});var g=o.categories[i]||a;return m.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":g,style:c},m.a.createElement("div",{style:d,"data-name":a,className:"emoji-mart-category-label"},m.a.createElement("span",{style:_,ref:this.setLabelRef,"aria-hidden":!0},g)),m.a.createElement("ul",{className:"emoji-mart-category-list"},u&&u.map((function(t){return m.a.createElement("li",{key:t.short_names&&t.short_names.join("_")||t},fp(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?mp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):mp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({emoji:t,data:e.data},r)))}))),u&&!u.length&&m.a.createElement(pp,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:r}))}}]),t}(m.a.Component);Fp.propTypes={emojis:lf.a.array,hasStickyPosition:lf.a.bool,name:lf.a.string.isRequired,native:lf.a.bool.isRequired,perLine:lf.a.number.isRequired,emojiProps:lf.a.object.isRequired,recent:lf.a.arrayOf(lf.a.string),notFound:lf.a.func,notFoundEmoji:lf.a.string.isRequired},Fp.defaultProps={emojis:[],hasStickyPosition:!0};var bp=function(e){function t(e){var i;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).state={opened:!1},i}return Zh()(t,e),_h()(t,[{key:"handleClick",value:function(e){var t=parseInt(e.currentTarget.getAttribute("data-skin")),i=this.props.onChange;this.state.opened?(this.setState({opened:!1}),t!=this.props.skin&&i(t)):this.setState({opened:!0})}},{key:"render",value:function(){return null}}]),t}(m.a.PureComponent);bp.propTypes={onChange:lf.a.func,skin:lf.a.number.isRequired},bp.defaultProps={onChange:function(){}};var Ep=function(e){function t(e){var i;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).handleClick=i.handleClick.bind(Jh()(i)),i}return Zh()(t,e),_h()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.emojiProps,a=e.data,n=e.skinEmoji,r=e.i18n,o=this.state.opened,s=[],l=1;l<=6;l++){var u=l===t;s.push(m.a.createElement("span",{key:"skin-tone-".concat(l),className:"emoji-mart-skin-swatch custom".concat(u?" selected":"")},m.a.createElement("span",{onClick:this.handleClick,"data-skin":l,className:"emoji-mart-skin-tone-".concat(l)},fp({emoji:n,data:a,skin:l,backgroundImageFn:i.backgroundImageFn,native:i.native,set:i.set,sheetSize:i.sheetSize,size:23}))))}return m.a.createElement("div",{className:"emoji-mart-skin-swatches custom".concat(o?" opened":"")},m.a.createElement("div",{className:"emoji-mart-skin-text".concat(o?" opened":"")},r.skintext),s)}}]),t}(bp);Ep.propTypes={onChange:lf.a.func,skin:lf.a.number.isRequired,emojiProps:lf.a.object.isRequired,skinTone:lf.a.number,skinEmoji:lf.a.string.isRequired,i18n:lf.a.object},Ep.defaultProps={onChange:function(){},skinTone:null};var yp=function(e){function t(e){var i;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).handleClick=i.handleClick.bind(Jh()(i)),i.handleKeyDown=i.handleKeyDown.bind(Jh()(i)),i}return Zh()(t,e),_h()(t,[{key:"handleKeyDown",value:function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),this.handleClick(e))}},{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.i18n,a=this.state.opened,n=[],r=1;r<=6;r++){var o=r===t,s=a||o;n.push(m.a.createElement("span",Yh()({key:"skin-tone-".concat(r),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":i.skintones[r],"aria-hidden":!s},a?{role:"menuitem"}:{}),m.a.createElement("span",Yh()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!a}:{},a?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":i.skintones[r],title:i.skintones[r],"data-skin":r,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(r)}))))}return m.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(a?" opened":""),"aria-label":i.skintext},m.a.createElement("div",a?{role:"menubar"}:{},n))}}]),t}(bp);function Dp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function vp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Dp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Dp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}yp.propTypes={onChange:lf.a.func,skin:lf.a.number.isRequired,i18n:lf.a.object},yp.defaultProps={onChange:function(){}};var kp=function(e){function t(e){var i;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).data=e.data,i.state={emoji:null},i}return Zh()(t,e),_h()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,i=t.emojiProps,a=t.skinsProps,n=t.showSkinTones,r=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var u=vh(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"},fp(vp({key:e.id,emoji:e,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("div",{className:"emoji-mart-preview-name"},e.name),m.a.createElement("div",{className:"emoji-mart-preview-shortnames"},u.short_names.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-shortname"},":",e,":")}))),m.a.createElement("div",{className:"emoji-mart-preview-emoticons"},c.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-emoticon"},e)})))))}return m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},o&&o.length&&fp(vp({emoji:o,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("span",{className:"emoji-mart-title-label"},r)),n&&m.a.createElement("div",{className:"emoji-mart-preview-skins".concat(a.skinEmoji?" custom":"")},a.skinEmoji?m.a.createElement(Ep,{skin:a.skin,emojiProps:i,data:this.data,skinEmoji:a.skinEmoji,i18n:s,onChange:a.onChange}):m.a.createElement(yp,{skin:a.skin,i18n:s,onChange:a.onChange})))}}]),t}(m.a.PureComponent);kp.propTypes={showSkinTones:lf.a.bool,title:lf.a.string.isRequired,emoji:lf.a.string.isRequired,emojiProps:lf.a.object.isRequired,skinsProps:lf.a.object.isRequired},kp.defaultProps={showSkinTones:!0,onChange:function(){}};var Sp=0,wp=function(e){function t(e){var i,a,n,r;return uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).state={icon:tp.search,isSearching:!1,id:++Sp},i.data=e.data,i.emojiIndex=new Rh(i.data),i.setRef=i.setRef.bind(Jh()(i)),i.clear=i.clear.bind(Jh()(i)),i.handleKeyUp=i.handleKeyUp.bind(Jh()(i)),i.handleChange=(a=i.handleChange.bind(Jh()(i)),n="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,r=!1,function(){r||(r=!0,n((function(){r=!1,a()})))}),i}return Zh()(t,e),_h()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:tp.search,isSearching:!1}):this.setState({icon:tp.delete,isSearching:!0}),this.props.onSearch(this.emojiIndex.search(e,{emojisToShowFilter:this.props.emojisToShowFilter,maxResults:this.props.maxResults,include:this.props.include,exclude:this.props.exclude,custom:this.props.custom}))}},{key:"clear",value:function(){""!=this.input.value&&(this.input.value="",this.input.focus(),this.search(""))}},{key:"handleChange",value:function(){this.input&&this.search(this.input.value)}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.clear()}},{key:"setRef",value:function(e){this.input=e}},{key:"render",value:function(){var e=this.props,t=e.i18n,i=e.autoFocus,a=this.state,n=a.icon,r=a.isSearching,o=a.id,s="emoji-mart-search-".concat(o);return m.a.createElement("section",{className:"emoji-mart-search","aria-label":t.search},m.a.createElement("input",{id:s,ref:this.setRef,type:"search",onChange:this.handleChange,placeholder:t.search,autoFocus:i}),m.a.createElement("label",{className:"emoji-mart-sr-only",htmlFor:s},t.search),m.a.createElement("button",{className:"emoji-mart-search-icon",onClick:this.clear,onKeyUp:this.handleKeyUp,"aria-label":t.clear,disabled:!r},n()))}}]),t}(m.a.PureComponent);function Cp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function xp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Cp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Cp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}wp.propTypes={onSearch:lf.a.func,maxResults:lf.a.number,emojisToShowFilter:lf.a.func,autoFocus:lf.a.bool},wp.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var Tp={search:"Search",clear:"Clear",notfound:"No Emoji Found",skintext:"Choose your default skin tone",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"},categorieslabel:"Emoji categories",skintones:{1:"Default Skin Tone",2:"Light Skin Tone",3:"Medium-Light Skin Tone",4:"Medium Skin Tone",5:"Medium-Dark Skin Tone",6:"Dark Skin Tone"}},Op=function(e){function t(e){var i;uh()(this,t),(i=Vh()(this,Kh()(t).call(this,e))).CUSTOM=[],i.RECENT_CATEGORY={id:"recent",name:"Recent",emojis:null},i.SEARCH_CATEGORY={id:"search",name:"Search",emojis:null,anchor:!1},e.data.compressed&&ph(e.data),i.data=e.data,i.i18n=wh(Tp,e.i18n),i.icons=wh(a,e.icons),i.state={firstRender:!0},i.categories=[];var n=[].concat(i.data.categories);if(e.custom.length>0){var r={},o=0;e.custom.forEach((function(e){r[e.customCategory]||(r[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=r[e.customCategory],a=xp({},e,{id:e.short_names[0],custom:!0});t.emojis.push(a),i.CUSTOM.push(a)})),n=n.concat(Object.keys(r).map((function(e){return r[e]})))}i.hideRecent=!0,null!=e.include&&n.sort((function(t,i){return e.include.indexOf(t.id)>e.include.indexOf(i.id)?1:-1}));for(var s=0;s<n.length;s++){var l=n[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,g=0;g<c.length;g++){var f=c[g];e.emojisToShowFilter(i.data.emojis[f]||f)&&_.push(f)}if(_.length){var h={emojis:_,name:l.name,id:l.id};i.categories.push(h)}}else i.categories.push(l)}var p=!e.include||!e.include.length||e.include.indexOf(i.RECENT_CATEGORY.id)>-1,m=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(i.RECENT_CATEGORY.id)>-1;return p&&!m&&(i.hideRecent=!1,i.categories.unshift(i.RECENT_CATEGORY)),i.categories[0]&&(i.categories[0].first=!0),i.categories.unshift(i.SEARCH_CATEGORY),i.setAnchorsRef=i.setAnchorsRef.bind(Jh()(i)),i.handleAnchorClick=i.handleAnchorClick.bind(Jh()(i)),i.setSearchRef=i.setSearchRef.bind(Jh()(i)),i.handleSearch=i.handleSearch.bind(Jh()(i)),i.setScrollRef=i.setScrollRef.bind(Jh()(i)),i.handleScroll=i.handleScroll.bind(Jh()(i)),i.handleScrollPaint=i.handleScrollPaint.bind(Jh()(i)),i.handleEmojiOver=i.handleEmojiOver.bind(Jh()(i)),i.handleEmojiLeave=i.handleEmojiLeave.bind(Jh()(i)),i.handleEmojiClick=i.handleEmojiClick.bind(Jh()(i)),i.handleEmojiSelect=i.handleEmojiSelect.bind(Jh()(i)),i.setPreviewRef=i.setPreviewRef.bind(Jh()(i)),i.handleSkinChange=i.handleSkinChange.bind(Jh()(i)),i.handleKeyDown=i.handleKeyDown.bind(Jh()(i)),i.handleDarkMatchMediaChange=i.handleDarkMatchMediaChange.bind(Jh()(i)),i}return Zh()(t,e),_h()(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?op.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?op.theme:this.darkMatchMedia.matches?"dark":"light")}},{key:"handleDarkMatchMediaChange",value:function(){this.setState({theme:this.darkMatchMedia.matches?"dark":"light"})}},{key:"handleEmojiOver",value:function(e){var t=this.preview;if(t){var i=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a]);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||Uh.add(e);var i=this.categoryRefs["category-1"];if(i){var a=i.maxMargin;this.props.enableFrequentEmojiSort&&i.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(i.memoizeSize(),a!=i.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&i.updateDisplay("none")))}))}}},{key:"handleScroll",value:function(){this.waitingForPaint||(this.waitingForPaint=!0,requestAnimationFrame(this.handleScrollPaint))}},{key:"handleScrollPaint",value:function(){if(this.waitingForPaint=!1,this.scroll){var e=null;if(this.SEARCH_CATEGORY.emojis)e=this.SEARCH_CATEGORY;else{for(var t=this.scroll.scrollTop,i=t>(this.scrollTop||0),a=0,n=0,r=this.categories.length;n<r;n++){var o=i?this.categories.length-1-n:n,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!a||l.top<a)&&l.top>0&&(a=l.top),u&&!e&&(e=s)}}t<a?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,i=this.categories.length;t<i;t++){var a=this.categoryRefs["category-".concat(t)];if(a&&"Search"!=a.props.name){var n=e?"none":"inherit";a.updateDisplay(n)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var i,a=this.categoryRefs["category-".concat(t)],n=this.scroll;this.anchors;i=function(){if(a){var t=a.top;e.first?t=0:t+=1,n.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(i)):i()}},{key:"handleSkinChange",value:function(e){var t={skin:e},i=this.props.onSkinChange;this.setState(t),Ah.update(t),i(e)}},{key:"handleKeyDown",value:function(e){var t=!1;switch(e.keyCode){case 13:var i;this.SEARCH_CATEGORY.emojis&&this.SEARCH_CATEGORY.emojis.length&&(i=Dh(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(i),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var i=this.categoryRefs["category-".concat(e)];i&&i.memoizeSize()}if(this.scroll){var a=this.scroll;this.scrollHeight=a.scrollHeight,this.clientHeight=a.clientHeight}}},{key:"getCategories",value:function(){return this.state.firstRender?this.categories.slice(0,3):this.categories}},{key:"setAnchorsRef",value:function(e){this.anchors=e}},{key:"setSearchRef",value:function(e){this.search=e}},{key:"setPreviewRef",value:function(e){this.preview=e}},{key:"setScrollRef",value:function(e){this.scroll=e}},{key:"setCategoryRef",value:function(e,t){this.categoryRefs||(this.categoryRefs={}),this.categoryRefs[e]=t}},{key:"render",value:function(){var e=this,t=this.props,i=t.perLine,a=t.emojiSize,n=t.set,r=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,u=t.title,d=t.emoji,_=t.color,c=t.native,g=t.backgroundImageFn,f=t.emojisToShowFilter,h=t.showPreview,p=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,E=t.include,y=t.exclude,D=t.recent,v=t.autoFocus,k=t.skinEmoji,S=t.notFound,w=t.notFoundEmoji,C=i*(a+12)+12+2+function(){if("undefined"==typeof document)return 0;var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}(),x=this.getPreferredTheme(),T=this.props.skin||this.state.skin||Ah.get("skin")||this.props.defaultSkin;return m.a.createElement("section",{style:xp({width:C},l),className:"emoji-mart emoji-mart-".concat(x),"aria-label":u,onKeyDown:this.handleKeyDown},m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(np,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:_,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),m.a.createElement(wp,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:f,include:E,exclude:y,custom:this.CUSTOM,autoFocus:v}),m.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return m.a.createElement(Fp,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:i,native:c,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?D:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:c,skin:T,size:a,set:n,sheetSize:r,sheetColumns:o,sheetRows:s,forceSize:c,tooltip:F,backgroundImageFn:g,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:S,notFoundEmoji:w})}))),(h||p)&&m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(kp,{ref:this.setPreviewRef,data:this.data,title:u,emoji:d,showSkinTones:p,showPreview:h,emojiProps:{native:c,size:38,skin:T,set:n,sheetSize:r,sheetColumns:o,sheetRows:s,backgroundImageFn:g},skinsProps:{skin:T,onChange:this.handleSkinChange,skinEmoji:k},i18n:this.i18n})))}}]),t}(m.a.PureComponent);function Np(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}Op.propTypes=xp({},ap,{data:lf.a.object.isRequired}),Op.defaultProps=xp({},op);var Ap=function(e){function t(){return uh()(this,t),Vh()(this,Kh()(t).apply(this,arguments))}return Zh()(t,e),_h()(t,[{key:"render",value:function(){return m.a.createElement(Op,Yh()({},this.props,this.state))}}]),t}(m.a.PureComponent);function Rp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Mp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Rp(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Rp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}Ap.propTypes=ap,Ap.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Np(Object(i),!0).forEach((function(t){Gh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Np(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},op,{data:sh});var Ip=function e(t){for(var i in e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);return fp(Mp({},t))};Ip.propTypes=ip,Ip.defaultProps=Mp({},rp,{data:sh});var Bp=i(49),Lp={insert:"head",singleton:!1},Pp=(r()(Bp.a,Lp),Bp.a.locals,i(90));function jp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=oh()(e);if(t){var n=oh()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return nh()(this,i)}}var qp=function(e){ih()(i,e);var t=jp(i);function i(){var e;Qf()(this,i);for(var a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return e=t.call.apply(t,[this].concat(n)),_()(eh()(e),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),_()(eh()(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return Xf()(i,[{key:"render",value:function(){return m.a.createElement(Op,{style:{maxWidth:"100%"},data:Pp,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect,"data-cy":"neeto-editor-emoji-picker"})}}]),i}(m.a.Component);qp.defaultProps={editor:{},range:{}},qp.propTypes={editor:lf.a.object.isRequired,range:lf.a.object};var Up=qp,zp=function(e){var t=e.editor,i=Object(p.useRef)();return m.a.createElement(Of,{ref:i,closeOnSelect:!1,customTarget:function(){var e;return m.a.createElement(_f,{icon:$f,iconActive:null==i||null===(e=i.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Emoji",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-emoji-option-button"})},position:"bottom-start"},m.a.createElement(Up,{editor:t}))},Gp=function(e){var t=e.editor,i=e.variables,a=e.setImageUploadVisible,n=e.options,r=e.mentions,o=e.showImageInMention,s=Object(p.useState)(!1),l=g()(s,2),u=l[0],d=l[1],_=t&&t.view.state.selection.node,c=_&&"image"===_.type.name;if(!t)return null;var f=[{Icon:Eg,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Dg,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:kg,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:wg,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Ag,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}].filter((function(e){return n.includes(e.optionName)})),h=[{Icon:Jg,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:Og,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"code-block"},{Icon:tf,command:function(){return a(!0)},active:t.isActive("imageUpload"),optionName:"image-upload"}].filter((function(e){return n.includes(e.optionName)})),F=[{Icon:nf,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:of,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}].filter((function(e){return n.includes(e.optionName)})),b=n.includes("font-color"),E=n.includes("font-size"),y=n.includes("emoji"),D=n.includes("link"),v=function(e,t){var i=e.Icon,a=e.command,n=e.active,r=e.optionName;return m.a.createElement(_f,{key:t,icon:i,iconActive:n,onClick:a,tooltipProps:{content:_d(r),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(r,"-option")})};return m.a.createElement("div",{className:"neeto-editor-fixed-menu"},E&&m.a.createElement(Nf,{editor:t}),f.map(v),b&&m.a.createElement(pf,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),y&&m.a.createElement(zp,{editor:t}),D&&m.a.createElement(Wf,{editor:t}),h.map(v),F.map(v),c&&Gg({editor:t,isImageEditorModalOpen:u,setIsImageEditorModalOpen:d}).map((function(e,t){var i=e.Icon,a=e.command,n=e.active,r=e.optionName;return m.a.createElement(_f,{key:t,icon:i,iconActive:n,onClick:a,tooltipProps:{content:_d(r),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(r,"-option")})})),m.a.createElement("div",{className:"neeto-editor-fixed-menu-addons"},m.a.createElement(Lf,{editor:t,variables:i}),m.a.createElement(Yf,{editor:t,mentions:r,showImageInMention:o})),m.a.createElement(lg,{isOpen:u,onClose:function(){return d(!1)}},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},m.a.createElement(mg,{editor:t,onClose:function(){return d(!1)},url:null==_?void 0:_.attrs.src,alt:null==_?void 0:_.attrs.alt})))))},Hp=["children","size","noUnderline","className"],Yp=["active","className","children","icon","onClick","activeClassName"],Wp=function(){},Vp="large",$p=function(e){var t=e.children,i=e.size,a=e.noUnderline,n=e.className,r=void 0===n?"":n,o=h()(e,Hp);return m.a.createElement("div",u()({className:b()({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":i===Vp},{"ne-tab__wrapper--underline-none":a},[r]),"data-cy":"tab-container"},o),t)};$p.Item=function(e){var t=e.active,i=e.className,a=void 0===i?"":i,n=e.children,r=e.icon,o=void 0===r?null:r,s=e.onClick,l=void 0===s?Wp:s,d=e.activeClassName,_=void 0===d?"":d,c=h()(e,Yp),g="button",f="string"==typeof o?function(){return m.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||m.a.Fragment;return _&&(g=wc),m.a.createElement(g,u()({className:b()(["ne-tab flex items-center justify-center select-none",a],{active:t}),onClick:l,"data-cy":"tab-item"},c),o&&m.a.createElement(f,{className:"ne-tab__icon"}),n)};var Kp=$p,Qp=function(e){var t,i=Object(p.useState)(null===(t=e[0])||void 0===t?void 0:t.key),a=g()(i,2),n=a[0],r=a[1];return[n,function(e){return r(e.key)}]},Zp=function(e){var t=e.buttonLabel,i=void 0===t?"Submit":t,a=e.placeholder,n=e.onSubmit,r=e.className,o=Object(p.useState)(""),s=g()(o,2),l=s[0],u=s[1],d=Object(p.useState)(""),c=g()(d,2),f=c[0],h=c[1];return m.a.createElement("div",{className:b()("neeto-editor-url-form__wrapper",_()({},r,r))},m.a.createElement(pg,{name:"url",value:l,placeholder:a,onFocus:function(){return h("")},error:f,onChange:function(e){var t=e.target.value;return u(t)},"data-cy":"neeto-editor-image-upload-url-input"}),m.a.createElement(Xc,{size:"large",label:i,onClick:function(e){e.preventDefault(),Wg.test(l)?n(l):h("Please enter a valid url")},"data-cy":"neeto-editor-image-upload-url-submit"}))},Xp=i(19),Jp=i.n(Xp),em=(i(61),i(74),i(75)),tm=i.n(em),im=(i(76),i(77),i(78),i(79)),am=i.n(im),nm=i(91),rm=i.n(nm),om={autoProceed:!0,allowMultipleUploads:!1,restrictions:{maxFileSize:5242880,allowedFileTypes:[".jpg",".jpeg",".png",".gif"]}},sm={formData:!0,fieldName:"blob"},lm=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}],um=function(e){var t,i=e.uppy,a=Object(p.useState)(0),n=g()(a,2),r=n[0],o=n[1];Object(p.useEffect)((function(){i.on("progress",o)}),[i]);var s="".concat(r,"%");return m.a.createElement("div",{className:"neeto-editor-image-uploader__progress"},m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(t=i.getFiles()[0])||void 0===t?void 0:t.name),m.a.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},m.a.createElement("div",{className:"neeto-editor-progress-bar__percent"},m.a.createElement("p",null,s),m.a.createElement(Xc,{icon:ac,onClick:function(){return i.cancelAll()},size:"small",style:"text"})),m.a.createElement("div",{className:"neeto-editor-progress-bar__indicator"},m.a.createElement("div",{style:{width:s},className:"neeto-editor-progress-bar__indicator-inner"}))))},dm=function(e){for(var t=["B","KB","MB","GB"],i=0;e>=1024&&i<t.length;)e/=1024,++i;return"".concat(e.toFixed(1)," ").concat(t[i])};function _m(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function cm(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?_m(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):_m(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var gm=function(e){var t=e.endpoint,i=void 0===t?"/api/v1/direct_uploads/image_upload":t,a=e.onSuccess,n=e.uploadConfig,r=Object(p.useState)(!1),o=g()(r,2),s=o[0],l=o[1],u=Object(p.useState)(""),d=g()(u,2),_=d[0],c=d[1],f=cm(cm({},om),n),h=am()((function(){return new Jp.a(cm(cm({},f),{},{onBeforeFileAdded:function(e){var t=f.restrictions,i=t.maxFileSize,a=t.allowedFileTypes;return e.size>i?(c("File size is too large. Max size is ".concat(dm(f.restrictions.maxFileSize),".")),!1):!!a.includes(".".concat(e.extension))||(c("File type is not permitted. Allowed file types are: ".concat(a.join(", "),".")),!1)}})).use(rm.a,cm({endpoint:i},sm)).on("upload",(function(){return l(!0)})).on("upload-success",(function(e,t){return a(t.body.imageURL)})).on("cancel-all",(function(){return l(!1)})).on("complete",(function(){return l(!1)}))}));return s?m.a.createElement(um,{uppy:h}):m.a.createElement("div",{className:"neeto-editor-image-uploader__dnd-wrapper"},m.a.createElement(tm.a,{className:"neeto-editor-image-uploader__dnd",note:"Max. File Size: ".concat(dm(f.restrictions.maxFileSize)),locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:h,"data-cy":"neeto-editor-image-local-uploader"}),_&&m.a.createElement("p",{className:"neeto-editor-image-uploader__dnd--error"},_))},fm=i(50),hm=i.n(fm),pm=i(92),mm=i.n(pm),Fm=i(51),bm=i.n(Fm),Em=i(93),ym=i.n(Em),Dm=i(94),vm=i.n(Dm),km={FONT_COLOR:"font-color",FONT_SIZE:"font-size",BOLD:"bold",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"strike",BLOCKQUOTE:"block-quote",CODE_BLOCK:"code-block",LINK:"link",LIST_BULLETS:"bullet-list",LIST_ORDERED:"ordered-list",IMAGE_UPLOAD:"image-upload",VIDEO_EMBED:"video-embed",EMOJI:"emoji",DIVIDER:"divider",MENTION:"mention"},Sm=function(e){var t=e.pageNo,i=e.query,a=e.apiKey;return vm.a.get("https://api.unsplash.com/search/photos",{headers:{Authorization:"Client-ID ".concat(a)},params:{page:t,per_page:30,order_by:"popular",query:i}})},wm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,i=Object(p.useState)(e),a=g()(i,2),n=a[0],r=a[1];return Object(p.useEffect)((function(){var i=setTimeout((function(){r(e)}),t);return function(){clearTimeout(i)}}),[e]),n},Cm=function(){return m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__loader"},m.a.createElement("span",{className:"neeto-editor-unsplash-gallery__spinner-icon"}))},xm=function(e){var t=e.onSubmit,i=e.unsplashApiKey,a=Object(p.useRef)(null),n=Object(p.useState)(""),r=g()(n,2),o=r[0],s=r[1],l=Object(p.useState)(!1),u=g()(l,2),d=u[0],_=u[1],c=Object(p.useState)([]),f=g()(c,2),h=f[0],F=f[1],b=Object(p.useState)(1),E=g()(b,2),y=E[0],D=E[1],v=Object(p.useState)(!0),k=g()(v,2),S=k[0],w=k[1],C=Object(p.useState)(!1),x=g()(C,2),T=x[0],O=x[1],N=wm(o||"latest");Object(p.useEffect)((function(){A(1)}),[N]);var A=function(){var e=mm()(bm.a.mark((function e(t){var a,n,r,o;return bm.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,O(!0),_(!1),e.next=5,Sm({page:t,query:N,apiKey:i});case 5:a=e.sent,n=a.data,r=n.results,o=n.total_pages,F(1===t?r:[].concat(hm()(h),hm()(r))),D(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,O(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,12,15,18]])})));return function(t){return e.apply(this,arguments)}}();return m.a.createElement("div",{className:"neeto-editor-unsplash-wrapper"},m.a.createElement(pg,{name:"text",value:o,placeholder:"Search Unsplash",onChange:function(e){var t=e.target.value;s(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),d&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!d&&!T&&fd(h)&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!d&&m.a.createElement("div",{className:"neeto-editor-unsplash-container"},m.a.createElement(ym.a,{ref:a,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:S,loadMore:function(){!T&&S&&y>1&&A(y)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:m.a.createElement(Cm,{key:0})},h&&h.map((function(e,i){return m.a.createElement("div",{key:i,className:"neeto-editor-unsplash-gallery__item","data-cy":"neeto-editor-unsplash-image-picker-result-".concat(i)},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:"".concat(e.height/e.width*100,"%")}},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:"unsplashImage".concat(i)},m.a.createElement("img",{src:e.urls.regular,onClick:function(){return t(e.urls.small)}}),m.a.createElement("a",{href:"https://unsplash.com/@".concat(e.user.username),target:"_blank",rel:"noreferrer"},e.user.name," "))))}))),!S&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},Tm=function(e){var t=e.editor,i=e.imageUploadUrl,a=e.uploadConfig,n=e.isVisible,r=e.setIsVisible,o=e.unsplashApiKey,s=e.isUnsplashImageUploadActive,l=Qp(lm),u=g()(l,2),d=u[0],_=u[1],c=Object(p.useState)(""),f=g()(c,2),h=f[0],F=f[1],b=function(e){F(e)},E={local:function(){return m.a.createElement(gm,{endpoint:i,onSuccess:b,uploadConfig:a})},link:function(){return m.a.createElement(Zp,{onSubmit:b,buttonLabel:"Upload Image",placeholder:"Paste the image link"})},unsplash:function(){return m.a.createElement(xm,{unsplashApiKey:o,onSubmit:b})}}[d];return m.a.createElement(lg,{isOpen:n,onClose:function(){return r(!1)},closeButton:!1},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement(Kp,null,lm.filter((function(e){return"unsplash"!==e.key||s})).map((function(e){return m.a.createElement(Kp.Item,{key:e.key,active:d===e.key,onClick:function(){return _(e)}},e.title)}))),m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},h?m.a.createElement(mg,{url:h,editor:t,onClose:function(){F(null),r(!1)}}):m.a.createElement(E,null))))};function Om(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}var Nm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=t,a=e.current;if(a){var n=a.selectionStart,r=a.selectionEnd,o=i.length,s=a.value.substring(0,n),l=a.value.substring(n,r),u=a.value.substring(r,a.value.length);n!==r&&(s.endsWith(i)&&u.startsWith(i)?(i="",s=s.substring(0,s.length-o),u=u.substring(o,u.length)):l.startsWith(i)&&l.endsWith(i)&&(i="",l=l.substring(o,l.length-o)),a.value=s+i+l+i+u,a.selectionStart=a.selectionEnd=s.length)}},Am=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.current;if(a){var n=a.value.substring(0,a.selectionStart).lastIndexOf("\n"),r=a.value.substring(a.selectionEnd,a.value.length).indexOf("\n");n=-1===n?0:n+1,r=-1===r?a.value.length:r+a.selectionEnd;var o=a.value.substring(0,n),s=a.value.substring(n,r),l=a.value.substring(r,a.value.length);if(0===s.indexOf(t)||i&&0===s.indexOf("1.")){var u=i?s.replaceAll(/^\d+\.\s/gm,""):s.replaceAll(t,"");a.value=o+u+l}else{var d=1,_=i?s.replaceAll("\n",(function(){return"\n".concat(++d,". ")})):s.replaceAll("\n","\n".concat(t));a.value=o+(t||"1. ")+_+l}}},Rm=function(e){var t=e.strategy,i=e.style,a=e.ref,n=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Om(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Om(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},i);return n["min-height"]&&(n.minHeight=n["min-height"],delete n["min-height"]),"flexible"===t&&a.current&&(n.height=a.current.scrollHeight),n},Mm=["editor","className","style","strategy","limit","onFocus","onBlur"],Im=function(e){var t=e.editor,i=e.className,a=e.style,n=e.strategy,r=e.limit,o=e.onFocus,s=e.onBlur,l=h()(e,Mm),d=t.inputFieldRef,c=t.onChange,g=t.state.length;return m.a.createElement("textarea",u()({ref:d,onChange:function(e){return c(e.target.value)},onKeyDown:function(e){return function(e){var t=e.event,i=e.inputFieldRef,a=e.length,n=e.limit,r=e.onChange;if(a>=n&&"Backspace"!==t.key)t.preventDefault();else if("b"===t.key&&(t.metaKey||t.ctrlKey)&&t.shiftKey)Am(i,"> ");else if("b"===t.key&&(t.metaKey||t.ctrlKey))Nm(i,"**");else if("i"===t.key&&(t.metaKey||t.ctrlKey))Nm(i,"_");else if("u"===t.key&&(t.metaKey||t.ctrlKey))Nm(i,"--");else if("x"===t.key&&(t.metaKey||t.ctrlKey)&&t.shiftKey)Nm(i,"~");else if("h"===t.key&&(t.metaKey||t.ctrlKey)&&t.shiftKey)Nm(i,"==");else if("7"===t.key&&(t.metaKey||t.ctrlKey)&&t.shiftKey)Am(i,null,!0);else{if("8"!==t.key||!t.metaKey&&!t.ctrlKey||!t.shiftKey)return;Am(i,"- ")}r(i.current.value)}({event:e,inputFieldRef:d,length:g,limit:r,onChange:c})},onFocus:o,onBlur:s,className:b()("ProseMirror neeto-editor-markdown",_()({},i,i)),style:Rm({style:a,strategy:n,ref:d}),"data-cy":"neeto-editor-markdown-editor",role:"textbox"},l))},Bm=function(e){var t=e.count,i=e.limit,a="limit"===e.strategy&&i;return m.a.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},a?"".concat(i-t," characters remaining"):"".concat(t," characters"))},Lm=i(38),Pm=i.n(Lm),jm=i(95);function qm(e,t){return Array(t+1).join(e)}var Um=["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 zm(e){return Wm(e,Um)}var Gm=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Hm(e){return Wm(e,Gm)}var Ym=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Wm(e,t){return t.indexOf(e.nodeName)>=0}function Vm(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var $m={};function Km(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function Qm(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 Zm(e,t,i){for(var a=0;a<e.length;a++){var n=e[a];if(Xm(n,t,i))return n}}function Xm(e,t,i){var a=e.filter;if("string"==typeof a){if(a===t.nodeName.toLowerCase())return!0}else if(Array.isArray(a)){if(a.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof a)throw new TypeError("`filter` needs to be a string, array, or function");if(a.call(e,t,i))return!0}}function Jm(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function eF(e,t,i){return e&&e.parentNode===t||i(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}$m.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},$m.lineBreak={filter:"br",replacement:function(e,t,i){return i.br+"\n"}},$m.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,i){var a=Number(t.nodeName.charAt(1));return"setext"===i.headingStyle&&a<3?"\n\n"+e+"\n"+qm(1===a?"=":"-",e.length)+"\n\n":"\n\n"+qm("#",a)+" "+e+"\n\n"}},$m.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},$m.list={filter:["ul","ol"],replacement:function(e,t){var i=t.parentNode;return"LI"===i.nodeName&&i.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},$m.listItem={filter:"li",replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var a=i.bulletListMarker+" ",n=t.parentNode;if("OL"===n.nodeName){var r=n.getAttribute("start"),o=Array.prototype.indexOf.call(n.children,t);a=(r?Number(r)+o:o+1)+". "}return a+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},$m.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},$m.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){for(var a,n=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],r=t.firstChild.textContent,o=i.fence.charAt(0),s=3,l=new RegExp("^"+o+"{3,}","gm");a=l.exec(r);)a[0].length>=s&&(s=a[0].length+1);var u=qm(o,s);return"\n\n"+u+n+"\n"+r.replace(/\n$/,"")+"\n"+u+"\n\n"}},$m.horizontalRule={filter:"hr",replacement:function(e,t,i){return"\n\n"+i.hr+"\n\n"}},$m.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var i=t.getAttribute("href"),a=Km(t.getAttribute("title"));return a&&(a=' "'+a+'"'),"["+e+"]("+i+a+")"}},$m.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,i){var a,n,r=t.getAttribute("href"),o=Km(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),i.linkReferenceStyle){case"collapsed":a="["+e+"][]",n="["+e+"]: "+r+o;break;case"shortcut":a="["+e+"]",n="["+e+"]: "+r+o;break;default:var s=this.references.length+1;a="["+e+"]["+s+"]",n="["+s+"]: "+r+o}return this.references.push(n),a},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},$m.emphasis={filter:["em","i"],replacement:function(e,t,i){return e.trim()?i.emDelimiter+e+i.emDelimiter:""}},$m.strong={filter:["strong","b"],replacement:function(e,t,i){return e.trim()?i.strongDelimiter+e+i.strongDelimiter:""}},$m.code={filter:function(e){var t=e.previousSibling||e.nextSibling,i="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!i},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",i="`",a=e.match(/`+/gm)||[];-1!==a.indexOf(i);)i+="`";return i+t+e+t+i}},$m.image={filter:"img",replacement:function(e,t){var i=Km(t.getAttribute("alt")),a=t.getAttribute("src")||"",n=Km(t.getAttribute("title"));return a?"!["+i+"]("+a+(n?' "'+n+'"':"")+")":""}},Qm.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=Zm(this.array,e,this.options))||(t=Zm(this._keep,e,this.options))||(t=Zm(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 tF="undefined"!=typeof window?window:{};var iF,aF,nF=function(){var e=tF.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?tF.DOMParser:(iF=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?iF.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:iF.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},iF);function rF(e,t){var i;"string"==typeof e?i=(aF=aF||new nF).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):i=e.cloneNode(!0);return function(e){var t=e.element,i=e.isBlock,a=e.isVoid,n=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!n(t)){for(var r=null,o=!1,s=null,l=eF(s,t,n);l!==t;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \r\n\t]+/g," ");if(r&&!/ $/.test(r.data)||o||" "!==u[0]||(u=u.substr(1)),!u){l=Jm(l);continue}l.data=u,r=l}else{if(1!==l.nodeType){l=Jm(l);continue}i(l)||"BR"===l.nodeName?(r&&(r.data=r.data.replace(/ $/,"")),r=null,o=!1):a(l)||n(l)?(r=null,o=!0):r&&(o=!1)}var d=eF(s,l,n);s=l,l=d}r&&(r.data=r.data.replace(/ $/,""),r.data||Jm(r))}}({element:i,isBlock:zm,isVoid:Hm,isPre:t.preformattedCode?oF:null}),i}function oF(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function sF(e,t){return e.isBlock=zm(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!Hm(e)&&!function(e){return Wm(e,Ym)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return Vm(e,Gm)}(e)&&!function(e){return Vm(e,Ym)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var i=(a=e.textContent,n=a.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/),{leading:n[1],leadingAscii:n[2],leadingNonAscii:n[3],trailing:n[4],trailingNonAscii:n[5],trailingAscii:n[6]});var a,n;i.leadingAscii&&lF("left",e,t)&&(i.leading=i.leadingNonAscii);i.trailingAscii&&lF("right",e,t)&&(i.trailing=i.trailingNonAscii);return{leading:i.leading,trailing:i.trailing}}(e,t),e}function lF(e,t,i){var a,n,r;return"left"===e?(a=t.previousSibling,n=/ $/):(a=t.nextSibling,n=/^ /),a&&(3===a.nodeType?r=n.test(a.nodeValue):i.preformattedCode&&"CODE"===a.nodeName?r=!1:1!==a.nodeType||zm(a)||(r=n.test(a.textContent))),r}var uF=Array.prototype.reduce,dF=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function _F(e){if(!(this instanceof _F))return new _F(e);var t={rules:$m,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}({},t,e),this.rules=new Qm(this.options)}function cF(e){var t=this;return uF.call(e.childNodes,(function(e,i){var a="";return 3===(i=new sF(i,t.options)).nodeType?a=i.isCode?i.nodeValue:t.escape(i.nodeValue):1===i.nodeType&&(a=fF.call(t,i)),hF(e,a)}),"")}function gF(e){var t=this;return this.rules.forEach((function(i){"function"==typeof i.append&&(e=hF(e,i.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function fF(e){var t=this.rules.forNode(e),i=cF.call(this,e),a=e.flankingWhitespace;return(a.leading||a.trailing)&&(i=i.trim()),a.leading+t.replacement(i,e,this.options)+a.trailing}function hF(e,t){var i=function(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),a=t.replace(/^\n*/,""),n=Math.max(e.length-i.length,t.length-a.length);return i+"\n\n".substring(0,n)+a}_F.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=cF.call(this,new rF(e,this.options));return gF.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 dF.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};var pF=_F,mF=function(e){e=e.replaceAll(/^\\$/gm,"<p></p>");var t=jm.marked.parse(e,{sanitize:!1});return t=(t=(t=(t=t.replaceAll(/<p><img[^>]*><\/p>/g,(function(e){return e.replace(/<\/?p>/g,"")}))).replaceAll(/!\[(.*?)\]\((.*?)\)/g,(function(e,t,i){return'<img src="'.concat(i,'" alt="').concat(t,'">')}))).replaceAll(/==([^=]+)==/g,"<mark>$1</mark>")).replaceAll(/--([^-]+)--/g,"<u>$1</u>"),Pm.a.sanitize(t,{ADD_TAGS:["iframe"]})},FF=function(e){var t=new pF({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){return t.isBlock?"\\\n":""}});return t.keep(["iframe"]),t.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~".concat(e,"~")}}),t.addRule("highlight",{filter:["mark"],replacement:function(e){return"==".concat(e,"==")}}),t.addRule("underline",{filter:["u"],replacement:function(e){return"--".concat(e,"--")}}),t.turndown(e)},bF=function(e){var t=document.createElement("div");return t.innerHTML=e,t.textContent},EF=function(e){var t=e.content,i=e.onUpdate,a=e.onSubmit,n=e.markdownMode,r=Object(p.useState)((function(){return t?{content:FF(t),length:bF(t).length}:{content:"",length:0}})),o=g()(r,2),s=o[0],l=o[1],u=Object(p.useRef)(),d=Object(p.useRef)();d.current=s.content;var _=Object(p.useCallback)((function(e){if(u.current){var t=FF(e),i=bF(e);l({content:t,length:i.length}),u.current.textContent=t}}),[l]),c=Object(p.useCallback)((function(){return mF(d.current)}),[d]),f=Object(p.useCallback)((function(){var e=c();return bF(e)}),[d]),h=Object(p.useCallback)((function(e){var t;if(n&&"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null===(t=u.current)||void 0===t||t.blur(),a)){var i=c();a({markdown:d.current,html:i})}}),[d,n]);Object(p.useEffect)((function(){return document.addEventListener("keydown",h),function(){document.removeEventListener("keydown",h)}}),[h]),Object(p.useEffect)((function(){u.current&&(u.current.textContent=d.current)}),[u,d]);var m=Object(p.useMemo)((function(){return{setContent:_}}),[_]);return{inputFieldRef:u,state:s,onChange:function(e){var t=mF(e),a=bF(t);l({content:e,length:a.length}),i({markdown:e,html:t})},isEmpty:s.length<=0,getHTML:c,getText:f,commands:m}};const yF=/^\s*>\s$/,DF=cs.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",ns(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:yF,type:this.type})]}}),vF=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,kF=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,SF=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,wF=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,CF=gs.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",ns(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:vF,type:this.type}),ps({find:SF,type:this.type})]},addPasteRules(){return[Es({find:kF,type:this.type}),Es({find:wF,type:this.type})]}}),xF=/^\s*([-+*])\s$/,TF=cs.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",ns(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:xF,type:this.type})]}}),OF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,NF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,AF=gs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",ns(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:OF,type:this.type})]},addPasteRules(){return[Es({find:NF,type:this.type})]}}),RF=/^```(?<language>[a-z]*)?[\s\n]$/,MF=/^~~~(?<language>[a-z]*)?[\s\n]$/,IF=cs.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:i}=this.options,a=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(i)).map(e=>e.replace(i,""))[0];return a||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands:()=>({setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,i=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!i&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[ms({find:RF,type:this.type,getAttributes:({groups:e})=>e}),ms({find:MF,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Rt({key:new Bt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const i=t.clipboardData.getData("text/plain"),a=t.clipboardData.getData("vscode-editor-data"),n=a?JSON.parse(a):void 0,r=null==n?void 0:n.mode;if(!i||!r)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:r})),o.setSelection(mt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(i.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}});var BF=cs.create({name:"doc",topNode:!0,content:"block+"});var LF=function(e,t){var i=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var a=function(e){return i[t](e)};return e.dom.addEventListener(t,a),{name:t,handler:a}}))};LF.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var i=t.name,a=t.handler;return e.editorView.dom.removeEventListener(i,a)}))},LF.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())},LF.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},LF.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var i=t.nodeBefore,a=t.nodeAfter;if(i||a){var n=this.editorView.nodeDOM(this.cursorPos-(i?i.nodeSize:0)).getBoundingClientRect(),r=i?n.bottom:n.top;i&&a&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:n.left,right:n.right,top:r-this.width/2,bottom:r+this.width/2}}}if(!e){var o=this.editorView.coordsAtPos(this.cursorPos);e={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var 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"},LF.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},LF.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Je(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},LF.prototype.dragend=function(){this.scheduleRemoval(20)},LF.prototype.drop=function(){this.scheduleRemoval(20)},LF.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const PF=mr.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Rt({view:function(t){return new LF(t,e)}}))];var e}});var jF=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,a){var n=i.resolve(a.map(this.head));return t.valid(n)?new t(n):e.near(n)},t.prototype.content=function(){return T.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(i.pos))},t.prototype.getBookmark=function(){return new qF(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var i=e.index(t);if(0!=i)for(var a=e.node(t).child(i-1);;a=a.lastChild){if(0==a.childCount&&!a.inlineContent||a.isAtom||a.type.spec.isolating)return!0;if(a.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var i=e.indexAfter(t),a=e.node(t);if(i!=a.childCount)for(var n=a.child(i);;n=n.firstChild){if(0==n.childCount&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}(e))return!1;var i=t.type.spec.allowGapCursor;if(null!=i)return i;var a=t.contentMatchAt(e.index()).defaultType;return a&&a.isTextblock},t.findFrom=function(e,i,a){e:for(;;){if(!a&&t.valid(e))return e;for(var n=e.pos,r=null,o=e.depth;;o--){var s=e.node(o);if(i>0?e.indexAfter(o)<s.childCount:e.index(o)>0){r=s.child(i>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;n+=i;var l=e.doc.resolve(n);if(t.valid(l))return l}for(;;){var u=i>0?r.firstChild:r.lastChild;if(!u){if(r.isAtom&&!r.isText&&!bt.isSelectable(r)){e=e.doc.resolve(n+r.nodeSize*i),a=!1;continue e}break}r=u,n+=i;var d=e.doc.resolve(n);if(t.valid(d))return d}return null}},t}(ft);jF.prototype.visible=!1,ft.jsonID("gapcursor",jF);var qF=function(e){this.pos=e};qF.prototype.map=function(e){return new qF(e.map(this.pos))},qF.prototype.resolve=function(e){var t=e.resolve(this.pos);return jF.valid(t)?new jF(t):ft.near(t)};var UF=_r({ArrowLeft:zF("horiz",-1),ArrowRight:zF("horiz",1),ArrowUp:zF("vert",-1),ArrowDown:zF("vert",1)});function zF(e,t){var i="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,a,n){var r=e.selection,o=t>0?r.$to:r.$from,s=r.empty;if(r instanceof mt){if(!n.endOfTextblock(i)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=jF.findFrom(o,t,s);return!!l&&(a&&a(e.tr.setSelection(new jF(l))),!0)}}function GF(e,t,i){if(!e.editable)return!1;var a=e.state.doc.resolve(t);if(!jF.valid(a))return!1;var n=e.posAtCoords({left:i.clientX,top:i.clientY}).inside;return!(n>-1&&bt.isSelectable(e.state.doc.nodeAt(n)))&&(e.dispatch(e.state.tr.setSelection(new jF(a))),!0)}function HF(e){if(!(e.selection instanceof jF))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Mn.create(e.doc,[On.widget(e.selection.head,t,{key:"gapcursor"})])}const YF=mr.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Rt({props:{decorations:HF,createSelectionBetween:function(e,t,i){if(t.pos==i.pos&&jF.valid(i))return new jF(i)},handleClick:GF,handleKeyDown:UF}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=hr(pr(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),WF=cs.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",ns(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:i,editor:a})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:n}=a.extensionManager,r=i.storedMarks||i.selection.$to.parentOffset&&i.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:i})=>{if(i&&r&&e){const e=r.filter(e=>n.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),VF=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]),ns(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 $F=function(){};$F.prototype.append=function(e){return e.length?(e=$F.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},$F.prototype.prepend=function(e){return e.length?$F.from(e).append(this):this},$F.prototype.appendInner=function(e){return new QF(this,e)},$F.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?$F.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},$F.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},$F.prototype.forEach=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length),t<=i?this.forEachInner(e,t,i,0):this.forEachInvertedInner(e,t,i,0)},$F.prototype.map=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length);var a=[];return this.forEach((function(t,i){return a.push(e(t,i))}),t,i),a},$F.from=function(e){return e instanceof $F?e:e&&e.length?new KF(e):$F.empty};var KF=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,i){return 0==e&&i==this.length?this:new t(this.values.slice(e,i))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,i,a){for(var n=t;n<i;n++)if(!1===e(this.values[n],a+n))return!1},t.prototype.forEachInvertedInner=function(e,t,i,a){for(var n=t-1;n>=i;n--)if(!1===e(this.values[n],a+n))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},i.length.get=function(){return this.values.length},i.depth.get=function(){return 0},Object.defineProperties(t.prototype,i),t}($F);$F.empty=new KF([]);var QF=function(e){function t(t,i){e.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,i,a){var n=this.left.length;return!(t<n&&!1===this.left.forEachInner(e,t,Math.min(i,n),a))&&(!(i>n&&!1===this.right.forEachInner(e,Math.max(t-n,0),Math.min(this.length,i)-n,a+n))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,i,a){var n=this.left.length;return!(t>n&&!1===this.right.forEachInvertedInner(e,t-n,Math.max(i,n)-n,a+n))&&(!(i<n&&!1===this.left.forEachInvertedInner(e,Math.min(t,n),i,a))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var i=this.left.length;return t<=i?this.left.slice(e,t):e>=i?this.right.slice(e-i,t-i):this.left.slice(e,i).append(this.right.slice(0,t-i))},t.prototype.leafAppend=function(e){var i=this.right.leafAppend(e);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(e){var i=this.left.leafPrepend(e);if(i)return new t(i,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}($F),ZF=$F,XF=function(e,t){this.items=e,this.eventCount=t};XF.prototype.popEvent=function(e,t){var i=this;if(0==this.eventCount)return null;for(var a,n,r=this.items.length;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(a=this.remapping(r,this.items.length),n=a.maps.length);var o,s,l=e.tr,u=[],d=[];return this.items.forEach((function(e,t){if(!e.step)return a||(a=i.remapping(r,t+1),n=a.maps.length),n--,void d.push(e);if(a){d.push(new JF(e.map));var _,c=e.step.map(a.slice(n));c&&l.maybeStep(c).doc&&(_=l.mapping.maps[l.mapping.maps.length-1],u.push(new JF(_,null,null,u.length+d.length))),n--,_&&a.appendMap(_,n)}else l.maybeStep(e.step);return e.selection?(o=a?e.selection.map(a.slice(n)):e.selection,s=new XF(i.items.slice(0,r).append(d.reverse().concat(u)),i.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}},XF.prototype.addTransform=function(e,t,i,a){for(var n=[],r=this.eventCount,o=this.items,s=!a&&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 JF(e.mapping.maps[l],d,t);(u=s&&s.merge(_))&&(_=u,l?n.pop():o=o.slice(0,o.length-1)),n.push(_),t&&(r++,t=null),a||(s=_)}var c,g,f,h=r-i.depth;return h>tb&&(g=h,(c=o).forEach((function(e,t){if(e.selection&&0==g--)return f=t,!1})),o=c.slice(f),r-=h),new XF(o.append(n),r)},XF.prototype.remapping=function(e,t){var i=new Ie;return this.items.forEach((function(t,a){var n=null!=t.mirrorOffset&&a-t.mirrorOffset>=e?i.maps.length-t.mirrorOffset:null;i.appendMap(t.map,n)}),e,t),i},XF.prototype.addMaps=function(e){return 0==this.eventCount?this:new XF(this.items.append(e.map((function(e){return new JF(e)}))),this.eventCount)},XF.prototype.rebased=function(e,t){if(!this.eventCount)return this;var i=[],a=Math.max(0,this.items.length-t),n=e.mapping,r=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),a);var s=t;this.items.forEach((function(t){var a=n.getMirror(--s);if(null!=a){r=Math.min(r,a);var l=n.maps[a];if(t.step){var u=e.steps[a].invert(e.docs[a]),d=t.selection&&t.selection.map(n.slice(s+1,a));d&&o++,i.push(new JF(l,u,d))}else i.push(new JF(l))}}),a);for(var l=[],u=t;u<r;u++)l.push(new JF(n.maps[u]));var d=this.items.slice(0,a).append(l).append(i),_=new XF(d,o);return _.emptyItemCount()>500&&(_=_.compress(this.items.length-i.length)),_},XF.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},XF.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),i=t.maps.length,a=[],n=0;return this.items.forEach((function(r,o){if(o>=e)a.push(r),r.selection&&n++;else if(r.step){var s=r.step.map(t.slice(i)),l=s&&s.getMap();if(i--,l&&t.appendMap(l,i),s){var u=r.selection&&r.selection.map(t.slice(i));u&&n++;var d,_=new JF(l.invert(),s,u),c=a.length-1;(d=a.length&&a[c].merge(_))?a[c]=d:a.push(_)}}else r.map&&i--}),this.items.length,0),new XF(ZF.from(a.reverse()),n)},XF.empty=new XF(ZF.empty,0);var JF=function(e,t,i,a){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=a};JF.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new JF(t.getMap().invert(),t,this.selection)}};var eb=function(e,t,i,a){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=a},tb=20;function ib(e){var t=[];return e.forEach((function(e,i,a,n){return t.push(a,n)})),t}function ab(e,t){if(!e)return null;for(var i=[],a=0;a<e.length;a+=2){var n=t.map(e[a],1),r=t.map(e[a+1],-1);n<=r&&i.push(n,r)}return i}function nb(e,t,i,a){var n=sb(t),r=lb.get(t).spec.config,o=(a?e.undone:e.done).popEvent(t,n);if(o){var s=o.selection.resolve(o.transform.doc),l=(a?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),r,n),u=new eb(a?l:o.remaining,a?o.remaining:l,null,0);i(o.transform.setSelection(s).setMeta(lb,{redo:a,historyState:u}).scrollIntoView())}}var rb=!1,ob=null;function sb(e){var t=e.plugins;if(ob!=t){rb=!1,ob=t;for(var i=0;i<t.length;i++)if(t[i].spec.historyPreserveItems){rb=!0;break}}return rb}var lb=new Bt("history"),ub=new Bt("closeHistory");function db(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Rt({key:lb,state:{init:function(){return new eb(XF.empty,XF.empty,null,0)},apply:function(t,i,a){return function(e,t,i,a){var n,r=i.getMeta(lb);if(r)return r.historyState;i.getMeta(ub)&&(e=new eb(e.done,e.undone,null,0));var o=i.getMeta("appendedTransaction");if(0==i.steps.length)return e;if(o&&o.getMeta(lb))return o.getMeta(lb).redo?new eb(e.done.addTransform(i,null,a,sb(t)),e.undone,ib(i.mapping.maps[i.steps.length-1]),e.prevTime):new eb(e.done,e.undone.addTransform(i,null,a,sb(t)),null,e.prevTime);if(!1===i.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(n=i.getMeta("rebased"))?new eb(e.done.rebased(i,n),e.undone.rebased(i,n),ab(e.prevRanges,i.mapping),e.prevTime):new eb(e.done.addMaps(i.mapping.maps),e.undone.addMaps(i.mapping.maps),ab(e.prevRanges,i.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(i.time||0)-a.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var i=!1;return e.mapping.maps[0].forEach((function(e,a){for(var n=0;n<t.length;n+=2)e<=t[n+1]&&a>=t[n]&&(i=!0)})),i}(i,e.prevRanges)),l=o?ab(e.prevRanges,i.mapping):ib(i.mapping.maps[i.steps.length-1]);return new eb(e.done.addTransform(i,s?t.selection.getBookmark():null,a,sb(t)),XF.empty,l,i.time)}(i,a,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var i="historyUndo"==t.inputType?_b(e.state,e.dispatch):"historyRedo"==t.inputType&&cb(e.state,e.dispatch);return i&&t.preventDefault(),i}}}})}function _b(e,t){var i=lb.getState(e);return!(!i||0==i.done.eventCount)&&(t&&nb(i,e,t,!1),!0)}function cb(e,t){var i=lb.getState(e);return!(!i||0==i.undone.eventCount)&&(t&&nb(i,e,t,!0),!0)}const gb=mr.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>_b(e,t),redo:()=>({state:e,dispatch:t})=>cb(e,t)}),addProseMirrorPlugins(){return[db(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()}}}),fb=cs.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",ns(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:i}=e,{empty:a,$anchor:n}=i,r=n.parent.isTextblock&&!n.parent.type.spec.code&&!n.parent.textContent;if(!a||!r||!t)return!0;const o=n.before(),s=n.start();return e.deleteRange(o,s),e.setSelection(mt.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var i;if(t){const{parent:t,pos:a}=e.selection.$from,n=a+1;if(!e.doc.nodeAt(n)){const a=null===(i=t.type.contentMatch.defaultType)||void 0===i?void 0:i.create();a&&(e.insert(n,a),e.setSelection(mt.create(e.doc,n)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[fs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),hb=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,pb=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,mb=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Fb=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,bb=gs.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",ns(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:hb,type:this.type}),ps({find:mb,type:this.type})]},addPasteRules(){return[Es({find:pb,type:this.type}),Es({find:Fb,type:this.type})]}}),Eb=cs.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",ns(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")}}}),yb=/^(\d+)\.\s$/,Db=cs.create({name:"orderedList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...i}=e;return 1===t?["ol",ns(this.options.HTMLAttributes,i),0]:["ol",ns(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:yb,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),vb=cs.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),kb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Sb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,wb=gs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",ns(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:kb,type:this.type})]},addPasteRules(){return[Es({find:Sb,type:this.type})]}});var Cb=cs.create({name:"text",group:"inline"});const xb=mr.create({name:"starterKit",addExtensions(){var e,t,i,a,n,r,o,s,l,u,d,_,c,g,f,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(DF.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(CF.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(TF.configure(null===(i=this.options)||void 0===i?void 0:i.bulletList)),!1!==this.options.code&&F.push(AF.configure(null===(a=this.options)||void 0===a?void 0:a.code)),!1!==this.options.codeBlock&&F.push(IF.configure(null===(n=this.options)||void 0===n?void 0:n.codeBlock)),!1!==this.options.document&&F.push(BF.configure(null===(r=this.options)||void 0===r?void 0:r.document)),!1!==this.options.dropcursor&&F.push(PF.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(YF.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(WF.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push(VF.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push(gb.configure(null===(d=this.options)||void 0===d?void 0:d.history)),!1!==this.options.horizontalRule&&F.push(fb.configure(null===(_=this.options)||void 0===_?void 0:_.horizontalRule)),!1!==this.options.italic&&F.push(bb.configure(null===(c=this.options)||void 0===c?void 0:c.italic)),!1!==this.options.listItem&&F.push(Eb.configure(null===(g=this.options)||void 0===g?void 0:g.listItem)),!1!==this.options.orderedList&&F.push(Db.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&F.push(vb.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(wb.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(Cb.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),Tb=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,Ob=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,Nb=gs.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:"background-color: "+e.color}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",ns(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:Tb,type:this.type})]},addPasteRules(){return[Es({find:Ob,type:this.type})]}});var Ab=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var i=0;i<e.length;i++)this.size+=e[i].nodeSize},Rb={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};Ab.prototype.nodesBetween=function(e,t,i,a,n){void 0===a&&(a=0);for(var r=0,o=0;o<t;r++){var s=this.content[r],l=o+s.nodeSize;if(l>e&&!1!==i(s,a+o,n,r)&&s.content.size){var u=o+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),i,a+u)}o=l}},Ab.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},Ab.prototype.textBetween=function(e,t,i,a){var n="",r=!0;return this.nodesBetween(e,t,(function(o,s){o.isText?(n+=o.text.slice(Math.max(e,s)-s,t-s),r=!i):o.isLeaf&&a?(n+="function"==typeof a?a(o):a,r=!i):!r&&o.isBlock&&(n+=i,r=!0)}),0),n},Ab.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,i=e.firstChild,a=this.content.slice(),n=0;for(t.isText&&t.sameMarkup(i)&&(a[a.length-1]=t.withText(t.text+i.text),n=1);n<e.content.length;n++)a.push(e.content[n]);return new Ab(a,this.size+e.size)},Ab.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var i=[],a=0;if(t>e)for(var n=0,r=0;r<t;n++){var o=this.content[n],s=r+o.nodeSize;s>e&&((r<e||s>t)&&(o=o.isText?o.cut(Math.max(0,e-r),Math.min(o.text.length,t-r)):o.cut(Math.max(0,e-r-1),Math.min(o.content.size,t-r-1))),i.push(o),a+=o.nodeSize),r=s}return new Ab(i,a)},Ab.prototype.cutByIndex=function(e,t){return e==t?Ab.empty:0==e&&t==this.content.length?this:new Ab(this.content.slice(e,t))},Ab.prototype.replaceChild=function(e,t){var i=this.content[e];if(i==t)return this;var a=this.content.slice(),n=this.size+t.nodeSize-i.nodeSize;return a[e]=t,new Ab(a,n)},Ab.prototype.addToStart=function(e){return new Ab([e].concat(this.content),this.size+e.nodeSize)},Ab.prototype.addToEnd=function(e){return new Ab(this.content.concat(e),this.size+e.nodeSize)},Ab.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},Rb.firstChild.get=function(){return this.content.length?this.content[0]:null},Rb.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},Rb.childCount.get=function(){return this.content.length},Ab.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},Ab.prototype.maybeChild=function(e){return this.content[e]},Ab.prototype.forEach=function(e){for(var t=0,i=0;t<this.content.length;t++){var a=this.content[t];e(a,i,t),i+=a.nodeSize}},Ab.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,i,a){for(var n=0;;n++){if(n==t.childCount||n==i.childCount)return t.childCount==i.childCount?null:a;var r=t.child(n),o=i.child(n);if(r!=o){if(!r.sameMarkup(o))return a;if(r.isText&&r.text!=o.text){for(var s=0;r.text[s]==o.text[s];s++)a++;return a}if(r.content.size||o.content.size){var l=e(r.content,o.content,a+1);if(null!=l)return l}a+=r.nodeSize}else a+=r.nodeSize}}(this,e,t)},Ab.prototype.findDiffEnd=function(e,t,i){return void 0===t&&(t=this.size),void 0===i&&(i=e.size),function e(t,i,a,n){for(var r=t.childCount,o=i.childCount;;){if(0==r||0==o)return r==o?null:{a:a,b:n};var s=t.child(--r),l=i.child(--o),u=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:a,b:n};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++,a--,n--;return{a:a,b:n}}if(s.content.size||l.content.size){var c=e(s.content,l.content,a-1,n-1);if(c)return c}a-=u,n-=u}else a-=u,n-=u}}(this,e,t,i)},Ab.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return Ib(0,e);if(e==this.size)return Ib(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var i=0,a=0;;i++){var n=a+this.child(i).nodeSize;if(n>=e)return n==e||t>0?Ib(i+1,n):Ib(i,a);a=n}},Ab.prototype.toString=function(){return"<"+this.toStringInner()+">"},Ab.prototype.toStringInner=function(){return this.content.join(", ")},Ab.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},Ab.fromJSON=function(e,t){if(!t)return Ab.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ab(t.map(e.nodeFromJSON))},Ab.fromArray=function(e){if(!e.length)return Ab.empty;for(var t,i=0,a=0;a<e.length;a++){var n=e[a];i+=n.nodeSize,a&&n.isText&&e[a-1].sameMarkup(n)?(t||(t=e.slice(0,a)),t[t.length-1]=n.withText(t[t.length-1].text+n.text)):t&&t.push(n)}return new Ab(t||e,i)},Ab.from=function(e){if(!e)return Ab.empty;if(e instanceof Ab)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ab([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(Ab.prototype,Rb);var Mb={index:0,offset:0};function Ib(e,t){return Mb.index=e,Mb.offset=t,Mb}function Bb(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var i=Array.isArray(e);if(Array.isArray(t)!=i)return!1;if(i){if(e.length!=t.length)return!1;for(var a=0;a<e.length;a++)if(!Bb(e[a],t[a]))return!1}else{for(var n in e)if(!(n in t)||!Bb(e[n],t[n]))return!1;for(var r in t)if(!(r in e))return!1}return!0}Ab.empty=new Ab([],0);var Lb=function(e,t){this.type=e,this.attrs=t};function Pb(e){var t=Error.call(this,e);return t.__proto__=Pb.prototype,t}Lb.prototype.addToSet=function(e){for(var t,i=!1,a=0;a<e.length;a++){var n=e[a];if(this.eq(n))return e;if(this.type.excludes(n.type))t||(t=e.slice(0,a));else{if(n.type.excludes(this.type))return e;!i&&n.type.rank>this.type.rank&&(t||(t=e.slice(0,a)),t.push(this),i=!0),t&&t.push(n)}}return t||(t=e.slice()),i||t.push(this),t},Lb.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},Lb.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},Lb.prototype.eq=function(e){return this==e||this.type==e.type&&Bb(this.attrs,e.attrs)},Lb.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},Lb.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var i=e.marks[t.type];if(!i)throw new RangeError("There is no mark type "+t.type+" in this schema");return i.create(t.attrs)},Lb.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0},Lb.setFrom=function(e){if(!e||0==e.length)return Lb.none;if(e instanceof Lb)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},Lb.none=[],Pb.prototype=Object.create(Error.prototype),Pb.prototype.constructor=Pb,Pb.prototype.name="ReplaceError";var jb=function(e,t,i){this.content=e,this.openStart=t,this.openEnd=i},qb={size:{configurable:!0}};function Ub(e,t,i){if(i.openStart>e.depth)throw new Pb("Inserted content deeper than insertion position");if(e.depth-i.openStart!=t.depth-i.openEnd)throw new Pb("Inconsistent open depths");return function e(t,i,a,n){var r=t.index(n),o=t.node(n);if(r==i.index(n)&&n<t.depth-a.openStart){var s=e(t,i,a,n+1);return o.copy(o.content.replaceChild(r,s))}if(a.content.size){if(a.openStart||a.openEnd||t.depth!=n||i.depth!=n){var l=function(e,t){for(var i=t.depth-e.openStart,a=t.node(i).copy(e.content),n=i-1;n>=0;n--)a=t.node(n).copy(Ab.from(a));return{start:a.resolveNoCache(e.openStart+i),end:a.resolveNoCache(a.content.size-e.openEnd-i)}}(a,t),u=l.start,d=l.end;return Wb(o,function e(t,i,a,n,r){var o=t.depth>r&&Gb(t,i,r+1),s=n.depth>r&&Gb(a,n,r+1),l=[];Yb(null,t,r,l),o&&s&&i.index(r)==a.index(r)?(zb(o,s),Hb(Wb(o,e(t,i,a,n,r+1)),l)):(o&&Hb(Wb(o,Vb(t,i,r+1)),l),Yb(i,a,r,l),s&&Hb(Wb(s,Vb(a,n,r+1)),l));return Yb(n,null,r,l),new Ab(l)}(t,u,d,i,n))}var _=t.parent,c=_.content;return Wb(_,c.cut(0,t.parentOffset).append(a.content).append(c.cut(i.parentOffset)))}return Wb(o,Vb(t,i,n))}(e,t,i,0)}function zb(e,t){if(!t.type.compatibleContent(e.type))throw new Pb("Cannot join "+t.type.name+" onto "+e.type.name)}function Gb(e,t,i){var a=e.node(i);return zb(a,t.node(i)),a}function Hb(e,t){var i=t.length-1;i>=0&&e.isText&&e.sameMarkup(t[i])?t[i]=e.withText(t[i].text+e.text):t.push(e)}function Yb(e,t,i,a){var n=(t||e).node(i),r=0,o=t?t.index(i):n.childCount;e&&(r=e.index(i),e.depth>i?r++:e.textOffset&&(Hb(e.nodeAfter,a),r++));for(var s=r;s<o;s++)Hb(n.child(s),a);t&&t.depth==i&&t.textOffset&&Hb(t.nodeBefore,a)}function Wb(e,t){if(!e.type.validContent(t))throw new Pb("Invalid content for node "+e.type.name);return e.copy(t)}function Vb(e,t,i){var a=[];(Yb(null,e,i,a),e.depth>i)&&Hb(Wb(Gb(e,t,i+1),Vb(e,t,i+1)),a);return Yb(t,null,i,a),new Ab(a)}qb.size.get=function(){return this.content.size-this.openStart-this.openEnd},jb.prototype.insertAt=function(e,t){var i=function e(t,i,a,n){var r=t.findIndex(i),o=r.index,s=r.offset,l=t.maybeChild(o);if(s==i||l.isText)return n&&!n.canReplace(o,o,a)?null:t.cut(0,i).append(a).append(t.cut(i));var u=e(l.content,i-s-1,a);return u&&t.replaceChild(o,l.copy(u))}(this.content,e+this.openStart,t,null);return i&&new jb(i,this.openStart,this.openEnd)},jb.prototype.removeBetween=function(e,t){return new jb(function e(t,i,a){var n=t.findIndex(i),r=n.index,o=n.offset,s=t.maybeChild(r),l=t.findIndex(a),u=l.index,d=l.offset;if(o==i||s.isText){if(d!=a&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,i).append(t.cut(a))}if(r!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(e(s.content,i-o-1,a-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},jb.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},jb.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},jb.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},jb.fromJSON=function(e,t){if(!t)return jb.empty;var i=t.openStart||0,a=t.openEnd||0;if("number"!=typeof i||"number"!=typeof a)throw new RangeError("Invalid input for Slice.fromJSON");return new jb(Ab.fromJSON(e,t.content),i,a)},jb.maxOpen=function(e,t){void 0===t&&(t=!0);for(var i=0,a=0,n=e.firstChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.firstChild)i++;for(var r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)a++;return new jb(e,i,a)},Object.defineProperties(jb.prototype,qb),jb.empty=new jb(Ab.empty,0,0);var $b=function(e,t,i){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=i},Kb={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};$b.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},Kb.parent.get=function(){return this.node(this.depth)},Kb.doc.get=function(){return this.node(0)},$b.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},$b.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},$b.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},$b.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},$b.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},$b.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]},$b.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},Kb.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Kb.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var i=this.pos-this.path[this.path.length-1],a=e.child(t);return i?e.child(t).cut(i):a},Kb.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)},$b.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var i=this.path[3*t],a=0==t?0:this.path[3*t-1]+1,n=0;n<e;n++)a+=i.child(n).nodeSize;return a},$b.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return Lb.none;if(this.textOffset)return e.child(t).marks;var i=e.maybeChild(t-1),a=e.maybeChild(t);if(!i){var n=i;i=a,a=n}for(var r=i.marks,o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||a&&r[o].isInSet(a.marks)||(r=r[o--].removeFromSet(r));return r},$b.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var i=t.marks,a=e.parent.maybeChild(e.index()),n=0;n<i.length;n++)!1!==i[n].type.spec.inclusive||a&&i[n].isInSet(a.marks)||(i=i[n--].removeFromSet(i));return i},$b.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},$b.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new Jb(this,e,i)},$b.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},$b.prototype.max=function(e){return e.pos>this.pos?e:this},$b.prototype.min=function(e){return e.pos<this.pos?e:this},$b.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},$b.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var i=[],a=0,n=t,r=e;;){var o=r.content.findIndex(n),s=o.index,l=o.offset,u=n-l;if(i.push(r,s,a+l),!u)break;if((r=r.child(s)).isText)break;n=u-1,a+=l+1}return new $b(t,i,n)},$b.resolveCached=function(e,t){for(var i=0;i<Qb.length;i++){var a=Qb[i];if(a.pos==t&&a.doc==e)return a}var n=Qb[Zb]=$b.resolve(e,t);return Zb=(Zb+1)%Xb,n},Object.defineProperties($b.prototype,Kb);var Qb=[],Zb=0,Xb=12,Jb=function(e,t,i){this.$from=e,this.$to=t,this.depth=i},eE={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};eE.start.get=function(){return this.$from.before(this.depth+1)},eE.end.get=function(){return this.$to.after(this.depth+1)},eE.parent.get=function(){return this.$from.node(this.depth)},eE.startIndex.get=function(){return this.$from.index(this.depth)},eE.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(Jb.prototype,eE);var tE=Object.create(null),iE=function(e,t,i,a){this.type=e,this.attrs=t,this.content=i||Ab.empty,this.marks=a||Lb.none},aE={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}};aE.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},aE.childCount.get=function(){return this.content.childCount},iE.prototype.child=function(e){return this.content.child(e)},iE.prototype.maybeChild=function(e){return this.content.maybeChild(e)},iE.prototype.forEach=function(e){this.content.forEach(e)},iE.prototype.nodesBetween=function(e,t,i,a){void 0===a&&(a=0),this.content.nodesBetween(e,t,i,a,this)},iE.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},aE.textContent.get=function(){return this.textBetween(0,this.content.size,"")},iE.prototype.textBetween=function(e,t,i,a){return this.content.textBetween(e,t,i,a)},aE.firstChild.get=function(){return this.content.firstChild},aE.lastChild.get=function(){return this.content.lastChild},iE.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},iE.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},iE.prototype.hasMarkup=function(e,t,i){return this.type==e&&Bb(this.attrs,t||e.defaultAttrs||tE)&&Lb.sameSet(this.marks,i||Lb.none)},iE.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},iE.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},iE.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},iE.prototype.slice=function(e,t,i){if(void 0===t&&(t=this.content.size),void 0===i&&(i=!1),e==t)return jb.empty;var a=this.resolve(e),n=this.resolve(t),r=i?0:a.sharedDepth(t),o=a.start(r),s=a.node(r).content.cut(a.pos-o,n.pos-o);return new jb(s,a.depth-r,n.depth-r)},iE.prototype.replace=function(e,t,i){return Ub(this.resolve(e),this.resolve(t),i)},iE.prototype.nodeAt=function(e){for(var t=this;;){var i=t.content.findIndex(e),a=i.index,n=i.offset;if(!(t=t.maybeChild(a)))return null;if(n==e||t.isText)return t;e-=n+1}},iE.prototype.childAfter=function(e){var t=this.content.findIndex(e),i=t.index,a=t.offset;return{node:this.content.maybeChild(i),index:i,offset:a}},iE.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),i=t.index,a=t.offset;if(a<e)return{node:this.content.child(i),index:i,offset:a};var n=this.content.child(i-1);return{node:n,index:i-1,offset:a-n.nodeSize}},iE.prototype.resolve=function(e){return $b.resolveCached(this,e)},iE.prototype.resolveNoCache=function(e){return $b.resolve(this,e)},iE.prototype.rangeHasMark=function(e,t,i){var a=!1;return t>e&&this.nodesBetween(e,t,(function(e){return i.isInSet(e.marks)&&(a=!0),!a})),a},aE.isBlock.get=function(){return this.type.isBlock},aE.isTextblock.get=function(){return this.type.isTextblock},aE.inlineContent.get=function(){return this.type.inlineContent},aE.isInline.get=function(){return this.type.isInline},aE.isText.get=function(){return this.type.isText},aE.isLeaf.get=function(){return this.type.isLeaf},aE.isAtom.get=function(){return this.type.isAtom},iE.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),function(e,t){for(var i=e.length-1;i>=0;i--)t=e[i].type.name+"("+t+")";return t}(this.marks,e)},iE.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},iE.prototype.canReplace=function(e,t,i,a,n){void 0===i&&(i=Ab.empty),void 0===a&&(a=0),void 0===n&&(n=i.childCount);var r=this.contentMatchAt(e).matchFragment(i,a,n),o=r&&r.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(var s=a;s<n;s++)if(!this.type.allowsMarks(i.child(s).marks))return!1;return!0},iE.prototype.canReplaceWith=function(e,t,i,a){if(a&&!this.type.allowsMarks(a))return!1;var n=this.contentMatchAt(e).matchType(i),r=n&&n.matchFragment(this.content,t);return!!r&&r.validEnd},iE.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},iE.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=Lb.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Lb.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()}))},iE.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},iE.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var i=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}var a=Ab.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,a,i)},Object.defineProperties(iE.prototype,aE);var nE=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},rE={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};nE.parse=function(e,t){var i=new oE(e,t);if(null==i.next)return nE.empty;var a=lE(i);i.next&&i.err("Unexpected trailing text");var n=function(e){var t=Object.create(null);return function i(a){var n=[];a.forEach((function(t){e[t].forEach((function(t){var i=t.term,a=t.to;if(i){var r=n.indexOf(i),o=r>-1&&n[r+1];fE(e,a).forEach((function(e){o||n.push(i,o=[]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var r=t[a.join(",")]=new nE(a.indexOf(e.length-1)>-1),o=0;o<n.length;o+=2){var s=n[o+1].sort(gE);r.next.push(n[o],t[s.join(",")]||i(s))}return r}(fE(e,0))}(function(e){var t=[[]];return n(function e(t,r){if("choice"==t.type)return t.exprs.reduce((function(t,i){return t.concat(e(i,r))}),[]);if("seq"==t.type)for(var o=0;;o++){var s=e(t.exprs[o],r);if(o==t.exprs.length-1)return s;n(s,r=i())}else{if("star"==t.type){var l=i();return a(r,l),n(e(t.expr,l),l),[a(l)]}if("plus"==t.type){var u=i();return n(e(t.expr,r),u),n(e(t.expr,u),u),[a(u)]}if("opt"==t.type)return[a(r)].concat(e(t.expr,r));if("range"==t.type){for(var d=r,_=0;_<t.min;_++){var c=i();n(e(t.expr,d),c),d=c}if(-1==t.max)n(e(t.expr,d),d);else for(var g=t.min;g<t.max;g++){var f=i();a(d,f),n(e(t.expr,d),f),d=f}return[a(d)]}if("name"==t.type)return[a(r,null,t.value)]}}(e,0),i()),t;function i(){return t.push([])-1}function a(e,i,a){var n={term:a,to:i};return t[e].push(n),n}function n(e,t){e.forEach((function(e){return e.to=t}))}}(a));return function(e,t){for(var i=0,a=[e];i<a.length;i++){for(var n=a[i],r=!n.validEnd,o=[],s=0;s<n.next.length;s+=2){var l=n.next[s],u=n.next[s+1];o.push(l.name),!r||l.isText||l.hasRequiredAttrs()||(r=!1),-1==a.indexOf(u)&&a.push(u)}r&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(n,i),n},nE.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},nE.prototype.matchFragment=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.childCount);for(var a=this,n=t;a&&n<i;n++)a=a.matchType(e.child(n).type);return a},rE.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},rE.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}},nE.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var i=0;i<e.next.length;i+=2)if(this.next[t]==e.next[i])return!0;return!1},nE.prototype.fillBefore=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=0);var a=[this];return function n(r,o){var s=r.matchFragment(e,i);if(s&&(!t||s.validEnd))return Ab.from(o.map((function(e){return e.createAndFill()})));for(var l=0;l<r.next.length;l+=2){var u=r.next[l],d=r.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==a.indexOf(d)){a.push(d);var _=n(d,o.concat(u));if(_)return _}}}(this,[])},nE.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var i=this.computeWrapping(e);return this.wrapCache.push(e,i),i},nE.prototype.computeWrapping=function(e){for(var t=Object.create(null),i=[{match:this,type:null,via:null}];i.length;){var a=i.shift(),n=a.match;if(n.matchType(e)){for(var r=[],o=a;o.type;o=o.via)r.push(o.type);return r.reverse()}for(var s=0;s<n.next.length;s+=2){var l=n.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||a.type&&!n.next[s+1].validEnd||(i.push({match:l.contentMatch,type:l,via:a}),t[l.name]=!0)}}},rE.edgeCount.get=function(){return this.next.length>>1},nE.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]}},nE.prototype.toString=function(){var e=[];return function t(i){e.push(i);for(var a=1;a<i.next.length;a+=2)-1==e.indexOf(i.next[a])&&t(i.next[a])}(this),e.map((function(t,i){for(var a=i+(t.validEnd?"*":" ")+" ",n=0;n<t.next.length;n+=2)a+=(n?", ":"")+t.next[n].name+"->"+e.indexOf(t.next[n+1]);return a})).join("\n")},Object.defineProperties(nE.prototype,rE),nE.empty=new nE(!0);var oE=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()},sE={next:{configurable:!0}};function lE(e){var t=[];do{t.push(uE(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function uE(e){var t=[];do{t.push(dE(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function dE(e){for(var t=function(e){if(e.eat("(")){var t=lE(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var i=function(e,t){var i=e.nodeTypes,a=i[t];if(a)return[a];var n=[];for(var r in i){var o=i[r];o.groups.indexOf(t)>-1&&n.push(o)}0==n.length&&e.err("No node type or group '"+t+"' found");return n}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==i.length?i[0]:{type:"choice",exprs:i}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=cE(e,t)}return t}function _E(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function cE(e,t){var i=_E(e),a=i;return e.eat(",")&&(a="}"!=e.next?_E(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:i,max:a,expr:t}}function gE(e,t){return t-e}function fE(e,t){var i=[];return function t(a){var n=e[a];if(1==n.length&&!n[0].term)return t(n[0].to);i.push(a);for(var r=0;r<n.length;r++){var o=n[r],s=o.term,l=o.to;s||-1!=i.indexOf(l)||t(l)}}(t),i.sort(gE)}function hE(e){var t=Object.create(null);for(var i in e){var a=e[i];if(!a.hasDefault)return null;t[i]=a.default}return t}function pE(e,t){var i=Object.create(null);for(var a in e){var n=t&&t[a];if(void 0===n){var r=e[a];if(!r.hasDefault)throw new RangeError("No value supplied for attribute "+a);n=r.default}i[a]=n}return i}function mE(e){var t=Object.create(null);if(e)for(var i in e)t[i]=new EE(e[i]);return t}sE.next.get=function(){return this.tokens[this.pos]},oE.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},oE.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(oE.prototype,sE);var FE=function(e,t,i){this.name=e,this.schema=t,this.spec=i,this.groups=i.group?i.group.split(" "):[],this.attrs=mE(i.attrs),this.defaultAttrs=hE(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(i.inline||"text"==e),this.isText="text"==e},bE={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};bE.isInline.get=function(){return!this.isBlock},bE.isTextblock.get=function(){return this.isBlock&&this.inlineContent},bE.isLeaf.get=function(){return this.contentMatch==nE.empty},bE.isAtom.get=function(){return this.isLeaf||this.spec.atom},FE.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},FE.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},FE.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:pE(this.attrs,e)},FE.prototype.create=function(e,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new iE(this,this.computeAttrs(e),Ab.from(t),Lb.setFrom(i))},FE.prototype.createChecked=function(e,t,i){if(t=Ab.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new iE(this,this.computeAttrs(e),t,Lb.setFrom(i))},FE.prototype.createAndFill=function(e,t,i){if(e=this.computeAttrs(e),(t=Ab.from(t)).size){var a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}var n=this.contentMatch.matchFragment(t).fillBefore(Ab.empty,!0);return n?new iE(this,e,t.append(n),Lb.setFrom(i)):null},FE.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0},FE.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},FE.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},FE.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:Lb.empty:e},FE.compile=function(e,t){var i=Object.create(null);e.forEach((function(e,a){return i[e]=new FE(e,t,a)}));var a=t.spec.topNode||"doc";if(!i[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(var n in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i},Object.defineProperties(FE.prototype,bE);var EE=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},yE={isRequired:{configurable:!0}};yE.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(EE.prototype,yE);var DE=function(e,t,i,a){this.name=e,this.schema=i,this.spec=a,this.attrs=mE(a.attrs),this.rank=t,this.excluded=null;var n=hE(this.attrs);this.instance=n&&new Lb(this,n)};DE.prototype.create=function(e){return!e&&this.instance?this.instance:new Lb(this,pE(this.attrs,e))},DE.compile=function(e,t){var i=Object.create(null),a=0;return e.forEach((function(e,n){return i[e]=new DE(e,a++,t,n)})),i},DE.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},DE.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},DE.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var vE={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},kE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},SE={ol:!0,ul:!0};function wE(e){return(e?1:0)|("full"===e?2:0)}var CE=function(e,t,i,a,n,r,o){this.type=e,this.attrs=t,this.solid=n,this.match=r||(4&o?null:e.contentMatch),this.options=o,this.content=[],this.marks=i,this.activeMarks=Lb.none,this.pendingMarks=a,this.stashMarks=[]};CE.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(Ab.from(e));if(!t){var i,a=this.type.contentMatch;return(i=a.findWrapping(e.type))?(this.match=a,i):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},CE.prototype.finish=function(e){if(!(1&this.options)){var t,i=this.content[this.content.length-1];i&&i.isText&&(t=/[ \t\r\n\u000c]+$/.exec(i.text))&&(i.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-t[0].length)))}var a=Ab.from(this.content);return!e&&this.match&&(a=a.append(this.match.fillBefore(Ab.empty,!0))),this.type?this.type.create(this.attrs,a,this.marks):a},CE.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]},CE.prototype.applyPending=function(e){for(var t=0,i=this.pendingMarks;t<i.length;t++){var a=i[t];(this.type?this.type.allowsMarkType(a.type):OE(a.type,e))&&!a.isInSet(this.activeMarks)&&(this.activeMarks=a.addToSet(this.activeMarks),this.pendingMarks=a.removeFromSet(this.pendingMarks))}},CE.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!vE.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var xE=function(e,t,i){this.parser=e,this.options=t,this.isOpen=i;var a,n=t.topNode,r=wE(t.preserveWhitespace)|(i?4:0);a=n?new CE(n.type,n.attrs,Lb.none,Lb.none,!0,t.topMatch||n.type.contentMatch,r):new CE(i?null:e.schema.topNodeType,null,Lb.none,Lb.none,!0,null,r),this.nodes=[a],this.open=0,this.find=t.findPositions,this.needsBlock=!1},TE={top:{configurable:!0},currentPos:{configurable:!0}};function OE(e,t){var i=t.schema.nodes,a=function(a){var n=i[a];if(n.allowsMarkType(e)){var r=[],o=function(e){r.push(e);for(var i=0;i<e.edgeCount;i++){var a=e.edge(i),n=a.type,s=a.next;if(n==t)return!0;if(r.indexOf(s)<0&&o(s))return!0}};return o(n.contentMatch)?{v:!0}:void 0}};for(var n in i){var r=a(n);if(r)return r.v}}TE.top.get=function(){return this.nodes[this.open]},xE.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),i=t?this.readStyles(function(e){var t,i=/\s*([\w-]+)\s*:\s*([^;]+)/g,a=[];for(;t=i.exec(e);)a.push(t[1],t[2].trim());return a}(t)):null,a=this.top;if(null!=i)for(var n=0;n<i.length;n++)this.addPendingMark(i[n]);if(this.addElement(e),null!=i)for(var r=0;r<i.length;r++)this.removePendingMark(i[r],a)}},xE.prototype.addTextNode=function(e){var t=e.nodeValue,i=this.top;if(2&i.options||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&i.options)t=2&i.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var a=i.content[i.content.length-1],n=e.previousSibling;(!a||n&&"BR"==n.nodeName||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},xE.prototype.addElement=function(e,t){var i,a=e.nodeName.toLowerCase();SE.hasOwnProperty(a)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,i=null;t;t=t.nextSibling){var a=1==t.nodeType?t.nodeName.toLowerCase():null;a&&SE.hasOwnProperty(a)&&i?(i.appendChild(t),t=i):"li"==a?i=t:a&&(i=null)}}(e);var n=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(n?n.ignore:kE.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e);else if(!n||n.skip||n.closeParent){n&&n.closeParent?this.open=Math.max(0,this.open-1):n&&n.skip.nodeType&&(e=n.skip);var r,o=this.top,s=this.needsBlock;if(vE.hasOwnProperty(a))r=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),r&&this.sync(o),this.needsBlock=s}else this.addElementByRule(e,n,!1===n.consuming?i:null)},xE.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},xE.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},xE.prototype.readStyles=function(e){var t=Lb.none;e:for(var i=0;i<e.length;i+=2)for(var a=null;;){var n=this.parser.matchStyle(e[i],e[i+1],this,a);if(!n)continue e;if(n.ignore)return null;if(t=this.parser.schema.marks[n.mark].create(n.attrs).addToSet(t),!1!==n.consuming)break;a=n}return t},xE.prototype.addElementByRule=function(e,t,i){var a,n,r,o=this;t.node?(n=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(n.create(t.attrs))||this.leafFallback(e):a=this.enter(n,t.attrs,t.preserveWhitespace):(r=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(r));var s=this.top;if(n&&n.isLeaf)this.findInside(e);else if(i)this.addElement(e,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return o.insertNode(e)}));else{var l=t.contentElement;"string"==typeof l?l=e.querySelector(l):"function"==typeof l&&(l=l(e)),l||(l=e),this.findAround(e,l,!0),this.addAll(l,a)}a&&(this.sync(s),this.open--),r&&this.removePendingMark(r,s)},xE.prototype.addAll=function(e,t,i,a){for(var n=i||0,r=i?e.childNodes[i]:e.firstChild,o=null==a?null:e.childNodes[a];r!=o;r=r.nextSibling,++n)this.findAtPoint(e,n),this.addDOM(r),t&&vE.hasOwnProperty(r.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,n)},xE.prototype.findPlace=function(e){for(var t,i,a=this.open;a>=0;a--){var n=this.nodes[a],r=n.findWrapping(e);if(r&&(!t||t.length>r.length)&&(t=r,i=n,!r.length))break;if(n.solid)break}if(!t)return!1;this.sync(i);for(var o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0},xE.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var i=this.top;i.applyPending(e.type),i.match&&(i.match=i.match.matchType(e.type));for(var a=i.activeMarks,n=0;n<e.marks.length;n++)i.type&&!i.type.allowsMarkType(e.marks[n].type)||(a=e.marks[n].addToSet(a));return i.content.push(e.mark(a)),!0}return!1},xE.prototype.enter=function(e,t,i){var a=this.findPlace(e.create(t));return a&&this.enterInner(e,t,!0,i),a},xE.prototype.enterInner=function(e,t,i,a){this.closeExtra();var n=this.top;n.applyPending(e),n.match=n.match&&n.match.matchType(e,t);var r=null==a?-5&n.options:wE(a);4&n.options&&0==n.content.length&&(r|=4),this.nodes.push(new CE(e,t,n.activeMarks,n.pendingMarks,i,null,r)),this.open++},xE.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}},xE.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},xE.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},TE.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var i=this.nodes[t].content,a=i.length-1;a>=0;a--)e+=i[a].nodeSize;t&&e++}return e},xE.prototype.findAtPoint=function(e,t){if(this.find)for(var i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==t&&(this.find[i].pos=this.currentPos)},xE.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)},xE.prototype.findAround=function(e,t,i){if(e!=t&&this.find)for(var a=0;a<this.find.length;a++){if(null==this.find[a].pos&&1==e.nodeType&&e.contains(this.find[a].node))t.compareDocumentPosition(this.find[a].node)&(i?2:4)&&(this.find[a].pos=this.currentPos)}},xE.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))},xE.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var i=e.split("/"),a=this.options.context,n=!(this.isOpen||a&&a.parent.type!=this.nodes[0].type),r=-(a?a.depth+1:0)+(n?0:1),o=function(e,s){for(;e>=0;e--){var l=i[e];if(""==l){if(e==i.length-1||0==e)continue;for(;s>=r;s--)if(o(e-1,s))return!0;return!1}var u=s>0||0==s&&n?t.nodes[s].type:a&&s>=r?a.node(s-r).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0};return o(i.length-1,this.open)},xE.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var i=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(var a in this.parser.schema.nodes){var n=this.parser.schema.nodes[a];if(n.isTextblock&&n.defaultAttrs)return n}},xE.prototype.addPendingMark=function(e){var t=function(e,t){for(var i=0;i<t.length;i++)if(e.eq(t[i]))return t[i]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},xE.prototype.removePendingMark=function(e,t){for(var i=this.open;i>=0;i--){var a=this.nodes[i];if(a.pendingMarks.lastIndexOf(e)>-1)a.pendingMarks=e.removeFromSet(a.pendingMarks);else{a.activeMarks=e.removeFromSet(a.activeMarks);var n=a.popFromStashMark(e);n&&a.type&&a.type.allowsMarkType(n.type)&&(a.activeMarks=n.addToSet(a.activeMarks))}if(a==t)break}},Object.defineProperties(xE.prototype,TE);var NE=Math.pow(2,16);function AE(e){return 65535&e}var RE=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null),this.pos=e,this.deleted=t,this.recover=i},ME=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};ME.prototype.recover=function(e){var t=0,i=AE(e);if(!this.inverted)for(var a=0;a<i;a++)t+=this.ranges[3*a+2]-this.ranges[3*a+1];return this.ranges[3*i]+t+function(e){return(e-(65535&e))/NE}(e)},ME.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},ME.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},ME.prototype._map=function(e,t,i){for(var a=0,n=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?a:0);if(s>e)break;var l=this.ranges[o+n],u=this.ranges[o+r],d=s+l;if(e<=d){var _=s+a+((l?e==s?-1:e==d?1:t:t)<0?0:u);if(i)return _;var c=e==(t<0?s:d)?null:o/3+(e-s)*NE;return new RE(_,t<0?e!=s:e!=d,c)}a+=u-l}return i?e+a:new RE(e+a)},ME.prototype.touches=function(e,t){for(var i=0,a=AE(t),n=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?i:0);if(s>e)break;var l=this.ranges[o+n];if(e<=s+l&&o==3*a)return!0;i+=this.ranges[o+r]-l}return!1},ME.prototype.forEach=function(e){for(var t=this.inverted?2:1,i=this.inverted?1:2,a=0,n=0;a<this.ranges.length;a+=3){var r=this.ranges[a],o=r-(this.inverted?n:0),s=r+(this.inverted?0:n),l=this.ranges[a+t],u=this.ranges[a+i];e(o,o+l,s,s+u),n+=u-l}},ME.prototype.invert=function(){return new ME(this.ranges,!this.inverted)},ME.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},ME.offset=function(e){return 0==e?ME.empty:new ME(e<0?[0,-e,0]:[0,0,e])},ME.empty=new ME([]);var IE=function(e,t,i,a){this.maps=e||[],this.from=i||0,this.to=null==a?this.maps.length:a,this.mirror=t};function BE(e){var t=Error.call(this,e);return t.__proto__=BE.prototype,t}IE.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new IE(this.maps,this.mirror,e,t)},IE.prototype.copy=function(){return new IE(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},IE.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},IE.prototype.appendMapping=function(e){for(var t=0,i=this.maps.length;t<e.maps.length;t++){var a=e.getMirror(t);this.appendMap(e.maps[t],null!=a&&a<t?i+a:null)}},IE.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)]},IE.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},IE.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,i=this.maps.length+e.maps.length;t>=0;t--){var a=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=a&&a>t?i-a-1:null)}},IE.prototype.invert=function(){var e=new IE;return e.appendMappingInverted(this),e},IE.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var i=this.from;i<this.to;i++)e=this.maps[i].map(e,t);return e},IE.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},IE.prototype._map=function(e,t,i){for(var a=!1,n=this.from;n<this.to;n++){var r=this.maps[n].mapResult(e,t);if(null!=r.recover){var o=this.getMirror(n);if(null!=o&&o>n&&o<this.to){n=o,e=this.maps[o].recover(r.recover);continue}}r.deleted&&(a=!0),e=r.pos}return i?e:new RE(e,a)},BE.prototype=Object.create(Error.prototype),BE.prototype.constructor=BE,BE.prototype.name="TransformError";var LE=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new IE},PE={before:{configurable:!0},docChanged:{configurable:!0}};function jE(){throw new Error("Override me")}PE.before.get=function(){return this.docs.length?this.docs[0]:this.doc},LE.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new BE(t.failed);return this},LE.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},PE.docChanged.get=function(){return this.steps.length>0},LE.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(LE.prototype,PE);var qE=Object.create(null),UE=function(){};UE.prototype.apply=function(e){return jE()},UE.prototype.getMap=function(){return ME.empty},UE.prototype.invert=function(e){return jE()},UE.prototype.map=function(e){return jE()},UE.prototype.merge=function(e){return null},UE.prototype.toJSON=function(){return jE()},UE.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var i=qE[t.stepType];if(!i)throw new RangeError("No step type "+t.stepType+" defined");return i.fromJSON(e,t)},UE.jsonID=function(e,t){if(e in qE)throw new RangeError("Duplicate use of step JSON ID "+e);return qE[e]=t,t.prototype.jsonID=e,t};var zE=function(e,t){this.doc=e,this.failed=t};zE.ok=function(e){return new zE(e,null)},zE.fail=function(e){return new zE(null,e)},zE.fromReplace=function(e,t,i,a){try{return zE.ok(e.replace(t,i,a))}catch(e){if(e instanceof Pb)return zE.fail(e.message);throw e}};var GE=function(e){function t(t,i,a,n){e.call(this),this.from=t,this.to=i,this.slice=a,this.structure=!!n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&YE(e,this.from,this.to)?zE.fail("Structure replace would overwrite content"):zE.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new ME([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted?null:new t(i.pos,Math.max(i.pos,a.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var i=this.slice.size+e.slice.size==0?jb.empty:new jb(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,i,this.structure)}var a=this.slice.size+e.slice.size==0?jb.empty:new jb(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),a,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(i.from,i.to,jb.fromJSON(e,i.slice),!!i.structure)},t}(UE);UE.jsonID("replace",GE);var HE=function(e){function t(t,i,a,n,r,o,s){e.call(this),this.from=t,this.to=i,this.gapFrom=a,this.gapTo=n,this.slice=r,this.insert=o,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(YE(e,this.from,this.gapFrom)||YE(e,this.gapTo,this.to)))return zE.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return zE.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,t.content);return i?zE.fromReplace(e,this.from,this.to,i):zE.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new ME([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var i=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+i,this.from+this.insert,this.from+this.insert+i,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1),n=e.map(this.gapFrom,-1),r=e.map(this.gapTo,1);return i.deleted&&a.deleted||n<i.pos||r>a.pos?null:new t(i.pos,a.pos,n,r,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to||"number"!=typeof i.gapFrom||"number"!=typeof i.gapTo||"number"!=typeof i.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(i.from,i.to,i.gapFrom,i.gapTo,jb.fromJSON(e,i.slice),i.insert,!!i.structure)},t}(UE);function YE(e,t,i){for(var a=e.resolve(t),n=i-t,r=a.depth;n>0&&r>0&&a.indexAfter(r)==a.node(r).childCount;)r--,n--;if(n>0)for(var o=a.node(r).maybeChild(a.indexAfter(r));n>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,n--}return!1}function WE(e,t,i){for(var a=[],n=0;n<e.childCount;n++){var r=e.child(n);r.content.size&&(r=r.copy(WE(r.content,t,r))),r.isInline&&(r=t(r,i,n)),a.push(r)}return Ab.fromArray(a)}UE.jsonID("replaceAround",HE),LE.prototype.lift=function(e,t){for(var i=e.$from,a=e.$to,n=e.depth,r=i.before(n+1),o=a.after(n+1),s=r,l=o,u=Ab.empty,d=0,_=n,c=!1;_>t;_--)c||i.index(_)>0?(c=!0,u=Ab.from(i.node(_).copy(u)),d++):s--;for(var g=Ab.empty,f=0,h=n,p=!1;h>t;h--)p||a.after(h+1)<a.end(h)?(p=!0,g=Ab.from(a.node(h).copy(g)),f++):l++;return this.step(new HE(s,l,r,o,new jb(u.append(g),d,f),u.size-d,!0))},LE.prototype.wrap=function(e,t){for(var i=Ab.empty,a=t.length-1;a>=0;a--)i=Ab.from(t[a].type.create(t[a].attrs,i));var n=e.start,r=e.end;return this.step(new HE(n,r,n,r,new jb(i,0,0),t.length,!0))},LE.prototype.setBlockType=function(e,t,i,a){var n=this;if(void 0===t&&(t=e),!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var r=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(i,a)&&function(e,t,i){var a=e.resolve(t),n=a.index();return a.parent.canReplaceWith(n,n+1,i)}(n.doc,n.mapping.slice(r).map(t),i)){n.clearIncompatible(n.mapping.slice(r).map(t,1),i);var o=n.mapping.slice(r),s=o.map(t,1),l=o.map(t+e.nodeSize,1);return n.step(new HE(s,l,s+1,l-1,new jb(Ab.from(i.create(a,null,e.marks)),0,0),1,!0)),!1}})),this},LE.prototype.setNodeMarkup=function(e,t,i,a){var n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at given position");t||(t=n.type);var r=t.create(i,null,a||n.marks);if(n.isLeaf)return this.replaceWith(e,e+n.nodeSize,r);if(!t.validContent(n.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new HE(e,e+n.nodeSize,e+1,e+n.nodeSize-1,new jb(Ab.from(r),0,0),1,!0))},LE.prototype.split=function(e,t,i){void 0===t&&(t=1);for(var a=this.doc.resolve(e),n=Ab.empty,r=Ab.empty,o=a.depth,s=a.depth-t,l=t-1;o>s;o--,l--){n=Ab.from(a.node(o).copy(n));var u=i&&i[l];r=Ab.from(u?u.type.create(u.attrs,r):a.node(o).copy(r))}return this.step(new GE(e,e,new jb(n.append(r),t,t),!0))},LE.prototype.join=function(e,t){void 0===t&&(t=1);var i=new GE(e-t,e+t,jb.empty,!0);return this.step(i)};var VE=function(e){function t(t,i,a){e.call(this),this.from=t,this.to=i,this.mark=a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),a=e.resolve(this.from),n=a.node(a.sharedDepth(this.to)),r=new jb(WE(i.content,(function(e,i){return e.isAtom&&i.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),n),i.openStart,i.openEnd);return zE.fromReplace(e,this.from,this.to,r)},t.prototype.invert=function(){return new $E(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted||i.pos>=a.pos?null:new t(i.pos,a.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(UE);UE.jsonID("addMark",VE);var $E=function(e){function t(t,i,a){e.call(this),this.from=t,this.to=i,this.mark=a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),a=new jb(WE(i.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),i.openStart,i.openEnd);return zE.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new VE(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted||i.pos>=a.pos?null:new t(i.pos,a.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(UE);function KE(e,t,i){return!i.openStart&&!i.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),i.content)}UE.jsonID("removeMark",$E),LE.prototype.addMark=function(e,t,i){var a=this,n=[],r=[],o=null,s=null;return this.doc.nodesBetween(e,t,(function(a,l,u){if(a.isInline){var d=a.marks;if(!i.isInSet(d)&&u.type.allowsMarkType(i.type)){for(var _=Math.max(l,e),c=Math.min(l+a.nodeSize,t),g=i.addToSet(d),f=0;f<d.length;f++)d[f].isInSet(g)||(o&&o.to==_&&o.mark.eq(d[f])?o.to=c:n.push(o=new $E(_,c,d[f])));s&&s.to==_?s.to=c:r.push(s=new VE(_,c,i))}}})),n.forEach((function(e){return a.step(e)})),r.forEach((function(e){return a.step(e)})),this},LE.prototype.removeMark=function(e,t,i){var a=this;void 0===i&&(i=null);var n=[],r=0;return this.doc.nodesBetween(e,t,(function(a,o){if(a.isInline){r++;var s=null;if(i instanceof DE)for(var l,u=a.marks;l=i.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else i?i.isInSet(a.marks)&&(s=[i]):s=a.marks;if(s&&s.length)for(var d=Math.min(o+a.nodeSize,t),_=0;_<s.length;_++){for(var c=s[_],g=void 0,f=0;f<n.length;f++){var h=n[f];h.step==r-1&&c.eq(n[f].style)&&(g=h)}g?(g.to=d,g.step=r):n.push({style:c,from:Math.max(o,e),to:d,step:r})}}})),n.forEach((function(e){return a.step(new $E(e.from,e.to,e.style))})),this},LE.prototype.clearIncompatible=function(e,t,i){void 0===i&&(i=t.contentMatch);for(var a=this.doc.nodeAt(e),n=[],r=e+1,o=0;o<a.childCount;o++){var s=a.child(o),l=r+s.nodeSize,u=i.matchType(s.type,s.attrs);if(u){i=u;for(var d=0;d<s.marks.length;d++)t.allowsMarkType(s.marks[d].type)||this.step(new $E(r,l,s.marks[d]))}else n.push(new GE(r,l,jb.empty));r=l}if(!i.validEnd){var _=i.fillBefore(Ab.empty,!0);this.replace(r,r,new jb(_,0,0))}for(var c=n.length-1;c>=0;c--)this.step(n[c]);return this},LE.prototype.replace=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=jb.empty);var a=function(e,t,i,a){if(void 0===i&&(i=t),void 0===a&&(a=jb.empty),t==i&&!a.size)return null;var n=e.resolve(t),r=e.resolve(i);return KE(n,r,a)?new GE(t,i,a):new QE(n,r,a).fit()}(this.doc,e,t,i);return a&&this.step(a),this},LE.prototype.replaceWith=function(e,t,i){return this.replace(e,t,new jb(Ab.from(i),0,0))},LE.prototype.delete=function(e,t){return this.replace(e,t,jb.empty)},LE.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var QE=function(e,t,i){this.$to=t,this.$from=e,this.unplaced=i,this.frontier=[];for(var a=0;a<=e.depth;a++){var n=e.node(a);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(a))})}this.placed=Ab.empty;for(var r=e.depth;r>0;r--)this.placed=Ab.from(e.node(r).copy(this.placed))},ZE={depth:{configurable:!0}};function XE(e,t,i){return 0==t?e.cutByIndex(i):e.replaceChild(0,e.firstChild.copy(XE(e.firstChild.content,t-1,i)))}function JE(e,t,i){return 0==t?e.append(i):e.replaceChild(e.childCount-1,e.lastChild.copy(JE(e.lastChild.content,t-1,i)))}function ey(e,t){for(var i=0;i<t;i++)e=e.firstChild.content;return e}function ty(e,t,i){if(t<=0)return e;var a=e.content;return t>1&&(a=a.replaceChild(0,ty(a.firstChild,t-1,1==a.childCount?i-1:0))),t>0&&(a=e.type.contentMatch.fillBefore(a).append(a),i<=0&&(a=a.append(e.type.contentMatch.matchFragment(a).fillBefore(Ab.empty,!0)))),e.copy(a)}function iy(e,t,i,a,n){var r=e.node(t),o=n?e.indexAfter(t):e.index(t);if(o==r.childCount&&!i.compatibleContent(r.type))return null;var s=a.fillBefore(r.content,!0,o);return s&&!function(e,t,i){for(var a=i;a<t.childCount;a++)if(!e.allowsMarks(t.child(a).marks))return!0;return!1}(i,r.content,o)?s:null}function ay(e,t,i,a,n){if(t<i){var r=e.firstChild;e=e.replaceChild(0,r.copy(ay(r.content,t+1,i,a,r)))}if(t>a){var o=n.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(Ab.empty,!0))}return e}function ny(e,t){for(var i=[],a=Math.min(e.depth,t.depth);a>=0;a--){var n=e.start(a);if(n<e.pos-(e.depth-a)||t.end(a)>t.pos+(t.depth-a)||e.node(a).type.spec.isolating||t.node(a).type.spec.isolating)break;(n==t.start(a)||a==e.depth&&a==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&a&&t.start(a-1)==n-1)&&i.push(a)}return i}ZE.depth.get=function(){return this.frontier.length-1},QE.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),i=this.placed.size-this.depth-this.$from.depth,a=this.$from,n=this.close(t<0?this.$to:a.doc.resolve(t));if(!n)return null;for(var r=this.placed,o=a.depth,s=n.depth;o&&s&&1==r.childCount;)r=r.firstChild.content,o--,s--;var l=new jb(r,o,s);return t>-1?new HE(a.pos,t,this.$to.pos,this.$to.end(),l,i):l.size||a.pos!=this.$to.pos?new GE(a.pos,n.pos,l):void 0},QE.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var i=void 0,a=(t?(i=ey(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,n=this.depth;n>=0;n--){var r=this.frontier[n],o=r.type,s=r.match,l=void 0,u=void 0;if(1==e&&(a?s.matchType(a.type)||(u=s.fillBefore(Ab.from(a),!1)):o.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:n,parent:i,inject:u};if(2==e&&a&&(l=s.findWrapping(a.type)))return{sliceDepth:t,frontierDepth:n,parent:i,wrap:l};if(i&&s.matchType(i.type))break}},QE.prototype.openMore=function(){var e=this.unplaced,t=e.content,i=e.openStart,a=e.openEnd,n=ey(t,i);return!(!n.childCount||n.firstChild.isLeaf)&&(this.unplaced=new jb(t,i+1,Math.max(a,n.size+i>=t.size-a?i+1:0)),!0)},QE.prototype.dropNode=function(){var e=this.unplaced,t=e.content,i=e.openStart,a=e.openEnd,n=ey(t,i);if(n.childCount<=1&&i>0){var r=t.size-i<=i+n.size;this.unplaced=new jb(XE(t,i-1,1),i-1,r?i-1:a)}else this.unplaced=new jb(XE(t,i,1),i,a)},QE.prototype.placeNodes=function(e){for(var t=e.sliceDepth,i=e.frontierDepth,a=e.parent,n=e.inject,r=e.wrap;this.depth>i;)this.closeFrontierNode();if(r)for(var o=0;o<r.length;o++)this.openFrontierNode(r[o]);var s=this.unplaced,l=a?a.content:s.content,u=s.openStart-t,d=0,_=[],c=this.frontier[i],g=c.match,f=c.type;if(n){for(var h=0;h<n.childCount;h++)_.push(n.child(h));g=g.matchFragment(n)}for(var p=l.size+t-(s.content.size-s.openEnd);d<l.childCount;){var m=l.child(d),F=g.matchType(m.type);if(!F)break;(++d>1||0==u||m.content.size)&&(g=F,_.push(ty(m.mark(f.allowedMarks(m.marks)),1==d?u:0,d==l.childCount?p:-1)))}var b=d==l.childCount;b||(p=-1),this.placed=JE(this.placed,i,Ab.from(_)),this.frontier[i].match=g,b&&p<0&&a&&a.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var E=0,y=l;E<p;E++){var D=y.lastChild;this.frontier.push({type:D.type,match:D.contentMatchAt(D.childCount)}),y=D.content}this.unplaced=b?0==t?jb.empty:new jb(XE(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new jb(XE(s.content,t,d),s.openStart,s.openEnd)},QE.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||!iy(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var i=this.$to.depth,a=this.$to.after(i);i>1&&a==this.$to.end(--i);)++a;return a},QE.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var i=this.frontier[t],a=i.match,n=i.type,r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=iy(e,t,n,a,r);if(o){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,d=iy(e,s,l.type,u,!0);if(!d||d.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}},QE.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=JE(this.placed,t.depth,t.fit)),e=t.move;for(var i=t.depth+1;i<=e.depth;i++){var a=e.node(i),n=a.type.contentMatch.fillBefore(a.content,!0,e.index(i));this.openFrontierNode(a.type,a.attrs,n)}return e},QE.prototype.openFrontierNode=function(e,t,i){var a=this.frontier[this.depth];a.match=a.match.matchType(e),this.placed=JE(this.placed,this.depth,Ab.from(e.create(t,i))),this.frontier.push({type:e,match:e.contentMatch})},QE.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(Ab.empty,!0);e.childCount&&(this.placed=JE(this.placed,this.frontier.length,e))},Object.defineProperties(QE.prototype,ZE),LE.prototype.replaceRange=function(e,t,i){if(!i.size)return this.deleteRange(e,t);var a=this.doc.resolve(e),n=this.doc.resolve(t);if(KE(a,n,i))return this.step(new GE(e,t,i));var r=ny(a,this.doc.resolve(t));0==r[r.length-1]&&r.pop();var o=-(a.depth+1);r.unshift(o);for(var s=a.depth,l=a.pos-1;s>0;s--,l--){var u=a.node(s).type.spec;if(u.defining||u.isolating)break;r.indexOf(s)>-1?o=s:a.before(s)==l&&r.splice(1,0,-s)}for(var d=r.indexOf(o),_=[],c=i.openStart,g=i.content,f=0;;f++){var h=g.firstChild;if(_.push(h),f==i.openStart)break;g=h.content}c>0&&_[c-1].type.spec.defining&&a.node(d).type!=_[c-1].type?c-=1:c>=2&&_[c-1].isTextblock&&_[c-2].type.spec.defining&&a.node(d).type!=_[c-2].type&&(c-=2);for(var p=i.openStart;p>=0;p--){var m=(p+c+1)%(i.openStart+1),F=_[m];if(F)for(var b=0;b<r.length;b++){var E=r[(b+d)%r.length],y=!0;E<0&&(y=!1,E=-E);var D=a.node(E-1),v=a.index(E-1);if(D.canReplaceWith(v,v,F.type,F.marks))return this.replace(a.before(E),y?n.after(E):t,new jb(ay(i.content,0,i.openStart,m),m,i.openEnd))}}for(var k=this.steps.length,S=r.length-1;S>=0&&(this.replace(e,t,i),!(this.steps.length>k));S--){var w=r[S];w<0||(e=a.before(w),t=n.after(w))}return this},LE.prototype.replaceRangeWith=function(e,t,i){if(!i.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var a=function(e,t,i){var a=e.resolve(t);if(a.parent.canReplaceWith(a.index(),a.index(),i))return t;if(0==a.parentOffset)for(var n=a.depth-1;n>=0;n--){var r=a.index(n);if(a.node(n).canReplaceWith(r,r,i))return a.before(n+1);if(r>0)return null}if(a.parentOffset==a.parent.content.size)for(var o=a.depth-1;o>=0;o--){var s=a.indexAfter(o);if(a.node(o).canReplaceWith(s,s,i))return a.after(o+1);if(s<a.node(o).childCount)return null}}(this.doc,e,i.type);null!=a&&(e=t=a)}return this.replaceRange(e,t,new jb(Ab.from(i),0,0))},LE.prototype.deleteRange=function(e,t){for(var i=this.doc.resolve(e),a=this.doc.resolve(t),n=ny(i,a),r=0;r<n.length;r++){var o=n[r],s=r==n.length-1;if(s&&0==o||i.node(o).type.contentMatch.validEnd)return this.delete(i.start(o),a.end(o));if(o>0&&(s||i.node(o-1).canReplace(i.index(o-1),a.indexAfter(o-1))))return this.delete(i.before(o),a.after(o))}for(var l=1;l<=i.depth&&l<=a.depth;l++)if(e-i.start(l)==i.depth-l&&t>i.end(l)&&a.end(l)-t!=a.depth-l)return this.delete(i.before(l),t);return this.delete(e,t)};var ry=Object.create(null),oy=function(e,t,i){this.ranges=i||[new ly(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},sy={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};sy.anchor.get=function(){return this.$anchor.pos},sy.head.get=function(){return this.$head.pos},sy.from.get=function(){return this.$from.pos},sy.to.get=function(){return this.$to.pos},sy.$from.get=function(){return this.ranges[0].$from},sy.$to.get=function(){return this.ranges[0].$to},sy.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},oy.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},oy.prototype.replace=function(e,t){void 0===t&&(t=jb.empty);for(var i=t.content.lastChild,a=null,n=0;n<t.openEnd;n++)a=i,i=i.lastChild;for(var r=e.steps.length,o=this.ranges,s=0;s<o.length;s++){var l=o[s],u=l.$from,d=l.$to,_=e.mapping.slice(r);e.replaceRange(_.map(u.pos),_.map(d.pos),s?jb.empty:t),0==s&&py(e,r,(i?i.isInline:a&&a.isTextblock)?-1:1)}},oy.prototype.replaceWith=function(e,t){for(var i=e.steps.length,a=this.ranges,n=0;n<a.length;n++){var r=a[n],o=r.$from,s=r.$to,l=e.mapping.slice(i),u=l.map(o.pos),d=l.map(s.pos);n?e.deleteRange(u,d):(e.replaceRangeWith(u,d,t),py(e,i,t.isInline?-1:1))}},oy.findFrom=function(e,t,i){var a=e.parent.inlineContent?new uy(e):hy(e.node(0),e.parent,e.pos,e.index(),t,i);if(a)return a;for(var n=e.depth-1;n>=0;n--){var r=t<0?hy(e.node(0),e.node(n),e.before(n+1),e.index(n),t,i):hy(e.node(0),e.node(n),e.after(n+1),e.index(n)+1,t,i);if(r)return r}},oy.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new gy(e.node(0))},oy.atStart=function(e){return hy(e,e,0,0,1)||new gy(e)},oy.atEnd=function(e){return hy(e,e,e.content.size,e.childCount,-1)||new gy(e)},oy.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var i=ry[t.type];if(!i)throw new RangeError("No selection type "+t.type+" defined");return i.fromJSON(e,t)},oy.jsonID=function(e,t){if(e in ry)throw new RangeError("Duplicate use of selection JSON ID "+e);return ry[e]=t,t.prototype.jsonID=e,t},oy.prototype.getBookmark=function(){return uy.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(oy.prototype,sy),oy.prototype.visible=!0;var ly=function(e,t){this.$from=e,this.$to=t},uy=function(e){function t(t,i){void 0===i&&(i=t),e.call(this,t,i)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={$cursor:{configurable:!0}};return i.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(i,a){var n=i.resolve(a.map(this.head));if(!n.parent.inlineContent)return e.near(n);var r=i.resolve(a.map(this.anchor));return new t(r.parent.inlineContent?r:n,n)},t.prototype.replace=function(t,i){if(void 0===i&&(i=jb.empty),e.prototype.replace.call(this,t,i),i==jb.empty){var a=this.$from.marksAcross(this.$to);a&&t.ensureMarks(a)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new dy(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.anchor||"number"!=typeof i.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(i.anchor),e.resolve(i.head))},t.create=function(e,t,i){void 0===i&&(i=t);var a=e.resolve(t);return new this(a,i==t?a:e.resolve(i))},t.between=function(i,a,n){var r=i.pos-a.pos;if(n&&!r||(n=r>=0?1:-1),!a.parent.inlineContent){var o=e.findFrom(a,n,!0)||e.findFrom(a,-n,!0);if(!o)return e.near(a,n);a=o.$head}return i.parent.inlineContent||(0==r||(i=(e.findFrom(i,-n,!0)||e.findFrom(i,n,!0)).$anchor).pos<a.pos!=r<0)&&(i=a),new t(i,a)},Object.defineProperties(t.prototype,i),t}(oy);oy.jsonID("text",uy);var dy=function(e,t){this.anchor=e,this.head=t};dy.prototype.map=function(e){return new dy(e.map(this.anchor),e.map(this.head))},dy.prototype.resolve=function(e){return uy.between(e.resolve(this.anchor),e.resolve(this.head))};var _y=function(e){function t(t){var i=t.nodeAfter,a=t.node(0).resolve(t.pos+i.nodeSize);e.call(this,t,a),this.node=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,a){var n=a.mapResult(this.anchor),r=n.deleted,o=n.pos,s=i.resolve(o);return r?e.near(s):new t(s)},t.prototype.content=function(){return new jb(Ab.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 cy(this.anchor)},t.fromJSON=function(e,i){if("number"!=typeof i.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(i.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(oy);_y.prototype.visible=!1,oy.jsonID("node",_y);var cy=function(e){this.anchor=e};cy.prototype.map=function(e){var t=e.mapResult(this.anchor),i=t.deleted,a=t.pos;return i?new dy(a,a):new cy(a)},cy.prototype.resolve=function(e){var t=e.resolve(this.anchor),i=t.nodeAfter;return i&&_y.isSelectable(i)?new _y(t):oy.near(t)};var gy=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,i){if(void 0===i&&(i=jb.empty),i==jb.empty){t.delete(0,t.doc.content.size);var a=e.atStart(t.doc);a.eq(t.selection)||t.setSelection(a)}else e.prototype.replace.call(this,t,i)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return fy},t}(oy);oy.jsonID("all",gy);var fy={map:function(){return this},resolve:function(e){return new gy(e)}};function hy(e,t,i,a,n,r){if(t.inlineContent)return uy.create(e,i);for(var o=a-(n>0?0:1);n>0?o<t.childCount:o>=0;o+=n){var s=t.child(o);if(s.isAtom){if(!r&&_y.isSelectable(s))return _y.create(e,i-(n<0?s.nodeSize:0))}else{var l=hy(e,s,i+n,n<0?s.childCount:0,n,r);if(l)return l}i+=s.nodeSize*n}}function py(e,t,i){var a=e.steps.length-1;if(!(a<t)){var n,r=e.steps[a];if(r instanceof GE||r instanceof HE)e.mapping.maps[a].forEach((function(e,t,i,a){null==n&&(n=a)})),e.setSelection(oy.near(e.doc.resolve(n),i))}}var my=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return i.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},t.prototype.setSelection=function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},i.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return Lb.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},i.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,i){e.prototype.addStep.call(this,t,i),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var i=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||Lb.none))),i.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,i){void 0===i&&(i=t);var a=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(a.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,i);var n=this.storedMarks;if(!n){var r=this.doc.resolve(t);n=i==t?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(t,i,a.text(e,n)),this.selection.empty||this.setSelection(oy.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},i.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},i.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,i),t}(LE);function Fy(e,t){return t&&e?e.bind(t):e}var by=function(e,t,i){this.name=e,this.init=Fy(t.init,i),this.apply=Fy(t.apply,i)},Ey=[new by("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new by("selection",{init:function(e,t){return e.selection||oy.atStart(t.doc)},apply:function(e){return e.selection}}),new by("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,i,a){return a.selection.$cursor?e.storedMarks:null}}),new by("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],yy=function(e,t){var i=this;this.schema=e,this.fields=Ey.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(i.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");i.plugins.push(e),i.pluginsByKey[e.key]=e,e.spec.state&&i.fields.push(new by(e.key,e.spec.state,e))}))},Dy=function(e){this.config=e},vy={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};vy.schema.get=function(){return this.config.schema},vy.plugins.get=function(){return this.config.plugins},Dy.prototype.apply=function(e){return this.applyTransaction(e).state},Dy.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var i=0;i<this.config.plugins.length;i++)if(i!=t){var a=this.config.plugins[i];if(a.spec.filterTransaction&&!a.spec.filterTransaction.call(a,e,this))return!1}return!0},Dy.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],i=this.applyInner(e),a=null;;){for(var n=!1,r=0;r<this.config.plugins.length;r++){var o=this.config.plugins[r];if(o.spec.appendTransaction){var s=a?a[r].n:0,l=a?a[r].state:this,u=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,l,i);if(u&&i.filterTransaction(u,r)){if(u.setMeta("appendedTransaction",e),!a){a=[];for(var d=0;d<this.config.plugins.length;d++)a.push(d<r?{state:i,n:t.length}:{state:this,n:0})}t.push(u),i=i.applyInner(u),n=!0}a&&(a[r]={state:i,n:t.length})}}if(!n)return{state:i,transactions:t}}},Dy.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new Dy(this.config),i=this.config.fields,a=0;a<i.length;a++){var n=i[a];t[n.name]=n.apply(e,this[n.name],this,t)}for(var r=0;r<ky.length;r++)ky[r](this,e,t);return t},vy.tr.get=function(){return new my(this)},Dy.create=function(e){for(var t=new yy(e.doc?e.doc.type.schema:e.schema,e.plugins),i=new Dy(t),a=0;a<t.fields.length;a++)i[t.fields[a].name]=t.fields[a].init(e,i);return i},Dy.prototype.reconfigure=function(e){for(var t=new yy(this.schema,e.plugins),i=t.fields,a=new Dy(t),n=0;n<i.length;n++){var r=i[n].name;a[r]=this.hasOwnProperty(r)?this[r]:i[n].init(e,a)}return a},Dy.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var i in e){if("doc"==i||"selection"==i)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var a=e[i],n=a.spec.state;n&&n.toJSON&&(t[i]=n.toJSON.call(a,this[a.key]))}return t},Dy.fromJSON=function(e,t,i){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var a=new yy(e.schema,e.plugins),n=new Dy(a);return a.fields.forEach((function(a){if("doc"==a.name)n.doc=iE.fromJSON(e.schema,t.doc);else if("selection"==a.name)n.selection=oy.fromJSON(n.doc,t.selection);else if("storedMarks"==a.name)t.storedMarks&&(n.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(i)for(var r in i){var o=i[r],s=o.spec.state;if(o.key==a.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(n[a.name]=s.fromJSON.call(o,e,t[r],n))}n[a.name]=a.init(e,n)}})),n},Dy.addApplyListener=function(e){ky.push(e)},Dy.removeApplyListener=function(e){var t=ky.indexOf(e);t>-1&&ky.splice(t,1)},Object.defineProperties(Dy.prototype,vy);var ky=[];var Sy=function(e){this.props={},e.props&&function e(t,i,a){for(var n in t){var r=t[n];r instanceof Function?r=r.bind(i):"handleDOMEvents"==n&&(r=e(r,i,{})),a[n]=r}return a}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:Cy("plugin")};Sy.prototype.getState=function(e){return e[this.key]};var wy=Object.create(null);function Cy(e){return e in wy?e+"$"+ ++wy[e]:(wy[e]=0,e+"$")}var xy=function(e){void 0===e&&(e="key"),this.key=Cy(e)};xy.prototype.get=function(e){return e.config.pluginsByKey[this.key]},xy.prototype.getState=function(e){return e[this.key]};const Ty=mr.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter(e=>""!==e).length}},addProseMirrorPlugins(){return[new Sy({key:new xy("characterCount"),filterTransaction:(e,t)=>{const i=this.options.limit;if(!e.docChanged||0===i||null==i)return!0;const a=this.storage.characters({node:t.doc}),n=this.storage.characters({node:e.doc});if(n<=i)return!0;if(a>i&&n>i&&n<=a)return!0;if(a>i&&n>i&&n>a)return!1;if(!e.getMeta("paste"))return!1;const r=e.selection.$head.pos,o=r-(n-i),s=r;e.deleteRange(o,s);return!(this.storage.characters({node:e.doc})>i)}})]}});var Oy=i(52);const Ny=gs.create({name:"link",priority:1e3,inclusive:!1,addOptions:()=>({openOnClick:!0,linkOnPaste:!0,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target}}},parseHTML:()=>[{tag:"a[href]"}],renderHTML({HTMLAttributes:e}){return["a",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setLink:e=>({commands:t})=>t.setMark("link",e),toggleLink:e=>({commands:t})=>t.toggleMark("link",e,{extendEmptyMarkRange:!0}),unsetLink:()=>({commands:e})=>e.unsetMark("link",{extendEmptyMarkRange:!0})}),addPasteRules(){return[Es({find:e=>Object(Oy.find)(e).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.openOnClick&&e.push(new Rt({key:new Bt("handleClickLink"),props:{handleClick:(e,t,i)=>{var a;const n=this.editor.getAttributes("link");return!(!(null===(a=i.target)||void 0===a?void 0:a.closest("a"))||!n.href)&&(window.open(n.href,n.target),!0)}}})),this.options.linkOnPaste&&e.push(new Rt({key:new Bt("handlePasteLink"),props:{handlePaste:(e,t,i)=>{const{state:a}=e,{selection:n}=a,{empty:r}=n;if(r)return!1;let o="";i.content.forEach(e=>{o+=e.textContent});const s=Object(Oy.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),Ay=gs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",ns(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const i=po(e,this.type);return!!Object.entries(i).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),Ry=mr.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>e.style.color.replace(/['"]+/g,""),renderHTML:e=>e.color?{style:"color: "+e.color}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})});var My=cs.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Rt({key:new Bt("eventHandler"),props:{handleClick:function(t,i){var a=t.state,n=a.doc.lastChild,r=a.doc.resolve(i).nodeBefore;if(n&&r){var o=n.eq(r),s=n.isInline,l=["paragraph","text"].includes(n.type.name);!o||s||l||e.commands.insertContentAt(i,{type:"paragraph",content:""})}}}})]}}),Iy=VF.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",ns(this.options.HTMLAttributes,t),0]}});const By=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,Ly=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",ns(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[fs({find:By,type:this.type,getAttributes:e=>{const[,,t,i,a]=e;return{src:i,alt:t,title:a}}})]}});function Py(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function jy(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Py(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Py(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var qy=Ly.extend({name:"image",addAttributes:function(){return jy(jy({},Ly.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1},align:{default:"center",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(i){var a,n,r,o=i.tr,s=i.commands;return"image"==(null===(a=o.selection)||void 0===a||null===(n=a.node)||void 0===n||null===(r=n.type)||void 0===r?void 0:r.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}},setImageAttributes:function(t){return function(i){var a=i.tr,n=a.selection,r=jy(jy({},n.node.attrs),t),o=e.type.create(r);a.replaceRangeWith(n.from,n.to,o)}}}},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes,a=i.src,n=i.alt,r="large"===t.attrs.size?"image-banner":"";return i.class=" image-size-"+t.attrs.size,i.class+=" image-float-"+t.attrs.float,i.class+=" image-align-"+t.attrs.align,delete i.src,delete i.alt,["figure",ns(this.options.HTMLAttributes,i),["img",{src:a,class:r}],["figcaption",n||""]]}});const Uy=gs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setUnderline:()=>({commands:e})=>e.setMark("underline"),toggleUnderline:()=>({commands:e})=>e.toggleMark("underline"),unsetUnderline:()=>({commands:e})=>e.unsetMark("underline")}),addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});const zy=new Bt("suggestion");function Gy({pluginKey:e=zy,editor:t,char:i="@",allowSpaces:a=!1,prefixSpace:n=!0,startOfLine:r=!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 Rt({key:e,view(){return{update:async(e,i)=>{var a,n,r,o,s;const d=null===(a=this.key)||void 0===a?void 0:a.getState(i),_=null===(n=this.key)||void 0===n?void 0:n.getState(e.state),g=d.active&&_.active&&d.range.from!==_.range.from,f=!d.active&&_.active,h=d.active&&!_.active,p=f||g,m=!f&&!h&&d.query!==_.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?d:_,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from: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:i,prefixSpace:a,startOfLine:n,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=n?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=r.depth<=0?0:r.before(),_=r.pos,c=r.doc.textBetween(d,_,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(a&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:a,prefixSpace:n,startOfLine:r,$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 i;const{active:a,range:n}=this.getState(e.state);return a&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:n}))||!1},decorations(e){const{active:t,range:i,decorationId:a}=this.getState(e);return t?Mn.create(e.doc,[On.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":a})]):null}}})}var Hy=function(e){var t=e.wrapperRef,i=e.index;if(t.current&&!(i>=t.current.children.length)){var a=t.current,n=a.children[i],r=n.clientHeight+8,o=a.scrollTop;n.offsetTop+r>o+a.clientHeight?o=n.offsetTop-a.clientHeight+r:o>n.offsetTop&&(o=n.offsetTop-8),t.current.scrollTop=o}};function Yy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=oh()(e);if(t){var n=oh()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return nh()(this,i)}}var Wy=function(e){ih()(i,e);var t=Yy(i);function i(e){var a;return Qf()(this,i),a=t.call(this,e),_()(eh()(a),"keydownHandler",(function(e){var t={Enter:a.enterHandler,ArrowUp:a.upHandler,ArrowDown:a.downHandler,ArrowLeft:a.leftArrowHandler,ArrowRight:a.rightArrowHandler};e.key in t&&t[e.key](e)})),_()(eh()(a),"selectItem",(function(e){var t=a.props,i=t.items,n=t.editor,r=t.range,o=i[e],s=o&&o.command,l=fd(o.items);s&&l&&o.command({editor:n,range:r})})),_()(eh()(a),"upHandler",(function(){var e=a.props.items,t=a.state.selectedIndex;a.setState({selectedIndex:(t+e.length-1)%e.length})})),_()(eh()(a),"downHandler",(function(){var e=a.props.items,t=a.state.selectedIndex;a.setState({selectedIndex:(t+1)%e.length})})),_()(eh()(a),"enterHandler",(function(){var e=a.state.selectedIndex;a.selectItem(e)})),_()(eh()(a),"leftArrowHandler",(function(){var e=a.props,t=e.menuIndex,i=e.setActiveMenuIndex;t>0&&i(t-1)})),_()(eh()(a),"rightArrowHandler",(function(){var e=a.props,t=e.menuIndex,i=e.setActiveMenuIndex,n=e.items[a.state.selectedIndex];n&&!fd(n.items)&&i(t+1)})),a.state={selectedIndex:0},a.menuRef=m.a.createRef(),a}return Xf()(i,[{key:"componentDidMount",value:function(){var e=this.props;e.menuIndex===e.activeMenuIndex&&document.addEventListener("keydown",this.keydownHandler)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.keydownHandler)}},{key:"componentDidUpdate",value:function(e){var t=this.props,i=t.items,a=t.menuIndex===t.activeMenuIndex;i!==e.items&&this.setState({selectedIndex:0}),Hy({wrapperRef:this.menuRef,index:this.state.selectedIndex}),a?document.addEventListener("keydown",this.keydownHandler):document.removeEventListener("keydown",this.keydownHandler)}},{key:"render",value:function(){var e=this,t=this.props,a=t.items,n=t.menuIndex,r=t.activeMenuIndex,o=this.state.selectedIndex,s=n===r;return m.a.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},a.map((function(t,a){var r=fd(t.items),l=m.a.createElement(Vy,{key:t.title,item:t,index:a,selectedIndex:s?o:-1,selectItem:function(){return r&&e.selectItem(a)},onHover:function(){return e.setState({selectedIndex:a})}});return r?l:m.a.createElement(jc,{key:t.title,interactive:!0,placement:"right",content:m.a.createElement(i,u()({},e.props,{items:t.items,menuIndex:n+1})),onCreate:function(e){return e.popper.style.width="max-content"},visible:o===a,onShow:function(){e.isSubmenuOpened=!0},onHide:function(){e.isSubmenuOpened=!1}},l)})))}}]),i}(m.a.Component),Vy=Object(p.forwardRef)((function(e,t){var i=e.item,a=e.selectedIndex,n=e.index,r=e.selectItem,o=e.onHover,s=i.Icon;return m.a.createElement("div",{className:b()("neeto-editor-slash-commands__item",{active:n===a}),onClick:r,ref:t,"data-cy":"neeto-editor-command-list-item-".concat(n),onMouseEnter:o},s&&m.a.createElement(s,{size:20}),m.a.createElement("div",{className:"neeto-editor-slash-commands__item-content"},m.a.createElement("h5",null,i.title),m.a.createElement("p",null,i.description)))})),$y=Wy;function Ky(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=oh()(e);if(t){var n=oh()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return nh()(this,i)}}var Qy=function(e){ih()(i,e);var t=Ky(i);function i(){var e;Qf()(this,i);for(var a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return e=t.call.apply(t,[this].concat(n)),_()(eh()(e),"state",{activeMenuIndex:0}),_()(eh()(e),"onKeyDown",(function(e){var t=e.event;return["Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)})),_()(eh()(e),"setActiveMenuIndex",(function(t){return e.setState({activeMenuIndex:t})})),e}return Xf()(i,[{key:"render",value:function(){return m.a.createElement($y,u()({},this.props,{menuIndex:0,activeMenuIndex:this.state.activeMenuIndex,setActiveMenuIndex:this.setActiveMenuIndex}))}}]),i}(m.a.Component),Zy=["size","color","strokeWidth"];function Xy(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Zy);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M13 4.5H20M13 9.5H20M4 14.5H20M4 19.5H20M9 9.5L6.5 4.5L4 9.5M4.5 8.5H6.5H8.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Xy.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Xy.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var Jy=["size","color","strokeWidth"];function eD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,Jy);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M5 6V18M13 6V18M5 12H13M18.5 18V13L17.25 14.25M20 18H17",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}eD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},eD.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var tD=["size","color","strokeWidth"];function iD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,tD);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M17 14C17 13.7348 17.1054 13.4804 17.2929 13.2929C17.4804 13.1054 17.7348 13 18 13H18.6145C18.8723 13 19.1237 13.0811 19.3329 13.2319C19.542 13.3827 19.6985 13.5955 19.78 13.8401C19.8471 14.0414 19.8609 14.2566 19.8202 14.4648C19.7794 14.673 19.6854 14.8671 19.5473 15.0281L17 18H20M5 6V18M13 6V18M5 12H13",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}iD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},iD.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var aD=["size","color","strokeWidth"];function nD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,aD);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M20.667 20.125H3.33301M20.667 14.708H3.33301M20.667 9.292H16.334M20.667 3.875H16.334M9.29201 6.042H12C12.299 6.042 12.542 6.285 12.542 6.584V8.75C12.542 9.049 12.299 9.292 12 9.292H9.83301C9.53401 9.292 9.29101 9.049 9.29101 8.75L9.29201 6.042ZM9.29201 6.042C9.29201 3.875 9.69801 3.515 10.917 2.792M3.33301 6.042H6.04101C6.34001 6.042 6.58301 6.285 6.58301 6.584V8.75C6.58301 9.049 6.34001 9.292 6.04101 9.292H3.87501C3.57601 9.292 3.33301 9.049 3.33301 8.75V6.042ZM3.33301 6.042C3.33301 3.875 3.73901 3.515 4.95801 2.792",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}nD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},nD.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var rD=["size","color","strokeWidth"];function oD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,rD);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M17 12H7",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}oD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},oD.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var sD=["size","color","strokeWidth"];function lD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=Hd(e,sD);return C_.createElement("svg",Gd({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),C_.createElement("path",{d:"M15.375 13.097L19.17 16.151C19.906 16.744 21 16.22 21 15.275V8.725C21 7.78 19.906 7.256 19.17 7.849L15.375 10.903M13.125 17.75H5.25C4.007 17.75 3 16.743 3 15.5V8.5C3 7.257 4.007 6.25 5.25 6.25H13.125C14.368 6.25 15.375 7.257 15.375 8.5V15.5C15.375 16.743 14.368 17.75 13.125 17.75Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}lD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},lD.propTypes={color:tc.string,size:tc.oneOfType([tc.string,tc.number]),strokeWidth:tc.oneOfType([tc.string,tc.number])};var uD={PARAGRAPH:{optionName:km.FONT_SIZE,title:"Paragraph",description:"Add a plain text block.",Icon:Xy,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("paragraph").run()}},H1:{optionName:km.FONT_SIZE,title:"H1",description:"Add a big heading.",Icon:eD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:1}).run()}},H2:{optionName:km.FONT_SIZE,title:"H2",description:"Add a sub-heading.",Icon:iD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:2}).run()}},LIST_ORDERED:{optionName:km.LIST_ORDERED,title:"Numbered list",description:"Add a list with numbering.",Icon:of,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleOrderedList().run()}},LIST_BULLETS:{optionName:km.LIST_BULLETS,title:"Bulleted list",description:"Add an list bullets.",Icon:nf,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBulletList().run()}},BLOCKQUOTE:{optionName:km.BLOCKQUOTE,title:"Blockquote",description:"Add a quote.",Icon:nD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBlockquote().run()}},IMAGE:{optionName:km.IMAGE_UPLOAD,title:"Image",description:"Add an image.",Icon:tf,command:function(e){var t=e.editor,i=e.range;return t.chain().focus().deleteRange(i).run()}},CODE:{optionName:km.CODE_BLOCK,title:"Code block",description:"Add a code block with syntax highlighting.",Icon:Og,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleCodeBlock().run()}},EMOJI:{optionName:km.EMOJI,title:"Emoji",description:"Add an emoji.",Icon:$f,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("::").run()}},DIVIDER:{optionName:km.DIVIDER,title:"Divider",description:"Add an horizontal line to separate sections.",Icon:oD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setHorizontalRule().run()}},VIDEO:{optionName:km.VIDEO_EMBED,title:"Embed Youtube/Vimeo",description:"Embed a video from major services.",Icon:lD,command:function(e){var t,i=e.editor,a=e.range,n=prompt("Please enter Youtube/Vimeo embed URL."),r=(t=n.match(Vg))&&"https://www.youtube.com/embed/".concat(t[5])||function(e){var t=e.match($g);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])}(n);r?i.chain().focus().deleteRange(a).setExternalVideo({src:r}).run():i.chain().focus().deleteRange(a).insertContent("#invalid").run()}},MENTION:{optionName:km.MENTION,title:"Mention",description:"Mention a user.",Icon:jf,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("@").run()}},NO_RESULT:{title:"No results",command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).run()}}};function dD(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function _D(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?dD(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dD(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var cD=new Bt("commands"),gD=function(e){var t=e.setImageUploadVisible,i=e.mentions,a=e.addonCommands,n=e.options,r=[uD.PARAGRAPH,uD.H1,uD.H2,uD.LIST_ORDERED,uD.LIST_BULLETS,uD.BLOCKQUOTE,_D(_D({},uD.IMAGE),{},{command:function(){var e;t(!0),(e=uD.IMAGE).command.apply(e,arguments)}}),uD.CODE,uD.EMOJI,uD.DIVIDER,uD.VIDEO];return fd(i)||r.push(uD.MENTION),fd(n)||(r=r.filter((function(e){var t=e.optionName;return n.includes(t)}))),fd(a)||(r=r.concat(a)),mr.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:cD,command:function(e){var t=e.editor,i=e.range;e.props.command({editor:t,range:i})},items:function(e){var t=e.query,i=r.filter((function(e){return e.title.toLowerCase().includes(t.toLowerCase())}));return fd(i)?[uD.NO_RESULT]:i},render:function(){var e,t;return{onStart:function(i){e=new Tu(Qy,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t&&t[0].destroy(),e&&e.destroy()}}}}}},addProseMirrorPlugins:function(){return[Gy(_D({editor:this.editor},this.options.suggestion))]}})},fD={};function hD(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var i=e[t];"object"!=typeof i||Object.isFrozen(i)||hD(i)})),e}var pD=hD,mD=hD;pD.default=mD;class FD{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function bD(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ED(e,...t){const i=Object.create(null);for(const t in e)i[t]=e[t];return t.forEach((function(e){for(const t in e)i[t]=e[t]})),i}const yD=e=>!!e.kind;class DD{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=bD(e)}openNode(e){if(!yD(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){yD(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class vD{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=>{vD._collapse(e)}))}}class kD extends vD{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const i=e.root;i.kind=t,i.sublanguage=!0,this.add(i)}toHTML(){return new DD(this,this.options).value()}finalize(){return!0}}function SD(e){return e?"string"==typeof e?e:e.source:null}const wD=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const CD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",xD={begin:"\\\\[\\s\\S]",relevance:0},TD={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[xD]},OD={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[xD]},ND={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/},AD=function(e,t,i={}){const a=ED({className:"comment",begin:e,end:t,contains:[]},i);return a.contains.push(ND),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},RD=AD("//","$"),MD=AD("/\\*","\\*/"),ID=AD("#","$"),BD={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},LD={className:"number",begin:CD,relevance:0},PD={className:"number",begin:"\\b(0b[01]+)",relevance:0},jD={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},qD={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[xD,{begin:/\[/,end:/\]/,relevance:0,contains:[xD]}]}]},UD={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},zD={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},GD={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var HD=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:CD,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>SD(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),ED({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:xD,APOS_STRING_MODE:TD,QUOTE_STRING_MODE:OD,PHRASAL_WORDS_MODE:ND,COMMENT:AD,C_LINE_COMMENT_MODE:RD,C_BLOCK_COMMENT_MODE:MD,HASH_COMMENT_MODE:ID,NUMBER_MODE:BD,C_NUMBER_MODE:LD,BINARY_NUMBER_MODE:PD,CSS_NUMBER_MODE:jD,REGEXP_MODE:qD,TITLE_MODE:UD,UNDERSCORE_TITLE_MODE:zD,METHOD_GUARD:GD,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 YD(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function WD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=YD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function VD(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>SD(e)).join("|")+")"}(...e.illegal))}function $D(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 KD(e,t){void 0===e.relevance&&(e.relevance=1)}const QD=["of","and","for","in","not","or","if","then","parent","list","value"];function ZD(e,t){return t?Number(t):function(e){return QD.includes(e.toLowerCase())}(e)?0:1}function XD(e,{plugins:t}){function i(t,i){return new RegExp(SD(t),"m"+(e.case_insensitive?"i":"")+(i?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=i(function(e,t="|"){let i=0;return e.map(e=>{i+=1;const t=i;let a=SD(e),n="";for(;a.length>0;){const e=wD.exec(a);if(!e){n+=a;break}n+=a.substring(0,e.index),a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?n+="\\"+String(Number(e[1])+t):(n+=e[0],"("===e[0]&&i++)}return n}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex((e,t)=>t>0&&void 0!==e),a=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,a)}}class n{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 a;return this.rules.slice(e).forEach(([e,i])=>t.addRule(e,i)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=ED(e.classNameAliases||{}),function t(a,r){const o=a;if(a.isCompiled)return o;[$D].forEach(e=>e(a,r)),e.compilerExtensions.forEach(e=>e(a,r)),a.__beforeBegin=null,[WD,VD,KD].forEach(e=>e(a,r)),a.isCompiled=!0;let s=null;if("object"==typeof a.keywords&&(s=a.keywords.$pattern,delete a.keywords.$pattern),a.keywords&&(a.keywords=function e(t,i,a="keyword"){const n={};return"string"==typeof t?r(a,t.split(" ")):Array.isArray(t)?r(a,t):Object.keys(t).forEach((function(a){Object.assign(n,e(t[a],i,a))})),n;function r(e,t){i&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const i=t.split("|");n[i[0]]=[e,ZD(i[0],i[1])]}))}}(a.keywords,e.case_insensitive)),a.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||a.lexemes||/\w+/,o.keywordPatternRe=i(s,!0),r&&(a.begin||(a.begin=/\B|\b/),o.beginRe=i(a.begin),a.endSameAsBegin&&(a.end=a.begin),a.end||a.endsWithParent||(a.end=/\B|\b/),a.end&&(o.endRe=i(a.end)),o.terminatorEnd=SD(a.end)||"",a.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(a.end?"|":"")+r.terminatorEnd)),a.illegal&&(o.illegalRe=i(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return ED(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return ED(e,{starts:e.starts?ED(e.starts):null});if(Object.isFrozen(e))return ED(e);return e}("self"===e?a:e)}))),a.contains.forEach((function(e){t(e,o)})),a.starts&&t(a.starts,r),o.matcher=function(e){const t=new n;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 JD(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,bD(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 ev={"after:highlightElement":({el:e,result:t,text:i})=>{const a=iv(e);if(!a.length)return;const n=document.createElement("div");n.innerHTML=t.value,t.value=function(e,t,i){let a=0,n="";const r=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){n+="<"+tv(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+bD(e.value)+'"'})).join("")+">"}function l(e){n+="</"+tv(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(n+=bD(i.substring(a,t[0].offset)),a=t[0].offset,t===e){r.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===a);r.reverse().forEach(s)}else"start"===t[0].event?r.push(t[0].node):r.pop(),u(t.splice(0,1)[0])}return n+bD(i.substr(a))}(a,iv(n),i)}};function tv(e){return e.nodeName.toLowerCase()}function iv(e){const t=[];return function e(i,a){for(let n=i.firstChild;n;n=n.nextSibling)3===n.nodeType?a+=n.nodeValue.length:1===n.nodeType&&(t.push({event:"start",offset:a,node:n}),a=e(n,a),tv(n).match(/br|hr|img|input/)||t.push({event:"stop",offset:a,node:n}));return a}(e,0),t}const av={},nv=e=>{console.error(e)},rv=(e,...t)=>{console.log("WARN: "+e,...t)},ov=(e,t)=>{av[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),av[`${e}/${t}`]=!0)},sv=bD,lv=ED,uv=Symbol("nomatch");var dv=function(e){const t=Object.create(null),i=Object.create(null),a=[];let n=!0;const r=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:kD};function u(e){return l.noHighlightRe.test(e)}function d(e,t,i,a){let n="",r="";"object"==typeof t?(n=e,i=t.ignoreIllegals,r=t.language,a=void 0):(ov("10.7.0","highlight(lang, code, ...args) has been deprecated."),ov("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,n=t);const o={code:n,language:r};v("before:highlight",o);const s=o.result?o.result:_(o.language,o.code,i,a);return s.code=o.code,v("after:highlight",s),s}function _(e,i,r,s){function u(e,t){const i=b.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,i)&&e.keywords[i]}function d(){null!=v.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof v.subLanguage){if(!t[v.subLanguage])return void S.addText(w);e=_(v.subLanguage,w,!0,k[v.subLanguage]),k[v.subLanguage]=e.top}else e=c(w,v.subLanguage.length?v.subLanguage:null);v.relevance>0&&(C+=e.relevance),S.addSublanguage(e.emitter,e.language)}():function(){if(!v.keywords)return void S.addText(w);let e=0;v.keywordPatternRe.lastIndex=0;let t=v.keywordPatternRe.exec(w),i="";for(;t;){i+=w.substring(e,t.index);const a=u(v,t);if(a){const[e,n]=a;if(S.addText(i),i="",C+=n,e.startsWith("_"))i+=t[0];else{const i=b.classNameAliases[e]||e;S.addKeyword(t[0],i)}}else i+=t[0];e=v.keywordPatternRe.lastIndex,t=v.keywordPatternRe.exec(w)}i+=w.substr(e),S.addText(i)}(),w=""}function g(e){return e.className&&S.openNode(b.classNameAliases[e.className]||e.className),v=Object.create(e,{parent:{value:v}}),v}function f(e){return 0===v.matcher.regexIndex?(w+=e[0],1):(O=!0,0)}function h(e){const t=e[0],i=e.rule,a=new FD(i),n=[i.__beforeBegin,i["on:begin"]];for(const i of n)if(i&&(i(e,a),a.isMatchIgnored))return f(t);return i&&i.endSameAsBegin&&(i.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),i.skip?w+=t:(i.excludeBegin&&(w+=t),d(),i.returnBegin||i.excludeBegin||(w=t)),g(i),i.returnBegin?0:t.length}function p(e){const t=e[0],a=i.substr(e.index),n=function e(t,i,a){let n=function(e,t){const i=e&&e.exec(t);return i&&0===i.index}(t.endRe,a);if(n){if(t["on:end"]){const e=new FD(t);t["on:end"](i,e),e.isMatchIgnored&&(n=!1)}if(n){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,i,a)}(v,e,a);if(!n)return uv;const r=v;r.skip?w+=t:(r.returnEnd||r.excludeEnd||(w+=t),d(),r.excludeEnd&&(w=t));do{v.className&&S.closeNode(),v.skip||v.subLanguage||(C+=v.relevance),v=v.parent}while(v!==n.parent);return n.starts&&(n.endSameAsBegin&&(n.starts.endRe=n.endRe),g(n.starts)),r.returnEnd?0:t.length}let m={};function F(t,a){const o=a&&a[0];if(w+=t,null==o)return d(),0;if("begin"===m.type&&"end"===a.type&&m.index===a.index&&""===o){if(w+=i.slice(a.index,a.index+1),!n){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=a,"begin"===a.type)return h(a);if("illegal"===a.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(v.className||"<unnamed>")+'"');throw e.mode=v,e}if("end"===a.type){const e=p(a);if(e!==uv)return e}if("illegal"===a.type&&""===o)return 1;if(T>1e5&&T>3*a.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=E(e);if(!b)throw nv(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const y=XD(b,{plugins:a});let D="",v=s||y;const k={},S=new l.__emitter(l);!function(){const e=[];for(let t=v;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>S.openNode(e))}();let w="",C=0,x=0,T=0,O=!1;try{for(v.matcher.considerAll();;){T++,O?O=!1:v.matcher.considerAll(),v.matcher.lastIndex=x;const e=v.matcher.exec(i);if(!e)break;const t=F(i.substring(x,e.index),e);x=e.index+t}return F(i.substr(x)),S.closeAllNodes(),S.finalize(),D=S.toHTML(),{relevance:Math.floor(C),value:D,language:e,illegal:!1,emitter:S,top:v}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:i.slice(x-100,x+100),mode:t.mode},sofar:D,relevance:0,value:sv(i),emitter:S};if(n)return{illegal:!1,relevance:0,value:sv(i),emitter:S,language:e,top:v,errorRaised:t};throw t}}function c(e,i){i=i||l.languages||Object.keys(t);const a=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:sv(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),n=i.filter(E).filter(D).map(t=>_(t,e,!1));n.unshift(a);const r=n.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(E(e.language).supersetOf===t.language)return 1;if(E(t.language).supersetOf===e.language)return-1}return 0}),[o,u]=r,d=o;return d.second_best=u,d}const g={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},f=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(f,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const a=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=l.languageDetectRe.exec(t);if(i){const t=E(i[1]);return t||(rv(o.replace("{}",i[1])),rv("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||E(e))}(e);if(u(a))return;v("before:highlightElement",{el:e,language:a}),t=e;const n=t.textContent,r=a?d(n,{language:a,ignoreIllegals:!0}):c(n);v("after:highlightElement",{el:e,result:r,text:n}),e.innerHTML=r.value,function(e,t,a){const n=t?i[t]:a;e.classList.add("hljs"),n&&e.classList.add(n)}(e,a,r.language),e.result={language:r.language,re:r.relevance,relavance:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance,relavance:r.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,ov("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(p)};let F=!1;function b(){if("loading"===document.readyState)return void(F=!0);document.querySelectorAll("pre code").forEach(p)}function E(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function y(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function D(e){const t=E(e);return t&&!t.disableAutodetect}function v(e,t){const i=e;a.forEach((function(e){e[i]&&e[i](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 ov("10.2.0","fixMarkup will be removed entirely in v11.0"),ov("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(r,e=>"\n"===e?l.useBR?"<br>":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:p,highlightBlock:function(e){return ov("10.7.0","highlightBlock will be removed entirely in v12.0"),ov("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(ov("10.3.0","'useBR' will be removed entirely in v11.0"),ov("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=lv(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){ov("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(i,a){let r=null;try{r=a(e)}catch(e){if(nv("Language definition for '{}' could not be registered.".replace("{}",i)),!n)throw e;nv(e),r=s}r.name||(r.name=i),t[i]=r,r.rawDefinition=a.bind(null,e),r.aliases&&y(r.aliases,{languageName:i})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(i))i[t]===e&&delete i[t]},listLanguages:function(){return Object.keys(t)},getLanguage:E,registerAliases:y,requireLanguage:function(e){ov("10.4.0","requireLanguage will be removed entirely in v11."),ov("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=E(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:D,inherit:lv,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),a.push(e)},vuePlugin:JD(e).VuePlugin}),e.debugMode=function(){n=!1},e.safeMode=function(){n=!0},e.versionString="10.7.3";for(const e in HD)"object"==typeof HD[e]&&pD(HD[e]);return Object.assign(e,HD),e.addPlugin(g),e.addPlugin(ev),e.addPlugin(h),e}({}),_v={exports:{}};!function(e){!function(){var t;function i(e){for(var t,i,a,n,r=1,o=[].slice.call(arguments),s=0,l=e.length,u="",d=!1,_=!1,c=function(){return o[r++]},g=function(){for(var i="";/\d/.test(e[s]);)i+=e[s++],t=e[s];return i.length>0?parseInt(i):null};s<l;++s)if(t=e[s],d)switch(d=!1,"."==t?(_=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(_=!0,t=e[s+=2]):_=!0,n=g(),t){case"b":u+=parseInt(c(),10).toString(2);break;case"c":u+="string"==typeof(i=c())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case"d":u+=parseInt(c(),10);break;case"f":a=String(parseFloat(c()).toFixed(n||6)),u+=_?a:a.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=i).format=i,t.vsprintf=function(e,t){return i.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(i.apply(null,arguments))})}()}(_v);var cv=_v.exports,gv=hv(Error),fv=gv;function hv(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=cv.apply(null,arguments)),new e(t)}}gv.eval=hv(EvalError),gv.range=hv(RangeError),gv.reference=hv(ReferenceError),gv.syntax=hv(SyntaxError),gv.type=hv(TypeError),gv.uri=hv(URIError),gv.create=hv;var pv=dv,mv=fv;fD.highlight=Fv,fD.highlightAuto=function(e,t){var i=t||{},a=i.subset||pv.listLanguages();i.prefix;var n,r,o,s,l=a.length,u=-1;if("string"!=typeof e)throw mv("Expected `string` for value, got `%s`",e);r={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};for(;++u<l;)s=a[u],pv.getLanguage(s)&&((o=Fv(s,e,t)).language=s,o.relevance>r.relevance&&(r=o),o.relevance>n.relevance&&(r=n,n=o));r.language&&(n.secondBest=r);return n},fD.registerLanguage=function(e,t){pv.registerLanguage(e,t)},fD.listLanguages=function(){return pv.listLanguages()},fD.registerAlias=function(e,t){var i,a=e;t&&((a={})[e]=t);for(i in a)pv.registerAliases(a[i],{languageName:i})},bv.prototype.addText=function(e){var t,i,a=this.stack;if(""===e)return;t=a[a.length-1],(i=t.children[t.children.length-1])&&"text"===i.type?i.value+=e:t.children.push({type:"text",value:e})},bv.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},bv.prototype.addSublanguage=function(e,t){var i=this.stack,a=i[i.length-1],n=e.rootNode.children,r=t?{type:"element",tagName:"span",properties:{className:[t]},children:n}:n;a.children=a.children.concat(r)},bv.prototype.openNode=function(e){var t=this.stack,i=this.options.classPrefix+e,a=t[t.length-1],n={type:"element",tagName:"span",properties:{className:[i]},children:[]};a.children.push(n),t.push(n)},bv.prototype.closeNode=function(){this.stack.pop()},bv.prototype.closeAllNodes=Ev,bv.prototype.finalize=Ev,bv.prototype.toHTML=function(){return""};function Fv(e,t,i){var a,n=pv.configure({}),r=(i||{}).prefix;if("string"!=typeof e)throw mv("Expected `string` for name, got `%s`",e);if(!pv.getLanguage(e))throw mv("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw mv("Expected `string` for value, got `%s`",t);if(null==r&&(r="hljs-"),pv.configure({__emitter:bv,classPrefix:r}),a=pv.highlight(t,{language:e,ignoreIllegals:!0}),pv.configure(n||{}),a.errorRaised)throw a.errorRaised;return{relevance:a.relevance,language:a.language,value:a.emitter.rootNode.children}}function bv(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function Ev(){}function yv(e){return e.value||e.children||[]}function Dv({doc:e,name:t,lowlight:i}){const a=[];return ys(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:n}=e.node.attrs,r=i.listLanguages();(function e(t,i=[]){return t.map(t=>{const a=[...i,...t.properties?t.properties.className:[]];return t.children?e(t.children,a):{text:t.value,classes:a}}).flat()})(n&&r.includes(n)?yv(i.highlight(n,e.node.textContent)):yv(i.highlightAuto(e.node.textContent))).forEach(e=>{const i=t+e.text.length;if(e.classes.length){const n=On.inline(t,i,{class:e.classes.join(" ")});a.push(n)}t=i})}),Mn.create(e,a)}function vv({name:e,lowlight:t}){return new Rt({key:new Bt("lowlight"),state:{init:(i,{doc:a})=>Dv({doc:a,name:e,lowlight:t}),apply:(i,a,n,r)=>{const o=n.selection.$head.parent.type.name,s=r.selection.$head.parent.type.name,l=ys(n.doc,t=>t.type.name===e),u=ys(r.doc,t=>t.type.name===e);return i.docChanged&&([o,s].includes(e)||u.length!==l.length||i.steps.some(e=>void 0!==e.from&&void 0!==e.to&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?Dv({doc:i.doc,name:e,lowlight:t}):a.map(i.mapping,i.doc)}},props:{decorations(e){return this.getState(e)}}})}const kv=IF.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:fD}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],vv({name:this.name,lowlight:this.options.lowlight})]}});function Sv(){return m.a.createElement(Lu,{"data-cy":"neeto-editor-code-block"},m.a.createElement("pre",null,m.a.createElement(Pu,{as:"code"})))}var wv=i(96),Cv=i.n(wv),xv=kv.extend({addNodeView:function(){return new Ru(Sv)}}).configure({lowlight:Cv.a}),Tv=function(e){var t=e.items,i=e.command;return m.a.createElement("div",{className:"neeto-editor-variables-suggestion"},m.a.createElement(Mf,{variables:t,onClickVariable:function(e){var t=e.category_key,a=e.key,n=t?"".concat(t,".").concat(a):a;i({label:n,id:n})}}))};function Ov(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Nv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ov(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ov(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Av=new Bt("variables"),Rv=cs.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel:function(e){var t=e.options,i=e.node;return"".concat(t.charOpen).concat(i.attrs.label||i.attrs.id).concat(t.charClose)},suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:function(e){return e.getAttribute("data-id")},renderHTML:function(e){return e.id?{"data-id":e.id}:{}}},label:{default:null,parseHTML:function(e){return e.getAttribute("data-label")},renderHTML:function(e){return e.label?{"data-label":e.label}:{}}}}},parseHTML:function(){return[{tag:"span[data-variable]"}]},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return["span",ns({"data-variable":""},this.options.HTMLAttributes,i),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addCommands:function(){var e=this;return{setVariable:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:t},{type:"text",text:" "}]).run()}}}},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var i=t.tr,a=t.state,n=!1,r=a.selection,o=r.empty,s=r.anchor;return!!o&&(a.doc.nodesBetween(s-1,s,(function(t,a){if(t.type.name===e.name)return n=!0,i.insertText("",a,a+t.nodeSize),!1})),n)}))}}},addProseMirrorPlugins:function(){return[Gy(Nv({editor:this.editor},this.options.suggestion))]}}),Mv={char:"{{",startOfLine:!1,pluginKey:Av,command:function(e){var t=e.editor,i=e.range,a=e.props;t.chain().focus().deleteRange(i).setVariable(a).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(Tv,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Iv=function(e){var t=e.suggestion,i=void 0===t?{}:t;return Rv.configure({suggestion:Nv(Nv({},Mv),i)})},Bv=i(33),Lv=i.n(Bv),Pv=i(97),jv=i.n(Pv),qv=function(e){var t=Lv()(e);return"string"===t||"funtion"===t?e:jv()(e)?function(t){var i=t.node.type.name;return e[i]}:""},Uv=mr.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Rt({props:{decorations:function(t){var i=t.doc,a=t.selection,n=e.editor.isEditable||!e.options.showOnlyWhenEditable,r=a.anchor,o=[];if(n)return i.descendants((function(t,i){var a=r>=i&&r<=i+t.nodeSize,n=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((a||!e.options.showOnlyCurrent)&&!s&&n){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=On.node(i,i+t.nodeSize,{class:l.join(" "),"data-placeholder":"function"==typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:i}):e.options.placeholder});o.push(u)}return e.options.includeChildren})),Mn.create(i,o)}}})]}});const zv=new Bt("suggestion");function Gv({pluginKey:e=zv,editor:t,char:i="@",allowSpaces:a=!1,prefixSpace:n=!0,startOfLine:r=!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 Rt({key:e,view(){return{update:async(e,i)=>{var a,n,r,o,s;const d=null===(a=this.key)||void 0===a?void 0:a.getState(i),_=null===(n=this.key)||void 0===n?void 0:n.getState(e.state),g=d.active&&_.active&&d.range.from!==_.range.from,f=!d.active&&_.active,h=d.active&&!_.active,p=f||g,m=!f&&!h&&d.query!==_.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?d:_,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from: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:i,prefixSpace:a,startOfLine:n,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=n?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=r.depth<=0?0:r.before(),_=r.pos,c=r.doc.textBetween(d,_,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(a&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:a,prefixSpace:n,startOfLine:r,$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 i;const{active:a,range:n}=this.getState(e.state);return a&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:n}))||!1},decorations(e){const{active:t,range:i,decorationId:a}=this.getState(e);return t?Mn.create(e.doc,[On.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":a})]):null}}})}const Hv=new Bt("mention"),Yv=cs.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var i;return`${e.suggestion.char}${null!==(i=t.attrs.label)&&void 0!==i?i:t.attrs.id}`},suggestion:{char:"@",pluginKey:Hv,command:({editor:e,range:t,props:i})=>{var a;const n=e.view.state.selection.$to.nodeAfter;(null===(a=null==n?void 0:n.text)||void 0===a?void 0:a.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:i},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const i=e.state.doc.resolve(t.from),a=e.schema.nodes[this.name];return!!i.parent.type.contentMatch.matchType(a)}}}},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",ns({"data-mention":""},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let i=!1;const{selection:a}=t,{empty:n,anchor:r}=a;return!!n&&(t.doc.nodesBetween(r-1,r,(t,a)=>{if(t.type.name===this.name)return i=!0,e.insertText(this.options.suggestion.char||"",a,a+t.nodeSize),!1}),i)})}},addProseMirrorPlugins(){return[Gv({editor:this.editor,...this.options.suggestion})]}});function Wv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=oh()(e);if(t){var n=oh()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return nh()(this,i)}}var Vv=function(e){ih()(i,e);var t=Wv(i);function i(e){var a;return Qf()(this,i),a=t.call(this,e),_()(eh()(a),"selectItem",(function(e){var t=a.props,i=t.items,n=t.command,r=i[e];r&&n({label:r.name,id:r.key})})),_()(eh()(a),"upHandler",(function(){var e=a.props.items;a.setState((function(t){return{selectedIndex:(t.selectedIndex+e.length-1)%e.length}}))})),_()(eh()(a),"downHandler",(function(){var e=a.props.items;a.setState((function(t){return{selectedIndex:(t.selectedIndex+1)%e.length}}))})),_()(eh()(a),"enterHandler",(function(){var e=a.state.selectedIndex;a.selectItem(e)})),_()(eh()(a),"onKeyDown",(function(e){var t=e.event,i={ArrowUp:a.upHandler,ArrowDown:a.downHandler,Enter:a.enterHandler};return!!i.hasOwnProperty(t.key)&&(i[t.key](),!0)})),a.state={selectedIndex:0},a.mentionRef=m.a.createRef(),a}return Xf()(i,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),Hy({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,i=this.props.items;return 0===i.length?m.a.createElement("div",{className:"neeto-editor-mentions__wrapper"},m.a.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):m.a.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},i.map((function(i,a){var n=i.key,r=i.name,o=i.imageUrl,s=i.showImage;return m.a.createElement("button",{className:b()("neeto-editor-mentions__item",{active:a===t}),key:n,onClick:function(){return e.selectItem(a)},type:"button","data-cy":"neeto-editor-mention-list-".concat(r)},s&&m.a.createElement(Hf,{user:{name:r,imageUrl:o}}),m.a.createElement("p",null,r))})))}}]),i}(m.a.Component);function $v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Kv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$v(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):$v(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Qv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.showImage,a=void 0!==i&&i,n=e.map((function(e,t){return Kv({showImage:a,key:"".concat(cd(e.name),"-").concat(t)},e)})).sort((function(e,t){return e.name.localeCompare(t.name)}));return function(e){var t=e.query;return n.filter((function(e){return e.name.toLowerCase().includes(t.toLowerCase())}))}},Zv=["suggestion"];function Xv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Jv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Xv(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Xv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var ek={render:function(){var e,t;return{onStart:function(i){e=new Tu(Vv,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(i){var a;return"Escape"===i.event.key?(t[0].hide(),!0):null===(a=e.ref)||void 0===a?void 0:a.onKeyDown(i)},onExit:function(){t[0].destroy(),e.destroy()}}}},tk=Yv.extend({addCommands:function(){var e=this;return{setMention:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:{id:t,label:t}},{type:"text",text:" "}]).run()}}}}}),ik=function(e){var t=e.suggestion,i=void 0===t?{}:t,a=h()(e,Zv);return tk.configure(Jv(Jv({},a),{},{suggestion:Jv(Jv({},ek),i)}))};function ak(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function nk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ak(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ak(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var rk=cs.create({name:"external-video",addOptions:function(){return{inline:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["iframe",ns(this.options.HTMLAttributes,nk(nk({},t),{},{class:"video-wrapper"}))]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(i){return i.commands.insertContent({type:e.name,attrs:t})}}}}});function ok(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=oh()(e);if(t){var n=oh()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return nh()(this,i)}}var sk=function(e){ih()(i,e);var t=ok(i);function i(){var e;Qf()(this,i);for(var a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return e=t.call.apply(t,[this].concat(n)),_()(eh()(e),"state",{selectedIndex:0,emojiSuggestions:Lh.search(e.props.query||"smile").slice(0,5)}),_()(eh()(e),"onKeyDown",(function(t){var i=t.event;if("ArrowLeft"===i.key||"ArrowDown"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===i.key||"ArrowUp"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===i.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===i.key){var a;if(fd(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(a=Lh.search(e.props.query))||void 0===a?void 0:a[0]).run();return!0}return"Escape"===i.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),_()(eh()(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return Xf()(i,[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:Lh.search(this.props.query||"smile").slice(0,5)})}},{key:"render",value:function(){var e=this;return m.a.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map((function(t,i){return m.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(i)},className:b()("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":i===e.state.selectedIndex}),"data-cy":"neeto-editor-emoji-suggestion-".concat(t.id)},t.native)})):m.a.createElement("p",null,"No results"))}}]),i}(m.a.Component);function lk(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function uk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?lk(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):lk(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var dk=new Bt("emoji-suggestion"),_k=cs.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:dk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(sk,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addCommands:function(){return{setEmoji:function(e){return function(t){(0,t.chain)().focus().insertContent("".concat((null==e?void 0:e.native)||""," ")).run()}}}},addProseMirrorPlugins:function(){return[Gy(uk({editor:this.editor},this.options.suggestion))]}});function ck(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function gk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ck(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ck(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var fk=new Bt("emoji-picker"),hk=cs.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:fk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(Up,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[Gy(gk({editor:this.editor},this.options.suggestion))]}});function pk(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}var mk=function(e){var t=e.handleSubmit,i=e.shortcuts;return mr.create({addKeyboardShortcuts:function(){var e=this;return function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?pk(Object(i),!0).forEach((function(t){_()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):pk(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({"Mod-Enter":function(){return null==t||t(e.editor.getHTML()),e.editor.commands.blur(),!0}},i)}})},Fk=function(e){var t=e.handleSubmit,i=e.shortcuts;return mk({handleSubmit:t,shortcuts:i})};const bk=Fs({find:/--$/,replace:"—"}),Ek=Fs({find:/\.\.\.$/,replace:"…"}),yk=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),Dk=Fs({find:/"$/,replace:"”"}),vk=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),kk=Fs({find:/'$/,replace:"’"}),Sk=Fs({find:/<-$/,replace:"←"}),wk=Fs({find:/->$/,replace:"→"}),Ck=Fs({find:/\(c\)$/,replace:"©"}),xk=Fs({find:/\(tm\)$/,replace:"™"}),Tk=Fs({find:/\(r\)$/,replace:"®"}),Ok=Fs({find:/1\/2$/,replace:"½"}),Nk=Fs({find:/\+\/-$/,replace:"±"}),Ak=Fs({find:/!=$/,replace:"≠"}),Rk=Fs({find:/<<$/,replace:"«"}),Mk=Fs({find:/>>$/,replace:"»"}),Ik=Fs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),Bk=Fs({find:/\^2$/,replace:"²"}),Lk=Fs({find:/\^3$/,replace:"³"}),Pk=Fs({find:/1\/4$/,replace:"¼"}),jk=Fs({find:/3\/4$/,replace:"¾"});var qk=mr.create({name:"typography",addInputRules(){const e=[];return!1!==this.options.emDash&&e.push(bk),!1!==this.options.ellipsis&&e.push(Ek),!1!==this.options.openDoubleQuote&&e.push(yk),!1!==this.options.closeDoubleQuote&&e.push(Dk),!1!==this.options.openSingleQuote&&e.push(vk),!1!==this.options.closeSingleQuote&&e.push(kk),!1!==this.options.leftArrow&&e.push(Sk),!1!==this.options.rightArrow&&e.push(wk),!1!==this.options.copyright&&e.push(Ck),!1!==this.options.trademark&&e.push(xk),!1!==this.options.registeredTrademark&&e.push(Tk),!1!==this.options.oneHalf&&e.push(Ok),!1!==this.options.plusMinus&&e.push(Nk),!1!==this.options.notEqual&&e.push(Ak),!1!==this.options.laquo&&e.push(Rk),!1!==this.options.raquo&&e.push(Mk),!1!==this.options.multiplication&&e.push(Ik),!1!==this.options.superscriptTwo&&e.push(Bk),!1!==this.options.superscriptThree&&e.push(Lk),!1!==this.options.oneQuarter&&e.push(Pk),!1!==this.options.threeQuarters&&e.push(jk),e}}).configure({emDash:!1,openDoubleQuote:!1,closeDoubleQuote:!1,openSingleQuote:!1,closeSingleQuote:!1});var Uk=[km.FONT_COLOR,km.FONT_SIZE,km.BOLD,km.ITALIC,km.UNDERLINE,km.STRIKETHROUGH,km.LINK,km.LIST_BULLETS,km.LIST_ORDERED],zk=function(e,t){var i=[];e.split(/\n/).forEach((function(e){var a={type:"paragraph"};e.length>0&&(a.content=[{type:"text",text:e}]);var n=W.fromJSON(t.doc.type.schema,a);i.push(n)}));var a=D.fromArray(i);return T.maxOpen(a)},Gk=["forceTitle","titleError","hideSlashCommands","addons","addonCommands","markdownMode","className","uploadEndpoint","uploadConfig","initialValue","onChange","onFocus","onBlur","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName","characterLimit","editorSecrets","rows","autoFocus","onSubmit","heightStrategy","characterCountStrategy","keyboardShortcuts"],Hk=function(e,t){var i=e.forceTitle,a=void 0!==i&&i,n=e.titleError,r=void 0!==n&&n,o=e.hideSlashCommands,s=void 0!==o&&o,l=e.addons,d=void 0===l?[]:l,c=e.addonCommands,f=e.markdownMode,F=void 0!==f&&f,E=e.className,y=e.uploadEndpoint,D=e.uploadConfig,v=void 0===D?{}:D,k=e.initialValue,S=void 0===k?"":k,w=e.onChange,C=void 0===w?function(){}:w,x=e.onFocus,T=void 0===x?function(){}:x,O=e.onBlur,N=void 0===O?function(){}:O,A=e.menuType,R=void 0===A?"fixed":A,M=e.variables,I=e.mentions,B=e.showImageInMention,L=void 0!==B&&B,P=e.placeholder,j=void 0===P?a?{title:"Untitled"}:null:P,q=e.extensions,U=e.contentClassName,z=e.characterLimit,G=e.editorSecrets,H=e.rows,Y=void 0===H?6:H,W=e.autoFocus,V=void 0!==W&&W,$=e.onSubmit,K=e.heightStrategy,Q=void 0===K?"fixed":K,Z=e.characterCountStrategy,X=void 0===Z?"hidden":Z,J=e.keyboardShortcuts,ee=void 0===J?[]:J,te=h()(e,Gk),ie=Object(p.useState)(!1),ae=g()(ie,2),ne=ae[0],re=ae[1],oe=!F&&"fixed"===R,se=!F&&"bubble"===R,le=!F&&!s,ue=function(e){if(e){if("string"==typeof e&&e.length)return!0;if("object"===Lv()(e)&&Object.keys(e).length)return!0;if("function"==typeof e)return!0}return!1}(j),de=!ue&&le,_e=d.includes("image-upload-unsplash"),ce=!F&&"hidden"!==X,ge=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=t.includeImageUpload,a=e.map((function(e){return e.toLowerCase()}));return i&&a.push(km.IMAGE_UPLOAD),[].concat(Uk,a)}(d,{includeImageUpload:_e}),fe=function(e){var t=e.forceTitle,i=e.placeholder,a=e.extensions,n=e.mentions,r=e.variables,o=e.isSlashCommandsActive,s=e.showImageInMention,l=e.setImageUploadVisible,u=e.options,d=e.addonCommands,_=e.characterLimit,c=e.onSubmit,g=e.keyboardShortcuts,f=[Iy,My.extend({content:t?"title block*":"block+"}),xb.configure({document:!1,codeBlock:!1}),Uy,qk,Ay,Nb,xv,qy,PF,rk,Ny,Ry,Uv.configure({placeholder:qv(i)}),_k,hk,Ty.configure({limit:_}),Fk({handleSubmit:c,shortcuts:g})];return o&&f.push(gD({setImageUploadVisible:l,options:u,addonCommands:d,mentions:n})),fd(n)||f.push(ik({suggestion:{items:Qv(n,{showImage:s})}})),fd(r)||f.push(Iv({suggestion:{items:function(){return r}}})),fd(a)||(f=f.concat(a)),f}({contentClassName:U,forceTitle:a,placeholder:j,extensions:q,mentions:I,variables:M,isSlashCommandsActive:le,showImageInMention:L,setImageUploadVisible:re,options:ge,addonCommands:c,characterLimit:z,keyboardShortcuts:ee,onSubmit:$}),he=b()("neeto-editor",_()({"slash-active":de,"fixed-menu-active border":oe,"bubble-menu-active":se,"force-title":a,"force-title--error":r,"placeholder-active":ue},E,E)),pe=function(e){var t=e.heightStrategy,i={},a=21*e.rows+26;return"flexible"===t?i["min-height"]=a+"px":i.height=a+"px",i}({heightStrategy:Q,rows:Y}),me=xu({extensions:fe,content:S,injectCSS:!1,autofocus:V&&"end",editorProps:{attributes:{class:he,style:gd(pe)},clipboardTextParser:zk},parseOptions:{preserveWhitespace:!0},onUpdate:function(e){var t=e.editor;return C(t.getHTML())},onFocus:T,onBlur:N}),Fe=EF({content:S,onUpdate:function(e){var t=e.html;return C(t)},onSubmit:function(e){var t=e.html;return $&&$(t)},markdownMode:F});return m.a.useImperativeHandle(t,(function(){return{editor:F?Fe:me}})),Object(p.useEffect)((function(){if(me){var e=F?me.getHTML():Fe.getHTML();(F?Fe.commands.setContent:me.commands.setContent)(e)}}),[F]),m.a.createElement("div",{className:"neeto-editor-wrapper"},oe&&m.a.createElement(Gp,{editor:me,variables:M,setImageUploadVisible:re,options:ge,mentions:I,showImageInMention:L}),se&&m.a.createElement(Zg,{editor:me,options:ge}),m.a.createElement(Tm,{isVisible:ne,setIsVisible:re,editor:me,imageUploadUrl:y,uploadConfig:v,isUnsplashImageUploadActive:_e,unsplashApiKey:null==G?void 0:G.unsplash}),F&&m.a.createElement(Im,u()({editor:Fe,strategy:Q,style:pe,limit:z,className:he,onFocus:T,onBlur:N},te)),m.a.createElement("div",{className:b()({"neeto-editor-content--hidden":F})},m.a.createElement(Bu,u()({editor:me},te))),ce&&m.a.createElement(Bm,{count:null==me?void 0:me.storage.characterCount.characters(),limit:z,strategy:X}))},Yk=m.a.forwardRef(Hk),Wk=i(98),Vk=i.n(Wk);var $k=["content","className"],Kk=function(e){var t=e.content,i=void 0===t?"":t,a=e.className,n=h()(e,$k);return Object(p.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){Vk.a.highlightElement(e)}))}),[i]),m.a.createElement("div",u()({className:b()("neeto-editor-content",_()({},a,a)),dangerouslySetInnerHTML:{__html:Pm.a.sanitize(i,{ADD_ATTR:["target"]})},"data-cy":"neeto-editor-content"},n))}}])}));