@maily-to/core 0.0.13 → 0.0.14

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/dist/index.d.mts CHANGED
@@ -22,6 +22,7 @@ type MailyContextType = {
22
22
  slashCommands?: SlashCommandItem[];
23
23
  };
24
24
 
25
+ type ParitialMailContextType = Partial<MailyContextType>;
25
26
  type EditorProps = {
26
27
  contentHtml?: string;
27
28
  contentJson?: JSONContent;
@@ -36,8 +37,9 @@ type EditorProps = {
36
37
  contentClassName?: string;
37
38
  bodyClassName?: string;
38
39
  autofocus?: FocusPosition;
40
+ immediatelyRender?: boolean;
39
41
  };
40
- } & Partial<MailyContextType>;
42
+ } & ParitialMailContextType;
41
43
  declare function Editor(props: EditorProps): react_jsx_runtime.JSX.Element | null;
42
44
 
43
45
  export { Editor, type EditorProps };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ type MailyContextType = {
22
22
  slashCommands?: SlashCommandItem[];
23
23
  };
24
24
 
25
+ type ParitialMailContextType = Partial<MailyContextType>;
25
26
  type EditorProps = {
26
27
  contentHtml?: string;
27
28
  contentJson?: JSONContent;
@@ -36,8 +37,9 @@ type EditorProps = {
36
37
  contentClassName?: string;
37
38
  bodyClassName?: string;
38
39
  autofocus?: FocusPosition;
40
+ immediatelyRender?: boolean;
39
41
  };
40
- } & Partial<MailyContextType>;
42
+ } & ParitialMailContextType;
41
43
  declare function Editor(props: EditorProps): react_jsx_runtime.JSX.Element | null;
42
44
 
