@bigbinary/neeto-editor 0.2.19 → 0.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -56,4 +56,4 @@ function y_(e,t){if(!e)throw new Error(t)}const E_=Object(l.createContext)(null)
|
|
|
56
56
|
* LICENSE.md file in the root directory of this source tree.
|
|
57
57
|
*
|
|
58
58
|
* @license MIT
|
|
59
|
-
*/;function M_(){return(M_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function R_(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}const I_=["onClick","reloadDocument","replace","state","target","to"],L_=["aria-current","caseSensitive","className","end","style","to"];const B_=Object(l.forwardRef)((function(e,t){let{onClick:i,reloadDocument:n,replace:a=!1,state:r,target:o,to:s}=e,u=R_(e,I_),d=D_(s),_=function(e,t){let{target:i,replace:n,state:a}=void 0===t?{}:t,r=S_(),o=w_(),s=O_(e);return Object(l.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=!!n||F_(o)===F_(s);r(e,{replace:i,state:a})}},[o,r,s,n,a,i,e])}(s,{replace:a,state:r,target:o});return Object(l.createElement)("a",M_({},u,{href:d,onClick:function(e){i&&i(e),e.defaultPrevented||n||_(e)},ref:t,target:o}))}));const P_=Object(l.forwardRef)((function(e,t){let{"aria-current":i="page",caseSensitive:n=!1,className:a="",end:r=!1,style:o,to:s}=e,u=R_(e,L_),d=w_(),_=O_(s),c=d.pathname,f=_.pathname;n||(c=c.toLowerCase(),f=f.toLowerCase());let g,h=c===f||!r&&c.startsWith(f)&&"/"===c.charAt(f.length),p=h?i:void 0;g="function"==typeof a?a({isActive:h}):[a,h?"active":null].filter(Boolean).join(" ");let m="function"==typeof o?o({isActive:h}):o;return Object(l.createElement)(B_,M_({},u,{"aria-current":p,className:g,ref:t,style:m,to:s}))}));var j_=["icon","iconPosition","iconSize","label","loading","onClick","to","type","style","fullWidth","className","disabled","size","href","tooltipProps"];function q_(){return(q_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function U_(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var z_=function(){},H_="primary",G_="secondary",W_="danger",Y_="text",V_="link",$_="large",K_="left",Q_=u.a.forwardRef((function(e,t){var i,n,a=e.icon,r=void 0===a?null:a,o=e.iconPosition,s=void 0===o?"right":o,l=e.iconSize,d=void 0===l?16:l,c=e.label,f=void 0===c?"":c,g=e.loading,h=void 0!==g&&g,p=e.onClick,m=void 0===p?z_:p,F=e.to,b=void 0===F?null:F,y=e.type,E=void 0===y?"button":y,v=e.style,k=void 0===v?"primary":v,D=e.fullWidth,C=void 0!==D&&D,w=e.className,S=void 0===w?"":w,O=e.disabled,T=void 0!==O&&O,x=e.size,N=void 0===x?null:x,A=e.href,M=void 0===A?null:A,R=e.tooltipProps,I=void 0===R?null:R,L=U_(e,j_);b?(i=B_,n={to:b}):M?(i="a",n={href:M}):(i="button",n={type:E});var B="string"==typeof r?function(){return u.a.createElement("i",{className:_()("neeto-ui-btn__icon",[r])})}:r||u.a.Fragment;return u.a.createElement(o_,q_({},I,{disabled:!I}),u.a.createElement(i,q_({ref:t,onClick:function(e){h||T||m(e)},className:_()("neeto-ui-btn",[S],{"neeto-ui-btn--style-primary":k===H_,"neeto-ui-btn--style-secondary":k===G_,"neeto-ui-btn--style-danger":k===W_,"neeto-ui-btn--style-text":k===Y_,"neeto-ui-btn--style-link":k===V_,"neeto-ui-btn--size-large":N===$_,"neeto-ui-btn--width-full":C,"neeto-ui-btn--icon-left":s==K_,"neeto-ui-btn--icon-only":!f,disabled:T}),disabled:T},n,L),f&&u.a.createElement("span",null,f),r?u.a.createElement(B,{key:"2",size:d,className:"neeto-ui-btn__icon"}):null))})),Z_=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/;function X_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return J_(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return J_(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J_(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var ec=function(e){var t=e.editor,i=Object(l.useRef)(),n=X_(Object(l.useState)(""),2),a=n[0],r=n[1],o=X_(Object(l.useState)(""),2),s=o[0],d=o[1],_=t.isActive("link"),c=function(){d(t.getAttributes("link").href||"")};return u.a.createElement(Ld,{ref:i,customTarget:function(){return u.a.createElement("button",{className:"h-full p-3 transition-colors editor-fixed-menu--item",onClick:c},u.a.createElement(Nu.Link,{size:24,color:_?"#2F3941":"#87929D"}))},className:"fontsize-dropdown",position:"bottom",closeOnSelect:!1},u.a.createElement("div",{className:"flex py-1 space-x-3 add-link-form"},u.a.createElement("div",{className:"flex-row w-full"},u.a.createElement(h_,{name:"url",value:s,placeholder:"Paste URL",onFocus:function(){return r("")},error:a,onChange:function(e){var t=e.target.value;return d(t)}})),u.a.createElement(Q_,{label:"Link",onClick:function(e){var n;(e.preventDefault(),Z_.test(s))?(t.chain().focus().setLink({href:s}).run(),null===(n=i.current)||void 0===n||n.close()):r("Please enter a valid url")},className:"self-start"}),_?u.a.createElement(Q_,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=i.current)||void 0===e||e.close()},className:"self-start"}):null))},tc=["Icon","command","active","optionName","disabled"];function ic(){return(ic=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function nc(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var ac=function(e){var t=e.editor,i=e.variables,n=e.setImageUploadVisible;if(!t)return null;var a=[{Icon:Nu.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Nu.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:Nu.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline",size:27},{Icon:Nu.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Nu.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}],r=[{Icon:Nu.Quote,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:Nu.Code,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"codeBlock"},{Icon:Nu.Image,command:function(){return n(!0)},optionName:"image-upload"}],o=[{Icon:Nu.ListDot,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:Nu.ListNumber,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}],s=[{Icon:Nu.Undo,command:function(){return t.chain().focus().undo().run()},optionName:"undo",disabled:!t.can().undo(),active:t.can().undo()},{Icon:Nu.Redo,command:function(){return t.chain().focus().redo().run()},optionName:"redo",disabled:!t.can().redo(),active:t.can().redo()}],l=function(e){var t=e.Icon,i=e.command,n=e.active,a=e.optionName,r=e.disabled,o=nc(e,tc);return u.a.createElement("button",{disabled:r,onClick:i,key:a,className:"p-3 transition-colors cursor-pointer editor-fixed-menu--item"},u.a.createElement(t,ic({color:n?"#2F3941":"#87929D"},o)))};return u.a.createElement("div",{className:"flex space-x-6 border-t border-l border-r editor-fixed-menu--root"},u.a.createElement("div",{className:"flex"},u.a.createElement(Vu,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),u.a.createElement(Bd,{editor:t}),a.map(l)),u.a.createElement("div",{className:"flex"},u.a.createElement(ec,{editor:t}),r.map(l)),[o,s].map((function(e,t){return u.a.createElement("div",{className:"flex",key:t},e.map(l))})),u.a.createElement("div",{className:"flex justify-end flex-1"},u.a.createElement(Hd,{editor:t,variables:i})))},rc=i(12),oc=i.n(rc),sc=i(62),lc=i.n(sc),uc=function(e){var t=e.children,i=e.className,n=void 0===i?"root-portal":i,a=e.el,r=void 0===a?"div":a,o=document.getElementsByClassName(n)[0];return o||(o=document.createElement(r)).classList.add(n),u.a.useEffect((function(){document.body.appendChild(o)}),[]),mu.a.createPortal(t,o)},dc=["children","className"];function _c(){return(_c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function cc(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var fc=function(e){var t,i,n,a=e.children,r=e.className,o=cc(e,dc);return u.a.createElement("div",_c({className:_()("transition-opacity bg-gray-500 bg-opacity-50",(t={},i=r,n=r,i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t))},o),a)},gc=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"];function hc(){return(hc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function pc(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var mc=function(){},Fc="xs",bc="sm",yc="md",Ec=function(e){var t,i,n,a=e.size,r=void 0===a?"sm":a,o=e.isOpen,s=void 0!==o&&o,d=e.onClose,c=void 0===d?mc:d,f=e.loading,g=void 0!==f&&f,h=e.children,p=e.className,m=void 0===p?"":p,F=e.closeOnEsc,b=void 0===F||F,y=e.closeButton,E=void 0===y||y,v=e.backdropClassName,k=void 0===v?"":v,D=e.closeOnOutsideClick,C=void 0===D||D,w=pc(e,gc),S=Object(l.useRef)();return C&&wd(S,c),b&&Dd("esc",c),u.a.createElement(uc,{className:"neeto-ui-portal"},s&&u.a.createElement(fc,{key:"modal-backdrop",className:_()("neeto-ui-modal__backdrop",k)},u.a.createElement("div",hc({ref:S,key:"modal-wrapper",className:_()("neeto-ui-modal__wrapper",(t={"neeto-ui-modal__wrapper--xs":r===Fc,"neeto-ui-modal__wrapper--sm":r===bc,"neeto-ui-modal__wrapper--md":r===yc},i=m,n=m,i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t))},w),E&&u.a.createElement(Q_,{style:"text",icon:Nu.Close,className:"neeto-ui-modal__close",onClick:c}),g?u.a.createElement(u.a.Fragment,null):h)))},vc=["children","size","noUnderline","className"],kc=["active","className","children","icon","onClick","activeClassName"];function Dc(){return(Dc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Cc(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var wc=function(){},Sc="large",Oc=function(e){var t=e.children,i=e.size,n=e.noUnderline,a=e.className,r=void 0===a?"":a,o=Cc(e,vc);return u.a.createElement("div",Dc({className:_()({"neeto-ui-tab__wrapper flex":!0},{"neeto-ui-tab__wrapper--size-large":i===Sc},{"neeto-ui-tab__wrapper--underline-none":n},[r]),"data-cy":"tab-container"},o),t)};Oc.Item=function(e){var t=e.active,i=e.className,n=void 0===i?"":i,a=e.children,r=e.icon,o=void 0===r?null:r,s=e.onClick,l=void 0===s?wc:s,d=e.activeClassName,c=void 0===d?"":d,f=Cc(e,kc),g="button",h="string"==typeof o?function(){return u.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||u.a.Fragment;return c&&(g=P_),u.a.createElement(g,Dc({className:_()(["neeto-ui-tab flex items-center justify-center select-none",n],{active:t}),onClick:l,"data-cy":"tab-item"},f),o&&u.a.createElement(h,{className:"neeto-ui-tab__icon"}),a)};var Tc=Oc;function xc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Nc(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Nc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nc(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Ac=function(e){var t,i,n,a=e.buttonLabel,r=void 0===a?"Submit":a,o=e.placeholder,s=e.onSubmit,d=e.className,c=xc(Object(l.useState)(""),2),f=c[0],g=c[1],h=xc(Object(l.useState)(""),2),p=h[0],m=h[1];return u.a.createElement("div",{className:_()("flex flex-col items-center justify-center flex-1 mx-10 flex-wrap",(t={},i=d,n=d,i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t))},u.a.createElement("div",{className:"flex-row w-full my-4"},u.a.createElement(h_,{name:"url",value:f,placeholder:o,onFocus:function(){return m("")},error:p,onChange:function(e){var t=e.target.value;return g(t)}})),u.a.createElement(Q_,{label:r,onClick:function(e){e.preventDefault(),Z_.test(f)?s(f):m("Please enter a valid url")}}))};function Mc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rc(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Rc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rc(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Ic=function(e){var t,i=Mc(Object(l.useState)(null===(t=e[0])||void 0===t?void 0:t.key),2),n=i[0],a=i[1];return[n,function(e){return a(e.key)}]},Lc=(i(43),i(54),i(55)),Bc=i.n(Lc),Pc=(i(56),i(57),i(58),i(59),function(e){var t=e.uppy;return u.a.createElement(Bc.a,{note:"Max. File Size: 5MB",uppy:t,locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},className:"local-upload__root"})});function jc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qc(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return qc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qc(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Uc=function(e){var t=e.uppy,i=jc(Object(l.useState)(0),2),n=i[0],a=i[1];Object(l.useEffect)((function(){t.on("progress",a)}),[t]);var r="".concat(n,"%");return u.a.createElement("div",{className:"progress-bar__root"},u.a.createElement("div",{className:"flex items-center justify-between"},u.a.createElement("span",{className:"progress-bar__percent-text"},r),u.a.createElement("button",{onClick:t.cancelAll},u.a.createElement(Nu.Close,{size:16}))),u.a.createElement("div",{className:"progress-bar__indicator"},u.a.createElement("div",{className:"flex h-full"},u.a.createElement("div",{style:{width:r},className:"flex flex-col justify-center text-center text-white shadow-none whitespace-nowrap progress-bar__indicator-inner"}))))},zc=[{title:"Upload",key:"local"},{title:"Link",key:"link"}];function Hc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gc(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Gc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gc(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Wc=function(e){var t,i=e.editor,n=e.imageUploadUrl,a=e.isVisible,r=e.setIsVisible,o=Hc(Object(l.useState)(!1),2),s=o[0],d=o[1],_=Hc(Ic(zc),2),c=_[0],f=_[1],g=Object(l.useMemo)((function(){return new oc.a({allowMultipleUploads:!1,autoProceed:!0,debug:!0}).use(lc.a,{endpoint:n||"/api/v1/direct_uploads",formData:!0,fieldName:"blob"}).on("upload",(function(){return d(!0)})).on("upload-success",(function(e,t){var n=t.body.imageURL;i.chain().focus().setImage({src:n}).run(),r(!1)})).on("cancel-all",(function(){return d(!1)})).on("complete",(function(){return d(!1)}))}),[i]);return u.a.createElement(Ec,{isOpen:a,onClose:function(){return r(!1)},className:"image-uploader__modal",closeButton:!1},u.a.createElement("div",{className:"image-uploader__root"},u.a.createElement(Tc,null,zc.map((function(e){return u.a.createElement(Tc.Item,{key:e.key,active:c===e.key,onClick:function(){return f(e)}},e.title)}))),u.a.createElement("div",{className:"image-uploader__content"},s?u.a.createElement("div",{className:"flex flex-col items-center justify-center flex-1 text-center"},u.a.createElement("span",{className:"label--primary"},"Uploading..."),u.a.createElement("span",{className:"label--secondary"},null===(t=g.getFiles()[0])||void 0===t?void 0:t.name),u.a.createElement(Uc,{uppy:g})):"local"===c?u.a.createElement(Pc,{uppy:g}):"link"===c?u.a.createElement(Ac,{onSubmit:function(e){i.chain().focus().setImage({src:e}).run(),r(!1)},buttonLabel:"Upload Image",placeholder:"Paste the image link"}):null)))};const Yc=/^\s*>\s$/,Vc=ns.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",Qo(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[_s({find:Yc,type:this.type})]}}),$c=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Kc=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Qc=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Zc=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Xc=as.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",Qo(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[ls({find:$c,type:this.type}),ls({find:Qc,type:this.type})]},addPasteRules(){return[cs({find:Kc,type:this.type}),cs({find:Zc,type:this.type})]}}),Jc=/^\s*([-+*])\s$/,ef=ns.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Qo(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[_s({find:Jc,type:this.type})]}}),tf=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,nf=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,af=as.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Qo(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[ls({find:tf,type:this.type})]},addPasteRules(){return[cs({find:nf,type:this.type})]}}),rf=/^```(?<language>[a-z]*)?[\s\n]$/,of=/^~~~(?<language>[a-z]*)?[\s\n]$/,sf=ns.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:i}=this.options,n=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(i)).map(e=>e.replace(i,""))[0];return n||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands:()=>({setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,i=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!i&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[us({find:rf,type:this.type,getAttributes:({groups:e})=>e}),us({find:of,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Ct({key:new Ot("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const i=t.clipboardData.getData("text/plain"),n=t.clipboardData.getData("vscode-editor-data"),a=n?JSON.parse(n):void 0,r=null==a?void 0:a.mode;if(!i||!r)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:r})),o.setSelection(ut.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 lf=ns.create({name:"doc",topNode:!0,content:"block+"});var uf=function(e,t){var i=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var n=function(e){return i[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))};uf.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var i=t.name,n=t.handler;return e.editorView.dom.removeEventListener(i,n)}))},uf.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())},uf.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},uf.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var i=t.nodeBefore,n=t.nodeAfter;if(i||n){var a=this.editorView.nodeDOM(this.cursorPos-(i?i.nodeSize:0)).getBoundingClientRect(),r=i?a.bottom:a.top;i&&n&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:a.left,right:a.right,top:r-this.width/2,bottom:r+this.width/2}}}if(!e){var o=this.editorView.coordsAtPos(this.cursorPos);e={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var 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"},uf.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},uf.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=We(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},uf.prototype.dragend=function(){this.scheduleRemoval(20)},uf.prototype.drop=function(){this.scheduleRemoval(20)},uf.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const df=ur.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Ct({view:function(t){return new uf(t,e)}}))];var e}});var _f=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,n){var a=i.resolve(n.map(this.head));return t.valid(a)?new t(a):e.near(a)},t.prototype.content=function(){return E.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 cf(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var i=e.index(t);if(0!=i)for(var n=e.node(t).child(i-1);;n=n.lastChild){if(0==n.childCount&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var i=e.indexAfter(t),n=e.node(t);if(i!=n.childCount)for(var a=n.child(i);;a=a.firstChild){if(0==a.childCount&&!a.inlineContent||a.isAtom||a.type.spec.isolating)return!0;if(a.inlineContent)return!1}}return!0}(e))return!1;var i=t.type.spec.allowGapCursor;if(null!=i)return i;var n=t.contentMatchAt(e.index()).defaultType;return n&&n.isTextblock},t.findFrom=function(e,i,n){e:for(;;){if(!n&&t.valid(e))return e;for(var a=e.pos,r=null,o=e.depth;;o--){var s=e.node(o);if(i>0?e.indexAfter(o)<s.childCount:e.index(o)>0){r=s.child(i>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;a+=i;var l=e.doc.resolve(a);if(t.valid(l))return l}for(;;){var u=i>0?r.firstChild:r.lastChild;if(!u){if(r.isAtom&&!r.isText&&!_t.isSelectable(r)){e=e.doc.resolve(a+r.nodeSize*i),n=!1;continue e}break}r=u,a+=i;var d=e.doc.resolve(a);if(t.valid(d))return d}return null}},t}(ot);_f.prototype.visible=!1,ot.jsonID("gapcursor",_f);var cf=function(e){this.pos=e};cf.prototype.map=function(e){return new cf(e.map(this.pos))},cf.prototype.resolve=function(e){var t=e.resolve(this.pos);return _f.valid(t)?new _f(t):ot.near(t)};var ff=nr({ArrowLeft:gf("horiz",-1),ArrowRight:gf("horiz",1),ArrowUp:gf("vert",-1),ArrowDown:gf("vert",1)});function gf(e,t){var i="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,n,a){var r=e.selection,o=t>0?r.$to:r.$from,s=r.empty;if(r instanceof ut){if(!a.endOfTextblock(i)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=_f.findFrom(o,t,s);return!!l&&(n&&n(e.tr.setSelection(new _f(l))),!0)}}function hf(e,t,i){if(!e.editable)return!1;var n=e.state.doc.resolve(t);if(!_f.valid(n))return!1;var a=e.posAtCoords({left:i.clientX,top:i.clientY}).inside;return!(a>-1&&_t.isSelectable(e.state.doc.nodeAt(a)))&&(e.dispatch(e.state.tr.setSelection(new _f(n))),!0)}function pf(e){if(!(e.selection instanceof _f))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",wa.create(e.doc,[va.widget(e.selection.head,t,{key:"gapcursor"})])}const mf=ur.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Ct({props:{decorations:pf,createSelectionBetween:function(e,t,i){if(t.pos==i.pos&&_f.valid(i))return new _f(i)},handleClick:hf,handleKeyDown:ff}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=sr(lr(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),Ff=ns.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Qo(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:i,editor:n})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:a}=n.extensionManager,r=i.storedMarks||i.selection.$to.parentOffset&&i.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:i})=>{if(i&&r&&e){const e=r.filter(e=>a.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),bf=ns.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]),Qo(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=>us({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var yf=function(){};yf.prototype.append=function(e){return e.length?(e=yf.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},yf.prototype.prepend=function(e){return e.length?yf.from(e).append(this):this},yf.prototype.appendInner=function(e){return new vf(this,e)},yf.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?yf.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},yf.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},yf.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)},yf.prototype.map=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length);var n=[];return this.forEach((function(t,i){return n.push(e(t,i))}),t,i),n},yf.from=function(e){return e instanceof yf?e:e&&e.length?new Ef(e):yf.empty};var Ef=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,i){return 0==e&&i==this.length?this:new t(this.values.slice(e,i))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,i,n){for(var a=t;a<i;a++)if(!1===e(this.values[a],n+a))return!1},t.prototype.forEachInvertedInner=function(e,t,i,n){for(var a=t-1;a>=i;a--)if(!1===e(this.values[a],n+a))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},i.length.get=function(){return this.values.length},i.depth.get=function(){return 0},Object.defineProperties(t.prototype,i),t}(yf);yf.empty=new Ef([]);var vf=function(e){function t(t,i){e.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,i,n){var a=this.left.length;return!(t<a&&!1===this.left.forEachInner(e,t,Math.min(i,a),n))&&(!(i>a&&!1===this.right.forEachInner(e,Math.max(t-a,0),Math.min(this.length,i)-a,n+a))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,i,n){var a=this.left.length;return!(t>a&&!1===this.right.forEachInvertedInner(e,t-a,Math.max(i,a)-a,n+a))&&(!(i<a&&!1===this.left.forEachInvertedInner(e,Math.min(t,a),i,n))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var i=this.left.length;return t<=i?this.left.slice(e,t):e>=i?this.right.slice(e-i,t-i):this.left.slice(e,i).append(this.right.slice(0,t-i))},t.prototype.leafAppend=function(e){var i=this.right.leafAppend(e);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(e){var i=this.left.leafPrepend(e);if(i)return new t(i,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(yf),kf=yf,Df=function(e,t){this.items=e,this.eventCount=t};Df.prototype.popEvent=function(e,t){var i=this;if(0==this.eventCount)return null;for(var n,a,r=this.items.length;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(n=this.remapping(r,this.items.length),a=n.maps.length);var o,s,l=e.tr,u=[],d=[];return this.items.forEach((function(e,t){if(!e.step)return n||(n=i.remapping(r,t+1),a=n.maps.length),a--,void d.push(e);if(n){d.push(new Cf(e.map));var _,c=e.step.map(n.slice(a));c&&l.maybeStep(c).doc&&(_=l.mapping.maps[l.mapping.maps.length-1],u.push(new Cf(_,null,null,u.length+d.length))),a--,_&&n.appendMap(_,a)}else l.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(a)):e.selection,s=new Df(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}},Df.prototype.addTransform=function(e,t,i,n){for(var a=[],r=this.eventCount,o=this.items,s=!n&&o.length?o.get(o.length-1):null,l=0;l<e.steps.length;l++){var u,d=e.steps[l].invert(e.docs[l]),_=new Cf(e.mapping.maps[l],d,t);(u=s&&s.merge(_))&&(_=u,l?a.pop():o=o.slice(0,o.length-1)),a.push(_),t&&(r++,t=null),n||(s=_)}var c,f,g,h=r-i.depth;return h>Sf&&(f=h,(c=o).forEach((function(e,t){if(e.selection&&0==f--)return g=t,!1})),o=c.slice(g),r-=h),new Df(o.append(a),r)},Df.prototype.remapping=function(e,t){var i=new Se;return this.items.forEach((function(t,n){var a=null!=t.mirrorOffset&&n-t.mirrorOffset>=e?i.maps.length-t.mirrorOffset:null;i.appendMap(t.map,a)}),e,t),i},Df.prototype.addMaps=function(e){return 0==this.eventCount?this:new Df(this.items.append(e.map((function(e){return new Cf(e)}))),this.eventCount)},Df.prototype.rebased=function(e,t){if(!this.eventCount)return this;var i=[],n=Math.max(0,this.items.length-t),a=e.mapping,r=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),n);var s=t;this.items.forEach((function(t){var n=a.getMirror(--s);if(null!=n){r=Math.min(r,n);var l=a.maps[n];if(t.step){var u=e.steps[n].invert(e.docs[n]),d=t.selection&&t.selection.map(a.slice(s+1,n));d&&o++,i.push(new Cf(l,u,d))}else i.push(new Cf(l))}}),n);for(var l=[],u=t;u<r;u++)l.push(new Cf(a.maps[u]));var d=this.items.slice(0,n).append(l).append(i),_=new Df(d,o);return _.emptyItemCount()>500&&(_=_.compress(this.items.length-i.length)),_},Df.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},Df.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),i=t.maps.length,n=[],a=0;return this.items.forEach((function(r,o){if(o>=e)n.push(r),r.selection&&a++;else if(r.step){var s=r.step.map(t.slice(i)),l=s&&s.getMap();if(i--,l&&t.appendMap(l,i),s){var u=r.selection&&r.selection.map(t.slice(i));u&&a++;var d,_=new Cf(l.invert(),s,u),c=n.length-1;(d=n.length&&n[c].merge(_))?n[c]=d:n.push(_)}}else r.map&&i--}),this.items.length,0),new Df(kf.from(n.reverse()),a)},Df.empty=new Df(kf.empty,0);var Cf=function(e,t,i,n){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=n};Cf.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new Cf(t.getMap().invert(),t,this.selection)}};var wf=function(e,t,i,n){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=n},Sf=20;function Of(e){var t=[];return e.forEach((function(e,i,n,a){return t.push(n,a)})),t}function Tf(e,t){if(!e)return null;for(var i=[],n=0;n<e.length;n+=2){var a=t.map(e[n],1),r=t.map(e[n+1],-1);a<=r&&i.push(a,r)}return i}function xf(e,t,i,n){var a=Mf(t),r=Rf.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,a);if(o){var s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),r,a),u=new wf(n?l:o.remaining,n?o.remaining:l,null,0);i(o.transform.setSelection(s).setMeta(Rf,{redo:n,historyState:u}).scrollIntoView())}}var Nf=!1,Af=null;function Mf(e){var t=e.plugins;if(Af!=t){Nf=!1,Af=t;for(var i=0;i<t.length;i++)if(t[i].spec.historyPreserveItems){Nf=!0;break}}return Nf}var Rf=new Ot("history"),If=new Ot("closeHistory");function Lf(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Ct({key:Rf,state:{init:function(){return new wf(Df.empty,Df.empty,null,0)},apply:function(t,i,n){return function(e,t,i,n){var a,r=i.getMeta(Rf);if(r)return r.historyState;i.getMeta(If)&&(e=new wf(e.done,e.undone,null,0));var o=i.getMeta("appendedTransaction");if(0==i.steps.length)return e;if(o&&o.getMeta(Rf))return o.getMeta(Rf).redo?new wf(e.done.addTransform(i,null,n,Mf(t)),e.undone,Of(i.mapping.maps[i.steps.length-1]),e.prevTime):new wf(e.done,e.undone.addTransform(i,null,n,Mf(t)),null,e.prevTime);if(!1===i.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(a=i.getMeta("rebased"))?new wf(e.done.rebased(i,a),e.undone.rebased(i,a),Tf(e.prevRanges,i.mapping),e.prevTime):new wf(e.done.addMaps(i.mapping.maps),e.undone.addMaps(i.mapping.maps),Tf(e.prevRanges,i.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(i.time||0)-n.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var i=!1;return e.mapping.maps[0].forEach((function(e,n){for(var a=0;a<t.length;a+=2)e<=t[a+1]&&n>=t[a]&&(i=!0)})),i}(i,e.prevRanges)),l=o?Tf(e.prevRanges,i.mapping):Of(i.mapping.maps[i.steps.length-1]);return new wf(e.done.addTransform(i,s?t.selection.getBookmark():null,n,Mf(t)),Df.empty,l,i.time)}(i,n,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var i="historyUndo"==t.inputType?Bf(e.state,e.dispatch):"historyRedo"==t.inputType&&Pf(e.state,e.dispatch);return i&&t.preventDefault(),i}}}})}function Bf(e,t){var i=Rf.getState(e);return!(!i||0==i.done.eventCount)&&(t&&xf(i,e,t,!1),!0)}function Pf(e,t){var i=Rf.getState(e);return!(!i||0==i.undone.eventCount)&&(t&&xf(i,e,t,!0),!0)}const jf=ur.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Bf(e,t),redo:()=>({state:e,dispatch:t})=>Pf(e,t)}),addProseMirrorPlugins(){return[Lf(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()}}}),qf=ns.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Qo(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:i}=e,{empty:n,$anchor:a}=i,r=a.parent.isTextblock&&!a.parent.type.spec.code&&!a.parent.textContent;if(!n||!r||!t)return!0;const o=a.before(),s=a.start();return e.deleteRange(o,s),e.setSelection(ut.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var i;if(t){const{parent:t,pos:n}=e.selection.$from,a=n+1;if(!e.doc.nodeAt(a)){const n=null===(i=t.type.contentMatch.defaultType)||void 0===i?void 0:i.create();n&&(e.insert(a,n),e.setSelection(ut.create(e.doc,a)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[rs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Uf=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,zf=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Hf=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Gf=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Wf=as.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",Qo(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[ls({find:Uf,type:this.type}),ls({find:Hf,type:this.type})]},addPasteRules(){return[cs({find:zf,type:this.type}),cs({find:Gf,type:this.type})]}}),Yf=ns.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Qo(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")}}}),Vf=/^(\d+)\.\s$/,$f=ns.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",Qo(this.options.HTMLAttributes,i),0]:["ol",Qo(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[_s({find:Vf,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),Kf=ns.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Qo(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Qf=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Zf=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Xf=as.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",Qo(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[ls({find:Qf,type:this.type})]},addPasteRules(){return[cs({find:Zf,type:this.type})]}});var Jf=ns.create({name:"text",group:"inline"});const eg=ur.create({name:"starterKit",addExtensions(){var e,t,i,n,a,r,o,s,l,u,d,_,c,f,g,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(Vc.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(Xc.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(ef.configure(null===(i=this.options)||void 0===i?void 0:i.bulletList)),!1!==this.options.code&&F.push(af.configure(null===(n=this.options)||void 0===n?void 0:n.code)),!1!==this.options.codeBlock&&F.push(sf.configure(null===(a=this.options)||void 0===a?void 0:a.codeBlock)),!1!==this.options.document&&F.push(lf.configure(null===(r=this.options)||void 0===r?void 0:r.document)),!1!==this.options.dropcursor&&F.push(df.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(mf.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(Ff.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push(bf.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push(jf.configure(null===(d=this.options)||void 0===d?void 0:d.history)),!1!==this.options.horizontalRule&&F.push(qf.configure(null===(_=this.options)||void 0===_?void 0:_.horizontalRule)),!1!==this.options.italic&&F.push(Wf.configure(null===(c=this.options)||void 0===c?void 0:c.italic)),!1!==this.options.listItem&&F.push(Yf.configure(null===(f=this.options)||void 0===f?void 0:f.listItem)),!1!==this.options.orderedList&&F.push($f.configure(null===(g=this.options)||void 0===g?void 0:g.orderedList)),!1!==this.options.paragraph&&F.push(Kf.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(Xf.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(Jf.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),tg=ds({find:/--$/,replace:"—"}),ig=ds({find:/\.\.\.$/,replace:"…"}),ng=ds({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),ag=ds({find:/"$/,replace:"”"}),rg=ds({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),og=ds({find:/'$/,replace:"’"}),sg=ds({find:/<-$/,replace:"←"}),lg=ds({find:/->$/,replace:"→"}),ug=ds({find:/\(c\)$/,replace:"©"}),dg=ds({find:/\(tm\)$/,replace:"™"}),_g=ds({find:/\(r\)$/,replace:"®"}),cg=ds({find:/1\/2$/,replace:"½"}),fg=ds({find:/\+\/-$/,replace:"±"}),gg=ds({find:/!=$/,replace:"≠"}),hg=ds({find:/<<$/,replace:"«"}),pg=ds({find:/>>$/,replace:"»"}),mg=ds({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),Fg=ds({find:/\^2$/,replace:"²"}),bg=ds({find:/\^3$/,replace:"³"}),yg=ds({find:/1\/4$/,replace:"¼"}),Eg=ds({find:/3\/4$/,replace:"¾"}),vg=ur.create({name:"typography",addInputRules:()=>[tg,ig,ng,ag,rg,og,sg,lg,ug,dg,_g,cg,fg,gg,hg,pg,mg,Fg,bg,yg,Eg]}),kg=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,Dg=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,Cg=as.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",Qo(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[ls({find:kg,type:this.type})]},addPasteRules(){return[cs({find:Dg,type:this.type})]}});var wg=i(35);const Sg=as.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",Qo(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[cs({find:e=>Object(wg.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 Ct({key:new Ot("handleClickLink"),props:{handleClick:(e,t,i)=>{var n;const a=this.editor.getAttributes("link");return!(!(null===(n=i.target)||void 0===n?void 0:n.closest("a"))||!a.href)&&(window.open(a.href,a.target),!0)}}})),this.options.linkOnPaste&&e.push(new Ct({key:new Ot("handlePasteLink"),props:{handlePaste:(e,t,i)=>{const{state:n}=e,{selection:a}=n,{empty:r}=a;if(r)return!1;let o="";i.content.forEach(e=>{o+=e.textContent});const s=Object(wg.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),Og=as.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",Qo(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const i=so(e,this.type);return!!Object.entries(i).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),Tg=ur.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 xg=i(23),Ng=i.n(xg);var Ag=ns.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Ct({key:new Ot("eventHandler"),props:{handleClick:function(t,i){var n=t.state,a=n.doc.lastChild,r=n.doc.resolve(i).nodeBefore;if(a&&r){var o=a.eq(r),s=a.isInline,l=["paragraph","text"].includes(a.type.name);!o||s||l||e.commands.insertContentAt(i,{type:"paragraph",content:""})}}}})]}});const Mg=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,Rg=ns.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",Qo(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[rs({find:Mg,type:this.type,getAttributes:e=>{const[,,t,i,n]=e;return{src:i,alt:t,title:n}}})]}});function Ig(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Lg(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ig(Object(i),!0).forEach((function(t){Bg(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ig(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Bg(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var Pg=Rg.extend({name:"image",addAttributes:function(){return Lg(Lg({},Rg.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(i){var n,a,r,o=i.tr,s=i.commands;return"image"==(null===(n=o.selection)||void 0===n||null===(a=n.node)||void 0===a||null===(r=a.type)||void 0===r?void 0:r.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}}}},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return i.class=" image-"+t.attrs.size,i.class+=" image-float-"+t.attrs.float,["img",Qo(this.options.HTMLAttributes,i)]}});const jg=as.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",Qo(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()}}});function qg(e){return(qg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ug(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function zg(e,t){return(zg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Yg(e);if(t){var a=Yg(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Gg(this,i)}}function Gg(e,t){if(t&&("object"===qg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wg(e)}function Wg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yg(e){return(Yg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vg(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var $g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zg(e,t)}(r,e);var t,i,n,a=Hg(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),Vg(Wg(t=a.call(this,e)),"onKeyDown",(function(e){var i=e.event;return"ArrowUp"===i.key?(t.upHandler(),!0):"ArrowDown"===i.key?(t.downHandler(),!0):"Enter"===i.key&&(t.enterHandler(),!0)})),Vg(Wg(t),"upHandler",(function(){t.setState({selectedIndex:(t.state.selectedIndex+t.props.items.length-1)%t.props.items.length})})),Vg(Wg(t),"downHandler",(function(){t.setState({selectedIndex:(t.state.selectedIndex+1)%t.props.items.length})})),Vg(Wg(t),"enterHandler",(function(){t.selectItem(t.state.selectedIndex)})),Vg(Wg(t),"selectItem",(function(e){var i=t.props.items[e];if(i){var n=t.props,a=n.editor,r=n.range;i.command({editor:a,range:r})}})),Vg(Wg(t),"scrollHandler",(function(){var e=t.menuRef.current,i=e.children[t.state.selectedIndex],n=i.clientHeight+8,a=e.scrollTop;i.offsetTop+n>a+e.clientHeight?a=i.offsetTop-e.clientHeight+n:a>i.offsetTop&&(a=i.offsetTop-8),t.menuRef.current.scrollTop=a})),t.state={selectedIndex:0},t.menuRef=u.a.createRef(),t}return t=r,(i=[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),this.scrollHandler()}},{key:"render",value:function(){var e=this;return u.a.createElement("div",{ref:this.menuRef,className:"relative p-3 -mr-1 space-y-2 overflow-x-hidden overflow-y-scroll rounded shadow max-h-80 w-80 editor-command-list--root"},this.props.items.map((function(t,i){return u.a.createElement(Kg,{key:t.title,item:t,index:i,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(i)}})})))}}])&&Ug(t.prototype,i),n&&Ug(t,n),r}(u.a.Component),Kg=function(e){var t=e.item,i=e.selectedIndex,n=e.index,a=e.selectItem,r=t.Icon;return u.a.createElement("div",{className:_()("flex items-center w-full px-4 py-2 space-x-4 transition-all duration-100 ease-in-out editor-command-list--item cursor-pointer rounded",{selected_item:n===i}),onClick:function(){return a(n)}},r&&u.a.createElement("div",{className:"p-1 text-gray-100 rounded-sm"},u.a.createElement(r,{size:18})),u.a.createElement("div",{className:"flex flex-col text-gray-100"},u.a.createElement("span",{className:"text-sm font-semibold"},t.title),u.a.createElement("span",{className:"text-xs text-gray-300"},t.description)))},Qg=$g;const Zg=new Ot("suggestion");function Xg({pluginKey:e=Zg,editor:t,char:i="@",allowSpaces:n=!1,prefixSpace:a=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:_=(()=>!0)}){const c=null==d?void 0:d();return new Ct({key:e,view(){return{update:async(e,i)=>{var n,a,r,o,s;const d=null===(n=this.key)||void 0===n?void 0:n.getState(i),_=null===(a=this.key)||void 0===a?void 0:a.getState(e.state),f=d.active&&_.active&&d.range.from!==_.range.from,g=!d.active&&_.active,h=d.active&&!_.active,p=g||f,m=!g&&!h&&d.query!==_.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:_,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:y,clientRect:y?()=>{var e;const{decorationId: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,E)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,E)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,E))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:d}=l,c={...o};if(c.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:n,startOfLine:a,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=a?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=r.depth<=0?0:r.before(),_=r.pos,c=r.doc.textBetween(d,_,"\0","\0"),f=Array.from(c.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(n&&!h)return null;const p=f.index+r.start();let m=p+f[0].length;return i&&s.test(c.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:i,allowSpaces:n,prefixSpace:a,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:n,range:a}=this.getState(e.state);return n&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:a}))||!1},decorations(e){const{active:t,range:i,decorationId:n}=this.getState(e);return t?wa.create(e.doc,[va.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":n})]):null}}})}function Jg(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function eh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Jg(Object(i),!0).forEach((function(t){th(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Jg(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function th(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var ih=new Ot("commands"),nh=function(e){var t=e.setImageUploadVisible;return ur.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:ih,command:function(e){var t=e.editor,i=e.range;e.props.command({editor:t,range:i})},items:function(e){var i=e.query,n=[{title:"Paragraph",description:"Add a plain text block",Icon:Nu.Paragraph,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("paragraph").run()}},{title:"H1",description:"Add a big heading",Icon:Nu.TextH1,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:1}).run()}},{title:"H2",description:"Add a sub-heading",Icon:Nu.TextH2,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:2}).run()}},{title:"Numbered list",description:"Add a list with numbering",Icon:Nu.ListNumber,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleOrderedList().run()}},{title:"Bulleted list",description:"Add an list bullets",Icon:Nu.ListDot,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBulletList().run()}},{title:"Blockquote",description:"Add a quote",Icon:Nu.Blockquote,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBlockquote().run()}},{title:"Image",description:"Add an image",Icon:Nu.Image,command:function(e){var i=e.editor,n=e.range;t(!0),i.chain().focus().deleteRange(n).run()}},{title:"Youtube/Vimeo",description:"Embed a video from major services",Icon:Nu.Video,command:function(e){var t=e.editor,i=e.range,n=prompt("Please enter Youtube/Vimeo embed URL");t.chain().focus().deleteRange(i).setExternalVideo({src:n}).run()}},{title:"Code block",description:"Add a code block with syntax highlighting",Icon:Nu.Code,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleCodeBlock().run()}},{title:"Emoji",description:"Add an emoji",Icon:Nu.Smiley,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("::").run()}}],a=n.filter((function(e){return e.title.toLowerCase().includes(i.toLowerCase())}));return Ng()(a)?[{title:"No results",command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).run()}}]:a},render:function(){var e,t;return{onStart:function(i){e=new Eu(Qg,{props:i,editor:i.editor}),t=_u("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1})},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()}}}}}},addProseMirrorPlugins:function(){return[Xg(eh({editor:this.editor},this.options.suggestion))]}})},ah={};function rh(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)||rh(i)})),e}var oh=rh,sh=rh;oh.default=sh;class lh{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function uh(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function dh(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 _h=e=>!!e.kind;class ch{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=uh(e)}openNode(e){if(!_h(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){_h(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class fh{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=>{fh._collapse(e)}))}}class gh extends fh{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 ch(this,this.options).value()}finalize(){return!0}}function hh(e){return e?"string"==typeof e?e:e.source:null}const ph=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const mh="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Fh={begin:"\\\\[\\s\\S]",relevance:0},bh={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[Fh]},yh={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[Fh]},Eh={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/},vh=function(e,t,i={}){const n=dh({className:"comment",begin:e,end:t,contains:[]},i);return n.contains.push(Eh),n.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),n},kh=vh("//","$"),Dh=vh("/\\*","\\*/"),Ch=vh("#","$"),wh={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},Sh={className:"number",begin:mh,relevance:0},Oh={className:"number",begin:"\\b(0b[01]+)",relevance:0},Th={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},xh={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Fh,{begin:/\[/,end:/\]/,relevance:0,contains:[Fh]}]}]},Nh={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},Ah={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},Mh={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var Rh=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:mh,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>hh(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),dh({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:Fh,APOS_STRING_MODE:bh,QUOTE_STRING_MODE:yh,PHRASAL_WORDS_MODE:Eh,COMMENT:vh,C_LINE_COMMENT_MODE:kh,C_BLOCK_COMMENT_MODE:Dh,HASH_COMMENT_MODE:Ch,NUMBER_MODE:wh,C_NUMBER_MODE:Sh,BINARY_NUMBER_MODE:Oh,CSS_NUMBER_MODE:Th,REGEXP_MODE:xh,TITLE_MODE:Nh,UNDERSCORE_TITLE_MODE:Ah,METHOD_GUARD:Mh,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 Ih(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function Lh(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Ih,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Bh(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>hh(e)).join("|")+")"}(...e.illegal))}function Ph(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 jh(e,t){void 0===e.relevance&&(e.relevance=1)}const qh=["of","and","for","in","not","or","if","then","parent","list","value"];function Uh(e,t){return t?Number(t):function(e){return qh.includes(e.toLowerCase())}(e)?0:1}function zh(e,{plugins:t}){function i(t,i){return new RegExp(hh(t),"m"+(e.case_insensitive?"i":"")+(i?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=i(function(e,t="|"){let i=0;return e.map(e=>{i+=1;const t=i;let n=hh(e),a="";for(;n.length>0;){const e=ph.exec(n);if(!e){a+=n;break}a+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?a+="\\"+String(Number(e[1])+t):(a+=e[0],"("===e[0]&&i++)}return a}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex((e,t)=>t>0&&void 0!==e),n=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,n)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,i])=>t.addRule(e,i)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=dh(e.classNameAliases||{}),function t(n,r){const o=n;if(n.isCompiled)return o;[Ph].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[Lh,Bh,jh].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;if("object"==typeof n.keywords&&(s=n.keywords.$pattern,delete n.keywords.$pattern),n.keywords&&(n.keywords=function e(t,i,n="keyword"){const a={};return"string"==typeof t?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach((function(n){Object.assign(a,e(t[n],i,n))})),a;function r(e,t){i&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const i=t.split("|");a[i[0]]=[e,Uh(i[0],i[1])]}))}}(n.keywords,e.case_insensitive)),n.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||n.lexemes||/\w+/,o.keywordPatternRe=i(s,!0),r&&(n.begin||(n.begin=/\B|\b/),o.beginRe=i(n.begin),n.endSameAsBegin&&(n.end=n.begin),n.end||n.endsWithParent||(n.end=/\B|\b/),n.end&&(o.endRe=i(n.end)),o.terminatorEnd=hh(n.end)||"",n.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(n.end?"|":"")+r.terminatorEnd)),n.illegal&&(o.illegalRe=i(n.illegal)),n.contains||(n.contains=[]),n.contains=[].concat(...n.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return dh(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return dh(e,{starts:e.starts?dh(e.starts):null});if(Object.isFrozen(e))return dh(e);return e}("self"===e?n:e)}))),n.contains.forEach((function(e){t(e,o)})),n.starts&&t(n.starts,r),o.matcher=function(e){const t=new a;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function Hh(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,uh(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 Gh={"after:highlightElement":({el:e,result:t,text:i})=>{const n=Yh(e);if(!n.length)return;const a=document.createElement("div");a.innerHTML=t.value,t.value=function(e,t,i){let n=0,a="";const r=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){a+="<"+Wh(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+uh(e.value)+'"'})).join("")+">"}function l(e){a+="</"+Wh(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(a+=uh(i.substring(n,t[0].offset)),n=t[0].offset,t===e){r.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===n);r.reverse().forEach(s)}else"start"===t[0].event?r.push(t[0].node):r.pop(),u(t.splice(0,1)[0])}return a+uh(i.substr(n))}(n,Yh(a),i)}};function Wh(e){return e.nodeName.toLowerCase()}function Yh(e){const t=[];return function e(i,n){for(let a=i.firstChild;a;a=a.nextSibling)3===a.nodeType?n+=a.nodeValue.length:1===a.nodeType&&(t.push({event:"start",offset:n,node:a}),n=e(a,n),Wh(a).match(/br|hr|img|input/)||t.push({event:"stop",offset:n,node:a}));return n}(e,0),t}const Vh={},$h=e=>{console.error(e)},Kh=(e,...t)=>{console.log("WARN: "+e,...t)},Qh=(e,t)=>{Vh[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Vh[`${e}/${t}`]=!0)},Zh=uh,Xh=dh,Jh=Symbol("nomatch");var ep=function(e){const t=Object.create(null),i=Object.create(null),n=[];let a=!0;const r=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:gh};function u(e){return l.noHighlightRe.test(e)}function d(e,t,i,n){let a="",r="";"object"==typeof t?(a=e,i=t.ignoreIllegals,r=t.language,n=void 0):(Qh("10.7.0","highlight(lang, code, ...args) has been deprecated."),Qh("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,a=t);const o={code:a,language:r};k("before:highlight",o);const s=o.result?o.result:_(o.language,o.code,i,n);return s.code=o.code,k("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!=k.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void C.addText(w);e=_(k.subLanguage,w,!0,D[k.subLanguage]),D[k.subLanguage]=e.top}else e=c(w,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),C.addSublanguage(e.emitter,e.language)}():function(){if(!k.keywords)return void C.addText(w);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(w),i="";for(;t;){i+=w.substring(e,t.index);const n=u(k,t);if(n){const[e,a]=n;if(C.addText(i),i="",S+=a,e.startsWith("_"))i+=t[0];else{const i=b.classNameAliases[e]||e;C.addKeyword(t[0],i)}}else i+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(w)}i+=w.substr(e),C.addText(i)}(),w=""}function f(e){return e.className&&C.openNode(b.classNameAliases[e.className]||e.className),k=Object.create(e,{parent:{value:k}}),k}function g(e){return 0===k.matcher.regexIndex?(w+=e[0],1):(x=!0,0)}function h(e){const t=e[0],i=e.rule,n=new lh(i),a=[i.__beforeBegin,i["on:begin"]];for(const i of a)if(i&&(i(e,n),n.isMatchIgnored))return g(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)),f(i),i.returnBegin?0:t.length}function p(e){const t=e[0],n=i.substr(e.index),a=function e(t,i,n){let a=function(e,t){const i=e&&e.exec(t);return i&&0===i.index}(t.endRe,n);if(a){if(t["on:end"]){const e=new lh(t);t["on:end"](i,e),e.isMatchIgnored&&(a=!1)}if(a){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,i,n)}(k,e,n);if(!a)return Jh;const r=k;r.skip?w+=t:(r.returnEnd||r.excludeEnd||(w+=t),d(),r.excludeEnd&&(w=t));do{k.className&&C.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent}while(k!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.endRe=a.endRe),f(a.starts)),r.returnEnd?0:t.length}let m={};function F(t,n){const o=n&&n[0];if(w+=t,null==o)return d(),0;if("begin"===m.type&&"end"===n.type&&m.index===n.index&&""===o){if(w+=i.slice(n.index,n.index+1),!a){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=n,"begin"===n.type)return h(n);if("illegal"===n.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(k.className||"<unnamed>")+'"');throw e.mode=k,e}if("end"===n.type){const e=p(n);if(e!==Jh)return e}if("illegal"===n.type&&""===o)return 1;if(T>1e5&&T>3*n.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=y(e);if(!b)throw $h(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const E=zh(b,{plugins:n});let v="",k=s||E;const D={},C=new l.__emitter(l);!function(){const e=[];for(let t=k;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>C.openNode(e))}();let w="",S=0,O=0,T=0,x=!1;try{for(k.matcher.considerAll();;){T++,x?x=!1:k.matcher.considerAll(),k.matcher.lastIndex=O;const e=k.matcher.exec(i);if(!e)break;const t=F(i.substring(O,e.index),e);O=e.index+t}return F(i.substr(O)),C.closeAllNodes(),C.finalize(),v=C.toHTML(),{relevance:Math.floor(S),value:v,language:e,illegal:!1,emitter:C,top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:i.slice(O-100,O+100),mode:t.mode},sofar:v,relevance:0,value:Zh(i),emitter:C};if(a)return{illegal:!1,relevance:0,value:Zh(i),emitter:C,language:e,top:k,errorRaised:t};throw t}}function c(e,i){i=i||l.languages||Object.keys(t);const n=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:Zh(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),a=i.filter(y).filter(v).map(t=>_(t,e,!1));a.unshift(n);const r=a.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(y(e.language).supersetOf===t.language)return 1;if(y(t.language).supersetOf===e.language)return-1}return 0}),[o,u]=r,d=o;return d.second_best=u,d}const f={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},g=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(g,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=l.languageDetectRe.exec(t);if(i){const t=y(i[1]);return t||(Kh(o.replace("{}",i[1])),Kh("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||y(e))}(e);if(u(n))return;k("before:highlightElement",{el:e,language:n}),t=e;const a=t.textContent,r=n?d(a,{language:n,ignoreIllegals:!0}):c(a);k("after:highlightElement",{el:e,result:r,text:a}),e.innerHTML=r.value,function(e,t,n){const a=t?i[t]:n;e.classList.add("hljs"),a&&e.classList.add(a)}(e,n,r.language),e.result={language:r.language,re:r.relevance,relavance:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance,relavance:r.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,Qh("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(p)};let F=!1;function b(){if("loading"===document.readyState)return void(F=!0);document.querySelectorAll("pre code").forEach(p)}function y(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function E(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function v(e){const t=y(e);return t&&!t.disableAutodetect}function k(e,t){const i=e;n.forEach((function(e){e[i]&&e[i](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){F&&b()}),!1),Object.assign(e,{highlight:d,highlightAuto:c,highlightAll:b,fixMarkup:function(e){return Qh("10.2.0","fixMarkup will be removed entirely in v11.0"),Qh("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 Qh("10.7.0","highlightBlock will be removed entirely in v12.0"),Qh("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(Qh("10.3.0","'useBR' will be removed entirely in v11.0"),Qh("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=Xh(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){Qh("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(i,n){let r=null;try{r=n(e)}catch(e){if($h("Language definition for '{}' could not be registered.".replace("{}",i)),!a)throw e;$h(e),r=s}r.name||(r.name=i),t[i]=r,r.rawDefinition=n.bind(null,e),r.aliases&&E(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:y,registerAliases:E,requireLanguage:function(e){Qh("10.4.0","requireLanguage will be removed entirely in v11."),Qh("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=y(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:v,inherit:Xh,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),n.push(e)},vuePlugin:Hh(e).VuePlugin}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="10.7.3";for(const e in Rh)"object"==typeof Rh[e]&&oh(Rh[e]);return Object.assign(e,Rh),e.addPlugin(f),e.addPlugin(Gh),e.addPlugin(h),e}({}),tp={exports:{}};!function(e){!function(){var t;function i(e){for(var t,i,n,a,r=1,o=[].slice.call(arguments),s=0,l=e.length,u="",d=!1,_=!1,c=function(){return o[r++]},f=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,a=f(),t){case"b":u+=parseInt(c(),10).toString(2);break;case"c":u+="string"==typeof(i=c())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case"d":u+=parseInt(c(),10);break;case"f":n=String(parseFloat(c()).toFixed(a||6)),u+=_?n:n.replace(/^0/,"");break;case"j":u+=JSON.stringify(c());break;case"o":u+="0"+parseInt(c(),10).toString(8);break;case"s":u+=c();break;case"x":u+="0x"+parseInt(c(),10).toString(16);break;case"X":u+="0x"+parseInt(c(),10).toString(16).toUpperCase();break;default:u+=t}else"%"===t?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))})}()}(tp);var ip=tp.exports,np=rp(Error),ap=np;function rp(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=ip.apply(null,arguments)),new e(t)}}np.eval=rp(EvalError),np.range=rp(RangeError),np.reference=rp(ReferenceError),np.syntax=rp(SyntaxError),np.type=rp(TypeError),np.uri=rp(URIError),np.create=rp;var op=ep,sp=ap;ah.highlight=lp,ah.highlightAuto=function(e,t){var i=t||{},n=i.subset||op.listLanguages();i.prefix;var a,r,o,s,l=n.length,u=-1;if("string"!=typeof e)throw sp("Expected `string` for value, got `%s`",e);r={relevance:0,language:null,value:[]},a={relevance:0,language:null,value:[]};for(;++u<l;)s=n[u],op.getLanguage(s)&&((o=lp(s,e,t)).language=s,o.relevance>r.relevance&&(r=o),o.relevance>a.relevance&&(r=a,a=o));r.language&&(a.secondBest=r);return a},ah.registerLanguage=function(e,t){op.registerLanguage(e,t)},ah.listLanguages=function(){return op.listLanguages()},ah.registerAlias=function(e,t){var i,n=e;t&&((n={})[e]=t);for(i in n)op.registerAliases(n[i],{languageName:i})},up.prototype.addText=function(e){var t,i,n=this.stack;if(""===e)return;t=n[n.length-1],(i=t.children[t.children.length-1])&&"text"===i.type?i.value+=e:t.children.push({type:"text",value:e})},up.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},up.prototype.addSublanguage=function(e,t){var i=this.stack,n=i[i.length-1],a=e.rootNode.children,r=t?{type:"element",tagName:"span",properties:{className:[t]},children:a}:a;n.children=n.children.concat(r)},up.prototype.openNode=function(e){var t=this.stack,i=this.options.classPrefix+e,n=t[t.length-1],a={type:"element",tagName:"span",properties:{className:[i]},children:[]};n.children.push(a),t.push(a)},up.prototype.closeNode=function(){this.stack.pop()},up.prototype.closeAllNodes=dp,up.prototype.finalize=dp,up.prototype.toHTML=function(){return""};function lp(e,t,i){var n,a=op.configure({}),r=(i||{}).prefix;if("string"!=typeof e)throw sp("Expected `string` for name, got `%s`",e);if(!op.getLanguage(e))throw sp("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw sp("Expected `string` for value, got `%s`",t);if(null==r&&(r="hljs-"),op.configure({__emitter:up,classPrefix:r}),n=op.highlight(t,{language:e,ignoreIllegals:!0}),op.configure(a||{}),n.errorRaised)throw n.errorRaised;return{relevance:n.relevance,language:n.language,value:n.emitter.rootNode.children}}function up(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function dp(){}function _p(e){return e.value||e.children||[]}function cp({doc:e,name:t,lowlight:i}){const n=[];return fs(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:a}=e.node.attrs,r=i.listLanguages();(function e(t,i=[]){return t.map(t=>{const n=[...i,...t.properties?t.properties.className:[]];return t.children?e(t.children,n):{text:t.value,classes:n}}).flat()})(a&&r.includes(a)?_p(i.highlight(a,e.node.textContent)):_p(i.highlightAuto(e.node.textContent))).forEach(e=>{const i=t+e.text.length;if(e.classes.length){const a=va.inline(t,i,{class:e.classes.join(" ")});n.push(a)}t=i})}),wa.create(e,n)}function fp({name:e,lowlight:t}){return new Ct({key:new Ot("lowlight"),state:{init:(i,{doc:n})=>cp({doc:n,name:e,lowlight:t}),apply:(i,n,a,r)=>{const o=a.selection.$head.parent.type.name,s=r.selection.$head.parent.type.name,l=fs(a.doc,t=>t.type.name===e),u=fs(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)))?cp({doc:i.doc,name:e,lowlight:t}):n.map(i.mapping,i.doc)}},props:{decorations(e){return this.getState(e)}}})}const gp=sf.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:ah}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],fp({name:this.name,lowlight:this.options.lowlight})]}});function hp(){return u.a.createElement(Tu,null,u.a.createElement("pre",null,u.a.createElement(xu,{as:"code"})))}var pp=i(63),mp=i.n(pp),Fp=gp.extend({addNodeView:function(){return new Cu(hp)}}).configure({lowlight:mp.a}),bp=function(e){var t=e.items,i=e.command;return u.a.createElement("div",{className:"shadow-md"},u.a.createElement(Ud,{variables:t,onClickVariable:function(e){var t=e.category_key,n=e.key,a=t?"".concat(t,".").concat(n):n;i({label:a,id:a})}}))};function yp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Ep(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?yp(Object(i),!0).forEach((function(t){vp(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):yp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function vp(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var kp=new Ot("variables"),Dp=ns.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"variable__text"},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",Qo({"data-variable":""},this.options.HTMLAttributes,i),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addCommands:function(){var e=this;return{setVariable:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:t},{type:"text",text:" "}]).run()}}}},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var i=t.tr,n=t.state,a=!1,r=n.selection,o=r.empty,s=r.anchor;return!!o&&(n.doc.nodesBetween(s-1,s,(function(t,n){if(t.type.name===e.name)return a=!0,i.insertText("",n,n+t.nodeSize),!1})),a)}))}}},addProseMirrorPlugins:function(){return[Xg(Ep({editor:this.editor},this.options.suggestion))]}}),Cp={char:"{{",startOfLine:!1,pluginKey:kp,command:function(e){var t=e.editor,i=e.range,n=e.props;t.chain().focus().deleteRange(i).setVariable(n).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Eu(bp,{props:i,editor:i.editor}),t=_u("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},wp=function(e){var t=e.suggestion,i=void 0===t?{}:t;return Dp.configure({suggestion:Ep(Ep({},Cp),i)})},Sp=i(64),Op=i.n(Sp);function Tp(e){return(Tp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var xp=function(e){var t=Tp(e);return"string"===t||"funtion"===t?e:Op()(e)?function(t){var i=t.node.type.name;return e[i]}:""},Np=ur.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Ct({props:{decorations:function(t){var i=t.doc,n=t.selection,a=e.editor.isEditable||!e.options.showOnlyWhenEditable,r=n.anchor,o=[];if(a)return i.descendants((function(t,i){var n=r>=i&&r<=i+t.nodeSize,a=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((n||!e.options.showOnlyCurrent)&&!s&&a){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=va.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})),wa.create(i,o)}}})]}});const Ap=new Ot("suggestion");function Mp({pluginKey:e=Ap,editor:t,char:i="@",allowSpaces:n=!1,prefixSpace:a=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:_=(()=>!0)}){const c=null==d?void 0:d();return new Ct({key:e,view(){return{update:async(e,i)=>{var n,a,r,o,s;const d=null===(n=this.key)||void 0===n?void 0:n.getState(i),_=null===(a=this.key)||void 0===a?void 0:a.getState(e.state),f=d.active&&_.active&&d.range.from!==_.range.from,g=!d.active&&_.active,h=d.active&&!_.active,p=g||f,m=!g&&!h&&d.query!==_.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:_,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:y,clientRect:y?()=>{var e;const{decorationId: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,E)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,E)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,E))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:d}=l,c={...o};if(c.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:n,startOfLine:a,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=a?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=r.depth<=0?0:r.before(),_=r.pos,c=r.doc.textBetween(d,_,"\0","\0"),f=Array.from(c.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(n&&!h)return null;const p=f.index+r.start();let m=p+f[0].length;return i&&s.test(c.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:i,allowSpaces:n,prefixSpace:a,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:n,range:a}=this.getState(e.state);return n&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:a}))||!1},decorations(e){const{active:t,range:i,decorationId:n}=this.getState(e);return t?wa.create(e.doc,[va.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":n})]):null}}})}const Rp=new Ot("mention"),Ip=ns.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:Rp,command:({editor:e,range:t,props:i})=>{var n;const a=e.view.state.selection.$to.nodeAfter;(null===(n=null==a?void 0:a.text)||void 0===n?void 0:n.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:i},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const i=e.state.doc.resolve(t.from),n=e.schema.nodes[this.name];return!!i.parent.type.contentMatch.matchType(n)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-mention]"}],renderHTML({node:e,HTMLAttributes:t}){return["span",Qo({"data-mention":""},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let i=!1;const{selection:n}=t,{empty:a,anchor:r}=n;return!!a&&(t.doc.nodesBetween(r-1,r,(t,n)=>{if(t.type.name===this.name)return i=!0,e.insertText(this.options.suggestion.char||"",n,n+t.nodeSize),!1}),i)})}},addProseMirrorPlugins(){return[Mp({editor:this.editor,...this.options.suggestion})]}});var Lp=["size","user","isSquare","status","onClick","className"];function Bp(){return(Bp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Pp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jp(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return jp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jp(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function qp(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var Up={small:24,medium:32,large:40,xlarge:64},zp=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function Hp(e){var t,i,n=e.size,a=e.user,r=e.isSquare,o=e.status,s=e.onClick,d=e.className,c=qp(e,Lp),f=Pp(Object(l.useState)(!1),2),g=f[0],h=f[1],p=a.name,m=void 0===p?"":p,F=a.imageUrl,b="medium"===n,y="large"===n,E="xlarge"===n,v=(t=m.trim().split(" ")).reduce((function(e,i,n){return 0!==n&&n!==t.length-1||(e="".concat(e).concat(i.charAt(0).toUpperCase())),e}),""),k={height:Up[n],width:Up[n],backgroundColor:(i=(v.charCodeAt(0)||0)+(v.charCodeAt(1)||0),zp[i%65%zp.length]||zp[0])},D=_()("neeto-ui-avatar",{"neeto-ui-avatar--medium":b,"neeto-ui-avatar--large":y,"neeto-ui-avatar--xlarge":E,"neeto-ui-avatar--round":!r,hidden:!g}),C=_()("neeto-ui-avatar__text",{"neeto-ui-avatar__text-medium":b,"neeto-ui-avatar__text-large":y,"neeto-ui-avatar__text-xlarge":E}),w=_()("neeto-ui-avatar__status","".concat(o),{"neeto-ui-avatar__status-medium":b,"neeto-ui-avatar__status-large":y,"neeto-ui-avatar__status-xlarge":E,"neeto-ui-avatar__status-square":r}),S=function(){return null==o?u.a.Fragment:u.a.createElement("span",{className:w})},O=function(){return u.a.createElement("span",{className:C},v)},T=v&&!F&&!g;return u.a.createElement("div",Bp({onClick:s,style:k,className:_()("neeto-ui-avatar--container",{"neeto-ui-avatar--container-round":!r},d)},c),u.a.createElement(S,null),T?u.a.createElement(O,null):u.a.createElement("img",{className:D,onLoad:function(){return h(!0)},onError:function(){return h(!1)},src:F,alt:"avatar-".concat(v)}))}Hp.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},Hp.propTypes={size:Pu.a.oneOf(Object.keys(Up)),user:Pu.a.shape({imageUrl:Pu.a.string,name:Pu.a.string}),isSquare:Pu.a.bool,onClick:Pu.a.func,status:Pu.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:Pu.a.string};var Gp=Hp;function Wp(e){return(Wp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vp(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $p(e,t){return($p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Xp(e);if(t){var a=Xp(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Qp(this,i)}}function Qp(e,t){if(t&&("object"===Wp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Zp(e)}function Zp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xp(e){return(Xp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jp(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var em=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$p(e,t)}(r,e);var t,i,n,a=Kp(r);function r(){var e;Yp(this,r);for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return Jp(Zp(e=a.call.apply(a,[this].concat(i))),"state",{selectedIndex:0}),Jp(Zp(e),"selectItem",(function(t){var i=e.props,n=i.items,a=i.command,r=n[t];r&&a({label:r.label,id:r.key})})),Jp(Zp(e),"upHandler",(function(){var t=e.props.items;e.setState((function(e){return{selectedIndex:(e.selectedIndex+t.length-1)%t.length}}))})),Jp(Zp(e),"downHandler",(function(){var t=e.props.items;e.setState((function(e){return{selectedIndex:(e.selectedIndex+1)%t.length}}))})),Jp(Zp(e),"enterHandler",(function(){var t=e.state.selectedIndex;e.selectItem(t)})),Jp(Zp(e),"onKeyDown",(function(t){var i=t.event,n={ArrowUp:e.upHandler,ArrowDown:e.downHandler,Enter:e.enterHandler};return!!n.hasOwnProperty(i.key)&&(n[i.key](),!0)})),e}return t=r,(i=[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,i=this.props.items;return u.a.createElement("div",{className:"relative p-2 space-y-1 overflow-hidden rounded shadow editor-command-list--root"},i.map((function(i,n){var a=i.label,r=i.imageUrl,o=i.showImage;return u.a.createElement("button",{className:_()("flex items-center w-full px-4 py-2 transition-all duration-100 ease-in-out cursor-pointer text-xs text-white rounded editor-command-list--item",{selected_item:n===t}),key:a,onClick:function(){return e.selectItem(n)}},o?u.a.createElement(Gp,{user:{name:a,imageUrl:r},className:"mr-2"}):null,u.a.createElement("span",null,a))})))}}])&&Vp(t.prototype,i),n&&Vp(t,n),r}(u.a.Component);function tm(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function im(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?tm(Object(i),!0).forEach((function(t){nm(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):tm(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function nm(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function am(e){return(am="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var rm=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.limit,n=void 0===i?5:i,a=t.showImage,r=void 0!==a&&a,o=e.map((function(e){var t;return"string"==typeof e?t={key:e,label:e}:"object"===am(e)&&(t=im({},e)),t.showImage=r,t}));return function(e){var t=e.query;return o.filter((function(e){return e.label.toLowerCase().startsWith(t.toLowerCase())})).slice(0,n)}},om=["suggestion"];function sm(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function lm(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sm(Object(i),!0).forEach((function(t){um(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sm(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function um(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function dm(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var _m={render:function(){var e,t;return{onStart:function(i){e=new Eu(em,{props:i,editor:i.editor}),t=_u("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(i){var n;return"Escape"===i.event.key?(t[0].hide(),!0):null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(i)},onExit:function(){t[0].destroy(),e.destroy()}}}},cm=function(e){var t=e.suggestion,i=void 0===t?{}:t,n=dm(e,om);return Ip.configure(lm(lm({},n),{},{suggestion:lm(lm({},_m),i)}))},fm=ns.create({name:"external-video",addOptions:function(){return{inline:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["div",{class:"video-wrapper"},["iframe",Qo(this.options.HTMLAttributes,t)]]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(i){return i.commands.insertContent({type:e.name,attrs:t})}}}}}),gm=i(20),hm=i(6),pm=i.n(hm),mm=i(7),Fm=i.n(mm),bm=i(32),ym=i.n(bm),Em={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"},vm=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(",")},km=function(e){for(var t in e.compressed=!1,e.emojis){var i=e.emojis[t];for(var n in Em)i[n]=i[Em[n]],delete i[Em[n]];i.short_names||(i.short_names=[]),i.short_names.unshift(t),i.sheet_x=i.sheet[0],i.sheet_y=i.sheet[1],delete i.sheet,i.text||(i.text=""),i.added_in||(i.added_in=6),i.added_in=i.added_in.toFixed(1),i.search=vm(i)}},Dm=String.fromCodePoint||function(){var e,t,i=16384,n=[],a=-1,r=arguments.length;if(!r)return"";for(var o="";++a<r;){var s=Number(arguments[a]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(a+1===r||n.length>i)&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o},Cm=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,wm=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function Sm(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return Dm.apply(null,t)}function Om(e){var t=e.name,i=e.short_names,n=e.skin_tone,a=e.skin_variations,r=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,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}:(n&&(_+=":skin-tone-".concat(n,":")),{id:d,name:t,short_names:i,colons:_,emoticons:r,unified:o.toLowerCase(),skin:n||(a?1:null),native:Sm(o)})}function Tm(){return Om(xm.apply(void 0,arguments))}function xm(e,t,i,n){var a={};if("string"==typeof e){var r=e.match(Cm);if(r&&(e=r[1],r[2]&&(t=parseInt(r[2],10))),n.aliases.hasOwnProperty(e)&&(e=n.aliases[e]),!n.emojis.hasOwnProperty(e))return null;a=n.emojis[e]}else e.id&&(n.aliases.hasOwnProperty(e.id)&&(e.id=n.aliases[e.id]),n.emojis.hasOwnProperty(e.id)&&(a=n.emojis[e.id],t||(t=e.skin)));if(Object.keys(a).length||((a=e).custom=!0,a.search||(a.search=vm(e))),a.emoticons||(a.emoticons=[]),a.variations||(a.variations=[]),a.skin_variations&&t>1){a=JSON.parse(JSON.stringify(a));var o=wm[t-1],s=a.skin_variations[o];if(s&&(!s.variations&&a.variations&&delete a.variations,i&&(null==s["has_img_".concat(i)]||s["has_img_".concat(i)])||!i))for(var l in a.skin_tone=t,s){var u=s[l];a[l]=u}}return a.variations&&a.variations.length&&((a=JSON.parse(JSON.stringify(a))).unified=a.variations.shift()),a}function Nm(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function Am(e,t){var i=Nm(e),n=Nm(t);return i.filter((function(e){return n.indexOf(e)>=0}))}function Mm(e,t){var i={};for(var n in e){var a=e[n],r=a;t.hasOwnProperty(n)&&(r=t[n]),"object"===ym()(r)&&(r=Mm(a,r)),i[n]=r}return i}var Rm,Im,Lm="emoji-mart",Bm="undefined"!=typeof window&&"localStorage"in window;function Pm(e,t){if(Im)Im(e,t);else{if(!Bm)return;try{window.localStorage["".concat(Lm,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var jm={update:function(e){for(var t in e){Pm(t,e[t])}},set:Pm,get:function(e){if(Rm)return Rm(e);if(Bm)try{var t=window.localStorage["".concat(Lm,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){Lm=e},setHandlers:function(e){e||(e={}),Rm=e.getter,Im=e.setter}},qm=function(){function e(t,i){pm()(this,e),t.compressed&&km(t),this.data=t||{},this.set=i||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return Fm()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var i=e.data.emojis[t],n=i.short_names,a=i.emoticons,r=i.skin_variations,o=n[0];if(a&&a.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),r){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=Tm({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=Tm(o,null,e.set,e.data);e.originalPool[o]=i};for(var i in this.data.emojis)t(i)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(i){var n=i.id||i.short_names[0];delete e[n],delete t.emojis[n]}))}},{key:"addCustomToPool",value:function(e,t){var i=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var n=e.id||e.short_names[0];n&&!t[n]&&(t[n]=xm(e,null,null,i.data),i.emojis[n]=Tm(e,null,null,i.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.emojisToShowFilter,a=i.maxResults,r=i.include,o=i.exclude,s=i.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=jm.get("skin")||1;a||(a=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|,|\-|_]+/),f=[];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,n=!(!o||!o.length)&&o.indexOf(e.id)>-1;i&&!n&&e.emojis.forEach((function(e){return _[e]=t.data.emojis[e]}))})),l.length)){var g=!r||!r.length||r.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;g&&!h&&this.addCustomToPool(l,_)}d=(f=c.map((function(e){for(var i=_,n=t.index,a=0,r=0;r<e.length;r++){var o=e[r];a++,n[o]||(n[o]={}),(n=n[o]).results||function(){var r={};for(var o in n.results=[],n.pool={},i){var s=i[o],l=s.search,d=e.substr(0,a),_=l.indexOf(d);if(-1!=_){var c=_+1;d==o&&(c=0),t.emojis[o]&&t.emojis[o][u]?n.results.push(t.emojis[o][u]):n.results.push(t.emojis[o]),n.pool[o]=s,r[o]=c}}n.results.sort((function(e,t){var i=r[e.id],n=r[t.id];return i==n?e.id.localeCompare(t.id):i-n}))}(),i=n.pool}return n.results})).filter((function(e){return e}))).length>1?Am.apply(null,f):f.length?f[0]:[]}return d&&(n&&(d=d.filter((function(e){return n(_[e.id])}))),d&&d.length>a&&(d=d.slice(0,a))),d}}]),e}(),Um=new qm(gm);var zm,Hm,Gm={search:function(){return Um.search.apply(Um,arguments)},emojis:Um.emojis,emoticons:Um.emoticons},Wm=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],Ym={};function Vm(){Hm=!0,zm=jm.get("frequently")}var $m={add:function(e){Hm||Vm();var t=e.id;zm||(zm=Ym),zm[t]||(zm[t]=0),zm[t]+=1,jm.set("last",t),jm.set("frequently",zm)},get:function(e){if(Hm||Vm(),!zm){Ym={};for(var t=[],i=0;i<e;i++)Ym[Wm[i]]=e-i,t.push(Wm[i]);return t}var n=4*e,a=[];for(var r in zm)zm.hasOwnProperty(r)&&a.push(r);var o=a.sort((function(e,t){return zm[e]-zm[t]})).reverse().slice(0,n),s=jm.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},Km=i(11),Qm=i.n(Km),Zm=i(13),Xm=i.n(Zm),Jm=i(8),eF=i.n(Jm),tF=i(9),iF=i.n(tF),nF=i(10),aF=i.n(nF),rF=i(4),oF=i.n(rF),sF={activity:function(){return u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.a.createElement("g",{transform:"translate(2.000000, 1.000000)"},u.a.createElement("rect",{id:"Rectangle",x:"8",y:"0",width:"3",height:"21",rx:"1.5"}),u.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"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.a.createElement("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.a.createElement("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"}))}},lF={search:function(){return u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},u.a.createElement("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"}))}},uF={data:Pu.a.object.isRequired,onOver:Pu.a.func,onLeave:Pu.a.func,onClick:Pu.a.func,fallback:Pu.a.func,backgroundImageFn:Pu.a.func,native:Pu.a.bool,forceSize:Pu.a.bool,tooltip:Pu.a.bool,useButton:Pu.a.bool,skin:Pu.a.oneOf([1,2,3,4,5,6]),sheetSize:Pu.a.oneOf([16,20,32,64]),sheetColumns:Pu.a.number,sheetRows:Pu.a.number,set:Pu.a.oneOf(["apple","google","twitter","facebook"]),size:Pu.a.number.isRequired,emoji:Pu.a.oneOfType([Pu.a.string,Pu.a.object]).isRequired},dF={onClick:Pu.a.func,onSelect:Pu.a.func,onSkinChange:Pu.a.func,perLine:Pu.a.number,emojiSize:Pu.a.number,i18n:Pu.a.object,style:Pu.a.object,title:Pu.a.string,emoji:Pu.a.string,color:Pu.a.string,set:uF.set,skin:uF.skin,native:Pu.a.bool,backgroundImageFn:uF.backgroundImageFn,sheetSize:uF.sheetSize,emojisToShowFilter:Pu.a.func,showPreview:Pu.a.bool,showSkinTones:Pu.a.bool,emojiTooltip:uF.tooltip,useButton:uF.useButton,theme:Pu.a.oneOf(["auto","light","dark"]),include:Pu.a.arrayOf(Pu.a.string),exclude:Pu.a.arrayOf(Pu.a.string),recent:Pu.a.arrayOf(Pu.a.string),autoFocus:Pu.a.bool,enableFrequentEmojiSort:Pu.a.bool,custom:Pu.a.arrayOf(Pu.a.shape({name:Pu.a.string.isRequired,short_names:Pu.a.arrayOf(Pu.a.string).isRequired,emoticons:Pu.a.arrayOf(Pu.a.string),keywords:Pu.a.arrayOf(Pu.a.string),imageUrl:Pu.a.string,spriteUrl:Pu.a.string,sheet_x:Pu.a.number,sheet_y:Pu.a.number,size:Pu.a.number,sheetColumns:Pu.a.number,sheetRows:Pu.a.number})),skinEmoji:Pu.a.string,notFound:Pu.a.func,notFoundEmoji:Pu.a.string,icons:Pu.a.object},_F=function(e){function t(e){var i;pm()(this,t),i=eF()(this,iF()(t).call(this,e));var n=e.categories.filter((function(e){return e.first}))[0];return i.state={selected:n.name},i.handleClick=i.handleClick.bind(oF()(i)),i}return aF()(t,e),Fm()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),i=this.props,n=i.categories;(0,i.onAnchorClick)(n[t],t)}},{key:"render",value:function(){var e=this,t=this.props,i=t.categories,n=t.color,a=t.i18n,r=t.icons,o=this.state.selected;return u.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":a.categorieslabel},i.map((function(t,i){var s=t.id,l=t.name,d=t.anchor,_=l==o;if(!1===d)return null;var c=s.startsWith("custom-")?"custom":s;return u.a.createElement("button",{key:s,"aria-label":a.categories[c],title:a.categories[c],"data-index":i,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(_?"emoji-mart-anchor-selected":""),style:{color:_?n:null}},u.a.createElement("div",{className:"emoji-mart-anchor-icon"},r.categories[c]()),u.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:n}}))})))}}]),t}(u.a.PureComponent);_F.propTypes={categories:Pu.a.array,onAnchorClick:Pu.a.func,icons:Pu.a.object},_F.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var cF={skin:1,set:"apple",sheetSize:64,sheetColumns:57,sheetRows:57,native:!1,forceSize:!1,tooltip:!1,useButton:!0,backgroundImageFn:function(e,t){return"https://unpkg.com/emoji-datasource-".concat(e,"@").concat("5.0.1","/img/").concat(e,"/sheets-256/").concat(t,".png")}},fF={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:cF.set,theme:"light",skin:null,defaultSkin:cF.skin,native:cF.native,sheetSize:cF.sheetSize,backgroundImageFn:cF.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:cF.tooltip,useButton:cF.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function gF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function hF(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var pF=function(e){return xm(e.emoji,e.skin,e.set,e.data)},mF=function(e){var t=pF(e),i=t.sheet_x,n=t.sheet_y,a=100/(e.sheetColumns-1),r=100/(e.sheetRows-1);return"".concat(a*i,"% ").concat(r*n,"%")},FF=function(e){return Tm(e.emoji,e.skin,e.set,e.data)},bF=function(e){return!isNaN(e-parseFloat(e))},yF=function e(t){for(var i in t.data.compressed&&km(t.data),e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);var n=pF(t);if(!n)return t.fallback?t.fallback(null,t):null;var a=n.unified,r=n.custom,o=n.short_names,s=n.imageUrl,l={},d=t.children,_="emoji-mart-emoji",c=a&&Sm(a),f=[c].concat(o).filter(Boolean).join(", "),g=null;if(!a&&!r)return t.fallback?t.fallback(n,t):null;if(t.tooltip&&(g=o[0]),t.native&&a)_+=" emoji-mart-emoji-native",l={fontSize:t.size},d=c,t.forceSize&&(l.display="inline-block",l.width=t.size,l.height=t.size,l.wordBreak="keep-all");else if(r)_+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=n.spriteUrl?hF({},l,{backgroundImage:"url(".concat(n.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:mF(t)}):hF({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==n["has_img_".concat(t.set)]||n["has_img_".concat(t.set)]))return t.fallback?t.fallback(n,t):null;l={width:t.size,height:t.size,display:"inline-block",backgroundImage:"url(".concat(t.backgroundImageFn(t.set,t.sheetSize),")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:mF(t)}}var h={name:"span",props:{}};return t.onClick&&t.useButton&&(h.name="button",h.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var i in e){var n=e[i];bF(n)&&(n+="px"),t.style[i]=n}return t.getAttribute("style")}(l),"<".concat(h.name," style='").concat(l,"' aria-label='").concat(f,"' ").concat(g?"title='".concat(g,"'"):""," class='").concat(_,"'>").concat(d||"","</").concat(h.name,">")):u.a.createElement(h.name,Xm()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(FF(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(FF(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(FF(t),e)}(e,t)},"aria-label":f,title:g,className:_},h.props),u.a.createElement("span",{style:l},d))};yF.propTypes=hF({},uF,{data:Pu.a.object.isRequired}),yF.defaultProps=cF;var EF=yF;function vF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var kF=function(e){function t(){return pm()(this,t),eF()(this,iF()(t).apply(this,arguments))}return aF()(t,e),Fm()(t,[{key:"render",value:function(){var e=this.props,t=e.data,i=e.emojiProps,n=e.i18n,a=e.notFound,r=e.notFoundEmoji;return a&&a()||u.a.createElement("div",{className:"emoji-mart-no-results"},EF(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?vF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):vF(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})),u.a.createElement("div",{className:"emoji-mart-no-results-label"},n.notfound))}}]),t}(u.a.PureComponent);function DF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}kF.propTypes={notFound:Pu.a.func.isRequired,emojiProps:Pu.a.object.isRequired};var CF=function(e){function t(e){var i;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).data=e.data,i.setContainerRef=i.setContainerRef.bind(oF()(i)),i.setLabelRef=i.setLabelRef.bind(oF()(i)),i}return aF()(t,e),Fm()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var i=this.props,n=i.name,a=i.perLine,r=i.native,o=i.hasStickyPosition,s=i.emojis,l=i.emojiProps,u=l.skin,d=l.size,_=l.set,c=e.perLine,f=e.native,g=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,y=!1;return"Recent"==n&&a!=c&&(y=!0),"Search"==n&&(y=!(s==h)),u==m&&d==F&&r==f&&_==b&&o==g||(y=!0),y}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),i=t.top,n=t.height,a=e.getBoundingClientRect().top,r=this.label.getBoundingClientRect().height;this.top=i-a+e.scrollTop,this.maxMargin=0==n?0:n-r}},{key:"handleScroll",value:function(e){var t=e-this.top;if((t=(t=t<this.minMargin?this.minMargin:t)>this.maxMargin?this.maxMargin:t)!=this.margin)return this.props.hasStickyPosition||(this.label.style.top="".concat(t,"px")),this.margin=t,!0}},{key:"getEmojis",value:function(){var e=this,t=this.props,i=t.name,n=t.emojis,a=t.recent,r=t.perLine;if("Recent"==i){var o=this.props.custom,s=a||$m.get(r);if(s.length&&(n=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!xm(t,null,null,e.data)}))),0===n.length&&s.length>0)return null}return n&&(n=n.slice(0)),n}},{key:"updateDisplay",value:function(e){this.getEmojis()&&this.container&&(this.container.style.display=e)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setLabelRef",value:function(e){this.label=e}},{key:"render",value:function(){var e=this,t=this.props,i=t.id,n=t.name,a=t.hasStickyPosition,r=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,d=this.getEmojis(),_={},c={},f={};d||(f={display:"none"}),a||(_={height:28},c={position:"absolute"});var g=o.categories[i]||n;return u.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":g,style:f},u.a.createElement("div",{style:_,"data-name":n,className:"emoji-mart-category-label"},u.a.createElement("span",{style:c,ref:this.setLabelRef,"aria-hidden":!0},g)),u.a.createElement("ul",{className:"emoji-mart-category-list"},d&&d.map((function(t){return u.a.createElement("li",{key:t.short_names&&t.short_names.join("_")||t},EF(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?DF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):DF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({emoji:t,data:e.data},r)))}))),d&&!d.length&&u.a.createElement(kF,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:r}))}}]),t}(u.a.Component);CF.propTypes={emojis:Pu.a.array,hasStickyPosition:Pu.a.bool,name:Pu.a.string.isRequired,native:Pu.a.bool.isRequired,perLine:Pu.a.number.isRequired,emojiProps:Pu.a.object.isRequired,recent:Pu.a.arrayOf(Pu.a.string),notFound:Pu.a.func,notFoundEmoji:Pu.a.string.isRequired},CF.defaultProps={emojis:[],hasStickyPosition:!0};var wF=function(e){function t(e){var i;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).state={opened:!1},i}return aF()(t,e),Fm()(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}(u.a.PureComponent);wF.propTypes={onChange:Pu.a.func,skin:Pu.a.number.isRequired},wF.defaultProps={onChange:function(){}};var SF=function(e){function t(e){var i;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).handleClick=i.handleClick.bind(oF()(i)),i}return aF()(t,e),Fm()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.emojiProps,n=e.data,a=e.skinEmoji,r=e.i18n,o=this.state.opened,s=[],l=1;l<=6;l++){var d=l===t;s.push(u.a.createElement("span",{key:"skin-tone-".concat(l),className:"emoji-mart-skin-swatch custom".concat(d?" selected":"")},u.a.createElement("span",{onClick:this.handleClick,"data-skin":l,className:"emoji-mart-skin-tone-".concat(l)},EF({emoji:a,data:n,skin:l,backgroundImageFn:i.backgroundImageFn,native:i.native,set:i.set,sheetSize:i.sheetSize,size:23}))))}return u.a.createElement("div",{className:"emoji-mart-skin-swatches custom".concat(o?" opened":"")},u.a.createElement("div",{className:"emoji-mart-skin-text".concat(o?" opened":"")},r.skintext),s)}}]),t}(wF);SF.propTypes={onChange:Pu.a.func,skin:Pu.a.number.isRequired,emojiProps:Pu.a.object.isRequired,skinTone:Pu.a.number,skinEmoji:Pu.a.string.isRequired,i18n:Pu.a.object},SF.defaultProps={onChange:function(){},skinTone:null};var OF=function(e){function t(e){var i;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).handleClick=i.handleClick.bind(oF()(i)),i.handleKeyDown=i.handleKeyDown.bind(oF()(i)),i}return aF()(t,e),Fm()(t,[{key:"handleKeyDown",value:function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),this.handleClick(e))}},{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.i18n,n=this.state.opened,a=[],r=1;r<=6;r++){var o=r===t,s=n||o;a.push(u.a.createElement("span",Xm()({key:"skin-tone-".concat(r),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":i.skintones[r],"aria-hidden":!s},n?{role:"menuitem"}:{}),u.a.createElement("span",Xm()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!n}:{},n?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":i.skintones[r],title:i.skintones[r],"data-skin":r,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(r)}))))}return u.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(n?" opened":""),"aria-label":i.skintext},u.a.createElement("div",n?{role:"menubar"}:{},a))}}]),t}(wF);function TF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function xF(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?TF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):TF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}OF.propTypes={onChange:Pu.a.func,skin:Pu.a.number.isRequired,i18n:Pu.a.object},OF.defaultProps={onChange:function(){}};var NF=function(e){function t(e){var i;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).data=e.data,i.state={emoji:null},i}return aF()(t,e),Fm()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,i=t.emojiProps,n=t.skinsProps,a=t.showSkinTones,r=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var d=xm(e,null,null,this.data),_=d.emoticons,c=[],f=[];return(void 0===_?[]:_).forEach((function(e){c.indexOf(e.toLowerCase())>=0||(c.push(e.toLowerCase()),f.push(e))})),u.a.createElement("div",{className:"emoji-mart-preview"},u.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},EF(xF({key:e.id,emoji:e,data:this.data},i))),u.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},u.a.createElement("div",{className:"emoji-mart-preview-name"},e.name),u.a.createElement("div",{className:"emoji-mart-preview-shortnames"},d.short_names.map((function(e){return u.a.createElement("span",{key:e,className:"emoji-mart-preview-shortname"},":",e,":")}))),u.a.createElement("div",{className:"emoji-mart-preview-emoticons"},f.map((function(e){return u.a.createElement("span",{key:e,className:"emoji-mart-preview-emoticon"},e)})))))}return u.a.createElement("div",{className:"emoji-mart-preview"},u.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},o&&o.length&&EF(xF({emoji:o,data:this.data},i))),u.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},u.a.createElement("span",{className:"emoji-mart-title-label"},r)),a&&u.a.createElement("div",{className:"emoji-mart-preview-skins".concat(n.skinEmoji?" custom":"")},n.skinEmoji?u.a.createElement(SF,{skin:n.skin,emojiProps:i,data:this.data,skinEmoji:n.skinEmoji,i18n:s,onChange:n.onChange}):u.a.createElement(OF,{skin:n.skin,i18n:s,onChange:n.onChange})))}}]),t}(u.a.PureComponent);NF.propTypes={showSkinTones:Pu.a.bool,title:Pu.a.string.isRequired,emoji:Pu.a.string.isRequired,emojiProps:Pu.a.object.isRequired,skinsProps:Pu.a.object.isRequired},NF.defaultProps={showSkinTones:!0,onChange:function(){}};var AF=0,MF=function(e){function t(e){var i,n,a,r;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).state={icon:lF.search,isSearching:!1,id:++AF},i.data=e.data,i.emojiIndex=new qm(i.data),i.setRef=i.setRef.bind(oF()(i)),i.clear=i.clear.bind(oF()(i)),i.handleKeyUp=i.handleKeyUp.bind(oF()(i)),i.handleChange=(n=i.handleChange.bind(oF()(i)),a="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,r=!1,function(){r||(r=!0,a((function(){r=!1,n()})))}),i}return aF()(t,e),Fm()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:lF.search,isSearching:!1}):this.setState({icon:lF.delete,isSearching:!0}),this.props.onSearch(this.emojiIndex.search(e,{emojisToShowFilter:this.props.emojisToShowFilter,maxResults:this.props.maxResults,include:this.props.include,exclude:this.props.exclude,custom:this.props.custom}))}},{key:"clear",value:function(){""!=this.input.value&&(this.input.value="",this.input.focus(),this.search(""))}},{key:"handleChange",value:function(){this.input&&this.search(this.input.value)}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.clear()}},{key:"setRef",value:function(e){this.input=e}},{key:"render",value:function(){var e=this.props,t=e.i18n,i=e.autoFocus,n=this.state,a=n.icon,r=n.isSearching,o=n.id,s="emoji-mart-search-".concat(o);return u.a.createElement("section",{className:"emoji-mart-search","aria-label":t.search},u.a.createElement("input",{id:s,ref:this.setRef,type:"search",onChange:this.handleChange,placeholder:t.search,autoFocus:i}),u.a.createElement("label",{className:"emoji-mart-sr-only",htmlFor:s},t.search),u.a.createElement("button",{className:"emoji-mart-search-icon",onClick:this.clear,onKeyUp:this.handleKeyUp,"aria-label":t.clear,disabled:!r},a()))}}]),t}(u.a.PureComponent);function RF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function IF(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?RF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):RF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}MF.propTypes={onSearch:Pu.a.func,maxResults:Pu.a.number,emojisToShowFilter:Pu.a.func,autoFocus:Pu.a.bool},MF.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var LF={search:"Search",clear:"Clear",notfound:"No Emoji Found",skintext:"Choose your default skin tone",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"},categorieslabel:"Emoji categories",skintones:{1:"Default Skin Tone",2:"Light Skin Tone",3:"Medium-Light Skin Tone",4:"Medium Skin Tone",5:"Medium-Dark Skin Tone",6:"Dark Skin Tone"}},BF=function(e){function t(e){var i;pm()(this,t),(i=eF()(this,iF()(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&&km(e.data),i.data=e.data,i.i18n=Mm(LF,e.i18n),i.icons=Mm(n,e.icons),i.state={firstRender:!0},i.categories=[];var a=[].concat(i.data.categories);if(e.custom.length>0){var r={},o=0;e.custom.forEach((function(e){r[e.customCategory]||(r[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=r[e.customCategory],n=IF({},e,{id:e.short_names[0],custom:!0});t.emojis.push(n),i.CUSTOM.push(n)})),a=a.concat(Object.keys(r).map((function(e){return r[e]})))}i.hideRecent=!0,null!=e.include&&a.sort((function(t,i){return e.include.indexOf(t.id)>e.include.indexOf(i.id)?1:-1}));for(var s=0;s<a.length;s++){var l=a[s],u=!e.include||!e.include.length||e.include.indexOf(l.id)>-1,d=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(l.id)>-1;if(u&&!d)if(e.emojisToShowFilter){for(var _=[],c=l.emojis,f=0;f<c.length;f++){var g=c[f];e.emojisToShowFilter(i.data.emojis[g]||g)&&_.push(g)}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(oF()(i)),i.handleAnchorClick=i.handleAnchorClick.bind(oF()(i)),i.setSearchRef=i.setSearchRef.bind(oF()(i)),i.handleSearch=i.handleSearch.bind(oF()(i)),i.setScrollRef=i.setScrollRef.bind(oF()(i)),i.handleScroll=i.handleScroll.bind(oF()(i)),i.handleScrollPaint=i.handleScrollPaint.bind(oF()(i)),i.handleEmojiOver=i.handleEmojiOver.bind(oF()(i)),i.handleEmojiLeave=i.handleEmojiLeave.bind(oF()(i)),i.handleEmojiClick=i.handleEmojiClick.bind(oF()(i)),i.handleEmojiSelect=i.handleEmojiSelect.bind(oF()(i)),i.setPreviewRef=i.setPreviewRef.bind(oF()(i)),i.handleSkinChange=i.handleSkinChange.bind(oF()(i)),i.handleKeyDown=i.handleKeyDown.bind(oF()(i)),i.handleDarkMatchMediaChange=i.handleDarkMatchMediaChange.bind(oF()(i)),i}return aF()(t,e),Fm()(t,[{key:"componentDidMount",value:function(){var e=this;this.state.firstRender&&(this.testStickyPosition(),this.firstRenderTimeout=setTimeout((function(){e.setState({firstRender:!1})}),60))}},{key:"componentDidUpdate",value:function(){this.updateCategoriesSize(),this.handleScroll()}},{key:"componentWillUnmount",value:function(){this.SEARCH_CATEGORY.emojis=null,clearTimeout(this.leaveTimeout),clearTimeout(this.firstRenderTimeout),this.darkMatchMedia&&this.darkMatchMedia.removeListener(this.handleDarkMatchMediaChange)}},{key:"testStickyPosition",value:function(){var e=document.createElement("div");["","-webkit-","-ms-","-moz-","-o-"].forEach((function(t){return e.style.position="".concat(t,"sticky")})),this.hasStickyPosition=!!e.style.position.length}},{key:"getPreferredTheme",value:function(){return"auto"!=this.props.theme?this.props.theme:this.state.theme?this.state.theme:"function"!=typeof matchMedia?fF.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?fF.theme:this.darkMatchMedia.matches?"dark":"light")}},{key:"handleDarkMatchMediaChange",value:function(){this.setState({theme:this.darkMatchMedia.matches?"dark":"light"})}},{key:"handleEmojiOver",value:function(e){var t=this.preview;if(t){var i=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n]);t.setState({emoji:e}),clearTimeout(this.leaveTimeout)}}},{key:"handleEmojiLeave",value:function(e){var t=this.preview;t&&(this.leaveTimeout=setTimeout((function(){t.setState({emoji:null})}),16))}},{key:"handleEmojiClick",value:function(e,t){this.props.onClick(e,t),this.handleEmojiSelect(e)}},{key:"handleEmojiSelect",value:function(e){var t=this;this.props.onSelect(e),this.hideRecent||this.props.recent||$m.add(e);var i=this.categoryRefs["category-1"];if(i){var n=i.maxMargin;this.props.enableFrequentEmojiSort&&i.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(i.memoizeSize(),n!=i.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&i.updateDisplay("none")))}))}}},{key:"handleScroll",value:function(){this.waitingForPaint||(this.waitingForPaint=!0,requestAnimationFrame(this.handleScrollPaint))}},{key:"handleScrollPaint",value:function(){if(this.waitingForPaint=!1,this.scroll){var e=null;if(this.SEARCH_CATEGORY.emojis)e=this.SEARCH_CATEGORY;else{for(var t=this.scroll.scrollTop,i=t>(this.scrollTop||0),n=0,a=0,r=this.categories.length;a<r;a++){var o=i?this.categories.length-1-a:a,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!n||l.top<n)&&l.top>0&&(n=l.top),u&&!e&&(e=s)}}t<n?e=this.categories.filter((function(e){return!(!1===e.anchor)}))[0]:t+this.clientHeight>=this.scrollHeight&&(e=this.categories[this.categories.length-1])}if(e){var 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 n=this.categoryRefs["category-".concat(t)];if(n&&"Search"!=n.props.name){var a=e?"none":"inherit";n.updateDisplay(a)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var i,n=this.categoryRefs["category-".concat(t)],a=this.scroll;this.anchors;i=function(){if(n){var t=n.top;e.first?t=0:t+=1,a.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(i)):i()}},{key:"handleSkinChange",value:function(e){var t={skin:e},i=this.props.onSkinChange;this.setState(t),jm.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=Tm(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(i),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var i=this.categoryRefs["category-".concat(e)];i&&i.memoizeSize()}if(this.scroll){var n=this.scroll;this.scrollHeight=n.scrollHeight,this.clientHeight=n.clientHeight}}},{key:"getCategories",value:function(){return this.state.firstRender?this.categories.slice(0,3):this.categories}},{key:"setAnchorsRef",value:function(e){this.anchors=e}},{key:"setSearchRef",value:function(e){this.search=e}},{key:"setPreviewRef",value:function(e){this.preview=e}},{key:"setScrollRef",value:function(e){this.scroll=e}},{key:"setCategoryRef",value:function(e,t){this.categoryRefs||(this.categoryRefs={}),this.categoryRefs[e]=t}},{key:"render",value:function(){var e=this,t=this.props,i=t.perLine,n=t.emojiSize,a=t.set,r=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,d=t.title,_=t.emoji,c=t.color,f=t.native,g=t.backgroundImageFn,h=t.emojisToShowFilter,p=t.showPreview,m=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,y=t.include,E=t.exclude,v=t.recent,k=t.autoFocus,D=t.skinEmoji,C=t.notFound,w=t.notFoundEmoji,S=i*(n+12)+12+2+function(){if("undefined"==typeof document)return 0;var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}(),O=this.getPreferredTheme(),T=this.props.skin||this.state.skin||jm.get("skin")||this.props.defaultSkin;return u.a.createElement("section",{style:IF({width:S},l),className:"emoji-mart emoji-mart-".concat(O),"aria-label":d,onKeyDown:this.handleKeyDown},u.a.createElement("div",{className:"emoji-mart-bar"},u.a.createElement(_F,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:c,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),u.a.createElement(MF,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:h,include:y,exclude:E,custom:this.CUSTOM,autoFocus:k}),u.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return u.a.createElement(CF,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:i,native:f,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?v:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:f,skin:T,size:n,set:a,sheetSize:r,sheetColumns:o,sheetRows:s,forceSize:f,tooltip:F,backgroundImageFn:g,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:C,notFoundEmoji:w})}))),(p||m)&&u.a.createElement("div",{className:"emoji-mart-bar"},u.a.createElement(NF,{ref:this.setPreviewRef,data:this.data,title:d,emoji:_,showSkinTones:m,showPreview:p,emojiProps:{native:f,size:38,skin:T,set:a,sheetSize:r,sheetColumns:o,sheetRows:s,backgroundImageFn:g},skinsProps:{skin:T,onChange:this.handleSkinChange,skinEmoji:D},i18n:this.i18n})))}}]),t}(u.a.PureComponent);function PF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}BF.propTypes=IF({},dF,{data:Pu.a.object.isRequired}),BF.defaultProps=IF({},fF);var jF=function(e){function t(){return pm()(this,t),eF()(this,iF()(t).apply(this,arguments))}return aF()(t,e),Fm()(t,[{key:"render",value:function(){return u.a.createElement(BF,Xm()({},this.props,this.state))}}]),t}(u.a.PureComponent);function qF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function UF(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?qF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):qF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}jF.propTypes=dF,jF.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?PF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):PF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},fF,{data:gm});var zF=function e(t){for(var i in e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);return EF(UF({},t))};zF.propTypes=uF,zF.defaultProps=UF({},cF,{data:gm});var HF=i(65);function GF(e){return(GF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function WF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YF(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function VF(e,t){return(VF=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=ZF(e);if(t){var a=ZF(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return KF(this,i)}}function KF(e,t){if(t&&("object"===GF(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return QF(e)}function QF(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZF(e){return(ZF=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function XF(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var JF=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&VF(e,t)}(r,e);var t,i,n,a=$F(r);function r(){var e;WF(this,r);for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return XF(QF(e=a.call.apply(a,[this].concat(i))),"state",{selectedIndex:0,emojiSuggestions:Gm.search(e.props.query||"smile").slice(0,5)}),XF(QF(e),"onKeyDown",(function(t){var i=t.event;if("ArrowLeft"===i.key||"ArrowDown"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===i.key||"ArrowUp"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===i.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===i.key){var n;if(Object(HF.isEmpty)(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(n=Gm.search(e.props.query))||void 0===n?void 0:n[0]).run();return!0}return"Escape"===i.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),XF(QF(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return t=r,(i=[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:Gm.search(this.props.query||"smile").slice(0,5)})}},{key:"render",value:function(){var e=this;return u.a.createElement("div",{className:"flex space-x-0.5 items-center h-10"},this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map((function(t,i){return u.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(i)},className:_()("px-2 py-0.5 text-2xl transition-all duration-200 rounded cursor-pointer hover:bg-gray-100",{"bg-gray-200":i===e.state.selectedIndex})},t.native)})):u.a.createElement("p",{className:"p-2 font-semibold text-gray-500"},"No results"))}}])&&YF(t.prototype,i),n&&YF(t,n),r}(u.a.Component);function eb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function tb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?eb(Object(i),!0).forEach((function(t){ib(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):eb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function ib(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var nb=new Ot("emoji-suggestion"),ab=ns.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:nb,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Eu(JF,{props:i,editor:i.editor}),t=_u("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start"})},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[Xg(tb({editor:this.editor},this.options.suggestion))]}}),rb=i(36),ob={insert:"head",singleton:!1},sb=(r()(rb.a,ob),rb.a.locals,i(66));function lb(e){return(lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ub(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function db(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _b(e,t){return(_b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cb(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=hb(e);if(t){var a=hb(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fb(this,i)}}function fb(e,t){if(t&&("object"===lb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return gb(e)}function gb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hb(e){return(hb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pb(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var mb=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_b(e,t)}(r,e);var t,i,n,a=cb(r);function r(){var e;ub(this,r);for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return pb(gb(e=a.call.apply(a,[this].concat(i))),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),pb(gb(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return t=r,(i=[{key:"render",value:function(){return u.a.createElement(BF,{style:{maxWidth:"100%"},data:sb,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect})}}])&&db(t.prototype,i),n&&db(t,n),r}(u.a.Component);function Fb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function bb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Fb(Object(i),!0).forEach((function(t){yb(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Fb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function yb(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var Eb=new Ot("emoji-picker"),vb=ns.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:Eb,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Eu(mb,{props:i,editor:i.editor}),t=_u("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},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[Xg(bb({editor:this.editor},this.options.suggestion))]}});function kb(e){return function(e){if(Array.isArray(e))return Db(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Db(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Db(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Db(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Cb=["forceTitle","hideSlashCommands","formatterOptions","className","uploadEndpoint","initialValue","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName"];function wb(){return(wb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Sb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ob(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ob(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ob(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Tb(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var xb=function(e,t){var i,n,a,r=e.forceTitle,o=void 0!==r&&r,s=e.hideSlashCommands,d=void 0!==s&&s,c=e.formatterOptions,f=void 0===c?["bold","italic","underline","code","highlight","strike","link"]:c,g=e.className,h=e.uploadEndpoint,p=e.initialValue,m=void 0===p?"":p,F=e.onChange,b=void 0===F?function(){}:F,y=e.menuType,E=void 0===y?"fixed":y,v=e.variables,k=e.mentions,D=e.showImageInMention,C=void 0!==D&&D,w=e.placeholder,S=e.extensions,O=e.contentClassName,T=Tb(e,Cb),x=Sb(Object(l.useState)(!1),2),N=x[0],A=x[1],M="fixed"===E,R="bubble"===E,I=!d,L=!w&&I,B=function(e){var t,i=e.forceTitle,n=e.placeholder,a=e.extensions,r=e.mentions,o=e.variables,s=e.isSlashCommandsActive,l=e.showImageInMention,u=e.setImageUploadVisible;return a?t=kb(a):(t=[Ag.extend({content:i?"heading block*":"block+"}),eg.configure({document:!1,codeBlock:!1}),jg,vg,Og,Cg,Fp,Pg,df,fm,Sg,Tg,Np.configure({placeholder:xp(n)}),ab,vb],s&&t.push(nh({setImageUploadVisible:u})),Ng()(r)||t.push(cm({suggestion:{items:rm(r,{showImage:l})}})),Ng()(o)||t.push(wp({suggestion:{items:function(){return o}}}))),t}({contentClassName:O,forceTitle:o,placeholder:w,extensions:S,mentions:k,variables:v,isSlashCommandsActive:I,showImageInMention:C,setImageUploadVisible:A}),P=yu({extensions:B,content:m,injectCSS:!1,editorProps:{attributes:{class:_()("focus:outline-none whitespace-pre-wrap p-3",(i={"slash-active":L,"fixed-menu-active border":M,"bubble-menu-active":R},n=g,a=g,n in i?Object.defineProperty(i,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[n]=a,i))}},onUpdate:function(e){var t=e.editor;return b(t.getHTML())}});return u.a.useImperativeHandle(t,(function(){return{editor:P}})),u.a.createElement("div",null,M?u.a.createElement(ac,{editor:P,variables:v,setImageUploadVisible:A}):null,R?u.a.createElement(Iu,{editor:P,formatterOptions:f}):null,u.a.createElement(Wc,{isVisible:N,setIsVisible:A,editor:P,imageUploadUrl:h}),u.a.createElement(Ou,wb({editor:P},T)))},Nb=u.a.forwardRef(xb),Ab=i(67),Mb=i.n(Ab);var Rb=i(68),Ib=i.n(Rb),Lb=["content","classNames"];function Bb(){return(Bb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Pb(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var jb=function(e){var t,i,n,a=e.content,r=void 0===a?"":a,o=e.classNames,s=Pb(e,Lb);return Object(l.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){Mb.a.highlightElement(e)}))}),[r]),u.a.createElement("div",Bb({className:_()("neeto-editor-content",(t={},i=o,n=o,i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t)),dangerouslySetInnerHTML:{__html:Ib.a.sanitize(r)}},s))}}])}));
|
|
59
|
+
*/;function M_(){return(M_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function R_(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}const I_=["onClick","reloadDocument","replace","state","target","to"],L_=["aria-current","caseSensitive","className","end","style","to"];const B_=Object(l.forwardRef)((function(e,t){let{onClick:i,reloadDocument:n,replace:a=!1,state:r,target:o,to:s}=e,u=R_(e,I_),d=D_(s),_=function(e,t){let{target:i,replace:n,state:a}=void 0===t?{}:t,r=S_(),o=w_(),s=O_(e);return Object(l.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=!!n||F_(o)===F_(s);r(e,{replace:i,state:a})}},[o,r,s,n,a,i,e])}(s,{replace:a,state:r,target:o});return Object(l.createElement)("a",M_({},u,{href:d,onClick:function(e){i&&i(e),e.defaultPrevented||n||_(e)},ref:t,target:o}))}));const P_=Object(l.forwardRef)((function(e,t){let{"aria-current":i="page",caseSensitive:n=!1,className:a="",end:r=!1,style:o,to:s}=e,u=R_(e,L_),d=w_(),_=O_(s),c=d.pathname,f=_.pathname;n||(c=c.toLowerCase(),f=f.toLowerCase());let g,h=c===f||!r&&c.startsWith(f)&&"/"===c.charAt(f.length),p=h?i:void 0;g="function"==typeof a?a({isActive:h}):[a,h?"active":null].filter(Boolean).join(" ");let m="function"==typeof o?o({isActive:h}):o;return Object(l.createElement)(B_,M_({},u,{"aria-current":p,className:g,ref:t,style:m,to:s}))}));var j_=["icon","iconPosition","iconSize","label","loading","onClick","to","type","style","fullWidth","className","disabled","size","href","tooltipProps"];function q_(){return(q_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function U_(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var z_=function(){},H_="primary",G_="secondary",W_="danger",Y_="text",V_="link",$_="large",K_="left",Q_=u.a.forwardRef((function(e,t){var i,n,a=e.icon,r=void 0===a?null:a,o=e.iconPosition,s=void 0===o?"right":o,l=e.iconSize,d=void 0===l?16:l,c=e.label,f=void 0===c?"":c,g=e.loading,h=void 0!==g&&g,p=e.onClick,m=void 0===p?z_:p,F=e.to,b=void 0===F?null:F,y=e.type,E=void 0===y?"button":y,v=e.style,k=void 0===v?"primary":v,D=e.fullWidth,C=void 0!==D&&D,w=e.className,S=void 0===w?"":w,O=e.disabled,T=void 0!==O&&O,x=e.size,N=void 0===x?null:x,A=e.href,M=void 0===A?null:A,R=e.tooltipProps,I=void 0===R?null:R,L=U_(e,j_);b?(i=B_,n={to:b}):M?(i="a",n={href:M}):(i="button",n={type:E});var B="string"==typeof r?function(){return u.a.createElement("i",{className:_()("neeto-ui-btn__icon",[r])})}:r||u.a.Fragment;return u.a.createElement(o_,q_({},I,{disabled:!I}),u.a.createElement(i,q_({ref:t,onClick:function(e){h||T||m(e)},className:_()("neeto-ui-btn",[S],{"neeto-ui-btn--style-primary":k===H_,"neeto-ui-btn--style-secondary":k===G_,"neeto-ui-btn--style-danger":k===W_,"neeto-ui-btn--style-text":k===Y_,"neeto-ui-btn--style-link":k===V_,"neeto-ui-btn--size-large":N===$_,"neeto-ui-btn--width-full":C,"neeto-ui-btn--icon-left":s==K_,"neeto-ui-btn--icon-only":!f,disabled:T}),disabled:T},n,L),f&&u.a.createElement("span",null,f),r?u.a.createElement(B,{key:"2",size:d,className:"neeto-ui-btn__icon"}):null))})),Z_=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/;function X_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return J_(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return J_(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J_(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var ec=function(e){var t=e.editor,i=Object(l.useRef)(),n=X_(Object(l.useState)(""),2),a=n[0],r=n[1],o=X_(Object(l.useState)(""),2),s=o[0],d=o[1],_=t.isActive("link"),c=function(){d(t.getAttributes("link").href||"")};return u.a.createElement(Ld,{ref:i,customTarget:function(){return u.a.createElement("button",{className:"h-full p-3 transition-colors editor-fixed-menu--item",onClick:c},u.a.createElement(Nu.Link,{size:24,color:_?"#2F3941":"#87929D"}))},className:"fontsize-dropdown",position:"bottom",closeOnSelect:!1},u.a.createElement("div",{className:"flex py-1 space-x-3 add-link-form"},u.a.createElement("div",{className:"flex-row w-full"},u.a.createElement(h_,{name:"url",value:s,placeholder:"Paste URL",onFocus:function(){return r("")},error:a,onChange:function(e){var t=e.target.value;return d(t)}})),u.a.createElement(Q_,{label:"Link",onClick:function(e){var n;(e.preventDefault(),Z_.test(s))?(t.chain().focus().setLink({href:s}).run(),null===(n=i.current)||void 0===n||n.close()):r("Please enter a valid url")},className:"self-start"}),_?u.a.createElement(Q_,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=i.current)||void 0===e||e.close()},className:"self-start"}):null))},tc=["Icon","command","active","optionName","disabled"];function ic(){return(ic=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function nc(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var ac=function(e){var t=e.editor,i=e.variables,n=e.setImageUploadVisible;if(!t)return null;var a=[{Icon:Nu.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Nu.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:Nu.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline",size:27},{Icon:Nu.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Nu.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}],r=[{Icon:Nu.Quote,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:Nu.Code,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"codeBlock"},{Icon:Nu.Image,command:function(){return n(!0)},optionName:"image-upload"}],o=[{Icon:Nu.ListDot,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:Nu.ListNumber,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}],s=[{Icon:Nu.Undo,command:function(){return t.chain().focus().undo().run()},optionName:"undo",disabled:!t.can().undo(),active:t.can().undo()},{Icon:Nu.Redo,command:function(){return t.chain().focus().redo().run()},optionName:"redo",disabled:!t.can().redo(),active:t.can().redo()}],l=function(e){var t=e.Icon,i=e.command,n=e.active,a=e.optionName,r=e.disabled,o=nc(e,tc);return u.a.createElement("button",{disabled:r,onClick:i,key:a,className:"p-3 transition-colors cursor-pointer editor-fixed-menu--item",type:"button"},u.a.createElement(t,ic({color:n?"#2F3941":"#87929D"},o)))};return u.a.createElement("div",{className:"flex space-x-6 border-t border-l border-r editor-fixed-menu--root"},u.a.createElement("div",{className:"flex"},u.a.createElement(Vu,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),u.a.createElement(Bd,{editor:t}),a.map(l)),u.a.createElement("div",{className:"flex"},u.a.createElement(ec,{editor:t}),r.map(l)),[o,s].map((function(e,t){return u.a.createElement("div",{className:"flex",key:t},e.map(l))})),u.a.createElement("div",{className:"flex justify-end flex-1"},u.a.createElement(Hd,{editor:t,variables:i})))},rc=i(12),oc=i.n(rc),sc=i(62),lc=i.n(sc),uc=function(e){var t=e.children,i=e.className,n=void 0===i?"root-portal":i,a=e.el,r=void 0===a?"div":a,o=document.getElementsByClassName(n)[0];return o||(o=document.createElement(r)).classList.add(n),u.a.useEffect((function(){document.body.appendChild(o)}),[]),mu.a.createPortal(t,o)},dc=["children","className"];function _c(){return(_c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function cc(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var fc=function(e){var t,i,n,a=e.children,r=e.className,o=cc(e,dc);return u.a.createElement("div",_c({className:_()("transition-opacity bg-gray-500 bg-opacity-50",(t={},i=r,n=r,i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t))},o),a)},gc=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"];function hc(){return(hc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function pc(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var mc=function(){},Fc="xs",bc="sm",yc="md",Ec=function(e){var t,i,n,a=e.size,r=void 0===a?"sm":a,o=e.isOpen,s=void 0!==o&&o,d=e.onClose,c=void 0===d?mc:d,f=e.loading,g=void 0!==f&&f,h=e.children,p=e.className,m=void 0===p?"":p,F=e.closeOnEsc,b=void 0===F||F,y=e.closeButton,E=void 0===y||y,v=e.backdropClassName,k=void 0===v?"":v,D=e.closeOnOutsideClick,C=void 0===D||D,w=pc(e,gc),S=Object(l.useRef)();return C&&wd(S,c),b&&Dd("esc",c),u.a.createElement(uc,{className:"neeto-ui-portal"},s&&u.a.createElement(fc,{key:"modal-backdrop",className:_()("neeto-ui-modal__backdrop",k)},u.a.createElement("div",hc({ref:S,key:"modal-wrapper",className:_()("neeto-ui-modal__wrapper",(t={"neeto-ui-modal__wrapper--xs":r===Fc,"neeto-ui-modal__wrapper--sm":r===bc,"neeto-ui-modal__wrapper--md":r===yc},i=m,n=m,i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t))},w),E&&u.a.createElement(Q_,{style:"text",icon:Nu.Close,className:"neeto-ui-modal__close",onClick:c}),g?u.a.createElement(u.a.Fragment,null):h)))},vc=["children","size","noUnderline","className"],kc=["active","className","children","icon","onClick","activeClassName"];function Dc(){return(Dc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Cc(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var wc=function(){},Sc="large",Oc=function(e){var t=e.children,i=e.size,n=e.noUnderline,a=e.className,r=void 0===a?"":a,o=Cc(e,vc);return u.a.createElement("div",Dc({className:_()({"neeto-ui-tab__wrapper flex":!0},{"neeto-ui-tab__wrapper--size-large":i===Sc},{"neeto-ui-tab__wrapper--underline-none":n},[r]),"data-cy":"tab-container"},o),t)};Oc.Item=function(e){var t=e.active,i=e.className,n=void 0===i?"":i,a=e.children,r=e.icon,o=void 0===r?null:r,s=e.onClick,l=void 0===s?wc:s,d=e.activeClassName,c=void 0===d?"":d,f=Cc(e,kc),g="button",h="string"==typeof o?function(){return u.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||u.a.Fragment;return c&&(g=P_),u.a.createElement(g,Dc({className:_()(["neeto-ui-tab flex items-center justify-center select-none",n],{active:t}),onClick:l,"data-cy":"tab-item"},f),o&&u.a.createElement(h,{className:"neeto-ui-tab__icon"}),a)};var Tc=Oc;function xc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Nc(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Nc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nc(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Ac=function(e){var t,i,n,a=e.buttonLabel,r=void 0===a?"Submit":a,o=e.placeholder,s=e.onSubmit,d=e.className,c=xc(Object(l.useState)(""),2),f=c[0],g=c[1],h=xc(Object(l.useState)(""),2),p=h[0],m=h[1];return u.a.createElement("div",{className:_()("flex flex-col items-center justify-center flex-1 mx-10 flex-wrap",(t={},i=d,n=d,i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t))},u.a.createElement("div",{className:"flex-row w-full my-4"},u.a.createElement(h_,{name:"url",value:f,placeholder:o,onFocus:function(){return m("")},error:p,onChange:function(e){var t=e.target.value;return g(t)}})),u.a.createElement(Q_,{label:r,onClick:function(e){e.preventDefault(),Z_.test(f)?s(f):m("Please enter a valid url")}}))};function Mc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rc(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Rc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rc(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Ic=function(e){var t,i=Mc(Object(l.useState)(null===(t=e[0])||void 0===t?void 0:t.key),2),n=i[0],a=i[1];return[n,function(e){return a(e.key)}]},Lc=(i(43),i(54),i(55)),Bc=i.n(Lc),Pc=(i(56),i(57),i(58),i(59),function(e){var t=e.uppy;return u.a.createElement(Bc.a,{note:"Max. File Size: 5MB",uppy:t,locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},className:"local-upload__root"})});function jc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qc(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return qc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qc(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Uc=function(e){var t=e.uppy,i=jc(Object(l.useState)(0),2),n=i[0],a=i[1];Object(l.useEffect)((function(){t.on("progress",a)}),[t]);var r="".concat(n,"%");return u.a.createElement("div",{className:"progress-bar__root"},u.a.createElement("div",{className:"flex items-center justify-between"},u.a.createElement("span",{className:"progress-bar__percent-text"},r),u.a.createElement("button",{onClick:t.cancelAll},u.a.createElement(Nu.Close,{size:16}))),u.a.createElement("div",{className:"progress-bar__indicator"},u.a.createElement("div",{className:"flex h-full"},u.a.createElement("div",{style:{width:r},className:"flex flex-col justify-center text-center text-white shadow-none whitespace-nowrap progress-bar__indicator-inner"}))))},zc=[{title:"Upload",key:"local"},{title:"Link",key:"link"}];function Hc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gc(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Gc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gc(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Wc=function(e){var t,i=e.editor,n=e.imageUploadUrl,a=e.isVisible,r=e.setIsVisible,o=Hc(Object(l.useState)(!1),2),s=o[0],d=o[1],_=Hc(Ic(zc),2),c=_[0],f=_[1],g=Object(l.useMemo)((function(){return new oc.a({allowMultipleUploads:!1,autoProceed:!0,debug:!0}).use(lc.a,{endpoint:n||"/api/v1/direct_uploads",formData:!0,fieldName:"blob"}).on("upload",(function(){return d(!0)})).on("upload-success",(function(e,t){var n=t.body.imageURL;i.chain().focus().setImage({src:n}).run(),r(!1)})).on("cancel-all",(function(){return d(!1)})).on("complete",(function(){return d(!1)}))}),[i]);return u.a.createElement(Ec,{isOpen:a,onClose:function(){return r(!1)},className:"image-uploader__modal",closeButton:!1},u.a.createElement("div",{className:"image-uploader__root"},u.a.createElement(Tc,null,zc.map((function(e){return u.a.createElement(Tc.Item,{key:e.key,active:c===e.key,onClick:function(){return f(e)}},e.title)}))),u.a.createElement("div",{className:"image-uploader__content"},s?u.a.createElement("div",{className:"flex flex-col items-center justify-center flex-1 text-center"},u.a.createElement("span",{className:"label--primary"},"Uploading..."),u.a.createElement("span",{className:"label--secondary"},null===(t=g.getFiles()[0])||void 0===t?void 0:t.name),u.a.createElement(Uc,{uppy:g})):"local"===c?u.a.createElement(Pc,{uppy:g}):"link"===c?u.a.createElement(Ac,{onSubmit:function(e){i.chain().focus().setImage({src:e}).run(),r(!1)},buttonLabel:"Upload Image",placeholder:"Paste the image link"}):null)))};const Yc=/^\s*>\s$/,Vc=ns.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",Qo(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[_s({find:Yc,type:this.type})]}}),$c=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Kc=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Qc=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Zc=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Xc=as.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",Qo(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[ls({find:$c,type:this.type}),ls({find:Qc,type:this.type})]},addPasteRules(){return[cs({find:Kc,type:this.type}),cs({find:Zc,type:this.type})]}}),Jc=/^\s*([-+*])\s$/,ef=ns.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Qo(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[_s({find:Jc,type:this.type})]}}),tf=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,nf=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,af=as.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Qo(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[ls({find:tf,type:this.type})]},addPasteRules(){return[cs({find:nf,type:this.type})]}}),rf=/^```(?<language>[a-z]*)?[\s\n]$/,of=/^~~~(?<language>[a-z]*)?[\s\n]$/,sf=ns.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:i}=this.options,n=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(i)).map(e=>e.replace(i,""))[0];return n||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands:()=>({setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,i=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!i&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[us({find:rf,type:this.type,getAttributes:({groups:e})=>e}),us({find:of,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Ct({key:new Ot("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const i=t.clipboardData.getData("text/plain"),n=t.clipboardData.getData("vscode-editor-data"),a=n?JSON.parse(n):void 0,r=null==a?void 0:a.mode;if(!i||!r)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:r})),o.setSelection(ut.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 lf=ns.create({name:"doc",topNode:!0,content:"block+"});var uf=function(e,t){var i=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var n=function(e){return i[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))};uf.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var i=t.name,n=t.handler;return e.editorView.dom.removeEventListener(i,n)}))},uf.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())},uf.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},uf.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var i=t.nodeBefore,n=t.nodeAfter;if(i||n){var a=this.editorView.nodeDOM(this.cursorPos-(i?i.nodeSize:0)).getBoundingClientRect(),r=i?a.bottom:a.top;i&&n&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:a.left,right:a.right,top:r-this.width/2,bottom:r+this.width/2}}}if(!e){var o=this.editorView.coordsAtPos(this.cursorPos);e={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var 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"},uf.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},uf.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=We(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},uf.prototype.dragend=function(){this.scheduleRemoval(20)},uf.prototype.drop=function(){this.scheduleRemoval(20)},uf.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const df=ur.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Ct({view:function(t){return new uf(t,e)}}))];var e}});var _f=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,n){var a=i.resolve(n.map(this.head));return t.valid(a)?new t(a):e.near(a)},t.prototype.content=function(){return E.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 cf(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var i=e.index(t);if(0!=i)for(var n=e.node(t).child(i-1);;n=n.lastChild){if(0==n.childCount&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var i=e.indexAfter(t),n=e.node(t);if(i!=n.childCount)for(var a=n.child(i);;a=a.firstChild){if(0==a.childCount&&!a.inlineContent||a.isAtom||a.type.spec.isolating)return!0;if(a.inlineContent)return!1}}return!0}(e))return!1;var i=t.type.spec.allowGapCursor;if(null!=i)return i;var n=t.contentMatchAt(e.index()).defaultType;return n&&n.isTextblock},t.findFrom=function(e,i,n){e:for(;;){if(!n&&t.valid(e))return e;for(var a=e.pos,r=null,o=e.depth;;o--){var s=e.node(o);if(i>0?e.indexAfter(o)<s.childCount:e.index(o)>0){r=s.child(i>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;a+=i;var l=e.doc.resolve(a);if(t.valid(l))return l}for(;;){var u=i>0?r.firstChild:r.lastChild;if(!u){if(r.isAtom&&!r.isText&&!_t.isSelectable(r)){e=e.doc.resolve(a+r.nodeSize*i),n=!1;continue e}break}r=u,a+=i;var d=e.doc.resolve(a);if(t.valid(d))return d}return null}},t}(ot);_f.prototype.visible=!1,ot.jsonID("gapcursor",_f);var cf=function(e){this.pos=e};cf.prototype.map=function(e){return new cf(e.map(this.pos))},cf.prototype.resolve=function(e){var t=e.resolve(this.pos);return _f.valid(t)?new _f(t):ot.near(t)};var ff=nr({ArrowLeft:gf("horiz",-1),ArrowRight:gf("horiz",1),ArrowUp:gf("vert",-1),ArrowDown:gf("vert",1)});function gf(e,t){var i="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,n,a){var r=e.selection,o=t>0?r.$to:r.$from,s=r.empty;if(r instanceof ut){if(!a.endOfTextblock(i)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=_f.findFrom(o,t,s);return!!l&&(n&&n(e.tr.setSelection(new _f(l))),!0)}}function hf(e,t,i){if(!e.editable)return!1;var n=e.state.doc.resolve(t);if(!_f.valid(n))return!1;var a=e.posAtCoords({left:i.clientX,top:i.clientY}).inside;return!(a>-1&&_t.isSelectable(e.state.doc.nodeAt(a)))&&(e.dispatch(e.state.tr.setSelection(new _f(n))),!0)}function pf(e){if(!(e.selection instanceof _f))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",wa.create(e.doc,[va.widget(e.selection.head,t,{key:"gapcursor"})])}const mf=ur.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Ct({props:{decorations:pf,createSelectionBetween:function(e,t,i){if(t.pos==i.pos&&_f.valid(i))return new _f(i)},handleClick:hf,handleKeyDown:ff}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=sr(lr(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),Ff=ns.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Qo(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:i,editor:n})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:a}=n.extensionManager,r=i.storedMarks||i.selection.$to.parentOffset&&i.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:i})=>{if(i&&r&&e){const e=r.filter(e=>a.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),bf=ns.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]),Qo(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=>us({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var yf=function(){};yf.prototype.append=function(e){return e.length?(e=yf.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},yf.prototype.prepend=function(e){return e.length?yf.from(e).append(this):this},yf.prototype.appendInner=function(e){return new vf(this,e)},yf.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?yf.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},yf.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},yf.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)},yf.prototype.map=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length);var n=[];return this.forEach((function(t,i){return n.push(e(t,i))}),t,i),n},yf.from=function(e){return e instanceof yf?e:e&&e.length?new Ef(e):yf.empty};var Ef=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,i){return 0==e&&i==this.length?this:new t(this.values.slice(e,i))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,i,n){for(var a=t;a<i;a++)if(!1===e(this.values[a],n+a))return!1},t.prototype.forEachInvertedInner=function(e,t,i,n){for(var a=t-1;a>=i;a--)if(!1===e(this.values[a],n+a))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},i.length.get=function(){return this.values.length},i.depth.get=function(){return 0},Object.defineProperties(t.prototype,i),t}(yf);yf.empty=new Ef([]);var vf=function(e){function t(t,i){e.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,i,n){var a=this.left.length;return!(t<a&&!1===this.left.forEachInner(e,t,Math.min(i,a),n))&&(!(i>a&&!1===this.right.forEachInner(e,Math.max(t-a,0),Math.min(this.length,i)-a,n+a))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,i,n){var a=this.left.length;return!(t>a&&!1===this.right.forEachInvertedInner(e,t-a,Math.max(i,a)-a,n+a))&&(!(i<a&&!1===this.left.forEachInvertedInner(e,Math.min(t,a),i,n))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var i=this.left.length;return t<=i?this.left.slice(e,t):e>=i?this.right.slice(e-i,t-i):this.left.slice(e,i).append(this.right.slice(0,t-i))},t.prototype.leafAppend=function(e){var i=this.right.leafAppend(e);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(e){var i=this.left.leafPrepend(e);if(i)return new t(i,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(yf),kf=yf,Df=function(e,t){this.items=e,this.eventCount=t};Df.prototype.popEvent=function(e,t){var i=this;if(0==this.eventCount)return null;for(var n,a,r=this.items.length;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(n=this.remapping(r,this.items.length),a=n.maps.length);var o,s,l=e.tr,u=[],d=[];return this.items.forEach((function(e,t){if(!e.step)return n||(n=i.remapping(r,t+1),a=n.maps.length),a--,void d.push(e);if(n){d.push(new Cf(e.map));var _,c=e.step.map(n.slice(a));c&&l.maybeStep(c).doc&&(_=l.mapping.maps[l.mapping.maps.length-1],u.push(new Cf(_,null,null,u.length+d.length))),a--,_&&n.appendMap(_,a)}else l.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(a)):e.selection,s=new Df(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}},Df.prototype.addTransform=function(e,t,i,n){for(var a=[],r=this.eventCount,o=this.items,s=!n&&o.length?o.get(o.length-1):null,l=0;l<e.steps.length;l++){var u,d=e.steps[l].invert(e.docs[l]),_=new Cf(e.mapping.maps[l],d,t);(u=s&&s.merge(_))&&(_=u,l?a.pop():o=o.slice(0,o.length-1)),a.push(_),t&&(r++,t=null),n||(s=_)}var c,f,g,h=r-i.depth;return h>Sf&&(f=h,(c=o).forEach((function(e,t){if(e.selection&&0==f--)return g=t,!1})),o=c.slice(g),r-=h),new Df(o.append(a),r)},Df.prototype.remapping=function(e,t){var i=new Se;return this.items.forEach((function(t,n){var a=null!=t.mirrorOffset&&n-t.mirrorOffset>=e?i.maps.length-t.mirrorOffset:null;i.appendMap(t.map,a)}),e,t),i},Df.prototype.addMaps=function(e){return 0==this.eventCount?this:new Df(this.items.append(e.map((function(e){return new Cf(e)}))),this.eventCount)},Df.prototype.rebased=function(e,t){if(!this.eventCount)return this;var i=[],n=Math.max(0,this.items.length-t),a=e.mapping,r=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),n);var s=t;this.items.forEach((function(t){var n=a.getMirror(--s);if(null!=n){r=Math.min(r,n);var l=a.maps[n];if(t.step){var u=e.steps[n].invert(e.docs[n]),d=t.selection&&t.selection.map(a.slice(s+1,n));d&&o++,i.push(new Cf(l,u,d))}else i.push(new Cf(l))}}),n);for(var l=[],u=t;u<r;u++)l.push(new Cf(a.maps[u]));var d=this.items.slice(0,n).append(l).append(i),_=new Df(d,o);return _.emptyItemCount()>500&&(_=_.compress(this.items.length-i.length)),_},Df.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},Df.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),i=t.maps.length,n=[],a=0;return this.items.forEach((function(r,o){if(o>=e)n.push(r),r.selection&&a++;else if(r.step){var s=r.step.map(t.slice(i)),l=s&&s.getMap();if(i--,l&&t.appendMap(l,i),s){var u=r.selection&&r.selection.map(t.slice(i));u&&a++;var d,_=new Cf(l.invert(),s,u),c=n.length-1;(d=n.length&&n[c].merge(_))?n[c]=d:n.push(_)}}else r.map&&i--}),this.items.length,0),new Df(kf.from(n.reverse()),a)},Df.empty=new Df(kf.empty,0);var Cf=function(e,t,i,n){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=n};Cf.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new Cf(t.getMap().invert(),t,this.selection)}};var wf=function(e,t,i,n){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=n},Sf=20;function Of(e){var t=[];return e.forEach((function(e,i,n,a){return t.push(n,a)})),t}function Tf(e,t){if(!e)return null;for(var i=[],n=0;n<e.length;n+=2){var a=t.map(e[n],1),r=t.map(e[n+1],-1);a<=r&&i.push(a,r)}return i}function xf(e,t,i,n){var a=Mf(t),r=Rf.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,a);if(o){var s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),r,a),u=new wf(n?l:o.remaining,n?o.remaining:l,null,0);i(o.transform.setSelection(s).setMeta(Rf,{redo:n,historyState:u}).scrollIntoView())}}var Nf=!1,Af=null;function Mf(e){var t=e.plugins;if(Af!=t){Nf=!1,Af=t;for(var i=0;i<t.length;i++)if(t[i].spec.historyPreserveItems){Nf=!0;break}}return Nf}var Rf=new Ot("history"),If=new Ot("closeHistory");function Lf(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Ct({key:Rf,state:{init:function(){return new wf(Df.empty,Df.empty,null,0)},apply:function(t,i,n){return function(e,t,i,n){var a,r=i.getMeta(Rf);if(r)return r.historyState;i.getMeta(If)&&(e=new wf(e.done,e.undone,null,0));var o=i.getMeta("appendedTransaction");if(0==i.steps.length)return e;if(o&&o.getMeta(Rf))return o.getMeta(Rf).redo?new wf(e.done.addTransform(i,null,n,Mf(t)),e.undone,Of(i.mapping.maps[i.steps.length-1]),e.prevTime):new wf(e.done,e.undone.addTransform(i,null,n,Mf(t)),null,e.prevTime);if(!1===i.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(a=i.getMeta("rebased"))?new wf(e.done.rebased(i,a),e.undone.rebased(i,a),Tf(e.prevRanges,i.mapping),e.prevTime):new wf(e.done.addMaps(i.mapping.maps),e.undone.addMaps(i.mapping.maps),Tf(e.prevRanges,i.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(i.time||0)-n.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var i=!1;return e.mapping.maps[0].forEach((function(e,n){for(var a=0;a<t.length;a+=2)e<=t[a+1]&&n>=t[a]&&(i=!0)})),i}(i,e.prevRanges)),l=o?Tf(e.prevRanges,i.mapping):Of(i.mapping.maps[i.steps.length-1]);return new wf(e.done.addTransform(i,s?t.selection.getBookmark():null,n,Mf(t)),Df.empty,l,i.time)}(i,n,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var i="historyUndo"==t.inputType?Bf(e.state,e.dispatch):"historyRedo"==t.inputType&&Pf(e.state,e.dispatch);return i&&t.preventDefault(),i}}}})}function Bf(e,t){var i=Rf.getState(e);return!(!i||0==i.done.eventCount)&&(t&&xf(i,e,t,!1),!0)}function Pf(e,t){var i=Rf.getState(e);return!(!i||0==i.undone.eventCount)&&(t&&xf(i,e,t,!0),!0)}const jf=ur.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Bf(e,t),redo:()=>({state:e,dispatch:t})=>Pf(e,t)}),addProseMirrorPlugins(){return[Lf(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()}}}),qf=ns.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Qo(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:i}=e,{empty:n,$anchor:a}=i,r=a.parent.isTextblock&&!a.parent.type.spec.code&&!a.parent.textContent;if(!n||!r||!t)return!0;const o=a.before(),s=a.start();return e.deleteRange(o,s),e.setSelection(ut.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var i;if(t){const{parent:t,pos:n}=e.selection.$from,a=n+1;if(!e.doc.nodeAt(a)){const n=null===(i=t.type.contentMatch.defaultType)||void 0===i?void 0:i.create();n&&(e.insert(a,n),e.setSelection(ut.create(e.doc,a)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[rs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Uf=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,zf=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Hf=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Gf=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Wf=as.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",Qo(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[ls({find:Uf,type:this.type}),ls({find:Hf,type:this.type})]},addPasteRules(){return[cs({find:zf,type:this.type}),cs({find:Gf,type:this.type})]}}),Yf=ns.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Qo(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")}}}),Vf=/^(\d+)\.\s$/,$f=ns.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",Qo(this.options.HTMLAttributes,i),0]:["ol",Qo(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[_s({find:Vf,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),Kf=ns.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Qo(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Qf=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Zf=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Xf=as.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",Qo(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[ls({find:Qf,type:this.type})]},addPasteRules(){return[cs({find:Zf,type:this.type})]}});var Jf=ns.create({name:"text",group:"inline"});const eg=ur.create({name:"starterKit",addExtensions(){var e,t,i,n,a,r,o,s,l,u,d,_,c,f,g,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(Vc.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(Xc.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(ef.configure(null===(i=this.options)||void 0===i?void 0:i.bulletList)),!1!==this.options.code&&F.push(af.configure(null===(n=this.options)||void 0===n?void 0:n.code)),!1!==this.options.codeBlock&&F.push(sf.configure(null===(a=this.options)||void 0===a?void 0:a.codeBlock)),!1!==this.options.document&&F.push(lf.configure(null===(r=this.options)||void 0===r?void 0:r.document)),!1!==this.options.dropcursor&&F.push(df.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(mf.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(Ff.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push(bf.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push(jf.configure(null===(d=this.options)||void 0===d?void 0:d.history)),!1!==this.options.horizontalRule&&F.push(qf.configure(null===(_=this.options)||void 0===_?void 0:_.horizontalRule)),!1!==this.options.italic&&F.push(Wf.configure(null===(c=this.options)||void 0===c?void 0:c.italic)),!1!==this.options.listItem&&F.push(Yf.configure(null===(f=this.options)||void 0===f?void 0:f.listItem)),!1!==this.options.orderedList&&F.push($f.configure(null===(g=this.options)||void 0===g?void 0:g.orderedList)),!1!==this.options.paragraph&&F.push(Kf.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(Xf.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(Jf.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),tg=ds({find:/--$/,replace:"—"}),ig=ds({find:/\.\.\.$/,replace:"…"}),ng=ds({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),ag=ds({find:/"$/,replace:"”"}),rg=ds({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),og=ds({find:/'$/,replace:"’"}),sg=ds({find:/<-$/,replace:"←"}),lg=ds({find:/->$/,replace:"→"}),ug=ds({find:/\(c\)$/,replace:"©"}),dg=ds({find:/\(tm\)$/,replace:"™"}),_g=ds({find:/\(r\)$/,replace:"®"}),cg=ds({find:/1\/2$/,replace:"½"}),fg=ds({find:/\+\/-$/,replace:"±"}),gg=ds({find:/!=$/,replace:"≠"}),hg=ds({find:/<<$/,replace:"«"}),pg=ds({find:/>>$/,replace:"»"}),mg=ds({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),Fg=ds({find:/\^2$/,replace:"²"}),bg=ds({find:/\^3$/,replace:"³"}),yg=ds({find:/1\/4$/,replace:"¼"}),Eg=ds({find:/3\/4$/,replace:"¾"}),vg=ur.create({name:"typography",addInputRules:()=>[tg,ig,ng,ag,rg,og,sg,lg,ug,dg,_g,cg,fg,gg,hg,pg,mg,Fg,bg,yg,Eg]}),kg=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,Dg=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,Cg=as.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",Qo(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[ls({find:kg,type:this.type})]},addPasteRules(){return[cs({find:Dg,type:this.type})]}});var wg=i(35);const Sg=as.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",Qo(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[cs({find:e=>Object(wg.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 Ct({key:new Ot("handleClickLink"),props:{handleClick:(e,t,i)=>{var n;const a=this.editor.getAttributes("link");return!(!(null===(n=i.target)||void 0===n?void 0:n.closest("a"))||!a.href)&&(window.open(a.href,a.target),!0)}}})),this.options.linkOnPaste&&e.push(new Ct({key:new Ot("handlePasteLink"),props:{handlePaste:(e,t,i)=>{const{state:n}=e,{selection:a}=n,{empty:r}=a;if(r)return!1;let o="";i.content.forEach(e=>{o+=e.textContent});const s=Object(wg.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),Og=as.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",Qo(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const i=so(e,this.type);return!!Object.entries(i).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),Tg=ur.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 xg=i(23),Ng=i.n(xg);var Ag=ns.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Ct({key:new Ot("eventHandler"),props:{handleClick:function(t,i){var n=t.state,a=n.doc.lastChild,r=n.doc.resolve(i).nodeBefore;if(a&&r){var o=a.eq(r),s=a.isInline,l=["paragraph","text"].includes(a.type.name);!o||s||l||e.commands.insertContentAt(i,{type:"paragraph",content:""})}}}})]}});const Mg=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,Rg=ns.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",Qo(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[rs({find:Mg,type:this.type,getAttributes:e=>{const[,,t,i,n]=e;return{src:i,alt:t,title:n}}})]}});function Ig(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Lg(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ig(Object(i),!0).forEach((function(t){Bg(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ig(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Bg(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var Pg=Rg.extend({name:"image",addAttributes:function(){return Lg(Lg({},Rg.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(i){var n,a,r,o=i.tr,s=i.commands;return"image"==(null===(n=o.selection)||void 0===n||null===(a=n.node)||void 0===a||null===(r=a.type)||void 0===r?void 0:r.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}}}},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return i.class=" image-"+t.attrs.size,i.class+=" image-float-"+t.attrs.float,["img",Qo(this.options.HTMLAttributes,i)]}});const jg=as.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",Qo(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()}}});function qg(e){return(qg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ug(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function zg(e,t){return(zg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Yg(e);if(t){var a=Yg(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Gg(this,i)}}function Gg(e,t){if(t&&("object"===qg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wg(e)}function Wg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yg(e){return(Yg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vg(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var $g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zg(e,t)}(r,e);var t,i,n,a=Hg(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),Vg(Wg(t=a.call(this,e)),"onKeyDown",(function(e){var i=e.event;return"ArrowUp"===i.key?(t.upHandler(),!0):"ArrowDown"===i.key?(t.downHandler(),!0):"Enter"===i.key&&(t.enterHandler(),!0)})),Vg(Wg(t),"upHandler",(function(){t.setState({selectedIndex:(t.state.selectedIndex+t.props.items.length-1)%t.props.items.length})})),Vg(Wg(t),"downHandler",(function(){t.setState({selectedIndex:(t.state.selectedIndex+1)%t.props.items.length})})),Vg(Wg(t),"enterHandler",(function(){t.selectItem(t.state.selectedIndex)})),Vg(Wg(t),"selectItem",(function(e){var i=t.props.items[e];if(i){var n=t.props,a=n.editor,r=n.range;i.command({editor:a,range:r})}})),Vg(Wg(t),"scrollHandler",(function(){var e=t.menuRef.current,i=e.children[t.state.selectedIndex],n=i.clientHeight+8,a=e.scrollTop;i.offsetTop+n>a+e.clientHeight?a=i.offsetTop-e.clientHeight+n:a>i.offsetTop&&(a=i.offsetTop-8),t.menuRef.current.scrollTop=a})),t.state={selectedIndex:0},t.menuRef=u.a.createRef(),t}return t=r,(i=[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),this.scrollHandler()}},{key:"render",value:function(){var e=this;return u.a.createElement("div",{ref:this.menuRef,className:"relative p-3 -mr-1 space-y-2 overflow-x-hidden overflow-y-scroll rounded shadow max-h-80 w-80 editor-command-list--root"},this.props.items.map((function(t,i){return u.a.createElement(Kg,{key:t.title,item:t,index:i,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(i)}})})))}}])&&Ug(t.prototype,i),n&&Ug(t,n),r}(u.a.Component),Kg=function(e){var t=e.item,i=e.selectedIndex,n=e.index,a=e.selectItem,r=t.Icon;return u.a.createElement("div",{className:_()("flex items-center w-full px-4 py-2 space-x-4 transition-all duration-100 ease-in-out editor-command-list--item cursor-pointer rounded",{selected_item:n===i}),onClick:function(){return a(n)}},r&&u.a.createElement("div",{className:"p-1 text-gray-100 rounded-sm"},u.a.createElement(r,{size:18})),u.a.createElement("div",{className:"flex flex-col text-gray-100"},u.a.createElement("span",{className:"text-sm font-semibold"},t.title),u.a.createElement("span",{className:"text-xs text-gray-300"},t.description)))},Qg=$g;const Zg=new Ot("suggestion");function Xg({pluginKey:e=Zg,editor:t,char:i="@",allowSpaces:n=!1,prefixSpace:a=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:_=(()=>!0)}){const c=null==d?void 0:d();return new Ct({key:e,view(){return{update:async(e,i)=>{var n,a,r,o,s;const d=null===(n=this.key)||void 0===n?void 0:n.getState(i),_=null===(a=this.key)||void 0===a?void 0:a.getState(e.state),f=d.active&&_.active&&d.range.from!==_.range.from,g=!d.active&&_.active,h=d.active&&!_.active,p=g||f,m=!g&&!h&&d.query!==_.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:_,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:y,clientRect:y?()=>{var e;const{decorationId: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,E)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,E)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,E))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:d}=l,c={...o};if(c.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:n,startOfLine:a,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=a?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=r.depth<=0?0:r.before(),_=r.pos,c=r.doc.textBetween(d,_,"\0","\0"),f=Array.from(c.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(n&&!h)return null;const p=f.index+r.start();let m=p+f[0].length;return i&&s.test(c.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:i,allowSpaces:n,prefixSpace:a,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:n,range:a}=this.getState(e.state);return n&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:a}))||!1},decorations(e){const{active:t,range:i,decorationId:n}=this.getState(e);return t?wa.create(e.doc,[va.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":n})]):null}}})}function Jg(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function eh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Jg(Object(i),!0).forEach((function(t){th(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Jg(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function th(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var ih=new Ot("commands"),nh=function(e){var t=e.setImageUploadVisible;return ur.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:ih,command:function(e){var t=e.editor,i=e.range;e.props.command({editor:t,range:i})},items:function(e){var i=e.query,n=[{title:"Paragraph",description:"Add a plain text block",Icon:Nu.Paragraph,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("paragraph").run()}},{title:"H1",description:"Add a big heading",Icon:Nu.TextH1,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:1}).run()}},{title:"H2",description:"Add a sub-heading",Icon:Nu.TextH2,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:2}).run()}},{title:"Numbered list",description:"Add a list with numbering",Icon:Nu.ListNumber,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleOrderedList().run()}},{title:"Bulleted list",description:"Add an list bullets",Icon:Nu.ListDot,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBulletList().run()}},{title:"Blockquote",description:"Add a quote",Icon:Nu.Blockquote,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBlockquote().run()}},{title:"Image",description:"Add an image",Icon:Nu.Image,command:function(e){var i=e.editor,n=e.range;t(!0),i.chain().focus().deleteRange(n).run()}},{title:"Youtube/Vimeo",description:"Embed a video from major services",Icon:Nu.Video,command:function(e){var t=e.editor,i=e.range,n=prompt("Please enter Youtube/Vimeo embed URL");t.chain().focus().deleteRange(i).setExternalVideo({src:n}).run()}},{title:"Code block",description:"Add a code block with syntax highlighting",Icon:Nu.Code,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleCodeBlock().run()}},{title:"Emoji",description:"Add an emoji",Icon:Nu.Smiley,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("::").run()}}],a=n.filter((function(e){return e.title.toLowerCase().includes(i.toLowerCase())}));return Ng()(a)?[{title:"No results",command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).run()}}]:a},render:function(){var e,t;return{onStart:function(i){e=new Eu(Qg,{props:i,editor:i.editor}),t=_u("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1})},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()}}}}}},addProseMirrorPlugins:function(){return[Xg(eh({editor:this.editor},this.options.suggestion))]}})},ah={};function rh(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)||rh(i)})),e}var oh=rh,sh=rh;oh.default=sh;class lh{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function uh(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function dh(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 _h=e=>!!e.kind;class ch{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=uh(e)}openNode(e){if(!_h(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){_h(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class fh{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=>{fh._collapse(e)}))}}class gh extends fh{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 ch(this,this.options).value()}finalize(){return!0}}function hh(e){return e?"string"==typeof e?e:e.source:null}const ph=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const mh="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Fh={begin:"\\\\[\\s\\S]",relevance:0},bh={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[Fh]},yh={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[Fh]},Eh={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/},vh=function(e,t,i={}){const n=dh({className:"comment",begin:e,end:t,contains:[]},i);return n.contains.push(Eh),n.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),n},kh=vh("//","$"),Dh=vh("/\\*","\\*/"),Ch=vh("#","$"),wh={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},Sh={className:"number",begin:mh,relevance:0},Oh={className:"number",begin:"\\b(0b[01]+)",relevance:0},Th={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},xh={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Fh,{begin:/\[/,end:/\]/,relevance:0,contains:[Fh]}]}]},Nh={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},Ah={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},Mh={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var Rh=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:mh,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>hh(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),dh({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:Fh,APOS_STRING_MODE:bh,QUOTE_STRING_MODE:yh,PHRASAL_WORDS_MODE:Eh,COMMENT:vh,C_LINE_COMMENT_MODE:kh,C_BLOCK_COMMENT_MODE:Dh,HASH_COMMENT_MODE:Ch,NUMBER_MODE:wh,C_NUMBER_MODE:Sh,BINARY_NUMBER_MODE:Oh,CSS_NUMBER_MODE:Th,REGEXP_MODE:xh,TITLE_MODE:Nh,UNDERSCORE_TITLE_MODE:Ah,METHOD_GUARD:Mh,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 Ih(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function Lh(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Ih,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Bh(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>hh(e)).join("|")+")"}(...e.illegal))}function Ph(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 jh(e,t){void 0===e.relevance&&(e.relevance=1)}const qh=["of","and","for","in","not","or","if","then","parent","list","value"];function Uh(e,t){return t?Number(t):function(e){return qh.includes(e.toLowerCase())}(e)?0:1}function zh(e,{plugins:t}){function i(t,i){return new RegExp(hh(t),"m"+(e.case_insensitive?"i":"")+(i?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=i(function(e,t="|"){let i=0;return e.map(e=>{i+=1;const t=i;let n=hh(e),a="";for(;n.length>0;){const e=ph.exec(n);if(!e){a+=n;break}a+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?a+="\\"+String(Number(e[1])+t):(a+=e[0],"("===e[0]&&i++)}return a}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex((e,t)=>t>0&&void 0!==e),n=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,n)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,i])=>t.addRule(e,i)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=dh(e.classNameAliases||{}),function t(n,r){const o=n;if(n.isCompiled)return o;[Ph].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[Lh,Bh,jh].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;if("object"==typeof n.keywords&&(s=n.keywords.$pattern,delete n.keywords.$pattern),n.keywords&&(n.keywords=function e(t,i,n="keyword"){const a={};return"string"==typeof t?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach((function(n){Object.assign(a,e(t[n],i,n))})),a;function r(e,t){i&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const i=t.split("|");a[i[0]]=[e,Uh(i[0],i[1])]}))}}(n.keywords,e.case_insensitive)),n.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||n.lexemes||/\w+/,o.keywordPatternRe=i(s,!0),r&&(n.begin||(n.begin=/\B|\b/),o.beginRe=i(n.begin),n.endSameAsBegin&&(n.end=n.begin),n.end||n.endsWithParent||(n.end=/\B|\b/),n.end&&(o.endRe=i(n.end)),o.terminatorEnd=hh(n.end)||"",n.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(n.end?"|":"")+r.terminatorEnd)),n.illegal&&(o.illegalRe=i(n.illegal)),n.contains||(n.contains=[]),n.contains=[].concat(...n.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return dh(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return dh(e,{starts:e.starts?dh(e.starts):null});if(Object.isFrozen(e))return dh(e);return e}("self"===e?n:e)}))),n.contains.forEach((function(e){t(e,o)})),n.starts&&t(n.starts,r),o.matcher=function(e){const t=new a;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function Hh(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,uh(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 Gh={"after:highlightElement":({el:e,result:t,text:i})=>{const n=Yh(e);if(!n.length)return;const a=document.createElement("div");a.innerHTML=t.value,t.value=function(e,t,i){let n=0,a="";const r=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){a+="<"+Wh(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+uh(e.value)+'"'})).join("")+">"}function l(e){a+="</"+Wh(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(a+=uh(i.substring(n,t[0].offset)),n=t[0].offset,t===e){r.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===n);r.reverse().forEach(s)}else"start"===t[0].event?r.push(t[0].node):r.pop(),u(t.splice(0,1)[0])}return a+uh(i.substr(n))}(n,Yh(a),i)}};function Wh(e){return e.nodeName.toLowerCase()}function Yh(e){const t=[];return function e(i,n){for(let a=i.firstChild;a;a=a.nextSibling)3===a.nodeType?n+=a.nodeValue.length:1===a.nodeType&&(t.push({event:"start",offset:n,node:a}),n=e(a,n),Wh(a).match(/br|hr|img|input/)||t.push({event:"stop",offset:n,node:a}));return n}(e,0),t}const Vh={},$h=e=>{console.error(e)},Kh=(e,...t)=>{console.log("WARN: "+e,...t)},Qh=(e,t)=>{Vh[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Vh[`${e}/${t}`]=!0)},Zh=uh,Xh=dh,Jh=Symbol("nomatch");var ep=function(e){const t=Object.create(null),i=Object.create(null),n=[];let a=!0;const r=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:gh};function u(e){return l.noHighlightRe.test(e)}function d(e,t,i,n){let a="",r="";"object"==typeof t?(a=e,i=t.ignoreIllegals,r=t.language,n=void 0):(Qh("10.7.0","highlight(lang, code, ...args) has been deprecated."),Qh("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,a=t);const o={code:a,language:r};k("before:highlight",o);const s=o.result?o.result:_(o.language,o.code,i,n);return s.code=o.code,k("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!=k.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void C.addText(w);e=_(k.subLanguage,w,!0,D[k.subLanguage]),D[k.subLanguage]=e.top}else e=c(w,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),C.addSublanguage(e.emitter,e.language)}():function(){if(!k.keywords)return void C.addText(w);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(w),i="";for(;t;){i+=w.substring(e,t.index);const n=u(k,t);if(n){const[e,a]=n;if(C.addText(i),i="",S+=a,e.startsWith("_"))i+=t[0];else{const i=b.classNameAliases[e]||e;C.addKeyword(t[0],i)}}else i+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(w)}i+=w.substr(e),C.addText(i)}(),w=""}function f(e){return e.className&&C.openNode(b.classNameAliases[e.className]||e.className),k=Object.create(e,{parent:{value:k}}),k}function g(e){return 0===k.matcher.regexIndex?(w+=e[0],1):(x=!0,0)}function h(e){const t=e[0],i=e.rule,n=new lh(i),a=[i.__beforeBegin,i["on:begin"]];for(const i of a)if(i&&(i(e,n),n.isMatchIgnored))return g(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)),f(i),i.returnBegin?0:t.length}function p(e){const t=e[0],n=i.substr(e.index),a=function e(t,i,n){let a=function(e,t){const i=e&&e.exec(t);return i&&0===i.index}(t.endRe,n);if(a){if(t["on:end"]){const e=new lh(t);t["on:end"](i,e),e.isMatchIgnored&&(a=!1)}if(a){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,i,n)}(k,e,n);if(!a)return Jh;const r=k;r.skip?w+=t:(r.returnEnd||r.excludeEnd||(w+=t),d(),r.excludeEnd&&(w=t));do{k.className&&C.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent}while(k!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.endRe=a.endRe),f(a.starts)),r.returnEnd?0:t.length}let m={};function F(t,n){const o=n&&n[0];if(w+=t,null==o)return d(),0;if("begin"===m.type&&"end"===n.type&&m.index===n.index&&""===o){if(w+=i.slice(n.index,n.index+1),!a){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=n,"begin"===n.type)return h(n);if("illegal"===n.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(k.className||"<unnamed>")+'"');throw e.mode=k,e}if("end"===n.type){const e=p(n);if(e!==Jh)return e}if("illegal"===n.type&&""===o)return 1;if(T>1e5&&T>3*n.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=y(e);if(!b)throw $h(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const E=zh(b,{plugins:n});let v="",k=s||E;const D={},C=new l.__emitter(l);!function(){const e=[];for(let t=k;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>C.openNode(e))}();let w="",S=0,O=0,T=0,x=!1;try{for(k.matcher.considerAll();;){T++,x?x=!1:k.matcher.considerAll(),k.matcher.lastIndex=O;const e=k.matcher.exec(i);if(!e)break;const t=F(i.substring(O,e.index),e);O=e.index+t}return F(i.substr(O)),C.closeAllNodes(),C.finalize(),v=C.toHTML(),{relevance:Math.floor(S),value:v,language:e,illegal:!1,emitter:C,top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:i.slice(O-100,O+100),mode:t.mode},sofar:v,relevance:0,value:Zh(i),emitter:C};if(a)return{illegal:!1,relevance:0,value:Zh(i),emitter:C,language:e,top:k,errorRaised:t};throw t}}function c(e,i){i=i||l.languages||Object.keys(t);const n=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:Zh(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),a=i.filter(y).filter(v).map(t=>_(t,e,!1));a.unshift(n);const r=a.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(y(e.language).supersetOf===t.language)return 1;if(y(t.language).supersetOf===e.language)return-1}return 0}),[o,u]=r,d=o;return d.second_best=u,d}const f={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},g=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(g,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=l.languageDetectRe.exec(t);if(i){const t=y(i[1]);return t||(Kh(o.replace("{}",i[1])),Kh("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||y(e))}(e);if(u(n))return;k("before:highlightElement",{el:e,language:n}),t=e;const a=t.textContent,r=n?d(a,{language:n,ignoreIllegals:!0}):c(a);k("after:highlightElement",{el:e,result:r,text:a}),e.innerHTML=r.value,function(e,t,n){const a=t?i[t]:n;e.classList.add("hljs"),a&&e.classList.add(a)}(e,n,r.language),e.result={language:r.language,re:r.relevance,relavance:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance,relavance:r.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,Qh("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(p)};let F=!1;function b(){if("loading"===document.readyState)return void(F=!0);document.querySelectorAll("pre code").forEach(p)}function y(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function E(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function v(e){const t=y(e);return t&&!t.disableAutodetect}function k(e,t){const i=e;n.forEach((function(e){e[i]&&e[i](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){F&&b()}),!1),Object.assign(e,{highlight:d,highlightAuto:c,highlightAll:b,fixMarkup:function(e){return Qh("10.2.0","fixMarkup will be removed entirely in v11.0"),Qh("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 Qh("10.7.0","highlightBlock will be removed entirely in v12.0"),Qh("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(Qh("10.3.0","'useBR' will be removed entirely in v11.0"),Qh("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=Xh(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){Qh("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(i,n){let r=null;try{r=n(e)}catch(e){if($h("Language definition for '{}' could not be registered.".replace("{}",i)),!a)throw e;$h(e),r=s}r.name||(r.name=i),t[i]=r,r.rawDefinition=n.bind(null,e),r.aliases&&E(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:y,registerAliases:E,requireLanguage:function(e){Qh("10.4.0","requireLanguage will be removed entirely in v11."),Qh("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=y(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:v,inherit:Xh,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),n.push(e)},vuePlugin:Hh(e).VuePlugin}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="10.7.3";for(const e in Rh)"object"==typeof Rh[e]&&oh(Rh[e]);return Object.assign(e,Rh),e.addPlugin(f),e.addPlugin(Gh),e.addPlugin(h),e}({}),tp={exports:{}};!function(e){!function(){var t;function i(e){for(var t,i,n,a,r=1,o=[].slice.call(arguments),s=0,l=e.length,u="",d=!1,_=!1,c=function(){return o[r++]},f=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,a=f(),t){case"b":u+=parseInt(c(),10).toString(2);break;case"c":u+="string"==typeof(i=c())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case"d":u+=parseInt(c(),10);break;case"f":n=String(parseFloat(c()).toFixed(a||6)),u+=_?n:n.replace(/^0/,"");break;case"j":u+=JSON.stringify(c());break;case"o":u+="0"+parseInt(c(),10).toString(8);break;case"s":u+=c();break;case"x":u+="0x"+parseInt(c(),10).toString(16);break;case"X":u+="0x"+parseInt(c(),10).toString(16).toUpperCase();break;default:u+=t}else"%"===t?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))})}()}(tp);var ip=tp.exports,np=rp(Error),ap=np;function rp(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=ip.apply(null,arguments)),new e(t)}}np.eval=rp(EvalError),np.range=rp(RangeError),np.reference=rp(ReferenceError),np.syntax=rp(SyntaxError),np.type=rp(TypeError),np.uri=rp(URIError),np.create=rp;var op=ep,sp=ap;ah.highlight=lp,ah.highlightAuto=function(e,t){var i=t||{},n=i.subset||op.listLanguages();i.prefix;var a,r,o,s,l=n.length,u=-1;if("string"!=typeof e)throw sp("Expected `string` for value, got `%s`",e);r={relevance:0,language:null,value:[]},a={relevance:0,language:null,value:[]};for(;++u<l;)s=n[u],op.getLanguage(s)&&((o=lp(s,e,t)).language=s,o.relevance>r.relevance&&(r=o),o.relevance>a.relevance&&(r=a,a=o));r.language&&(a.secondBest=r);return a},ah.registerLanguage=function(e,t){op.registerLanguage(e,t)},ah.listLanguages=function(){return op.listLanguages()},ah.registerAlias=function(e,t){var i,n=e;t&&((n={})[e]=t);for(i in n)op.registerAliases(n[i],{languageName:i})},up.prototype.addText=function(e){var t,i,n=this.stack;if(""===e)return;t=n[n.length-1],(i=t.children[t.children.length-1])&&"text"===i.type?i.value+=e:t.children.push({type:"text",value:e})},up.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},up.prototype.addSublanguage=function(e,t){var i=this.stack,n=i[i.length-1],a=e.rootNode.children,r=t?{type:"element",tagName:"span",properties:{className:[t]},children:a}:a;n.children=n.children.concat(r)},up.prototype.openNode=function(e){var t=this.stack,i=this.options.classPrefix+e,n=t[t.length-1],a={type:"element",tagName:"span",properties:{className:[i]},children:[]};n.children.push(a),t.push(a)},up.prototype.closeNode=function(){this.stack.pop()},up.prototype.closeAllNodes=dp,up.prototype.finalize=dp,up.prototype.toHTML=function(){return""};function lp(e,t,i){var n,a=op.configure({}),r=(i||{}).prefix;if("string"!=typeof e)throw sp("Expected `string` for name, got `%s`",e);if(!op.getLanguage(e))throw sp("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw sp("Expected `string` for value, got `%s`",t);if(null==r&&(r="hljs-"),op.configure({__emitter:up,classPrefix:r}),n=op.highlight(t,{language:e,ignoreIllegals:!0}),op.configure(a||{}),n.errorRaised)throw n.errorRaised;return{relevance:n.relevance,language:n.language,value:n.emitter.rootNode.children}}function up(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function dp(){}function _p(e){return e.value||e.children||[]}function cp({doc:e,name:t,lowlight:i}){const n=[];return fs(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:a}=e.node.attrs,r=i.listLanguages();(function e(t,i=[]){return t.map(t=>{const n=[...i,...t.properties?t.properties.className:[]];return t.children?e(t.children,n):{text:t.value,classes:n}}).flat()})(a&&r.includes(a)?_p(i.highlight(a,e.node.textContent)):_p(i.highlightAuto(e.node.textContent))).forEach(e=>{const i=t+e.text.length;if(e.classes.length){const a=va.inline(t,i,{class:e.classes.join(" ")});n.push(a)}t=i})}),wa.create(e,n)}function fp({name:e,lowlight:t}){return new Ct({key:new Ot("lowlight"),state:{init:(i,{doc:n})=>cp({doc:n,name:e,lowlight:t}),apply:(i,n,a,r)=>{const o=a.selection.$head.parent.type.name,s=r.selection.$head.parent.type.name,l=fs(a.doc,t=>t.type.name===e),u=fs(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)))?cp({doc:i.doc,name:e,lowlight:t}):n.map(i.mapping,i.doc)}},props:{decorations(e){return this.getState(e)}}})}const gp=sf.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:ah}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],fp({name:this.name,lowlight:this.options.lowlight})]}});function hp(){return u.a.createElement(Tu,null,u.a.createElement("pre",null,u.a.createElement(xu,{as:"code"})))}var pp=i(63),mp=i.n(pp),Fp=gp.extend({addNodeView:function(){return new Cu(hp)}}).configure({lowlight:mp.a}),bp=function(e){var t=e.items,i=e.command;return u.a.createElement("div",{className:"shadow-md"},u.a.createElement(Ud,{variables:t,onClickVariable:function(e){var t=e.category_key,n=e.key,a=t?"".concat(t,".").concat(n):n;i({label:a,id:a})}}))};function yp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Ep(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?yp(Object(i),!0).forEach((function(t){vp(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):yp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function vp(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var kp=new Ot("variables"),Dp=ns.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"variable__text"},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",Qo({"data-variable":""},this.options.HTMLAttributes,i),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addCommands:function(){var e=this;return{setVariable:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:t},{type:"text",text:" "}]).run()}}}},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var i=t.tr,n=t.state,a=!1,r=n.selection,o=r.empty,s=r.anchor;return!!o&&(n.doc.nodesBetween(s-1,s,(function(t,n){if(t.type.name===e.name)return a=!0,i.insertText("",n,n+t.nodeSize),!1})),a)}))}}},addProseMirrorPlugins:function(){return[Xg(Ep({editor:this.editor},this.options.suggestion))]}}),Cp={char:"{{",startOfLine:!1,pluginKey:kp,command:function(e){var t=e.editor,i=e.range,n=e.props;t.chain().focus().deleteRange(i).setVariable(n).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Eu(bp,{props:i,editor:i.editor}),t=_u("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},wp=function(e){var t=e.suggestion,i=void 0===t?{}:t;return Dp.configure({suggestion:Ep(Ep({},Cp),i)})},Sp=i(64),Op=i.n(Sp);function Tp(e){return(Tp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var xp=function(e){var t=Tp(e);return"string"===t||"funtion"===t?e:Op()(e)?function(t){var i=t.node.type.name;return e[i]}:""},Np=ur.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Ct({props:{decorations:function(t){var i=t.doc,n=t.selection,a=e.editor.isEditable||!e.options.showOnlyWhenEditable,r=n.anchor,o=[];if(a)return i.descendants((function(t,i){var n=r>=i&&r<=i+t.nodeSize,a=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((n||!e.options.showOnlyCurrent)&&!s&&a){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=va.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})),wa.create(i,o)}}})]}});const Ap=new Ot("suggestion");function Mp({pluginKey:e=Ap,editor:t,char:i="@",allowSpaces:n=!1,prefixSpace:a=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:_=(()=>!0)}){const c=null==d?void 0:d();return new Ct({key:e,view(){return{update:async(e,i)=>{var n,a,r,o,s;const d=null===(n=this.key)||void 0===n?void 0:n.getState(i),_=null===(a=this.key)||void 0===a?void 0:a.getState(e.state),f=d.active&&_.active&&d.range.from!==_.range.from,g=!d.active&&_.active,h=d.active&&!_.active,p=g||f,m=!g&&!h&&d.query!==_.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:_,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:y,clientRect:y?()=>{var e;const{decorationId: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,E)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,E)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,E))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:d}=l,c={...o};if(c.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:n,startOfLine:a,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=a?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=r.depth<=0?0:r.before(),_=r.pos,c=r.doc.textBetween(d,_,"\0","\0"),f=Array.from(c.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(n&&!h)return null;const p=f.index+r.start();let m=p+f[0].length;return i&&s.test(c.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:i,allowSpaces:n,prefixSpace:a,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:n,range:a}=this.getState(e.state);return n&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:a}))||!1},decorations(e){const{active:t,range:i,decorationId:n}=this.getState(e);return t?wa.create(e.doc,[va.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":n})]):null}}})}const Rp=new Ot("mention"),Ip=ns.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:Rp,command:({editor:e,range:t,props:i})=>{var n;const a=e.view.state.selection.$to.nodeAfter;(null===(n=null==a?void 0:a.text)||void 0===n?void 0:n.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:i},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const i=e.state.doc.resolve(t.from),n=e.schema.nodes[this.name];return!!i.parent.type.contentMatch.matchType(n)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-mention]"}],renderHTML({node:e,HTMLAttributes:t}){return["span",Qo({"data-mention":""},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let i=!1;const{selection:n}=t,{empty:a,anchor:r}=n;return!!a&&(t.doc.nodesBetween(r-1,r,(t,n)=>{if(t.type.name===this.name)return i=!0,e.insertText(this.options.suggestion.char||"",n,n+t.nodeSize),!1}),i)})}},addProseMirrorPlugins(){return[Mp({editor:this.editor,...this.options.suggestion})]}});var Lp=["size","user","isSquare","status","onClick","className"];function Bp(){return(Bp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Pp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jp(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return jp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jp(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function qp(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var Up={small:24,medium:32,large:40,xlarge:64},zp=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function Hp(e){var t,i,n=e.size,a=e.user,r=e.isSquare,o=e.status,s=e.onClick,d=e.className,c=qp(e,Lp),f=Pp(Object(l.useState)(!1),2),g=f[0],h=f[1],p=a.name,m=void 0===p?"":p,F=a.imageUrl,b="medium"===n,y="large"===n,E="xlarge"===n,v=(t=m.trim().split(" ")).reduce((function(e,i,n){return 0!==n&&n!==t.length-1||(e="".concat(e).concat(i.charAt(0).toUpperCase())),e}),""),k={height:Up[n],width:Up[n],backgroundColor:(i=(v.charCodeAt(0)||0)+(v.charCodeAt(1)||0),zp[i%65%zp.length]||zp[0])},D=_()("neeto-ui-avatar",{"neeto-ui-avatar--medium":b,"neeto-ui-avatar--large":y,"neeto-ui-avatar--xlarge":E,"neeto-ui-avatar--round":!r,hidden:!g}),C=_()("neeto-ui-avatar__text",{"neeto-ui-avatar__text-medium":b,"neeto-ui-avatar__text-large":y,"neeto-ui-avatar__text-xlarge":E}),w=_()("neeto-ui-avatar__status","".concat(o),{"neeto-ui-avatar__status-medium":b,"neeto-ui-avatar__status-large":y,"neeto-ui-avatar__status-xlarge":E,"neeto-ui-avatar__status-square":r}),S=function(){return null==o?u.a.Fragment:u.a.createElement("span",{className:w})},O=function(){return u.a.createElement("span",{className:C},v)},T=v&&!F&&!g;return u.a.createElement("div",Bp({onClick:s,style:k,className:_()("neeto-ui-avatar--container",{"neeto-ui-avatar--container-round":!r},d)},c),u.a.createElement(S,null),T?u.a.createElement(O,null):u.a.createElement("img",{className:D,onLoad:function(){return h(!0)},onError:function(){return h(!1)},src:F,alt:"avatar-".concat(v)}))}Hp.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},Hp.propTypes={size:Pu.a.oneOf(Object.keys(Up)),user:Pu.a.shape({imageUrl:Pu.a.string,name:Pu.a.string}),isSquare:Pu.a.bool,onClick:Pu.a.func,status:Pu.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:Pu.a.string};var Gp=Hp;function Wp(e){return(Wp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vp(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $p(e,t){return($p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Xp(e);if(t){var a=Xp(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Qp(this,i)}}function Qp(e,t){if(t&&("object"===Wp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Zp(e)}function Zp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xp(e){return(Xp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jp(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var em=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$p(e,t)}(r,e);var t,i,n,a=Kp(r);function r(){var e;Yp(this,r);for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return Jp(Zp(e=a.call.apply(a,[this].concat(i))),"state",{selectedIndex:0}),Jp(Zp(e),"selectItem",(function(t){var i=e.props,n=i.items,a=i.command,r=n[t];r&&a({label:r.label,id:r.key})})),Jp(Zp(e),"upHandler",(function(){var t=e.props.items;e.setState((function(e){return{selectedIndex:(e.selectedIndex+t.length-1)%t.length}}))})),Jp(Zp(e),"downHandler",(function(){var t=e.props.items;e.setState((function(e){return{selectedIndex:(e.selectedIndex+1)%t.length}}))})),Jp(Zp(e),"enterHandler",(function(){var t=e.state.selectedIndex;e.selectItem(t)})),Jp(Zp(e),"onKeyDown",(function(t){var i=t.event,n={ArrowUp:e.upHandler,ArrowDown:e.downHandler,Enter:e.enterHandler};return!!n.hasOwnProperty(i.key)&&(n[i.key](),!0)})),e}return t=r,(i=[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,i=this.props.items;return u.a.createElement("div",{className:"relative p-2 space-y-1 overflow-hidden rounded shadow editor-command-list--root"},i.map((function(i,n){var a=i.label,r=i.imageUrl,o=i.showImage;return u.a.createElement("button",{className:_()("flex items-center w-full px-4 py-2 transition-all duration-100 ease-in-out cursor-pointer text-xs text-white rounded editor-command-list--item",{selected_item:n===t}),key:a,onClick:function(){return e.selectItem(n)}},o?u.a.createElement(Gp,{user:{name:a,imageUrl:r},className:"mr-2"}):null,u.a.createElement("span",null,a))})))}}])&&Vp(t.prototype,i),n&&Vp(t,n),r}(u.a.Component);function tm(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function im(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?tm(Object(i),!0).forEach((function(t){nm(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):tm(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function nm(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function am(e){return(am="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var rm=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.limit,n=void 0===i?5:i,a=t.showImage,r=void 0!==a&&a,o=e.map((function(e){var t;return"string"==typeof e?t={key:e,label:e}:"object"===am(e)&&(t=im({},e)),t.showImage=r,t}));return function(e){var t=e.query;return o.filter((function(e){return e.label.toLowerCase().startsWith(t.toLowerCase())})).slice(0,n)}},om=["suggestion"];function sm(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function lm(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sm(Object(i),!0).forEach((function(t){um(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sm(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function um(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function dm(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var _m={render:function(){var e,t;return{onStart:function(i){e=new Eu(em,{props:i,editor:i.editor}),t=_u("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(i){var n;return"Escape"===i.event.key?(t[0].hide(),!0):null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(i)},onExit:function(){t[0].destroy(),e.destroy()}}}},cm=function(e){var t=e.suggestion,i=void 0===t?{}:t,n=dm(e,om);return Ip.configure(lm(lm({},n),{},{suggestion:lm(lm({},_m),i)}))},fm=ns.create({name:"external-video",addOptions:function(){return{inline:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["div",{class:"video-wrapper"},["iframe",Qo(this.options.HTMLAttributes,t)]]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(i){return i.commands.insertContent({type:e.name,attrs:t})}}}}}),gm=i(20),hm=i(6),pm=i.n(hm),mm=i(7),Fm=i.n(mm),bm=i(32),ym=i.n(bm),Em={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"},vm=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(",")},km=function(e){for(var t in e.compressed=!1,e.emojis){var i=e.emojis[t];for(var n in Em)i[n]=i[Em[n]],delete i[Em[n]];i.short_names||(i.short_names=[]),i.short_names.unshift(t),i.sheet_x=i.sheet[0],i.sheet_y=i.sheet[1],delete i.sheet,i.text||(i.text=""),i.added_in||(i.added_in=6),i.added_in=i.added_in.toFixed(1),i.search=vm(i)}},Dm=String.fromCodePoint||function(){var e,t,i=16384,n=[],a=-1,r=arguments.length;if(!r)return"";for(var o="";++a<r;){var s=Number(arguments[a]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(a+1===r||n.length>i)&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o},Cm=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,wm=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function Sm(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return Dm.apply(null,t)}function Om(e){var t=e.name,i=e.short_names,n=e.skin_tone,a=e.skin_variations,r=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,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}:(n&&(_+=":skin-tone-".concat(n,":")),{id:d,name:t,short_names:i,colons:_,emoticons:r,unified:o.toLowerCase(),skin:n||(a?1:null),native:Sm(o)})}function Tm(){return Om(xm.apply(void 0,arguments))}function xm(e,t,i,n){var a={};if("string"==typeof e){var r=e.match(Cm);if(r&&(e=r[1],r[2]&&(t=parseInt(r[2],10))),n.aliases.hasOwnProperty(e)&&(e=n.aliases[e]),!n.emojis.hasOwnProperty(e))return null;a=n.emojis[e]}else e.id&&(n.aliases.hasOwnProperty(e.id)&&(e.id=n.aliases[e.id]),n.emojis.hasOwnProperty(e.id)&&(a=n.emojis[e.id],t||(t=e.skin)));if(Object.keys(a).length||((a=e).custom=!0,a.search||(a.search=vm(e))),a.emoticons||(a.emoticons=[]),a.variations||(a.variations=[]),a.skin_variations&&t>1){a=JSON.parse(JSON.stringify(a));var o=wm[t-1],s=a.skin_variations[o];if(s&&(!s.variations&&a.variations&&delete a.variations,i&&(null==s["has_img_".concat(i)]||s["has_img_".concat(i)])||!i))for(var l in a.skin_tone=t,s){var u=s[l];a[l]=u}}return a.variations&&a.variations.length&&((a=JSON.parse(JSON.stringify(a))).unified=a.variations.shift()),a}function Nm(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function Am(e,t){var i=Nm(e),n=Nm(t);return i.filter((function(e){return n.indexOf(e)>=0}))}function Mm(e,t){var i={};for(var n in e){var a=e[n],r=a;t.hasOwnProperty(n)&&(r=t[n]),"object"===ym()(r)&&(r=Mm(a,r)),i[n]=r}return i}var Rm,Im,Lm="emoji-mart",Bm="undefined"!=typeof window&&"localStorage"in window;function Pm(e,t){if(Im)Im(e,t);else{if(!Bm)return;try{window.localStorage["".concat(Lm,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var jm={update:function(e){for(var t in e){Pm(t,e[t])}},set:Pm,get:function(e){if(Rm)return Rm(e);if(Bm)try{var t=window.localStorage["".concat(Lm,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){Lm=e},setHandlers:function(e){e||(e={}),Rm=e.getter,Im=e.setter}},qm=function(){function e(t,i){pm()(this,e),t.compressed&&km(t),this.data=t||{},this.set=i||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return Fm()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var i=e.data.emojis[t],n=i.short_names,a=i.emoticons,r=i.skin_variations,o=n[0];if(a&&a.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),r){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=Tm({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=Tm(o,null,e.set,e.data);e.originalPool[o]=i};for(var i in this.data.emojis)t(i)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(i){var n=i.id||i.short_names[0];delete e[n],delete t.emojis[n]}))}},{key:"addCustomToPool",value:function(e,t){var i=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var n=e.id||e.short_names[0];n&&!t[n]&&(t[n]=xm(e,null,null,i.data),i.emojis[n]=Tm(e,null,null,i.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.emojisToShowFilter,a=i.maxResults,r=i.include,o=i.exclude,s=i.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=jm.get("skin")||1;a||(a=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|,|\-|_]+/),f=[];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,n=!(!o||!o.length)&&o.indexOf(e.id)>-1;i&&!n&&e.emojis.forEach((function(e){return _[e]=t.data.emojis[e]}))})),l.length)){var g=!r||!r.length||r.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;g&&!h&&this.addCustomToPool(l,_)}d=(f=c.map((function(e){for(var i=_,n=t.index,a=0,r=0;r<e.length;r++){var o=e[r];a++,n[o]||(n[o]={}),(n=n[o]).results||function(){var r={};for(var o in n.results=[],n.pool={},i){var s=i[o],l=s.search,d=e.substr(0,a),_=l.indexOf(d);if(-1!=_){var c=_+1;d==o&&(c=0),t.emojis[o]&&t.emojis[o][u]?n.results.push(t.emojis[o][u]):n.results.push(t.emojis[o]),n.pool[o]=s,r[o]=c}}n.results.sort((function(e,t){var i=r[e.id],n=r[t.id];return i==n?e.id.localeCompare(t.id):i-n}))}(),i=n.pool}return n.results})).filter((function(e){return e}))).length>1?Am.apply(null,f):f.length?f[0]:[]}return d&&(n&&(d=d.filter((function(e){return n(_[e.id])}))),d&&d.length>a&&(d=d.slice(0,a))),d}}]),e}(),Um=new qm(gm);var zm,Hm,Gm={search:function(){return Um.search.apply(Um,arguments)},emojis:Um.emojis,emoticons:Um.emoticons},Wm=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],Ym={};function Vm(){Hm=!0,zm=jm.get("frequently")}var $m={add:function(e){Hm||Vm();var t=e.id;zm||(zm=Ym),zm[t]||(zm[t]=0),zm[t]+=1,jm.set("last",t),jm.set("frequently",zm)},get:function(e){if(Hm||Vm(),!zm){Ym={};for(var t=[],i=0;i<e;i++)Ym[Wm[i]]=e-i,t.push(Wm[i]);return t}var n=4*e,a=[];for(var r in zm)zm.hasOwnProperty(r)&&a.push(r);var o=a.sort((function(e,t){return zm[e]-zm[t]})).reverse().slice(0,n),s=jm.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},Km=i(11),Qm=i.n(Km),Zm=i(13),Xm=i.n(Zm),Jm=i(8),eF=i.n(Jm),tF=i(9),iF=i.n(tF),nF=i(10),aF=i.n(nF),rF=i(4),oF=i.n(rF),sF={activity:function(){return u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.a.createElement("g",{transform:"translate(2.000000, 1.000000)"},u.a.createElement("rect",{id:"Rectangle",x:"8",y:"0",width:"3",height:"21",rx:"1.5"}),u.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"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.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"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.a.createElement("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},u.a.createElement("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"}))}},lF={search:function(){return u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},u.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 u.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},u.a.createElement("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"}))}},uF={data:Pu.a.object.isRequired,onOver:Pu.a.func,onLeave:Pu.a.func,onClick:Pu.a.func,fallback:Pu.a.func,backgroundImageFn:Pu.a.func,native:Pu.a.bool,forceSize:Pu.a.bool,tooltip:Pu.a.bool,useButton:Pu.a.bool,skin:Pu.a.oneOf([1,2,3,4,5,6]),sheetSize:Pu.a.oneOf([16,20,32,64]),sheetColumns:Pu.a.number,sheetRows:Pu.a.number,set:Pu.a.oneOf(["apple","google","twitter","facebook"]),size:Pu.a.number.isRequired,emoji:Pu.a.oneOfType([Pu.a.string,Pu.a.object]).isRequired},dF={onClick:Pu.a.func,onSelect:Pu.a.func,onSkinChange:Pu.a.func,perLine:Pu.a.number,emojiSize:Pu.a.number,i18n:Pu.a.object,style:Pu.a.object,title:Pu.a.string,emoji:Pu.a.string,color:Pu.a.string,set:uF.set,skin:uF.skin,native:Pu.a.bool,backgroundImageFn:uF.backgroundImageFn,sheetSize:uF.sheetSize,emojisToShowFilter:Pu.a.func,showPreview:Pu.a.bool,showSkinTones:Pu.a.bool,emojiTooltip:uF.tooltip,useButton:uF.useButton,theme:Pu.a.oneOf(["auto","light","dark"]),include:Pu.a.arrayOf(Pu.a.string),exclude:Pu.a.arrayOf(Pu.a.string),recent:Pu.a.arrayOf(Pu.a.string),autoFocus:Pu.a.bool,enableFrequentEmojiSort:Pu.a.bool,custom:Pu.a.arrayOf(Pu.a.shape({name:Pu.a.string.isRequired,short_names:Pu.a.arrayOf(Pu.a.string).isRequired,emoticons:Pu.a.arrayOf(Pu.a.string),keywords:Pu.a.arrayOf(Pu.a.string),imageUrl:Pu.a.string,spriteUrl:Pu.a.string,sheet_x:Pu.a.number,sheet_y:Pu.a.number,size:Pu.a.number,sheetColumns:Pu.a.number,sheetRows:Pu.a.number})),skinEmoji:Pu.a.string,notFound:Pu.a.func,notFoundEmoji:Pu.a.string,icons:Pu.a.object},_F=function(e){function t(e){var i;pm()(this,t),i=eF()(this,iF()(t).call(this,e));var n=e.categories.filter((function(e){return e.first}))[0];return i.state={selected:n.name},i.handleClick=i.handleClick.bind(oF()(i)),i}return aF()(t,e),Fm()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),i=this.props,n=i.categories;(0,i.onAnchorClick)(n[t],t)}},{key:"render",value:function(){var e=this,t=this.props,i=t.categories,n=t.color,a=t.i18n,r=t.icons,o=this.state.selected;return u.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":a.categorieslabel},i.map((function(t,i){var s=t.id,l=t.name,d=t.anchor,_=l==o;if(!1===d)return null;var c=s.startsWith("custom-")?"custom":s;return u.a.createElement("button",{key:s,"aria-label":a.categories[c],title:a.categories[c],"data-index":i,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(_?"emoji-mart-anchor-selected":""),style:{color:_?n:null}},u.a.createElement("div",{className:"emoji-mart-anchor-icon"},r.categories[c]()),u.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:n}}))})))}}]),t}(u.a.PureComponent);_F.propTypes={categories:Pu.a.array,onAnchorClick:Pu.a.func,icons:Pu.a.object},_F.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var cF={skin:1,set:"apple",sheetSize:64,sheetColumns:57,sheetRows:57,native:!1,forceSize:!1,tooltip:!1,useButton:!0,backgroundImageFn:function(e,t){return"https://unpkg.com/emoji-datasource-".concat(e,"@").concat("5.0.1","/img/").concat(e,"/sheets-256/").concat(t,".png")}},fF={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:cF.set,theme:"light",skin:null,defaultSkin:cF.skin,native:cF.native,sheetSize:cF.sheetSize,backgroundImageFn:cF.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:cF.tooltip,useButton:cF.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function gF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function hF(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var pF=function(e){return xm(e.emoji,e.skin,e.set,e.data)},mF=function(e){var t=pF(e),i=t.sheet_x,n=t.sheet_y,a=100/(e.sheetColumns-1),r=100/(e.sheetRows-1);return"".concat(a*i,"% ").concat(r*n,"%")},FF=function(e){return Tm(e.emoji,e.skin,e.set,e.data)},bF=function(e){return!isNaN(e-parseFloat(e))},yF=function e(t){for(var i in t.data.compressed&&km(t.data),e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);var n=pF(t);if(!n)return t.fallback?t.fallback(null,t):null;var a=n.unified,r=n.custom,o=n.short_names,s=n.imageUrl,l={},d=t.children,_="emoji-mart-emoji",c=a&&Sm(a),f=[c].concat(o).filter(Boolean).join(", "),g=null;if(!a&&!r)return t.fallback?t.fallback(n,t):null;if(t.tooltip&&(g=o[0]),t.native&&a)_+=" emoji-mart-emoji-native",l={fontSize:t.size},d=c,t.forceSize&&(l.display="inline-block",l.width=t.size,l.height=t.size,l.wordBreak="keep-all");else if(r)_+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=n.spriteUrl?hF({},l,{backgroundImage:"url(".concat(n.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:mF(t)}):hF({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==n["has_img_".concat(t.set)]||n["has_img_".concat(t.set)]))return t.fallback?t.fallback(n,t):null;l={width:t.size,height:t.size,display:"inline-block",backgroundImage:"url(".concat(t.backgroundImageFn(t.set,t.sheetSize),")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:mF(t)}}var h={name:"span",props:{}};return t.onClick&&t.useButton&&(h.name="button",h.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var i in e){var n=e[i];bF(n)&&(n+="px"),t.style[i]=n}return t.getAttribute("style")}(l),"<".concat(h.name," style='").concat(l,"' aria-label='").concat(f,"' ").concat(g?"title='".concat(g,"'"):""," class='").concat(_,"'>").concat(d||"","</").concat(h.name,">")):u.a.createElement(h.name,Xm()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(FF(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(FF(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(FF(t),e)}(e,t)},"aria-label":f,title:g,className:_},h.props),u.a.createElement("span",{style:l},d))};yF.propTypes=hF({},uF,{data:Pu.a.object.isRequired}),yF.defaultProps=cF;var EF=yF;function vF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var kF=function(e){function t(){return pm()(this,t),eF()(this,iF()(t).apply(this,arguments))}return aF()(t,e),Fm()(t,[{key:"render",value:function(){var e=this.props,t=e.data,i=e.emojiProps,n=e.i18n,a=e.notFound,r=e.notFoundEmoji;return a&&a()||u.a.createElement("div",{className:"emoji-mart-no-results"},EF(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?vF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):vF(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})),u.a.createElement("div",{className:"emoji-mart-no-results-label"},n.notfound))}}]),t}(u.a.PureComponent);function DF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}kF.propTypes={notFound:Pu.a.func.isRequired,emojiProps:Pu.a.object.isRequired};var CF=function(e){function t(e){var i;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).data=e.data,i.setContainerRef=i.setContainerRef.bind(oF()(i)),i.setLabelRef=i.setLabelRef.bind(oF()(i)),i}return aF()(t,e),Fm()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var i=this.props,n=i.name,a=i.perLine,r=i.native,o=i.hasStickyPosition,s=i.emojis,l=i.emojiProps,u=l.skin,d=l.size,_=l.set,c=e.perLine,f=e.native,g=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,y=!1;return"Recent"==n&&a!=c&&(y=!0),"Search"==n&&(y=!(s==h)),u==m&&d==F&&r==f&&_==b&&o==g||(y=!0),y}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),i=t.top,n=t.height,a=e.getBoundingClientRect().top,r=this.label.getBoundingClientRect().height;this.top=i-a+e.scrollTop,this.maxMargin=0==n?0:n-r}},{key:"handleScroll",value:function(e){var t=e-this.top;if((t=(t=t<this.minMargin?this.minMargin:t)>this.maxMargin?this.maxMargin:t)!=this.margin)return this.props.hasStickyPosition||(this.label.style.top="".concat(t,"px")),this.margin=t,!0}},{key:"getEmojis",value:function(){var e=this,t=this.props,i=t.name,n=t.emojis,a=t.recent,r=t.perLine;if("Recent"==i){var o=this.props.custom,s=a||$m.get(r);if(s.length&&(n=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!xm(t,null,null,e.data)}))),0===n.length&&s.length>0)return null}return n&&(n=n.slice(0)),n}},{key:"updateDisplay",value:function(e){this.getEmojis()&&this.container&&(this.container.style.display=e)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setLabelRef",value:function(e){this.label=e}},{key:"render",value:function(){var e=this,t=this.props,i=t.id,n=t.name,a=t.hasStickyPosition,r=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,d=this.getEmojis(),_={},c={},f={};d||(f={display:"none"}),a||(_={height:28},c={position:"absolute"});var g=o.categories[i]||n;return u.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":g,style:f},u.a.createElement("div",{style:_,"data-name":n,className:"emoji-mart-category-label"},u.a.createElement("span",{style:c,ref:this.setLabelRef,"aria-hidden":!0},g)),u.a.createElement("ul",{className:"emoji-mart-category-list"},d&&d.map((function(t){return u.a.createElement("li",{key:t.short_names&&t.short_names.join("_")||t},EF(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?DF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):DF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({emoji:t,data:e.data},r)))}))),d&&!d.length&&u.a.createElement(kF,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:r}))}}]),t}(u.a.Component);CF.propTypes={emojis:Pu.a.array,hasStickyPosition:Pu.a.bool,name:Pu.a.string.isRequired,native:Pu.a.bool.isRequired,perLine:Pu.a.number.isRequired,emojiProps:Pu.a.object.isRequired,recent:Pu.a.arrayOf(Pu.a.string),notFound:Pu.a.func,notFoundEmoji:Pu.a.string.isRequired},CF.defaultProps={emojis:[],hasStickyPosition:!0};var wF=function(e){function t(e){var i;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).state={opened:!1},i}return aF()(t,e),Fm()(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}(u.a.PureComponent);wF.propTypes={onChange:Pu.a.func,skin:Pu.a.number.isRequired},wF.defaultProps={onChange:function(){}};var SF=function(e){function t(e){var i;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).handleClick=i.handleClick.bind(oF()(i)),i}return aF()(t,e),Fm()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.emojiProps,n=e.data,a=e.skinEmoji,r=e.i18n,o=this.state.opened,s=[],l=1;l<=6;l++){var d=l===t;s.push(u.a.createElement("span",{key:"skin-tone-".concat(l),className:"emoji-mart-skin-swatch custom".concat(d?" selected":"")},u.a.createElement("span",{onClick:this.handleClick,"data-skin":l,className:"emoji-mart-skin-tone-".concat(l)},EF({emoji:a,data:n,skin:l,backgroundImageFn:i.backgroundImageFn,native:i.native,set:i.set,sheetSize:i.sheetSize,size:23}))))}return u.a.createElement("div",{className:"emoji-mart-skin-swatches custom".concat(o?" opened":"")},u.a.createElement("div",{className:"emoji-mart-skin-text".concat(o?" opened":"")},r.skintext),s)}}]),t}(wF);SF.propTypes={onChange:Pu.a.func,skin:Pu.a.number.isRequired,emojiProps:Pu.a.object.isRequired,skinTone:Pu.a.number,skinEmoji:Pu.a.string.isRequired,i18n:Pu.a.object},SF.defaultProps={onChange:function(){},skinTone:null};var OF=function(e){function t(e){var i;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).handleClick=i.handleClick.bind(oF()(i)),i.handleKeyDown=i.handleKeyDown.bind(oF()(i)),i}return aF()(t,e),Fm()(t,[{key:"handleKeyDown",value:function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),this.handleClick(e))}},{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.i18n,n=this.state.opened,a=[],r=1;r<=6;r++){var o=r===t,s=n||o;a.push(u.a.createElement("span",Xm()({key:"skin-tone-".concat(r),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":i.skintones[r],"aria-hidden":!s},n?{role:"menuitem"}:{}),u.a.createElement("span",Xm()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!n}:{},n?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":i.skintones[r],title:i.skintones[r],"data-skin":r,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(r)}))))}return u.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(n?" opened":""),"aria-label":i.skintext},u.a.createElement("div",n?{role:"menubar"}:{},a))}}]),t}(wF);function TF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function xF(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?TF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):TF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}OF.propTypes={onChange:Pu.a.func,skin:Pu.a.number.isRequired,i18n:Pu.a.object},OF.defaultProps={onChange:function(){}};var NF=function(e){function t(e){var i;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).data=e.data,i.state={emoji:null},i}return aF()(t,e),Fm()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,i=t.emojiProps,n=t.skinsProps,a=t.showSkinTones,r=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var d=xm(e,null,null,this.data),_=d.emoticons,c=[],f=[];return(void 0===_?[]:_).forEach((function(e){c.indexOf(e.toLowerCase())>=0||(c.push(e.toLowerCase()),f.push(e))})),u.a.createElement("div",{className:"emoji-mart-preview"},u.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},EF(xF({key:e.id,emoji:e,data:this.data},i))),u.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},u.a.createElement("div",{className:"emoji-mart-preview-name"},e.name),u.a.createElement("div",{className:"emoji-mart-preview-shortnames"},d.short_names.map((function(e){return u.a.createElement("span",{key:e,className:"emoji-mart-preview-shortname"},":",e,":")}))),u.a.createElement("div",{className:"emoji-mart-preview-emoticons"},f.map((function(e){return u.a.createElement("span",{key:e,className:"emoji-mart-preview-emoticon"},e)})))))}return u.a.createElement("div",{className:"emoji-mart-preview"},u.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},o&&o.length&&EF(xF({emoji:o,data:this.data},i))),u.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},u.a.createElement("span",{className:"emoji-mart-title-label"},r)),a&&u.a.createElement("div",{className:"emoji-mart-preview-skins".concat(n.skinEmoji?" custom":"")},n.skinEmoji?u.a.createElement(SF,{skin:n.skin,emojiProps:i,data:this.data,skinEmoji:n.skinEmoji,i18n:s,onChange:n.onChange}):u.a.createElement(OF,{skin:n.skin,i18n:s,onChange:n.onChange})))}}]),t}(u.a.PureComponent);NF.propTypes={showSkinTones:Pu.a.bool,title:Pu.a.string.isRequired,emoji:Pu.a.string.isRequired,emojiProps:Pu.a.object.isRequired,skinsProps:Pu.a.object.isRequired},NF.defaultProps={showSkinTones:!0,onChange:function(){}};var AF=0,MF=function(e){function t(e){var i,n,a,r;return pm()(this,t),(i=eF()(this,iF()(t).call(this,e))).state={icon:lF.search,isSearching:!1,id:++AF},i.data=e.data,i.emojiIndex=new qm(i.data),i.setRef=i.setRef.bind(oF()(i)),i.clear=i.clear.bind(oF()(i)),i.handleKeyUp=i.handleKeyUp.bind(oF()(i)),i.handleChange=(n=i.handleChange.bind(oF()(i)),a="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,r=!1,function(){r||(r=!0,a((function(){r=!1,n()})))}),i}return aF()(t,e),Fm()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:lF.search,isSearching:!1}):this.setState({icon:lF.delete,isSearching:!0}),this.props.onSearch(this.emojiIndex.search(e,{emojisToShowFilter:this.props.emojisToShowFilter,maxResults:this.props.maxResults,include:this.props.include,exclude:this.props.exclude,custom:this.props.custom}))}},{key:"clear",value:function(){""!=this.input.value&&(this.input.value="",this.input.focus(),this.search(""))}},{key:"handleChange",value:function(){this.input&&this.search(this.input.value)}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.clear()}},{key:"setRef",value:function(e){this.input=e}},{key:"render",value:function(){var e=this.props,t=e.i18n,i=e.autoFocus,n=this.state,a=n.icon,r=n.isSearching,o=n.id,s="emoji-mart-search-".concat(o);return u.a.createElement("section",{className:"emoji-mart-search","aria-label":t.search},u.a.createElement("input",{id:s,ref:this.setRef,type:"search",onChange:this.handleChange,placeholder:t.search,autoFocus:i}),u.a.createElement("label",{className:"emoji-mart-sr-only",htmlFor:s},t.search),u.a.createElement("button",{className:"emoji-mart-search-icon",onClick:this.clear,onKeyUp:this.handleKeyUp,"aria-label":t.clear,disabled:!r},a()))}}]),t}(u.a.PureComponent);function RF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function IF(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?RF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):RF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}MF.propTypes={onSearch:Pu.a.func,maxResults:Pu.a.number,emojisToShowFilter:Pu.a.func,autoFocus:Pu.a.bool},MF.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var LF={search:"Search",clear:"Clear",notfound:"No Emoji Found",skintext:"Choose your default skin tone",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"},categorieslabel:"Emoji categories",skintones:{1:"Default Skin Tone",2:"Light Skin Tone",3:"Medium-Light Skin Tone",4:"Medium Skin Tone",5:"Medium-Dark Skin Tone",6:"Dark Skin Tone"}},BF=function(e){function t(e){var i;pm()(this,t),(i=eF()(this,iF()(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&&km(e.data),i.data=e.data,i.i18n=Mm(LF,e.i18n),i.icons=Mm(n,e.icons),i.state={firstRender:!0},i.categories=[];var a=[].concat(i.data.categories);if(e.custom.length>0){var r={},o=0;e.custom.forEach((function(e){r[e.customCategory]||(r[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=r[e.customCategory],n=IF({},e,{id:e.short_names[0],custom:!0});t.emojis.push(n),i.CUSTOM.push(n)})),a=a.concat(Object.keys(r).map((function(e){return r[e]})))}i.hideRecent=!0,null!=e.include&&a.sort((function(t,i){return e.include.indexOf(t.id)>e.include.indexOf(i.id)?1:-1}));for(var s=0;s<a.length;s++){var l=a[s],u=!e.include||!e.include.length||e.include.indexOf(l.id)>-1,d=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(l.id)>-1;if(u&&!d)if(e.emojisToShowFilter){for(var _=[],c=l.emojis,f=0;f<c.length;f++){var g=c[f];e.emojisToShowFilter(i.data.emojis[g]||g)&&_.push(g)}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(oF()(i)),i.handleAnchorClick=i.handleAnchorClick.bind(oF()(i)),i.setSearchRef=i.setSearchRef.bind(oF()(i)),i.handleSearch=i.handleSearch.bind(oF()(i)),i.setScrollRef=i.setScrollRef.bind(oF()(i)),i.handleScroll=i.handleScroll.bind(oF()(i)),i.handleScrollPaint=i.handleScrollPaint.bind(oF()(i)),i.handleEmojiOver=i.handleEmojiOver.bind(oF()(i)),i.handleEmojiLeave=i.handleEmojiLeave.bind(oF()(i)),i.handleEmojiClick=i.handleEmojiClick.bind(oF()(i)),i.handleEmojiSelect=i.handleEmojiSelect.bind(oF()(i)),i.setPreviewRef=i.setPreviewRef.bind(oF()(i)),i.handleSkinChange=i.handleSkinChange.bind(oF()(i)),i.handleKeyDown=i.handleKeyDown.bind(oF()(i)),i.handleDarkMatchMediaChange=i.handleDarkMatchMediaChange.bind(oF()(i)),i}return aF()(t,e),Fm()(t,[{key:"componentDidMount",value:function(){var e=this;this.state.firstRender&&(this.testStickyPosition(),this.firstRenderTimeout=setTimeout((function(){e.setState({firstRender:!1})}),60))}},{key:"componentDidUpdate",value:function(){this.updateCategoriesSize(),this.handleScroll()}},{key:"componentWillUnmount",value:function(){this.SEARCH_CATEGORY.emojis=null,clearTimeout(this.leaveTimeout),clearTimeout(this.firstRenderTimeout),this.darkMatchMedia&&this.darkMatchMedia.removeListener(this.handleDarkMatchMediaChange)}},{key:"testStickyPosition",value:function(){var e=document.createElement("div");["","-webkit-","-ms-","-moz-","-o-"].forEach((function(t){return e.style.position="".concat(t,"sticky")})),this.hasStickyPosition=!!e.style.position.length}},{key:"getPreferredTheme",value:function(){return"auto"!=this.props.theme?this.props.theme:this.state.theme?this.state.theme:"function"!=typeof matchMedia?fF.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?fF.theme:this.darkMatchMedia.matches?"dark":"light")}},{key:"handleDarkMatchMediaChange",value:function(){this.setState({theme:this.darkMatchMedia.matches?"dark":"light"})}},{key:"handleEmojiOver",value:function(e){var t=this.preview;if(t){var i=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n]);t.setState({emoji:e}),clearTimeout(this.leaveTimeout)}}},{key:"handleEmojiLeave",value:function(e){var t=this.preview;t&&(this.leaveTimeout=setTimeout((function(){t.setState({emoji:null})}),16))}},{key:"handleEmojiClick",value:function(e,t){this.props.onClick(e,t),this.handleEmojiSelect(e)}},{key:"handleEmojiSelect",value:function(e){var t=this;this.props.onSelect(e),this.hideRecent||this.props.recent||$m.add(e);var i=this.categoryRefs["category-1"];if(i){var n=i.maxMargin;this.props.enableFrequentEmojiSort&&i.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(i.memoizeSize(),n!=i.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&i.updateDisplay("none")))}))}}},{key:"handleScroll",value:function(){this.waitingForPaint||(this.waitingForPaint=!0,requestAnimationFrame(this.handleScrollPaint))}},{key:"handleScrollPaint",value:function(){if(this.waitingForPaint=!1,this.scroll){var e=null;if(this.SEARCH_CATEGORY.emojis)e=this.SEARCH_CATEGORY;else{for(var t=this.scroll.scrollTop,i=t>(this.scrollTop||0),n=0,a=0,r=this.categories.length;a<r;a++){var o=i?this.categories.length-1-a:a,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!n||l.top<n)&&l.top>0&&(n=l.top),u&&!e&&(e=s)}}t<n?e=this.categories.filter((function(e){return!(!1===e.anchor)}))[0]:t+this.clientHeight>=this.scrollHeight&&(e=this.categories[this.categories.length-1])}if(e){var 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 n=this.categoryRefs["category-".concat(t)];if(n&&"Search"!=n.props.name){var a=e?"none":"inherit";n.updateDisplay(a)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var i,n=this.categoryRefs["category-".concat(t)],a=this.scroll;this.anchors;i=function(){if(n){var t=n.top;e.first?t=0:t+=1,a.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(i)):i()}},{key:"handleSkinChange",value:function(e){var t={skin:e},i=this.props.onSkinChange;this.setState(t),jm.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=Tm(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(i),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var i=this.categoryRefs["category-".concat(e)];i&&i.memoizeSize()}if(this.scroll){var n=this.scroll;this.scrollHeight=n.scrollHeight,this.clientHeight=n.clientHeight}}},{key:"getCategories",value:function(){return this.state.firstRender?this.categories.slice(0,3):this.categories}},{key:"setAnchorsRef",value:function(e){this.anchors=e}},{key:"setSearchRef",value:function(e){this.search=e}},{key:"setPreviewRef",value:function(e){this.preview=e}},{key:"setScrollRef",value:function(e){this.scroll=e}},{key:"setCategoryRef",value:function(e,t){this.categoryRefs||(this.categoryRefs={}),this.categoryRefs[e]=t}},{key:"render",value:function(){var e=this,t=this.props,i=t.perLine,n=t.emojiSize,a=t.set,r=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,d=t.title,_=t.emoji,c=t.color,f=t.native,g=t.backgroundImageFn,h=t.emojisToShowFilter,p=t.showPreview,m=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,y=t.include,E=t.exclude,v=t.recent,k=t.autoFocus,D=t.skinEmoji,C=t.notFound,w=t.notFoundEmoji,S=i*(n+12)+12+2+function(){if("undefined"==typeof document)return 0;var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}(),O=this.getPreferredTheme(),T=this.props.skin||this.state.skin||jm.get("skin")||this.props.defaultSkin;return u.a.createElement("section",{style:IF({width:S},l),className:"emoji-mart emoji-mart-".concat(O),"aria-label":d,onKeyDown:this.handleKeyDown},u.a.createElement("div",{className:"emoji-mart-bar"},u.a.createElement(_F,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:c,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),u.a.createElement(MF,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:h,include:y,exclude:E,custom:this.CUSTOM,autoFocus:k}),u.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return u.a.createElement(CF,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:i,native:f,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?v:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:f,skin:T,size:n,set:a,sheetSize:r,sheetColumns:o,sheetRows:s,forceSize:f,tooltip:F,backgroundImageFn:g,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:C,notFoundEmoji:w})}))),(p||m)&&u.a.createElement("div",{className:"emoji-mart-bar"},u.a.createElement(NF,{ref:this.setPreviewRef,data:this.data,title:d,emoji:_,showSkinTones:m,showPreview:p,emojiProps:{native:f,size:38,skin:T,set:a,sheetSize:r,sheetColumns:o,sheetRows:s,backgroundImageFn:g},skinsProps:{skin:T,onChange:this.handleSkinChange,skinEmoji:D},i18n:this.i18n})))}}]),t}(u.a.PureComponent);function PF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}BF.propTypes=IF({},dF,{data:Pu.a.object.isRequired}),BF.defaultProps=IF({},fF);var jF=function(e){function t(){return pm()(this,t),eF()(this,iF()(t).apply(this,arguments))}return aF()(t,e),Fm()(t,[{key:"render",value:function(){return u.a.createElement(BF,Xm()({},this.props,this.state))}}]),t}(u.a.PureComponent);function qF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function UF(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?qF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):qF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}jF.propTypes=dF,jF.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?PF(Object(i),!0).forEach((function(t){Qm()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):PF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},fF,{data:gm});var zF=function e(t){for(var i in e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);return EF(UF({},t))};zF.propTypes=uF,zF.defaultProps=UF({},cF,{data:gm});var HF=i(65);function GF(e){return(GF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function WF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YF(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function VF(e,t){return(VF=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=ZF(e);if(t){var a=ZF(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return KF(this,i)}}function KF(e,t){if(t&&("object"===GF(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return QF(e)}function QF(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZF(e){return(ZF=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function XF(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var JF=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&VF(e,t)}(r,e);var t,i,n,a=$F(r);function r(){var e;WF(this,r);for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return XF(QF(e=a.call.apply(a,[this].concat(i))),"state",{selectedIndex:0,emojiSuggestions:Gm.search(e.props.query||"smile").slice(0,5)}),XF(QF(e),"onKeyDown",(function(t){var i=t.event;if("ArrowLeft"===i.key||"ArrowDown"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===i.key||"ArrowUp"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===i.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===i.key){var n;if(Object(HF.isEmpty)(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(n=Gm.search(e.props.query))||void 0===n?void 0:n[0]).run();return!0}return"Escape"===i.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),XF(QF(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return t=r,(i=[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:Gm.search(this.props.query||"smile").slice(0,5)})}},{key:"render",value:function(){var e=this;return u.a.createElement("div",{className:"flex space-x-0.5 items-center h-10"},this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map((function(t,i){return u.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(i)},className:_()("px-2 py-0.5 text-2xl transition-all duration-200 rounded cursor-pointer hover:bg-gray-100",{"bg-gray-200":i===e.state.selectedIndex})},t.native)})):u.a.createElement("p",{className:"p-2 font-semibold text-gray-500"},"No results"))}}])&&YF(t.prototype,i),n&&YF(t,n),r}(u.a.Component);function eb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function tb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?eb(Object(i),!0).forEach((function(t){ib(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):eb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function ib(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var nb=new Ot("emoji-suggestion"),ab=ns.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:nb,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Eu(JF,{props:i,editor:i.editor}),t=_u("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start"})},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[Xg(tb({editor:this.editor},this.options.suggestion))]}}),rb=i(36),ob={insert:"head",singleton:!1},sb=(r()(rb.a,ob),rb.a.locals,i(66));function lb(e){return(lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ub(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function db(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _b(e,t){return(_b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cb(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=hb(e);if(t){var a=hb(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fb(this,i)}}function fb(e,t){if(t&&("object"===lb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return gb(e)}function gb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hb(e){return(hb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pb(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var mb=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_b(e,t)}(r,e);var t,i,n,a=cb(r);function r(){var e;ub(this,r);for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return pb(gb(e=a.call.apply(a,[this].concat(i))),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),pb(gb(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return t=r,(i=[{key:"render",value:function(){return u.a.createElement(BF,{style:{maxWidth:"100%"},data:sb,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect})}}])&&db(t.prototype,i),n&&db(t,n),r}(u.a.Component);function Fb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function bb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Fb(Object(i),!0).forEach((function(t){yb(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Fb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function yb(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var Eb=new Ot("emoji-picker"),vb=ns.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:Eb,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Eu(mb,{props:i,editor:i.editor}),t=_u("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},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[Xg(bb({editor:this.editor},this.options.suggestion))]}});function kb(e){return function(e){if(Array.isArray(e))return Db(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Db(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Db(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Db(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Cb=["forceTitle","hideSlashCommands","formatterOptions","className","uploadEndpoint","initialValue","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName"];function wb(){return(wb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Sb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,a,r=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ob(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ob(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ob(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Tb(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var xb=function(e,t){var i,n,a,r=e.forceTitle,o=void 0!==r&&r,s=e.hideSlashCommands,d=void 0!==s&&s,c=e.formatterOptions,f=void 0===c?["bold","italic","underline","code","highlight","strike","link"]:c,g=e.className,h=e.uploadEndpoint,p=e.initialValue,m=void 0===p?"":p,F=e.onChange,b=void 0===F?function(){}:F,y=e.menuType,E=void 0===y?"fixed":y,v=e.variables,k=e.mentions,D=e.showImageInMention,C=void 0!==D&&D,w=e.placeholder,S=e.extensions,O=e.contentClassName,T=Tb(e,Cb),x=Sb(Object(l.useState)(!1),2),N=x[0],A=x[1],M="fixed"===E,R="bubble"===E,I=!d,L=!w&&I,B=function(e){var t,i=e.forceTitle,n=e.placeholder,a=e.extensions,r=e.mentions,o=e.variables,s=e.isSlashCommandsActive,l=e.showImageInMention,u=e.setImageUploadVisible;return a?t=kb(a):(t=[Ag.extend({content:i?"heading block*":"block+"}),eg.configure({document:!1,codeBlock:!1}),jg,vg,Og,Cg,Fp,Pg,df,fm,Sg,Tg,Np.configure({placeholder:xp(n)}),ab,vb],s&&t.push(nh({setImageUploadVisible:u})),Ng()(r)||t.push(cm({suggestion:{items:rm(r,{showImage:l})}})),Ng()(o)||t.push(wp({suggestion:{items:function(){return o}}}))),t}({contentClassName:O,forceTitle:o,placeholder:w,extensions:S,mentions:k,variables:v,isSlashCommandsActive:I,showImageInMention:C,setImageUploadVisible:A}),P=yu({extensions:B,content:m,injectCSS:!1,editorProps:{attributes:{class:_()("focus:outline-none whitespace-pre-wrap p-3",(i={"slash-active":L,"fixed-menu-active border":M,"bubble-menu-active":R},n=g,a=g,n in i?Object.defineProperty(i,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[n]=a,i))}},onUpdate:function(e){var t=e.editor;return b(t.getHTML())}});return u.a.useImperativeHandle(t,(function(){return{editor:P}})),u.a.createElement("div",null,M?u.a.createElement(ac,{editor:P,variables:v,setImageUploadVisible:A}):null,R?u.a.createElement(Iu,{editor:P,formatterOptions:f}):null,u.a.createElement(Wc,{isVisible:N,setIsVisible:A,editor:P,imageUploadUrl:h}),u.a.createElement(Ou,wb({editor:P},T)))},Nb=u.a.forwardRef(xb),Ab=i(67),Mb=i.n(Ab);var Rb=i(68),Ib=i.n(Rb),Lb=["content","classNames"];function Bb(){return(Bb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Pb(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var jb=function(e){var t,i,n,a=e.content,r=void 0===a?"":a,o=e.classNames,s=Pb(e,Lb);return Object(l.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){Mb.a.highlightElement(e)}))}),[r]),u.a.createElement("div",Bb({className:_()("neeto-editor-content",(t={},i=o,n=o,i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t)),dangerouslySetInnerHTML:{__html:Ib.a.sanitize(r)}},s))}}])}));
|
package/package.json
CHANGED