43
45
  export { Editor, type EditorProps };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- "use strict";var jt=Object.create;var $=Object.defineProperty,Jt=Object.defineProperties,Yt=Object.getOwnPropertyDescriptor,Qt=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertyNames,X=Object.getOwnPropertySymbols,eo=Object.getPrototypeOf,ye=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable;var Re=(t,e,o)=>e in t?$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,y=(t,e)=>{for(var o in e||(e={}))ye.call(e,o)&&Re(t,o,e[o]);if(X)for(var o of X(e))Se.call(e,o)&&Re(t,o,e[o]);return t},C=(t,e)=>Jt(t,Qt(e));var N=(t,e)=>{var o={};for(var r in t)ye.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&X)for(var r of X(t))e.indexOf(r)<0&&Se.call(t,r)&&(o[r]=t[r]);return o};var to=(t,e)=>{for(var o in e)$(t,o,{get:e[o],enumerable:!0})},Be=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Zt(e))!ye.call(t,n)&&n!==o&&$(t,n,{get:()=>e[n],enumerable:!(r=Yt(e,n))||r.enumerable});return t};var x=(t,e,o)=>(o=t!=null?jt(eo(t)):{},Be(e||!t||!t.__esModule?$(o,"default",{value:t,enumerable:!0}):o,t)),oo=t=>Be($({},"__esModule",{value:!0}),t);var fo={};to(fo,{Editor:()=>wo});module.exports=oo(fo);function _(t,{insertAt:e}={}){if(!t||typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}_(`.mly-editor .mly-prose p:where([class~=text-sm]){font-size:16px}.mly-editor .mly-prose h1,.mly-editor .mly-prose h2,.mly-editor .mly-prose h3{margin-top:0;margin-bottom:12px}.mly-editor .mly-prose h1{font-size:36px}.mly-editor .mly-prose h2{font-size:30px}.mly-editor .mly-prose h3{font-size:24px}.mly-editor .mly-prose p{font-size:15px;margin-bottom:20px}.mly-editor .mly-prose h1+p,.mly-editor .mly-prose h2+p,.mly-editor .mly-prose h3+p,.mly-editor .mly-prose hr+p{margin-top:0}.mly-editor .mly-prose ol,.mly-editor .mly-prose ul{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose li:not(:last-child){margin-bottom:8px}.mly-editor .mly-prose li>p{margin:0}.mly-editor .mly-prose img{margin-top:0;margin-bottom:32px}.mly-editor .mly-prose hr{margin-block:32px}.mly-editor .mly-prose .footer{display:block;font-size:13px;margin-bottom:20px;color:#64748b}.mly-editor .mly-prose .spacer+*{margin-top:0}.mly-editor .mly-prose p+.spacer{margin-top:-20px}.mly-editor .mly-prose blockquote+.spacer{margin-top:-16px}.mly-editor .mly-prose h1+.spacer,.mly-editor .mly-prose h2+.spacer,.mly-editor .mly-prose h3+.spacer{margin-top:-12px}.mly-editor .mly-prose ol+.spacer,.mly-editor .mly-prose ul+.spacer{margin-top:-20px}.mly-editor .mly-prose img+.spacer{margin-top:-32px}.mly-editor .mly-prose .node-button+.spacer,.mly-editor .mly-prose .node-linkCard+.spacer,.mly-editor .mly-prose footer+.spacer{margin-top:-20px}.mly-editor .mly-prose .node-button,.mly-editor .mly-prose .node-linkCard{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose .node-image{line-height:0;margin-top:0;margin-bottom:32px;outline:none}.mly-editor .mly-prose .node-image+.spacer{margin-top:-32px}.mly-editor .mly-prose code:before,.mly-editor .mly-prose code:after{content:none}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:"liga" 0}.ProseMirror:focus{outline:none}.ProseMirror .is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror .is-empty:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror-selectednode{outline:3px solid #555}.mly-no-scrollbar::-webkit-scrollbar{display:none}.mly-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.mly-editor .react-colorful__alpha{border-radius:0}.mly-editor .react-colorful__saturation,.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{border-radius:8px}.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{height:16px}.mly-editor .react-colorful__pointer{width:16px;height:16px}
3
- `);_(`:where(.mly-editor),:where(.mly-editor) :before,:where(.mly-editor) :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:where(.mly-editor) :before,:where(.mly-editor) :after{--tw-content: ""}:where(.mly-editor) html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}:where(.mly-editor) body{margin:0;line-height:inherit}:where(.mly-editor) hr{height:0;color:inherit;border-top-width:1px}:where(.mly-editor) abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6{font-size:inherit;font-weight:inherit}:where(.mly-editor) a{color:inherit;text-decoration:inherit}:where(.mly-editor) b,:where(.mly-editor) strong{font-weight:bolder}:where(.mly-editor) code,:where(.mly-editor) kbd,:where(.mly-editor) samp,:where(.mly-editor) pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}:where(.mly-editor) small{font-size:80%}:where(.mly-editor) sub,:where(.mly-editor) sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.mly-editor) sub{bottom:-.25em}:where(.mly-editor) sup{top:-.5em}:where(.mly-editor) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.mly-editor) button,:where(.mly-editor) input,:where(.mly-editor) optgroup,:where(.mly-editor) select,:where(.mly-editor) textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}:where(.mly-editor) button,:where(.mly-editor) select{text-transform:none}:where(.mly-editor) button,:where(.mly-editor) [type=button],:where(.mly-editor) [type=reset],:where(.mly-editor) [type=submit]{-webkit-appearance:button;background-image:none}:where(.mly-editor) :-moz-focusring{outline:auto}:where(.mly-editor) :-moz-ui-invalid{box-shadow:none}:where(.mly-editor) progress{vertical-align:baseline}:where(.mly-editor) ::-webkit-inner-spin-button,:where(.mly-editor) ::-webkit-outer-spin-button{height:auto}:where(.mly-editor) [type=search]{-webkit-appearance:textfield;outline-offset:-2px}:where(.mly-editor) ::-webkit-search-decoration{-webkit-appearance:none}:where(.mly-editor) ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(.mly-editor) summary{display:list-item}:where(.mly-editor) blockquote,:where(.mly-editor) dl,:where(.mly-editor) dd,:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6,:where(.mly-editor) hr,:where(.mly-editor) figure,:where(.mly-editor) p,:where(.mly-editor) pre{margin:0}:where(.mly-editor) fieldset{margin:0;padding:0}:where(.mly-editor) legend{padding:0}:where(.mly-editor) ol,:where(.mly-editor) ul,:where(.mly-editor) menu{list-style:none;margin:0;padding:0}:where(.mly-editor) dialog{padding:0}:where(.mly-editor) textarea{resize:vertical}:where(.mly-editor) input::-moz-placeholder,:where(.mly-editor) textarea::-moz-placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) input::placeholder,:where(.mly-editor) textarea::placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) button,:where(.mly-editor) [role=button]{cursor:pointer}:where(.mly-editor) :disabled{cursor:default}:where(.mly-editor) img,:where(.mly-editor) svg,:where(.mly-editor) video,:where(.mly-editor) canvas,:where(.mly-editor) audio,:where(.mly-editor) iframe,:where(.mly-editor) embed,:where(.mly-editor) object{display:block;vertical-align:middle}:where(.mly-editor) img,:where(.mly-editor) video{max-width:100%;height:auto}:where(.mly-editor) [hidden]{display:none}
4
- `);_('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;text-align:start;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-absolute{position:absolute}.mly-relative{position:relative}.mly-inset-0{inset:0}.mly-z-50{z-index:50}.\\!mly-my-0{margin-top:0!important;margin-bottom:0!important}.\\!mly-mb-0{margin-bottom:0!important}.\\!mly-mb-1{margin-bottom:.25rem!important}.\\!mly-mb-1\\.5{margin-bottom:.375rem!important}.mly-mb-1{margin-bottom:.25rem}.mly-mb-1\\.5{margin-bottom:.375rem}.mly-mb-4{margin-bottom:1rem}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-inline-block{display:inline-block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-grid{display:grid}.mly-aspect-\\[16\\/9\\]{aspect-ratio:16/9}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-h-full{height:100%}.mly-max-h-\\[330px\\]{max-height:330px}.mly-min-h-24{min-height:6rem}.\\!mly-w-full{width:100%!important}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-72{width:18rem}.mly-w-96{width:24rem}.mly-w-full{width:100%}.mly-min-w-0{min-width:0px}.mly-min-w-\\[128px\\]{min-width:128px}.mly-min-w-\\[260px\\]{min-width:260px}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-items-stretch{align-items:stretch}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-1\\.5{gap:.375rem}.mly-gap-2{gap:.5rem}.mly-gap-3{gap:.75rem}.mly-gap-4{gap:1rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.mly-space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-lg{border-radius:.5rem}.mly-rounded-md{border-radius:.375rem}.mly-rounded-none{border-radius:0}.mly-rounded-xl{border-radius:.75rem}.mly-rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.mly-border{border-width:1px}.mly-border-0{border-width:0px}.mly-border-l-4{border-left-width:4px}.mly-border-t{border-top-width:1px}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.mly-border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.\\!mly-bg-transparent{background-color:transparent!important}.mly-bg-\\[\\#efefef\\]{--tw-bg-opacity: 1;background-color:rgb(239 239 239 / var(--tw-bg-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity))}.mly-bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.mly-bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity))}.mly-stroke-\\[2\\.5\\]{stroke-width:2.5}.mly-object-cover{-o-object-fit:cover;object-fit:cover}.\\!mly-p-0{padding:0!important}.mly-p-1{padding:.25rem}.mly-p-3{padding:.75rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-0{padding-top:0;padding-bottom:0}.mly-py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.\\!mly-text-base{font-size:1rem!important;line-height:1.5rem!important}.\\!mly-text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-uppercase{text-transform:uppercase}.mly-capitalize{text-transform:capitalize}.mly-leading-none{line-height:1}.mly-tracking-normal{letter-spacing:0em}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-gray-950{--tw-text-opacity: 1;color:rgb(3 7 18 / var(--tw-text-opacity))}.mly-text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-border-gray-400:focus-visible{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');var me=require("@tiptap/react");var Y=require("@tiptap/react"),k=require("lucide-react");var ze=require("@tiptap/core"),Ie=x(require("@tiptap/extension-image"));var Ee=["sm","md","lg"],j=["left","center","right"],He="left",ue="sm";function ro(t){let e={sm:"40px",md:"48px",lg:"64px"};return[`height:${e[t]||e[ue]}`,`width:${e[t]||e[ue]}`]}function lo(t){let e={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return e[t]||e[He]}var Ve=Ie.default.extend({name:"logo",priority:1e3,addAttributes(){var t;return C(y({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:ue,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:He,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},renderHTML({HTMLAttributes:t,node:e}){let{size:o,alignment:r}=e.attrs,n=["position:relative","margin-top:0",...ro(o),...lo(r)];return t.style=n.join(";"),["img",(0,ze.mergeAttributes)(this.options.HTMLAttributes,t)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});var De=x(require("react")),_e=require("@radix-ui/react-slot");var Oe=require("clsx"),Ue=require("tailwind-merge");function w(...t){return(0,Ue.twMerge)((0,Oe.clsx)(t))}var qe=require("react/jsx-runtime"),B=De.forwardRef((i,s)=>{var l=i,{className:t,variant:e="default",size:o="default",asChild:r=!1}=l,n=N(l,["className","variant","size","asChild"]);let a=r?_e.Slot:"button",g="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",m={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},d={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},f=w("mly-editor",g,m[e],d[o],t);return(0,qe.jsx)(a,y({className:f,ref:s},n))});B.displayName="BaseButton";var J=require("react/jsx-runtime");function O(t){return(0,J.jsx)(B,{variant:"ghost",size:"sm",onClick:t.command,"data-state":t.isActive(),className:w("mly-px-2.5"),type:"button",children:t.icon?(0,J.jsx)(t.icon,{className:w("mly-h-3.5 mly-w-3.5")}):(0,J.jsx)("span",{className:"mly-text-sm mly-font-medium mly-text-slate-600",children:t.name})})}var ge=require("react/jsx-runtime");function Fe(t){let{editor:e}=t,o=[k.AlignLeftIcon,k.AlignCenterIcon,k.AlignRightIcon],r=j.map((i,l)=>({name:i,isActive:()=>e==null?void 0:e.isActive({textAlign:i}),command:()=>{var a,g,m,d;(a=t==null?void 0:t.editor)!=null&&a.isActive({textAlign:i})?(m=(g=t==null?void 0:t.editor)==null?void 0:g.chain())==null||m.focus().unsetTextAlign().run():(d=t==null?void 0:t.editor)==null||d.chain().focus().setTextAlign(i).run()},icon:o[l]})),n=[{name:"bold",isActive:()=>e==null?void 0:e.isActive("bold"),command:()=>e==null?void 0:e.chain().focus().toggleBold().run(),icon:k.BoldIcon},{name:"italic",isActive:()=>e==null?void 0:e.isActive("italic"),command:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),icon:k.ItalicIcon},{name:"underline",isActive:()=>e==null?void 0:e.isActive("underline"),command:()=>e==null?void 0:e.chain().focus().toggleUnderline().run(),icon:k.UnderlineIcon},{name:"strike",isActive:()=>e==null?void 0:e.isActive("strike"),command:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),icon:k.StrikethroughIcon},...r,{name:"code",isActive:()=>e==null?void 0:e.isActive("code"),command:()=>e==null?void 0:e.chain().focus().toggleCode().run(),icon:k.CodeIcon},{name:"link",command:()=>{let i=e==null?void 0:e.getAttributes("link").href,l=window.prompt("URL",i);if(l!==null){if(l===""){e==null||e.chain().focus().extendMarkRange("link").unsetLink().run();return}e==null||e.chain().focus().extendMarkRange("link").setLink({href:l}).run()}},isActive:()=>e==null?void 0:e.isActive("link"),icon:k.LinkIcon}],s=C(y({},t),{shouldShow:({editor:i,state:l,from:a,to:g})=>{let{doc:m,selection:d}=l,{empty:f}=d,V=!m.textBetween(a,g).length&&(0,Y.isTextSelection)(l.selection);return!(f||V||!i.isEditable||i.isActive("image")||i.isActive("logo")||i.isActive("spacer")||i.isActive("variable")||i.isActive({mailyComponent:"button"})||i.isActive({mailyComponent:"linkCard"}))},tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,ge.jsx)(Y.BubbleMenu,C(y({},s),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:n.map((i,l)=>(0,ge.jsx)(O,y({},i),l))}))}var he=require("react"),v=require("lucide-react");var Q=require("react/jsx-runtime"),We=t=>{let{editor:e,config:o}=t,r=(0,he.useMemo)(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:v.BoldIcon},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:v.ItalicIcon},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:v.UnderlineIcon},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:v.StrikethroughIcon},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:v.EraserIcon},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:v.SeparatorHorizontal},{name:"link",command:()=>{let s=e.getAttributes("link").href,i=window.prompt("URL",s);if(i!==null){if(i===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:i}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:v.LinkIcon},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:v.AlignLeft},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:v.AlignCenter},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:v.AlignRight}],[e]),n=(0,he.useMemo)(()=>r.reduce((s,i)=>(s.includes(i.group)||s.push(i.group),s),[]),[r]);return e?(0,Q.jsx)("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:n.map((s,i)=>(0,Q.jsx)("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(l=>l.group===s).map((l,a)=>(0,Q.jsx)(O,y({},l),a))},i))}):null};var $e=require("@tiptap/react"),L=require("lucide-react");var we=require("react/jsx-runtime");function Ke(t){let{editor:e}=t,o=[L.AlignLeftIcon,L.AlignCenterIcon,L.AlignRightIcon],r=j.map((l,a)=>({name:l,isActive:()=>(e==null?void 0:e.isActive("logo",{alignment:l}))||(e==null?void 0:e.isActive("image",{alignment:l})),shouldShow:()=>(e==null?void 0:e.isActive("logo"))||(e==null?void 0:e.isActive("image")),command:()=>{var m,d;(e==null?void 0:e.isActive("logo"))?(m=t==null?void 0:t.editor)==null||m.chain().focus().setLogoAttributes({alignment:l}).run():(d=t==null?void 0:t.editor)==null||d.chain().focus().updateAttributes("image",{alignment:l}).run()},icon:o[a]})),n=Ee.map(l=>({name:l,isActive:()=>{var a;return(a=t==null?void 0:t.editor)==null?void 0:a.isActive("logo",{size:l})},shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var a;(a=t==null?void 0:t.editor)==null||a.chain().focus().setLogoAttributes({size:l}).run()}})),s=[...r,{name:"url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var V,M,b;let{editor:l}=t,a=(V=l==null?void 0:l.getAttributes("logo"))==null?void 0:V.src,g=window.prompt("Update logo URL",a);if(!g)return;let m=(M=l==null?void 0:l.getAttributes("logo"))==null?void 0:M.size,d=(b=l==null?void 0:l.getAttributes("logo"))==null?void 0:b.alignment,f=l==null?void 0:l.state.selection;l==null||l.commands.setLogoImage({src:g,size:m,alignment:d}),l==null||l.commands.setNodeSelection((f==null?void 0:f.from)||0)},icon:L.Link},{name:"image-url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("image"),command:()=>{var d;let{editor:l}=t,a=(d=l==null?void 0:l.getAttributes("image"))==null?void 0:d.src,g=window.prompt("Update Image URL",a);if(!g)return;let m=l==null?void 0:l.state.selection;l==null||l.commands.setImage({src:g}),l==null||l.commands.setNodeSelection((m==null?void 0:m.from)||0)},icon:L.Unlink},{name:"image-external-url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("image"),command:()=>{var m;let{editor:l}=t,a=(m=l==null?void 0:l.getAttributes("image"))==null?void 0:m.externalLink,g=window.prompt("Update Image External URL",a||"");l==null||l.commands.updateAttributes("image",{externalLink:g||""})},icon:L.ArrowUpRight},...n],i=C(y({},t),{shouldShow:({editor:l})=>l.isActive("logo")||l.isActive("image"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,we.jsx)($e.BubbleMenu,C(y({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:s.filter(l=>{var a;return(a=l.shouldShow)==null?void 0:a.call(l)}).map((l,a)=>(0,we.jsx)(O,y({},l),a))}))}var Xe=require("@tiptap/react");var Z=require("@tiptap/core"),fe=["sm","md","lg","xl"],no="sm";function ao(t){let e={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${e[t]||e[no]}`}var Ge=Z.Node.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height})}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>{if(!fe.includes(t))throw new Error("Invalid spacer height");return e.updateAttributes("spacer",{height:t})},unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){let{height:o}=e.attrs;return t.style=ao(o),["div",(0,Z.mergeAttributes)({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer relative z-50",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});var be=require("react/jsx-runtime");function je(t){let{editor:e}=t,o=fe.map(n=>({name:n,isActive:()=>e==null?void 0:e.isActive("spacer",{height:n}),command:()=>{e==null||e.chain().focus().setSpacer({height:n}).run()}})),r=C(y({},t),{shouldShow:({editor:n})=>n.isActive("spacer"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,be.jsx)(Xe.BubbleMenu,C(y({},r),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:o.map((n,s)=>(0,be.jsx)(O,y({},n),s))}))}var Vt=x(require("@tiptap/starter-kit")),Ot=require("@tiptap/extension-color"),Ut=x(require("@tiptap/extension-link")),Dt=x(require("@tiptap/extension-list-item")),_t=x(require("@tiptap/extension-paragraph")),qt=x(require("@tiptap/extension-placeholder")),Ft=x(require("@tiptap/extension-text-align")),Te=x(require("@tiptap/extension-text-style")),Wt=x(require("@tiptap/extension-heading")),$t=x(require("@tiptap/extension-underline"));var Je=require("@tiptap/core"),Ye=require("@tiptap/extension-horizontal-rule"),Qe=Ye.HorizontalRule.extend({addInputRules(){return[new Je.InputRule({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{let o={},{tr:r}=t,n=e.from,s=e.to;r.insert(n-1,this.type.create(o)).delete(r.mapping.map(n),r.mapping.map(s))}})]}});var te=require("@tiptap/core"),it=require("@tiptap/react");var rt=require("@tiptap/react"),F=require("lucide-react");var Ze=require("react"),ee=require("react-colorful"),K=require("react/jsx-runtime");function xe(t){let{color:e,onChange:o}=t,[r,n]=(0,Ze.useState)(e),s=i=>{n(i),o==null||o(i)};return(0,K.jsxs)("div",{className:"mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4",children:[(0,K.jsx)(ee.HexAlphaColorPicker,{color:r,onChange:s,className:"mly-flex !mly-w-full mly-flex-col mly-gap-4"}),(0,K.jsx)(ee.HexColorInput,{alpha:!0,color:r,onChange:s,className:"mly-mt-4 mly-w-full mly-min-w-0 mly-rounded-lg mly-border mly-px-2 mly-py-1.5 mly-text-sm mly-uppercase focus-visible:mly-border-gray-400 focus-visible:mly-outline-none",prefixed:!0})]})}var et=x(require("react"));var tt=require("react/jsx-runtime"),T=et.forwardRef((n,r)=>{var s=n,{className:t,type:e}=s,o=N(s,["className","type"]);return(0,tt.jsx)("input",y({type:e,className:w("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",t),ref:r},o))});T.displayName="Input";var ot=x(require("react")),z=x(require("@radix-ui/react-popover"));var ve=require("react/jsx-runtime"),U=z.Root,D=z.Trigger,I=ot.forwardRef((s,n)=>{var i=s,{className:t,align:e="center",sideOffset:o=4}=i,r=N(i,["className","align","sideOffset"]);return(0,ve.jsx)(z.Portal,{children:(0,ve.jsx)(z.Content,y({ref:n,align:e,sideOffset:o,className:w("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-text-gray-950 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2","mly-editor",t)},r))})});I.displayName=z.Content.displayName;var c=require("react/jsx-runtime"),io={left:F.AlignLeftIcon,center:F.AlignCenterIcon,right:F.AlignRightIcon},ke={style(t){return nt.map(e=>({name:e,isActive:t.node.attrs.variant===e,onClick:()=>{t.updateAttributes({variant:e})}}))},cornerRadius(t){return at.map(e=>({name:e,isActive:t.node.attrs.borderRadius===e,onClick:()=>{t.updateAttributes({borderRadius:e})}}))},alignment(t){return Object.entries(io).map(([e,o])=>({name:e,icon:o,isActive:t.node.attrs.alignment===e,onClick:()=>t.updateAttributes({alignment:e})}))}};function lt(t){let{url:e,text:o,alignment:r,variant:n,borderRadius:s,buttonColor:i,textColor:l}=t.node.attrs,{getPos:a,editor:g}=t;return(0,c.jsx)(rt.NodeViewWrapper,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:(0,c.jsxs)(U,{open:t.selected,children:[(0,c.jsx)(D,{asChild:!0,children:(0,c.jsx)("div",{children:(0,c.jsx)("button",{className:w("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":s==="round","!mly-rounded-md":s==="smooth","!mly-rounded-none":s==="sharp"}),tabIndex:-1,style:{backgroundColor:n==="filled"?i:"transparent",color:l,borderWidth:2,borderStyle:"solid",borderColor:i},onClick:m=>{m.preventDefault();let d=a();g.commands.setNodeSelection(d)},children:o})})}),(0,c.jsxs)(I,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:m=>m.preventDefault(),onCloseAutoFocus:m=>m.preventDefault(),children:[(0,c.jsx)(T,{placeholder:"Add text here",value:o,onChange:m=>{t.updateAttributes({text:m.target.value})}}),(0,c.jsx)(T,{placeholder:"Add link here",value:e,onChange:m=>{t.updateAttributes({url:m.target.value})}}),(0,c.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,c.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),(0,c.jsx)("div",{className:"mly-flex mly-gap-1",children:ke.style(t).map((m,d)=>(0,c.jsx)(B,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},d))})]}),(0,c.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,c.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),(0,c.jsx)("div",{className:"mly-flex mly-gap-1",children:ke.cornerRadius(t).map((m,d)=>(0,c.jsx)(B,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},d))})]}),(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),(0,c.jsx)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:ke.alignment(t).map((m,d)=>(0,c.jsx)(B,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:m.onClick,type:"button",children:(0,c.jsx)(m.icon,{size:16})},d))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),(0,c.jsxs)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[(0,c.jsx)(so,{variant:n,color:i,onChange:m=>{t.updateAttributes({buttonColor:m})}}),(0,c.jsx)(mo,{color:l,onChange:m=>{t.updateAttributes({textColor:m})}})]})]})]})]})]})})}function so(t){let{color:e,onChange:o,variant:r}=t;return(0,c.jsxs)(U,{children:[(0,c.jsx)(D,{asChild:!0,children:(0,c.jsx)(B,{variant:"ghost",className:"",size:"sm",type:"button",children:(0,c.jsx)("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:e}})})}),(0,c.jsx)(I,{className:"mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",children:(0,c.jsx)(xe,{color:e,onChange:n=>{queueMicrotask(()=>{o(n)})}})})]})}function mo(t){let{color:e,onChange:o}=t;return(0,c.jsxs)(U,{children:[(0,c.jsx)(D,{asChild:!0,children:(0,c.jsx)(B,{variant:"ghost",size:"sm",type:"button",children:(0,c.jsxs)("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[(0,c.jsx)("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),(0,c.jsx)("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:e}})]})})}),(0,c.jsx)(I,{className:"mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",children:(0,c.jsx)(xe,{color:e,onChange:r=>{queueMicrotask(()=>{o(r)})}})})]})}var nt=["filled","outline"],at=["sharp","smooth","round"],st=te.Node.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["a",(0,te.mergeAttributes)({"data-maily-component":this.name},t)]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return(0,it.ReactNodeViewRenderer)(lt)}});var oe=require("@tiptap/core"),Ae=oe.Node.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",(0,oe.mergeAttributes)(this.options.HTMLAttributes,t,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});var E=require("react"),le=require("@tiptap/react"),yt=x(require("tippy.js")),ut=require("lucide-react");var re=require("react");var pt=require("react/jsx-runtime"),mt=(0,re.createContext)({variables:[],slashCommands:[]});function dt(t){let r=t,{children:e}=r,o=N(r,["children"]);return(0,pt.jsx)(mt.Provider,{value:o,children:e})}function ct(){let t=(0,re.useContext)(mt);if(!t)throw new Error("Missing MailyContext.Provider in the component tree");return t}var A=require("react/jsx-runtime"),gt=(0,E.forwardRef)((t,e)=>{var s,i;let[o,r]=(0,E.useState)(0),n=l=>{let a=t.items[l];a&&t.command({id:a})};return(0,E.useEffect)(()=>r(0),[t.items]),(0,E.useImperativeHandle)(e,()=>({onKeyDown:({event:l})=>l.key==="ArrowUp"?(r((o+t.items.length-1)%t.items.length),!0):l.key==="ArrowDown"?(r((o+1)%t.items.length),!0):l.key==="Enter"?(n(o),!0):!1})),(0,A.jsx)("div",{className:"mly-z-50 mly-h-auto mly-min-w-[128px] mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-1 mly-shadow-md mly-transition-all",children:(s=t==null?void 0:t.items)!=null&&s.length?(i=t==null?void 0:t.items)==null?void 0:i.map((l,a)=>(0,A.jsx)("button",{onClick:()=>n(a),className:w("mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",a===o?"mly-bg-gray-200":"mly-bg-white"),children:l},a)):(0,A.jsx)("button",{className:"mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-bg-white mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:"No result"})})});gt.displayName="VariableList";function ht(t=[]){let e=t.map(o=>o.name);return{items:({query:o})=>e.concat(o.length>0?[o]:[]).filter(r=>r.toLowerCase().startsWith(o.toLowerCase())).slice(0,5),render:()=>{let o,r=null;return{onStart:n=>{o=new le.ReactRenderer(gt,{props:n,editor:n.editor}),n.clientRect&&(r=(0,yt.default)("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:o.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(n){var s;o.updateProps(n),n.clientRect&&((s=r==null?void 0:r[0])==null||s.setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var s;return n.event.key==="Escape"?(r==null||r[0].hide(),!0):(s=o.ref)==null?void 0:s.onKeyDown(n)},onExit(){!r||!(r!=null&&r[0])||!o||(r==null||r[0].destroy(),o.destroy())}}}}}function wt(t){var m,d;let{node:e,selected:o,updateAttributes:r}=t,{id:n,fallback:s}=e.attrs,{variables:i=[]}=ct(),l=(d=(m=i.find(f=>f.name===n))==null?void 0:m.required)!=null?d:!0,[a,g]=(0,E.useState)(!1);return(0,A.jsx)(le.NodeViewWrapper,{className:w("react-component",o&&"ProseMirror-selectednode","mly-inline-block mly-leading-none"),draggable:"false",children:(0,A.jsxs)(U,{open:a,onOpenChange:g,children:[(0,A.jsx)(D,{children:(0,A.jsxs)("span",{tabIndex:-1,className:"mly-inline-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-border-rose-200 mly-bg-rose-50 mly-px-2 mly-py-1 mly-leading-none mly-text-rose-800",children:[n,l&&!s&&(0,A.jsx)(ut.AlertTriangle,{className:"mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5]"})]})}),(0,A.jsxs)(I,{align:"start",className:"mly-space-y-2",onOpenAutoFocus:f=>f.preventDefault(),onCloseAutoFocus:f=>f.preventDefault(),children:[(0,A.jsxs)("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[(0,A.jsx)("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Variable Name"}),(0,A.jsx)(T,{placeholder:"Add Variable Name",value:n,onChange:f=>{r({id:f.target.value})}})]}),(0,A.jsxs)("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[(0,A.jsx)("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Fallback Value"}),(0,A.jsx)(T,{placeholder:"Fallback Value",value:s||"",onChange:f=>{r({fallback:f.target.value})}}),(0,A.jsx)("p",{className:"mly-text-xs mly-text-gray-500",children:"If the variable doesn't exist, this fallback value will be used."})]})]})]})})}var P=require("react"),ft=require("@tiptap/core"),bt=require("@tiptap/react"),xt=x(require("@tiptap/suggestion")),h=require("lucide-react"),vt=x(require("tippy.js"));var u=require("react/jsx-runtime"),kt=ft.Extension.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:o})=>{o.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[(0,xt.default)(y({editor:this.editor},this.options.suggestion))]}}),co=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:(0,u.jsx)(h.Text,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:(0,u.jsx)(h.Heading1,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:(0,u.jsx)(h.Heading2,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:(0,u.jsx)(h.Heading3,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:(0,u.jsx)(h.List,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:(0,u.jsx)(h.ListOrdered,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:(0,u.jsx)(h.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Image URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setImage({src:o}).run())}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:(0,u.jsx)(h.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Logo URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setLogoImage({src:o}).run())}},{title:"Spacer",description:"Add a spacer to email. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:(0,u.jsx)(h.MoveVertical,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to email.",searchTerms:["link","button","cta"],icon:(0,u.jsx)(h.MousePointer,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setButton().run()}},{title:"Link Card",description:"Add a link card to email.",searchTerms:["link","button","image"],icon:(0,u.jsx)(h.ArrowUpRightSquare,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setLinkCard().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:(0,u.jsx)(h.DivideIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHardBreak().run()}},{title:"Blockquote",description:"Add blockquote.",searchTerms:["quote","blockquote"],icon:(0,u.jsx)(h.TextQuote,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBlockquote().run()}},{title:"Footer",description:"Add a footer text to email.",searchTerms:["footer","text"],icon:(0,u.jsx)(h.FootprintsIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:(0,u.jsx)(h.EraserIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().selectParentNode().deleteSelection().run()}}],po=(t,e)=>{let o=t.offsetHeight,r=e?e.offsetHeight:0,n=e.offsetTop,s=n+r;n<t.scrollTop?t.scrollTop-=t.scrollTop-n+5:s>o+t.scrollTop&&(t.scrollTop+=s-o-t.scrollTop+5)},yo=({items:t,command:e,editor:o})=>{let[r,n]=(0,P.useState)(0),s=(0,P.useCallback)(l=>{let a=t[l];a&&e(a)},[e,o,t]);(0,P.useEffect)(()=>{let l=["ArrowUp","ArrowDown","Enter"],a=g=>{if(l.includes(g.key))return g.preventDefault(),g.key==="ArrowUp"?(n((r+t.length-1)%t.length),!0):g.key==="ArrowDown"?(n((r+1)%t.length),!0):g.key==="Enter"?(s(r),!0):!1};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[t,r,n,s]),(0,P.useEffect)(()=>{n(0)},[t]);let i=(0,P.useRef)(null);return(0,P.useLayoutEffect)(()=>{let l=i==null?void 0:i.current,a=l==null?void 0:l.children[r];a&&l&&po(l,a)},[r]),t.length>0?(0,u.jsxs)("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[(0,u.jsx)("div",{id:"slash-command",ref:i,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:t.map((l,a)=>(0,u.jsxs)("button",{className:w("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",a===r?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>s(a),type:"button",children:[(0,u.jsx)("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:l.icon}),(0,u.jsxs)("div",{children:[(0,u.jsx)("p",{className:"mly-font-medium",children:l.title}),(0,u.jsx)("p",{className:"mly-text-xs mly-text-gray-400",children:l.description})]})]},a))}),(0,u.jsx)("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:(0,u.jsxs)("div",{className:"mly-flex mly-items-center",children:[(0,u.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,u.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),(0,u.jsx)("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),(0,u.jsx)("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),(0,u.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,u.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null};function At(t=[]){return{items:({query:e})=>[...co,...t].filter(o=>{if(typeof e=="string"&&e.length>0){let r=e.toLowerCase();return o.title.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)||o.searchTerms&&o.searchTerms.some(n=>n.includes(r))}return!0}),render:()=>{let e,o=null;return{onStart:r=>{e=new bt.ReactRenderer(yo,{props:r,editor:r.editor}),o=(0,vt.default)("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:r=>{e==null||e.updateProps(r),o&&o[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var n;return r.event.key==="Escape"?(o==null||o[0].hide(),!0):(n=e==null?void 0:e.ref)==null?void 0:n.onKeyDown(r)},onExit:()=>{!o||!(o!=null&&o[0])||!e||(o==null||o[0].destroy(),e==null||e.destroy())}}}}}var ne=require("@tiptap/core"),Ct=require("@tiptap/pm/state"),Tt=require("@tiptap/react"),Nt=x(require("@tiptap/suggestion"));var uo=new Ct.PluginKey("variable"),Lt=ne.Node.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},renderLabel({options:t,node:e}){var o;return`${(o=e.attrs.label)!=null?o:e.attrs.id}`},suggestion:{char:"@",pluginKey:uo,command:({editor:t,range:e,props:o})=>{var s,i;let r=t.view.state.selection.$to.nodeAfter;((s=r==null?void 0:r.text)==null?void 0:s.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:o},{type:"text",text:" "}]).run(),(i=window.getSelection())==null||i.collapseToEnd()},allow:({state:t,range:e})=>{let o=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!o.parent.type.contentMatch.matchType(r)}}}},addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},fallback:{default:null,parseHTML:t=>t.getAttribute("data-fallback"),renderHTML:t=>t.fallback?{"data-fallback":t.fallback}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",(0,ne.mergeAttributes)({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})]},renderText({node:t}){return this.options.renderLabel({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let o=!1,{selection:r}=e,{empty:n,anchor:s}=r;return n?(e.doc.nodesBetween(s-1,s,(i,l)=>{if(i.type.name===this.name)return o=!0,t.insertText(this.options.suggestion.char||"",l,l+i.nodeSize),!1}),o):!1})}},addProseMirrorPlugins(){return[(0,Nt.default)(y({editor:this.editor},this.options.suggestion))]},addNodeView(){return(0,Tt.ReactNodeViewRenderer)(wt)}});var ae=require("@tiptap/react"),ie=require("react"),Mt=x(require("@tiptap/extension-image"));var W=require("react"),Pt=t=>{let e=(0,W.useRef)(null);return(0,W.useLayoutEffect)(()=>{e.current=t},[t]),(0,W.useCallback)((...o)=>{if(e.current===null)throw new Error("Handler is not assigned");return e.current(...o)},[])};var H=require("react/jsx-runtime"),go=60;function ho(t){let{node:e,updateAttributes:o,selected:r}=t,n=(0,ie.useRef)(null),[s,i]=(0,ie.useState)(),l=Pt(b=>{let S=document.querySelector(".ProseMirror-selectednode");if(!n.current||!S||!r)return;let G=S.offsetWidth;b.preventDefault();let Ne=b.currentTarget.dataset.direction||"--",Gt=b.clientX,de=n.current.width,Le=n.current.height,q=de,ce=Le,Xt=Ne[1]==="w"?-1:1,pe=()=>{window.removeEventListener("mousemove",Pe),window.removeEventListener("mouseup",pe),o({width:q,height:ce}),i(void 0)},Pe=Me=>{if(q=Math.max(de+Xt*(Me.clientX-Gt),go),q>G&&(q=G),ce=q/de*Le,i({width:q,height:ce}),!Me.buttons)return pe()};window.addEventListener("mousemove",Pe),window.addEventListener("mouseup",pe)});function a(b){return(0,H.jsx)("div",{role:"button",tabIndex:0,onMouseDown:l,"data-direction":b,className:"mly-bg-rose-500",style:C(y(y({position:"absolute",height:"10px",width:"10px"},{n:{top:0},s:{bottom:0}}[b[0]]),{w:{left:0},e:{right:0}}[b[1]]),{cursor:`${b}-resize`})})}let{alignment:g="center",width:m,height:d}=e.attrs||{},M=e.attrs||{},{externalLink:f}=M,V=N(M,["externalLink"]);return(0,H.jsxs)(ae.NodeViewWrapper,{as:"div",draggable:!0,"data-drag-handle":!0,style:y(C(y({width:m,height:d},s),{overflow:"hidden",position:"relative",lineHeight:"0px",display:"block"}),{center:{marginLeft:"auto",marginRight:"auto"},left:{marginRight:"auto"},right:{marginLeft:"auto"}}[g]||{}),children:[(0,H.jsx)("img",C(y({},V),{ref:n,style:C(y({},s),{cursor:"default",marginBottom:0})})),r&&(0,H.jsxs)(H.Fragment,{children:[[{left:0,top:0,height:"100%",width:"1px"},{right:0,top:0,height:"100%",width:"1px"},{top:0,left:0,width:"100%",height:"1px"},{bottom:0,left:0,width:"100%",height:"1px"}].map((b,S)=>(0,H.jsx)("div",{className:"mly-bg-rose-500",style:y({position:"absolute"},b)},S)),a("nw"),a("ne"),a("sw"),a("se")]})]})}var Rt=Mt.default.extend({addAttributes(){var t;return C(y({},(t=this.parent)==null?void 0:t.call(this)),{width:{renderHTML:({width:e})=>({width:e})},height:{renderHTML:({height:e})=>({height:e})},alignment:{default:"center",renderHTML:({alignment:e})=>({"data-alignment":e}),parseHTML:e=>e.getAttribute("data-alignment")||"center"},externalLink:{default:null,renderHTML:({externalLink:e})=>e?{"data-external-link":e}:{},parseHTML:e=>{let o=e.getAttribute("data-external-link");return o?{externalLink:o}:null}}})},addNodeView(){return(0,ae.ReactNodeViewRenderer)(ho)}});var se=require("@tiptap/core"),Et=require("@tiptap/react");var zt=require("@tiptap/react");var St=x(require("react"));var Bt=require("react/jsx-runtime"),Ce=St.forwardRef((r,o)=>{var n=r,{className:t}=n,e=N(n,["className"]);return(0,Bt.jsx)("textarea",y({className:w("mly-flex mly-min-h-24 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",t),ref:o},e))});Ce.displayName="Textarea";var p=require("react/jsx-runtime");function It(t){let{layout:e,title:o,description:r,link:n,linkTitle:s,image:i,badgeText:l,subTitle:a}=t.node.attrs,{getPos:g,editor:m}=t;return(0,p.jsx)(zt.NodeViewWrapper,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",children:(0,p.jsxs)(U,{open:t.selected,children:[(0,p.jsx)(D,{asChild:!0,children:(0,p.jsx)("div",{tabIndex:-1,onClick:d=>{d.preventDefault();let f=g();m.commands.setNodeSelection(f)},children:(0,p.jsxs)("div",{className:"mly-no-prose mly-flex mly-flex-col mly-rounded-lg mly-border mly-border-gray-300",children:[i&&(0,p.jsx)("div",{className:"mly-relative mly-aspect-[16/9] mly-w-full mly-shrink-0 mly-mb-1.5",children:(0,p.jsx)("img",{src:i,alt:"link-card",className:"mly-no-prose mly-absolute mly-inset-0 !mly-mb-0 mly-h-full mly-w-full mly-rounded-t-lg mly-object-cover"})}),(0,p.jsx)("div",{className:"mly-flex mly-items-stretch mly-p-3",children:(0,p.jsxs)("div",{className:w("mly-flex mly-flex-col"),children:[(0,p.jsxs)("div",{className:"!mly-mb-1.5 mly-flex mly-items-center mly-gap-1.5",children:[(0,p.jsx)("h2",{className:"!mly-mb-0 !mly-text-lg mly-font-semibold",children:o}),l&&(0,p.jsx)("span",{className:"!mly-font-base text-xs mly-rounded-md mly-bg-yellow-200 mly-px-2 mly-py-1 mly-font-semibold mly-leading-none",children:l})," ",a&&!l&&(0,p.jsx)("span",{className:"!mly-font-base text-xs mly-rounded-md mly-font-regular mly-leading-none mly-text-gray-400",children:a})]}),(0,p.jsxs)("p",{className:"!mly-my-0 !mly-text-base mly-text-gray-500",children:[r," ",s?(0,p.jsx)("a",{href:n,className:"mly-font-semibold",children:s}):null]})]})})]})})}),(0,p.jsxs)(I,{align:"end",className:"mly-flex mly-w-96 mly-flex-col mly-gap-2",sideOffset:10,onOpenAutoFocus:d=>d.preventDefault(),onCloseAutoFocus:d=>d.preventDefault(),children:[(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Image"}),(0,p.jsx)(T,{placeholder:"Add Image",type:"url",value:i,onChange:d=>{t.updateAttributes({image:d.target.value})}})]}),(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Title"}),(0,p.jsx)(T,{placeholder:"Add title",value:o,onChange:d=>{t.updateAttributes({title:d.target.value})}})]}),(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Description"}),(0,p.jsx)(Ce,{placeholder:"Add description here",value:r,onChange:d=>{t.updateAttributes({description:d.target.value})}})]}),(0,p.jsxs)("div",{className:"mly-grid mly-grid-cols-2 mly-gap-2",children:[(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Link Title"}),(0,p.jsx)(T,{placeholder:"Add link title here",value:s,onChange:d=>{t.updateAttributes({linkTitle:d.target.value})}})]}),(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Link"}),(0,p.jsx)(T,{placeholder:"Add link here",value:n,onChange:d=>{t.updateAttributes({link:d.target.value})}})]})]}),(0,p.jsxs)("div",{className:"mly-grid mly-grid-cols-2 mly-gap-2",children:[(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Badge Text"}),(0,p.jsx)(T,{placeholder:"Add badge text here",value:l,onChange:d=>{t.updateAttributes({badgeText:d.target.value})}})]}),(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Sub Title"}),(0,p.jsx)(T,{placeholder:"Add sub title here",value:a,onChange:d=>{t.updateAttributes({subTitle:d.target.value})}})]})]})]})]})})}var Ht=se.Node.create({name:"linkCard",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"linkCard"},title:{default:""},description:{default:""},link:{default:""},linkTitle:{default:""},image:{default:""},subTitle:{default:""},badgeText:{default:""}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["div",(0,se.mergeAttributes)({"data-maily-component":this.name},t)]},addCommands(){return{setLinkCard:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return(0,Et.ReactNodeViewRenderer)(It)}});function Kt(t){let{variables:e,slashCommands:o}=t;return[Vt.default.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},code:{HTMLAttributes:{class:"mly-px-1 mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"}},horizontalRule:!1,blockquote:{HTMLAttributes:{class:"mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4"}}}),$t.default,Ve,Ot.Color.configure({types:[Te.default.name,Dt.default.name]}),Te.default.configure(),Ft.default.configure({types:[_t.default.name,Wt.default.name,Ae.name]}),Qe,qt.default.configure({placeholder:({node:r})=>r.type.name==="heading"?`Heading ${r.attrs.level}`:"Write something or / to see commands",includeChildren:!0}),Ge,Ae,Lt.configure({suggestion:ht(e)}),kt.configure({suggestion:At(o)}),Ut.default.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),st,Rt,Ht]}var R=require("react/jsx-runtime");function wo(t){let{config:{wrapClassName:e="",contentClassName:o="",bodyClassName:r="",hasMenuBar:n=!0,spellCheck:s=!1,autofocus:i="end"}={},onCreate:l,onUpdate:a,extensions:g,contentHtml:m,contentJson:d,variables:f,slashCommands:V}=t,M=null;d?M=(d==null?void 0:d.type)==="doc"?d:{type:"doc",content:d}:m?M=m:M={type:"doc",content:[{type:"paragraph",content:[]}]};let b=(0,me.useEditor)({editorProps:{attributes:{class:w("mly-prose mly-w-full",o),spellCheck:s?"true":"false"},handleDOMEvents:{keydown:(S,G)=>{if(["ArrowUp","ArrowDown","Enter"].includes(G.key)&&document.querySelector("#slash-command"))return!0}}},onCreate:({editor:S})=>{l==null||l(S)},onUpdate:({editor:S})=>{a==null||a(S)},extensions:[...Kt({variables:f,slashCommands:V}),...g||[]],content:M,autofocus:i});return b?(0,R.jsx)(dt,{variables:f,children:(0,R.jsxs)("div",{className:w("mly-editor mly-antialiased",e),children:[n&&(0,R.jsx)(We,{config:t.config,editor:b}),(0,R.jsxs)("div",{className:w("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[(0,R.jsx)(Fe,{editor:b}),(0,R.jsx)(Ke,{editor:b}),(0,R.jsx)(je,{editor:b}),(0,R.jsx)(me.EditorContent,{editor:b})]})]})}):null}0&&(module.exports={Editor});
2
+ "use strict";var Uo=Object.create;var oe=Object.defineProperty,_o=Object.defineProperties,Fo=Object.getOwnPropertyDescriptor,Wo=Object.getOwnPropertyDescriptors,qo=Object.getOwnPropertyNames,ae=Object.getOwnPropertySymbols,$o=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable;var Qe=(e,t,o)=>t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,c=(e,t)=>{for(var o in t||(t={}))ze.call(t,o)&&Qe(e,o,t[o]);if(ae)for(var o of ae(t))Ze.call(t,o)&&Qe(e,o,t[o]);return e},x=(e,t)=>_o(e,Wo(t));var S=(e,t)=>{var o={};for(var r in e)ze.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&ae)for(var r of ae(e))t.indexOf(r)<0&&Ze.call(e,r)&&(o[r]=e[r]);return o};var Ko=(e,t)=>{for(var o in t)oe(e,o,{get:t[o],enumerable:!0})},je=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of qo(t))!ze.call(e,l)&&l!==o&&oe(e,l,{get:()=>t[l],enumerable:!(r=Fo(t,l))||r.enumerable});return e};var w=(e,t,o)=>(o=e!=null?Uo($o(e)):{},je(t||!e||!e.__esModule?oe(o,"default",{value:e,enumerable:!0}):o,e)),Go=e=>je(oe({},"__esModule",{value:!0}),e);var cr={};Ko(cr,{Editor:()=>dr});module.exports=Go(cr);function G(e,{insertAt:t}={}){if(!e||typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}G(`:root{--placeholder-color: #adb5bd}.mly-editor .mly-prose p:where([class~=text-sm]){font-size:16px}.mly-editor .mly-prose h1,.mly-editor .mly-prose h2,.mly-editor .mly-prose h3{margin-top:0;margin-bottom:12px}.mly-editor .mly-prose h1{font-size:36px}.mly-editor .mly-prose h2{font-size:30px}.mly-editor .mly-prose h3{font-size:24px}.mly-editor .mly-prose p{font-size:15px;margin-bottom:20px}.mly-editor .mly-prose h1+p,.mly-editor .mly-prose h2+p,.mly-editor .mly-prose h3+p,.mly-editor .mly-prose hr+p{margin-top:0}.mly-editor .mly-prose ol,.mly-editor .mly-prose ul{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose li:not(:last-child){margin-bottom:8px}.mly-editor .mly-prose li>p{margin:0}.mly-editor .mly-prose img{margin-top:0;margin-bottom:32px}.mly-editor .mly-prose hr{margin-block:32px}.mly-editor .mly-prose .footer{display:block;font-size:13px;margin-bottom:20px;color:#64748b}.mly-editor .mly-prose .spacer+*{margin-top:0}.mly-editor .mly-prose p+.spacer{margin-top:-20px}.mly-editor .mly-prose blockquote+.spacer{margin-top:-16px}.mly-editor .mly-prose h1+.spacer,.mly-editor .mly-prose h2+.spacer,.mly-editor .mly-prose h3+.spacer{margin-top:-12px}.mly-editor .mly-prose ol+.spacer,.mly-editor .mly-prose ul+.spacer{margin-top:-20px}.mly-editor .mly-prose img+.spacer{margin-top:-32px}.mly-editor .mly-prose .node-button+.spacer,.mly-editor .mly-prose .node-linkCard+.spacer,.mly-editor .mly-prose footer+.spacer{margin-top:-20px}.mly-editor .mly-prose .node-button,.mly-editor .mly-prose .node-linkCard{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose .node-image{line-height:0;margin-top:0;margin-bottom:32px;outline:none}.mly-editor .mly-prose .node-image+.spacer{margin-top:-32px}.mly-editor .mly-prose code:before,.mly-editor .mly-prose code:after{content:none}.mly-no-scrollbar::-webkit-scrollbar{display:none}.mly-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.mly-editor .react-colorful__alpha{border-radius:0}.mly-editor .react-colorful__saturation,.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{border-radius:8px}.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{height:16px}.mly-editor .react-colorful__pointer{width:16px;height:16px}.ProseMirror-selectednode{outline:3px solid #555}.mly-prose{strong{color:currentColor}}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:"liga" 0;&:focus{outline:none}.is-editor-empty:first-child:not([data-type=columns],[data-type=section]):before{content:attr(data-placeholder);text-wrap:nowrap;float:left;color:var(--placeholder-color);pointer-events:none;height:0}.is-empty:not([data-type=columns],[data-type=section]):before{content:attr(data-placeholder);text-wrap:nowrap;float:left;color:var(--placeholder-color);pointer-events:none;height:0}[data-type=columns]{padding:0;[data-type=column].has-focus{outline:2px solid #e9ecef}}[data-type=column]{padding:0;>*:first-child{margin-top:0}>*:last-child{margin-bottom:0}}[data-type=section]{margin:0;padding:0;[data-type=section-cell]{padding:0;>*:first-child{margin-top:0}>*:last-child{margin-bottom:0}}}*:has(+.ProseMirror-gapcursor){margin-bottom:0!important}.ProseMirror-gapcursor{&:after{border:1.5px solid gray;width:24px}+*{margin-top:0!important}}}.hide-number-controls{&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}&[type=number]{-moz-appearance:textfield}}
3
+ `);G(`:where(.mly-editor),:where(.mly-editor) :before,:where(.mly-editor) :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:where(.mly-editor) :before,:where(.mly-editor) :after{--tw-content: ""}:where(.mly-editor) html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}:where(.mly-editor) body{margin:0;line-height:inherit}:where(.mly-editor) hr{height:0;color:inherit;border-top-width:1px}:where(.mly-editor) abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6{font-size:inherit;font-weight:inherit}:where(.mly-editor) a{color:inherit;text-decoration:inherit}:where(.mly-editor) b,:where(.mly-editor) strong{font-weight:bolder}:where(.mly-editor) code,:where(.mly-editor) kbd,:where(.mly-editor) samp,:where(.mly-editor) pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}:where(.mly-editor) small{font-size:80%}:where(.mly-editor) sub,:where(.mly-editor) sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.mly-editor) sub{bottom:-.25em}:where(.mly-editor) sup{top:-.5em}:where(.mly-editor) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.mly-editor) button,:where(.mly-editor) input,:where(.mly-editor) optgroup,:where(.mly-editor) select,:where(.mly-editor) textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}:where(.mly-editor) button,:where(.mly-editor) select{text-transform:none}:where(.mly-editor) button,:where(.mly-editor) [type=button],:where(.mly-editor) [type=reset],:where(.mly-editor) [type=submit]{-webkit-appearance:button;background-image:none}:where(.mly-editor) :-moz-focusring{outline:auto}:where(.mly-editor) :-moz-ui-invalid{box-shadow:none}:where(.mly-editor) progress{vertical-align:baseline}:where(.mly-editor) ::-webkit-inner-spin-button,:where(.mly-editor) ::-webkit-outer-spin-button{height:auto}:where(.mly-editor) [type=search]{-webkit-appearance:textfield;outline-offset:-2px}:where(.mly-editor) ::-webkit-search-decoration{-webkit-appearance:none}:where(.mly-editor) ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(.mly-editor) summary{display:list-item}:where(.mly-editor) blockquote,:where(.mly-editor) dl,:where(.mly-editor) dd,:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6,:where(.mly-editor) hr,:where(.mly-editor) figure,:where(.mly-editor) p,:where(.mly-editor) pre{margin:0}:where(.mly-editor) fieldset{margin:0;padding:0}:where(.mly-editor) legend{padding:0}:where(.mly-editor) ol,:where(.mly-editor) ul,:where(.mly-editor) menu{list-style:none;margin:0;padding:0}:where(.mly-editor) dialog{padding:0}:where(.mly-editor) textarea{resize:vertical}:where(.mly-editor) input::-moz-placeholder,:where(.mly-editor) textarea::-moz-placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) input::placeholder,:where(.mly-editor) textarea::placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) button,:where(.mly-editor) [role=button]{cursor:pointer}:where(.mly-editor) :disabled{cursor:default}:where(.mly-editor) img,:where(.mly-editor) svg,:where(.mly-editor) video,:where(.mly-editor) canvas,:where(.mly-editor) audio,:where(.mly-editor) iframe,:where(.mly-editor) embed,:where(.mly-editor) object{display:block;vertical-align:middle}:where(.mly-editor) img,:where(.mly-editor) video{max-width:100%;height:auto}:where(.mly-editor) [hidden]{display:none}
4
+ `);G('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(th,td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){text-align:start}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-absolute{position:absolute}.mly-relative{position:relative}.mly-inset-y-0{top:0;bottom:0}.mly-left-1\\.5{left:.375rem}.mly-left-2{left:.5rem}.mly-z-50{z-index:50}.\\!mly-my-0{margin-top:0!important;margin-bottom:0!important}.mly-mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.\\!mly-mb-0{margin-bottom:0!important}.\\!mly-mb-1\\.5{margin-bottom:.375rem!important}.mly-mb-1\\.5{margin-bottom:.375rem}.mly-mb-4{margin-bottom:1rem}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-inline-block{display:inline-block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-grid{display:grid}.\\!mly-size-7{width:1.75rem!important;height:1.75rem!important}.\\!mly-h-7{height:1.75rem!important}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-h-full{height:100%}.mly-h-px{height:1px}.mly-max-h-\\[330px\\]{max-height:330px}.mly-min-h-24{min-height:6rem}.\\!mly-w-full{width:100%!important}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-7{width:1.75rem}.mly-w-72{width:18rem}.mly-w-96{width:24rem}.mly-w-full{width:100%}.mly-w-px{width:1px}.mly-min-w-0{min-width:0px}.mly-min-w-\\[128px\\]{min-width:128px}.mly-min-w-\\[260px\\]{min-width:260px}.mly-max-w-12{max-width:3rem}.mly-max-w-24{max-width:6rem}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.mly-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-items-stretch{align-items:stretch}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-1\\.5{gap:.375rem}.mly-gap-2{gap:.5rem}.mly-gap-3{gap:.75rem}.mly-gap-4{gap:1rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.mly-space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-lg{border-radius:.5rem}.mly-rounded-md{border-radius:.375rem}.mly-rounded-none{border-radius:0}.mly-rounded-xl{border-radius:.75rem}.mly-rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.mly-border{border-width:1px}.mly-border-0{border-width:0px}.mly-border-b{border-bottom-width:1px}.mly-border-l-4{border-left-width:4px}.mly-border-t{border-top-width:1px}.mly-border-none{border-style:none}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.mly-border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.mly-border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.\\!mly-bg-transparent{background-color:transparent!important}.mly-bg-\\[\\#efefef\\]{--tw-bg-opacity: 1;background-color:rgb(239 239 239 / var(--tw-bg-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity))}.mly-bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.mly-bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity))}.mly-stroke-\\[2\\.5\\]{stroke-width:2.5}.\\!mly-p-0{padding:0!important}.mly-p-0{padding:0}.mly-p-1{padding:.25rem}.mly-p-3{padding:.75rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-pl-\\[26px\\]{padding-left:26px}.mly-pt-2{padding-top:.5rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.\\!mly-text-base{font-size:1rem!important;line-height:1.5rem!important}.\\!mly-text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.mly-text-\\[10px\\]{font-size:10px}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-uppercase{text-transform:uppercase}.mly-capitalize{text-transform:capitalize}.mly-tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.mly-leading-none{line-height:1}.mly-tracking-normal{letter-spacing:0em}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-gray-950{--tw-text-opacity: 1;color:rgb(3 7 18 / var(--tw-text-opacity))}.mly-text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-border-gray-400:focus-visible{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');var Se=require("@tiptap/react");var He=require("react"),C=require("lucide-react");var ot=w(require("react")),rt=require("@radix-ui/react-slot");var et=require("clsx"),tt=require("tailwind-merge");function b(...e){return(0,tt.twMerge)((0,et.clsx)(e))}var nt=require("react/jsx-runtime"),R=ot.forwardRef((i,a)=>{var s=i,{className:e,variant:t="default",size:o="default",asChild:r=!1}=s,l=S(s,["className","variant","size","asChild"]);let n=r?rt.Slot:"button",d="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",m={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},u={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},g=b("mly-editor",d,m[t],u[o],e);return(0,nt.jsx)(n,c({className:g,ref:a},l))});R.displayName="BaseButton";var ie=require("react/jsx-runtime");function N(e){return(0,ie.jsx)(R,{variant:"ghost",size:"sm",onClick:e.command,"data-state":e.isActive(),className:b("mly-px-2.5",e==null?void 0:e.className),type:"button",children:e.icon?(0,ie.jsx)(e.icon,{className:b("shrink-0 mly-h-3.5 mly-w-3.5",e==null?void 0:e.iconClassName)}):(0,ie.jsx)("span",{className:b("mly-text-sm mly-font-medium mly-text-slate-600",e==null?void 0:e.nameClassName),children:e.name})})}var se=require("react/jsx-runtime"),lt=e=>{let{editor:t,config:o}=e,r=(0,He.useMemo)(()=>[{name:"bold",command:()=>t.chain().focus().toggleBold().run(),isActive:()=>t.isActive("bold"),group:"mark",icon:C.BoldIcon},{name:"italic",command:()=>t.chain().focus().toggleItalic().run(),isActive:()=>t.isActive("italic"),group:"mark",icon:C.ItalicIcon},{name:"underline",command:()=>t.chain().focus().toggleUnderline().run(),isActive:()=>t.isActive("underline"),group:"mark",icon:C.UnderlineIcon},{name:"strike",command:()=>t.chain().focus().toggleStrike().run(),isActive:()=>t.isActive("strike"),group:"mark",icon:C.StrikethroughIcon},{name:"delete-line",command:()=>t.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:C.EraserIcon},{name:"divider",command:()=>t.chain().focus().setHorizontalRule().run(),isActive:()=>t.isActive("horizontalRule"),group:"custom",icon:C.SeparatorHorizontal},{name:"link",command:()=>{let a=t.getAttributes("link").href,i=window.prompt("URL",a);if(i!==null){if(i===""){t.chain().focus().extendMarkRange("link").unsetLink().run();return}t.chain().focus().extendMarkRange("link").setLink({href:i}).run()}},isActive:()=>t.isActive("link"),group:"custom",icon:C.LinkIcon},{name:"left",command:()=>t.chain().focus().setTextAlign("left").run(),isActive:()=>t.isActive({textAlign:"left"}),group:"alignment",icon:C.AlignLeft},{name:"center",command:()=>t.chain().focus().setTextAlign("center").run(),isActive:()=>t.isActive({textAlign:"center"}),group:"alignment",icon:C.AlignCenter},{name:"right",command:()=>t.chain().focus().setTextAlign("right").run(),isActive:()=>t.isActive({textAlign:"right"}),group:"alignment",icon:C.AlignRight}],[t]),l=(0,He.useMemo)(()=>r.reduce((a,i)=>(a.includes(i.group)||a.push(i.group),a),[]),[r]);return t?(0,se.jsx)("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:l.map((a,i)=>(0,se.jsx)("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(s=>s.group===a).map((s,n)=>(0,se.jsx)(N,c({},s),n))},i))}):null};var dt=require("@tiptap/react"),B=require("lucide-react");var at=require("@tiptap/core"),it=w(require("@tiptap/extension-image"));var st=["sm","md","lg"],me=["left","center","right"],mt="left",Ve="sm";function Xo(e){let t={sm:"40px",md:"48px",lg:"64px"};return[`height:${t[e]||t[Ve]}`,`width:${t[e]||t[Ve]}`]}function Jo(e){let t={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return t[e]||t[mt]}var de=it.default.extend({name:"logo",priority:1e3,addAttributes(){var e;return x(c({},(e=this.parent)==null?void 0:e.call(this)),{"maily-component":{default:"logo",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t.getAttribute("data-maily-component")},size:{default:Ve,parseHTML:t=>t.getAttribute("data-size"),renderHTML:t=>({"data-size":t.size})},alignment:{default:mt,parseHTML:t=>t.getAttribute("data-alignment"),renderHTML:t=>({"data-alignment":t.alignment})}})},addCommands(){return{setLogoImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),setLogoAttributes:e=>({commands:t})=>t.updateAttributes("logo",e)}},renderHTML({HTMLAttributes:e,node:t}){let{size:o,alignment:r}=t.attrs,l=["position:relative","margin-top:0",...Xo(o),...Jo(r)];return e.style=l.join(";"),["img",(0,at.mergeAttributes)(this.options.HTMLAttributes,e)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});var Oe=require("react/jsx-runtime");function ct(e){let{editor:t,appendTo:o}=e,r=[B.AlignLeftIcon,B.AlignCenterIcon,B.AlignRightIcon],l=me.map((n,d)=>({name:n,isActive:()=>(t==null?void 0:t.isActive("logo",{alignment:n}))||(t==null?void 0:t.isActive("image",{alignment:n})),shouldShow:()=>(t==null?void 0:t.isActive("logo"))||(t==null?void 0:t.isActive("image")),command:()=>{var u,g;(t==null?void 0:t.isActive("logo"))?(u=e==null?void 0:e.editor)==null||u.chain().focus().setLogoAttributes({alignment:n}).run():(g=e==null?void 0:e.editor)==null||g.chain().focus().updateAttributes("image",{alignment:n}).run()},icon:r[d]})),a=st.map(n=>({name:n,isActive:()=>{var d;return(d=e==null?void 0:e.editor)==null?void 0:d.isActive("logo",{size:n})},shouldShow:()=>t==null?void 0:t.isActive("logo"),command:()=>{var d;(d=e==null?void 0:e.editor)==null||d.chain().focus().setLogoAttributes({size:n}).run()}})),i=[...l,{name:"url",isActive:()=>!1,shouldShow:()=>t==null?void 0:t.isActive("logo"),command:()=>{var W,v,L;let{editor:n}=e,d=(W=n==null?void 0:n.getAttributes("logo"))==null?void 0:W.src,m=window.prompt("Update logo URL",d);if(!m)return;let u=(v=n==null?void 0:n.getAttributes("logo"))==null?void 0:v.size,g=(L=n==null?void 0:n.getAttributes("logo"))==null?void 0:L.alignment,P=n==null?void 0:n.state.selection;n==null||n.commands.setLogoImage({src:m,size:u,alignment:g}),n==null||n.commands.setNodeSelection((P==null?void 0:P.from)||0)},icon:B.Link},{name:"image-url",isActive:()=>!1,shouldShow:()=>t==null?void 0:t.isActive("image"),command:()=>{var g;let{editor:n}=e,d=(g=n==null?void 0:n.getAttributes("image"))==null?void 0:g.src,m=window.prompt("Update Image URL",d);if(!m)return;let u=n==null?void 0:n.state.selection;n==null||n.commands.setImage({src:m}),n==null||n.commands.setNodeSelection((u==null?void 0:u.from)||0)},icon:B.Unlink},{name:"image-external-url",isActive:()=>!1,shouldShow:()=>t==null?void 0:t.isActive("image"),command:()=>{var u;let{editor:n}=e,d=(u=n==null?void 0:n.getAttributes("image"))==null?void 0:u.externalLink,m=window.prompt("Update Image External URL",d||"");n==null||n.commands.updateAttributes("image",{externalLink:m||""})},icon:B.ArrowUpRight},...a],s=x(c(c({},e),o?{appendTo:o.current}:{}),{shouldShow:({editor:n})=>n.isActive("logo")||n.isActive("image"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,Oe.jsx)(dt.BubbleMenu,x(c({},s),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:i.filter(n=>{var d;return(d=n.shouldShow)==null?void 0:d.call(n)}).map((n,d)=>(0,Oe.jsx)(N,c({},n),d))}))}var pt=require("@tiptap/react");var ce=require("@tiptap/core"),De=["sm","md","lg","xl"],Yo="sm";function Qo(e){let t={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${t[e]||t[Yo]}`}var pe=ce.Node.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:e=>e.getAttribute("data-height"),renderHTML:e=>({"data-height":e.height})}}},addCommands(){return{setSpacer:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{height:e.height}}),setSpacerSize:e=>({commands:t})=>{if(!De.includes(e))throw new Error("Invalid spacer height");return t.updateAttributes("spacer",{height:e})},unsetSpacer:()=>({commands:e})=>e.deleteNode("spacer")}},renderHTML({HTMLAttributes:e,node:t}){let{height:o}=t.attrs;return e.style=Qo(o),["div",(0,ce.mergeAttributes)({"data-maily-component":this.name},this.options.HTMLAttributes,e,{class:"spacer relative z-50",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});var Ue=require("react/jsx-runtime");function yt(e){let{editor:t,appendTo:o}=e,r=De.map(a=>({name:a,isActive:()=>t==null?void 0:t.isActive("spacer",{height:a}),command:()=>{t==null||t.chain().focus().setSpacer({height:a}).run()}})),l=x(c(c({},e),o?{appendTo:o.current}:{}),{shouldShow:({editor:a})=>a.isActive("spacer"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,Ue.jsx)(pt.BubbleMenu,x(c({},l),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:r.map((a,i)=>(0,Ue.jsx)(N,c({},a),i))}))}var to=w(require("@tiptap/starter-kit")),oo=require("@tiptap/extension-color"),ro=w(require("@tiptap/extension-link")),no=w(require("@tiptap/extension-list-item")),lo=w(require("@tiptap/extension-paragraph")),ao=w(require("@tiptap/extension-placeholder")),io=w(require("@tiptap/extension-text-align")),Ke=w(require("@tiptap/extension-text-style")),so=w(require("@tiptap/extension-heading")),mo=w(require("@tiptap/extension-underline")),co=w(require("@tiptap/extension-document")),po=w(require("@tiptap/extension-focus"));var ut=require("@tiptap/core"),gt=require("@tiptap/extension-horizontal-rule"),ye=gt.HorizontalRule.extend({addInputRules(){return[new ut.InputRule({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:e,range:t})=>{let o={},{tr:r}=e,l=t.from,a=t.to;r.insert(l-1,this.type.create(o)).delete(r.mapping.map(l),r.mapping.map(a))}})]}});var ge=require("@tiptap/core"),At=require("@tiptap/react");var wt=require("@tiptap/react"),Z=require("lucide-react");var ue=require("react-colorful");var ht=w(require("react")),O=w(require("@radix-ui/react-popover"));var _e=require("react/jsx-runtime"),q=O.Root,$=O.Trigger,D=ht.forwardRef((a,l)=>{var i=a,{className:e,align:t="center",sideOffset:o=4}=i,r=S(i,["className","align","sideOffset"]);return(0,_e.jsx)(O.Portal,{children:(0,_e.jsx)(O.Content,c({ref:l,align:t,sideOffset:o,className:b("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-text-gray-950 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2","mly-editor",e)},r))})});D.displayName=O.Content.displayName;var K=require("react/jsx-runtime");function X(e){let{color:t,onColorChange:o,children:r}=e,l=a=>{queueMicrotask(()=>{o(a)})};return(0,K.jsxs)(q,{children:[(0,K.jsx)($,{asChild:!0,children:r}),(0,K.jsx)(D,{className:"mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",children:(0,K.jsxs)("div",{className:"mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4",children:[(0,K.jsx)(ue.HexAlphaColorPicker,{color:t,onChange:l,className:"mly-flex !mly-w-full mly-flex-col mly-gap-4"}),(0,K.jsx)(ue.HexColorInput,{alpha:!0,color:t,onChange:l,className:"mly-mt-4 mly-w-full mly-min-w-0 mly-rounded-lg mly-border mly-px-2 mly-py-1.5 mly-text-sm mly-uppercase focus-visible:mly-border-gray-400 focus-visible:mly-outline-none",prefixed:!0})]})})]})}var ft=w(require("react"));var bt=require("react/jsx-runtime"),M=ft.forwardRef((l,r)=>{var a=l,{className:e,type:t}=a,o=S(a,["className","type"]);return(0,bt.jsx)("input",c({type:t,className:b("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",e),ref:r},o))});M.displayName="Input";var y=require("react/jsx-runtime"),Zo={left:Z.AlignLeftIcon,center:Z.AlignCenterIcon,right:Z.AlignRightIcon},Fe={style(e){return vt.map(t=>({name:t,isActive:e.node.attrs.variant===t,onClick:()=>{e.updateAttributes({variant:t})}}))},cornerRadius(e){return Ct.map(t=>({name:t,isActive:e.node.attrs.borderRadius===t,onClick:()=>{e.updateAttributes({borderRadius:t})}}))},alignment(e){return Object.entries(Zo).map(([t,o])=>({name:t,icon:o,isActive:e.node.attrs.alignment===t,onClick:()=>e.updateAttributes({alignment:t})}))}};function xt(e){let{url:t,text:o,alignment:r,variant:l,borderRadius:a,buttonColor:i,textColor:s}=e.node.attrs,{getPos:n,editor:d}=e;return(0,y.jsx)(wt.NodeViewWrapper,{className:`react-component ${e.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:(0,y.jsxs)(q,{open:e.selected,children:[(0,y.jsx)($,{asChild:!0,children:(0,y.jsx)("div",{children:(0,y.jsx)("button",{className:b("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":a==="round","!mly-rounded-md":a==="smooth","!mly-rounded-none":a==="sharp"}),tabIndex:-1,style:{backgroundColor:l==="filled"?i:"transparent",color:s,borderWidth:2,borderStyle:"solid",borderColor:i},onClick:m=>{m.preventDefault();let u=n();d.commands.setNodeSelection(u)},children:o})})}),(0,y.jsxs)(D,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:m=>m.preventDefault(),onCloseAutoFocus:m=>m.preventDefault(),children:[(0,y.jsx)(M,{placeholder:"Add text here",value:o,onChange:m=>{e.updateAttributes({text:m.target.value})}}),(0,y.jsx)(M,{placeholder:"Add link here",value:t,onChange:m=>{e.updateAttributes({url:m.target.value})}}),(0,y.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,y.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),(0,y.jsx)("div",{className:"mly-flex mly-gap-1",children:Fe.style(e).map((m,u)=>(0,y.jsx)(R,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},u))})]}),(0,y.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,y.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),(0,y.jsx)("div",{className:"mly-flex mly-gap-1",children:Fe.cornerRadius(e).map((m,u)=>(0,y.jsx)(R,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},u))})]}),(0,y.jsxs)("div",{className:"flex gap-2",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),(0,y.jsx)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:Fe.alignment(e).map((m,u)=>(0,y.jsx)(R,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:m.onClick,type:"button",children:(0,y.jsx)(m.icon,{size:16})},u))})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),(0,y.jsxs)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[(0,y.jsx)(jo,{variant:l,color:i,onChange:m=>{e.updateAttributes({buttonColor:m})}}),(0,y.jsx)(er,{color:s,onChange:m=>{e.updateAttributes({textColor:m})}})]})]})]})]})]})})}function jo(e){let{color:t,onChange:o,variant:r}=e;return(0,y.jsx)(X,{color:t,onColorChange:o,children:(0,y.jsx)(R,{variant:"ghost",className:"",size:"sm",type:"button",children:(0,y.jsx)("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?t:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:t}})})})}function er(e){let{color:t,onChange:o}=e;return(0,y.jsx)(X,{color:t,onColorChange:o,children:(0,y.jsx)(R,{variant:"ghost",size:"sm",type:"button",children:(0,y.jsxs)("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[(0,y.jsx)("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),(0,y.jsx)("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:t}})]})})})}var vt=["filled","outline"],Ct=["sharp","smooth","round"],he=ge.Node.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:e}){return["a",(0,ge.mergeAttributes)({"data-maily-component":this.name},e)]},addCommands(){return{setButton:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return(0,At.ReactNodeViewRenderer)(xt)}});var fe=require("@tiptap/core"),We=fe.Node.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e==null?void 0:e.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:e})=>e.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:e}){return["small",(0,fe.mergeAttributes)(this.options.HTMLAttributes,e,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});var U=require("react"),we=require("@tiptap/react"),Mt=w(require("tippy.js")),Pt=require("lucide-react");var be=require("react");var Lt=require("react/jsx-runtime"),kt=(0,be.createContext)({variables:[],slashCommands:[]});function Tt(e){let r=e,{children:t}=r,o=S(r,["children"]);return(0,Lt.jsx)(kt.Provider,{value:o,children:t})}function Nt(){let e=(0,be.useContext)(kt);if(!e)throw new Error("Missing MailyContext.Provider in the component tree");return e}var A=require("react/jsx-runtime"),Rt=(0,U.forwardRef)((e,t)=>{var a,i;let[o,r]=(0,U.useState)(0),l=s=>{let n=e.items[s];n&&e.command({id:n})};return(0,U.useEffect)(()=>r(0),[e.items]),(0,U.useImperativeHandle)(t,()=>({onKeyDown:({event:s})=>s.key==="ArrowUp"?(r((o+e.items.length-1)%e.items.length),!0):s.key==="ArrowDown"?(r((o+1)%e.items.length),!0):s.key==="Enter"?(l(o),!0):!1})),(0,A.jsx)("div",{className:"mly-z-50 mly-h-auto mly-min-w-[128px] mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-1 mly-shadow-md mly-transition-all",children:(a=e==null?void 0:e.items)!=null&&a.length?(i=e==null?void 0:e.items)==null?void 0:i.map((s,n)=>(0,A.jsx)("button",{onClick:()=>l(n),className:b("mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",n===o?"mly-bg-gray-200":"mly-bg-white"),children:s},n)):(0,A.jsx)("button",{className:"mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-bg-white mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:"No result"})})});Rt.displayName="VariableList";function St(e=[]){let t=e.map(o=>o.name);return{items:({query:o})=>t.concat(o.length>0?[o]:[]).filter(r=>r.toLowerCase().startsWith(o.toLowerCase())).slice(0,5),render:()=>{let o,r=null;return{onStart:l=>{o=new we.ReactRenderer(Rt,{props:l,editor:l.editor}),l.clientRect&&(r=(0,Mt.default)("body",{getReferenceClientRect:l.clientRect,appendTo:()=>document.body,content:o.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(l){var a;o.updateProps(l),l.clientRect&&((a=r==null?void 0:r[0])==null||a.setProps({getReferenceClientRect:l.clientRect}))},onKeyDown(l){var a;return l.event.key==="Escape"?(r==null||r[0].hide(),!0):(a=o.ref)==null?void 0:a.onKeyDown(l)},onExit(){!r||!(r!=null&&r[0])||!o||(r==null||r[0].destroy(),o.destroy())}}}}}function Bt(e){var m,u;let{node:t,selected:o,updateAttributes:r}=e,{id:l,fallback:a}=t.attrs,{variables:i=[]}=Nt(),s=(u=(m=i.find(g=>g.name===l))==null?void 0:m.required)!=null?u:!0,[n,d]=(0,U.useState)(!1);return(0,A.jsx)(we.NodeViewWrapper,{className:b("react-component",o&&"ProseMirror-selectednode","mly-inline-block mly-leading-none"),draggable:"false",children:(0,A.jsxs)(q,{open:n,onOpenChange:d,children:[(0,A.jsx)($,{children:(0,A.jsxs)("span",{tabIndex:-1,className:"mly-inline-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-border-rose-200 mly-bg-rose-50 mly-px-2 mly-py-1 mly-leading-none mly-text-rose-800",children:[l,s&&!a&&(0,A.jsx)(Pt.AlertTriangle,{className:"mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5]"})]})}),(0,A.jsxs)(D,{align:"start",className:"mly-space-y-2",onOpenAutoFocus:g=>g.preventDefault(),onCloseAutoFocus:g=>g.preventDefault(),children:[(0,A.jsxs)("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[(0,A.jsx)("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Variable Name"}),(0,A.jsx)(M,{placeholder:"Add Variable Name",value:l,onChange:g=>{r({id:g.target.value})}})]}),(0,A.jsxs)("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[(0,A.jsx)("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Fallback Value"}),(0,A.jsx)(M,{placeholder:"Fallback Value",value:a||"",onChange:g=>{r({fallback:g.target.value})}}),(0,A.jsx)("p",{className:"mly-text-xs mly-text-gray-500",children:"If the variable doesn't exist, this fallback value will be used."})]})]})]})})}var H=require("react"),Et=require("@tiptap/core"),It=require("@tiptap/react"),zt=w(require("@tiptap/suggestion")),f=require("lucide-react"),Ht=w(require("tippy.js"));var h=require("react/jsx-runtime"),Vt=Et.Extension.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:e,range:t,props:o})=>{o.command({editor:e,range:t})}}}},addProseMirrorPlugins(){return[(0,zt.default)(c({editor:this.editor},this.options.suggestion))]}}),tr=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:(0,h.jsx)(f.Text,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:(0,h.jsx)(f.Heading1,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:(0,h.jsx)(f.Heading2,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:(0,h.jsx)(f.Heading3,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:(0,h.jsx)(f.List,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:(0,h.jsx)(f.ListOrdered,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleOrderedList().run()}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:(0,h.jsx)(f.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{let o=prompt("Image URL: ")||"";o&&(e.chain().focus().deleteRange(t).run(),e.chain().focus().setImage({src:o}).run())}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:(0,h.jsx)(f.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{let o=prompt("Logo URL: ")||"";o&&(e.chain().focus().deleteRange(t).run(),e.chain().focus().setLogoImage({src:o}).run())}},{title:"Spacer",description:"Add a spacer to email. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:(0,h.jsx)(f.MoveVertical,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to email.",searchTerms:["link","button","cta"],icon:(0,h.jsx)(f.MousePointer,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setButton().run()}},{title:"Link Card",description:"Add a link card to email.",searchTerms:["link","button","image"],icon:(0,h.jsx)(f.ArrowUpRightSquare,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setLinkCard().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:(0,h.jsx)(f.DivideIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setHardBreak().run()}},{title:"Blockquote",description:"Add blockquote.",searchTerms:["quote","blockquote"],icon:(0,h.jsx)(f.TextQuote,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBlockquote().run()}},{title:"Footer",description:"Add a footer text to email.",searchTerms:["footer","text"],icon:(0,h.jsx)(f.FootprintsIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:(0,h.jsx)(f.EraserIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().selectParentNode().deleteSelection().run()}},{title:"Columns",description:"Add columns to email.",searchTerms:["layout","columns"],icon:(0,h.jsx)(f.ColumnsIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setColumns().focus(e.state.selection.head-1).run()}},{title:"Section",description:"Add a section to email.",searchTerms:["layout","section"],icon:(0,h.jsx)(f.SectionIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setSection().run()}}],or=(e,t)=>{let o=e.offsetHeight,r=t?t.offsetHeight:0,l=t.offsetTop,a=l+r;l<e.scrollTop?e.scrollTop-=e.scrollTop-l+5:a>o+e.scrollTop&&(e.scrollTop+=a-o-e.scrollTop+5)},rr=({items:e,command:t,editor:o})=>{let[r,l]=(0,H.useState)(0),a=(0,H.useCallback)(s=>{let n=e[s];n&&t(n)},[t,o,e]);(0,H.useEffect)(()=>{let s=["ArrowUp","ArrowDown","Enter"],n=d=>{if(s.includes(d.key))return d.preventDefault(),d.key==="ArrowUp"?(l((r+e.length-1)%e.length),!0):d.key==="ArrowDown"?(l((r+1)%e.length),!0):d.key==="Enter"?(a(r),!0):!1};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,r,l,a]),(0,H.useEffect)(()=>{l(0)},[e]);let i=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{let s=i==null?void 0:i.current,n=s==null?void 0:s.children[r];n&&s&&or(s,n)},[r]),e.length>0?(0,h.jsxs)("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[(0,h.jsx)("div",{id:"slash-command",ref:i,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:e.map((s,n)=>(0,h.jsxs)("button",{className:b("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",n===r?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>a(n),type:"button",children:[(0,h.jsx)("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:s.icon}),(0,h.jsxs)("div",{children:[(0,h.jsx)("p",{className:"mly-font-medium",children:s.title}),(0,h.jsx)("p",{className:"mly-text-xs mly-text-gray-400",children:s.description})]})]},n))}),(0,h.jsx)("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:(0,h.jsxs)("div",{className:"mly-flex mly-items-center",children:[(0,h.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,h.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),(0,h.jsx)("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),(0,h.jsx)("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),(0,h.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,h.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null};function Ot(e=[]){return{items:({query:t})=>[...tr,...e].filter(o=>{if(typeof t=="string"&&t.length>0){let r=t.toLowerCase();return o.title.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)||o.searchTerms&&o.searchTerms.some(l=>l.includes(r))}return!0}),render:()=>{let t,o=null;return{onStart:r=>{t=new It.ReactRenderer(rr,{props:r,editor:r.editor}),o=(0,Ht.default)("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:r=>{t==null||t.updateProps(r),o&&o[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var l;return r.event.key==="Escape"?(o==null||o[0].hide(),!0):(l=t==null?void 0:t.ref)==null?void 0:l.onKeyDown(r)},onExit:()=>{!o||!(o!=null&&o[0])||!t||(o==null||o[0].destroy(),t==null||t.destroy())}}}}}var xe=require("@tiptap/core"),Dt=require("@tiptap/pm/state"),Ut=require("@tiptap/react"),_t=w(require("@tiptap/suggestion"));var nr=new Dt.PluginKey("variable"),ve=xe.Node.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var o;return`${(o=t.attrs.label)!=null?o:t.attrs.id}`},suggestion:{char:"@",pluginKey:nr,command:({editor:e,range:t,props:o})=>{var a,i;let r=e.view.state.selection.$to.nodeAfter;((a=r==null?void 0:r.text)==null?void 0:a.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:o},{type:"text",text:" "}]).run(),(i=window.getSelection())==null||i.collapseToEnd()},allow:({state:e,range:t})=>{let o=e.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!o.parent.type.contentMatch.matchType(r)}}}},addAttributes(){return{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}:{}},fallback:{default:null,parseHTML:e=>e.getAttribute("data-fallback"),renderHTML:e=>e.fallback?{"data-fallback":e.fallback}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){return["span",(0,xe.mergeAttributes)({"data-type":this.name},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 o=!1,{selection:r}=t,{empty:l,anchor:a}=r;return l?(t.doc.nodesBetween(a-1,a,(i,s)=>{if(i.type.name===this.name)return o=!0,e.insertText(this.options.suggestion.char||"",s,s+i.nodeSize),!1}),o):!1})}},addProseMirrorPlugins(){return[(0,_t.default)(c({editor:this.editor},this.options.suggestion))]},addNodeView(){return(0,Ut.ReactNodeViewRenderer)(Bt)}});var Ce=require("@tiptap/react"),Ae=require("react"),Wt=w(require("@tiptap/extension-image"));var j=require("react"),Ft=e=>{let t=(0,j.useRef)(null);return(0,j.useLayoutEffect)(()=>{t.current=e},[e]),(0,j.useCallback)((...o)=>{if(t.current===null)throw new Error("Handler is not assigned");return t.current(...o)},[])};var _=require("react/jsx-runtime"),lr=20,ar=600;function ir(e){let{node:t,updateAttributes:o,selected:r}=e,l=(0,Ae.useRef)(null),[a,i]=(0,Ae.useState)(),s=Ft(v=>{let L=document.querySelector(".ProseMirror-selectednode");if(!l.current||!L||!r)return;let z=Math.max(L.offsetWidth,ar);v.preventDefault();let Y=v.currentTarget.dataset.direction||"--",Be=v.clientX,le=l.current.width,Xe=l.current.height,Q=le,Ee=Xe,Do=Y[1]==="w"?-1:1,Ie=()=>{window.removeEventListener("mousemove",Je),window.removeEventListener("mouseup",Ie),o({width:Q,height:Ee}),i(void 0)},Je=Ye=>{if(Q=Math.max(le+Do*(Ye.clientX-Be),lr),Q>z&&(Q=z),Ee=Q/le*Xe,i({width:Q,height:Ee}),!Ye.buttons)return Ie()};window.addEventListener("mousemove",Je),window.addEventListener("mouseup",Ie)});function n(v){return(0,_.jsx)("div",{role:"button",tabIndex:0,onMouseDown:s,"data-direction":v,className:"mly-bg-rose-500",style:x(c(c({position:"absolute",height:"10px",width:"10px"},{n:{top:0},s:{bottom:0}}[v[0]]),{w:{left:0},e:{right:0}}[v[1]]),{cursor:`${v}-resize`})})}let{alignment:d="center",width:m,height:u}=t.attrs||{},W=t.attrs||{},{externalLink:g}=W,P=S(W,["externalLink"]);return(0,_.jsxs)(Ce.NodeViewWrapper,{as:"div",draggable:!0,"data-drag-handle":!0,style:c(x(c({width:m,height:u},a),{overflow:"hidden",position:"relative",lineHeight:"0px",display:"block"}),{center:{marginLeft:"auto",marginRight:"auto"},left:{marginRight:"auto"},right:{marginLeft:"auto"}}[d]||{}),children:[(0,_.jsx)("img",x(c({},P),{ref:l,style:x(c({},a),{cursor:"default",marginBottom:0})})),r&&(0,_.jsxs)(_.Fragment,{children:[[{left:0,top:0,height:"100%",width:"1px"},{right:0,top:0,height:"100%",width:"1px"},{top:0,left:0,width:"100%",height:"1px"},{bottom:0,left:0,width:"100%",height:"1px"}].map((v,L)=>(0,_.jsx)("div",{className:"mly-bg-rose-500",style:c({position:"absolute"},v)},L)),n("nw"),n("ne"),n("sw"),n("se")]})]})}var ke=Wt.default.extend({addAttributes(){var e;return x(c({},(e=this.parent)==null?void 0:e.call(this)),{width:{renderHTML:({width:t})=>({width:t})},height:{renderHTML:({height:t})=>({height:t})},alignment:{default:"center",renderHTML:({alignment:t})=>({"data-alignment":t}),parseHTML:t=>t.getAttribute("data-alignment")||"center"},externalLink:{default:null,renderHTML:({externalLink:t})=>t?{"data-external-link":t}:{},parseHTML:t=>{let o=t.getAttribute("data-external-link");return o?{externalLink:o}:null}}})},addNodeView(){return(0,Ce.ReactNodeViewRenderer)(ir)}});var Te=require("@tiptap/core"),Xt=require("@tiptap/react");var Kt=require("@tiptap/react");var qt=w(require("react"));var $t=require("react/jsx-runtime"),qe=qt.forwardRef((r,o)=>{var l=r,{className:e}=l,t=S(l,["className"]);return(0,$t.jsx)("textarea",c({className:b("mly-flex mly-min-h-24 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",e),ref:o},t))});qe.displayName="Textarea";var p=require("react/jsx-runtime");function Gt(e){let{title:t,description:o,link:r,linkTitle:l,image:a,badgeText:i,subTitle:s}=e.node.attrs,{getPos:n,editor:d}=e;return(0,p.jsx)(Kt.NodeViewWrapper,{className:`react-component ${e.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",children:(0,p.jsxs)(q,{open:e.selected,children:[(0,p.jsx)($,{asChild:!0,children:(0,p.jsx)("div",{tabIndex:-1,onClick:m=>{m.preventDefault();let u=n();d.commands.setNodeSelection(u)},children:(0,p.jsxs)("div",{className:"mly-no-prose mly-flex mly-flex-col mly-rounded-lg mly-border mly-border-gray-300",children:[a&&(0,p.jsx)("div",{className:"mly-relative mly-mb-1.5 mly-w-full mly-shrink-0",children:(0,p.jsx)("img",{src:a,alt:"link-card",className:"mly-no-prose !mly-mb-0 mly-h-full mly-w-full mly-rounded-t-lg"})}),(0,p.jsx)("div",{className:"mly-flex mly-items-stretch mly-p-3",children:(0,p.jsxs)("div",{className:b("mly-flex mly-flex-col"),children:[(0,p.jsxs)("div",{className:"!mly-mb-1.5 mly-flex mly-items-center mly-gap-1.5",children:[(0,p.jsx)("h2",{className:"!mly-mb-0 !mly-text-lg mly-font-semibold",children:t}),i&&(0,p.jsx)("span",{className:"!mly-font-base text-xs mly-rounded-md mly-bg-yellow-200 mly-px-2 mly-py-1 mly-font-semibold mly-leading-none",children:i})," ",s&&!i&&(0,p.jsx)("span",{className:"!mly-font-base text-xs mly-font-regular mly-rounded-md mly-leading-none mly-text-gray-400",children:s})]}),(0,p.jsxs)("p",{className:"!mly-my-0 !mly-text-base mly-text-gray-500",children:[o," ",l?(0,p.jsx)("a",{href:r,className:"mly-font-semibold",children:l}):null]})]})})]})})}),(0,p.jsxs)(D,{align:"end",className:"mly-flex mly-w-96 mly-flex-col mly-gap-2",sideOffset:10,onOpenAutoFocus:m=>m.preventDefault(),onCloseAutoFocus:m=>m.preventDefault(),children:[(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Image"}),(0,p.jsx)(M,{placeholder:"Add Image",type:"url",value:a,onChange:m=>{e.updateAttributes({image:m.target.value})}})]}),(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Title"}),(0,p.jsx)(M,{placeholder:"Add title",value:t,onChange:m=>{e.updateAttributes({title:m.target.value})}})]}),(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Description"}),(0,p.jsx)(qe,{placeholder:"Add description here",value:o,onChange:m=>{e.updateAttributes({description:m.target.value})}})]}),(0,p.jsxs)("div",{className:"mly-grid mly-grid-cols-2 mly-gap-2",children:[(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Link Title"}),(0,p.jsx)(M,{placeholder:"Add link title here",value:l,onChange:m=>{e.updateAttributes({linkTitle:m.target.value})}})]}),(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Link"}),(0,p.jsx)(M,{placeholder:"Add link here",value:r,onChange:m=>{e.updateAttributes({link:m.target.value})}})]})]}),(0,p.jsxs)("div",{className:"mly-grid mly-grid-cols-2 mly-gap-2",children:[(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Badge Text"}),(0,p.jsx)(M,{placeholder:"Add badge text here",value:i,onChange:m=>{e.updateAttributes({badgeText:m.target.value})}})]}),(0,p.jsxs)("label",{className:"mly-w-full mly-space-y-1",children:[(0,p.jsx)("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Sub Title"}),(0,p.jsx)(M,{placeholder:"Add sub title here",value:s,onChange:m=>{e.updateAttributes({subTitle:m.target.value})}})]})]})]})]})})}var Ne=Te.Node.create({name:"linkCard",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"linkCard"},title:{default:""},description:{default:""},link:{default:""},linkTitle:{default:""},image:{default:""},subTitle:{default:""},badgeText:{default:""}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:e}){return["div",(0,Te.mergeAttributes)({"data-maily-component":this.name},e)]},addCommands(){return{setLinkCard:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return(0,Xt.ReactNodeViewRenderer)(Gt)}});function ee(e,t){return({commands:o})=>o.command(({tr:r,state:l,dispatch:a})=>{if(a){let i=null;if(r.selection.ranges.forEach(s=>{l.doc.nodesBetween(s.$from.pos,s.$to.pos,(n,d)=>{n.type.name===e&&(i=d)})}),i!==null){let s=l.doc.nodeAt(i);if(s)r.setNodeMarkup(i,null,c(c({},s.attrs),t));else for(let[n,d]of Object.entries(t))r.setNodeAttribute(i,n,d)}}return!0})}var Yt=require("@tiptap/core"),Qt=require("@tiptap/core"),sr="100%",Jt="center";var Zt=Qt.Node.create({name:"columns",group:"columns",content:"column column",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"two-column"},width:{default:sr,parseHTML:e=>e.style.width,renderHTML:e=>e.width?{style:`width: ${e.width}`}:{}},align:{default:Jt,parseHTML:e=>e.getAttribute("align")||Jt,renderHTML:e=>e.align?{align:e.align}:{}}}},addCommands(){return{setColumns:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{layout:"two-column"},content:[{type:"column",attrs:{position:"left"},content:[{type:"paragraph"}]},{type:"column",attrs:{position:"right"},content:[{type:"paragraph"}]}]}),setLayout:e=>({commands:t})=>t.updateAttributes("columns",{layout:e}),updateColumns:e=>ee(this.name,e)}},renderHTML({HTMLAttributes:e}){return["table",(0,Yt.mergeAttributes)(e,{"data-type":"columns",class:`layout-${e.layout}`}),["tbody",{},["tr",{},0]]]},parseHTML(){return[{tag:'table[data-type="columns"]'}]}});var Le=require("@tiptap/core"),jt=Le.Node.create({name:"column",content:"(block|columns)+",isolating:!0,addAttributes(){return{position:{default:"",parseHTML:e=>e.getAttribute("data-position"),renderHTML:e=>({"data-position":e.position})},verticalAlign:{default:"top",parseHTML:e=>{var t;return((t=e==null?void 0:e.style)==null?void 0:t.verticalAlign)||"top"},renderHTML:e=>e!=null&&e.verticalAlign?{style:`vertical-align: ${(e==null?void 0:e.verticalAlign)||"top"}`}:{}}}},addCommands(){return{updateColumn:e=>ee(this.name,e)}},renderHTML({HTMLAttributes:e}){return["td",(0,Le.mergeAttributes)(e,{"data-type":"column",width:"50%"}),0]},parseHTML(){return[{tag:'td[data-type="column"]'}]}});var Me=require("@tiptap/core"),$e="#ffffff",eo=Me.Node.create({name:"section",group:"block",content:"(block|columns)+",defining:!0,isolating:!0,addAttributes(){return{borderRadius:{default:0,parseHTML:e=>{var t,o;return Number((o=(t=e==null?void 0:e.style)==null?void 0:t.borderRadius)==null?void 0:o.replace(/['"]+/g,""))},renderHTML:e=>e.borderRadius?{style:`border-radius: ${e.borderRadius}px`}:{}},padding:{default:0,parseHTML:e=>{var t,o;return Number((o=(t=e==null?void 0:e.style)==null?void 0:t.padding)==null?void 0:o.replace(/['"]+/g,""))},renderHTML:e=>e.padding?{style:`padding: ${e.padding}px`}:{}},backgroundColor:{default:$e,parseHTML:e=>e.style.backgroundColor,renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}},addCommands(){return{setSection:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{type:this.name},content:[{type:"paragraph"}]}),updateSection:e=>ee(this.name,e)}},renderHTML({HTMLAttributes:e}){return["table",{"data-type":this.name},["tbody",{},["tr",{},["td",(0,Me.mergeAttributes)(e,{"data-type":"section-cell"}),0]]]]},parseHTML(){return[{tag:'table[data-type="section"]'}]}});function yo(e){let{variables:t,slashCommands:o}=e;return[co.default.extend({content:"(block|columns)+"}),Zt,jt,to.default.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},code:{HTMLAttributes:{class:"mly-px-1 mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"}},horizontalRule:!1,blockquote:{HTMLAttributes:{class:"mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4"}},document:!1}),mo.default,de,oo.Color.configure({types:[Ke.default.name,no.default.name]}),Ke.default.configure(),io.default.configure({types:[lo.default.name,so.default.name,We.name]}),ye,ao.default.configure({placeholder:({node:r})=>r.type.name==="heading"?`Heading ${r.attrs.level}`:r.type.name==="columns"||r.type.name==="column"||r.type.name==="section"?"":"Write something or / to see commands",includeChildren:!0}),pe,We,ve.configure({suggestion:St(t)}),Vt.configure({suggestion:Ot(o)}),ro.default.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),he,ke,Ne,po.default,eo]}var wo=require("@tiptap/react"),xo=require("react");function Pe(e,t){let{view:o,state:{selection:{from:r}}}=e,l=document.querySelectorAll(".has-focus"),a=l.length,s=l[a-1];if(s&&s.getAttribute("data-type")&&s.getAttribute("data-type")===t||s&&s.classList&&s.classList.contains(t))return s;let n=o.domAtPos(r).node,d=n;for(d.tagName||(d=n.parentElement);d&&!(d.getAttribute("data-type")&&d.getAttribute("data-type")===t)&&!d.classList.contains(t);)d=d.parentElement;return d}var vo=require("tippy.js");var uo=require("@tiptap/react"),go=w(require("fast-deep-equal")),ho=e=>(0,uo.useEditorState)({editor:e,selector:o=>{var r,l,a;return{currentBorderRadius:Number((r=o.editor.getAttributes("section"))==null?void 0:r.borderRadius)||0,currentPadding:Number((l=o.editor.getAttributes("section"))==null?void 0:l.padding)||0,currentBackgroundColor:((a=o.editor.getAttributes("section"))==null?void 0:a.backgroundColor)||$e}},equalityFn:go.default});var re=require("react/jsx-runtime");function Ge(e){let{value:t,onValueChange:o,icon:r}=e;return(0,re.jsxs)("label",{className:"mly-relative mly-flex mly-items-center mly-justify-center",children:[r?(0,re.jsx)(r,{size:14,className:"mly-absolute mly-left-1.5"}):null,(0,re.jsx)("input",{type:"number",value:t,onChange:l=>o(Number(l.target.value)),className:b("hide-number-controls focus-visible:outline-none mly-h-auto mly-max-w-12 mly-border-0 mly-border-none mly-p-1 mly-text-sm mly-tabular-nums mly-outline-none",r?"mly-pl-[26px]":""),min:0})]})}var Re=require("lucide-react");var fo=require("@tiptap/core");function te(e){let{state:{doc:t,selection:o,selection:{empty:r,from:l,to:a}}}=e,i=!t.textBetween(l,a).length&&(0,fo.isTextSelection)(o);return!(r||i||!e.isEditable)}var bo=require("react/jsx-runtime");function ne(e){let{type:t="vertical",className:o}=e;return(0,bo.jsx)("div",{className:b("mly-mx-0.5 mly-bg-gray-200",t==="vertical"?"mly-w-px":"mly-h-px",o)})}var V=require("react/jsx-runtime");function Co(e){let{appendTo:t,editor:o}=e;if(!o)return null;let r=(0,xo.useCallback)(()=>{let i=Pe(o,"section");return(i==null?void 0:i.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},[o]),l=x(c(c({},e),t?{appendTo:t.current}:{}),{shouldShow:({editor:i})=>te(i)?!1:i.isActive("section")&&!i.isActive("columns")&&!i.isActive("column"),tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,appendTo:()=>t==null?void 0:t.current,plugins:[vo.sticky],sticky:"popper"},pluginKey:"sectionBubbleMenu"}),a=ho(o);return(0,V.jsxs)(wo.BubbleMenu,x(c({},l),{className:"mly-flex mly-items-stretch mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:[(0,V.jsx)(Ge,{icon:Re.Scan,value:a.currentBorderRadius,onValueChange:i=>{var s;(s=o==null?void 0:o.commands)==null||s.updateSection({borderRadius:i})}}),(0,V.jsx)(ne,{}),(0,V.jsx)(Ge,{icon:Re.Box,value:a.currentPadding,onValueChange:i=>{var s;(s=o==null?void 0:o.commands)==null||s.updateSection({padding:i})}}),(0,V.jsx)(ne,{}),(0,V.jsx)(X,{color:a.currentBackgroundColor,onColorChange:i=>{var s;(s=o==null?void 0:o.commands)==null||s.updateSection({backgroundColor:i})},children:(0,V.jsx)(R,{variant:"ghost",className:"!mly-size-7 mly-shrink-0",size:"sm",type:"button",children:(0,V.jsx)("div",{className:"mly-h-4 mly-w-4 mly-shrink-0 mly-rounded mly-border mly-border-gray-700",style:{backgroundColor:a.currentBackgroundColor}})})})]}))}var Mo=require("@tiptap/react"),k=require("lucide-react");var Ao=require("@tiptap/react"),ko=w(require("fast-deep-equal")),mr="#374151",To=e=>(0,Ao.useEditorState)({editor:e,selector:o=>({currentTextColor:o.editor.getAttributes("textStyle").color||mr}),equalityFn:ko.default});var No=w(require("@tiptap/extension-image"));var Lo=(e,t)=>[ye.name,No.default.name,pe.name,ke.name,ve.name,he.name,Ne.name,de.name].some(r=>e.isActive(r));var F=require("react/jsx-runtime");function Po(e){let{editor:t,appendTo:o}=e;if(!t)return null;let r=[k.AlignLeftIcon,k.AlignCenterIcon,k.AlignRightIcon],l=me.map((n,d)=>({name:n,isActive:()=>t==null?void 0:t.isActive({textAlign:n}),command:()=>{var m,u,g,P;(m=e==null?void 0:e.editor)!=null&&m.isActive({textAlign:n})?(g=(u=e==null?void 0:e.editor)==null?void 0:u.chain())==null||g.focus().unsetTextAlign().run():(P=e==null?void 0:e.editor)==null||P.chain().focus().setTextAlign(n).run()},icon:r[d]})),a=[{name:"bold",isActive:()=>t==null?void 0:t.isActive("bold"),command:()=>t==null?void 0:t.chain().focus().toggleBold().run(),icon:k.BoldIcon},{name:"italic",isActive:()=>t==null?void 0:t.isActive("italic"),command:()=>t==null?void 0:t.chain().focus().toggleItalic().run(),icon:k.ItalicIcon},{name:"underline",isActive:()=>t==null?void 0:t.isActive("underline"),command:()=>t==null?void 0:t.chain().focus().toggleUnderline().run(),icon:k.UnderlineIcon},{name:"strike",isActive:()=>t==null?void 0:t.isActive("strike"),command:()=>t==null?void 0:t.chain().focus().toggleStrike().run(),icon:k.StrikethroughIcon},...l,{name:"code",isActive:()=>t==null?void 0:t.isActive("code"),command:()=>t==null?void 0:t.chain().focus().toggleCode().run(),icon:k.CodeIcon},{name:"link",command:()=>{let n=t==null?void 0:t.getAttributes("link").href,d=window.prompt("URL",n);if(d!==null){if(d===""){t==null||t.chain().focus().extendMarkRange("link").unsetLink().run();return}t==null||t.chain().focus().extendMarkRange("link").setLink({href:d}).run()}},isActive:()=>t==null?void 0:t.isActive("link"),icon:k.LinkIcon}],i=x(c(c({},e),o?{appendTo:o.current}:{}),{pluginKey:"textMenu",shouldShow:({editor:n,state:d,from:m,to:u,view:g})=>{if(!g||n.view.dragging)return!1;let P=g.domAtPos(m||0).node,v=g.nodeDOM(m||0)||P;return Lo(n,v)?!1:te(n)},tippyOptions:{popperOptions:{placement:"top-start",modifiers:[{name:"preventOverflow",options:{boundary:"viewport",padding:8}},{name:"flip",options:{fallbackPlacements:["bottom-start","top-end","bottom-end"]}}]},maxWidth:"100%"}}),s=To(t);return(0,F.jsxs)(Mo.BubbleMenu,x(c({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:[a.map((n,d)=>(0,F.jsx)(N,c({},n),d)),(0,F.jsx)(X,{color:s.currentTextColor,onColorChange:n=>{t==null||t.chain().setColor(n).run()},children:(0,F.jsx)(R,{variant:"ghost",size:"sm",type:"button",children:(0,F.jsxs)("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[(0,F.jsx)("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),(0,F.jsx)("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:s.currentTextColor}})]})})})]}))}var Oo=require("react");var Io=require("@tiptap/react"),zo=require("react");var Ho=require("tippy.js");var Ro=require("@tiptap/react"),So=w(require("fast-deep-equal")),Bo=e=>(0,Ro.useEditorState)({editor:e,selector:o=>{var r,l,a,i,s,n,d,m;return{width:((r=o.editor.getAttributes("columns"))==null?void 0:r.width)||"100%",isAlignLeft:((l=o.editor.getAttributes("columns"))==null?void 0:l.align)==="left",isAlignCenter:((a=o.editor.getAttributes("columns"))==null?void 0:a.align)==="center",isAlignRight:((i=o.editor.getAttributes("columns"))==null?void 0:i.align)==="right",currentVerticalAlignment:((s=o.editor.getAttributes("column"))==null?void 0:s.verticalAlign)||"top",isVerticalAlignTop:((n=o.editor.getAttributes("column"))==null?void 0:n.verticalAlign)==="top",isVerticalAlignMiddle:((d=o.editor.getAttributes("column"))==null?void 0:d.verticalAlign)==="middle",isVerticalAlignBottom:((m=o.editor.getAttributes("column"))==null?void 0:m.verticalAlign)==="bottom",isColumnActive:o.editor.isActive("column")}},equalityFn:So.default});var J=require("react/jsx-runtime");function Eo(e){let{selectedValue:t,onValueChange:o}=e;return(0,J.jsxs)("label",{className:"mly-relative mly-flex mly-items-center",children:[(0,J.jsx)("span",{className:"mly-absolute mly-inset-y-0 mly-left-2 mly-flex mly-items-center mly-text-xs mly-leading-none mly-text-gray-400",children:"W"}),(0,J.jsxs)("select",{className:"mly-h-auto mly-max-w-24 mly-appearance-none mly-border-0 mly-border-none mly-p-1 mly-pl-[26px] mly-text-sm mly-uppercase mly-tabular-nums mly-outline-none focus-visible:mly-outline-none",value:t,onChange:r=>o(r.target.value),children:[(0,J.jsx)("option",{value:"auto",children:"auto"}),(0,J.jsx)("option",{value:"100%",children:"100%"})]})]})}var E=require("lucide-react");var T=require("react/jsx-runtime");function Vo(e){let{appendTo:t,editor:o}=e;if(!o)return null;let r=(0,zo.useCallback)(()=>{let i=Pe(o,"columns");return(i==null?void 0:i.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},[o]),l=x(c(c({},e),t?{appendTo:t.current}:{}),{shouldShow:({editor:i})=>te(i)?!1:i.isActive("columns"),tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,appendTo:()=>t==null?void 0:t.current,plugins:[Ho.sticky],sticky:"popper"},pluginKey:"columnsBubbleMenu"}),a=Bo(o);return(0,T.jsxs)(Io.BubbleMenu,x(c({},l),{className:"mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-shadow-md",children:[a.isColumnActive&&(0,T.jsxs)("div",{className:"mly-border-b mly-p-1 mly-pt-2",children:[(0,T.jsx)("span",{className:"mly-ml-1 mly-block mly-text-[10px] mly-uppercase mly-leading-none mly-text-gray-500",children:"Column"}),(0,T.jsxs)("div",{className:"mly-mt-2 mly-flex mly-items-stretch",children:[(0,T.jsx)(N,{name:"Vertical Align Top",icon:E.AlignVerticalDistributeStart,command:()=>{o.commands.updateColumn({verticalAlign:"top"})},isActive:()=>a.isVerticalAlignTop,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3"}),(0,T.jsx)(N,{name:"Vertical Align Middle",icon:E.AlignVerticalDistributeCenter,command:()=>{o.commands.updateColumn({verticalAlign:"middle"})},isActive:()=>a.isVerticalAlignMiddle,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3"}),(0,T.jsx)(N,{name:"Vertical Align Bottom",icon:E.AlignVerticalDistributeEnd,command:()=>{o.commands.updateColumn({verticalAlign:"bottom"})},isActive:()=>a.isVerticalAlignBottom,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3"})]})]}),(0,T.jsxs)("div",{className:"mly-p-1 mly-pt-2",children:[(0,T.jsx)("span",{className:"mly-ml-1 mly-block mly-text-[10px] mly-uppercase mly-leading-none mly-text-gray-500",children:"Table"}),(0,T.jsxs)("div",{className:"mly-mt-2 mly-flex mly-items-stretch",children:[(0,T.jsx)(Eo,{selectedValue:a.width,onValueChange:i=>{o.commands.updateColumns({width:i})}}),(0,T.jsx)(ne,{}),(0,T.jsx)(N,{name:"Align Left",isActive:()=>a.isAlignLeft,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3",icon:E.AlignLeft,command:()=>o.commands.updateColumns({align:"left"})}),(0,T.jsx)(N,{name:"Align Center",isActive:()=>a.isAlignCenter,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3",icon:E.AlignCenter,command:()=>o.commands.updateColumns({align:"center"})}),(0,T.jsx)(N,{name:"Align Right",isActive:()=>a.isAlignRight,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3",icon:E.AlignRight,command:()=>o.commands.updateColumns({align:"right"})})]})]})]}))}var I=require("react/jsx-runtime");function dr(e){let{config:{wrapClassName:t="",contentClassName:o="",bodyClassName:r="",hasMenuBar:l=!0,spellCheck:a=!1,autofocus:i="end",immediatelyRender:s=!1}={},onCreate:n,onUpdate:d,extensions:m,contentHtml:u,contentJson:g,variables:P,slashCommands:W}=e,v=null;g?v=(g==null?void 0:g.type)==="doc"?g:{type:"doc",content:g}:u?v=u:v={type:"doc",content:[{type:"paragraph",content:[]}]};let L=(0,Oo.useRef)(null),z=(0,Se.useEditor)({editorProps:{attributes:{class:b("mly-prose mly-w-full",o),spellCheck:a?"true":"false"},handleDOMEvents:{keydown:(Y,Be)=>{if(["ArrowUp","ArrowDown","Enter"].includes(Be.key)&&document.querySelector("#slash-command"))return!0}}},immediatelyRender:s,onCreate:({editor:Y})=>{n==null||n(Y)},onUpdate:({editor:Y})=>{d==null||d(Y)},extensions:[...yo({variables:P,slashCommands:W}),...m||[]],content:v,autofocus:i});return z?(0,I.jsx)(Tt,{variables:P,children:(0,I.jsxs)("div",{className:b("mly-editor mly-antialiased",t),ref:L,children:[l&&(0,I.jsx)(lt,{config:e.config,editor:z}),(0,I.jsxs)("div",{className:b("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[(0,I.jsx)(Po,{editor:z,appendTo:L}),(0,I.jsx)(ct,{editor:z,appendTo:L}),(0,I.jsx)(yt,{editor:z,appendTo:L}),(0,I.jsx)(Se.EditorContent,{editor:z}),(0,I.jsx)(Co,{editor:z,appendTo:L}),(0,I.jsx)(Vo,{editor:z,appendTo:L})]})]})}):null}0&&(module.exports={Editor});
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var Qe=Object.defineProperty,Ze=Object.defineProperties;var et=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var ne=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable;var le=(t,e,o)=>e in t?Qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,c=(t,e)=>{for(var o in e||(e={}))ne.call(e,o)&&le(t,o,e[o]);if(D)for(var o of D(e))ae.call(e,o)&&le(t,o,e[o]);return t},b=(t,e)=>Ze(t,et(e));var k=(t,e)=>{var o={};for(var r in t)ne.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&D)for(var r of D(t))e.indexOf(r)<0&&ae.call(t,r)&&(o[r]=t[r]);return o};function I(t,{insertAt:e}={}){if(!t||typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}I(`.mly-editor .mly-prose p:where([class~=text-sm]){font-size:16px}.mly-editor .mly-prose h1,.mly-editor .mly-prose h2,.mly-editor .mly-prose h3{margin-top:0;margin-bottom:12px}.mly-editor .mly-prose h1{font-size:36px}.mly-editor .mly-prose h2{font-size:30px}.mly-editor .mly-prose h3{font-size:24px}.mly-editor .mly-prose p{font-size:15px;margin-bottom:20px}.mly-editor .mly-prose h1+p,.mly-editor .mly-prose h2+p,.mly-editor .mly-prose h3+p,.mly-editor .mly-prose hr+p{margin-top:0}.mly-editor .mly-prose ol,.mly-editor .mly-prose ul{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose li:not(:last-child){margin-bottom:8px}.mly-editor .mly-prose li>p{margin:0}.mly-editor .mly-prose img{margin-top:0;margin-bottom:32px}.mly-editor .mly-prose hr{margin-block:32px}.mly-editor .mly-prose .footer{display:block;font-size:13px;margin-bottom:20px;color:#64748b}.mly-editor .mly-prose .spacer+*{margin-top:0}.mly-editor .mly-prose p+.spacer{margin-top:-20px}.mly-editor .mly-prose blockquote+.spacer{margin-top:-16px}.mly-editor .mly-prose h1+.spacer,.mly-editor .mly-prose h2+.spacer,.mly-editor .mly-prose h3+.spacer{margin-top:-12px}.mly-editor .mly-prose ol+.spacer,.mly-editor .mly-prose ul+.spacer{margin-top:-20px}.mly-editor .mly-prose img+.spacer{margin-top:-32px}.mly-editor .mly-prose .node-button+.spacer,.mly-editor .mly-prose .node-linkCard+.spacer,.mly-editor .mly-prose footer+.spacer{margin-top:-20px}.mly-editor .mly-prose .node-button,.mly-editor .mly-prose .node-linkCard{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose .node-image{line-height:0;margin-top:0;margin-bottom:32px;outline:none}.mly-editor .mly-prose .node-image+.spacer{margin-top:-32px}.mly-editor .mly-prose code:before,.mly-editor .mly-prose code:after{content:none}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:"liga" 0}.ProseMirror:focus{outline:none}.ProseMirror .is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror .is-empty:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror-selectednode{outline:3px solid #555}.mly-no-scrollbar::-webkit-scrollbar{display:none}.mly-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.mly-editor .react-colorful__alpha{border-radius:0}.mly-editor .react-colorful__saturation,.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{border-radius:8px}.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{height:16px}.mly-editor .react-colorful__pointer{width:16px;height:16px}
3
- `);I(`:where(.mly-editor),:where(.mly-editor) :before,:where(.mly-editor) :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:where(.mly-editor) :before,:where(.mly-editor) :after{--tw-content: ""}:where(.mly-editor) html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}:where(.mly-editor) body{margin:0;line-height:inherit}:where(.mly-editor) hr{height:0;color:inherit;border-top-width:1px}:where(.mly-editor) abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6{font-size:inherit;font-weight:inherit}:where(.mly-editor) a{color:inherit;text-decoration:inherit}:where(.mly-editor) b,:where(.mly-editor) strong{font-weight:bolder}:where(.mly-editor) code,:where(.mly-editor) kbd,:where(.mly-editor) samp,:where(.mly-editor) pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}:where(.mly-editor) small{font-size:80%}:where(.mly-editor) sub,:where(.mly-editor) sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.mly-editor) sub{bottom:-.25em}:where(.mly-editor) sup{top:-.5em}:where(.mly-editor) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.mly-editor) button,:where(.mly-editor) input,:where(.mly-editor) optgroup,:where(.mly-editor) select,:where(.mly-editor) textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}:where(.mly-editor) button,:where(.mly-editor) select{text-transform:none}:where(.mly-editor) button,:where(.mly-editor) [type=button],:where(.mly-editor) [type=reset],:where(.mly-editor) [type=submit]{-webkit-appearance:button;background-image:none}:where(.mly-editor) :-moz-focusring{outline:auto}:where(.mly-editor) :-moz-ui-invalid{box-shadow:none}:where(.mly-editor) progress{vertical-align:baseline}:where(.mly-editor) ::-webkit-inner-spin-button,:where(.mly-editor) ::-webkit-outer-spin-button{height:auto}:where(.mly-editor) [type=search]{-webkit-appearance:textfield;outline-offset:-2px}:where(.mly-editor) ::-webkit-search-decoration{-webkit-appearance:none}:where(.mly-editor) ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(.mly-editor) summary{display:list-item}:where(.mly-editor) blockquote,:where(.mly-editor) dl,:where(.mly-editor) dd,:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6,:where(.mly-editor) hr,:where(.mly-editor) figure,:where(.mly-editor) p,:where(.mly-editor) pre{margin:0}:where(.mly-editor) fieldset{margin:0;padding:0}:where(.mly-editor) legend{padding:0}:where(.mly-editor) ol,:where(.mly-editor) ul,:where(.mly-editor) menu{list-style:none;margin:0;padding:0}:where(.mly-editor) dialog{padding:0}:where(.mly-editor) textarea{resize:vertical}:where(.mly-editor) input::-moz-placeholder,:where(.mly-editor) textarea::-moz-placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) input::placeholder,:where(.mly-editor) textarea::placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) button,:where(.mly-editor) [role=button]{cursor:pointer}:where(.mly-editor) :disabled{cursor:default}:where(.mly-editor) img,:where(.mly-editor) svg,:where(.mly-editor) video,:where(.mly-editor) canvas,:where(.mly-editor) audio,:where(.mly-editor) iframe,:where(.mly-editor) embed,:where(.mly-editor) object{display:block;vertical-align:middle}:where(.mly-editor) img,:where(.mly-editor) video{max-width:100%;height:auto}:where(.mly-editor) [hidden]{display:none}
4
- `);I('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;text-align:start;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-absolute{position:absolute}.mly-relative{position:relative}.mly-inset-0{inset:0}.mly-z-50{z-index:50}.\\!mly-my-0{margin-top:0!important;margin-bottom:0!important}.\\!mly-mb-0{margin-bottom:0!important}.\\!mly-mb-1{margin-bottom:.25rem!important}.\\!mly-mb-1\\.5{margin-bottom:.375rem!important}.mly-mb-1{margin-bottom:.25rem}.mly-mb-1\\.5{margin-bottom:.375rem}.mly-mb-4{margin-bottom:1rem}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-inline-block{display:inline-block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-grid{display:grid}.mly-aspect-\\[16\\/9\\]{aspect-ratio:16/9}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-h-full{height:100%}.mly-max-h-\\[330px\\]{max-height:330px}.mly-min-h-24{min-height:6rem}.\\!mly-w-full{width:100%!important}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-72{width:18rem}.mly-w-96{width:24rem}.mly-w-full{width:100%}.mly-min-w-0{min-width:0px}.mly-min-w-\\[128px\\]{min-width:128px}.mly-min-w-\\[260px\\]{min-width:260px}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-items-stretch{align-items:stretch}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-1\\.5{gap:.375rem}.mly-gap-2{gap:.5rem}.mly-gap-3{gap:.75rem}.mly-gap-4{gap:1rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.mly-space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-lg{border-radius:.5rem}.mly-rounded-md{border-radius:.375rem}.mly-rounded-none{border-radius:0}.mly-rounded-xl{border-radius:.75rem}.mly-rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.mly-border{border-width:1px}.mly-border-0{border-width:0px}.mly-border-l-4{border-left-width:4px}.mly-border-t{border-top-width:1px}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.mly-border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.\\!mly-bg-transparent{background-color:transparent!important}.mly-bg-\\[\\#efefef\\]{--tw-bg-opacity: 1;background-color:rgb(239 239 239 / var(--tw-bg-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity))}.mly-bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.mly-bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity))}.mly-stroke-\\[2\\.5\\]{stroke-width:2.5}.mly-object-cover{-o-object-fit:cover;object-fit:cover}.\\!mly-p-0{padding:0!important}.mly-p-1{padding:.25rem}.mly-p-3{padding:.75rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-0{padding-top:0;padding-bottom:0}.mly-py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.\\!mly-text-base{font-size:1rem!important;line-height:1.5rem!important}.\\!mly-text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-uppercase{text-transform:uppercase}.mly-capitalize{text-transform:capitalize}.mly-leading-none{line-height:1}.mly-tracking-normal{letter-spacing:0em}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-gray-950{--tw-text-opacity: 1;color:rgb(3 7 18 / var(--tw-text-opacity))}.mly-text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-border-gray-400:focus-visible{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');import{EditorContent as br,useEditor as xr}from"@tiptap/react";import{BubbleMenu as mt,isTextSelection as dt}from"@tiptap/react";import{AlignCenterIcon as ct,AlignLeftIcon as pt,AlignRightIcon as yt,BoldIcon as ut,CodeIcon as gt,ItalicIcon as ht,LinkIcon as wt,StrikethroughIcon as ft,UnderlineIcon as bt}from"lucide-react";import{mergeAttributes as tt}from"@tiptap/core";import ot from"@tiptap/extension-image";var ie=["sm","md","lg"],_=["left","center","right"],se="left",$="sm";function rt(t){let e={sm:"40px",md:"48px",lg:"64px"};return[`height:${e[t]||e[$]}`,`width:${e[t]||e[$]}`]}function lt(t){let e={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return e[t]||e[se]}var me=ot.extend({name:"logo",priority:1e3,addAttributes(){var t;return b(c({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:$,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:se,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},renderHTML({HTMLAttributes:t,node:e}){let{size:o,alignment:r}=e.attrs,n=["position:relative","margin-top:0",...rt(o),...lt(r)];return t.style=n.join(";"),["img",tt(this.options.HTMLAttributes,t)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});import*as de from"react";import{Slot as it}from"@radix-ui/react-slot";import{clsx as nt}from"clsx";import{twMerge as at}from"tailwind-merge";function u(...t){return at(nt(t))}import{jsx as st}from"react/jsx-runtime";var L=de.forwardRef((i,s)=>{var l=i,{className:t,variant:e="default",size:o="default",asChild:r=!1}=l,n=k(l,["className","variant","size","asChild"]);let a=r?it:"button",p="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",m={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},d={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},w=u("mly-editor",p,m[e],d[o],t);return st(a,c({className:w,ref:s},n))});L.displayName="BaseButton";import{jsx as K}from"react/jsx-runtime";function S(t){return K(L,{variant:"ghost",size:"sm",onClick:t.command,"data-state":t.isActive(),className:u("mly-px-2.5"),type:"button",children:t.icon?K(t.icon,{className:u("mly-h-3.5 mly-w-3.5")}):K("span",{className:"mly-text-sm mly-font-medium mly-text-slate-600",children:t.name})})}import{jsx as ce}from"react/jsx-runtime";function pe(t){let{editor:e}=t,o=[pt,ct,yt],r=_.map((i,l)=>({name:i,isActive:()=>e==null?void 0:e.isActive({textAlign:i}),command:()=>{var a,p,m,d;(a=t==null?void 0:t.editor)!=null&&a.isActive({textAlign:i})?(m=(p=t==null?void 0:t.editor)==null?void 0:p.chain())==null||m.focus().unsetTextAlign().run():(d=t==null?void 0:t.editor)==null||d.chain().focus().setTextAlign(i).run()},icon:o[l]})),n=[{name:"bold",isActive:()=>e==null?void 0:e.isActive("bold"),command:()=>e==null?void 0:e.chain().focus().toggleBold().run(),icon:ut},{name:"italic",isActive:()=>e==null?void 0:e.isActive("italic"),command:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),icon:ht},{name:"underline",isActive:()=>e==null?void 0:e.isActive("underline"),command:()=>e==null?void 0:e.chain().focus().toggleUnderline().run(),icon:bt},{name:"strike",isActive:()=>e==null?void 0:e.isActive("strike"),command:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),icon:ft},...r,{name:"code",isActive:()=>e==null?void 0:e.isActive("code"),command:()=>e==null?void 0:e.chain().focus().toggleCode().run(),icon:gt},{name:"link",command:()=>{let i=e==null?void 0:e.getAttributes("link").href,l=window.prompt("URL",i);if(l!==null){if(l===""){e==null||e.chain().focus().extendMarkRange("link").unsetLink().run();return}e==null||e.chain().focus().extendMarkRange("link").setLink({href:l}).run()}},isActive:()=>e==null?void 0:e.isActive("link"),icon:wt}],s=b(c({},t),{shouldShow:({editor:i,state:l,from:a,to:p})=>{let{doc:m,selection:d}=l,{empty:w}=d,R=!m.textBetween(a,p).length&&dt(l.selection);return!(w||R||!i.isEditable||i.isActive("image")||i.isActive("logo")||i.isActive("spacer")||i.isActive("variable")||i.isActive({mailyComponent:"button"})||i.isActive({mailyComponent:"linkCard"}))},tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return ce(mt,b(c({},s),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:n.map((i,l)=>ce(S,c({},i),l))}))}import{useMemo as ye}from"react";import{AlignCenter as xt,AlignLeft as vt,AlignRight as kt,BoldIcon as At,EraserIcon as Ct,ItalicIcon as Tt,LinkIcon as Nt,SeparatorHorizontal as Lt,StrikethroughIcon as Pt,UnderlineIcon as Mt}from"lucide-react";import{jsx as G}from"react/jsx-runtime";var ue=t=>{let{editor:e,config:o}=t,r=ye(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:At},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:Tt},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:Mt},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:Pt},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:Ct},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:Lt},{name:"link",command:()=>{let s=e.getAttributes("link").href,i=window.prompt("URL",s);if(i!==null){if(i===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:i}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:Nt},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:vt},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:xt},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:kt}],[e]),n=ye(()=>r.reduce((s,i)=>(s.includes(i.group)||s.push(i.group),s),[]),[r]);return e?G("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:n.map((s,i)=>G("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(l=>l.group===s).map((l,a)=>G(S,c({},l),a))},i))}):null};import{BubbleMenu as Rt}from"@tiptap/react";import{AlignCenterIcon as St,AlignLeftIcon as Bt,AlignRightIcon as zt,ArrowUpRight as It,Link as Et,Unlink as Ht}from"lucide-react";import{jsx as ge}from"react/jsx-runtime";function he(t){let{editor:e}=t,o=[Bt,St,zt],r=_.map((l,a)=>({name:l,isActive:()=>(e==null?void 0:e.isActive("logo",{alignment:l}))||(e==null?void 0:e.isActive("image",{alignment:l})),shouldShow:()=>(e==null?void 0:e.isActive("logo"))||(e==null?void 0:e.isActive("image")),command:()=>{var m,d;(e==null?void 0:e.isActive("logo"))?(m=t==null?void 0:t.editor)==null||m.chain().focus().setLogoAttributes({alignment:l}).run():(d=t==null?void 0:t.editor)==null||d.chain().focus().updateAttributes("image",{alignment:l}).run()},icon:o[a]})),n=ie.map(l=>({name:l,isActive:()=>{var a;return(a=t==null?void 0:t.editor)==null?void 0:a.isActive("logo",{size:l})},shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var a;(a=t==null?void 0:t.editor)==null||a.chain().focus().setLogoAttributes({size:l}).run()}})),s=[...r,{name:"url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var R,T,f;let{editor:l}=t,a=(R=l==null?void 0:l.getAttributes("logo"))==null?void 0:R.src,p=window.prompt("Update logo URL",a);if(!p)return;let m=(T=l==null?void 0:l.getAttributes("logo"))==null?void 0:T.size,d=(f=l==null?void 0:l.getAttributes("logo"))==null?void 0:f.alignment,w=l==null?void 0:l.state.selection;l==null||l.commands.setLogoImage({src:p,size:m,alignment:d}),l==null||l.commands.setNodeSelection((w==null?void 0:w.from)||0)},icon:Et},{name:"image-url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("image"),command:()=>{var d;let{editor:l}=t,a=(d=l==null?void 0:l.getAttributes("image"))==null?void 0:d.src,p=window.prompt("Update Image URL",a);if(!p)return;let m=l==null?void 0:l.state.selection;l==null||l.commands.setImage({src:p}),l==null||l.commands.setNodeSelection((m==null?void 0:m.from)||0)},icon:Ht},{name:"image-external-url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("image"),command:()=>{var m;let{editor:l}=t,a=(m=l==null?void 0:l.getAttributes("image"))==null?void 0:m.externalLink,p=window.prompt("Update Image External URL",a||"");l==null||l.commands.updateAttributes("image",{externalLink:p||""})},icon:It},...n],i=b(c({},t),{shouldShow:({editor:l})=>l.isActive("logo")||l.isActive("image"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return ge(Rt,b(c({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:s.filter(l=>{var a;return(a=l.shouldShow)==null?void 0:a.call(l)}).map((l,a)=>ge(S,c({},l),a))}))}import{BubbleMenu as _t}from"@tiptap/react";import{mergeAttributes as Vt,Node as Ot}from"@tiptap/core";var X=["sm","md","lg","xl"],Ut="sm";function Dt(t){let e={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${e[t]||e[Ut]}`}var we=Ot.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height})}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>{if(!X.includes(t))throw new Error("Invalid spacer height");return e.updateAttributes("spacer",{height:t})},unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){let{height:o}=e.attrs;return t.style=Dt(o),["div",Vt({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer relative z-50",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});import{jsx as fe}from"react/jsx-runtime";function be(t){let{editor:e}=t,o=X.map(n=>({name:n,isActive:()=>e==null?void 0:e.isActive("spacer",{height:n}),command:()=>{e==null||e.chain().focus().setSpacer({height:n}).run()}})),r=b(c({},t),{shouldShow:({editor:n})=>n.isActive("spacer"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return fe(_t,b(c({},r),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:o.map((n,s)=>fe(S,c({},n),s))}))}import dr from"@tiptap/starter-kit";import{Color as cr}from"@tiptap/extension-color";import pr from"@tiptap/extension-link";import yr from"@tiptap/extension-list-item";import ur from"@tiptap/extension-paragraph";import gr from"@tiptap/extension-placeholder";import hr from"@tiptap/extension-text-align";import Ge from"@tiptap/extension-text-style";import wr from"@tiptap/extension-heading";import fr from"@tiptap/extension-underline";import{InputRule as qt}from"@tiptap/core";import{HorizontalRule as Ft}from"@tiptap/extension-horizontal-rule";var xe=Ft.extend({addInputRules(){return[new qt({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{let o={},{tr:r}=t,n=e.from,s=e.to;r.insert(n-1,this.type.create(o)).delete(r.mapping.map(n),r.mapping.map(s))}})]}});import{mergeAttributes as oo,Node as ro}from"@tiptap/core";import{ReactNodeViewRenderer as lo}from"@tiptap/react";import{NodeViewWrapper as jt}from"@tiptap/react";import{AlignCenterIcon as Jt,AlignLeftIcon as Yt,AlignRightIcon as Qt}from"lucide-react";import{useState as Wt}from"react";import{HexAlphaColorPicker as $t,HexColorInput as Kt}from"react-colorful";import{jsx as ve,jsxs as Gt}from"react/jsx-runtime";function j(t){let{color:e,onChange:o}=t,[r,n]=Wt(e),s=i=>{n(i),o==null||o(i)};return Gt("div",{className:"mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4",children:[ve($t,{color:r,onChange:s,className:"mly-flex !mly-w-full mly-flex-col mly-gap-4"}),ve(Kt,{alpha:!0,color:r,onChange:s,className:"mly-mt-4 mly-w-full mly-min-w-0 mly-rounded-lg mly-border mly-px-2 mly-py-1.5 mly-text-sm mly-uppercase focus-visible:mly-border-gray-400 focus-visible:mly-outline-none",prefixed:!0})]})}import*as ke from"react";import{jsx as Xt}from"react/jsx-runtime";var v=ke.forwardRef((n,r)=>{var s=n,{className:t,type:e}=s,o=k(s,["className","type"]);return Xt("input",c({type:e,className:u("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",t),ref:r},o))});v.displayName="Input";import*as Ce from"react";import*as P from"@radix-ui/react-popover";import{jsx as Ae}from"react/jsx-runtime";var B=P.Root,z=P.Trigger,M=Ce.forwardRef((s,n)=>{var i=s,{className:t,align:e="center",sideOffset:o=4}=i,r=k(i,["className","align","sideOffset"]);return Ae(P.Portal,{children:Ae(P.Content,c({ref:n,align:e,sideOffset:o,className:u("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-text-gray-950 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2","mly-editor",t)},r))})});M.displayName=P.Content.displayName;import{jsx as y,jsxs as A}from"react/jsx-runtime";var Zt={left:Yt,center:Jt,right:Qt},J={style(t){return Ne.map(e=>({name:e,isActive:t.node.attrs.variant===e,onClick:()=>{t.updateAttributes({variant:e})}}))},cornerRadius(t){return Le.map(e=>({name:e,isActive:t.node.attrs.borderRadius===e,onClick:()=>{t.updateAttributes({borderRadius:e})}}))},alignment(t){return Object.entries(Zt).map(([e,o])=>({name:e,icon:o,isActive:t.node.attrs.alignment===e,onClick:()=>t.updateAttributes({alignment:e})}))}};function Te(t){let{url:e,text:o,alignment:r,variant:n,borderRadius:s,buttonColor:i,textColor:l}=t.node.attrs,{getPos:a,editor:p}=t;return y(jt,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:A(B,{open:t.selected,children:[y(z,{asChild:!0,children:y("div",{children:y("button",{className:u("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":s==="round","!mly-rounded-md":s==="smooth","!mly-rounded-none":s==="sharp"}),tabIndex:-1,style:{backgroundColor:n==="filled"?i:"transparent",color:l,borderWidth:2,borderStyle:"solid",borderColor:i},onClick:m=>{m.preventDefault();let d=a();p.commands.setNodeSelection(d)},children:o})})}),A(M,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:m=>m.preventDefault(),onCloseAutoFocus:m=>m.preventDefault(),children:[y(v,{placeholder:"Add text here",value:o,onChange:m=>{t.updateAttributes({text:m.target.value})}}),y(v,{placeholder:"Add link here",value:e,onChange:m=>{t.updateAttributes({url:m.target.value})}}),A("div",{className:"mly-w-full mly-space-y-2",children:[y("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),y("div",{className:"mly-flex mly-gap-1",children:J.style(t).map((m,d)=>y(L,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},d))})]}),A("div",{className:"mly-w-full mly-space-y-2",children:[y("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),y("div",{className:"mly-flex mly-gap-1",children:J.cornerRadius(t).map((m,d)=>y(L,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},d))})]}),A("div",{className:"flex gap-2",children:[A("div",{children:[y("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),y("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:J.alignment(t).map((m,d)=>y(L,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:m.onClick,type:"button",children:y(m.icon,{size:16})},d))})]}),A("div",{children:[y("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),A("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[y(eo,{variant:n,color:i,onChange:m=>{t.updateAttributes({buttonColor:m})}}),y(to,{color:l,onChange:m=>{t.updateAttributes({textColor:m})}})]})]})]})]})]})})}function eo(t){let{color:e,onChange:o,variant:r}=t;return A(B,{children:[y(z,{asChild:!0,children:y(L,{variant:"ghost",className:"",size:"sm",type:"button",children:y("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:e}})})}),y(M,{className:"mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",children:y(j,{color:e,onChange:n=>{queueMicrotask(()=>{o(n)})}})})]})}function to(t){let{color:e,onChange:o}=t;return A(B,{children:[y(z,{asChild:!0,children:y(L,{variant:"ghost",size:"sm",type:"button",children:A("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[y("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),y("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:e}})]})})}),y(M,{className:"mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",children:y(j,{color:e,onChange:r=>{queueMicrotask(()=>{o(r)})}})})]})}var Ne=["filled","outline"],Le=["sharp","smooth","round"],Pe=ro.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["a",oo({"data-maily-component":this.name},t)]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return lo(Te)}});import{mergeAttributes as no,Node as ao}from"@tiptap/core";var Y=ao.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",no(this.options.HTMLAttributes,t,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});import{forwardRef as co,useEffect as po,useImperativeHandle as yo,useState as Be}from"react";import{NodeViewWrapper as uo,ReactRenderer as go}from"@tiptap/react";import ho from"tippy.js";import{AlertTriangle as wo}from"lucide-react";import{createContext as io,useContext as so}from"react";import{jsx as mo}from"react/jsx-runtime";var Me=io({variables:[],slashCommands:[]});function Re(t){let r=t,{children:e}=r,o=k(r,["children"]);return mo(Me.Provider,{value:o,children:e})}function Se(){let t=so(Me);if(!t)throw new Error("Missing MailyContext.Provider in the component tree");return t}import{jsx as C,jsxs as O}from"react/jsx-runtime";var ze=co((t,e)=>{var s,i;let[o,r]=Be(0),n=l=>{let a=t.items[l];a&&t.command({id:a})};return po(()=>r(0),[t.items]),yo(e,()=>({onKeyDown:({event:l})=>l.key==="ArrowUp"?(r((o+t.items.length-1)%t.items.length),!0):l.key==="ArrowDown"?(r((o+1)%t.items.length),!0):l.key==="Enter"?(n(o),!0):!1})),C("div",{className:"mly-z-50 mly-h-auto mly-min-w-[128px] mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-1 mly-shadow-md mly-transition-all",children:(s=t==null?void 0:t.items)!=null&&s.length?(i=t==null?void 0:t.items)==null?void 0:i.map((l,a)=>C("button",{onClick:()=>n(a),className:u("mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",a===o?"mly-bg-gray-200":"mly-bg-white"),children:l},a)):C("button",{className:"mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-bg-white mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:"No result"})})});ze.displayName="VariableList";function Ie(t=[]){let e=t.map(o=>o.name);return{items:({query:o})=>e.concat(o.length>0?[o]:[]).filter(r=>r.toLowerCase().startsWith(o.toLowerCase())).slice(0,5),render:()=>{let o,r=null;return{onStart:n=>{o=new go(ze,{props:n,editor:n.editor}),n.clientRect&&(r=ho("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:o.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(n){var s;o.updateProps(n),n.clientRect&&((s=r==null?void 0:r[0])==null||s.setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var s;return n.event.key==="Escape"?(r==null||r[0].hide(),!0):(s=o.ref)==null?void 0:s.onKeyDown(n)},onExit(){!r||!(r!=null&&r[0])||!o||(r==null||r[0].destroy(),o.destroy())}}}}}function Ee(t){var m,d;let{node:e,selected:o,updateAttributes:r}=t,{id:n,fallback:s}=e.attrs,{variables:i=[]}=Se(),l=(d=(m=i.find(w=>w.name===n))==null?void 0:m.required)!=null?d:!0,[a,p]=Be(!1);return C(uo,{className:u("react-component",o&&"ProseMirror-selectednode","mly-inline-block mly-leading-none"),draggable:"false",children:O(B,{open:a,onOpenChange:p,children:[C(z,{children:O("span",{tabIndex:-1,className:"mly-inline-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-border-rose-200 mly-bg-rose-50 mly-px-2 mly-py-1 mly-leading-none mly-text-rose-800",children:[n,l&&!s&&C(wo,{className:"mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5]"})]})}),O(M,{align:"start",className:"mly-space-y-2",onOpenAutoFocus:w=>w.preventDefault(),onCloseAutoFocus:w=>w.preventDefault(),children:[O("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[C("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Variable Name"}),C(v,{placeholder:"Add Variable Name",value:n,onChange:w=>{r({id:w.target.value})}})]}),O("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[C("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Fallback Value"}),C(v,{placeholder:"Fallback Value",value:s||"",onChange:w=>{r({fallback:w.target.value})}}),C("p",{className:"mly-text-xs mly-text-gray-500",children:"If the variable doesn't exist, this fallback value will be used."})]})]})]})})}import{useCallback as fo,useEffect as He,useLayoutEffect as bo,useRef as xo,useState as vo}from"react";import{Extension as ko}from"@tiptap/core";import{ReactRenderer as Ao}from"@tiptap/react";import Co from"@tiptap/suggestion";import{DivideIcon as To,EraserIcon as No,FootprintsIcon as Lo,Heading1 as Po,Heading2 as Mo,Heading3 as Ro,ImageIcon as Ve,List as So,ListOrdered as Bo,MousePointer as zo,MoveVertical as Io,Text as Eo,TextQuote as Ho,ArrowUpRightSquare as Vo}from"lucide-react";import Oo from"tippy.js";import{jsx as g,jsxs as H}from"react/jsx-runtime";var Oe=ko.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:o})=>{o.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[Co(c({editor:this.editor},this.options.suggestion))]}}),Uo=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:g(Eo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:g(Po,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:g(Mo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:g(Ro,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:g(So,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:g(Bo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:g(Ve,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Image URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setImage({src:o}).run())}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:g(Ve,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Logo URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setLogoImage({src:o}).run())}},{title:"Spacer",description:"Add a spacer to email. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:g(Io,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to email.",searchTerms:["link","button","cta"],icon:g(zo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setButton().run()}},{title:"Link Card",description:"Add a link card to email.",searchTerms:["link","button","image"],icon:g(Vo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setLinkCard().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:g(To,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHardBreak().run()}},{title:"Blockquote",description:"Add blockquote.",searchTerms:["quote","blockquote"],icon:g(Ho,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBlockquote().run()}},{title:"Footer",description:"Add a footer text to email.",searchTerms:["footer","text"],icon:g(Lo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:g(No,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().selectParentNode().deleteSelection().run()}}],Do=(t,e)=>{let o=t.offsetHeight,r=e?e.offsetHeight:0,n=e.offsetTop,s=n+r;n<t.scrollTop?t.scrollTop-=t.scrollTop-n+5:s>o+t.scrollTop&&(t.scrollTop+=s-o-t.scrollTop+5)},_o=({items:t,command:e,editor:o})=>{let[r,n]=vo(0),s=fo(l=>{let a=t[l];a&&e(a)},[e,o,t]);He(()=>{let l=["ArrowUp","ArrowDown","Enter"],a=p=>{if(l.includes(p.key))return p.preventDefault(),p.key==="ArrowUp"?(n((r+t.length-1)%t.length),!0):p.key==="ArrowDown"?(n((r+1)%t.length),!0):p.key==="Enter"?(s(r),!0):!1};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[t,r,n,s]),He(()=>{n(0)},[t]);let i=xo(null);return bo(()=>{let l=i==null?void 0:i.current,a=l==null?void 0:l.children[r];a&&l&&Do(l,a)},[r]),t.length>0?H("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[g("div",{id:"slash-command",ref:i,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:t.map((l,a)=>H("button",{className:u("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",a===r?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>s(a),type:"button",children:[g("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:l.icon}),H("div",{children:[g("p",{className:"mly-font-medium",children:l.title}),g("p",{className:"mly-text-xs mly-text-gray-400",children:l.description})]})]},a))}),g("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:H("div",{className:"mly-flex mly-items-center",children:[H("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[g("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),g("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),g("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),H("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[g("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null};function Ue(t=[]){return{items:({query:e})=>[...Uo,...t].filter(o=>{if(typeof e=="string"&&e.length>0){let r=e.toLowerCase();return o.title.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)||o.searchTerms&&o.searchTerms.some(n=>n.includes(r))}return!0}),render:()=>{let e,o=null;return{onStart:r=>{e=new Ao(_o,{props:r,editor:r.editor}),o=Oo("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:r=>{e==null||e.updateProps(r),o&&o[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var n;return r.event.key==="Escape"?(o==null||o[0].hide(),!0):(n=e==null?void 0:e.ref)==null?void 0:n.onKeyDown(r)},onExit:()=>{!o||!(o!=null&&o[0])||!e||(o==null||o[0].destroy(),e==null||e.destroy())}}}}}import{mergeAttributes as qo,Node as Fo}from"@tiptap/core";import{PluginKey as Wo}from"@tiptap/pm/state";import{ReactNodeViewRenderer as $o}from"@tiptap/react";import Ko from"@tiptap/suggestion";var Go=new Wo("variable"),De=Fo.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},renderLabel({options:t,node:e}){var o;return`${(o=e.attrs.label)!=null?o:e.attrs.id}`},suggestion:{char:"@",pluginKey:Go,command:({editor:t,range:e,props:o})=>{var s,i;let r=t.view.state.selection.$to.nodeAfter;((s=r==null?void 0:r.text)==null?void 0:s.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:o},{type:"text",text:" "}]).run(),(i=window.getSelection())==null||i.collapseToEnd()},allow:({state:t,range:e})=>{let o=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!o.parent.type.contentMatch.matchType(r)}}}},addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},fallback:{default:null,parseHTML:t=>t.getAttribute("data-fallback"),renderHTML:t=>t.fallback?{"data-fallback":t.fallback}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",qo({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})]},renderText({node:t}){return this.options.renderLabel({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let o=!1,{selection:r}=e,{empty:n,anchor:s}=r;return n?(e.doc.nodesBetween(s-1,s,(i,l)=>{if(i.type.name===this.name)return o=!0,t.insertText(this.options.suggestion.char||"",l,l+i.nodeSize),!1}),o):!1})}},addProseMirrorPlugins(){return[Ko(c({editor:this.editor},this.options.suggestion))]},addNodeView(){return $o(Ee)}});import{NodeViewWrapper as Yo,ReactNodeViewRenderer as Qo}from"@tiptap/react";import{useRef as Zo,useState as er}from"react";import tr from"@tiptap/extension-image";import{useCallback as Xo,useLayoutEffect as jo,useRef as Jo}from"react";var _e=t=>{let e=Jo(null);return jo(()=>{e.current=t},[t]),Xo((...o)=>{if(e.current===null)throw new Error("Handler is not assigned");return e.current(...o)},[])};import{Fragment as lr,jsx as Q,jsxs as qe}from"react/jsx-runtime";var or=60;function rr(t){let{node:e,updateAttributes:o,selected:r}=t,n=Zo(null),[s,i]=er(),l=_e(f=>{let N=document.querySelector(".ProseMirror-selectednode");if(!n.current||!N||!r)return;let U=N.offsetWidth;f.preventDefault();let ee=f.currentTarget.dataset.direction||"--",Je=f.clientX,q=n.current.width,te=n.current.height,E=q,F=te,Ye=ee[1]==="w"?-1:1,W=()=>{window.removeEventListener("mousemove",oe),window.removeEventListener("mouseup",W),o({width:E,height:F}),i(void 0)},oe=re=>{if(E=Math.max(q+Ye*(re.clientX-Je),or),E>U&&(E=U),F=E/q*te,i({width:E,height:F}),!re.buttons)return W()};window.addEventListener("mousemove",oe),window.addEventListener("mouseup",W)});function a(f){return Q("div",{role:"button",tabIndex:0,onMouseDown:l,"data-direction":f,className:"mly-bg-rose-500",style:b(c(c({position:"absolute",height:"10px",width:"10px"},{n:{top:0},s:{bottom:0}}[f[0]]),{w:{left:0},e:{right:0}}[f[1]]),{cursor:`${f}-resize`})})}let{alignment:p="center",width:m,height:d}=e.attrs||{},T=e.attrs||{},{externalLink:w}=T,R=k(T,["externalLink"]);return qe(Yo,{as:"div",draggable:!0,"data-drag-handle":!0,style:c(b(c({width:m,height:d},s),{overflow:"hidden",position:"relative",lineHeight:"0px",display:"block"}),{center:{marginLeft:"auto",marginRight:"auto"},left:{marginRight:"auto"},right:{marginLeft:"auto"}}[p]||{}),children:[Q("img",b(c({},R),{ref:n,style:b(c({},s),{cursor:"default",marginBottom:0})})),r&&qe(lr,{children:[[{left:0,top:0,height:"100%",width:"1px"},{right:0,top:0,height:"100%",width:"1px"},{top:0,left:0,width:"100%",height:"1px"},{bottom:0,left:0,width:"100%",height:"1px"}].map((f,N)=>Q("div",{className:"mly-bg-rose-500",style:c({position:"absolute"},f)},N)),a("nw"),a("ne"),a("sw"),a("se")]})]})}var Fe=tr.extend({addAttributes(){var t;return b(c({},(t=this.parent)==null?void 0:t.call(this)),{width:{renderHTML:({width:e})=>({width:e})},height:{renderHTML:({height:e})=>({height:e})},alignment:{default:"center",renderHTML:({alignment:e})=>({"data-alignment":e}),parseHTML:e=>e.getAttribute("data-alignment")||"center"},externalLink:{default:null,renderHTML:({externalLink:e})=>e?{"data-external-link":e}:{},parseHTML:e=>{let o=e.getAttribute("data-external-link");return o?{externalLink:o}:null}}})},addNodeView(){return Qo(rr)}});import{mergeAttributes as ir,Node as sr}from"@tiptap/core";import{ReactNodeViewRenderer as mr}from"@tiptap/react";import{NodeViewWrapper as ar}from"@tiptap/react";import*as We from"react";import{jsx as nr}from"react/jsx-runtime";var Z=We.forwardRef((r,o)=>{var n=r,{className:t}=n,e=k(n,["className"]);return nr("textarea",c({className:u("mly-flex mly-min-h-24 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",t),ref:o},e))});Z.displayName="Textarea";import{jsx as h,jsxs as x}from"react/jsx-runtime";function $e(t){let{layout:e,title:o,description:r,link:n,linkTitle:s,image:i,badgeText:l,subTitle:a}=t.node.attrs,{getPos:p,editor:m}=t;return h(ar,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",children:x(B,{open:t.selected,children:[h(z,{asChild:!0,children:h("div",{tabIndex:-1,onClick:d=>{d.preventDefault();let w=p();m.commands.setNodeSelection(w)},children:x("div",{className:"mly-no-prose mly-flex mly-flex-col mly-rounded-lg mly-border mly-border-gray-300",children:[i&&h("div",{className:"mly-relative mly-aspect-[16/9] mly-w-full mly-shrink-0 mly-mb-1.5",children:h("img",{src:i,alt:"link-card",className:"mly-no-prose mly-absolute mly-inset-0 !mly-mb-0 mly-h-full mly-w-full mly-rounded-t-lg mly-object-cover"})}),h("div",{className:"mly-flex mly-items-stretch mly-p-3",children:x("div",{className:u("mly-flex mly-flex-col"),children:[x("div",{className:"!mly-mb-1.5 mly-flex mly-items-center mly-gap-1.5",children:[h("h2",{className:"!mly-mb-0 !mly-text-lg mly-font-semibold",children:o}),l&&h("span",{className:"!mly-font-base text-xs mly-rounded-md mly-bg-yellow-200 mly-px-2 mly-py-1 mly-font-semibold mly-leading-none",children:l})," ",a&&!l&&h("span",{className:"!mly-font-base text-xs mly-rounded-md mly-font-regular mly-leading-none mly-text-gray-400",children:a})]}),x("p",{className:"!mly-my-0 !mly-text-base mly-text-gray-500",children:[r," ",s?h("a",{href:n,className:"mly-font-semibold",children:s}):null]})]})})]})})}),x(M,{align:"end",className:"mly-flex mly-w-96 mly-flex-col mly-gap-2",sideOffset:10,onOpenAutoFocus:d=>d.preventDefault(),onCloseAutoFocus:d=>d.preventDefault(),children:[x("label",{className:"mly-w-full mly-space-y-1",children:[h("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Image"}),h(v,{placeholder:"Add Image",type:"url",value:i,onChange:d=>{t.updateAttributes({image:d.target.value})}})]}),x("label",{className:"mly-w-full mly-space-y-1",children:[h("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Title"}),h(v,{placeholder:"Add title",value:o,onChange:d=>{t.updateAttributes({title:d.target.value})}})]}),x("label",{className:"mly-w-full mly-space-y-1",children:[h("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Description"}),h(Z,{placeholder:"Add description here",value:r,onChange:d=>{t.updateAttributes({description:d.target.value})}})]}),x("div",{className:"mly-grid mly-grid-cols-2 mly-gap-2",children:[x("label",{className:"mly-w-full mly-space-y-1",children:[h("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Link Title"}),h(v,{placeholder:"Add link title here",value:s,onChange:d=>{t.updateAttributes({linkTitle:d.target.value})}})]}),x("label",{className:"mly-w-full mly-space-y-1",children:[h("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Link"}),h(v,{placeholder:"Add link here",value:n,onChange:d=>{t.updateAttributes({link:d.target.value})}})]})]}),x("div",{className:"mly-grid mly-grid-cols-2 mly-gap-2",children:[x("label",{className:"mly-w-full mly-space-y-1",children:[h("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Badge Text"}),h(v,{placeholder:"Add badge text here",value:l,onChange:d=>{t.updateAttributes({badgeText:d.target.value})}})]}),x("label",{className:"mly-w-full mly-space-y-1",children:[h("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Sub Title"}),h(v,{placeholder:"Add sub title here",value:a,onChange:d=>{t.updateAttributes({subTitle:d.target.value})}})]})]})]})]})})}var Ke=sr.create({name:"linkCard",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"linkCard"},title:{default:""},description:{default:""},link:{default:""},linkTitle:{default:""},image:{default:""},subTitle:{default:""},badgeText:{default:""}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["div",ir({"data-maily-component":this.name},t)]},addCommands(){return{setLinkCard:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return mr($e)}});function Xe(t){let{variables:e,slashCommands:o}=t;return[dr.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},code:{HTMLAttributes:{class:"mly-px-1 mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"}},horizontalRule:!1,blockquote:{HTMLAttributes:{class:"mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4"}}}),fr,me,cr.configure({types:[Ge.name,yr.name]}),Ge.configure(),hr.configure({types:[ur.name,wr.name,Y.name]}),xe,gr.configure({placeholder:({node:r})=>r.type.name==="heading"?`Heading ${r.attrs.level}`:"Write something or / to see commands",includeChildren:!0}),we,Y,De.configure({suggestion:Ie(e)}),Oe.configure({suggestion:Ue(o)}),pr.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),Pe,Fe,Ke]}import{jsx as V,jsxs as je}from"react/jsx-runtime";function Wa(t){let{config:{wrapClassName:e="",contentClassName:o="",bodyClassName:r="",hasMenuBar:n=!0,spellCheck:s=!1,autofocus:i="end"}={},onCreate:l,onUpdate:a,extensions:p,contentHtml:m,contentJson:d,variables:w,slashCommands:R}=t,T=null;d?T=(d==null?void 0:d.type)==="doc"?d:{type:"doc",content:d}:m?T=m:T={type:"doc",content:[{type:"paragraph",content:[]}]};let f=xr({editorProps:{attributes:{class:u("mly-prose mly-w-full",o),spellCheck:s?"true":"false"},handleDOMEvents:{keydown:(N,U)=>{if(["ArrowUp","ArrowDown","Enter"].includes(U.key)&&document.querySelector("#slash-command"))return!0}}},onCreate:({editor:N})=>{l==null||l(N)},onUpdate:({editor:N})=>{a==null||a(N)},extensions:[...Xe({variables:w,slashCommands:R}),...p||[]],content:T,autofocus:i});return f?V(Re,{variables:w,children:je("div",{className:u("mly-editor mly-antialiased",e),children:[n&&V(ue,{config:t.config,editor:f}),je("div",{className:u("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[V(pe,{editor:f}),V(he,{editor:f}),V(be,{editor:f}),V(br,{editor:f})]})]})}):null}export{Wa as Editor};
2
+ var At=Object.defineProperty,kt=Object.defineProperties;var Tt=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var Te=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable;var ke=(e,t,o)=>t in e?At(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,c=(e,t)=>{for(var o in t||(t={}))Te.call(t,o)&&ke(e,o,t[o]);if(Y)for(var o of Y(t))Ne.call(t,o)&&ke(e,o,t[o]);return e},b=(e,t)=>kt(e,Tt(t));var N=(e,t)=>{var o={};for(var r in e)Te.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Y)for(var r of Y(e))t.indexOf(r)<0&&Ne.call(e,r)&&(o[r]=e[r]);return o};function V(e,{insertAt:t}={}){if(!e||typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}V(`:root{--placeholder-color: #adb5bd}.mly-editor .mly-prose p:where([class~=text-sm]){font-size:16px}.mly-editor .mly-prose h1,.mly-editor .mly-prose h2,.mly-editor .mly-prose h3{margin-top:0;margin-bottom:12px}.mly-editor .mly-prose h1{font-size:36px}.mly-editor .mly-prose h2{font-size:30px}.mly-editor .mly-prose h3{font-size:24px}.mly-editor .mly-prose p{font-size:15px;margin-bottom:20px}.mly-editor .mly-prose h1+p,.mly-editor .mly-prose h2+p,.mly-editor .mly-prose h3+p,.mly-editor .mly-prose hr+p{margin-top:0}.mly-editor .mly-prose ol,.mly-editor .mly-prose ul{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose li:not(:last-child){margin-bottom:8px}.mly-editor .mly-prose li>p{margin:0}.mly-editor .mly-prose img{margin-top:0;margin-bottom:32px}.mly-editor .mly-prose hr{margin-block:32px}.mly-editor .mly-prose .footer{display:block;font-size:13px;margin-bottom:20px;color:#64748b}.mly-editor .mly-prose .spacer+*{margin-top:0}.mly-editor .mly-prose p+.spacer{margin-top:-20px}.mly-editor .mly-prose blockquote+.spacer{margin-top:-16px}.mly-editor .mly-prose h1+.spacer,.mly-editor .mly-prose h2+.spacer,.mly-editor .mly-prose h3+.spacer{margin-top:-12px}.mly-editor .mly-prose ol+.spacer,.mly-editor .mly-prose ul+.spacer{margin-top:-20px}.mly-editor .mly-prose img+.spacer{margin-top:-32px}.mly-editor .mly-prose .node-button+.spacer,.mly-editor .mly-prose .node-linkCard+.spacer,.mly-editor .mly-prose footer+.spacer{margin-top:-20px}.mly-editor .mly-prose .node-button,.mly-editor .mly-prose .node-linkCard{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose .node-image{line-height:0;margin-top:0;margin-bottom:32px;outline:none}.mly-editor .mly-prose .node-image+.spacer{margin-top:-32px}.mly-editor .mly-prose code:before,.mly-editor .mly-prose code:after{content:none}.mly-no-scrollbar::-webkit-scrollbar{display:none}.mly-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.mly-editor .react-colorful__alpha{border-radius:0}.mly-editor .react-colorful__saturation,.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{border-radius:8px}.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{height:16px}.mly-editor .react-colorful__pointer{width:16px;height:16px}.ProseMirror-selectednode{outline:3px solid #555}.mly-prose{strong{color:currentColor}}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:"liga" 0;&:focus{outline:none}.is-editor-empty:first-child:not([data-type=columns],[data-type=section]):before{content:attr(data-placeholder);text-wrap:nowrap;float:left;color:var(--placeholder-color);pointer-events:none;height:0}.is-empty:not([data-type=columns],[data-type=section]):before{content:attr(data-placeholder);text-wrap:nowrap;float:left;color:var(--placeholder-color);pointer-events:none;height:0}[data-type=columns]{padding:0;[data-type=column].has-focus{outline:2px solid #e9ecef}}[data-type=column]{padding:0;>*:first-child{margin-top:0}>*:last-child{margin-bottom:0}}[data-type=section]{margin:0;padding:0;[data-type=section-cell]{padding:0;>*:first-child{margin-top:0}>*:last-child{margin-bottom:0}}}*:has(+.ProseMirror-gapcursor){margin-bottom:0!important}.ProseMirror-gapcursor{&:after{border:1.5px solid gray;width:24px}+*{margin-top:0!important}}}.hide-number-controls{&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}&[type=number]{-moz-appearance:textfield}}
3
+ `);V(`:where(.mly-editor),:where(.mly-editor) :before,:where(.mly-editor) :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:where(.mly-editor) :before,:where(.mly-editor) :after{--tw-content: ""}:where(.mly-editor) html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}:where(.mly-editor) body{margin:0;line-height:inherit}:where(.mly-editor) hr{height:0;color:inherit;border-top-width:1px}:where(.mly-editor) abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6{font-size:inherit;font-weight:inherit}:where(.mly-editor) a{color:inherit;text-decoration:inherit}:where(.mly-editor) b,:where(.mly-editor) strong{font-weight:bolder}:where(.mly-editor) code,:where(.mly-editor) kbd,:where(.mly-editor) samp,:where(.mly-editor) pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}:where(.mly-editor) small{font-size:80%}:where(.mly-editor) sub,:where(.mly-editor) sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.mly-editor) sub{bottom:-.25em}:where(.mly-editor) sup{top:-.5em}:where(.mly-editor) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.mly-editor) button,:where(.mly-editor) input,:where(.mly-editor) optgroup,:where(.mly-editor) select,:where(.mly-editor) textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}:where(.mly-editor) button,:where(.mly-editor) select{text-transform:none}:where(.mly-editor) button,:where(.mly-editor) [type=button],:where(.mly-editor) [type=reset],:where(.mly-editor) [type=submit]{-webkit-appearance:button;background-image:none}:where(.mly-editor) :-moz-focusring{outline:auto}:where(.mly-editor) :-moz-ui-invalid{box-shadow:none}:where(.mly-editor) progress{vertical-align:baseline}:where(.mly-editor) ::-webkit-inner-spin-button,:where(.mly-editor) ::-webkit-outer-spin-button{height:auto}:where(.mly-editor) [type=search]{-webkit-appearance:textfield;outline-offset:-2px}:where(.mly-editor) ::-webkit-search-decoration{-webkit-appearance:none}:where(.mly-editor) ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(.mly-editor) summary{display:list-item}:where(.mly-editor) blockquote,:where(.mly-editor) dl,:where(.mly-editor) dd,:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6,:where(.mly-editor) hr,:where(.mly-editor) figure,:where(.mly-editor) p,:where(.mly-editor) pre{margin:0}:where(.mly-editor) fieldset{margin:0;padding:0}:where(.mly-editor) legend{padding:0}:where(.mly-editor) ol,:where(.mly-editor) ul,:where(.mly-editor) menu{list-style:none;margin:0;padding:0}:where(.mly-editor) dialog{padding:0}:where(.mly-editor) textarea{resize:vertical}:where(.mly-editor) input::-moz-placeholder,:where(.mly-editor) textarea::-moz-placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) input::placeholder,:where(.mly-editor) textarea::placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) button,:where(.mly-editor) [role=button]{cursor:pointer}:where(.mly-editor) :disabled{cursor:default}:where(.mly-editor) img,:where(.mly-editor) svg,:where(.mly-editor) video,:where(.mly-editor) canvas,:where(.mly-editor) audio,:where(.mly-editor) iframe,:where(.mly-editor) embed,:where(.mly-editor) object{display:block;vertical-align:middle}:where(.mly-editor) img,:where(.mly-editor) video{max-width:100%;height:auto}:where(.mly-editor) [hidden]{display:none}
4
+ `);V('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(th,td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){text-align:start}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-absolute{position:absolute}.mly-relative{position:relative}.mly-inset-y-0{top:0;bottom:0}.mly-left-1\\.5{left:.375rem}.mly-left-2{left:.5rem}.mly-z-50{z-index:50}.\\!mly-my-0{margin-top:0!important;margin-bottom:0!important}.mly-mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.\\!mly-mb-0{margin-bottom:0!important}.\\!mly-mb-1\\.5{margin-bottom:.375rem!important}.mly-mb-1\\.5{margin-bottom:.375rem}.mly-mb-4{margin-bottom:1rem}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-inline-block{display:inline-block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-grid{display:grid}.\\!mly-size-7{width:1.75rem!important;height:1.75rem!important}.\\!mly-h-7{height:1.75rem!important}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-h-full{height:100%}.mly-h-px{height:1px}.mly-max-h-\\[330px\\]{max-height:330px}.mly-min-h-24{min-height:6rem}.\\!mly-w-full{width:100%!important}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-7{width:1.75rem}.mly-w-72{width:18rem}.mly-w-96{width:24rem}.mly-w-full{width:100%}.mly-w-px{width:1px}.mly-min-w-0{min-width:0px}.mly-min-w-\\[128px\\]{min-width:128px}.mly-min-w-\\[260px\\]{min-width:260px}.mly-max-w-12{max-width:3rem}.mly-max-w-24{max-width:6rem}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.mly-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-items-stretch{align-items:stretch}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-1\\.5{gap:.375rem}.mly-gap-2{gap:.5rem}.mly-gap-3{gap:.75rem}.mly-gap-4{gap:1rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.mly-space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-lg{border-radius:.5rem}.mly-rounded-md{border-radius:.375rem}.mly-rounded-none{border-radius:0}.mly-rounded-xl{border-radius:.75rem}.mly-rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.mly-border{border-width:1px}.mly-border-0{border-width:0px}.mly-border-b{border-bottom-width:1px}.mly-border-l-4{border-left-width:4px}.mly-border-t{border-top-width:1px}.mly-border-none{border-style:none}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.mly-border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.mly-border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.\\!mly-bg-transparent{background-color:transparent!important}.mly-bg-\\[\\#efefef\\]{--tw-bg-opacity: 1;background-color:rgb(239 239 239 / var(--tw-bg-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity))}.mly-bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.mly-bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity))}.mly-stroke-\\[2\\.5\\]{stroke-width:2.5}.\\!mly-p-0{padding:0!important}.mly-p-0{padding:0}.mly-p-1{padding:.25rem}.mly-p-3{padding:.75rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-pl-\\[26px\\]{padding-left:26px}.mly-pt-2{padding-top:.5rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.\\!mly-text-base{font-size:1rem!important;line-height:1.5rem!important}.\\!mly-text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.mly-text-\\[10px\\]{font-size:10px}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-uppercase{text-transform:uppercase}.mly-capitalize{text-transform:capitalize}.mly-tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.mly-leading-none{line-height:1}.mly-tracking-normal{letter-spacing:0em}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-gray-950{--tw-text-opacity: 1;color:rgb(3 7 18 / var(--tw-text-opacity))}.mly-text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-border-gray-400:focus-visible{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');import{EditorContent as Nn,useEditor as Ln}from"@tiptap/react";import{useMemo as Me}from"react";import{AlignCenter as Rt,AlignLeft as St,AlignRight as Bt,BoldIcon as Et,EraserIcon as It,ItalicIcon as zt,LinkIcon as Ht,SeparatorHorizontal as Vt,StrikethroughIcon as Ot,UnderlineIcon as Dt}from"lucide-react";import*as Le from"react";import{Slot as Mt}from"@radix-ui/react-slot";import{clsx as Nt}from"clsx";import{twMerge as Lt}from"tailwind-merge";function u(...e){return Lt(Nt(e))}import{jsx as Pt}from"react/jsx-runtime";var T=Le.forwardRef((i,a)=>{var s=i,{className:e,variant:t="default",size:o="default",asChild:r=!1}=s,l=N(s,["className","variant","size","asChild"]);let n=r?Mt:"button",d="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",m={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},p={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},y=u("mly-editor",d,m[t],p[o],e);return Pt(n,c({className:y,ref:a},l))});T.displayName="BaseButton";import{jsx as de}from"react/jsx-runtime";function x(e){return de(T,{variant:"ghost",size:"sm",onClick:e.command,"data-state":e.isActive(),className:u("mly-px-2.5",e==null?void 0:e.className),type:"button",children:e.icon?de(e.icon,{className:u("shrink-0 mly-h-3.5 mly-w-3.5",e==null?void 0:e.iconClassName)}):de("span",{className:u("mly-text-sm mly-font-medium mly-text-slate-600",e==null?void 0:e.nameClassName),children:e.name})})}import{jsx as ce}from"react/jsx-runtime";var Pe=e=>{let{editor:t,config:o}=e,r=Me(()=>[{name:"bold",command:()=>t.chain().focus().toggleBold().run(),isActive:()=>t.isActive("bold"),group:"mark",icon:Et},{name:"italic",command:()=>t.chain().focus().toggleItalic().run(),isActive:()=>t.isActive("italic"),group:"mark",icon:zt},{name:"underline",command:()=>t.chain().focus().toggleUnderline().run(),isActive:()=>t.isActive("underline"),group:"mark",icon:Dt},{name:"strike",command:()=>t.chain().focus().toggleStrike().run(),isActive:()=>t.isActive("strike"),group:"mark",icon:Ot},{name:"delete-line",command:()=>t.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:It},{name:"divider",command:()=>t.chain().focus().setHorizontalRule().run(),isActive:()=>t.isActive("horizontalRule"),group:"custom",icon:Vt},{name:"link",command:()=>{let a=t.getAttributes("link").href,i=window.prompt("URL",a);if(i!==null){if(i===""){t.chain().focus().extendMarkRange("link").unsetLink().run();return}t.chain().focus().extendMarkRange("link").setLink({href:i}).run()}},isActive:()=>t.isActive("link"),group:"custom",icon:Ht},{name:"left",command:()=>t.chain().focus().setTextAlign("left").run(),isActive:()=>t.isActive({textAlign:"left"}),group:"alignment",icon:St},{name:"center",command:()=>t.chain().focus().setTextAlign("center").run(),isActive:()=>t.isActive({textAlign:"center"}),group:"alignment",icon:Rt},{name:"right",command:()=>t.chain().focus().setTextAlign("right").run(),isActive:()=>t.isActive({textAlign:"right"}),group:"alignment",icon:Bt}],[t]),l=Me(()=>r.reduce((a,i)=>(a.includes(i.group)||a.push(i.group),a),[]),[r]);return t?ce("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:l.map((a,i)=>ce("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(s=>s.group===a).map((s,n)=>ce(x,c({},s),n))},i))}):null};import{BubbleMenu as qt}from"@tiptap/react";import{AlignCenterIcon as $t,AlignLeftIcon as Kt,AlignRightIcon as Gt,ArrowUpRight as Xt,Link as Jt,Unlink as Yt}from"lucide-react";import{mergeAttributes as Ut}from"@tiptap/core";import _t from"@tiptap/extension-image";var Re=["sm","md","lg"],Q=["left","center","right"],Se="left",pe="sm";function Ft(e){let t={sm:"40px",md:"48px",lg:"64px"};return[`height:${t[e]||t[pe]}`,`width:${t[e]||t[pe]}`]}function Wt(e){let t={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return t[e]||t[Se]}var Z=_t.extend({name:"logo",priority:1e3,addAttributes(){var e;return b(c({},(e=this.parent)==null?void 0:e.call(this)),{"maily-component":{default:"logo",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t.getAttribute("data-maily-component")},size:{default:pe,parseHTML:t=>t.getAttribute("data-size"),renderHTML:t=>({"data-size":t.size})},alignment:{default:Se,parseHTML:t=>t.getAttribute("data-alignment"),renderHTML:t=>({"data-alignment":t.alignment})}})},addCommands(){return{setLogoImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),setLogoAttributes:e=>({commands:t})=>t.updateAttributes("logo",e)}},renderHTML({HTMLAttributes:e,node:t}){let{size:o,alignment:r}=t.attrs,l=["position:relative","margin-top:0",...Ft(o),...Wt(r)];return e.style=l.join(";"),["img",Ut(this.options.HTMLAttributes,e)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});import{jsx as Be}from"react/jsx-runtime";function Ee(e){let{editor:t,appendTo:o}=e,r=[Kt,$t,Gt],l=Q.map((n,d)=>({name:n,isActive:()=>(t==null?void 0:t.isActive("logo",{alignment:n}))||(t==null?void 0:t.isActive("image",{alignment:n})),shouldShow:()=>(t==null?void 0:t.isActive("logo"))||(t==null?void 0:t.isActive("image")),command:()=>{var p,y;(t==null?void 0:t.isActive("logo"))?(p=e==null?void 0:e.editor)==null||p.chain().focus().setLogoAttributes({alignment:n}).run():(y=e==null?void 0:e.editor)==null||y.chain().focus().updateAttributes("image",{alignment:n}).run()},icon:r[d]})),a=Re.map(n=>({name:n,isActive:()=>{var d;return(d=e==null?void 0:e.editor)==null?void 0:d.isActive("logo",{size:n})},shouldShow:()=>t==null?void 0:t.isActive("logo"),command:()=>{var d;(d=e==null?void 0:e.editor)==null||d.chain().focus().setLogoAttributes({size:n}).run()}})),i=[...l,{name:"url",isActive:()=>!1,shouldShow:()=>t==null?void 0:t.isActive("logo"),command:()=>{var E,w,C;let{editor:n}=e,d=(E=n==null?void 0:n.getAttributes("logo"))==null?void 0:E.src,m=window.prompt("Update logo URL",d);if(!m)return;let p=(w=n==null?void 0:n.getAttributes("logo"))==null?void 0:w.size,y=(C=n==null?void 0:n.getAttributes("logo"))==null?void 0:C.alignment,k=n==null?void 0:n.state.selection;n==null||n.commands.setLogoImage({src:m,size:p,alignment:y}),n==null||n.commands.setNodeSelection((k==null?void 0:k.from)||0)},icon:Jt},{name:"image-url",isActive:()=>!1,shouldShow:()=>t==null?void 0:t.isActive("image"),command:()=>{var y;let{editor:n}=e,d=(y=n==null?void 0:n.getAttributes("image"))==null?void 0:y.src,m=window.prompt("Update Image URL",d);if(!m)return;let p=n==null?void 0:n.state.selection;n==null||n.commands.setImage({src:m}),n==null||n.commands.setNodeSelection((p==null?void 0:p.from)||0)},icon:Yt},{name:"image-external-url",isActive:()=>!1,shouldShow:()=>t==null?void 0:t.isActive("image"),command:()=>{var p;let{editor:n}=e,d=(p=n==null?void 0:n.getAttributes("image"))==null?void 0:p.externalLink,m=window.prompt("Update Image External URL",d||"");n==null||n.commands.updateAttributes("image",{externalLink:m||""})},icon:Xt},...a],s=b(c(c({},e),o?{appendTo:o.current}:{}),{shouldShow:({editor:n})=>n.isActive("logo")||n.isActive("image"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return Be(qt,b(c({},s),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:i.filter(n=>{var d;return(d=n.shouldShow)==null?void 0:d.call(n)}).map((n,d)=>Be(x,c({},n),d))}))}import{BubbleMenu as to}from"@tiptap/react";import{mergeAttributes as Qt,Node as Zt}from"@tiptap/core";var ye=["sm","md","lg","xl"],jt="sm";function eo(e){let t={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${t[e]||t[jt]}`}var j=Zt.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:e=>e.getAttribute("data-height"),renderHTML:e=>({"data-height":e.height})}}},addCommands(){return{setSpacer:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{height:e.height}}),setSpacerSize:e=>({commands:t})=>{if(!ye.includes(e))throw new Error("Invalid spacer height");return t.updateAttributes("spacer",{height:e})},unsetSpacer:()=>({commands:e})=>e.deleteNode("spacer")}},renderHTML({HTMLAttributes:e,node:t}){let{height:o}=t.attrs;return e.style=eo(o),["div",Qt({"data-maily-component":this.name},this.options.HTMLAttributes,e,{class:"spacer relative z-50",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});import{jsx as Ie}from"react/jsx-runtime";function ze(e){let{editor:t,appendTo:o}=e,r=ye.map(a=>({name:a,isActive:()=>t==null?void 0:t.isActive("spacer",{height:a}),command:()=>{t==null||t.chain().focus().setSpacer({height:a}).run()}})),l=b(c(c({},e),o?{appendTo:o.current}:{}),{shouldShow:({editor:a})=>a.isActive("spacer"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return Ie(to,b(c({},l),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:r.map((a,i)=>Ie(x,c({},a),i))}))}import Br from"@tiptap/starter-kit";import{Color as Er}from"@tiptap/extension-color";import Ir from"@tiptap/extension-link";import zr from"@tiptap/extension-list-item";import Hr from"@tiptap/extension-paragraph";import Vr from"@tiptap/extension-placeholder";import Or from"@tiptap/extension-text-align";import st from"@tiptap/extension-text-style";import Dr from"@tiptap/extension-heading";import Ur from"@tiptap/extension-underline";import _r from"@tiptap/extension-document";import Fr from"@tiptap/extension-focus";import{InputRule as oo}from"@tiptap/core";import{HorizontalRule as ro}from"@tiptap/extension-horizontal-rule";var ee=ro.extend({addInputRules(){return[new oo({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:e,range:t})=>{let o={},{tr:r}=e,l=t.from,a=t.to;r.insert(l-1,this.type.create(o)).delete(r.mapping.map(l),r.mapping.map(a))}})]}});import{mergeAttributes as go,Node as ho}from"@tiptap/core";import{ReactNodeViewRenderer as fo}from"@tiptap/react";import{NodeViewWrapper as io}from"@tiptap/react";import{AlignCenterIcon as so,AlignLeftIcon as mo,AlignRightIcon as co}from"lucide-react";import{HexAlphaColorPicker as no,HexColorInput as lo}from"react-colorful";import*as Ve from"react";import*as R from"@radix-ui/react-popover";import{jsx as He}from"react/jsx-runtime";var I=R.Root,z=R.Trigger,S=Ve.forwardRef((a,l)=>{var i=a,{className:e,align:t="center",sideOffset:o=4}=i,r=N(i,["className","align","sideOffset"]);return He(R.Portal,{children:He(R.Content,c({ref:l,align:t,sideOffset:o,className:u("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-text-gray-950 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2","mly-editor",e)},r))})});S.displayName=R.Content.displayName;import{jsx as te,jsxs as Oe}from"react/jsx-runtime";function O(e){let{color:t,onColorChange:o,children:r}=e,l=a=>{queueMicrotask(()=>{o(a)})};return Oe(I,{children:[te(z,{asChild:!0,children:r}),te(S,{className:"mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",children:Oe("div",{className:"mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4",children:[te(no,{color:t,onChange:l,className:"mly-flex !mly-w-full mly-flex-col mly-gap-4"}),te(lo,{alpha:!0,color:t,onChange:l,className:"mly-mt-4 mly-w-full mly-min-w-0 mly-rounded-lg mly-border mly-px-2 mly-py-1.5 mly-text-sm mly-uppercase focus-visible:mly-border-gray-400 focus-visible:mly-outline-none",prefixed:!0})]})})]})}import*as De from"react";import{jsx as ao}from"react/jsx-runtime";var A=De.forwardRef((l,r)=>{var a=l,{className:e,type:t}=a,o=N(a,["className","type"]);return ao("input",c({type:t,className:u("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",e),ref:r},o))});A.displayName="Input";import{jsx as g,jsxs as B}from"react/jsx-runtime";var po={left:mo,center:so,right:co},ue={style(e){return _e.map(t=>({name:t,isActive:e.node.attrs.variant===t,onClick:()=>{e.updateAttributes({variant:t})}}))},cornerRadius(e){return Fe.map(t=>({name:t,isActive:e.node.attrs.borderRadius===t,onClick:()=>{e.updateAttributes({borderRadius:t})}}))},alignment(e){return Object.entries(po).map(([t,o])=>({name:t,icon:o,isActive:e.node.attrs.alignment===t,onClick:()=>e.updateAttributes({alignment:t})}))}};function Ue(e){let{url:t,text:o,alignment:r,variant:l,borderRadius:a,buttonColor:i,textColor:s}=e.node.attrs,{getPos:n,editor:d}=e;return g(io,{className:`react-component ${e.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:B(I,{open:e.selected,children:[g(z,{asChild:!0,children:g("div",{children:g("button",{className:u("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":a==="round","!mly-rounded-md":a==="smooth","!mly-rounded-none":a==="sharp"}),tabIndex:-1,style:{backgroundColor:l==="filled"?i:"transparent",color:s,borderWidth:2,borderStyle:"solid",borderColor:i},onClick:m=>{m.preventDefault();let p=n();d.commands.setNodeSelection(p)},children:o})})}),B(S,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:m=>m.preventDefault(),onCloseAutoFocus:m=>m.preventDefault(),children:[g(A,{placeholder:"Add text here",value:o,onChange:m=>{e.updateAttributes({text:m.target.value})}}),g(A,{placeholder:"Add link here",value:t,onChange:m=>{e.updateAttributes({url:m.target.value})}}),B("div",{className:"mly-w-full mly-space-y-2",children:[g("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),g("div",{className:"mly-flex mly-gap-1",children:ue.style(e).map((m,p)=>g(T,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},p))})]}),B("div",{className:"mly-w-full mly-space-y-2",children:[g("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),g("div",{className:"mly-flex mly-gap-1",children:ue.cornerRadius(e).map((m,p)=>g(T,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},p))})]}),B("div",{className:"flex gap-2",children:[B("div",{children:[g("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),g("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:ue.alignment(e).map((m,p)=>g(T,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:m.onClick,type:"button",children:g(m.icon,{size:16})},p))})]}),B("div",{children:[g("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),B("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[g(yo,{variant:l,color:i,onChange:m=>{e.updateAttributes({buttonColor:m})}}),g(uo,{color:s,onChange:m=>{e.updateAttributes({textColor:m})}})]})]})]})]})]})})}function yo(e){let{color:t,onChange:o,variant:r}=e;return g(O,{color:t,onColorChange:o,children:g(T,{variant:"ghost",className:"",size:"sm",type:"button",children:g("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?t:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:t}})})})}function uo(e){let{color:t,onChange:o}=e;return g(O,{color:t,onColorChange:o,children:g(T,{variant:"ghost",size:"sm",type:"button",children:B("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[g("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),g("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:t}})]})})})}var _e=["filled","outline"],Fe=["sharp","smooth","round"],oe=ho.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:e}){return["a",go({"data-maily-component":this.name},e)]},addCommands(){return{setButton:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return fo(Ue)}});import{mergeAttributes as bo,Node as wo}from"@tiptap/core";var ge=wo.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e==null?void 0:e.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:e})=>e.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:e}){return["small",bo(this.options.HTMLAttributes,e,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});import{forwardRef as Ao,useEffect as ko,useImperativeHandle as To,useState as Ke}from"react";import{NodeViewWrapper as No,ReactRenderer as Lo}from"@tiptap/react";import Mo from"tippy.js";import{AlertTriangle as Po}from"lucide-react";import{createContext as xo,useContext as vo}from"react";import{jsx as Co}from"react/jsx-runtime";var We=xo({variables:[],slashCommands:[]});function qe(e){let r=e,{children:t}=r,o=N(r,["children"]);return Co(We.Provider,{value:o,children:t})}function $e(){let e=vo(We);if(!e)throw new Error("Missing MailyContext.Provider in the component tree");return e}import{jsx as M,jsxs as $}from"react/jsx-runtime";var Ge=Ao((e,t)=>{var a,i;let[o,r]=Ke(0),l=s=>{let n=e.items[s];n&&e.command({id:n})};return ko(()=>r(0),[e.items]),To(t,()=>({onKeyDown:({event:s})=>s.key==="ArrowUp"?(r((o+e.items.length-1)%e.items.length),!0):s.key==="ArrowDown"?(r((o+1)%e.items.length),!0):s.key==="Enter"?(l(o),!0):!1})),M("div",{className:"mly-z-50 mly-h-auto mly-min-w-[128px] mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-1 mly-shadow-md mly-transition-all",children:(a=e==null?void 0:e.items)!=null&&a.length?(i=e==null?void 0:e.items)==null?void 0:i.map((s,n)=>M("button",{onClick:()=>l(n),className:u("mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",n===o?"mly-bg-gray-200":"mly-bg-white"),children:s},n)):M("button",{className:"mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-bg-white mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:"No result"})})});Ge.displayName="VariableList";function Xe(e=[]){let t=e.map(o=>o.name);return{items:({query:o})=>t.concat(o.length>0?[o]:[]).filter(r=>r.toLowerCase().startsWith(o.toLowerCase())).slice(0,5),render:()=>{let o,r=null;return{onStart:l=>{o=new Lo(Ge,{props:l,editor:l.editor}),l.clientRect&&(r=Mo("body",{getReferenceClientRect:l.clientRect,appendTo:()=>document.body,content:o.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(l){var a;o.updateProps(l),l.clientRect&&((a=r==null?void 0:r[0])==null||a.setProps({getReferenceClientRect:l.clientRect}))},onKeyDown(l){var a;return l.event.key==="Escape"?(r==null||r[0].hide(),!0):(a=o.ref)==null?void 0:a.onKeyDown(l)},onExit(){!r||!(r!=null&&r[0])||!o||(r==null||r[0].destroy(),o.destroy())}}}}}function Je(e){var m,p;let{node:t,selected:o,updateAttributes:r}=e,{id:l,fallback:a}=t.attrs,{variables:i=[]}=$e(),s=(p=(m=i.find(y=>y.name===l))==null?void 0:m.required)!=null?p:!0,[n,d]=Ke(!1);return M(No,{className:u("react-component",o&&"ProseMirror-selectednode","mly-inline-block mly-leading-none"),draggable:"false",children:$(I,{open:n,onOpenChange:d,children:[M(z,{children:$("span",{tabIndex:-1,className:"mly-inline-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-border-rose-200 mly-bg-rose-50 mly-px-2 mly-py-1 mly-leading-none mly-text-rose-800",children:[l,s&&!a&&M(Po,{className:"mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5]"})]})}),$(S,{align:"start",className:"mly-space-y-2",onOpenAutoFocus:y=>y.preventDefault(),onCloseAutoFocus:y=>y.preventDefault(),children:[$("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[M("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Variable Name"}),M(A,{placeholder:"Add Variable Name",value:l,onChange:y=>{r({id:y.target.value})}})]}),$("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[M("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Fallback Value"}),M(A,{placeholder:"Fallback Value",value:a||"",onChange:y=>{r({fallback:y.target.value})}}),M("p",{className:"mly-text-xs mly-text-gray-500",children:"If the variable doesn't exist, this fallback value will be used."})]})]})]})})}import{useCallback as Ro,useEffect as Ye,useLayoutEffect as So,useRef as Bo,useState as Eo}from"react";import{Extension as Io}from"@tiptap/core";import{ReactRenderer as zo}from"@tiptap/react";import Ho from"@tiptap/suggestion";import{DivideIcon as Vo,EraserIcon as Oo,FootprintsIcon as Do,Heading1 as Uo,Heading2 as _o,Heading3 as Fo,ImageIcon as Qe,List as Wo,ListOrdered as qo,MousePointer as $o,MoveVertical as Ko,Text as Go,TextQuote as Xo,ArrowUpRightSquare as Jo,ColumnsIcon as Yo,SectionIcon as Qo}from"lucide-react";import Zo from"tippy.js";import{jsx as h,jsxs as F}from"react/jsx-runtime";var Ze=Io.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:e,range:t,props:o})=>{o.command({editor:e,range:t})}}}},addProseMirrorPlugins(){return[Ho(c({editor:this.editor},this.options.suggestion))]}}),jo=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:h(Go,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:h(Uo,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:h(_o,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:h(Fo,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:h(Wo,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:h(qo,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleOrderedList().run()}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:h(Qe,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{let o=prompt("Image URL: ")||"";o&&(e.chain().focus().deleteRange(t).run(),e.chain().focus().setImage({src:o}).run())}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:h(Qe,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{let o=prompt("Logo URL: ")||"";o&&(e.chain().focus().deleteRange(t).run(),e.chain().focus().setLogoImage({src:o}).run())}},{title:"Spacer",description:"Add a spacer to email. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:h(Ko,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to email.",searchTerms:["link","button","cta"],icon:h($o,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setButton().run()}},{title:"Link Card",description:"Add a link card to email.",searchTerms:["link","button","image"],icon:h(Jo,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setLinkCard().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:h(Vo,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setHardBreak().run()}},{title:"Blockquote",description:"Add blockquote.",searchTerms:["quote","blockquote"],icon:h(Xo,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBlockquote().run()}},{title:"Footer",description:"Add a footer text to email.",searchTerms:["footer","text"],icon:h(Do,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:h(Oo,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().selectParentNode().deleteSelection().run()}},{title:"Columns",description:"Add columns to email.",searchTerms:["layout","columns"],icon:h(Yo,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setColumns().focus(e.state.selection.head-1).run()}},{title:"Section",description:"Add a section to email.",searchTerms:["layout","section"],icon:h(Qo,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setSection().run()}}],er=(e,t)=>{let o=e.offsetHeight,r=t?t.offsetHeight:0,l=t.offsetTop,a=l+r;l<e.scrollTop?e.scrollTop-=e.scrollTop-l+5:a>o+e.scrollTop&&(e.scrollTop+=a-o-e.scrollTop+5)},tr=({items:e,command:t,editor:o})=>{let[r,l]=Eo(0),a=Ro(s=>{let n=e[s];n&&t(n)},[t,o,e]);Ye(()=>{let s=["ArrowUp","ArrowDown","Enter"],n=d=>{if(s.includes(d.key))return d.preventDefault(),d.key==="ArrowUp"?(l((r+e.length-1)%e.length),!0):d.key==="ArrowDown"?(l((r+1)%e.length),!0):d.key==="Enter"?(a(r),!0):!1};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,r,l,a]),Ye(()=>{l(0)},[e]);let i=Bo(null);return So(()=>{let s=i==null?void 0:i.current,n=s==null?void 0:s.children[r];n&&s&&er(s,n)},[r]),e.length>0?F("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[h("div",{id:"slash-command",ref:i,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:e.map((s,n)=>F("button",{className:u("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",n===r?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>a(n),type:"button",children:[h("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:s.icon}),F("div",{children:[h("p",{className:"mly-font-medium",children:s.title}),h("p",{className:"mly-text-xs mly-text-gray-400",children:s.description})]})]},n))}),h("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:F("div",{className:"mly-flex mly-items-center",children:[F("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[h("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),h("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),h("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),F("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[h("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null};function je(e=[]){return{items:({query:t})=>[...jo,...e].filter(o=>{if(typeof t=="string"&&t.length>0){let r=t.toLowerCase();return o.title.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)||o.searchTerms&&o.searchTerms.some(l=>l.includes(r))}return!0}),render:()=>{let t,o=null;return{onStart:r=>{t=new zo(tr,{props:r,editor:r.editor}),o=Zo("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:r=>{t==null||t.updateProps(r),o&&o[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var l;return r.event.key==="Escape"?(o==null||o[0].hide(),!0):(l=t==null?void 0:t.ref)==null?void 0:l.onKeyDown(r)},onExit:()=>{!o||!(o!=null&&o[0])||!t||(o==null||o[0].destroy(),t==null||t.destroy())}}}}}import{mergeAttributes as or,Node as rr}from"@tiptap/core";import{PluginKey as nr}from"@tiptap/pm/state";import{ReactNodeViewRenderer as lr}from"@tiptap/react";import ar from"@tiptap/suggestion";var ir=new nr("variable"),re=rr.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var o;return`${(o=t.attrs.label)!=null?o:t.attrs.id}`},suggestion:{char:"@",pluginKey:ir,command:({editor:e,range:t,props:o})=>{var a,i;let r=e.view.state.selection.$to.nodeAfter;((a=r==null?void 0:r.text)==null?void 0:a.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:o},{type:"text",text:" "}]).run(),(i=window.getSelection())==null||i.collapseToEnd()},allow:({state:e,range:t})=>{let o=e.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!o.parent.type.contentMatch.matchType(r)}}}},addAttributes(){return{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}:{}},fallback:{default:null,parseHTML:e=>e.getAttribute("data-fallback"),renderHTML:e=>e.fallback?{"data-fallback":e.fallback}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){return["span",or({"data-type":this.name},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 o=!1,{selection:r}=t,{empty:l,anchor:a}=r;return l?(t.doc.nodesBetween(a-1,a,(i,s)=>{if(i.type.name===this.name)return o=!0,e.insertText(this.options.suggestion.char||"",s,s+i.nodeSize),!1}),o):!1})}},addProseMirrorPlugins(){return[ar(c({editor:this.editor},this.options.suggestion))]},addNodeView(){return lr(Je)}});import{NodeViewWrapper as cr,ReactNodeViewRenderer as pr}from"@tiptap/react";import{useRef as yr,useState as ur}from"react";import gr from"@tiptap/extension-image";import{useCallback as sr,useLayoutEffect as mr,useRef as dr}from"react";var et=e=>{let t=dr(null);return mr(()=>{t.current=e},[e]),sr((...o)=>{if(t.current===null)throw new Error("Handler is not assigned");return t.current(...o)},[])};import{Fragment as wr,jsx as he,jsxs as tt}from"react/jsx-runtime";var hr=20,fr=600;function br(e){let{node:t,updateAttributes:o,selected:r}=e,l=yr(null),[a,i]=ur(),s=et(w=>{let C=document.querySelector(".ProseMirror-selectednode");if(!l.current||!C||!r)return;let L=Math.max(C.offsetWidth,fr);w.preventDefault();let U=w.currentTarget.dataset.direction||"--",ie=w.clientX,J=l.current.width,ve=l.current.height,_=J,se=ve,Ct=U[1]==="w"?-1:1,me=()=>{window.removeEventListener("mousemove",Ce),window.removeEventListener("mouseup",me),o({width:_,height:se}),i(void 0)},Ce=Ae=>{if(_=Math.max(J+Ct*(Ae.clientX-ie),hr),_>L&&(_=L),se=_/J*ve,i({width:_,height:se}),!Ae.buttons)return me()};window.addEventListener("mousemove",Ce),window.addEventListener("mouseup",me)});function n(w){return he("div",{role:"button",tabIndex:0,onMouseDown:s,"data-direction":w,className:"mly-bg-rose-500",style:b(c(c({position:"absolute",height:"10px",width:"10px"},{n:{top:0},s:{bottom:0}}[w[0]]),{w:{left:0},e:{right:0}}[w[1]]),{cursor:`${w}-resize`})})}let{alignment:d="center",width:m,height:p}=t.attrs||{},E=t.attrs||{},{externalLink:y}=E,k=N(E,["externalLink"]);return tt(cr,{as:"div",draggable:!0,"data-drag-handle":!0,style:c(b(c({width:m,height:p},a),{overflow:"hidden",position:"relative",lineHeight:"0px",display:"block"}),{center:{marginLeft:"auto",marginRight:"auto"},left:{marginRight:"auto"},right:{marginLeft:"auto"}}[d]||{}),children:[he("img",b(c({},k),{ref:l,style:b(c({},a),{cursor:"default",marginBottom:0})})),r&&tt(wr,{children:[[{left:0,top:0,height:"100%",width:"1px"},{right:0,top:0,height:"100%",width:"1px"},{top:0,left:0,width:"100%",height:"1px"},{bottom:0,left:0,width:"100%",height:"1px"}].map((w,C)=>he("div",{className:"mly-bg-rose-500",style:c({position:"absolute"},w)},C)),n("nw"),n("ne"),n("sw"),n("se")]})]})}var ne=gr.extend({addAttributes(){var e;return b(c({},(e=this.parent)==null?void 0:e.call(this)),{width:{renderHTML:({width:t})=>({width:t})},height:{renderHTML:({height:t})=>({height:t})},alignment:{default:"center",renderHTML:({alignment:t})=>({"data-alignment":t}),parseHTML:t=>t.getAttribute("data-alignment")||"center"},externalLink:{default:null,renderHTML:({externalLink:t})=>t?{"data-external-link":t}:{},parseHTML:t=>{let o=t.getAttribute("data-external-link");return o?{externalLink:o}:null}}})},addNodeView(){return pr(br)}});import{mergeAttributes as Cr,Node as Ar}from"@tiptap/core";import{ReactNodeViewRenderer as kr}from"@tiptap/react";import{NodeViewWrapper as vr}from"@tiptap/react";import*as ot from"react";import{jsx as xr}from"react/jsx-runtime";var fe=ot.forwardRef((r,o)=>{var l=r,{className:e}=l,t=N(l,["className"]);return xr("textarea",c({className:u("mly-flex mly-min-h-24 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",e),ref:o},t))});fe.displayName="Textarea";import{jsx as f,jsxs as v}from"react/jsx-runtime";function rt(e){let{title:t,description:o,link:r,linkTitle:l,image:a,badgeText:i,subTitle:s}=e.node.attrs,{getPos:n,editor:d}=e;return f(vr,{className:`react-component ${e.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",children:v(I,{open:e.selected,children:[f(z,{asChild:!0,children:f("div",{tabIndex:-1,onClick:m=>{m.preventDefault();let p=n();d.commands.setNodeSelection(p)},children:v("div",{className:"mly-no-prose mly-flex mly-flex-col mly-rounded-lg mly-border mly-border-gray-300",children:[a&&f("div",{className:"mly-relative mly-mb-1.5 mly-w-full mly-shrink-0",children:f("img",{src:a,alt:"link-card",className:"mly-no-prose !mly-mb-0 mly-h-full mly-w-full mly-rounded-t-lg"})}),f("div",{className:"mly-flex mly-items-stretch mly-p-3",children:v("div",{className:u("mly-flex mly-flex-col"),children:[v("div",{className:"!mly-mb-1.5 mly-flex mly-items-center mly-gap-1.5",children:[f("h2",{className:"!mly-mb-0 !mly-text-lg mly-font-semibold",children:t}),i&&f("span",{className:"!mly-font-base text-xs mly-rounded-md mly-bg-yellow-200 mly-px-2 mly-py-1 mly-font-semibold mly-leading-none",children:i})," ",s&&!i&&f("span",{className:"!mly-font-base text-xs mly-font-regular mly-rounded-md mly-leading-none mly-text-gray-400",children:s})]}),v("p",{className:"!mly-my-0 !mly-text-base mly-text-gray-500",children:[o," ",l?f("a",{href:r,className:"mly-font-semibold",children:l}):null]})]})})]})})}),v(S,{align:"end",className:"mly-flex mly-w-96 mly-flex-col mly-gap-2",sideOffset:10,onOpenAutoFocus:m=>m.preventDefault(),onCloseAutoFocus:m=>m.preventDefault(),children:[v("label",{className:"mly-w-full mly-space-y-1",children:[f("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Image"}),f(A,{placeholder:"Add Image",type:"url",value:a,onChange:m=>{e.updateAttributes({image:m.target.value})}})]}),v("label",{className:"mly-w-full mly-space-y-1",children:[f("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Title"}),f(A,{placeholder:"Add title",value:t,onChange:m=>{e.updateAttributes({title:m.target.value})}})]}),v("label",{className:"mly-w-full mly-space-y-1",children:[f("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Description"}),f(fe,{placeholder:"Add description here",value:o,onChange:m=>{e.updateAttributes({description:m.target.value})}})]}),v("div",{className:"mly-grid mly-grid-cols-2 mly-gap-2",children:[v("label",{className:"mly-w-full mly-space-y-1",children:[f("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Link Title"}),f(A,{placeholder:"Add link title here",value:l,onChange:m=>{e.updateAttributes({linkTitle:m.target.value})}})]}),v("label",{className:"mly-w-full mly-space-y-1",children:[f("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Link"}),f(A,{placeholder:"Add link here",value:r,onChange:m=>{e.updateAttributes({link:m.target.value})}})]})]}),v("div",{className:"mly-grid mly-grid-cols-2 mly-gap-2",children:[v("label",{className:"mly-w-full mly-space-y-1",children:[f("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Badge Text"}),f(A,{placeholder:"Add badge text here",value:i,onChange:m=>{e.updateAttributes({badgeText:m.target.value})}})]}),v("label",{className:"mly-w-full mly-space-y-1",children:[f("span",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Sub Title"}),f(A,{placeholder:"Add sub title here",value:s,onChange:m=>{e.updateAttributes({subTitle:m.target.value})}})]})]})]})]})})}var le=Ar.create({name:"linkCard",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"linkCard"},title:{default:""},description:{default:""},link:{default:""},linkTitle:{default:""},image:{default:""},subTitle:{default:""},badgeText:{default:""}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:e}){return["div",Cr({"data-maily-component":this.name},e)]},addCommands(){return{setLinkCard:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return kr(rt)}});function W(e,t){return({commands:o})=>o.command(({tr:r,state:l,dispatch:a})=>{if(a){let i=null;if(r.selection.ranges.forEach(s=>{l.doc.nodesBetween(s.$from.pos,s.$to.pos,(n,d)=>{n.type.name===e&&(i=d)})}),i!==null){let s=l.doc.nodeAt(i);if(s)r.setNodeMarkup(i,null,c(c({},s.attrs),t));else for(let[n,d]of Object.entries(t))r.setNodeAttribute(i,n,d)}}return!0})}import{mergeAttributes as Tr}from"@tiptap/core";import{Node as Nr}from"@tiptap/core";var Lr="100%",nt="center";var lt=Nr.create({name:"columns",group:"columns",content:"column column",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"two-column"},width:{default:Lr,parseHTML:e=>e.style.width,renderHTML:e=>e.width?{style:`width: ${e.width}`}:{}},align:{default:nt,parseHTML:e=>e.getAttribute("align")||nt,renderHTML:e=>e.align?{align:e.align}:{}}}},addCommands(){return{setColumns:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{layout:"two-column"},content:[{type:"column",attrs:{position:"left"},content:[{type:"paragraph"}]},{type:"column",attrs:{position:"right"},content:[{type:"paragraph"}]}]}),setLayout:e=>({commands:t})=>t.updateAttributes("columns",{layout:e}),updateColumns:e=>W(this.name,e)}},renderHTML({HTMLAttributes:e}){return["table",Tr(e,{"data-type":"columns",class:`layout-${e.layout}`}),["tbody",{},["tr",{},0]]]},parseHTML(){return[{tag:'table[data-type="columns"]'}]}});import{Node as Mr,mergeAttributes as Pr}from"@tiptap/core";var at=Mr.create({name:"column",content:"(block|columns)+",isolating:!0,addAttributes(){return{position:{default:"",parseHTML:e=>e.getAttribute("data-position"),renderHTML:e=>({"data-position":e.position})},verticalAlign:{default:"top",parseHTML:e=>{var t;return((t=e==null?void 0:e.style)==null?void 0:t.verticalAlign)||"top"},renderHTML:e=>e!=null&&e.verticalAlign?{style:`vertical-align: ${(e==null?void 0:e.verticalAlign)||"top"}`}:{}}}},addCommands(){return{updateColumn:e=>W(this.name,e)}},renderHTML({HTMLAttributes:e}){return["td",Pr(e,{"data-type":"column",width:"50%"}),0]},parseHTML(){return[{tag:'td[data-type="column"]'}]}});import{mergeAttributes as Rr,Node as Sr}from"@tiptap/core";var be="#ffffff",it=Sr.create({name:"section",group:"block",content:"(block|columns)+",defining:!0,isolating:!0,addAttributes(){return{borderRadius:{default:0,parseHTML:e=>{var t,o;return Number((o=(t=e==null?void 0:e.style)==null?void 0:t.borderRadius)==null?void 0:o.replace(/['"]+/g,""))},renderHTML:e=>e.borderRadius?{style:`border-radius: ${e.borderRadius}px`}:{}},padding:{default:0,parseHTML:e=>{var t,o;return Number((o=(t=e==null?void 0:e.style)==null?void 0:t.padding)==null?void 0:o.replace(/['"]+/g,""))},renderHTML:e=>e.padding?{style:`padding: ${e.padding}px`}:{}},backgroundColor:{default:be,parseHTML:e=>e.style.backgroundColor,renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}},addCommands(){return{setSection:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{type:this.name},content:[{type:"paragraph"}]}),updateSection:e=>W(this.name,e)}},renderHTML({HTMLAttributes:e}){return["table",{"data-type":this.name},["tbody",{},["tr",{},["td",Rr(e,{"data-type":"section-cell"}),0]]]]},parseHTML(){return[{tag:'table[data-type="section"]'}]}});function mt(e){let{variables:t,slashCommands:o}=e;return[_r.extend({content:"(block|columns)+"}),lt,at,Br.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},code:{HTMLAttributes:{class:"mly-px-1 mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"}},horizontalRule:!1,blockquote:{HTMLAttributes:{class:"mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4"}},document:!1}),Ur,Z,Er.configure({types:[st.name,zr.name]}),st.configure(),Or.configure({types:[Hr.name,Dr.name,ge.name]}),ee,Vr.configure({placeholder:({node:r})=>r.type.name==="heading"?`Heading ${r.attrs.level}`:r.type.name==="columns"||r.type.name==="column"||r.type.name==="section"?"":"Write something or / to see commands",includeChildren:!0}),j,ge,re.configure({suggestion:Xe(t)}),Ze.configure({suggestion:je(o)}),Ir.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),oe,ne,le,Fr,it]}import{BubbleMenu as Xr}from"@tiptap/react";import{useCallback as Jr}from"react";function ae(e,t){let{view:o,state:{selection:{from:r}}}=e,l=document.querySelectorAll(".has-focus"),a=l.length,s=l[a-1];if(s&&s.getAttribute("data-type")&&s.getAttribute("data-type")===t||s&&s.classList&&s.classList.contains(t))return s;let n=o.domAtPos(r).node,d=n;for(d.tagName||(d=n.parentElement);d&&!(d.getAttribute("data-type")&&d.getAttribute("data-type")===t)&&!d.classList.contains(t);)d=d.parentElement;return d}import{sticky as Yr}from"tippy.js";import{useEditorState as Wr}from"@tiptap/react";import qr from"fast-deep-equal";var dt=e=>Wr({editor:e,selector:o=>{var r,l,a;return{currentBorderRadius:Number((r=o.editor.getAttributes("section"))==null?void 0:r.borderRadius)||0,currentPadding:Number((l=o.editor.getAttributes("section"))==null?void 0:l.padding)||0,currentBackgroundColor:((a=o.editor.getAttributes("section"))==null?void 0:a.backgroundColor)||be}},equalityFn:qr});import{jsx as ct,jsxs as $r}from"react/jsx-runtime";function we(e){let{value:t,onValueChange:o,icon:r}=e;return $r("label",{className:"mly-relative mly-flex mly-items-center mly-justify-center",children:[r?ct(r,{size:14,className:"mly-absolute mly-left-1.5"}):null,ct("input",{type:"number",value:t,onChange:l=>o(Number(l.target.value)),className:u("hide-number-controls focus-visible:outline-none mly-h-auto mly-max-w-12 mly-border-0 mly-border-none mly-p-1 mly-text-sm mly-tabular-nums mly-outline-none",r?"mly-pl-[26px]":""),min:0})]})}import{Box as Qr,Scan as Zr}from"lucide-react";import{isTextSelection as Kr}from"@tiptap/core";function q(e){let{state:{doc:t,selection:o,selection:{empty:r,from:l,to:a}}}=e,i=!t.textBetween(l,a).length&&Kr(o);return!(r||i||!e.isEditable)}import{jsx as Gr}from"react/jsx-runtime";function K(e){let{type:t="vertical",className:o}=e;return Gr("div",{className:u("mly-mx-0.5 mly-bg-gray-200",t==="vertical"?"mly-w-px":"mly-h-px",o)})}import{jsx as D,jsxs as jr}from"react/jsx-runtime";function pt(e){let{appendTo:t,editor:o}=e;if(!o)return null;let r=Jr(()=>{let i=ae(o,"section");return(i==null?void 0:i.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},[o]),l=b(c(c({},e),t?{appendTo:t.current}:{}),{shouldShow:({editor:i})=>q(i)?!1:i.isActive("section")&&!i.isActive("columns")&&!i.isActive("column"),tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,appendTo:()=>t==null?void 0:t.current,plugins:[Yr],sticky:"popper"},pluginKey:"sectionBubbleMenu"}),a=dt(o);return jr(Xr,b(c({},l),{className:"mly-flex mly-items-stretch mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:[D(we,{icon:Zr,value:a.currentBorderRadius,onValueChange:i=>{var s;(s=o==null?void 0:o.commands)==null||s.updateSection({borderRadius:i})}}),D(K,{}),D(we,{icon:Qr,value:a.currentPadding,onValueChange:i=>{var s;(s=o==null?void 0:o.commands)==null||s.updateSection({padding:i})}}),D(K,{}),D(O,{color:a.currentBackgroundColor,onColorChange:i=>{var s;(s=o==null?void 0:o.commands)==null||s.updateSection({backgroundColor:i})},children:D(T,{variant:"ghost",className:"!mly-size-7 mly-shrink-0",size:"sm",type:"button",children:D("div",{className:"mly-h-4 mly-w-4 mly-shrink-0 mly-rounded mly-border mly-border-gray-700",style:{backgroundColor:a.currentBackgroundColor}})})})]}))}import{BubbleMenu as nn}from"@tiptap/react";import{AlignCenterIcon as ln,AlignLeftIcon as an,AlignRightIcon as sn,BoldIcon as mn,CodeIcon as dn,ItalicIcon as cn,LinkIcon as pn,StrikethroughIcon as yn,UnderlineIcon as un}from"lucide-react";import{useEditorState as en}from"@tiptap/react";import tn from"fast-deep-equal";var on="#374151",yt=e=>en({editor:e,selector:o=>({currentTextColor:o.editor.getAttributes("textStyle").color||on}),equalityFn:tn});import rn from"@tiptap/extension-image";var ut=(e,t)=>[ee.name,rn.name,j.name,ne.name,re.name,oe.name,le.name,Z.name].some(r=>e.isActive(r));import{jsx as G,jsxs as gt}from"react/jsx-runtime";function ht(e){let{editor:t,appendTo:o}=e;if(!t)return null;let r=[an,ln,sn],l=Q.map((n,d)=>({name:n,isActive:()=>t==null?void 0:t.isActive({textAlign:n}),command:()=>{var m,p,y,k;(m=e==null?void 0:e.editor)!=null&&m.isActive({textAlign:n})?(y=(p=e==null?void 0:e.editor)==null?void 0:p.chain())==null||y.focus().unsetTextAlign().run():(k=e==null?void 0:e.editor)==null||k.chain().focus().setTextAlign(n).run()},icon:r[d]})),a=[{name:"bold",isActive:()=>t==null?void 0:t.isActive("bold"),command:()=>t==null?void 0:t.chain().focus().toggleBold().run(),icon:mn},{name:"italic",isActive:()=>t==null?void 0:t.isActive("italic"),command:()=>t==null?void 0:t.chain().focus().toggleItalic().run(),icon:cn},{name:"underline",isActive:()=>t==null?void 0:t.isActive("underline"),command:()=>t==null?void 0:t.chain().focus().toggleUnderline().run(),icon:un},{name:"strike",isActive:()=>t==null?void 0:t.isActive("strike"),command:()=>t==null?void 0:t.chain().focus().toggleStrike().run(),icon:yn},...l,{name:"code",isActive:()=>t==null?void 0:t.isActive("code"),command:()=>t==null?void 0:t.chain().focus().toggleCode().run(),icon:dn},{name:"link",command:()=>{let n=t==null?void 0:t.getAttributes("link").href,d=window.prompt("URL",n);if(d!==null){if(d===""){t==null||t.chain().focus().extendMarkRange("link").unsetLink().run();return}t==null||t.chain().focus().extendMarkRange("link").setLink({href:d}).run()}},isActive:()=>t==null?void 0:t.isActive("link"),icon:pn}],i=b(c(c({},e),o?{appendTo:o.current}:{}),{pluginKey:"textMenu",shouldShow:({editor:n,state:d,from:m,to:p,view:y})=>{if(!y||n.view.dragging)return!1;let k=y.domAtPos(m||0).node,w=y.nodeDOM(m||0)||k;return ut(n,w)?!1:q(n)},tippyOptions:{popperOptions:{placement:"top-start",modifiers:[{name:"preventOverflow",options:{boundary:"viewport",padding:8}},{name:"flip",options:{fallbackPlacements:["bottom-start","top-end","bottom-end"]}}]},maxWidth:"100%"}}),s=yt(t);return gt(nn,b(c({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:[a.map((n,d)=>G(x,c({},n),d)),G(O,{color:s.currentTextColor,onColorChange:n=>{t==null||t.chain().setColor(n).run()},children:G(T,{variant:"ghost",size:"sm",type:"button",children:gt("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[G("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),G("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:s.currentTextColor}})]})})})]}))}import{useRef as Mn}from"react";import{BubbleMenu as fn}from"@tiptap/react";import{useCallback as bn}from"react";import{sticky as wn}from"tippy.js";import{useEditorState as gn}from"@tiptap/react";import hn from"fast-deep-equal";var ft=e=>gn({editor:e,selector:o=>{var r,l,a,i,s,n,d,m;return{width:((r=o.editor.getAttributes("columns"))==null?void 0:r.width)||"100%",isAlignLeft:((l=o.editor.getAttributes("columns"))==null?void 0:l.align)==="left",isAlignCenter:((a=o.editor.getAttributes("columns"))==null?void 0:a.align)==="center",isAlignRight:((i=o.editor.getAttributes("columns"))==null?void 0:i.align)==="right",currentVerticalAlignment:((s=o.editor.getAttributes("column"))==null?void 0:s.verticalAlign)||"top",isVerticalAlignTop:((n=o.editor.getAttributes("column"))==null?void 0:n.verticalAlign)==="top",isVerticalAlignMiddle:((d=o.editor.getAttributes("column"))==null?void 0:d.verticalAlign)==="middle",isVerticalAlignBottom:((m=o.editor.getAttributes("column"))==null?void 0:m.verticalAlign)==="bottom",isColumnActive:o.editor.isActive("column")}},equalityFn:hn});import{jsx as xe,jsxs as bt}from"react/jsx-runtime";function wt(e){let{selectedValue:t,onValueChange:o}=e;return bt("label",{className:"mly-relative mly-flex mly-items-center",children:[xe("span",{className:"mly-absolute mly-inset-y-0 mly-left-2 mly-flex mly-items-center mly-text-xs mly-leading-none mly-text-gray-400",children:"W"}),bt("select",{className:"mly-h-auto mly-max-w-24 mly-appearance-none mly-border-0 mly-border-none mly-p-1 mly-pl-[26px] mly-text-sm mly-uppercase mly-tabular-nums mly-outline-none focus-visible:mly-outline-none",value:t,onChange:r=>o(r.target.value),children:[xe("option",{value:"auto",children:"auto"}),xe("option",{value:"100%",children:"100%"})]})]})}import{AlignCenter as xn,AlignLeft as vn,AlignRight as Cn,AlignVerticalDistributeCenter as An,AlignVerticalDistributeEnd as kn,AlignVerticalDistributeStart as Tn}from"lucide-react";import{jsx as P,jsxs as X}from"react/jsx-runtime";function xt(e){let{appendTo:t,editor:o}=e;if(!o)return null;let r=bn(()=>{let i=ae(o,"columns");return(i==null?void 0:i.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},[o]),l=b(c(c({},e),t?{appendTo:t.current}:{}),{shouldShow:({editor:i})=>q(i)?!1:i.isActive("columns"),tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,appendTo:()=>t==null?void 0:t.current,plugins:[wn],sticky:"popper"},pluginKey:"columnsBubbleMenu"}),a=ft(o);return X(fn,b(c({},l),{className:"mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-shadow-md",children:[a.isColumnActive&&X("div",{className:"mly-border-b mly-p-1 mly-pt-2",children:[P("span",{className:"mly-ml-1 mly-block mly-text-[10px] mly-uppercase mly-leading-none mly-text-gray-500",children:"Column"}),X("div",{className:"mly-mt-2 mly-flex mly-items-stretch",children:[P(x,{name:"Vertical Align Top",icon:Tn,command:()=>{o.commands.updateColumn({verticalAlign:"top"})},isActive:()=>a.isVerticalAlignTop,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3"}),P(x,{name:"Vertical Align Middle",icon:An,command:()=>{o.commands.updateColumn({verticalAlign:"middle"})},isActive:()=>a.isVerticalAlignMiddle,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3"}),P(x,{name:"Vertical Align Bottom",icon:kn,command:()=>{o.commands.updateColumn({verticalAlign:"bottom"})},isActive:()=>a.isVerticalAlignBottom,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3"})]})]}),X("div",{className:"mly-p-1 mly-pt-2",children:[P("span",{className:"mly-ml-1 mly-block mly-text-[10px] mly-uppercase mly-leading-none mly-text-gray-500",children:"Table"}),X("div",{className:"mly-mt-2 mly-flex mly-items-stretch",children:[P(wt,{selectedValue:a.width,onValueChange:i=>{o.commands.updateColumns({width:i})}}),P(K,{}),P(x,{name:"Align Left",isActive:()=>a.isAlignLeft,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3",icon:vn,command:()=>o.commands.updateColumns({align:"left"})}),P(x,{name:"Align Center",isActive:()=>a.isAlignCenter,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3",icon:xn,command:()=>o.commands.updateColumns({align:"center"})}),P(x,{name:"Align Right",isActive:()=>a.isAlignRight,className:"!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",iconClassName:"mly-w-3 mly-h-3",icon:Cn,command:()=>o.commands.updateColumns({align:"right"})})]})]})]}))}import{jsx as H,jsxs as vt}from"react/jsx-runtime";function Sm(e){let{config:{wrapClassName:t="",contentClassName:o="",bodyClassName:r="",hasMenuBar:l=!0,spellCheck:a=!1,autofocus:i="end",immediatelyRender:s=!1}={},onCreate:n,onUpdate:d,extensions:m,contentHtml:p,contentJson:y,variables:k,slashCommands:E}=e,w=null;y?w=(y==null?void 0:y.type)==="doc"?y:{type:"doc",content:y}:p?w=p:w={type:"doc",content:[{type:"paragraph",content:[]}]};let C=Mn(null),L=Ln({editorProps:{attributes:{class:u("mly-prose mly-w-full",o),spellCheck:a?"true":"false"},handleDOMEvents:{keydown:(U,ie)=>{if(["ArrowUp","ArrowDown","Enter"].includes(ie.key)&&document.querySelector("#slash-command"))return!0}}},immediatelyRender:s,onCreate:({editor:U})=>{n==null||n(U)},onUpdate:({editor:U})=>{d==null||d(U)},extensions:[...mt({variables:k,slashCommands:E}),...m||[]],content:w,autofocus:i});return L?H(qe,{variables:k,children:vt("div",{className:u("mly-editor mly-antialiased",t),ref:C,children:[l&&H(Pe,{config:e.config,editor:L}),vt("div",{className:u("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[H(ht,{editor:L,appendTo:C}),H(Ee,{editor:L,appendTo:C}),H(ze,{editor:L,appendTo:C}),H(Nn,{editor:L}),H(pt,{editor:L,appendTo:C}),H(xt,{editor:L,appendTo:C})]})]})}):null}export{Sm as Editor};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maily-to/core",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Powerful editor for creating beautiful, pre-designed, mobile-ready emails.",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
@@ -44,40 +44,46 @@
44
44
  "node": ">=18.0.0"
45
45
  },
46
46
  "dependencies": {
47
- "@radix-ui/react-popover": "^1.0.7",
48
- "@radix-ui/react-slot": "^1.0.2",
49
- "@tiptap/core": "^2.4.0",
50
- "@tiptap/extension-color": "^2.4.0",
51
- "@tiptap/extension-heading": "^2.4.0",
52
- "@tiptap/extension-horizontal-rule": "^2.4.0",
53
- "@tiptap/extension-image": "^2.4.0",
54
- "@tiptap/extension-link": "^2.4.0",
55
- "@tiptap/extension-list-item": "^2.4.0",
56
- "@tiptap/extension-mention": "^2.4.0",
57
- "@tiptap/extension-paragraph": "^2.4.0",
58
- "@tiptap/extension-placeholder": "^2.4.0",
59
- "@tiptap/extension-text-align": "^2.4.0",
60
- "@tiptap/extension-text-style": "^2.4.0",
61
- "@tiptap/extension-underline": "^2.4.0",
62
- "@tiptap/pm": "^2.4.0",
63
- "@tiptap/react": "^2.4.0",
64
- "@tiptap/starter-kit": "^2.4.0",
65
- "@tiptap/suggestion": "^2.4.0",
47
+ "@radix-ui/react-popover": "^1.1.1",
48
+ "@radix-ui/react-slot": "^1.1.0",
49
+ "@tiptap/core": "^2.6.6",
50
+ "@tiptap/extension-color": "^2.6.6",
51
+ "@tiptap/extension-document": "^2.6.6",
52
+ "@tiptap/extension-focus": "^2.6.6",
53
+ "@tiptap/extension-heading": "^2.6.6",
54
+ "@tiptap/extension-horizontal-rule": "^2.6.6",
55
+ "@tiptap/extension-image": "^2.6.6",
56
+ "@tiptap/extension-link": "^2.6.6",
57
+ "@tiptap/extension-list-item": "^2.6.6",
58
+ "@tiptap/extension-mention": "^2.6.6",
59
+ "@tiptap/extension-paragraph": "^2.6.6",
60
+ "@tiptap/extension-placeholder": "^2.6.6",
61
+ "@tiptap/extension-text-align": "^2.6.6",
62
+ "@tiptap/extension-text-style": "^2.6.6",
63
+ "@tiptap/extension-underline": "^2.6.6",
64
+ "@tiptap/pm": "^2.6.6",
65
+ "@tiptap/react": "^2.6.6",
66
+ "@tiptap/starter-kit": "^2.6.6",
67
+ "@tiptap/suggestion": "^2.6.6",
66
68
  "clsx": "^2.1.1",
67
- "lucide-react": "^0.395.0",
69
+ "fast-deep-equal": "^3.1.3",
70
+ "lucide-react": "^0.439.0",
68
71
  "react-colorful": "^5.6.1",
69
- "tailwind-merge": "^2.3.0",
70
- "tailwindcss": "^3.4.4",
71
- "tippy.js": "^6.3.7"
72
+ "tailwind-merge": "^2.5.2",
73
+ "tailwindcss": "^3.4.10",
74
+ "tippy.js": "^6.3.7",
75
+ "uuid": "^10.0.0"
72
76
  },
73
77
  "devDependencies": {
74
- "postcss": "^8.4.38",
78
+ "@types/react": "^18.3.5",
79
+ "@types/uuid": "^10.0.0",
80
+ "postcss": "^8.4.45",
75
81
  "tailwind-config": "workspace:*",
76
82
  "tsconfig": "workspace:*",
77
- "typescript": "^5.4.5"
83
+ "typescript": "^5.5.4"
78
84
  },
79
85
  "peerDependencies": {
80
- "react": "18.3.1"
86
+ "react": "^18.3.1"
81
87
  },
82
88
  "publishConfig": {
83
89
  "access": "public"