markdown-text-editor 1.8.0 → 2.0.0-beta.0

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.
@@ -1,12 +1,11 @@
1
- (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){.markdown-editor-wrapper *,.markdown-editor-wrapper :before,.markdown-editor-wrapper :after,.markdown-editor-wrapper ::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-content:""}}}:root,:host{--fj-spacing:.25rem;--fj-container-sm:24rem;--fj-text-xs:.75rem;--fj-text-xs--line-height:calc(1 / .75);--fj-font-weight-medium:500;--fj-font-weight-bold:700}.fj\\:me-modal{color:inherit;--radius-modal:calc(var(--border-radius) * 4);z-index:999;overscroll-behavior:contain;pointer-events:none;visibility:hidden;width:100%;max-width:none;height:100%;max-height:none;transition:visibility .2s ease allow-discrete, overlay .2s ease allow-discrete;background-color:#0000;border:none;place-items:center;margin:0;padding:.75rem;display:grid;position:fixed;inset:0;overflow:hidden}.fj\\:me-modal::backdrop{background-color:#000}@supports (color:color-mix(in lab, red, red)){.fj\\:me-modal::backdrop{background-color:var(--lightningcss-light,color-mix(in oklch, black 10%, var(--color-base-600) 40%))var(--lightningcss-dark,color-mix(in oklch, black 10%, var(--color-base-400) 40%))}}.fj\\:me-modal::backdrop{opacity:0;transition:opacity .2s ease-out}.fj\\:me-modal[open]{pointer-events:auto;visibility:visible}.fj\\:me-modal[open]::backdrop{opacity:1}@starting-style{.fj\\:me-modal[open]::backdrop{opacity:0}}.fj\\:me-modal[open]{--modal-content--translate:0 0;--modal-content--scale:1;--modal-content--opacity:1}.fj\\:me-btn{font:inherit;appearance:none;--radius-btn:calc(var(--border-radius) * 2);--color-btn:var(--color-base-soft);--color-on-btn:var(--color-on-base);--color-btn-active:var(--color-base-active);--btn-variant-text:var(--color-on-base);background-color:var(--color-btn);color:var(--color-on-btn,color-contrast(var(--color-btn) vs white, black));--btn--opacity:1;--btn--cursor:pointer;--btn--pointer-events:auto;--btn--border-width:0;--btn--border-style:solid;--btn--border-color:transparent;border-width:var(--btn--border-width);border-style:var(--btn--border-style);border-color:var(--btn--border-color)}.fj\\:me-btn:is(:disabled,[disabled]){--btn--opacity:.5;--btn--cursor:not-allowed;--btn--pointer-events:none}.fj\\:me-btn{opacity:var(--btn--opacity);cursor:pointer;pointer-events:var(--btn--pointer-events);-webkit-user-select:none;user-select:none;text-wrap:nowrap;text-decoration:none}@media (hover:hover){.fj\\:me-btn:hover{background-color:var(--color-btn-active);color:var(--color-on-btn);transition-duration:.22s}}.fj\\:me-btn{border-radius:var(--btn--radius,var(--radius-btn));display:var(--btn--display,inline-flex);padding-inline:var(--btn--shape-padding-inline,var(--btn--padding-inline,1.125rem));padding-block:var(--btn--shape-padding-block,var(--btn--padding-block,.625rem));font-size:var(--btn--font-size,1rem);line-height:calc(var(--btn--font-size,1rem) * var(--btn--line-height,1.5));width:var(--btn--width);max-width:var(--btn--max-width);vertical-align:middle;text-align:center;box-sizing:border-box;flex-wrap:nowrap;flex-shrink:0;justify-content:center;align-items:center;gap:.375rem;font-weight:500;transition:background-color .18s cubic-bezier(.4,0,.2,1),color .18s cubic-bezier(.4,0,.2,1),border-color .18s cubic-bezier(.4,0,.2,1),opacity .2s;position:relative}.fj\\:me-btn:is(input[type=checkbox],input[type=radio]){appearance:none}.fj\\:me-btn:is(input[type=checkbox],input[type=radio]):after{content:attr(aria-label)}.fj\\:me-btn:is(input[type=checkbox],input[type=radio]):checked{isolation:isolate;background-color:var(--color-btn-active)}.fj\\:me-btn:focus-visible{outline-width:2px;outline-style:solid;outline-color:var(--lightningcss-light,var(--color-base-950,currentColor))var(--lightningcss-dark,var(--color-base-50,currentColor));outline-offset:3px;isolation:isolate}.fj\\:me-input{font:inherit;--radius-input:calc(var(--border-radius) * 2);--color-input:var(--color-base-soft);--color-on-input:var(--color-on-base-soft);--color-input-soft:var(--color-base-soft);--color-input-active:var(--color-base-active);--color-on-input-active:var(--color-on-base);--input--inline:.75rem;--input--block:.625rem;--input--font-size:1rem;border-style:solid;border-width:1px;border-color:var(--color-input-active);background-color:#0000}.fj\\:me-input:not([type=file]){padding-inline:var(--input--inline);padding-block:var(--input--block)}.fj\\:me-input{font-size:var(--input--font-size);color:var(--color-on-base);appearance:none;border-radius:var(--radius-input);vertical-align:middle;white-space:nowrap;flex-shrink:0;align-self:flex-start;align-items:center;gap:.5rem;font-weight:500;transition:border-color .25s ease-in-out;display:inline-flex;position:relative}.fj\\:me-input::-moz-placeholder{font-size:var(--input--font-size);color:var(--input-disabled--color)}@supports (color:color-mix(in lab, red, red)){.fj\\:me-input::-moz-placeholder{color:color-mix(in oklab, var(--color-on-base) 30%, transparent)}}.fj\\:me-input::-moz-placeholder{font-weight:400}.fj\\:me-input::placeholder{font-size:var(--input--font-size);color:var(--input-disabled--color)}@supports (color:color-mix(in lab, red, red)){.fj\\:me-input::placeholder{color:color-mix(in oklab, var(--color-on-base) 30%, transparent)}}.fj\\:me-input::placeholder{font-weight:400}.fj\\:me-input::file-selector-button{font-size:var(--input--font-size);padding-inline:var(--input--inline);padding-block:var(--input--block);background-color:var(--color-input);border-inline-end-width:1px;border-style:solid;border-color:var(--color-input-active);font-weight:semibold;color:var(--color-on-input);border-start-start-radius:calc(var(--radius-input) / 2);border-end-start-radius:calc(var(--radius-input) / 2);align-items:center;margin-inline-end:1rem;transition:border-color .3s ease-in-out,background-color .3s ease-in-out,display .3s ease-in-out;display:inline-flex}@media (hover:hover){.fj\\:me-input::file-selector-button:hover{background-color:var(--color-input-active);color:var(--color-on-input-active)}}.fj\\:me-input:is(:disabled,[disabled],.fj\\:me-input-disabled){--input-disabled--cursor:not-allowed;--input-disabled--opacity:.6;--input-disabled--pointer-events:none;--input-disabled--user-select:none;--input-disabled--bg-color:var(--color-base-soft);--input-disabled--color:var(--lightningcss-light,var(--color-base-700))var(--lightningcss-dark,var(--color-base-400));--input-disabled--border-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.fj\\:me-input:is(:disabled,[disabled],.fj\\:me-input-disabled){--input-disabled--border-color:color-mix(in oklab, var(--input) 20%, transparent)}}.fj\\:me-input:is(:disabled,[disabled],.fj\\:me-input-disabled){cursor:var(--input-disabled--cursor);opacity:var(--input-disabled--opacity);pointer-events:var(--input-disabled--pointer-events);background-color:var(--input-disabled--bg-color);color:var(--input-disabled--color);-webkit-user-select:var(--input-disabled--user-select);-moz-user-select:var(--input-disabled--user-select);user-select:var(--input-disabled--user-select);border-color:var(--input-disabled--border-color)}.fj\\:me-input:focus,.fj\\:me-input:focus-within{border-color:var(--lightningcss-light,var(--color-base-800))var(--lightningcss-dark,var(--color-base-300))}@supports (color:color-mix(in lab, red, red)){.fj\\:me-input:focus,.fj\\:me-input:focus-within{border-color:var(--lightningcss-light,var(--color-base-800))var(--lightningcss-dark,color-mix(in oklab, var(--color-base-300) 80%, transparent))}}.fj\\:pointer-events-none{pointer-events:none}.fj\\:me-popover-content{inset:unset;color:inherit;border-radius:var(--radius-popover);visibility:var(--popover-hover--visibility,hidden);opacity:var(--popover-hover--opacity,0);z-index:100;position-anchor:var(--popover--anchor-name);position-area:var(--popover--position-area,block-end span-inline-end);position-try-fallbacks:var(--popover--position-try,none);background-color:var(--color-popover);outline-width:1px;outline-style:solid;outline-color:var(--color-popover-border);transition-behavior:allow-discrete;width:max-content;max-width:min(20rem,90vw);transition-property:opacity,visibility,transform;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-delay:var(--popover-hover--transition-delay,revert);border:none;margin:0;margin-block-start:var(--popover-placement--mt,0);margin-block-end:var(--popover-placement--mb,0);margin-inline-start:var(--popover-placement--ms,0);margin-inline-end:var(--popover-placement--me,0);padding:.6rem;position:fixed}.fj\\:me-popover-content:hover{--popover-hover--visibility:visible;--popover-hover--opacity:1}.fj\\:me-popover-content[popover]:popover-open{visibility:visible;opacity:1}@starting-style{.fj\\:me-popover-content[popover]:popover-open{visibility:hidden;opacity:0}}.fj\\:me-menu{--color-menu:var(--color-base-soft);--color-on-menu:var(--color-on-base-soft);--color-menu-active:var(--color-base-active);--radius-menu:calc(var(--border-radius) * 4);border-radius:var(--radius-menu);color:currentColor;flex-flow:column wrap;width:fit-content;margin:0;padding:0;font-size:.875rem;list-style:none;display:flex}.fj\\:me-menu :where(ul,li:not(:first-child)){margin-block-start:.375rem}.fj\\:me-menu :where(li ul){white-space:nowrap;color:currentColor;padding:0;margin-block:0;margin-inline-start:.1rem;padding-inline-start:1.4rem;font-size:.875rem;list-style:none;position:relative}.fj\\:me-menu :where(li ul):before{content:"";background-color:var(--color-on-menu);opacity:.1;width:1px;position:absolute;inset-block:.7rem 0;inset-inline-start:.7rem}.fj\\:me-menu :where(summary){margin-block:.375rem;margin-inline:.75rem}.fj\\:me-popover{--radius-popover:calc(var(--border-radius) * 2);--color-popover:var(--color-base);--color-popover-border:var(--color-base-soft);--popover--anchor-name:--popover-anchor;--popover--position-try:flip-block, flip-inline, flip-block flip-inline;anchor-scope:all;display:inline-block;position:relative}.fj\\:absolute{position:absolute}.fj\\:relative{position:relative}.fj\\:sticky{position:sticky}.fj\\:inset-0{inset:0}.fj\\:top-1{top:var(--fj-spacing)}.fj\\:-right-2{right:calc(var(--fj-spacing) * -2)}.fj\\:right-1{right:var(--fj-spacing)}.fj\\:z-0{z-index:0}.fj\\:z-10{z-index:10}.fj\\:z-20{z-index:20}.fj\\:me-modal-content{translate:var(--modal-content--translate,var(--modal-slide--translate,none));scale:var(--modal-content--scale,var(--modal-slide--scale,95%));opacity:var(--modal-content--opacity,0);overscroll-behavior:contain;background-color:var(--color-base);border-radius:var(--radius-modal);border:1px solid var(--color-base-soft);width:91.6667%;max-width:32rem;max-height:100vh;box-shadow:0 4px 6px -1px var(--lightningcss-light,var(--color-base-950))var(--lightningcss-dark,#00000073), 0 10px 32px -4px var(--lightningcss-light,var(--color-base-950))var(--lightningcss-dark,#0000008c);grid-row-start:1;grid-column-start:1;padding:1.5rem;overflow-y:auto}@supports (color:color-mix(in lab, red, red)){.fj\\:me-modal-content{box-shadow:0 4px 6px -1px var(--lightningcss-light,color-mix(in oklch, var(--color-base-950) 12%, transparent))var(--lightningcss-dark,oklch(0% none none/.45)), 0 10px 32px -4px var(--lightningcss-light,color-mix(in oklch, var(--color-base-950) 10%, transparent))var(--lightningcss-dark,oklch(0% none none/.55))}}.fj\\:me-modal-content{transition:translate .2s ease-out,scale .2s ease-out,opacity .2s ease-out,box-shadow .2s ease-out}@media (forced-colors:active){.fj\\:me-modal-content{outline:1px solid}}.fj\\:me-divider{--divider--margin:1rem 0;--color-divider:var(--color-base-soft);--divider-direction:right;--divider--flex-direction:row;--divider--width:100%;--divider--height:1px;--divider-dash-length:10px;--divider-gap-length:0px;flex-direction:var(--divider--flex-direction);width:var(--divider--width);height:var(--divider--height);justify-content:center;align-items:center;display:flex}.fj\\:me-divider:not(:empty){-moz-column-gap:.5rem;text-wrap:nowrap;column-gap:.5rem}.fj\\:me-divider:before,.fj\\:me-divider:after{content:"";margin:var(--divider--margin);width:var(--divider--width);height:var(--divider--height);background:repeating-linear-gradient(to var(--divider-direction), var(--color-divider) 0px, var(--color-divider) var(--divider-dash-length), transparent var(--divider-dash-length), transparent calc(var(--divider-dash-length) + var(--divider-gap-length)))}.fj\\:m-0{margin:0}.fj\\:my-1{margin-block:var(--fj-spacing)}.fj\\:mte-prose{color:var(--tw-prose-body);max-width:65ch}.fj\\:mte-prose :where(p):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.fj\\:mte-prose :where([class~=lead]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-lead);margin-top:1.2em;margin-bottom:1.2em;font-size:1.25em;line-height:1.6}.fj\\:mte-prose :where(a):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-links);font-weight:500;text-decoration:underline}.fj\\:mte-prose :where(strong):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-bold);font-weight:600}.fj\\:mte-prose :where(a strong):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose :where(blockquote strong):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose :where(thead th strong):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:inherit}.fj\\:mte-prose :where(ol):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:decimal}.fj\\:mte-prose :where(ol[type=A]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){list-style-type:upper-alpha}.fj\\:mte-prose :where(ol[type=a]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){list-style-type:lower-alpha}.fj\\:mte-prose :where(ol[type=A s]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){list-style-type:upper-alpha}.fj\\:mte-prose :where(ol[type=a s]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){list-style-type:lower-alpha}.fj\\:mte-prose :where(ol[type=I]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){list-style-type:upper-roman}.fj\\:mte-prose :where(ol[type=i]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){list-style-type:lower-roman}.fj\\:mte-prose :where(ol[type=I s]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){list-style-type:upper-roman}.fj\\:mte-prose :where(ol[type=i s]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){list-style-type:lower-roman}.fj\\:mte-prose :where(ol[type="1"]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){list-style-type:decimal}.fj\\:mte-prose :where(ul):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:disc}.fj\\:mte-prose :where(ol>li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *))::marker{color:var(--tw-prose-counters);font-weight:400}.fj\\:mte-prose :where(ul>li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *))::marker{color:var(--tw-prose-bullets)}.fj\\:mte-prose :where(dt):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-headings);margin-top:1.25em;font-weight:600}.fj\\:mte-prose :where(hr):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.fj\\:mte-prose :where(blockquote):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;font-style:italic;font-weight:500}.fj\\:mte-prose :where(blockquote p:first-of-type):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)):before{content:open-quote}.fj\\:mte-prose :where(blockquote p:last-of-type):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)):after{content:close-quote}.fj\\:mte-prose :where(h1):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-headings);margin-top:0;margin-bottom:.888889em;font-size:2.25em;font-weight:800;line-height:1.11111}.fj\\:mte-prose :where(h1 strong):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:inherit;font-weight:900}.fj\\:mte-prose :where(h2):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-headings);margin-top:2em;margin-bottom:1em;font-size:1.5em;font-weight:700;line-height:1.33333}.fj\\:mte-prose :where(h2 strong):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:inherit;font-weight:800}.fj\\:mte-prose :where(h3):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-headings);margin-top:1.6em;margin-bottom:.6em;font-size:1.25em;font-weight:600;line-height:1.6}.fj\\:mte-prose :where(h3 strong):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:inherit;font-weight:700}.fj\\:mte-prose :where(h4):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-headings);margin-top:1.5em;margin-bottom:.5em;font-weight:600;line-height:1.5}.fj\\:mte-prose :where(h4 strong):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:inherit;font-weight:700}.fj\\:mte-prose :where(img):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:2em;margin-bottom:2em}.fj\\:mte-prose :where(picture):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:2em;margin-bottom:2em;display:block}.fj\\:mte-prose :where(video):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:2em;margin-bottom:2em}.fj\\:mte-prose :where(kbd):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows), 0 3px 0 var(--tw-prose-kbd-shadows);padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;border-radius:.3125rem;padding-inline-start:.375em;font-family:inherit;font-size:.875em;font-weight:500}.fj\\:mte-prose :where(code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-code);font-size:.875em;font-weight:600}.fj\\:mte-prose :where(code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)):before,.fj\\:mte-prose :where(code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)):after{content:"\`"}.fj\\:mte-prose :where(a code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose :where(h1 code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:inherit}.fj\\:mte-prose :where(h2 code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:inherit;font-size:.875em}.fj\\:mte-prose :where(h3 code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:inherit;font-size:.9em}.fj\\:mte-prose :where(h4 code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose :where(blockquote code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose :where(thead th code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:inherit}.fj\\:mte-prose :where(pre):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);padding-top:.857143em;padding-inline-end:1.14286em;padding-bottom:.857143em;border-radius:.375rem;margin-top:1.71429em;margin-bottom:1.71429em;padding-inline-start:1.14286em;font-size:.875em;font-weight:400;line-height:1.71429;overflow-x:auto}.fj\\:mte-prose :where(pre code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;background-color:#0000;border-width:0;border-radius:0;padding:0}.fj\\:mte-prose :where(pre code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)):before,.fj\\:mte-prose :where(pre code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)):after{content:none}.fj\\:mte-prose :where(table):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){table-layout:auto;width:100%;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.71429}.fj\\:mte-prose :where(thead):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.fj\\:mte-prose :where(thead th):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-headings);vertical-align:bottom;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em;font-weight:600}.fj\\:mte-prose :where(tbody tr):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.fj\\:mte-prose :where(tbody tr:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){border-bottom-width:0}.fj\\:mte-prose :where(tbody td):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){vertical-align:baseline}.fj\\:mte-prose :where(tfoot):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.fj\\:mte-prose :where(tfoot td):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){vertical-align:top}.fj\\:mte-prose :where(th,td):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){text-align:start}.fj\\:mte-prose :where(figure>*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0;margin-bottom:0}.fj\\:mte-prose :where(figcaption):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){color:var(--tw-prose-captions);margin-top:.857143em;font-size:.875em;line-height:1.42857}.fj\\:mte-prose{--tw-prose-body:oklch(37.3% .034 259.733);--tw-prose-headings:oklch(21% .034 264.665);--tw-prose-lead:oklch(44.6% .03 256.802);--tw-prose-links:oklch(21% .034 264.665);--tw-prose-bold:oklch(21% .034 264.665);--tw-prose-counters:oklch(55.1% .027 264.364);--tw-prose-bullets:oklch(87.2% .01 258.338);--tw-prose-hr:oklch(92.8% .006 264.531);--tw-prose-quotes:oklch(21% .034 264.665);--tw-prose-quote-borders:oklch(92.8% .006 264.531);--tw-prose-captions:oklch(55.1% .027 264.364);--tw-prose-kbd:oklch(21% .034 264.665);--tw-prose-kbd-shadows:oklab(21% -.00316127 -.0338527/.1);--tw-prose-code:oklch(21% .034 264.665);--tw-prose-pre-code:oklch(92.8% .006 264.531);--tw-prose-pre-bg:oklch(27.8% .033 256.848);--tw-prose-th-borders:oklch(87.2% .01 258.338);--tw-prose-td-borders:oklch(92.8% .006 264.531);--tw-prose-invert-body:oklch(87.2% .01 258.338);--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:oklch(70.7% .022 261.325);--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:oklch(70.7% .022 261.325);--tw-prose-invert-bullets:oklch(44.6% .03 256.802);--tw-prose-invert-hr:oklch(37.3% .034 259.733);--tw-prose-invert-quotes:oklch(96.7% .003 264.542);--tw-prose-invert-quote-borders:oklch(37.3% .034 259.733);--tw-prose-invert-captions:oklch(70.7% .022 261.325);--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:#ffffff1a;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:oklch(87.2% .01 258.338);--tw-prose-invert-pre-bg:#00000080;--tw-prose-invert-th-borders:oklch(44.6% .03 256.802);--tw-prose-invert-td-borders:oklch(37.3% .034 259.733);font-size:1rem;line-height:1.75}.fj\\:mte-prose :where(picture>img):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0;margin-bottom:0}.fj\\:mte-prose :where(li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.5em;margin-bottom:.5em}.fj\\:mte-prose :where(ol>li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose :where(ul>li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-start:.375em}.fj\\:mte-prose :where(.fj\\:mte-prose>ul>li p):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.75em;margin-bottom:.75em}.fj\\:mte-prose :where(.fj\\:mte-prose>ul>li>p:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em}.fj\\:mte-prose :where(.fj\\:mte-prose>ul>li>p:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-bottom:1.25em}.fj\\:mte-prose :where(.fj\\:mte-prose>ol>li>p:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em}.fj\\:mte-prose :where(.fj\\:mte-prose>ol>li>p:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-bottom:1.25em}.fj\\:mte-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.75em;margin-bottom:.75em}.fj\\:mte-prose :where(dl):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.fj\\:mte-prose :where(dd):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.fj\\:mte-prose :where(hr+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose :where(h2+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose :where(h3+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose :where(h4+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0}.fj\\:mte-prose :where(thead th:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-start:0}.fj\\:mte-prose :where(thead th:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-end:0}.fj\\:mte-prose :where(tbody td,tfoot td):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-top:.571429em;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em}.fj\\:mte-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-start:0}.fj\\:mte-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-end:0}.fj\\:mte-prose :where(figure):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:2em;margin-bottom:2em}.fj\\:mte-prose :where(.fj\\:mte-prose>:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0}.fj\\:mte-prose :where(.fj\\:mte-prose>:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-bottom:0}.fj\\:mte-prose-sm{font-size:.875rem;line-height:1.71429}.fj\\:mte-prose-sm :where(p):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em}.fj\\:mte-prose-sm :where([class~=lead]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.888889em;margin-bottom:.888889em;font-size:1.28571em;line-height:1.55556}.fj\\:mte-prose-sm :where(blockquote):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.33333em;margin-bottom:1.33333em;padding-inline-start:1.11111em}.fj\\:mte-prose-sm :where(h1):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0;margin-bottom:.8em;font-size:2.14286em;line-height:1.2}.fj\\:mte-prose-sm :where(h2):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.6em;margin-bottom:.8em;font-size:1.42857em;line-height:1.4}.fj\\:mte-prose-sm :where(h3):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.55556em;margin-bottom:.444444em;font-size:1.28571em;line-height:1.55556}.fj\\:mte-prose-sm :where(h4):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.42857em;margin-bottom:.571429em;line-height:1.42857}.fj\\:mte-prose-sm :where(img):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose-sm :where(picture):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.fj\\:mte-prose-sm :where(picture>img):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0;margin-bottom:0}.fj\\:mte-prose-sm :where(video):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.fj\\:mte-prose-sm :where(kbd):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-top:.142857em;padding-inline-end:.357143em;padding-bottom:.142857em;border-radius:.3125rem;padding-inline-start:.357143em;font-size:.857143em}.fj\\:mte-prose-sm :where(code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){font-size:.857143em}.fj\\:mte-prose-sm :where(h2 code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){font-size:.9em}.fj\\:mte-prose-sm :where(h3 code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){font-size:.888889em}.fj\\:mte-prose-sm :where(pre):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-top:.666667em;padding-inline-end:1em;padding-bottom:.666667em;border-radius:.25rem;margin-top:1.66667em;margin-bottom:1.66667em;padding-inline-start:1em;font-size:.857143em;line-height:1.66667}.fj\\:mte-prose-sm :where(ol):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose-sm :where(ul):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em;padding-inline-start:1.57143em}.fj\\:mte-prose-sm :where(li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.285714em;margin-bottom:.285714em}.fj\\:mte-prose-sm :where(ol>li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose-sm :where(ul>li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-start:.428571em}.fj\\:mte-prose-sm :where(.fj\\:mte-prose-sm>ul>li p):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.571429em;margin-bottom:.571429em}.fj\\:mte-prose-sm :where(.fj\\:mte-prose-sm>ul>li>p:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.14286em}.fj\\:mte-prose-sm :where(.fj\\:mte-prose-sm>ul>li>p:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-bottom:1.14286em}.fj\\:mte-prose-sm :where(.fj\\:mte-prose-sm>ol>li>p:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.14286em}.fj\\:mte-prose-sm :where(.fj\\:mte-prose-sm>ol>li>p:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-bottom:1.14286em}.fj\\:mte-prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.571429em;margin-bottom:.571429em}.fj\\:mte-prose-sm :where(dl):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em}.fj\\:mte-prose-sm :where(dt):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.14286em}.fj\\:mte-prose-sm :where(dd):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.285714em;padding-inline-start:1.57143em}.fj\\:mte-prose-sm :where(hr):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:2.85714em;margin-bottom:2.85714em}.fj\\:mte-prose-sm :where(hr+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose-sm :where(h2+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose-sm :where(h3+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:mte-prose-sm :where(h4+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0}.fj\\:mte-prose-sm :where(table):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){font-size:.857143em;line-height:1.5}.fj\\:mte-prose-sm :where(thead th):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-end:1em;padding-bottom:.666667em;padding-inline-start:1em}.fj\\:mte-prose-sm :where(thead th:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-start:0}.fj\\:mte-prose-sm :where(thead th:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-end:0}.fj\\:mte-prose-sm :where(tbody td,tfoot td):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-top:.666667em;padding-inline-end:1em;padding-bottom:.666667em;padding-inline-start:1em}.fj\\:mte-prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-start:0}.fj\\:mte-prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-end:0}.fj\\:mte-prose-sm :where(figure):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.fj\\:mte-prose-sm :where(figure>*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0;margin-bottom:0}.fj\\:mte-prose-sm :where(figcaption):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.666667em;font-size:.857143em;line-height:1.33333}.fj\\:mte-prose-sm :where(.fj\\:mte-prose-sm>:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0}.fj\\:mte-prose-sm :where(.fj\\:mte-prose-sm>:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-bottom:0}.fj\\:mt-4{margin-top:calc(var(--fj-spacing) * 4)}.fj\\:box-border{box-sizing:border-box}.fj\\:me-menu-item{font:inherit;color:currentColor;border-radius:calc(var(--radius-menu) / 2);text-align:start;text-wrap:balance;-webkit-user-select:none;user-select:none;appearance:none;cursor:pointer;width:100%;padding-block:.375rem;padding-inline:.75rem;background:0 0;border:none;grid-auto-columns:minmax(auto,max-content) auto max-content;grid-auto-flow:column;align-content:flex-start;align-items:center;gap:.5rem;padding-inline-end:var(--menu-horizontal--padding-inline-end,.75rem);font-size:.875rem;text-decoration:none;transition-property:color,background-color,box-shadow;transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);display:grid}@media (hover:hover){.fj\\:me-menu-item:hover{background-color:var(--color-menu);color:var(--color-on-menu)}}.fj\\:me-menu-item:focus-within{background-color:var(--color-menu);color:var(--color-on-menu);cursor:pointer;outline-style:none}@media (forced-colors:active){.fj\\:me-menu-item:focus-within{outline-offset:2px;outline:2px solid #0000}}.fj\\:me-menu-item :where(a,button):focus-visible{outline:2px solid #0000}@media (forced-colors:active){.fj\\:me-menu-item :where(a,button):focus-visible{outline-offset:2px;outline:2px solid #0000}}.fj\\:flex{display:flex}.fj\\:grid{display:grid}.fj\\:hidden{display:none}.fj\\:me-btn-circle{--btn--radius:9999px;--btn--shape-padding-inline:var(--btn-circle--padding-block,.625rem);--btn--shape-padding-block:var(--btn-circle--padding-block,.625rem);aspect-ratio:1}.fj\\:me-btn-square{--btn--shape-padding-inline:var(--btn-square--padding-block,.625rem);--btn--shape-padding-block:var(--btn-square--padding-block,.625rem);aspect-ratio:1}.fj\\:h-full{height:100%}.fj\\:h-full\\!{height:100%!important}.fj\\:min-h-0{min-height:0}.fj\\:w-36{width:calc(var(--fj-spacing) * 36)}.fj\\:w-full{width:100%}.fj\\:max-w-full{max-width:100%}.fj\\:max-w-sm{max-width:var(--fj-container-sm)}.fj\\:min-w-\\[3\\.5rem\\]{min-width:3.5rem}.fj\\:flex-1{flex:1}.fj\\:resize-none{resize:none}.fj\\:appearance-none{appearance:none}.fj\\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.fj\\:flex-col{flex-direction:column}.fj\\:items-center{align-items:center}.fj\\:me-modal-top{align-items:start}.fj\\:justify-between{justify-content:space-between}.fj\\:justify-center{justify-content:center}.fj\\:me-modal-center{justify-items:center}.fj\\:gap-1{gap:var(--fj-spacing)}.fj\\:gap-3{gap:calc(var(--fj-spacing) * 3)}.fj\\:gap-x-1{column-gap:var(--fj-spacing)}.fj\\:gap-y-4{row-gap:calc(var(--fj-spacing) * 4)}.fj\\:gap-y-4\\.5{row-gap:calc(var(--fj-spacing) * 4.5)}.fj\\:self-end{align-self:flex-end}.fj\\:overflow-hidden{overflow:hidden}.fj\\:overflow-x-auto{overflow-x:auto}.fj\\:overflow-y-auto{overflow-y:auto}.fj\\:me-surface-rounded{border-radius:calc(var(--border-radius) * 2)}.fj\\:me-surface-outline{border-style:solid;border-width:1px;border-color:var(--color-base-soft);background-color:#0000}.fj\\:border-0{border-style:var(--tw-border-style);border-width:0}.fj\\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.fj\\:border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.fj\\:border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.fj\\:border-base-soft{border-color:var(--color-base-soft)}.fj\\:me-surface{--surface--bg-color:var(--color-base);--surface--color:var(--color-on-base);background-color:var(--surface--bg-color);color:var(--surface--color);padding:var(--surface--padding)}.fj\\:me-btn-ghost{color:var(--btn-variant-text);--btn--border-width:0;background-color:#0000}.fj\\:bg-transparent{background-color:#0000}.fj\\:p-1\\.5{padding:calc(var(--fj-spacing) * 1.5)}.fj\\:p-2{padding:calc(var(--fj-spacing) * 2)}.fj\\:me-menu-title{color:var(--color-base-700);padding-inline:.75rem;padding-block:var(--menu-title--padding-block,.375rem);font-size:.875rem;font-weight:600}.fj\\:px-1\\.5{padding-inline:calc(var(--fj-spacing) * 1.5)}.fj\\:px-3{padding-inline:calc(var(--fj-spacing) * 3)}.fj\\:px-4{padding-inline:calc(var(--fj-spacing) * 4)}.fj\\:py-1{padding-block:var(--fj-spacing)}.fj\\:py-2{padding-block:calc(var(--fj-spacing) * 2)}.fj\\:text-center{text-align:center}.fj\\:me-heading-lg{--heading-size:1.125rem;color:var(--color-on-base);text-wrap-style:balance;font-weight:700;font-size:var(--heading-size);line-height:1.15}.fj\\:me-heading-md{color:var(--color-on-base);text-wrap-style:balance;font-weight:700;font-size:var(--heading-size);--heading-size:1rem;line-height:1.15}.fj\\:me-heading-sm{--heading-size:.875rem;color:var(--color-on-base);text-wrap-style:balance;font-weight:700;font-size:var(--heading-size);line-height:1.15}.fj\\:me-heading-xl{--heading-size:1.25rem;color:var(--color-on-base);text-wrap-style:balance;font-weight:700;font-size:var(--heading-size);line-height:1.15}.fj\\:me-heading-xs{--heading-size:.75rem;color:var(--color-on-base);text-wrap-style:balance;font-weight:700;font-size:var(--heading-size);line-height:1.15}.fj\\:text-xs{font-size:var(--fj-text-xs);line-height:var(--tw-leading,var(--fj-text-xs--line-height))}.fj\\:font-bold{--tw-font-weight:var(--fj-font-weight-bold);font-weight:var(--fj-font-weight-bold)}.fj\\:font-medium{--tw-font-weight:var(--fj-font-weight-medium);font-weight:var(--fj-font-weight-medium)}.fj\\:wrap-break-word{overflow-wrap:break-word}.fj\\:whitespace-nowrap{white-space:nowrap}.fj\\:whitespace-pre-wrap{white-space:pre-wrap}.fj\\:text-accent{color:var(--lightningcss-light,var(--color-accent-700))var(--lightningcss-dark,var(--color-accent-300))}.fj\\:text-primary{color:var(--lightningcss-light,var(--color-primary-700))var(--lightningcss-dark,var(--color-primary-300))}.fj\\:text-secondary{color:var(--lightningcss-light,var(--color-secondary-700))var(--lightningcss-dark,var(--color-secondary-300))}.fj\\:text-transparent{color:#0000}.fj\\:line-through{text-decoration-line:line-through}.fj\\:underline{text-decoration-line:underline}.fj\\:caret-primary{caret-color:var(--color-primary-500)}.fj\\:opacity-25{opacity:.25}.fj\\:opacity-30{opacity:.3}.fj\\:opacity-40{opacity:.4}.fj\\:opacity-50{opacity:.5}.fj\\:opacity-60{opacity:.6}.fj\\:opacity-70{opacity:.7}.fj\\:shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.fj\\:outline-0{outline-style:var(--tw-outline-style);outline-width:0}.fj\\:me-prose-frutjam{--tw-prose-body:var(--color-body);--tw-prose-headings:var(--color-on-base);--tw-prose-lead:var(--color-on-neutral);--tw-prose-bold:var(--color-on-base);--tw-prose-links:var(--color-primary);--tw-prose-counters:var(--color-neutral);--tw-prose-bullets:var(--color-neutral);--tw-prose-hr:var(--color-base-soft);--tw-prose-quotes:var(--color-on-base);--tw-prose-quote-borders:var(--color-primary);--tw-prose-code:var(--color-on-base);--tw-prose-pre-code:var(--color-on-base);--tw-prose-pre-bg:var(--color-base-soft);--tw-prose-th-borders:var(--color-base-soft);--tw-prose-td-borders:var(--color-base-soft);--tw-prose-captions:var(--color-on-neutral);--tw-prose-kbd:var(--color-body);--tw-prose-invert-body:var(--color-on-neutral);--tw-prose-invert-headings:var(--color-on-base);--tw-prose-invert-links:var(--color-primary)}.fj\\:me-btn-sm{--btn--padding-inline:1rem;--btn--padding-block:.5rem;--btn--font-size:.875rem;--btn--line-height:1.4;--btn-square--padding-block:.5rem;--btn-circle--padding-block:.5rem}.fj\\:me-btn-xs{--btn--padding-inline:.875rem;--btn--padding-block:.375rem;--btn--font-size:.75rem;--btn--line-height:1.3;--btn-square--padding-block:.375rem;--btn-circle--padding-block:.375rem}.fj\\:me-input-xs{--input--inline:.475rem;--input--block:.375rem;--input--font-size:.75rem;--input--square-size:2rem}.fj\\:outline-none{--tw-outline-style:none;outline-style:none}.fj\\:select-none{-webkit-user-select:none;user-select:none}.fj\\:me-btn-active{--color-btn:var(--color-btn-active)}.fj\\:me-popover-toggle{anchor-name:var(--popover--anchor-name)}.fj\\:empty\\:after\\:absolute:empty:after{content:var(--tw-content);position:absolute}.fj\\:empty\\:after\\:inset-0:empty:after{content:var(--tw-content);inset:0}.fj\\:empty\\:after\\:px-4:empty:after{content:var(--tw-content);padding-inline:calc(var(--fj-spacing) * 4)}.fj\\:empty\\:after\\:py-2:empty:after{content:var(--tw-content);padding-block:calc(var(--fj-spacing) * 2)}.fj\\:empty\\:after\\:text-\\[CanvasText\\]:empty:after{content:var(--tw-content);color:canvastext}.fj\\:empty\\:after\\:opacity-50:empty:after{content:var(--tw-content);opacity:.5}.fj\\:empty\\:after\\:content-\\[attr\\(data-placeholder\\)\\]:empty:after{--tw-content:attr(data-placeholder);content:var(--tw-content)}.fj\\:focus\\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.fj\\:focus\\:outline-0:focus{outline-style:var(--tw-outline-style);outline-width:0}@media (width>=48rem){.fj\\:md\\:pointer-events-auto{pointer-events:auto}.fj\\:md\\:mte-prose-base{font-size:1rem;line-height:1.75}.fj\\:md\\:mte-prose-base :where(p):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.fj\\:md\\:mte-prose-base :where([class~=lead]):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.2em;margin-bottom:1.2em;font-size:1.25em;line-height:1.6}.fj\\:md\\:mte-prose-base :where(blockquote):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.fj\\:md\\:mte-prose-base :where(h1):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0;margin-bottom:.888889em;font-size:2.25em;line-height:1.11111}.fj\\:md\\:mte-prose-base :where(h2):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:2em;margin-bottom:1em;font-size:1.5em;line-height:1.33333}.fj\\:md\\:mte-prose-base :where(h3):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.6em;margin-bottom:.6em;font-size:1.25em;line-height:1.6}.fj\\:md\\:mte-prose-base :where(h4):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.fj\\:md\\:mte-prose-base :where(img):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:md\\:mte-prose-base :where(picture):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:2em;margin-bottom:2em}.fj\\:md\\:mte-prose-base :where(picture>img):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0;margin-bottom:0}.fj\\:md\\:mte-prose-base :where(video):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:2em;margin-bottom:2em}.fj\\:md\\:mte-prose-base :where(kbd):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;border-radius:.3125rem;padding-inline-start:.375em;font-size:.875em}.fj\\:md\\:mte-prose-base :where(code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:md\\:mte-prose-base :where(h2 code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){font-size:.875em}.fj\\:md\\:mte-prose-base :where(h3 code):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){font-size:.9em}.fj\\:md\\:mte-prose-base :where(pre):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-top:.857143em;padding-inline-end:1.14286em;padding-bottom:.857143em;border-radius:.375rem;margin-top:1.71429em;margin-bottom:1.71429em;padding-inline-start:1.14286em;font-size:.875em;line-height:1.71429}.fj\\:md\\:mte-prose-base :where(ol):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:md\\:mte-prose-base :where(ul):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.fj\\:md\\:mte-prose-base :where(li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.5em;margin-bottom:.5em}.fj\\:md\\:mte-prose-base :where(ol>li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:md\\:mte-prose-base :where(ul>li):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-start:.375em}.fj\\:md\\:mte-prose-base :where(.fj\\:mte-prose-base>ul>li p):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.75em;margin-bottom:.75em}.fj\\:md\\:mte-prose-base :where(.fj\\:mte-prose-base>ul>li>p:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em}.fj\\:md\\:mte-prose-base :where(.fj\\:mte-prose-base>ul>li>p:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-bottom:1.25em}.fj\\:md\\:mte-prose-base :where(.fj\\:mte-prose-base>ol>li>p:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em}.fj\\:md\\:mte-prose-base :where(.fj\\:mte-prose-base>ol>li>p:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-bottom:1.25em}.fj\\:md\\:mte-prose-base :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.75em;margin-bottom:.75em}.fj\\:md\\:mte-prose-base :where(dl):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.fj\\:md\\:mte-prose-base :where(dt):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:1.25em}.fj\\:md\\:mte-prose-base :where(dd):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.fj\\:md\\:mte-prose-base :where(hr):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:3em;margin-bottom:3em}.fj\\:md\\:mte-prose-base :where(hr+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:md\\:mte-prose-base :where(h2+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:md\\:mte-prose-base :where(h3+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)),.fj\\:md\\:mte-prose-base :where(h4+*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0}.fj\\:md\\:mte-prose-base :where(table):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){font-size:.875em;line-height:1.71429}.fj\\:md\\:mte-prose-base :where(thead th):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em}.fj\\:md\\:mte-prose-base :where(thead th:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-start:0}.fj\\:md\\:mte-prose-base :where(thead th:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-end:0}.fj\\:md\\:mte-prose-base :where(tbody td,tfoot td):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-top:.571429em;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em}.fj\\:md\\:mte-prose-base :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-start:0}.fj\\:md\\:mte-prose-base :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){padding-inline-end:0}.fj\\:md\\:mte-prose-base :where(figure):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:2em;margin-bottom:2em}.fj\\:md\\:mte-prose-base :where(figure>*):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0;margin-bottom:0}.fj\\:md\\:mte-prose-base :where(figcaption):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:.857143em;font-size:.875em;line-height:1.42857}.fj\\:md\\:mte-prose-base :where(.fj\\:mte-prose-base>:first-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-top:0}.fj\\:md\\:mte-prose-base :where(.fj\\:mte-prose-base>:last-child):not(:where([class~=not-mte-prose],[class~=not-mte-prose] *)){margin-bottom:0}.fj\\:md\\:grid{display:grid}.fj\\:md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.fj\\:md\\:opacity-100{opacity:1}}@media (width>=64rem){.fj\\:lg\\:me-modal-middle{align-items:center}}.markdown-editor-wrapper{--lightningcss-light:initial;--lightningcss-dark: ;resize:vertical}@media (prefers-color-scheme:dark){.markdown-editor-wrapper{--lightningcss-light: ;--lightningcss-dark:initial}}.markdown-editor-wrapper[data-theme=dark],[data-theme=dark] .markdown-editor-wrapper,.markdown-editor-wrapper[data-theme=darkberry],[data-theme=darkberry] .markdown-editor-wrapper{--lightningcss-light: ;--lightningcss-dark:initial}.markdown-editor-wrapper[data-theme=light],[data-theme=light] .markdown-editor-wrapper,.markdown-editor-wrapper[data-theme=snowberry],[data-theme=snowberry] .markdown-editor-wrapper{--lightningcss-light:initial;--lightningcss-dark: }.textarea-wrapper:has(.display-layer) .editor-textarea{scrollbar-gutter:stable}.display-layer{scrollbar-gutter:stable;scrollbar-color:transparent transparent}.display-layer::-webkit-scrollbar{background:0 0}.display-layer::-webkit-scrollbar-track{background:0 0}.display-layer::-webkit-scrollbar-thumb{background:0 0;border-color:#0000}.display-layer .faux-bold{text-shadow:0 0 .5px,0 0 .5px}.editor-textarea{font:inherit;box-sizing:border-box;scrollbar-gutter:stable}.textarea-wrapper:has(.display-layer) .editor-textarea::selection{background:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.textarea-wrapper:has(.display-layer) .editor-textarea::selection{background:color-mix(in oklch, var(--color-primary), transparent 80%)}}.textarea-wrapper:has(.display-layer) .editor-textarea::selection{color:#0000;caret-color:var(--color-primary)}.markdown-editor-wrapper.is-fullscreen{resize:none;height:100dvh;z-index:var(--mte-fullscreen-z-index,10000);top:0;border-radius:0;position:fixed;inset-inline:0}@layer base{@layer base{.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--palette-shade-light-color:white;--palette-shade-dark-color:black;--color-body:currentColor}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-body:color-mix(in oklch, currentColor 80%, transparent)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color-scheme:var(--scheme-color,light);color:var(--color-on-base);background-color:var(--color-base);--color-base-soft:var(--lightningcss-light,var(--color-on-base))var(--lightningcss-dark,var(--color-on-base))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-soft:var(--lightningcss-light,color-mix(in oklch, var(--color-on-base) 8%, var(--color-base) 92%))var(--lightningcss-dark,color-mix(in oklch, var(--color-on-base) 16%, var(--color-base) 84%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-on-base-soft:var(--color-on-base);--color-base-active:var(--lightningcss-light,var(--color-on-base))var(--lightningcss-dark,var(--color-on-base))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-active:var(--lightningcss-light,color-mix(in oklch, var(--color-on-base) 14%, var(--color-base) 86%))var(--lightningcss-dark,color-mix(in oklch, var(--color-on-base) 26%, var(--color-base) 74%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-50:var(--color-on-base)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-50:color-mix(in oklch, var(--color-on-base) 4%, var(--color-base) 96%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-100:var(--color-on-base)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-100:color-mix(in oklch, var(--color-on-base) 8%, var(--color-base) 92%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-200:var(--color-on-base)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-200:color-mix(in oklch, var(--color-on-base) 16%, var(--color-base) 84%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-300:var(--color-on-base)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-300:color-mix(in oklch, var(--color-on-base) 26%, var(--color-base) 74%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-400:var(--color-on-base)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-400:color-mix(in oklch, var(--color-on-base) 36%, var(--color-base) 64%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-500:var(--color-base);--color-base-600:var(--color-on-base)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-600:color-mix(in oklch, var(--color-on-base) 50%, var(--color-base) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-700:var(--color-on-base)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-700:color-mix(in oklch, var(--color-on-base) 62%, var(--color-base) 38%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-800:var(--color-on-base)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-800:color-mix(in oklch, var(--color-on-base) 74%, var(--color-base) 26%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-900:var(--color-on-base)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-900:color-mix(in oklch, var(--color-on-base) 86%, var(--color-base) 14%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-950:var(--color-on-base)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-base-950:color-mix(in oklch, var(--color-on-base) 92%, var(--color-base) 8%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-soft:var(--lightningcss-light,var(--color-neutral-50))var(--lightningcss-dark,var(--color-neutral))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-soft:var(--lightningcss-light,var(--color-neutral-50))var(--lightningcss-dark,color-mix(in srgb, var(--color-neutral) 20%, var(--color-base) 80%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-on-neutral-soft:var(--lightningcss-light,var(--color-neutral-700))var(--lightningcss-dark,var(--color-neutral-300));--color-neutral-active:var(--lightningcss-light,var(--palette-shade-dark-color))var(--lightningcss-dark,var(--palette-shade-light-color))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-active:var(--lightningcss-light,color-mix(in oklch, var(--palette-shade-dark-color) 15%, var(--color-neutral) 85%))var(--lightningcss-dark,color-mix(in oklch, var(--palette-shade-light-color) 15%, var(--color-neutral) 85%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-50:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-50:color-mix(in oklch, var(--palette-shade-light-color) 80%, var(--color-neutral) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-100:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-100:color-mix(in oklch, var(--palette-shade-light-color) 65%, var(--color-neutral) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-200:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-200:color-mix(in oklch, var(--palette-shade-light-color) 50%, var(--color-neutral) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-300:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-300:color-mix(in oklch, var(--palette-shade-light-color) 35%, var(--color-neutral) 65%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-400:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-400:color-mix(in oklch, var(--palette-shade-light-color) 18%, var(--color-neutral) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-500:var(--color-neutral);--color-neutral-600:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-600:color-mix(in oklch, var(--palette-shade-dark-color) 18%, var(--color-neutral) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-700:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-700:color-mix(in oklch, var(--palette-shade-dark-color) 34%, var(--color-neutral) 66%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-800:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-800:color-mix(in oklch, var(--palette-shade-dark-color) 50%, var(--color-neutral) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-900:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-900:color-mix(in oklch, var(--palette-shade-dark-color) 65%, var(--color-neutral) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-950:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-neutral-950:color-mix(in oklch, var(--palette-shade-dark-color) 80%, var(--color-neutral) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-soft:var(--lightningcss-light,var(--color-primary-50))var(--lightningcss-dark,var(--color-primary))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-soft:var(--lightningcss-light,var(--color-primary-50))var(--lightningcss-dark,color-mix(in srgb, var(--color-primary) 20%, var(--color-base) 80%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-on-primary-soft:var(--lightningcss-light,var(--color-primary-700))var(--lightningcss-dark,var(--color-primary-300));--color-primary-active:var(--lightningcss-light,var(--palette-shade-dark-color))var(--lightningcss-dark,var(--palette-shade-light-color))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-active:var(--lightningcss-light,color-mix(in oklch, var(--palette-shade-dark-color) 15%, var(--color-primary) 85%))var(--lightningcss-dark,color-mix(in oklch, var(--palette-shade-light-color) 15%, var(--color-primary) 85%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-50:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-50:color-mix(in oklch, var(--palette-shade-light-color) 80%, var(--color-primary) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-100:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-100:color-mix(in oklch, var(--palette-shade-light-color) 65%, var(--color-primary) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-200:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-200:color-mix(in oklch, var(--palette-shade-light-color) 50%, var(--color-primary) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-300:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-300:color-mix(in oklch, var(--palette-shade-light-color) 35%, var(--color-primary) 65%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-400:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-400:color-mix(in oklch, var(--palette-shade-light-color) 18%, var(--color-primary) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-500:var(--color-primary);--color-primary-600:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-600:color-mix(in oklch, var(--palette-shade-dark-color) 18%, var(--color-primary) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-700:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-700:color-mix(in oklch, var(--palette-shade-dark-color) 34%, var(--color-primary) 66%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-800:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-800:color-mix(in oklch, var(--palette-shade-dark-color) 50%, var(--color-primary) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-900:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-900:color-mix(in oklch, var(--palette-shade-dark-color) 65%, var(--color-primary) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-950:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-primary-950:color-mix(in oklch, var(--palette-shade-dark-color) 80%, var(--color-primary) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-soft:var(--lightningcss-light,var(--color-secondary-50))var(--lightningcss-dark,var(--color-secondary))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-soft:var(--lightningcss-light,var(--color-secondary-50))var(--lightningcss-dark,color-mix(in srgb, var(--color-secondary) 20%, var(--color-base) 80%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-on-secondary-soft:var(--lightningcss-light,var(--color-secondary-700))var(--lightningcss-dark,var(--color-secondary-300));--color-secondary-active:var(--lightningcss-light,var(--palette-shade-dark-color))var(--lightningcss-dark,var(--palette-shade-light-color))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-active:var(--lightningcss-light,color-mix(in oklch, var(--palette-shade-dark-color) 15%, var(--color-secondary) 85%))var(--lightningcss-dark,color-mix(in oklch, var(--palette-shade-light-color) 15%, var(--color-secondary) 85%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-50:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-50:color-mix(in oklch, var(--palette-shade-light-color) 80%, var(--color-secondary) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-100:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-100:color-mix(in oklch, var(--palette-shade-light-color) 65%, var(--color-secondary) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-200:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-200:color-mix(in oklch, var(--palette-shade-light-color) 50%, var(--color-secondary) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-300:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-300:color-mix(in oklch, var(--palette-shade-light-color) 35%, var(--color-secondary) 65%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-400:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-400:color-mix(in oklch, var(--palette-shade-light-color) 18%, var(--color-secondary) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-500:var(--color-secondary);--color-secondary-600:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-600:color-mix(in oklch, var(--palette-shade-dark-color) 18%, var(--color-secondary) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-700:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-700:color-mix(in oklch, var(--palette-shade-dark-color) 34%, var(--color-secondary) 66%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-800:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-800:color-mix(in oklch, var(--palette-shade-dark-color) 50%, var(--color-secondary) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-900:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-900:color-mix(in oklch, var(--palette-shade-dark-color) 65%, var(--color-secondary) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-950:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-secondary-950:color-mix(in oklch, var(--palette-shade-dark-color) 80%, var(--color-secondary) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-soft:var(--lightningcss-light,var(--color-accent-50))var(--lightningcss-dark,var(--color-accent))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-soft:var(--lightningcss-light,var(--color-accent-50))var(--lightningcss-dark,color-mix(in srgb, var(--color-accent) 20%, var(--color-base) 80%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-on-accent-soft:var(--lightningcss-light,var(--color-accent-700))var(--lightningcss-dark,var(--color-accent-300));--color-accent-active:var(--lightningcss-light,var(--palette-shade-dark-color))var(--lightningcss-dark,var(--palette-shade-light-color))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-active:var(--lightningcss-light,color-mix(in oklch, var(--palette-shade-dark-color) 15%, var(--color-accent) 85%))var(--lightningcss-dark,color-mix(in oklch, var(--palette-shade-light-color) 15%, var(--color-accent) 85%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-50:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-50:color-mix(in oklch, var(--palette-shade-light-color) 80%, var(--color-accent) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-100:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-100:color-mix(in oklch, var(--palette-shade-light-color) 65%, var(--color-accent) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-200:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-200:color-mix(in oklch, var(--palette-shade-light-color) 50%, var(--color-accent) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-300:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-300:color-mix(in oklch, var(--palette-shade-light-color) 35%, var(--color-accent) 65%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-400:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-400:color-mix(in oklch, var(--palette-shade-light-color) 18%, var(--color-accent) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-500:var(--color-accent);--color-accent-600:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-600:color-mix(in oklch, var(--palette-shade-dark-color) 18%, var(--color-accent) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-700:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-700:color-mix(in oklch, var(--palette-shade-dark-color) 34%, var(--color-accent) 66%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-800:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-800:color-mix(in oklch, var(--palette-shade-dark-color) 50%, var(--color-accent) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-900:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-900:color-mix(in oklch, var(--palette-shade-dark-color) 65%, var(--color-accent) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-950:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-accent-950:color-mix(in oklch, var(--palette-shade-dark-color) 80%, var(--color-accent) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-soft:var(--lightningcss-light,var(--color-info-50))var(--lightningcss-dark,var(--color-info))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-soft:var(--lightningcss-light,var(--color-info-50))var(--lightningcss-dark,color-mix(in srgb, var(--color-info) 20%, var(--color-base) 80%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-on-info-soft:var(--lightningcss-light,var(--color-info-700))var(--lightningcss-dark,var(--color-info-300));--color-info-active:var(--lightningcss-light,var(--palette-shade-dark-color))var(--lightningcss-dark,var(--palette-shade-light-color))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-active:var(--lightningcss-light,color-mix(in oklch, var(--palette-shade-dark-color) 15%, var(--color-info) 85%))var(--lightningcss-dark,color-mix(in oklch, var(--palette-shade-light-color) 15%, var(--color-info) 85%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-50:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-50:color-mix(in oklch, var(--palette-shade-light-color) 80%, var(--color-info) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-100:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-100:color-mix(in oklch, var(--palette-shade-light-color) 65%, var(--color-info) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-200:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-200:color-mix(in oklch, var(--palette-shade-light-color) 50%, var(--color-info) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-300:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-300:color-mix(in oklch, var(--palette-shade-light-color) 35%, var(--color-info) 65%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-400:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-400:color-mix(in oklch, var(--palette-shade-light-color) 18%, var(--color-info) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-500:var(--color-info);--color-info-600:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-600:color-mix(in oklch, var(--palette-shade-dark-color) 18%, var(--color-info) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-700:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-700:color-mix(in oklch, var(--palette-shade-dark-color) 34%, var(--color-info) 66%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-800:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-800:color-mix(in oklch, var(--palette-shade-dark-color) 50%, var(--color-info) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-900:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-900:color-mix(in oklch, var(--palette-shade-dark-color) 65%, var(--color-info) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-950:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-info-950:color-mix(in oklch, var(--palette-shade-dark-color) 80%, var(--color-info) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-soft:var(--lightningcss-light,var(--color-success-50))var(--lightningcss-dark,var(--color-success))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-soft:var(--lightningcss-light,var(--color-success-50))var(--lightningcss-dark,color-mix(in srgb, var(--color-success) 20%, var(--color-base) 80%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-on-success-soft:var(--lightningcss-light,var(--color-success-700))var(--lightningcss-dark,var(--color-success-300));--color-success-active:var(--lightningcss-light,var(--palette-shade-dark-color))var(--lightningcss-dark,var(--palette-shade-light-color))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-active:var(--lightningcss-light,color-mix(in oklch, var(--palette-shade-dark-color) 15%, var(--color-success) 85%))var(--lightningcss-dark,color-mix(in oklch, var(--palette-shade-light-color) 15%, var(--color-success) 85%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-50:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-50:color-mix(in oklch, var(--palette-shade-light-color) 80%, var(--color-success) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-100:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-100:color-mix(in oklch, var(--palette-shade-light-color) 65%, var(--color-success) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-200:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-200:color-mix(in oklch, var(--palette-shade-light-color) 50%, var(--color-success) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-300:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-300:color-mix(in oklch, var(--palette-shade-light-color) 35%, var(--color-success) 65%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-400:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-400:color-mix(in oklch, var(--palette-shade-light-color) 18%, var(--color-success) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-500:var(--color-success);--color-success-600:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-600:color-mix(in oklch, var(--palette-shade-dark-color) 18%, var(--color-success) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-700:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-700:color-mix(in oklch, var(--palette-shade-dark-color) 34%, var(--color-success) 66%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-800:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-800:color-mix(in oklch, var(--palette-shade-dark-color) 50%, var(--color-success) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-900:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-900:color-mix(in oklch, var(--palette-shade-dark-color) 65%, var(--color-success) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-950:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-success-950:color-mix(in oklch, var(--palette-shade-dark-color) 80%, var(--color-success) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-soft:var(--lightningcss-light,var(--color-warning-50))var(--lightningcss-dark,var(--color-warning))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-soft:var(--lightningcss-light,var(--color-warning-50))var(--lightningcss-dark,color-mix(in srgb, var(--color-warning) 20%, var(--color-base) 80%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-on-warning-soft:var(--lightningcss-light,var(--color-warning-800))var(--lightningcss-dark,var(--color-warning-300));--color-warning-active:var(--lightningcss-light,var(--palette-shade-dark-color))var(--lightningcss-dark,var(--palette-shade-light-color))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-active:var(--lightningcss-light,color-mix(in oklch, var(--palette-shade-dark-color) 15%, var(--color-warning) 85%))var(--lightningcss-dark,color-mix(in oklch, var(--palette-shade-light-color) 15%, var(--color-warning) 85%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-50:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-50:color-mix(in oklch, var(--palette-shade-light-color) 80%, var(--color-warning) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-100:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-100:color-mix(in oklch, var(--palette-shade-light-color) 65%, var(--color-warning) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-200:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-200:color-mix(in oklch, var(--palette-shade-light-color) 50%, var(--color-warning) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-300:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-300:color-mix(in oklch, var(--palette-shade-light-color) 35%, var(--color-warning) 65%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-400:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-400:color-mix(in oklch, var(--palette-shade-light-color) 18%, var(--color-warning) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-500:var(--color-warning);--color-warning-600:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-600:color-mix(in oklch, var(--palette-shade-dark-color) 18%, var(--color-warning) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-700:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-700:color-mix(in oklch, var(--palette-shade-dark-color) 34%, var(--color-warning) 66%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-800:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-800:color-mix(in oklch, var(--palette-shade-dark-color) 50%, var(--color-warning) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-900:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-900:color-mix(in oklch, var(--palette-shade-dark-color) 65%, var(--color-warning) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-950:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-warning-950:color-mix(in oklch, var(--palette-shade-dark-color) 80%, var(--color-warning) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-soft:var(--lightningcss-light,var(--color-error-50))var(--lightningcss-dark,var(--color-error))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-soft:var(--lightningcss-light,var(--color-error-50))var(--lightningcss-dark,color-mix(in srgb, var(--color-error) 20%, var(--color-base) 80%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-on-error-soft:var(--lightningcss-light,var(--color-error-700))var(--lightningcss-dark,var(--color-error-300));--color-error-active:var(--lightningcss-light,var(--palette-shade-dark-color))var(--lightningcss-dark,var(--palette-shade-light-color))}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-active:var(--lightningcss-light,color-mix(in oklch, var(--palette-shade-dark-color) 15%, var(--color-error) 85%))var(--lightningcss-dark,color-mix(in oklch, var(--palette-shade-light-color) 15%, var(--color-error) 85%))}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-50:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-50:color-mix(in oklch, var(--palette-shade-light-color) 80%, var(--color-error) 20%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-100:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-100:color-mix(in oklch, var(--palette-shade-light-color) 65%, var(--color-error) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-200:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-200:color-mix(in oklch, var(--palette-shade-light-color) 50%, var(--color-error) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-300:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-300:color-mix(in oklch, var(--palette-shade-light-color) 35%, var(--color-error) 65%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-400:var(--palette-shade-light-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-400:color-mix(in oklch, var(--palette-shade-light-color) 18%, var(--color-error) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-500:var(--color-error);--color-error-600:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-600:color-mix(in oklch, var(--palette-shade-dark-color) 18%, var(--color-error) 82%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-700:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-700:color-mix(in oklch, var(--palette-shade-dark-color) 34%, var(--color-error) 66%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-800:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-800:color-mix(in oklch, var(--palette-shade-dark-color) 50%, var(--color-error) 50%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-900:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-900:color-mix(in oklch, var(--palette-shade-dark-color) 65%, var(--color-error) 35%)}}.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-950:var(--palette-shade-dark-color)}@supports (color:color-mix(in lab, red, red)){.markdown-editor-wrapper,.markdown-editor-wrapper[data-theme],[data-theme] .markdown-editor-wrapper{--color-error-950:color-mix(in oklch, var(--palette-shade-dark-color) 80%, var(--color-error) 20%)}}}@layer theme{.markdown-editor-wrapper[data-theme=darkberry],[data-theme=darkberry] .markdown-editor-wrapper,.markdown-editor-wrapper[data-theme=dark],[data-theme=dark] .markdown-editor-wrapper{--scheme-color:dark;--border-radius:.25rem;--color-base:oklch(10.889% .00301 17.398);--color-on-base:oklch(98% .01 270);--color-neutral:oklch(85% 0 0);--color-on-neutral:oklch(20% 0 0);--color-primary:oklch(66.385% .18368 285.592);--color-on-primary:oklch(10% .01 270);--color-secondary:oklch(65% .18 220);--color-on-secondary:oklch(10% .01 220);--color-accent:oklch(75% .18 50);--color-on-accent:oklch(10% .01 50);--color-info:oklch(91.67% .077 205.04);--color-on-info:oklch(10% .01 250);--color-success:oklch(65% .18 140);--color-on-success:oklch(10% .01 140);--color-warning:oklch(75% .2 85);--color-on-warning:oklch(10% .01 85);--color-error:oklch(60% .22 30);--color-on-error:oklch(10% .01 30)}.markdown-editor-wrapper:not([data-theme]),.markdown-editor-wrapper[data-theme=snowberry],[data-theme=snowberry] .markdown-editor-wrapper,.markdown-editor-wrapper[data-theme=light],[data-theme=light] .markdown-editor-wrapper{--scheme-color:light;--border-radius:.25rem;--color-base:oklch(100% 0 0);--color-on-base:oklch(22% 0 0);--color-neutral:oklch(15% 0 0);--color-on-neutral:oklch(100% 0 0);--color-primary:oklch(51.1% .262 276.966);--color-on-primary:oklch(96.2% .018 272.314);--color-secondary:oklch(59.1% .293 322.896);--color-on-secondary:oklch(100% 0 0);--color-accent:oklch(54.1% .281 293.009);--color-on-accent:oklch(100% 0 0);--color-info:oklch(68.5% .169 237.323);--color-on-info:oklch(15% 0 0);--color-success:oklch(79.2% .209 151.711);--color-on-success:oklch(15% 0 0);--color-warning:oklch(85.2% .199 91.936);--color-on-warning:oklch(15% 0 0);--color-error:oklch(57.7% .245 27.325);--color-on-error:oklch(100% 0 0)}}@container countdown style(--digits:3){span:before{content:"000\\a 001\\a 002\\a 003\\a 004\\a 005\\a 006\\a 007\\a 008\\a 009\\a 010\\a 011\\a 012\\a 013\\a 014\\a 015\\a 016\\a 017\\a 018\\a 019\\a 020\\a 021\\a 022\\a 023\\a 024\\a 025\\a 026\\a 027\\a 028\\a 029\\a 030\\a 031\\a 032\\a 033\\a 034\\a 035\\a 036\\a 037\\a 038\\a 039\\a 040\\a 041\\a 042\\a 043\\a 044\\a 045\\a 046\\a 047\\a 048\\a 049\\a 050\\a 051\\a 052\\a 053\\a 054\\a 055\\a 056\\a 057\\a 058\\a 059\\a 060\\a 061\\a 062\\a 063\\a 064\\a 065\\a 066\\a 067\\a 068\\a 069\\a 070\\a 071\\a 072\\a 073\\a 074\\a 075\\a 076\\a 077\\a 078\\a 079\\a 080\\a 081\\a 082\\a 083\\a 084\\a 085\\a 086\\a 087\\a 088\\a 089\\a 090\\a 091\\a 092\\a 093\\a 094\\a 095\\a 096\\a 097\\a 098\\a 099\\a 100\\a 101\\a 102\\a 103\\a 104\\a 105\\a 106\\a 107\\a 108\\a 109\\a 110\\a 111\\a 112\\a 113\\a 114\\a 115\\a 116\\a 117\\a 118\\a 119\\a 120\\a 121\\a 122\\a 123\\a 124\\a 125\\a 126\\a 127\\a 128\\a 129\\a 130\\a 131\\a 132\\a 133\\a 134\\a 135\\a 136\\a 137\\a 138\\a 139\\a 140\\a 141\\a 142\\a 143\\a 144\\a 145\\a 146\\a 147\\a 148\\a 149\\a 150\\a 151\\a 152\\a 153\\a 154\\a 155\\a 156\\a 157\\a 158\\a 159\\a 160\\a 161\\a 162\\a 163\\a 164\\a 165\\a 166\\a 167\\a 168\\a 169\\a 170\\a 171\\a 172\\a 173\\a 174\\a 175\\a 176\\a 177\\a 178\\a 179\\a 180\\a 181\\a 182\\a 183\\a 184\\a 185\\a 186\\a 187\\a 188\\a 189\\a 190\\a 191\\a 192\\a 193\\a 194\\a 195\\a 196\\a 197\\a 198\\a 199\\a 200\\a 201\\a 202\\a 203\\a 204\\a 205\\a 206\\a 207\\a 208\\a 209\\a 210\\a 211\\a 212\\a 213\\a 214\\a 215\\a 216\\a 217\\a 218\\a 219\\a 220\\a 221\\a 222\\a 223\\a 224\\a 225\\a 226\\a 227\\a 228\\a 229\\a 230\\a 231\\a 232\\a 233\\a 234\\a 235\\a 236\\a 237\\a 238\\a 239\\a 240\\a 241\\a 242\\a 243\\a 244\\a 245\\a 246\\a 247\\a 248\\a 249\\a 250\\a 251\\a 252\\a 253\\a 254\\a 255\\a 256\\a 257\\a 258\\a 259\\a 260\\a 261\\a 262\\a 263\\a 264\\a 265\\a 266\\a 267\\a 268\\a 269\\a 270\\a 271\\a 272\\a 273\\a 274\\a 275\\a 276\\a 277\\a 278\\a 279\\a 280\\a 281\\a 282\\a 283\\a 284\\a 285\\a 286\\a 287\\a 288\\a 289\\a 290\\a 291\\a 292\\a 293\\a 294\\a 295\\a 296\\a 297\\a 298\\a 299\\a 300\\a 301\\a 302\\a 303\\a 304\\a 305\\a 306\\a 307\\a 308\\a 309\\a 310\\a 311\\a 312\\a 313\\a 314\\a 315\\a 316\\a 317\\a 318\\a 319\\a 320\\a 321\\a 322\\a 323\\a 324\\a 325\\a 326\\a 327\\a 328\\a 329\\a 330\\a 331\\a 332\\a 333\\a 334\\a 335\\a 336\\a 337\\a 338\\a 339\\a 340\\a 341\\a 342\\a 343\\a 344\\a 345\\a 346\\a 347\\a 348\\a 349\\a 350\\a 351\\a 352\\a 353\\a 354\\a 355\\a 356\\a 357\\a 358\\a 359\\a 360\\a 361\\a 362\\a 363\\a 364\\a 365\\a 366\\a 367\\a 368\\a 369\\a 370\\a 371\\a 372\\a 373\\a 374\\a 375\\a 376\\a 377\\a 378\\a 379\\a 380\\a 381\\a 382\\a 383\\a 384\\a 385\\a 386\\a 387\\a 388\\a 389\\a 390\\a 391\\a 392\\a 393\\a 394\\a 395\\a 396\\a 397\\a 398\\a 399\\a 400\\a 401\\a 402\\a 403\\a 404\\a 405\\a 406\\a 407\\a 408\\a 409\\a 410\\a 411\\a 412\\a 413\\a 414\\a 415\\a 416\\a 417\\a 418\\a 419\\a 420\\a 421\\a 422\\a 423\\a 424\\a 425\\a 426\\a 427\\a 428\\a 429\\a 430\\a 431\\a 432\\a 433\\a 434\\a 435\\a 436\\a 437\\a 438\\a 439\\a 440\\a 441\\a 442\\a 443\\a 444\\a 445\\a 446\\a 447\\a 448\\a 449\\a 450\\a 451\\a 452\\a 453\\a 454\\a 455\\a 456\\a 457\\a 458\\a 459\\a 460\\a 461\\a 462\\a 463\\a 464\\a 465\\a 466\\a 467\\a 468\\a 469\\a 470\\a 471\\a 472\\a 473\\a 474\\a 475\\a 476\\a 477\\a 478\\a 479\\a 480\\a 481\\a 482\\a 483\\a 484\\a 485\\a 486\\a 487\\a 488\\a 489\\a 490\\a 491\\a 492\\a 493\\a 494\\a 495\\a 496\\a 497\\a 498\\a 499\\a 500\\a 501\\a 502\\a 503\\a 504\\a 505\\a 506\\a 507\\a 508\\a 509\\a 510\\a 511\\a 512\\a 513\\a 514\\a 515\\a 516\\a 517\\a 518\\a 519\\a 520\\a 521\\a 522\\a 523\\a 524\\a 525\\a 526\\a 527\\a 528\\a 529\\a 530\\a 531\\a 532\\a 533\\a 534\\a 535\\a 536\\a 537\\a 538\\a 539\\a 540\\a 541\\a 542\\a 543\\a 544\\a 545\\a 546\\a 547\\a 548\\a 549\\a 550\\a 551\\a 552\\a 553\\a 554\\a 555\\a 556\\a 557\\a 558\\a 559\\a 560\\a 561\\a 562\\a 563\\a 564\\a 565\\a 566\\a 567\\a 568\\a 569\\a 570\\a 571\\a 572\\a 573\\a 574\\a 575\\a 576\\a 577\\a 578\\a 579\\a 580\\a 581\\a 582\\a 583\\a 584\\a 585\\a 586\\a 587\\a 588\\a 589\\a 590\\a 591\\a 592\\a 593\\a 594\\a 595\\a 596\\a 597\\a 598\\a 599\\a 600\\a 601\\a 602\\a 603\\a 604\\a 605\\a 606\\a 607\\a 608\\a 609\\a 610\\a 611\\a 612\\a 613\\a 614\\a 615\\a 616\\a 617\\a 618\\a 619\\a 620\\a 621\\a 622\\a 623\\a 624\\a 625\\a 626\\a 627\\a 628\\a 629\\a 630\\a 631\\a 632\\a 633\\a 634\\a 635\\a 636\\a 637\\a 638\\a 639\\a 640\\a 641\\a 642\\a 643\\a 644\\a 645\\a 646\\a 647\\a 648\\a 649\\a 650\\a 651\\a 652\\a 653\\a 654\\a 655\\a 656\\a 657\\a 658\\a 659\\a 660\\a 661\\a 662\\a 663\\a 664\\a 665\\a 666\\a 667\\a 668\\a 669\\a 670\\a 671\\a 672\\a 673\\a 674\\a 675\\a 676\\a 677\\a 678\\a 679\\a 680\\a 681\\a 682\\a 683\\a 684\\a 685\\a 686\\a 687\\a 688\\a 689\\a 690\\a 691\\a 692\\a 693\\a 694\\a 695\\a 696\\a 697\\a 698\\a 699\\a 700\\a 701\\a 702\\a 703\\a 704\\a 705\\a 706\\a 707\\a 708\\a 709\\a 710\\a 711\\a 712\\a 713\\a 714\\a 715\\a 716\\a 717\\a 718\\a 719\\a 720\\a 721\\a 722\\a 723\\a 724\\a 725\\a 726\\a 727\\a 728\\a 729\\a 730\\a 731\\a 732\\a 733\\a 734\\a 735\\a 736\\a 737\\a 738\\a 739\\a 740\\a 741\\a 742\\a 743\\a 744\\a 745\\a 746\\a 747\\a 748\\a 749\\a 750\\a 751\\a 752\\a 753\\a 754\\a 755\\a 756\\a 757\\a 758\\a 759\\a 760\\a 761\\a 762\\a 763\\a 764\\a 765\\a 766\\a 767\\a 768\\a 769\\a 770\\a 771\\a 772\\a 773\\a 774\\a 775\\a 776\\a 777\\a 778\\a 779\\a 780\\a 781\\a 782\\a 783\\a 784\\a 785\\a 786\\a 787\\a 788\\a 789\\a 790\\a 791\\a 792\\a 793\\a 794\\a 795\\a 796\\a 797\\a 798\\a 799\\a 800\\a 801\\a 802\\a 803\\a 804\\a 805\\a 806\\a 807\\a 808\\a 809\\a 810\\a 811\\a 812\\a 813\\a 814\\a 815\\a 816\\a 817\\a 818\\a 819\\a 820\\a 821\\a 822\\a 823\\a 824\\a 825\\a 826\\a 827\\a 828\\a 829\\a 830\\a 831\\a 832\\a 833\\a 834\\a 835\\a 836\\a 837\\a 838\\a 839\\a 840\\a 841\\a 842\\a 843\\a 844\\a 845\\a 846\\a 847\\a 848\\a 849\\a 850\\a 851\\a 852\\a 853\\a 854\\a 855\\a 856\\a 857\\a 858\\a 859\\a 860\\a 861\\a 862\\a 863\\a 864\\a 865\\a 866\\a 867\\a 868\\a 869\\a 870\\a 871\\a 872\\a 873\\a 874\\a 875\\a 876\\a 877\\a 878\\a 879\\a 880\\a 881\\a 882\\a 883\\a 884\\a 885\\a 886\\a 887\\a 888\\a 889\\a 890\\a 891\\a 892\\a 893\\a 894\\a 895\\a 896\\a 897\\a 898\\a 899\\a 900\\a 901\\a 902\\a 903\\a 904\\a 905\\a 906\\a 907\\a 908\\a 909\\a 910\\a 911\\a 912\\a 913\\a 914\\a 915\\a 916\\a 917\\a 918\\a 919\\a 920\\a 921\\a 922\\a 923\\a 924\\a 925\\a 926\\a 927\\a 928\\a 929\\a 930\\a 931\\a 932\\a 933\\a 934\\a 935\\a 936\\a 937\\a 938\\a 939\\a 940\\a 941\\a 942\\a 943\\a 944\\a 945\\a 946\\a 947\\a 948\\a 949\\a 950\\a 951\\a 952\\a 953\\a 954\\a 955\\a 956\\a 957\\a 958\\a 959\\a 960\\a 961\\a 962\\a 963\\a 964\\a 965\\a 966\\a 967\\a 968\\a 969\\a 970\\a 971\\a 972\\a 973\\a 974\\a 975\\a 976\\a 977\\a 978\\a 979\\a 980\\a 981\\a 982\\a 983\\a 984\\a 985\\a 986\\a 987\\a 988\\a 989\\a 990\\a 991\\a 992\\a 993\\a 994\\a 995\\a 996\\a 997\\a 998\\a 999"}}@keyframes loading-spin{to{transform:rotate(360deg)}}@keyframes loading-pulse{0%,80%,to{opacity:.5;transform:scale(.6)}40%{opacity:1;transform:scale(1)}}@keyframes loading-bars{0%,to{transform:scaleY(.4)}50%{transform:scaleY(1)}}@keyframes marquee-scroll{0%{translate:0}to{translate:var(--marquee--axis)}}@keyframes progress{50%{background-position-x:-115%}}@keyframes skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}:where(.me-swap-rotate) :where(.me-swap-on),:where(.me-swap-rotate) :where(.me-swap-indeterminate){rotate:45deg}:where(.me-table-pin-cols) :where(tr th){background-color:var(--color-table);position:sticky;inset-inline:0}:where(.me-table-pin-rows) :where(thead tr){background-color:var(--color-table);z-index:1;position:sticky;inset-block-start:0}:where(.me-table-hover) :where(tbody tr){transition-property:background-color;transition-duration:.15s;transition-timing-function:linear}:where(.me-table-hover) :where(tbody tr):hover,:where(.me-table-zebra) :where(tbody tr:nth-child(2n)),:where(.me-table-zebra-cols) :where(tbody tr td:nth-child(2n)),:where(.me-table-zebra-rows) :where(tbody tr:nth-child(2n)){background-color:var(--color-table-soft)}:where(.me-table-lg) :where(:not(thead,tfoot) tr){font-size:1.125rem}:where(.me-table-lg) :where(th,td){padding-block:1rem;padding-inline:1.25rem}:where(.me-table-md) :where(:not(thead,tfoot) tr){font-size:.875rem}:where(.me-table-md) :where(th,td){padding-block:.75rem;padding-inline:1rem}:where(.me-table-sm) :where(:not(thead,tfoot) tr){font-size:.75rem}:where(.me-table-sm) :where(th,td){padding-block:.5rem;padding-inline:.75rem}:where(.me-table-xl) :where(:not(thead,tfoot) tr){font-size:1.375rem}:where(.me-table-xl) :where(th,td){padding-block:1.25rem;padding-inline:1.5rem}:where(.me-table-xs) :where(:not(thead,tfoot) tr){font-size:.6875rem}:where(.me-table-xs) :where(th,td){padding-block:.25rem;padding-inline:.5rem}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-content{syntax:"*";inherits:false;initial-value:""}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.MarkdownEditor=t())})(this,function(){function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var t=e();function n(e){t=e}var r={exec:()=>null};function i(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function a(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(s.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var o=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),s={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:i(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:i(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:i(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:i(e=>RegExp(`^ {0,${e}}(?:</?(?:${y})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:i(e=>RegExp(`^ {0,${e}}>`))},c=/^(?:[ \t]*(?:\n|$))+/,l=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,u=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,d=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,f=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,p=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,m=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,h=a(m).replace(/bull/g,p).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),g=a(m).replace(/bull/g,p).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,v=/^[^\n]+/,ee=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,te=a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,ee).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ne=a(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,p).getRegex(),y=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,b=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,re=a(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,b).replace(`tag`,y).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x=e=>a(_).replace(`hr`,d).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,y).getRegex(),ie=x(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ae=x(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),oe={blockquote:a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ae).getRegex(),code:l,def:te,fences:u,heading:f,hr:d,html:re,lheading:h,list:ne,newline:c,paragraph:ie,table:r,text:v},se=a(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,d).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,y).getRegex(),ce={...oe,lheading:g,table:se,paragraph:a(_).replace(`hr`,d).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,se).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,y).getRegex()},le={...oe,html:a(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,b).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:a(_).replace(`hr`,d).replace(`heading`,` *#{1,6} *[^
3
- ]`).replace(`lheading`,h).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},ue=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,de=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,fe=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,pe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,S=/[\p{P}\p{S}]/u,me=/[\s\p{P}\p{S}]/u,he=/[^\s\p{P}\p{S}]/u,ge=a(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,me).getRegex(),C=/[\p{Pi}\p{Ps}"']/u,_e=/(?!~)[\p{P}\p{S}]/u,ve=/(?!~)[\s\p{P}\p{S}]/u,ye=/(?:[^\s\p{P}\p{S}]|~)/u,be=a(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,o?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),xe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Se=a(xe,`u`).replace(/punct/g,S).getRegex(),Ce=a(xe,`u`).replace(/punct/g,_e).getRegex(),we=a(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,C).replace(/punct/g,S).getRegex(),Te=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,w=a(Te,`gu`).replace(/notPunctSpace/g,he).replace(/punctSpace/g,me).replace(/punct/g,S).getRegex(),Ee=a(Te,`gu`).replace(/notPunctSpace/g,ye).replace(/punctSpace/g,ve).replace(/punct/g,_e).getRegex(),T=a(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,he).replace(/punctSpace/g,me).replace(/punct/g,S).getRegex(),De=a(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,he).replace(/punctSpace/g,me).replace(/punct/g,S).getRegex(),E=a(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,he).replace(/punctSpace/g,me).replace(/punct/g,S).getRegex(),Oe=a(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,S).getRegex(),ke=a(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,he).replace(/punctSpace/g,me).replace(/punct/g,S).getRegex(),D=a(/\\(punct)/,`gu`).replace(/punct/g,S).getRegex(),Ae=a(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),je=a(b).replace(`(?:-->|$)`,`-->`).getRegex(),Me=a(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,je).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ne=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,O=a(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Ne).getRegex(),Pe=a(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,O).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Fe=a(/^!?\[(label)\]\[(ref)\]/).replace(`label`,O).replace(`ref`,ee).getRegex(),Ie=a(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ee).getRegex(),Le=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Re=a(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Ne).getRegex(),ze=a(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,a(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Re).replace(`ref`,Le).getRegex()).replace(`nolink`,a(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Le).getRegex()).getRegex(),Be=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ve=a(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),He={_backpedal:r,anyPunctuation:D,autolink:Ae,blockSkip:be,br:fe,code:de,del:r,delLDelim:r,delRDelim:r,emStrongLDelim:Se,emStrongRDelimAst:w,emStrongRDelimUnd:De,escape:ue,link:Pe,nolink:Ie,punctuation:ge,reflink:Fe,reflinkSearch:ze,tag:Me,text:pe,url:r},Ue={...He,emStrongLDelim:we,emStrongRDelimAst:T,emStrongRDelimUnd:E,link:a(/^!?\[(label)\]\((.*?)\)/).replace(`label`,O).getRegex(),reflink:a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,O).getRegex()},We={...He,emStrongRDelimAst:Ee,emStrongLDelim:Ce,delLDelim:Oe,delRDelim:ke,url:a(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Ve).replace(`protocol`,Be).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:a(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,Be).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Ge={...We,br:a(fe).replace(`{2,}`,`*`).getRegex(),text:a(We.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Ke={normal:oe,gfm:ce,pedantic:le},qe={normal:He,gfm:We,breaks:Ge,pedantic:Ue},Je={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Ye=e=>Je[e];function k(e,t){if(t){if(s.escapeTest.test(e))return e.replace(s.escapeReplace,Ye)}else if(s.escapeTestNoEncode.test(e))return e.replace(s.escapeReplaceNoEncode,Ye);return e}function Xe(e){return e.replace(s.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function Ze(e){try{e=encodeURI(e).replace(s.percentDecode,`%`)}catch{return null}return e}function Qe(e,t){let n=e.replace(s.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(s.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(s.slashPipe,`|`);return n}function A(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function $e(e){let t=e.split(`
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.MarkdownEditor=t())})(this,function(){function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var t=e();function n(e){t=e}var r={exec:()=>null};function i(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function a(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(s.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var o=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),s={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:i(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:i(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:i(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:i(e=>RegExp(`^ {0,${e}}(?:</?(?:${y})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:i(e=>RegExp(`^ {0,${e}}>`))},c=/^(?:[ \t]*(?:\n|$))+/,l=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,u=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,d=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,f=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,p=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,m=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ee=a(m).replace(/bull/g,p).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),h=a(m).replace(/bull/g,p).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),g=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,_=/^[^\n]+/,te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,v=a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,te).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ne=a(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,p).getRegex(),y=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,re=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ie=a(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,re).replace(`tag`,y).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),b=e=>a(g).replace(`hr`,d).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,y).getRegex(),ae=b(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),oe=b(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),se={blockquote:a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,oe).getRegex(),code:l,def:v,fences:u,heading:f,hr:d,html:ie,lheading:ee,list:ne,newline:c,paragraph:ae,table:r,text:_},ce=a(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,d).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,y).getRegex(),le={...se,lheading:h,table:ce,paragraph:a(g).replace(`hr`,d).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,ce).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,y).getRegex()},ue={...se,html:a(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,re).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:a(g).replace(`hr`,d).replace(`heading`,` *#{1,6} *[^
2
+ ]`).replace(`lheading`,ee).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},de=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pe=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,me=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,x=/[\p{P}\p{S}]/u,he=/[\s\p{P}\p{S}]/u,ge=/[^\s\p{P}\p{S}]/u,_e=a(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,he).getRegex(),S=/[\p{Pi}\p{Ps}"']/u,ve=/(?!~)[\p{P}\p{S}]/u,ye=/(?!~)[\s\p{P}\p{S}]/u,be=/(?:[^\s\p{P}\p{S}]|~)/u,xe=a(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,o?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Se=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ce=a(Se,`u`).replace(/punct/g,x).getRegex(),we=a(Se,`u`).replace(/punct/g,ve).getRegex(),Te=a(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,S).replace(/punct/g,x).getRegex(),Ee=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,C=a(Ee,`gu`).replace(/notPunctSpace/g,ge).replace(/punctSpace/g,he).replace(/punct/g,x).getRegex(),De=a(Ee,`gu`).replace(/notPunctSpace/g,be).replace(/punctSpace/g,ye).replace(/punct/g,ve).getRegex(),w=a(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ge).replace(/punctSpace/g,he).replace(/punct/g,x).getRegex(),Oe=a(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,ge).replace(/punctSpace/g,he).replace(/punct/g,x).getRegex(),T=a(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ge).replace(/punctSpace/g,he).replace(/punct/g,x).getRegex(),ke=a(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,x).getRegex(),Ae=a(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ge).replace(/punctSpace/g,he).replace(/punct/g,x).getRegex(),E=a(/\\(punct)/,`gu`).replace(/punct/g,x).getRegex(),je=a(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Me=a(re).replace(`(?:-->|$)`,`-->`).getRegex(),Ne=a(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Me).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Pe=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,D=a(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Pe).getRegex(),Fe=a(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,D).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),O=a(/^!?\[(label)\]\[(ref)\]/).replace(`label`,D).replace(`ref`,te).getRegex(),Ie=a(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,te).getRegex(),Le=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Re=a(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Pe).getRegex(),ze=a(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,a(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Re).replace(`ref`,Le).getRegex()).replace(`nolink`,a(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Le).getRegex()).getRegex(),k=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Be=a(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Ve={_backpedal:r,anyPunctuation:E,autolink:je,blockSkip:xe,br:pe,code:fe,del:r,delLDelim:r,delRDelim:r,emStrongLDelim:Ce,emStrongRDelimAst:C,emStrongRDelimUnd:Oe,escape:de,link:Fe,nolink:Ie,punctuation:_e,reflink:O,reflinkSearch:ze,tag:Ne,text:me,url:r},He={...Ve,emStrongLDelim:Te,emStrongRDelimAst:w,emStrongRDelimUnd:T,link:a(/^!?\[(label)\]\((.*?)\)/).replace(`label`,D).getRegex(),reflink:a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,D).getRegex()},Ue={...Ve,emStrongRDelimAst:De,emStrongLDelim:we,delLDelim:ke,delRDelim:Ae,url:a(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Be).replace(`protocol`,k).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:a(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,k).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},We={...Ue,br:a(pe).replace(`{2,}`,`*`).getRegex(),text:a(Ue.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Ge={normal:se,gfm:le,pedantic:ue},A={normal:Ve,gfm:Ue,breaks:We,pedantic:He},Ke={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},j=e=>Ke[e];function M(e,t){if(t){if(s.escapeTest.test(e))return e.replace(s.escapeReplace,j)}else if(s.escapeTestNoEncode.test(e))return e.replace(s.escapeReplaceNoEncode,j);return e}function qe(e){return e.replace(s.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function Je(e){try{e=encodeURI(e).replace(s.percentDecode,`%`)}catch{return null}return e}function Ye(e,t){let n=e.replace(s.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(s.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(s.slashPipe,`|`);return n}function N(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Xe(e){let t=e.split(`
4
3
  `),n=t.length-1;for(;n>=0&&s.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
5
- `)}function j(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function M(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function N(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function et(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function tt(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
4
+ `)}function P(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function F(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function I(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Ze(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function Qe(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
6
5
  `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
7
- `)}function nt(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var rt=class{options;rules;lexer;constructor(e){this.options=e||t}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:$e(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=tt(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=A(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:A(t[0],`
8
- `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:A(t[0],`
9
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=A(t[0],`
6
+ `)}function $e(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var et=class{options;rules;lexer;constructor(e){this.options=e||t}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Xe(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Qe(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=N(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:N(t[0],`
7
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:N(t[0],`
8
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=N(t[0],`
10
9
  `).split(`
11
10
  `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
12
11
  `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
@@ -20,35 +19,35 @@ ${d.join(`
20
19
  `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
21
20
  `+e.join(`
22
21
  `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
23
- `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
24
- `,1)[0],l=t[1].length,u=this.options.pedantic?N(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>N(e,l)),d=e.split(`
22
+ `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
23
+ `,1)[0],l=t[1].length,u=this.options.pedantic?I(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>I(e,l)),d=e.split(`
25
24
  `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
26
25
  `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
27
26
  `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
28
27
  `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
29
28
  `+d}f=!d.trim(),r+=l+`
30
- `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=$e(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=j(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:A(t[0],`
31
- `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Qe(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
32
- `):[],a={type:`table`,raw:A(t[0],`
33
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Qe(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:A(t[0],`
29
+ `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Xe(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&F(t[2],`()`)!==-1)return;let e=P(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:N(t[0],`
30
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ye(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
31
+ `):[],a={type:`table`,raw:N(t[0],`
32
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Ye(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:N(t[0],`
34
33
  `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
35
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&nt(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=A(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=M(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),et(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&nt(e,n[1],r,this.rules))return;let i=t[j((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return et(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Xe(t[0]),escaped:e}}}},P=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t,this.options.tokenizer=this.options.tokenizer||new rt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let n={other:s,block:Ke.normal,inline:qe.normal};this.options.pedantic?(n.block=Ke.pedantic,n.inline=qe.pedantic):this.options.gfm&&(n.block=Ke.gfm,n.inline=this.options.breaks?qe.breaks:qe.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ke,inline:qe}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(s.carriageReturn,`
34
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&$e(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=N(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=F(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),Ze(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&$e(e,n[1],r,this.rules))return;let i=t[P((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Ze(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:qe(t[0]),escaped:e}}}},L=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t,this.options.tokenizer=this.options.tokenizer||new et,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:s,block:Ge.normal,inline:A.normal};this.options.pedantic?(n.block=Ge.pedantic,n.inline=A.pedantic):this.options.gfm&&(n.block=Ge.gfm,n.inline=this.options.breaks?A.breaks:A.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ge,inline:A}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(s.carriageReturn,`
36
35
  `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(s.tabCharGlobal,` `).replace(s.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
37
36
  `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
38
37
  `)?``:`
39
38
  `)+i.raw,n.text+=`
40
- `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
39
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
41
40
  `)?``:`
42
41
  `)+i.raw,n.text+=`
43
- `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
42
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
44
43
  `)?``:`
45
44
  `)+i.raw,r.text+=`
46
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
45
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
47
46
  `)?``:`
48
47
  `)+i.raw,n.text+=`
49
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,j(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,j(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},it=class{options;parser;constructor(e){this.options=e||t}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(s.notSpaceStart)?.[0],i=e?e.replace(s.endingNewline,``)+`
50
- `:``;return r?`<pre><code class="language-`+k(r)+`">`+(n?i:k(i,!0))+`</code></pre>
51
- `:`<pre><code>`+(n?i:k(i,!0))+`</code></pre>
48
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,P(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,P(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},tt=class{options;parser;constructor(e){this.options=e||t}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(s.notSpaceStart)?.[0],i=e?e.replace(s.endingNewline,``)+`
49
+ `:``;return r?`<pre><code class="language-`+M(r)+`">`+(n?i:M(i,!0))+`</code></pre>
50
+ `:`<pre><code>`+(n?i:M(i,!0))+`</code></pre>
52
51
  `}blockquote({tokens:e}){return`<blockquote>
53
52
  ${this.parser.parse(e)}</blockquote>
54
53
  `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
@@ -64,34 +63,34 @@ ${this.parser.parse(e)}</blockquote>
64
63
  `}tablerow({text:e}){return`<tr>
65
64
  ${e}</tr>
66
65
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
67
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${k(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?k(n,!0):this.parser.parseInline(r),o=Ze(e);if(o===null)return a;e=k(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+k(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ze(e);if(i===null)return k(n);e=i;let a=`<img src="${k(e)}" alt="${k(n)}"`;return t&&(a+=` title="${k(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:k(e.text)}},at=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},F=class e{options;renderer;textRenderer;constructor(e){this.options=e||t,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new at}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},I=class{options;block;constructor(e){this.options=e||t}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?P.lex:P.lexInline}provideParser(e=this.block){return e?F.parse:F.parseInline}},ot=class{defaults=e();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=F;Renderer=it;TextRenderer=at;Lexer=P;Tokenizer=rt;Hooks=I;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new it(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new rt(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new I;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=I.passThroughHooks.has(n)?e=>{if(this.defaults.async&&I.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return P.lex(e,t??this.defaults)}parser(e,t){return F.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?P.lex:P.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?F.parse:F.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?P.lex:P.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?F.parse:F.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
68
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+k(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},L=new ot;function R(e,t){return L.parse(e,t)}R.options=R.setOptions=function(e){return L.setOptions(e),R.defaults=L.defaults,n(R.defaults),R},R.getDefaults=e,R.defaults=t;function st(...e){return L.use(...e),R.defaults=L.defaults,n(R.defaults),R}R.use=st,R.walkTokens=function(e,t){return L.walkTokens(e,t)},R.parseInline=L.parseInline,R.Parser=F,R.parser=F.parse,R.Renderer=it,R.TextRenderer=at,R.Lexer=P,R.lexer=P.lex,R.Tokenizer=rt,R.Hooks=I,R.parse=R,R.options,R.setOptions,R.walkTokens,R.parseInline,F.parse,P.lex;function ct(e,t){this.v=e,this.k=t}function lt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ut(e){if(Array.isArray(e))return e}function dt(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ft(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
69
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pt(e,t){return ut(e)||dt(e,t)||mt(e,t)||ft()}function mt(e,t){if(e){if(typeof e==`string`)return lt(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,t):void 0}}function ht(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof ct;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}ht.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},ht.prototype.next=function(e){return this._invoke(`next`,e)},ht.prototype.throw=function(e){return this._invoke(`throw`,e)},ht.prototype.return=function(e){return this._invoke(`return`,e)};var gt=Object.entries,z=Object.setPrototypeOf,_t=Object.isFrozen,vt=Object.getPrototypeOf,yt=Object.getOwnPropertyDescriptor,B=Object.freeze,V=Object.seal,bt=Object.create,xt=typeof Reflect<`u`&&Reflect,St=xt.apply,Ct=xt.construct;B||=function(e){return e},V||=function(e){return e},St||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},Ct||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var wt=K(Array.prototype.forEach);Array.prototype.indexOf;var Tt=K(Array.prototype.lastIndexOf),Et=K(Array.prototype.pop),Dt=K(Array.prototype.push);Array.prototype.slice;var Ot=K(Array.prototype.splice),kt=Array.isArray,At=K(String.prototype.toLowerCase),jt=K(String.prototype.toString),Mt=K(String.prototype.match),Nt=K(String.prototype.replace),Pt=K(String.prototype.indexOf),Ft=K(String.prototype.trim),It=K(Number.prototype.toString),Lt=K(Boolean.prototype.toString),Rt=typeof BigInt>`u`?null:K(BigInt.prototype.toString),zt=typeof Symbol>`u`?null:K(Symbol.prototype.toString),H=K(Object.prototype.hasOwnProperty),U=K(Object.prototype.toString),W=K(RegExp.prototype.test),G=Bt(TypeError);function K(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return St(e,t,r)}}function Bt(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ct(e,n)}}function q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:At;if(z&&z(e,null),!kt(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(_t(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Vt(e){for(let t=0;t<e.length;t++)H(e,t)||(e[t]=null);return e}function J(e){let t=bt(null);for(let r of gt(e)){var n=pt(r,2);let i=n[0],a=n[1];H(e,i)&&(t[i]=kt(a)?Vt(a):a&&typeof a==`object`&&a.constructor===Object?J(a):a)}return t}function Ht(e){switch(typeof e){case`string`:return e;case`number`:return It(e);case`boolean`:return Lt(e);case`bigint`:return Rt?Rt(e):`0`;case`symbol`:return zt?zt(e):`Symbol()`;case`undefined`:return U(e);case`function`:case`object`:{if(e===null)return U(e);let t=e,n=Y(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:U(e)}return U(e)}default:return U(e)}}function Y(e,t){for(;e!==null;){let n=yt(e,t);if(n){if(n.get)return K(n.get);if(typeof n.value==`function`)return K(n.value)}e=vt(e)}function n(){return null}return n}function Ut(e){try{return W(e,``),!0}catch{return!1}}var Wt=B(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Gt=B(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Kt=B([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),qt=B([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Jt=B(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Yt=B([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Xt=B([`#text`]),Zt=B(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Qt=B(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),$t=B(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),en=B([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),tn=V(/{{[\w\W]*|^[\w\W]*}}/g),nn=V(/<%[\w\W]*|^[\w\W]*%>/g),rn=V(/\${[\w\W]*/g),an=V(/^data-[\-\w.\u00B7-\uFFFF]+$/),on=V(/^aria-[\-\w]+$/),sn=V(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cn=V(/^(?:\w+script|data):/i),ln=V(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),un=V(/^html$/i),dn=V(/^[a-z][.\w]*(-[.\w]+)+$/i),fn=V(/<[/\w!]/g),pn=V(/<[/\w]/g),mn=V(/<\/no(script|embed|frames)/i),hn=V(/\/>/i),X={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Z=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],gn=B(q({},Z)),_n=function(){let e={};return wt(Z,t=>{e[t]=V(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),B(e)}(),vn=function(){return typeof window>`u`?null:window},yn=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},bn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},xn=function(e,t,n,r){return H(e,t)&&kt(e[t])?q(r.base?J(r.base):{},e[t],r.transform):n},Sn=function(e,t,n){let r=H(e,t)?e[t]:void 0;return r&&typeof r==`object`?J(r):n()};function Cn(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vn(),t=e=>Cn(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==X.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Y(d,`cloneNode`),p=Y(d,`remove`),m=Y(d,`removeAttributeNode`),h=Y(d,`nextSibling`),g=Y(d,`childNodes`),_=Y(d,`parentNode`),v=Y(d,`shadowRoot`),ee=Y(d,`attributes`),te=o&&o.prototype?Y(o.prototype,`nodeType`):null,ne=o&&o.prototype?Y(o.prototype,`nodeName`):null,y=o&&o.prototype?Y(o.prototype,`ownerDocument`):null,b=function(e){return te?te(e):e.nodeType},re=function(e){return ne?ne(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,ie=``,ae,oe=!1,se=0,ce=function(){if(se>0)throw G(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},le=function(e){ce(),se++;try{return x.createHTML(e)}finally{se--}},ue=function(e){ce(),se++;try{return x.createScriptURL(e)}finally{se--}},de=function(){return oe||=(ae=yn(u,i),!0),ae},fe=n,pe=fe.implementation,S=fe.createNodeIterator,me=fe.createDocumentFragment,he=fe.getElementsByTagName,ge=r.importNode,C=bn();t.isSupported=typeof gt==`function`&&typeof _==`function`&&pe&&pe.createHTMLDocument!==void 0;let _e=tn,ve=nn,ye=rn,be=an,xe=on,Se=cn,Ce=ln,we=dn,Te=sn,w=null,Ee=q({},[...Wt,...Gt,...Kt,...Jt,...Xt]),T=null,De=q({},[...Zt,...Qt,...$t,...en]),E=Object.seal(bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,ke=null,D=Object.seal(bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ae=!0,je=!0,Me=!1,Ne=!0,O=!1,Pe=!0,Fe=!1,Ie=!1,Le=null,Re=null,ze=!1,Be=!1,Ve=!1,He=!1,Ue=!0,We=!1,Ge=`user-content-`,Ke=!0,qe=!1,Je={},Ye=null,k=q({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Xe=null,Ze=q({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Qe=null,A=q({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),$e=`http://www.w3.org/1998/Math/MathML`,j=`http://www.w3.org/2000/svg`,M=`http://www.w3.org/1999/xhtml`,N=M,et=!1,tt=null,nt=q({},[$e,j,M],jt),rt=B([`mi`,`mo`,`mn`,`ms`,`mtext`]),P=q({},rt),it=B([`annotation-xml`]),at=q({},it),F=q({},[`title`,`style`,`font`,`a`,`script`]),I=null,ot=[`application/xhtml+xml`,`text/html`],L=null,R=null,st=n.createElement(`form`),ct=function(e){return e instanceof RegExp||e instanceof Function},lt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(R&&R===e)return;(!e||typeof e!=`object`)&&(e={}),e=J(e),I=ot.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,L=I===`application/xhtml+xml`?jt:At,w=xn(e,`ALLOWED_TAGS`,Ee,{transform:L}),T=xn(e,`ALLOWED_ATTR`,De,{transform:L}),tt=xn(e,`ALLOWED_NAMESPACES`,nt,{transform:jt}),Qe=xn(e,`ADD_URI_SAFE_ATTR`,A,{transform:L,base:A}),Xe=xn(e,`ADD_DATA_URI_TAGS`,Ze,{transform:L,base:Ze}),Ye=xn(e,`FORBID_CONTENTS`,k,{transform:L}),Oe=xn(e,`FORBID_TAGS`,J({}),{transform:L}),ke=xn(e,`FORBID_ATTR`,J({}),{transform:L}),Je=H(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?J(e.USE_PROFILES):e.USE_PROFILES:!1,Ae=e.ALLOW_ARIA_ATTR!==!1,je=e.ALLOW_DATA_ATTR!==!1,Me=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ne=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,O=e.SAFE_FOR_TEMPLATES||!1,Pe=e.SAFE_FOR_XML!==!1,Fe=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,Ve=e.RETURN_DOM_FRAGMENT||!1,He=e.RETURN_TRUSTED_TYPE||!1,ze=e.FORCE_BODY||!1,Ue=e.SANITIZE_DOM!==!1,We=e.SANITIZE_NAMED_PROPS||!1,Ke=e.KEEP_CONTENT!==!1,qe=e.IN_PLACE||!1,Te=Ut(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:sn,N=typeof e.NAMESPACE==`string`?e.NAMESPACE:M,P=Sn(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>q({},rt)),at=Sn(e,`HTML_INTEGRATION_POINTS`,()=>q({},it));let t=Sn(e,`CUSTOM_ELEMENT_HANDLING`,()=>bt(null));if(E=bt(null),H(t,`tagNameCheck`)&&ct(t.tagNameCheck)&&(E.tagNameCheck=t.tagNameCheck),H(t,`attributeNameCheck`)&&ct(t.attributeNameCheck)&&(E.attributeNameCheck=t.attributeNameCheck),H(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(E.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),V(E),O&&(je=!1),Ve&&(Be=!0),Je&&(w=q({},Xt),T=bt(null),Je.html===!0&&(q(w,Wt),q(T,Zt)),Je.svg===!0&&(q(w,Gt),q(T,Qt),q(T,en)),Je.svgFilters===!0&&(q(w,Kt),q(T,Qt),q(T,en)),Je.mathMl===!0&&(q(w,Jt),q(T,$t),q(T,en))),D.tagCheck=null,D.attributeCheck=null,H(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?D.tagCheck=e.ADD_TAGS:kt(e.ADD_TAGS)&&(w===Ee&&(w=J(w)),q(w,e.ADD_TAGS,L))),H(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?D.attributeCheck=e.ADD_ATTR:kt(e.ADD_ATTR)&&(T===De&&(T=J(T)),q(T,e.ADD_ATTR,L))),H(e,`ADD_FORBID_CONTENTS`)&&kt(e.ADD_FORBID_CONTENTS)&&(Ye===k&&(Ye=J(Ye)),q(Ye,e.ADD_FORBID_CONTENTS,L)),Ke&&(w[`#text`]=!0),Fe&&q(w,[`html`,`head`,`body`]),w.table&&(q(w,[`tbody`]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw G(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw G(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{ie=le(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,ie=``):(x===void 0&&(x=de()),x&&typeof ie==`string`&&(ie=le(``)));B&&B(e),R=e},ut=q({},[...Gt,...Kt,...qt]),dt=q({},[...Jt,...Yt]),ft=function(e,t,n){return t.namespaceURI===M?e===`svg`:t.namespaceURI===$e?e===`svg`&&(n===`annotation-xml`||P[n]):!!ut[e]},pt=function(e,t,n){return t.namespaceURI===M?e===`math`:t.namespaceURI===j?e===`math`&&at[n]:!!dt[e]},mt=function(e,t,n){return t.namespaceURI===j&&!at[n]||t.namespaceURI===$e&&!P[n]?!1:!dt[e]&&(F[e]||!ut[e])},ht=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:N,tagName:`template`});let n=At(e.tagName),r=At(t.tagName);return tt[e.namespaceURI]?e.namespaceURI===j?ft(n,t,r):e.namespaceURI===$e?pt(n,t,r):e.namespaceURI===M?mt(n,t,r):!!(I===`application/xhtml+xml`&&tt[e.namespaceURI]):!1},z=function(e){Dt(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw G(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},_t=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},vt=function(e){St(e);let t=g(e);if(t){let e=[];wt(t,t=>{Dt(e,t)}),wt(e,e=>{try{p(e)}catch{}})}let n=ee(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&_t(e,r,i)}},yt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Dt(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Be||Ve)try{z(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},xt=function(e){let t=ee(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||T[L(i)]||_t(e,r,i)}},St=function(e){let t=[e];for(;t.length>0;){let e=t.pop();b(e)===X.element&&xt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Ct=function(e,t){return Pe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},It=function(e){if(!Pe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=b(e);if(n===X.processingInstruction||n===X.comment&&W(pn,e.data)){try{p(e)}catch{}continue}if(n===X.element){let t=e,n=L(re(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Ct(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Lt=function(e){let t=null,r=null;if(ze)e=`<remove></remove>`+e;else{let t=Mt(e,/^[\r\n\t ]+/);r=t&&t[0]}I===`application/xhtml+xml`&&N===M&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?le(e):e;if(N===M)try{t=new l().parseFromString(i,I)}catch{}if(!t||!t.documentElement){t=pe.createDocument(N,`template`,null);try{t.documentElement.innerHTML=et?ie:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),N===M?he.call(t,Fe?`html`:`body`)[0]:Fe?t.documentElement:a},Rt=function(e){let t=y?y(e):e.ownerDocument;return S.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},zt=function(e){return e=Nt(e,_e,` `),e=Nt(e,ve,` `),e=Nt(e,ye,` `),e},U=function(e){e.normalize();let t=y?y(e):e.ownerDocument,n=S.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=zt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&wt(i,e=>{Bt(e.content)&&U(e.content)})},K=function(e){let t=ne?ne(e):null;return typeof t!=`string`||L(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==ee(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==te(e)||e.childNodes!==g(e)},Bt=function(e){if(!te||typeof e!=`object`||!e)return!1;try{return te(e)===X.documentFragment}catch{return!1}},Vt=function(e){if(!te||typeof e!=`object`||!e)return!1;try{return typeof te(e)==`number`}catch{return!1}};function Z(e,n,r){e.length!==0&&wt(e,e=>{e.call(t,n,r,R)})}let wn=function(e,t){return!!(Pe&&e.hasChildNodes()&&!Vt(e.firstElementChild)&&W(fn,e.textContent)&&W(fn,e.innerHTML)||Pe&&e.namespaceURI===M&&gn[t]&&(Vt(e.firstElementChild)||typeof e.textContent==`string`&&W(_n[t],e.textContent))||e.nodeType===X.processingInstruction||Pe&&e.nodeType===X.comment&&W(pn,e.data))},Q=function(e,t){if(e instanceof RegExp)return W(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return!!e(t,...r)}return!1},Tn=function(e,t,n){if(!Oe[t]&&jn(t)&&Q(E.tagNameCheck,t))return!1;if(Ke&&!Ye[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return z(e),!0},En=function(e,t,n,r){return e.length===0?t:t===n||t===r?J(t):t},Dn=function(e,t){return e===t||_(e)!==null?!1:(qe&&St(e),!0)},On=function(e,n){if(Z(C.beforeSanitizeElements,e,null),Dn(e,n))return!0;if(K(e))return z(e),!0;let r=L(re(e));if(w=En(C.uponSanitizeElement,w,Ee,Le),Z(C.uponSanitizeElement,e,{tagName:r,allowedTags:w}),Dn(e,n))return!0;if(wn(e,r))return z(e),!0;if(Oe[r]||!(D.tagCheck instanceof Function&&D.tagCheck(r))&&!w[r]){let t=Tn(e,r,n);return t===!1&&(Z(C.afterSanitizeElements,e,null),Dn(e,n))?!0:t}if(b(e)===X.element&&!ht(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&W(mn,e.innerHTML))return z(e),!0;if(O&&e.nodeType===X.text){let n=zt(e.textContent);e.textContent!==n&&(Dt(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Z(C.afterSanitizeElements,e,null),Dn(e,n)},kn=function(e,t,r){if(ke[t]||Ct(t,e)||Ue&&(t===`id`||t===`name`)&&(r in n||r in st))return!1;let i=T[t]||D.attributeCheck instanceof Function&&D.attributeCheck(t,e);return je&&W(be,t)||Ae&&W(xe,t)?!0:i?Qe[t]||W(Te,Nt(r,Ce,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Pt(r,`data:`)===0&&Xe[e]||Me&&!W(Se,Nt(r,Ce,``))?!0:!r:jn(e)&&Q(E.tagNameCheck,e)&&Q(E.attributeNameCheck,t,e)||t===`is`&&E.allowCustomizedBuiltInElements&&Q(E.tagNameCheck,r)},An=q({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),jn=function(e){return!An[At(e)]&&W(we,e)},Mn=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return le(r);case`TrustedScriptURL`:return ue(r)}return r},Nn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!K(e)||(z(e),!1)}catch{return yt(t,e),!1}},Pn=function(e,n){if(Z(C.beforeSanitizeAttributes,e,null),Dn(e,n))return;let r=e.attributes;if(!r||K(e))return;T=En(C.uponSanitizeAttribute,T,De,Re);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:T,forceKeepAttr:void 0},a=r.length,o=L(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=L(s),d=l,f=s===`value`?d:Ft(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Z(C.uponSanitizeAttribute,e,i),f=i.attrValue,We&&(u===`id`||u===`name`)&&Pt(f,Ge)!==0&&(yt(s,e,n),f=Ge+f,p=!0),Pe&&W(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){yt(s,e,n);continue}if(u===`attributename`&&Mt(f,`href`)){yt(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){yt(s,e,n);continue}if(!Ne&&W(hn,f)){yt(s,e,n);continue}if(O&&(f=zt(f)),!kn(o,u,f)){yt(s,e,n);continue}f=Mn(o,u,c,f),f!==d&&Nn(e,s,c,f)&&p&&Et(t.removed)}}Z(C.afterSanitizeAttributes,e,null),Dn(e,n)},Fn=function(e){let t=null,n=Rt(e);for(Z(C.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Z(C.uponSanitizeShadowNode,t,null),On(t,e),Pn(t,e),Bt(t.content)&&Fn(t.content),b(t)===X.element){let e=v(t);Bt(e)&&(In(e),Fn(e))}Z(C.afterSanitizeShadowDOM,e,null)},In=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Fn(e.shadow);continue}let n=e.node,r=b(n)===X.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=ne?ne(n):null;if(typeof e==`string`&&L(e)===`template`){let e=n.content;Bt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Bt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(et=!e,et&&(e=`<!-->`),typeof e!=`string`&&!Vt(e)&&(e=Ht(e),typeof e!=`string`))throw G(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ie?(w=Le,T=Re):lt(n),(C.uponSanitizeElement.length>0||C.uponSanitizeAttribute.length>0)&&(w=J(w)),C.uponSanitizeAttribute.length>0&&(T=J(T)),t.removed=[];let c=qe&&typeof e!=`string`&&Vt(e);if(c){It(e);let t=re(e);if(typeof t==`string`){let n=L(t);if(!w[n]||Oe[n])throw vt(e),G(`root node is forbidden and cannot be sanitized in-place`)}if(K(e))throw vt(e),G(`root node is clobbered and cannot be sanitized in-place`);try{In(e)}catch(t){throw vt(e),t}}else if(Vt(e))i=Lt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===X.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),In(i);else{if(!Be&&!O&&!Fe&&e.indexOf(`<`)===-1)return x&&He?le(e):e;if(i=Lt(e),!i)return Be?null:He?ie:``}i&&ze&&z(i.firstChild);let l=c?e:i;try{let e=Rt(l);for(;o=e.nextNode();)On(o,l),Pn(o,l),Bt(o.content)&&Fn(o.content)}catch(n){throw c&&(vt(e),wt(t.removed,e=>{e.element&&St(e.element)})),n}if(c){let n=!1;if(wt(t.removed,t=>{t.element&&(t.element===e&&(n=!0),St(t.element))}),n)throw G(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return O&&U(e),e}if(Be){if(O&&U(i),Ve)for(s=me.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(T.shadowroot||T.shadowrootmode)&&(s=ge.call(r,s,!0)),s}let u=Fe?i.outerHTML:i.innerHTML;return Fe&&w[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&W(un,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
70
- `+u),O&&(u=zt(u)),x&&He?le(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lt(e),Ie=!0,Le=w,Re=T},t.clearConfig=function(){R=null,Ie=!1,Le=null,Re=null,x=ae,ie=``},t.isValidAttribute=function(e,t,n){R||lt({});let r=L(e),i=L(t);return kn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&H(C,e)&&Dt(C[e],t)},t.removeHook=function(e,t){if(H(C,e)){if(t!==void 0){let n=Tt(C[e],t);return n===-1?void 0:Ot(C[e],n,1)[0]}return Et(C[e])}},t.removeHooks=function(e){H(C,e)&&(C[e]=[])},t.removeAllHooks=function(){C=bn()},t}var wn=Cn(),Q=class{constructor(e,t){this.editor=e,this.defaultText=`${t} text`,this.button=this.createButton(),this.title=t}createButton(e){let t=document.createElement(`button`),n=this.title?`${this.title.replace(/ /g,`-`)}-btn`.toLowerCase():``;t.innerHTML=e;let r=t.querySelector(`svg`);if(r&&r.setAttribute(`aria-hidden`,`true`),t.type=`button`,t.title=this.title?this.editor.label(this.title):this.title,t.className=`markdown-btn ${n} fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost`,t.addEventListener(`click`,e=>this.applySyntax(e)),n==`preview-btn`){let e=document.createElement(`div`);return e.className=`fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-l fj:sticky fj:-right-2 fj:px-1.5`,e.appendChild(t),e}return t}},Tn=class extends Q{constructor(e){super(e,`Bold`),this.button=this.createButton(`
66
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${M(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?M(n,!0):this.parser.parseInline(r),o=Je(e);if(o===null)return a;e=M(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+M(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Je(e);if(i===null)return M(n);e=i;let a=`<img src="${M(e)}" alt="${M(n)}"`;return t&&(a+=` title="${M(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:M(e.text)}},nt=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},R=class e{options;renderer;textRenderer;constructor(e){this.options=e||t,this.options.renderer=this.options.renderer||new tt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nt}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},z=class{options;block;constructor(e){this.options=e||t}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?L.lex:L.lexInline}provideParser(e=this.block){return e?R.parse:R.parseInline}},rt=class{defaults=e();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=R;Renderer=tt;TextRenderer=nt;Lexer=L;Tokenizer=et;Hooks=z;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new tt(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new et(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new z;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=z.passThroughHooks.has(n)?e=>{if(this.defaults.async&&z.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return L.lex(e,t??this.defaults)}parser(e,t){return R.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?L.lex:L.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?R.parse:R.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?L.lex:L.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?R.parse:R.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
67
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+M(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},B=new rt;function V(e,t){return B.parse(e,t)}V.options=V.setOptions=function(e){return B.setOptions(e),V.defaults=B.defaults,n(V.defaults),V},V.getDefaults=e,V.defaults=t;function it(...e){return B.use(...e),V.defaults=B.defaults,n(V.defaults),V}V.use=it,V.walkTokens=function(e,t){return B.walkTokens(e,t)},V.parseInline=B.parseInline,V.Parser=R,V.parser=R.parse,V.Renderer=tt,V.TextRenderer=nt,V.Lexer=L,V.lexer=L.lex,V.Tokenizer=et,V.Hooks=z,V.parse=V,V.options,V.setOptions,V.walkTokens,V.parseInline,R.parse,L.lex;function at(e,t){this.v=e,this.k=t}function ot(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function st(e){if(Array.isArray(e))return e}function ct(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function lt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
68
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ut(e,t){return st(e)||ct(e,t)||dt(e,t)||lt()}function dt(e,t){if(e){if(typeof e==`string`)return ot(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ot(e,t):void 0}}function ft(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof at;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}ft.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},ft.prototype.next=function(e){return this._invoke(`next`,e)},ft.prototype.throw=function(e){return this._invoke(`throw`,e)},ft.prototype.return=function(e){return this._invoke(`return`,e)};var pt=Object.entries,H=Object.setPrototypeOf,mt=Object.isFrozen,ht=Object.getPrototypeOf,gt=Object.getOwnPropertyDescriptor,U=Object.freeze,W=Object.seal,_t=Object.create,vt=typeof Reflect<`u`&&Reflect,yt=vt.apply,bt=vt.construct;U||=function(e){return e},W||=function(e){return e},yt||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},bt||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var xt=q(Array.prototype.forEach);Array.prototype.indexOf;var St=q(Array.prototype.lastIndexOf),Ct=q(Array.prototype.pop),wt=q(Array.prototype.push);Array.prototype.slice;var Tt=q(Array.prototype.splice),Et=Array.isArray,Dt=q(String.prototype.toLowerCase),Ot=q(String.prototype.toString),kt=q(String.prototype.match),At=q(String.prototype.replace),jt=q(String.prototype.indexOf),Mt=q(String.prototype.trim),Nt=q(Number.prototype.toString),Pt=q(Boolean.prototype.toString),Ft=typeof BigInt>`u`?null:q(BigInt.prototype.toString),It=typeof Symbol>`u`?null:q(Symbol.prototype.toString),G=q(Object.prototype.hasOwnProperty),Lt=q(Object.prototype.toString),K=q(RegExp.prototype.test),Rt=zt(TypeError);function q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return yt(e,t,r)}}function zt(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return bt(e,n)}}function J(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dt;if(H&&H(e,null),!Et(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(mt(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Bt(e){for(let t=0;t<e.length;t++)G(e,t)||(e[t]=null);return e}function Y(e){let t=_t(null);for(let r of pt(e)){var n=ut(r,2);let i=n[0],a=n[1];G(e,i)&&(t[i]=Et(a)?Bt(a):a&&typeof a==`object`&&a.constructor===Object?Y(a):a)}return t}function Vt(e){switch(typeof e){case`string`:return e;case`number`:return Nt(e);case`boolean`:return Pt(e);case`bigint`:return Ft?Ft(e):`0`;case`symbol`:return It?It(e):`Symbol()`;case`undefined`:return Lt(e);case`function`:case`object`:{if(e===null)return Lt(e);let t=e,n=X(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Lt(e)}return Lt(e)}default:return Lt(e)}}function X(e,t){for(;e!==null;){let n=gt(e,t);if(n){if(n.get)return q(n.get);if(typeof n.value==`function`)return q(n.value)}e=ht(e)}function n(){return null}return n}function Ht(e){try{return K(e,``),!0}catch{return!1}}var Ut=U(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Wt=U(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Gt=U([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Kt=U([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),qt=U(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Jt=U([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Yt=U([`#text`]),Xt=U(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Zt=U(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Qt=U(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),$t=U([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),en=W(/{{[\w\W]*|^[\w\W]*}}/g),tn=W(/<%[\w\W]*|^[\w\W]*%>/g),nn=W(/\${[\w\W]*/g),rn=W(/^data-[\-\w.\u00B7-\uFFFF]+$/),an=W(/^aria-[\-\w]+$/),on=W(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sn=W(/^(?:\w+script|data):/i),cn=W(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ln=W(/^html$/i),un=W(/^[a-z][.\w]*(-[.\w]+)+$/i),dn=W(/<[/\w!]/g),fn=W(/<[/\w]/g),pn=W(/<\/no(script|embed|frames)/i),mn=W(/\/>/i),Z={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Q=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],hn=U(J({},Q)),gn=function(){let e={};return xt(Q,t=>{e[t]=W(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),U(e)}(),_n=function(){return typeof window>`u`?null:window},vn=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},yn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},bn=function(e,t,n,r){return G(e,t)&&Et(e[t])?J(r.base?Y(r.base):{},e[t],r.transform):n},xn=function(e,t,n){let r=G(e,t)?e[t]:void 0;return r&&typeof r==`object`?Y(r):n()};function Sn(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_n(),t=e=>Sn(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==Z.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=X(d,`cloneNode`),p=X(d,`remove`),m=X(d,`removeAttributeNode`),ee=X(d,`nextSibling`),h=X(d,`childNodes`),g=X(d,`parentNode`),_=X(d,`shadowRoot`),te=X(d,`attributes`),v=o&&o.prototype?X(o.prototype,`nodeType`):null,ne=o&&o.prototype?X(o.prototype,`nodeName`):null,y=o&&o.prototype?X(o.prototype,`ownerDocument`):null,re=function(e){return v?v(e):e.nodeType},ie=function(e){return ne?ne(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,ae=``,oe,se=!1,ce=0,le=function(){if(ce>0)throw Rt(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ue=function(e){le(),ce++;try{return b.createHTML(e)}finally{ce--}},de=function(e){le(),ce++;try{return b.createScriptURL(e)}finally{ce--}},fe=function(){return se||=(oe=vn(u,i),!0),oe},pe=n,me=pe.implementation,x=pe.createNodeIterator,he=pe.createDocumentFragment,ge=pe.getElementsByTagName,_e=r.importNode,S=yn();t.isSupported=typeof pt==`function`&&typeof g==`function`&&me&&me.createHTMLDocument!==void 0;let ve=en,ye=tn,be=nn,xe=rn,Se=an,Ce=sn,we=cn,Te=un,Ee=on,C=null,De=J({},[...Ut,...Wt,...Gt,...qt,...Yt]),w=null,Oe=J({},[...Xt,...Zt,...Qt,...$t]),T=Object.seal(_t(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ke=null,Ae=null,E=Object.seal(_t(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),je=!0,Me=!0,Ne=!1,Pe=!0,D=!1,Fe=!0,O=!1,Ie=!1,Le=null,Re=null,ze=!1,k=!1,Be=!1,Ve=!1,He=!0,Ue=!1,We=`user-content-`,Ge=!0,A=!1,Ke={},j=null,M=J({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),qe=null,Je=J({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ye=null,N=J({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Xe=`http://www.w3.org/1998/Math/MathML`,P=`http://www.w3.org/2000/svg`,F=`http://www.w3.org/1999/xhtml`,I=F,Ze=!1,Qe=null,$e=J({},[Xe,P,F],Ot),et=U([`mi`,`mo`,`mn`,`ms`,`mtext`]),L=J({},et),tt=U([`annotation-xml`]),nt=J({},tt),R=J({},[`title`,`style`,`font`,`a`,`script`]),z=null,rt=[`application/xhtml+xml`,`text/html`],B=null,V=null,it=n.createElement(`form`),at=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(V&&V===e)return;(!e||typeof e!=`object`)&&(e={}),e=Y(e),z=rt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,B=z===`application/xhtml+xml`?Ot:Dt,C=bn(e,`ALLOWED_TAGS`,De,{transform:B}),w=bn(e,`ALLOWED_ATTR`,Oe,{transform:B}),Qe=bn(e,`ALLOWED_NAMESPACES`,$e,{transform:Ot}),Ye=bn(e,`ADD_URI_SAFE_ATTR`,N,{transform:B,base:N}),qe=bn(e,`ADD_DATA_URI_TAGS`,Je,{transform:B,base:Je}),j=bn(e,`FORBID_CONTENTS`,M,{transform:B}),ke=bn(e,`FORBID_TAGS`,Y({}),{transform:B}),Ae=bn(e,`FORBID_ATTR`,Y({}),{transform:B}),Ke=G(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Y(e.USE_PROFILES):e.USE_PROFILES:!1,je=e.ALLOW_ARIA_ATTR!==!1,Me=e.ALLOW_DATA_ATTR!==!1,Ne=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,D=e.SAFE_FOR_TEMPLATES||!1,Fe=e.SAFE_FOR_XML!==!1,O=e.WHOLE_DOCUMENT||!1,k=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,Ve=e.RETURN_TRUSTED_TYPE||!1,ze=e.FORCE_BODY||!1,He=e.SANITIZE_DOM!==!1,Ue=e.SANITIZE_NAMED_PROPS||!1,Ge=e.KEEP_CONTENT!==!1,A=e.IN_PLACE||!1,Ee=Ht(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:on,I=typeof e.NAMESPACE==`string`?e.NAMESPACE:F,L=xn(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>J({},et)),nt=xn(e,`HTML_INTEGRATION_POINTS`,()=>J({},tt));let t=xn(e,`CUSTOM_ELEMENT_HANDLING`,()=>_t(null));if(T=_t(null),G(t,`tagNameCheck`)&&at(t.tagNameCheck)&&(T.tagNameCheck=t.tagNameCheck),G(t,`attributeNameCheck`)&&at(t.attributeNameCheck)&&(T.attributeNameCheck=t.attributeNameCheck),G(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(T.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),W(T),D&&(Me=!1),Be&&(k=!0),Ke&&(C=J({},Yt),w=_t(null),Ke.html===!0&&(J(C,Ut),J(w,Xt)),Ke.svg===!0&&(J(C,Wt),J(w,Zt),J(w,$t)),Ke.svgFilters===!0&&(J(C,Gt),J(w,Zt),J(w,$t)),Ke.mathMl===!0&&(J(C,qt),J(w,Qt),J(w,$t))),E.tagCheck=null,E.attributeCheck=null,G(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?E.tagCheck=e.ADD_TAGS:Et(e.ADD_TAGS)&&(C===De&&(C=Y(C)),J(C,e.ADD_TAGS,B))),G(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?E.attributeCheck=e.ADD_ATTR:Et(e.ADD_ATTR)&&(w===Oe&&(w=Y(w)),J(w,e.ADD_ATTR,B))),G(e,`ADD_FORBID_CONTENTS`)&&Et(e.ADD_FORBID_CONTENTS)&&(j===M&&(j=Y(j)),J(j,e.ADD_FORBID_CONTENTS,B)),Ge&&(C[`#text`]=!0),O&&J(C,[`html`,`head`,`body`]),C.table&&(J(C,[`tbody`]),delete ke.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Rt(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Rt(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=b;b=e.TRUSTED_TYPES_POLICY;try{ae=ue(``)}catch(e){throw b=t,e}}else e.TRUSTED_TYPES_POLICY===null?(b=void 0,ae=``):(b===void 0&&(b=fe()),b&&typeof ae==`string`&&(ae=ue(``)));U&&U(e),V=e},st=J({},[...Wt,...Gt,...Kt]),ct=J({},[...qt,...Jt]),lt=function(e,t,n){return t.namespaceURI===F?e===`svg`:t.namespaceURI===Xe?e===`svg`&&(n===`annotation-xml`||L[n]):!!st[e]},ut=function(e,t,n){return t.namespaceURI===F?e===`math`:t.namespaceURI===P?e===`math`&&nt[n]:!!ct[e]},dt=function(e,t,n){return t.namespaceURI===P&&!nt[n]||t.namespaceURI===Xe&&!L[n]?!1:!ct[e]&&(R[e]||!st[e])},ft=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:I,tagName:`template`});let n=Dt(e.tagName),r=Dt(t.tagName);return Qe[e.namespaceURI]?e.namespaceURI===P?lt(n,t,r):e.namespaceURI===Xe?ut(n,t,r):e.namespaceURI===F?dt(n,t,r):!!(z===`application/xhtml+xml`&&Qe[e.namespaceURI]):!1},H=function(e){wt(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw Rt(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},mt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},ht=function(e){yt(e);let t=h(e);if(t){let e=[];xt(t,t=>{wt(e,t)}),xt(e,e=>{try{p(e)}catch{}})}let n=te(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&mt(e,r,i)}},gt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}wt(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(k||Be)try{H(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},vt=function(e){let t=te(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||w[B(i)]||mt(e,r,i)}},yt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();re(e)===Z.element&&vt(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},bt=function(e,t){return Fe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Nt=function(e){if(!Fe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=re(e);if(n===Z.processingInstruction||n===Z.comment&&K(fn,e.data)){try{p(e)}catch{}continue}if(n===Z.element){let t=e,n=B(ie(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&bt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Pt=function(e){let t=null,r=null;if(ze)e=`<remove></remove>`+e;else{let t=kt(e,/^[\r\n\t ]+/);r=t&&t[0]}z===`application/xhtml+xml`&&I===F&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?ue(e):e;if(I===F)try{t=new l().parseFromString(i,z)}catch{}if(!t||!t.documentElement){t=me.createDocument(I,`template`,null);try{t.documentElement.innerHTML=Ze?ae:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),I===F?ge.call(t,O?`html`:`body`)[0]:O?t.documentElement:a},Ft=function(e){let t=y?y(e):e.ownerDocument;return x.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},It=function(e){return e=At(e,ve,` `),e=At(e,ye,` `),e=At(e,be,` `),e},Lt=function(e){e.normalize();let t=y?y(e):e.ownerDocument,n=x.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=It(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&xt(i,e=>{zt(e.content)&&Lt(e.content)})},q=function(e){let t=ne?ne(e):null;return typeof t!=`string`||B(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==te(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==v(e)||e.childNodes!==h(e)},zt=function(e){if(!v||typeof e!=`object`||!e)return!1;try{return v(e)===Z.documentFragment}catch{return!1}},Bt=function(e){if(!v||typeof e!=`object`||!e)return!1;try{return typeof v(e)==`number`}catch{return!1}};function Q(e,n,r){e.length!==0&&xt(e,e=>{e.call(t,n,r,V)})}let Cn=function(e,t){return!!(Fe&&e.hasChildNodes()&&!Bt(e.firstElementChild)&&K(dn,e.textContent)&&K(dn,e.innerHTML)||Fe&&e.namespaceURI===F&&hn[t]&&(Bt(e.firstElementChild)||typeof e.textContent==`string`&&K(gn[t],e.textContent))||e.nodeType===Z.processingInstruction||Fe&&e.nodeType===Z.comment&&K(fn,e.data))},$=function(e,t){if(e instanceof RegExp)return K(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return!!e(t,...r)}return!1},wn=function(e,t,n){if(!ke[t]&&An(t)&&$(T.tagNameCheck,t))return!1;if(Ge&&!j[t]){let t=g(e),r=h(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,ee(e))}}}return H(e),!0},Tn=function(e,t,n,r){return e.length===0?t:t===n||t===r?Y(t):t},En=function(e,t){return e===t||g(e)!==null?!1:(A&&yt(e),!0)},Dn=function(e,n){if(Q(S.beforeSanitizeElements,e,null),En(e,n))return!0;if(q(e))return H(e),!0;let r=B(ie(e));if(C=Tn(S.uponSanitizeElement,C,De,Le),Q(S.uponSanitizeElement,e,{tagName:r,allowedTags:C}),En(e,n))return!0;if(Cn(e,r))return H(e),!0;if(ke[r]||!(E.tagCheck instanceof Function&&E.tagCheck(r))&&!C[r]){let t=wn(e,r,n);return t===!1&&(Q(S.afterSanitizeElements,e,null),En(e,n))?!0:t}if(re(e)===Z.element&&!ft(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&K(pn,e.innerHTML))return H(e),!0;if(D&&e.nodeType===Z.text){let n=It(e.textContent);e.textContent!==n&&(wt(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Q(S.afterSanitizeElements,e,null),En(e,n)},On=function(e,t,r){if(Ae[t]||bt(t,e)||He&&(t===`id`||t===`name`)&&(r in n||r in it))return!1;let i=w[t]||E.attributeCheck instanceof Function&&E.attributeCheck(t,e);return Me&&K(xe,t)||je&&K(Se,t)?!0:i?Ye[t]||K(Ee,At(r,we,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&jt(r,`data:`)===0&&qe[e]||Ne&&!K(Ce,At(r,we,``))?!0:!r:An(e)&&$(T.tagNameCheck,e)&&$(T.attributeNameCheck,t,e)||t===`is`&&T.allowCustomizedBuiltInElements&&$(T.tagNameCheck,r)},kn=J({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),An=function(e){return!kn[Dt(e)]&&K(Te,e)},jn=function(e,t,n,r){if(b&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ue(r);case`TrustedScriptURL`:return de(r)}return r},Mn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!q(e)||(H(e),!1)}catch{return gt(t,e),!1}},Nn=function(e,n){if(Q(S.beforeSanitizeAttributes,e,null),En(e,n))return;let r=e.attributes;if(!r||q(e))return;w=Tn(S.uponSanitizeAttribute,w,Oe,Re);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0},a=r.length,o=B(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=B(s),d=l,f=s===`value`?d:Mt(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Q(S.uponSanitizeAttribute,e,i),f=i.attrValue,Ue&&(u===`id`||u===`name`)&&jt(f,We)!==0&&(gt(s,e,n),f=We+f,p=!0),Fe&&K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||u===`attributename`&&kt(f,`href`)?gt(s,e,n):i.forceKeepAttr||(i.keepAttr?!Pe&&K(mn,f)?gt(s,e,n):(D&&(f=It(f)),On(o,u,f)?(f=jn(o,u,c,f),f!==d&&Mn(e,s,c,f)&&p&&Ct(t.removed)):gt(s,e,n)):gt(s,e,n))}Q(S.afterSanitizeAttributes,e,null),En(e,n)},Pn=function(e){let t=null,n=Ft(e);for(Q(S.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Q(S.uponSanitizeShadowNode,t,null),Dn(t,e),Nn(t,e),zt(t.content)&&Pn(t.content),re(t)===Z.element){let e=_(t);zt(e)&&(Fn(e),Pn(e))}Q(S.afterSanitizeShadowDOM,e,null)},Fn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Pn(e.shadow);continue}let n=e.node,r=re(n)===Z.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=ne?ne(n):null;if(typeof e==`string`&&B(e)===`template`){let e=n.content;zt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);zt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ze=!e,Ze&&(e=`<!-->`),typeof e!=`string`&&!Bt(e)&&(e=Vt(e),typeof e!=`string`))throw Rt(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ie?(C=Le,w=Re):ot(n),(S.uponSanitizeElement.length>0||S.uponSanitizeAttribute.length>0)&&(C=Y(C)),S.uponSanitizeAttribute.length>0&&(w=Y(w)),t.removed=[];let c=A&&typeof e!=`string`&&Bt(e);if(c){Nt(e);let t=ie(e);if(typeof t==`string`){let n=B(t);if(!C[n]||ke[n])throw ht(e),Rt(`root node is forbidden and cannot be sanitized in-place`)}if(q(e))throw ht(e),Rt(`root node is clobbered and cannot be sanitized in-place`);try{Fn(e)}catch(t){throw ht(e),t}}else if(Bt(e))i=Pt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Z.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Fn(i);else{if(!k&&!D&&!O&&e.indexOf(`<`)===-1)return b&&Ve?ue(e):e;if(i=Pt(e),!i)return k?null:Ve?ae:``}i&&ze&&H(i.firstChild);let l=c?e:i;try{let e=Ft(l);for(;o=e.nextNode();)Dn(o,l),Nn(o,l),zt(o.content)&&Pn(o.content)}catch(n){throw c&&(ht(e),xt(t.removed,e=>{e.element&&yt(e.element)})),n}if(c){let n=!1;if(xt(t.removed,t=>{t.element&&(t.element===e&&(n=!0),yt(t.element))}),n)throw Rt(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return D&&Lt(e),e}if(k){if(D&&Lt(i),Be)for(s=he.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(w.shadowroot||w.shadowrootmode)&&(s=_e.call(r,s,!0)),s}let u=O?i.outerHTML:i.innerHTML;return O&&C[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&K(ln,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
69
+ `+u),D&&(u=It(u)),b&&Ve?ue(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ot(e),Ie=!0,Le=C,Re=w},t.clearConfig=function(){V=null,Ie=!1,Le=null,Re=null,b=oe,ae=``},t.isValidAttribute=function(e,t,n){V||ot({});let r=B(e),i=B(t);return On(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&G(S,e)&&wt(S[e],t)},t.removeHook=function(e,t){if(G(S,e)){if(t!==void 0){let n=St(S[e],t);return n===-1?void 0:Tt(S[e],n,1)[0]}return Ct(S[e])}},t.removeHooks=function(e){G(S,e)&&(S[e]=[])},t.removeAllHooks=function(){S=yn()},t}var Cn=Sn(),$=class{constructor(e,t){this.editor=e,this.defaultText=`${t} text`,this.button=this.createButton(),this.title=t}createButton(e){let t=document.createElement(`button`),n=this.title?`${this.title.replace(/ /g,`-`)}-btn`.toLowerCase():``;t.innerHTML=e;let r=t.querySelector(`svg`);if(r&&r.setAttribute(`aria-hidden`,`true`),t.type=`button`,t.title=this.title?this.editor.label(this.title):this.title,t.className=`markdown-btn ${n} fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost`,t.addEventListener(`click`,e=>this.applySyntax(e)),n==`preview-btn`){let e=document.createElement(`div`);return e.className=`fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-l fj:sticky fj:-right-2 fj:px-1.5`,e.appendChild(t),e}return t}},wn=class extends ${constructor(e){super(e,`Bold`),this.button=this.createButton(`
71
70
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 5h6a3.5 3.5 0 0 1 0 7h-6l0 -7" /><path d="M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" /></svg>
72
- `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`***`)&&i.endsWith(`***`))a=`*`+i.slice(3,-3)+`*`;else if(i.startsWith(`**`)&&i.endsWith(`**`))a=i.slice(2,-2);else if(r.substring(t-3,t)===`***`&&r.substring(n,n+3)===`***`){e.setSelectionRange(t-3,n+3),this.editor.insertText(`*${i}*`,1,1);return}else if(r.substring(t-2,t)===`**`&&r.substring(n,n+2)===`**`&&r[t-3]!==`*`&&r[n+2]!==`*`){e.setSelectionRange(t-2,n+2),this.editor.insertText(i,0,0);return}else a=`**${i||`Bold text`}**`,i||(o=2);this.editor.insertText(a,o,o)}},En=class extends Q{constructor(e){super(e,`Italic`),this.button=this.createButton(`
71
+ `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`***`)&&i.endsWith(`***`))a=`*`+i.slice(3,-3)+`*`;else if(i.startsWith(`**`)&&i.endsWith(`**`))a=i.slice(2,-2);else if(r.substring(t-3,t)===`***`&&r.substring(n,n+3)===`***`){e.setSelectionRange(t-3,n+3),this.editor.insertText(`*${i}*`,1,1);return}else if(r.substring(t-2,t)===`**`&&r.substring(n,n+2)===`**`&&r[t-3]!==`*`&&r[n+2]!==`*`){e.setSelectionRange(t-2,n+2),this.editor.insertText(i,0,0);return}else a=`**${i||`Bold text`}**`,i||(o=2);this.editor.insertText(a,o,o)}},Tn=class extends ${constructor(e){super(e,`Italic`),this.button=this.createButton(`
73
72
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M11 5l6 0" /><path d="M7 19l6 0" /><path d="M14 5l-4 14" /></svg>
74
- `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`***`)&&i.endsWith(`***`))a=`**`+i.slice(3,-3)+`**`;else if(i.startsWith(`*`)&&i.endsWith(`*`)&&!i.startsWith(`**`))a=i.slice(1,-1);else if(r.substring(t-3,t)===`***`&&r.substring(n,n+3)===`***`){e.setSelectionRange(t-3,n+3),this.editor.insertText(`**${i}**`,2,2);return}else if(r[t-1]===`*`&&r[n]===`*`&&r[t-2]!==`*`&&r[n+1]!==`*`){e.setSelectionRange(t-1,n+1),this.editor.insertText(i,0,0);return}else a=`*${i||`Italic text`}*`,i||(o=1);this.editor.insertText(a,o,o)}},Dn=class extends Q{constructor(e){super(e,`Strikethrough`),this.button=this.createButton(`
73
+ `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`***`)&&i.endsWith(`***`))a=`**`+i.slice(3,-3)+`**`;else if(i.startsWith(`*`)&&i.endsWith(`*`)&&!i.startsWith(`**`))a=i.slice(1,-1);else if(r.substring(t-3,t)===`***`&&r.substring(n,n+3)===`***`){e.setSelectionRange(t-3,n+3),this.editor.insertText(`**${i}**`,2,2);return}else if(r[t-1]===`*`&&r[n]===`*`&&r[t-2]!==`*`&&r[n+1]!==`*`){e.setSelectionRange(t-1,n+1),this.editor.insertText(i,0,0);return}else a=`*${i||`Italic text`}*`,i||(o=1);this.editor.insertText(a,o,o)}},En=class extends ${constructor(e){super(e,`Strikethrough`),this.button=this.createButton(`
75
74
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0" /><path d="M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5" /></svg>
76
- `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`~~`)&&i.endsWith(`~~`))a=i.slice(2,-2);else if(r.substring(t-2,t)===`~~`&&r.substring(n,n+2)===`~~`){e.setSelectionRange(t-2,n+2),this.editor.insertText(i,0,0);return}else a=`~~${i||`Strikethrough text`}~~`,o=2;this.editor.insertText(a,o,o)}},On=class extends Q{constructor(e){super(e,`Unordered list`),this.button=this.createButton(`
75
+ `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`~~`)&&i.endsWith(`~~`))a=i.slice(2,-2);else if(r.substring(t-2,t)===`~~`&&r.substring(n,n+2)===`~~`){e.setSelectionRange(t-2,n+2),this.editor.insertText(i,0,0);return}else a=`~~${i||`Strikethrough text`}~~`,o=2;this.editor.insertText(a,o,o)}},Dn=class extends ${constructor(e){super(e,`Unordered list`),this.button=this.createButton(`
77
76
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l11 0" /><path d="M9 12l11 0" /><path d="M9 18l11 0" /><path d="M5 6l0 .01" /><path d="M5 12l0 .01" /><path d="M5 18l0 .01" /></svg>
78
- `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`- `))a=i.slice(2);else if(r.substring(t-2,t)===`- `){e.setSelectionRange(t-2,n),this.editor.insertText(i,0,0);return}else a=`- ${i||`Unordered list`}`,o=2;this.editor.insertText(a,o)}},kn=class extends Q{constructor(e){super(e,`Ordered list`),this.button=this.createButton(`
77
+ `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`- `))a=i.slice(2);else if(r.substring(t-2,t)===`- `){e.setSelectionRange(t-2,n),this.editor.insertText(i,0,0);return}else a=`- ${i||`Unordered list`}`,o=2;this.editor.insertText(a,o)}},On=class extends ${constructor(e){super(e,`Ordered list`),this.button=this.createButton(`
79
78
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M11 6h9" /><path d="M11 12h9" /><path d="M12 18h8" /><path d="M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" /><path d="M6 10v-6l-2 2" /></svg>
80
- `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`1. `))a=i.slice(3);else if(r.substring(t-3,t)===`1. `){e.setSelectionRange(t-3,n),this.editor.insertText(i,0,0);return}else a=`1. ${i||`Ordered list`}`,o=3;this.editor.insertText(a,o)}},An=class extends Q{constructor(e){super(e,`Preview`),this.preview=!0,this.button=this.createButton(`
79
+ `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`1. `))a=i.slice(3);else if(r.substring(t-3,t)===`1. `){e.setSelectionRange(t-3,n),this.editor.insertText(i,0,0);return}else a=`1. ${i||`Ordered list`}`,o=3;this.editor.insertText(a,o)}},kn=class extends ${constructor(e){super(e,`Preview`),this.preview=!0,this.button=this.createButton(`
81
80
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 4v16" /><path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14" /><path d="M12 13l7.5 -7.5" /><path d="M12 18l8 -8" /><path d="M15 20l5 -5" /><path d="M12 8l4 -4" /></svg>
82
- `);let t=this.button.querySelector(`button`);t&&t.setAttribute(`aria-pressed`,`false`)}applySyntax(){let e=this.editor.previewContent?.parentNode,t=this.editor.markdownEditorDiv;e&&t&&(this.editor.preview&&this.preview?this.enablePreview(e,t):this.disablePreview(e,t))}disablePreview(e,t){this.preview=!0;let n=t.querySelector(`.textarea-wrapper`);t.parentNode.classList.remove(`is-fullscreen`),t.classList.remove(`fj:md:grid-cols-2`),e.classList.add(`fj:hidden`),n.classList.remove(`fj:hidden`,`fj:md:grid`),n.querySelector(`textarea`).classList.remove(`fj:h-full!`),n.querySelector(`.display-layer`)&&n.querySelector(`.display-layer`).classList.remove(`fj:h-full!`),e.classList.remove(`fj:min-h-0`),document.querySelector(`body`).classList.remove(`fj:overflow-hidden`),document.removeEventListener(`keydown`,this._escHandler),this.editor._autoGrow(),this.editor.editorContainer.querySelectorAll(`.markdown-btn`).forEach(e=>{e.classList.contains(`preview-btn`)?(e.classList.remove(`fj:me-btn-active`),e.setAttribute(`aria-pressed`,`false`)):(e.classList.remove(`fj:pointer-events-none`,`fj:md:pointer-events-auto`,`fj:opacity-25`,`fj:md:opacity-100`),e.removeAttribute(`aria-disabled`))})}enablePreview(e,t){this.preview=!1;let n=t.querySelector(`.textarea-wrapper`);t.parentNode.classList.add(`is-fullscreen`),t.classList.add(`fj:md:grid-cols-2`),e.classList.remove(`fj:hidden`),n.classList.add(`fj:hidden`,`fj:md:grid`),this.editor.editorContainer.style.height=``,n.querySelector(`textarea`).classList.add(`fj:h-full!`),n.querySelector(`.display-layer`)&&n.querySelector(`.display-layer`).classList.add(`fj:h-full!`),e.classList.add(`fj:min-h-0`),document.querySelector(`body`).classList.add(`fj:overflow-hidden`),this._escHandler=e=>{e.key===`Escape`&&this.applySyntax()},document.addEventListener(`keydown`,this._escHandler),this.editor.render();let r=window.matchMedia(`(max-width: 767px)`).matches;this.editor.editorContainer.querySelectorAll(`.markdown-btn`).forEach(e=>{e.classList.contains(`preview-btn`)?(e.classList.add(`fj:me-btn-active`),e.setAttribute(`aria-pressed`,`true`)):(e.classList.add(`fj:pointer-events-none`,`fj:md:pointer-events-auto`,`fj:opacity-25`,`fj:md:opacity-100`),e.setAttribute(`aria-disabled`,r?`true`:`false`))})}destroy(){this.preview||(document.removeEventListener(`keydown`,this._escHandler),document.querySelector(`body`)?.classList.remove(`fj:overflow-hidden`))}},jn=class extends Q{constructor(e){super(e,`Check list`),this.button=this.createButton(`
81
+ `);let t=this.button.querySelector(`button`);t&&t.setAttribute(`aria-pressed`,`false`)}applySyntax(){let e=this.editor.previewContent?.parentNode,t=this.editor.markdownEditorDiv;e&&t&&(this.editor.preview&&this.preview?this.enablePreview(e,t):this.disablePreview(e,t))}disablePreview(e,t){this.preview=!0;let n=t.querySelector(`.textarea-wrapper`);t.parentNode.classList.remove(`is-fullscreen`),t.classList.remove(`fj:md:grid-cols-2`),e.classList.add(`fj:hidden`),n.classList.remove(`fj:hidden`,`fj:md:grid`),n.querySelector(`textarea`).classList.remove(`fj:h-full!`),n.querySelector(`.display-layer`)&&n.querySelector(`.display-layer`).classList.remove(`fj:h-full!`),e.classList.remove(`fj:min-h-0`),document.querySelector(`body`).classList.remove(`fj:overflow-hidden`),document.removeEventListener(`keydown`,this._escHandler),this.editor._autoGrow(),this.editor.editorContainer.querySelectorAll(`.markdown-btn`).forEach(e=>{e.classList.contains(`preview-btn`)?(e.classList.remove(`fj:me-btn-active`),e.setAttribute(`aria-pressed`,`false`)):(e.classList.remove(`fj:pointer-events-none`,`fj:md:pointer-events-auto`,`fj:opacity-25`,`fj:md:opacity-100`),e.removeAttribute(`aria-disabled`))})}enablePreview(e,t){this.preview=!1;let n=t.querySelector(`.textarea-wrapper`);t.parentNode.classList.add(`is-fullscreen`),t.classList.add(`fj:md:grid-cols-2`),e.classList.remove(`fj:hidden`),n.classList.add(`fj:hidden`,`fj:md:grid`),this.editor.editorContainer.style.height=``,n.querySelector(`textarea`).classList.add(`fj:h-full!`),n.querySelector(`.display-layer`)&&n.querySelector(`.display-layer`).classList.add(`fj:h-full!`),e.classList.add(`fj:min-h-0`),document.querySelector(`body`).classList.add(`fj:overflow-hidden`),this._escHandler=e=>{e.key===`Escape`&&this.applySyntax()},document.addEventListener(`keydown`,this._escHandler),this.editor.render();let r=window.matchMedia(`(max-width: 767px)`).matches;this.editor.editorContainer.querySelectorAll(`.markdown-btn`).forEach(e=>{e.classList.contains(`preview-btn`)?(e.classList.add(`fj:me-btn-active`),e.setAttribute(`aria-pressed`,`true`)):(e.classList.add(`fj:pointer-events-none`,`fj:md:pointer-events-auto`,`fj:opacity-25`,`fj:md:opacity-100`),e.setAttribute(`aria-disabled`,r?`true`:`false`))})}destroy(){this.preview||(document.removeEventListener(`keydown`,this._escHandler),document.querySelector(`body`)?.classList.remove(`fj:overflow-hidden`))}},An=class extends ${constructor(e){super(e,`Check list`),this.button=this.createButton(`
83
82
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3.5 5.5l1.5 1.5l2.5 -2.5" /><path d="M3.5 11.5l1.5 1.5l2.5 -2.5" /><path d="M3.5 17.5l1.5 1.5l2.5 -2.5" /><path d="M11 6l9 0" /><path d="M11 12l9 0" /><path d="M11 18l9 0" /></svg>
84
- `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=`- [x] `,o=`- [ ] `,s=``,c=0;if(i.startsWith(a)||i.startsWith(o))s=i.slice(6);else{let l=r.substring(t-6,t);if(l===a||l===o){e.setSelectionRange(t-6,n),this.editor.insertText(i,0,0);return}s=`${a}${i||`Check list`}`,c=6}this.editor.insertText(s,c)}},Mn=class extends Q{constructor(e){super(e,`Blockquote`),this.button=this.createButton(`
83
+ `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=`- [x] `,o=`- [ ] `,s=``,c=0;if(i.startsWith(a)||i.startsWith(o))s=i.slice(6);else{let l=r.substring(t-6,t);if(l===a||l===o){e.setSelectionRange(t-6,n),this.editor.insertText(i,0,0);return}s=`${a}${i||`Check list`}`,c=6}this.editor.insertText(s,c)}},jn=class extends ${constructor(e){super(e,`Blockquote`),this.button=this.createButton(`
85
84
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" /><path d="M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" /></svg>
86
- `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`>`))a=i.slice(1);else if(r.substring(t-1,t)===`>`){e.setSelectionRange(t-1,n),this.editor.insertText(i,0,0);return}else a=`>${i||`Blockquote text`}`,i||(o=1);this.editor.insertText(a,o)}};function Nn(e,t,n,r=``){let i=e.target.closest(`.markdown-editor-wrapper`);i.querySelector(`.markdown-modal`)&&i.querySelector(`.markdown-modal`).remove();let a=`
85
+ `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`>`))a=i.slice(1);else if(r.substring(t-1,t)===`>`){e.setSelectionRange(t-1,n),this.editor.insertText(i,0,0);return}else a=`>${i||`Blockquote text`}`,i||(o=1);this.editor.insertText(a,o)}};function Mn(e,t,n,r=``){let i=e.target.closest(`.markdown-editor-wrapper`);i.querySelector(`.markdown-modal`)&&i.querySelector(`.markdown-modal`).remove();let a=`
87
86
  <dialog class="markdown-modal fj:me-modal fj:me-modal-top fj:lg:me-modal-middle fj:me-modal-center" id="nezanuha_toggleModal" ${r?`aria-label="${r}"`:``}>
88
87
  <div class="fj:me-modal-content ${t}">
89
88
  ${n}
90
89
  </div>
91
90
  </dialog>
92
- `;i.querySelector(`.markdown-modal`)||i.insertAdjacentHTML(`beforeend`,a);let o=i.querySelector(`.markdown-modal`);return o.addEventListener(`close`,()=>o.remove()),o.showModal(),o}var Pn=class extends Q{constructor(e){super(e,`Link`),this.button=this.createButton(`
91
+ `;i.querySelector(`.markdown-modal`)||i.insertAdjacentHTML(`beforeend`,a);let o=i.querySelector(`.markdown-modal`);return o.addEventListener(`close`,()=>o.remove()),o.showModal(),o}var Nn=class extends ${constructor(e){super(e,`Link`),this.button=this.createButton(`
93
92
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 15l6 -6" /><path d="M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464" /><path d="M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463" /></svg>
94
- `)}applySyntax(e){let t=this.editor,n=t.usertextarea,{selectionStart:r,selectionEnd:i}=n,a=n.value,o=a.substring(0,r),s=a.substring(i);if(o.endsWith(`[`)&&/^\]\([^)]+\)/.test(s)){let e=s.match(/^\]\(([^)]+)\)/);e&&(r=o.length-1,i+=e[0].length,n.setSelectionRange(r,i))}let c=a.substring(r,i),l=c&&c.match(/^\[([^\]]+)\]\(([^)]+)\)$/),u=l?l[1]:c,d=l?l[2]:``,f=Nn(e,`fj:max-w-sm`,`
93
+ `)}applySyntax(e){let t=this.editor,n=t.usertextarea,{selectionStart:r,selectionEnd:i}=n,a=n.value,o=a.substring(0,r),s=a.substring(i);if(o.endsWith(`[`)&&/^\]\([^)]+\)/.test(s)){let e=s.match(/^\]\(([^)]+)\)/);e&&(r=o.length-1,i+=e[0].length,n.setSelectionRange(r,i))}let c=a.substring(r,i),l=c&&c.match(/^\[([^\]]+)\]\(([^)]+)\)$/),u=l?l[1]:c,d=l?l[2]:``,f=Mn(e,`fj:max-w-sm`,`
95
94
  <div class="fj:flex fj:justify-between fj:items-center fj:gap-3">
96
95
  <div class="fj:font-medium">${this.editor.label(`Link`)}</div>
97
96
  <button type="button" class="modal-close-btn fj:me-btn fj:me-btn-ghost fj:me-btn-xs fj:me-btn-circle" aria-label="${this.editor.label(`Close`)}">
@@ -104,16 +103,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
104
103
  <input type="text" placeholder="${this.editor.label(`Link text`)}" class="link-text-input fj:me-input fj:w-full" value="${u}" required>
105
104
  <button type="submit" class="submit-link fj:me-btn fj:me-btn-sm fj:self-end">${this.editor.label(`Apply`)}</button>
106
105
  </div>
107
- </form>`,`Link`);f.querySelector(`.modal-close-btn`).addEventListener(`click`,()=>f.close()),f.querySelector(`.submit-link`).addEventListener(`click`,function(e){e.preventDefault();let n=f.querySelector(`.link-input`),r=f.querySelector(`.link-text-input`);if(!n.validity.valid)n.reportValidity();else if(!r.validity.valid)r.reportValidity();else{let e=n.value,i=r.value||`Link Text`;t.insertText(`[${i}](${e})`),f.close()}})}},Fn=class extends Q{constructor(e){super(e,`Heading`),this.button=this.createButton(`
106
+ </form>`,`Link`);f.querySelector(`.modal-close-btn`).addEventListener(`click`,()=>f.close()),f.querySelector(`.submit-link`).addEventListener(`click`,function(e){e.preventDefault();let n=f.querySelector(`.link-input`),r=f.querySelector(`.link-text-input`);if(!n.validity.valid)n.reportValidity();else if(!r.validity.valid)r.reportValidity();else{let e=n.value,i=r.value||`Link Text`;t.insertText(`[${i}](${e})`),f.close()}})}},Pn=[1,2,3,4,5,6];function Fn(e){if(e===void 0)return Pn;if(!Array.isArray(e))return console.warn(`[MarkdownEditor] heading levels must be an array of numbers 1-6. Using all six.`,e),Pn;let t=[...new Set(e)].filter(e=>Number.isInteger(e)&&e>=1&&e<=6).sort((e,t)=>e-t);return t.length!==e.length&&console.warn(`[MarkdownEditor] Ignored heading levels outside 1-6, or repeated.`,e),t.length?t:(console.warn(`[MarkdownEditor] No usable heading levels. Using all six.`,e),Pn)}var In=class extends ${constructor(e,t={}){super(e,`Heading`),this.levels=Fn(t?.levels),this.button=this.createButton(`
108
107
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 12h10" /><path d="M7 5v14" /><path d="M17 5v14" /><path d="M15 19h4" /><path d="M15 5h4" /><path d="M5 19h4" /><path d="M5 5h4" /></svg>
109
- `)}createButton(e){let t=`heading-popover-${Math.random().toString(36).slice(2,7)}`,n=document.createElement(`button`);n.innerHTML=e;let r=n.querySelector(`svg`);r&&r.setAttribute(`aria-hidden`,`true`),n.type=`button`,n.title=this.editor.label(`Heading`),n.setAttribute(`aria-label`,this.editor.label(`Heading`)),n.setAttribute(`aria-haspopup`,`menu`),n.className=`markdown-btn heading-btn fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost fj:me-popover-toggle`,n.setAttribute(`popovertarget`,t);let i=document.createElement(`div`);i.id=t,i.setAttribute(`role`,`menu`),i.setAttribute(`aria-label`,this.editor.label(`Heading level`)),i.className=`fj:me-popover-content`,i.setAttribute(`popover`,``);let a=document.createElement(`ul`);a.className=`fj:me-menu`,a.setAttribute(`role`,`presentation`);let o=[`fj:me-heading-xl`,`fj:me-heading-lg`,`fj:me-heading-md`,`fj:me-heading-sm`,`fj:me-heading-xs`,`fj:me-heading-xs`];for(let e=1;e<=6;e++){let t=document.createElement(`li`);t.setAttribute(`role`,`none`);let n=document.createElement(`button`);n.type=`button`,n.setAttribute(`role`,`menuitem`),n.className=`fj:me-menu-item ${o[e-1]}`,n.textContent=`${this.editor.label(`Heading`)} ${e}`,n.addEventListener(`click`,()=>{this.applyHeading(e),i.hidePopover()}),t.appendChild(n),a.appendChild(t)}i.appendChild(a);let s=document.createElement(`div`);return s.className=`fj:me-popover`,s.appendChild(n),s.appendChild(i),s}applyHeading(e){let t=this.editor.usertextarea,{selectionStart:n,selectionEnd:r}=t,i=t.value,a=i.lastIndexOf(`
108
+ `)}createButton(e){let t=`heading-popover-${Math.random().toString(36).slice(2,7)}`,n=document.createElement(`button`);n.innerHTML=e;let r=n.querySelector(`svg`);r&&r.setAttribute(`aria-hidden`,`true`),n.type=`button`,n.title=this.editor.label(`Heading`),n.setAttribute(`aria-label`,this.editor.label(`Heading`)),n.setAttribute(`aria-haspopup`,`menu`),n.className=`markdown-btn heading-btn fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost fj:me-popover-toggle`,n.setAttribute(`popovertarget`,t);let i=document.createElement(`div`);i.id=t,i.setAttribute(`role`,`menu`),i.setAttribute(`aria-label`,this.editor.label(`Heading level`)),i.className=`fj:me-popover-content`,i.setAttribute(`popover`,``);let a=document.createElement(`ul`);a.className=`fj:me-menu`,a.setAttribute(`role`,`presentation`);let o=[`fj:me-heading-xl`,`fj:me-heading-lg`,`fj:me-heading-md`,`fj:me-heading-sm`,`fj:me-heading-xs`,`fj:me-heading-xs`];for(let e of this.levels??Pn){let t=document.createElement(`li`);t.setAttribute(`role`,`none`);let n=document.createElement(`button`);n.type=`button`,n.setAttribute(`role`,`menuitem`),n.className=`fj:me-menu-item ${o[e-1]}`,n.textContent=`${this.editor.label(`Heading`)} ${e}`,n.addEventListener(`click`,()=>{this.applyHeading(e),i.hidePopover()}),t.appendChild(n),a.appendChild(t)}i.appendChild(a);let s=document.createElement(`div`);return s.className=`fj:me-popover`,s.appendChild(n),s.appendChild(i),s}applyHeading(e){let t=this.editor.usertextarea,{selectionStart:n,selectionEnd:r}=t,i=t.value,a=i.lastIndexOf(`
110
109
  `,n-1)+1,o=i.indexOf(`
111
- `,r),s=o===-1?i.length:o,c=i.substring(a,s),l=(c.match(/^(#+)\s/)||[])[1],u=c.replace(/^#+\s*/,``),d=`${`#`.repeat(e)} `,f=l&&l.length===e?u||`Heading`:u?`${d}${u}`:`${d}Heading`;t.value=`${i.substring(0,a)}${f}${i.substring(s)}`,t.focus();let p=a+(f===u||f===`Heading`?0:d.length),m=a+f.length;t.setSelectionRange(p,m),this.editor.scrollToView(),this.editor.render(),this.editor.notifyChange()}applySyntax(){}};async function In(e,{uploadUrl:t,params:n={},alt:r=``}={}){let i=new FormData;i.append(`image_file`,e),i.append(`image_alt`,r);for(let[e,t]of Object.entries(n))i.append(e,t);let a=await fetch(t,{method:`POST`,body:i});if(!a.ok)throw Error(`Upload failed: ${a.status}`);let o=await a.json();if(!o.success||!o.image_path)throw Error(o.error||o.message||`Image upload failed.`);return{path:o.image_path,alt:o.image_alt||``}}var Ln=class extends Q{constructor(e,t={}){super(e,`Image link`),this.config=t,this.fileInputConfig=t.fileInput||!1,this.altInputConfig=t.altInput===void 0?{required:!0}:t.altInput,this.button=this.createButton(`
110
+ `,r),s=o===-1?i.length:o,c=i.substring(a,s),l=(c.match(/^(#+)\s/)||[])[1],u=c.replace(/^#+\s*/,``),d=`${`#`.repeat(e)} `,f=l&&l.length===e?u||`Heading`:u?`${d}${u}`:`${d}Heading`;t.value=`${i.substring(0,a)}${f}${i.substring(s)}`,t.focus();let p=a+(f===u||f===`Heading`?0:d.length),m=a+f.length;t.setSelectionRange(p,m),this.editor.scrollToView(),this.editor.render(),this.editor.notifyChange()}applySyntax(){}};async function Ln(e,{uploadUrl:t,params:n={},alt:r=``}={}){let i=new FormData;i.append(`image_file`,e),i.append(`image_alt`,r);for(let[e,t]of Object.entries(n))i.append(e,t);let a=await fetch(t,{method:`POST`,body:i});if(!a.ok)throw Error(`Upload failed: ${a.status}`);let o=await a.json();if(!o.success||!o.image_path)throw Error(o.error||o.message||`Image upload failed.`);return{path:o.image_path,alt:o.image_alt||``}}var Rn=class extends ${constructor(e,t={}){super(e,`Image link`),this.config=t,this.fileInputConfig=t.fileInput||!1,this.altInputConfig=t.altInput===void 0?{required:!0}:t.altInput,this.button=this.createButton(`
112
111
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 8h.01" /><path d="M12.5 21h-6.5a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v6.5" /><path d="M3 16l5 -5c.928 -.893 2.072 -.893 3 0l4 4" /><path d="M14 14l1 -1c.67 -.644 1.45 -.824 2.182 -.54" /><path d="M16 19h6" /><path d="M19 16v6" /></svg>
113
- `)}applySyntax(e){let t=this.editor,n=t.usertextarea,{selectionStart:r,selectionEnd:i}=n,a=n.value,o=a.substring(0,r),s=a.substring(i);if(o.endsWith(`![`)&&/^\]\([^)]+\)/.test(s)){let e=s.match(/^\]\(([^)]+)\)/);e&&(r=o.length-2,i+=e[0].length,n.setSelectionRange(r,i))}let c=a.substring(r,i),l=this.fileInputConfig.accept?this.fileInputConfig.accept.map(e=>`image/${e}`).join(`,`):`image/*`,u=typeof this.altInputConfig==`boolean`?this.altInputConfig:this.altInputConfig.required!==!1,d=this.fileInputConfig.uploadUrl||null,f=this.fileInputConfig.params||{},p=c&&c.match(/^!\[([^\]]*)\]\(([^)]+)\)$/),m=p?p[1]:c,h=p?p[2]:``,g=``;this.fileInputConfig&&(g=`
112
+ `)}applySyntax(e){let t=this.editor,n=t.usertextarea,{selectionStart:r,selectionEnd:i}=n,a=n.value,o=a.substring(0,r),s=a.substring(i);if(o.endsWith(`![`)&&/^\]\([^)]+\)/.test(s)){let e=s.match(/^\]\(([^)]+)\)/);e&&(r=o.length-2,i+=e[0].length,n.setSelectionRange(r,i))}let c=a.substring(r,i),l=this.fileInputConfig.accept?this.fileInputConfig.accept.map(e=>`image/${e}`).join(`,`):`image/*`,u=typeof this.altInputConfig==`boolean`?this.altInputConfig:this.altInputConfig.required!==!1,d=this.fileInputConfig.uploadUrl||null,f=this.fileInputConfig.params||{},p=c&&c.match(/^!\[([^\]]*)\]\(([^)]+)\)$/),m=p?p[1]:c,ee=p?p[2]:``,h=``;this.fileInputConfig&&(h=`
114
113
  <input type="file" accept="${l}" class="img-file-input fj:me-input fj:w-full">
115
114
  <div class="fj:me-divider fj:my-1">OR</div>
116
- `);let _=Nn(e,`fj:max-w-sm`,`
115
+ `);let g=Mn(e,`fj:max-w-sm`,`
117
116
  <div class="fj:flex fj:justify-between fj:items-center fj:gap-3">
118
117
  <div class="fj:font-medium">${t.label(`Image`)}</div>
119
118
  <button type="button" class="modal-close-btn fj:me-btn fj:me-btn-ghost fj:me-btn-xs fj:me-btn-circle" aria-label="${t.label(`Close`)}">
@@ -121,47 +120,47 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
121
120
  </button>
122
121
  </div>
123
122
  <div class="fj:mt-4 fj:flex fj:flex-col fj:gap-y-4">
124
- ${g}
125
- <input type="url" placeholder="${t.label(`URL`)}" class="img-link-input fj:me-input fj:w-full" value="${h}" required>
123
+ ${h}
124
+ <input type="url" placeholder="${t.label(`URL`)}" class="img-link-input fj:me-input fj:w-full" value="${ee}" required>
126
125
  <input type="text" placeholder="${t.label(`Alt text`)}" class="img-link-alt-input fj:me-input fj:w-full" value="${m}" ${u?`required`:``}>
127
126
  <button type="button" class="submit-img-link fj:me-btn fj:me-btn-sm fj:self-end">${t.label(`Apply`)}</button>
128
- </div>`,`Image`);_.querySelector(`.modal-close-btn`).addEventListener(`click`,()=>_.close());let v=_.querySelector(`.submit-img-link`);v.addEventListener(`click`,async e=>{e.preventDefault();let n=_.querySelector(`.img-file-input`),r=_.querySelector(`.img-link-input`),i=_.querySelector(`.img-link-alt-input`),a=n?.files[0];if(a&&(r.required=!1),u&&!i.validity.valid){i.reportValidity(),a&&(r.required=!0);return}if(!a&&!r.validity.valid){r.reportValidity();return}if(a&&d){let e=n.files[0];v.disabled=!0,v.textContent=t.label(`Uploading...`);try{let{path:t,alt:n}=await In(e,{uploadUrl:d,params:f,alt:i.value});r.value=t,n&&!i.value.trim()&&(i.value=n)}catch(e){alert(e.message||`Upload failed.`),v.disabled=!1,v.textContent=t.label(`Apply`),r.required=!0;return}v.disabled=!1,v.textContent=t.label(`Apply`)}let o=r.value,s=`![${i.value||``}](${o})`;t.insertText(s),_.close()})}},Rn=class extends Q{constructor(e){super(e,`Undo`),this.button=this.createButton(`
127
+ </div>`,`Image`);g.querySelector(`.modal-close-btn`).addEventListener(`click`,()=>g.close());let _=g.querySelector(`.submit-img-link`);_.addEventListener(`click`,async e=>{e.preventDefault();let n=g.querySelector(`.img-file-input`),r=g.querySelector(`.img-link-input`),i=g.querySelector(`.img-link-alt-input`),a=n?.files[0];if(a&&(r.required=!1),u&&!i.validity.valid){i.reportValidity(),a&&(r.required=!0);return}if(!a&&!r.validity.valid){r.reportValidity();return}if(a&&d){let e=n.files[0];_.disabled=!0,_.textContent=t.label(`Uploading...`);try{let{path:t,alt:n}=await Ln(e,{uploadUrl:d,params:f,alt:i.value});r.value=t,n&&!i.value.trim()&&(i.value=n)}catch(e){alert(e.message||`Upload failed.`),_.disabled=!1,_.textContent=t.label(`Apply`),r.required=!0;return}_.disabled=!1,_.textContent=t.label(`Apply`)}let o=r.value,s=`![${i.value||``}](${o})`;t.insertText(s),g.close()})}},zn=class extends ${constructor(e){super(e,`Undo`),this.button=this.createButton(`
129
128
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 14l-4 -4l4 -4" /><path d="M5 10h11a4 4 0 1 1 0 8h-1" /></svg>
130
- `)}applySyntax(){let e=this.editor.undoRedoManager;e&&e.undo()}},zn=class extends Q{constructor(e){super(e,`Redo`),this.button=this.createButton(`
129
+ `)}applySyntax(){let e=this.editor.undoRedoManager;e&&e.undo()}},Bn=class extends ${constructor(e){super(e,`Redo`),this.button=this.createButton(`
131
130
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 14l4 -4l-4 -4" /><path d="M19 10h-11a4 4 0 1 0 0 8h1" /></svg>
132
- `)}applySyntax(){let e=this.editor.undoRedoManager;e&&e.redo()}},Bn=class extends Q{constructor(e){super(e,`Indent`),this.button=this.createButton(`
131
+ `)}applySyntax(){let e=this.editor.undoRedoManager;e&&e.redo()}},Vn=class extends ${constructor(e){super(e,`Indent`),this.button=this.createButton(`
133
132
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M20 6l-11 0" /><path d="M20 12l-7 0" /><path d="M20 18l-11 0" /><path d="M4 8l4 4l-4 4" /></svg>
134
- `)}applySyntax(){let e=this.editor.indentManager;e&&(e.indent(),this.editor.render())}},Vn=class extends Q{constructor(e){super(e,`Outdent`),this.button=this.createButton(`
133
+ `)}applySyntax(){let e=this.editor.indentManager;e&&(e.indent(),this.editor.render())}},Hn=class extends ${constructor(e){super(e,`Outdent`),this.button=this.createButton(`
135
134
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M20 6l-7 0" /><path d="M20 12l-9 0" /><path d="M20 18l-7 0" /><path d="M8 8l-4 4l4 4" /></svg>
136
- `)}applySyntax(e){let t=this.editor.indentManager;t&&(t.outdent(),this.editor.render())}},Hn=class extends Q{constructor(e){super(e,`Code`),this.button=this.createButton(`
135
+ `)}applySyntax(e){let t=this.editor.indentManager;t&&(t.outdent(),this.editor.render())}},Un=class extends ${constructor(e){super(e,`Code`),this.button=this.createButton(`
137
136
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 8l-4 4l4 4" /><path d="M17 8l4 4l-4 4" /><path d="M14 4l-4 16" /></svg>
138
- `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n);if(i.startsWith("`")&&i.endsWith("`")){this.editor.insertText(i.slice(1,-1),0,0);return}if(r[t-1]==="`"&&r[n]==="`"){e.setSelectionRange(t-1,n+1),this.editor.insertText(i,0,0);return}let a=`\`${i||`code`}\``;this.editor.insertText(a,1,1)}},Un=class extends Q{constructor(e){super(e,`Code Block`),this.button=this.createButton(`
137
+ `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n);if(i.startsWith("`")&&i.endsWith("`")){this.editor.insertText(i.slice(1,-1),0,0);return}if(r[t-1]==="`"&&r[n]==="`"){e.setSelectionRange(t-1,n+1),this.editor.insertText(i,0,0);return}let a=`\`${i||`code`}\``;this.editor.insertText(a,1,1)}},Wn=class extends ${constructor(e){super(e,`Code Block`),this.button=this.createButton(`
139
138
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M8 9l3 3l-3 3" /><path d="M13 15l3 0" /><rect x="3" y="4" width="18" height="16" rx="2" /></svg>
140
- `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value.substring(t,n);if(r.startsWith("```")&&r.endsWith("```")&&r.length>6){let e=r.replace(/^```\w*\n?/,``).replace(/\n?```$/,``);this.editor.insertText(e,0,0);return}let i=`\`\`\`\n${r||`code`}\n\`\`\``;this.editor.insertText(i,4,4)}},Wn=class extends Q{constructor(e){super(e,`Horizontal Rule`),this.button=this.createButton(`
139
+ `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value.substring(t,n);if(r.startsWith("```")&&r.endsWith("```")&&r.length>6){let e=r.replace(/^```\w*\n?/,``).replace(/\n?```$/,``);this.editor.insertText(e,0,0);return}let i=`\`\`\`\n${r||`code`}\n\`\`\``;this.editor.insertText(i,4,4)}},Gn=class extends ${constructor(e){super(e,`Horizontal Rule`),this.button=this.createButton(`
141
140
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12l16 0" stroke-width="3"/><path d="M4 7l6 0" /><path d="M4 17l6 0" /><path d="M14 7l6 0" /><path d="M14 17l6 0" /></svg>
142
141
  `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t}=e,n=e.value,r=t===0||n[t-1]===`
143
142
  `?`---
144
143
  `:`
145
144
 
146
145
  ---
147
- `;this.editor.insertText(r,r.length,0)}},Gn=class extends Q{constructor(e){super(e,`Table`),this.button=this.createButton(`
146
+ `;this.editor.insertText(r,r.length,0)}},Kn=class extends ${constructor(e){super(e,`Table`),this.button=this.createButton(`
148
147
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" /><path d="M3 10h18" /><path d="M10 3v18" /></svg>
149
148
  `)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t}=e,n=e.value,r=`| Column 1 | Column 2 | Column 3 |
150
149
  | --- | --- | --- |
151
150
  | Cell | Cell | Cell |
152
151
  | Cell | Cell | Cell |`,i=t===0||n[t-1]===`
153
- `?r:`\n${r}`;this.editor.insertText(i,i.length,0)}};function Kn(e){let t=e=>e&&e.label&&typeof e.value==`string`,n=[];for(let r of Array.isArray(e)?e:[])r&&(Array.isArray(r.items)?n.push(...r.items.filter(t)):t(r)&&n.push(r));return n}function qn(e,t){let n=Kn(t).filter(e=>typeof e.sample==`string`);return n.length?n.slice().sort((e,t)=>t.value.length-e.value.length).reduce((e,t)=>e.split(t.value).join(t.sample),e):e}var Jn=`
152
+ `?r:`\n${r}`;this.editor.insertText(i,i.length,0)}};function qn(e){let t=e=>e&&e.label&&typeof e.value==`string`,n=[];for(let r of Array.isArray(e)?e:[])r&&(Array.isArray(r.items)?n.push(...r.items.filter(t)):t(r)&&n.push(r));return n}function Jn(e,t){let n=qn(t).filter(e=>typeof e.sample==`string`);return n.length?n.slice().sort((e,t)=>t.value.length-e.value.length).reduce((e,t)=>e.split(t.value).join(t.sample),e):e}var Yn=`
154
153
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 4a2 2 0 0 0 -2 2v3a2 2 0 0 1 -2 2a2 2 0 0 1 2 2v3a2 2 0 0 0 2 2" /><path d="M17 4a2 2 0 0 1 2 2v3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2v3a2 2 0 0 1 -2 2" /></svg>
155
- `,Yn=class extends Q{constructor(e){super(e,`Variables`)}createButton(){let e=this.editor.variables??[];if(!Kn(e).length)return null;let t=`variable-popover-${Math.random().toString(36).slice(2,7)}`,n=document.createElement(`button`);n.innerHTML=Jn,n.querySelector(`svg`)?.setAttribute(`aria-hidden`,`true`),n.type=`button`,n.title=this.editor.label(`Insert variable`),n.setAttribute(`aria-label`,this.editor.label(`Insert variable`)),n.setAttribute(`aria-haspopup`,`menu`),n.className=`markdown-btn variable-btn fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost fj:me-popover-toggle`,n.setAttribute(`popovertarget`,t);let r=document.createElement(`div`);r.id=t,r.setAttribute(`role`,`menu`),r.setAttribute(`aria-label`,this.editor.label(`Variables`)),r.className=`fj:me-popover-content`,r.setAttribute(`popover`,``);let i=document.createElement(`ul`);i.className=`fj:me-menu`,i.setAttribute(`role`,`presentation`);let a=e=>e&&e.label&&typeof e.value==`string`;for(let t of e)if(t){if(Array.isArray(t.items)){let e=t.items.filter(a);if(!e.length)continue;let n=document.createElement(`li`);n.className=`fj:me-menu-title`,n.setAttribute(`role`,`presentation`),n.textContent=t.label??``;let o=document.createElement(`ul`);o.setAttribute(`role`,`group`),t.label&&o.setAttribute(`aria-label`,t.label),e.forEach(e=>o.appendChild(this.createItem(e,r)));let s=document.createElement(`li`);s.setAttribute(`role`,`none`),s.appendChild(o),i.appendChild(n),i.appendChild(s)}else a(t)&&i.appendChild(this.createItem(t,r))}r.appendChild(i);let o=document.createElement(`div`);return o.className=`fj:me-popover`,o.appendChild(n),o.appendChild(r),o}createItem(e,t){let n=document.createElement(`li`);n.setAttribute(`role`,`none`);let r=document.createElement(`button`);return r.type=`button`,r.setAttribute(`role`,`menuitem`),r.className=`fj:me-menu-item`,r.textContent=e.label,r.title=e.value,r.addEventListener(`click`,()=>{this.editor.insertText(e.value,e.value.length,0),t.hidePopover()}),n.appendChild(r),n}applySyntax(){}},Xn=class{constructor(e,t){this.editor=e,this.options=t,this.toolbar=document.createElement(`div`),this.toolbar.className=`toolbar not-prose fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-b fj:flex fj:items-center fj:gap-x-1 fj:p-1.5 fj:overflow-x-auto`,this.toolbar.setAttribute(`role`,`toolbar`),this.toolbar.setAttribute(`aria-label`,`Editor toolbar`),this.init()}init(){let e={heading:Fn,ul:On,ol:kn,checklist:jn,bold:Tn,italic:En,strikethrough:Dn,blockquote:Mn,code:Hn,codeblock:Un,hr:Wn,table:Gn,link:Pn,image:Ln,undo:Rn,redo:zn,indent:Bn,outdent:Vn,variables:Yn};if(this.options.forEach(t=>{let n,r;if(typeof t==`string`)n=e[t];else if(typeof t==`object`){let i=Object.keys(t)[0];r=t[i],n=e[i]}if(n){let e=new n(this.editor,r);e.button&&this.toolbar.appendChild(e.button)}}),this.options.includes(`preview`)){let e=new An(this.editor);this.editor.previewTool=e,this.toolbar.appendChild(e.button)}this.editor.editorContainer.insertBefore(this.toolbar,this.editor.markdownEditorDiv)}},Zn=class{constructor(e){this.previewContainer=document.createElement(`div`),this.previewContainer.className=`preview-wrapper fj:p-2 fj:hidden fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-l`,this.previewContainer.setAttribute(`role`,`region`),this.previewContainer.setAttribute(`aria-label`,`Preview`),this.previewContent=document.createElement(`div`),this.previewContent.className=`preview-content fj:mte-prose fj:mte-prose-sm fj:md:mte-prose-base fj:me-prose-frutjam fj:p-1.5 fj:overflow-y-auto fj:h-full fj:max-w-full`,this.previewContainer.appendChild(this.previewContent),e.appendChild(this.previewContainer)}getPreviewContent(){return this.previewContent}},Qn=class{constructor(e,t={}){this.options=t,this.footer=document.createElement(`div`),this.footer.className=`editor-footer not-prose fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-t fj:flex fj:justify-between fj:items-center fj:px-3 fj:py-1 fj:text-xs fj:opacity-60 fj:select-none`,this.footer.setAttribute(`aria-hidden`,`true`),this.positionEl=document.createElement(`span`),this.charsEl=document.createElement(`span`),this.wordsEl=document.createElement(`span`),(this.options.line||this.options.col)&&this.footer.appendChild(this.positionEl),this.options.chars&&this.footer.appendChild(this.charsEl),this.options.words&&this.footer.appendChild(this.wordsEl),e.appendChild(this.footer)}update(e){let t=e.value,n=e.selectionStart??0;if(this.options.line||this.options.col){let e=t.substring(0,n).split(`
156
- `),r=[];this.options.line&&r.push(`Ln ${e.length}`),this.options.col&&r.push(`Col ${e[e.length-1].length+1}`),this.positionEl.textContent=r.join(`, `)}if(this.options.chars&&(this.charsEl.textContent=`${t.length.toLocaleString()} chars`),this.options.words){let e=t.trim()?t.trim().split(/\s+/).length:0;this.wordsEl.textContent=`${e.toLocaleString()} words`}}},$=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},$n=new class extends ${};function er(e,t,n){return $n.diff(e,t,n)}function tr(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function nr(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function rr(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function ir(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function ar(e,t){return rr(e,t,``)}function or(e,t){return ir(e,t,``)}function sr(e,t){return t.slice(0,cr(e,t))}function cr(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function lr(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function ur(e,t){if(t)return fr(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function dr(e,t){if(t)return fr(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function fr(e,t){if(!t)return[dr(e),ur(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=lr(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var pr=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,mr=RegExp(`[${pr}]+|\\s+|[^${pr}]`,`ug`);new class extends ${equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=lr(e,r)}else n=e.match(mr)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&hr(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&hr(n,i,r,null,t.intlSegmenter),e}};function hr(e,t,n,r,i){if(t&&n){let[a,o]=fr(t.value,i),[s,c]=fr(n.value,i);if(e){let r=tr(a,s);e.value=ir(e.value,s,r),t.value=ar(t.value,r),n.value=ar(n.value,r)}if(r){let e=nr(o,c);r.value=rr(r.value,c,e),t.value=or(t.value,e),n.value=or(n.value,e)}}else if(n){if(e){let e=dr(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=dr(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=dr(r.value,i),[a,o]=fr(t.value,i),s=tr(n,a);t.value=ar(t.value,s);let c=nr(ar(n,s),o);t.value=or(t.value,c),r.value=rr(r.value,n,c),e.value=ir(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=dr(r.value,i),n=sr(ur(t.value,i),e);t.value=or(t.value,n)}else if(e){let n=sr(ur(e.value,i),dr(t.value,i));t.value=ar(t.value,n)}}new class extends ${tokenize(e){let t=RegExp(`(\\r?\\n)|[${pr}]+|[^\\S\\n\\r]+|[^${pr}]`,`ug`);return e.match(t)||[]}},new class extends ${constructor(){super(...arguments),this.tokenize=gr}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
154
+ `,Xn=class extends ${constructor(e){super(e,`Variables`)}createButton(){let e=this.editor.variables??[];if(!qn(e).length)return null;let t=`variable-popover-${Math.random().toString(36).slice(2,7)}`,n=document.createElement(`button`);n.innerHTML=Yn,n.querySelector(`svg`)?.setAttribute(`aria-hidden`,`true`),n.type=`button`,n.title=this.editor.label(`Insert variable`),n.setAttribute(`aria-label`,this.editor.label(`Insert variable`)),n.setAttribute(`aria-haspopup`,`menu`),n.className=`markdown-btn variable-btn fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost fj:me-popover-toggle`,n.setAttribute(`popovertarget`,t);let r=document.createElement(`div`);r.id=t,r.setAttribute(`role`,`menu`),r.setAttribute(`aria-label`,this.editor.label(`Variables`)),r.className=`fj:me-popover-content`,r.setAttribute(`popover`,``);let i=document.createElement(`ul`);i.className=`fj:me-menu`,i.setAttribute(`role`,`presentation`);let a=e=>e&&e.label&&typeof e.value==`string`;for(let t of e)if(t){if(Array.isArray(t.items)){let e=t.items.filter(a);if(!e.length)continue;let n=document.createElement(`li`);n.className=`fj:me-menu-title`,n.setAttribute(`role`,`presentation`),n.textContent=t.label??``;let o=document.createElement(`ul`);o.setAttribute(`role`,`group`),t.label&&o.setAttribute(`aria-label`,t.label),e.forEach(e=>o.appendChild(this.createItem(e,r)));let s=document.createElement(`li`);s.setAttribute(`role`,`none`),s.appendChild(o),i.appendChild(n),i.appendChild(s)}else a(t)&&i.appendChild(this.createItem(t,r))}r.appendChild(i);let o=document.createElement(`div`);return o.className=`fj:me-popover`,o.appendChild(n),o.appendChild(r),o}createItem(e,t){let n=document.createElement(`li`);n.setAttribute(`role`,`none`);let r=document.createElement(`button`);return r.type=`button`,r.setAttribute(`role`,`menuitem`),r.className=`fj:me-menu-item`,r.textContent=e.label,r.title=e.value,r.addEventListener(`click`,()=>{this.editor.insertText(e.value,e.value.length,0),t.hidePopover()}),n.appendChild(r),n}applySyntax(){}},Zn=class extends ${constructor(e,t={}){super(e,t.title||`Custom`),this.action=t.action,this.button=typeof this.action==`function`?this.createButton(t.icon||``):null,this.shortcut=this.button?t.shortcut:void 0,this.button||console.warn(`[MarkdownEditor] A custom tool needs an action function. Skipping it.`,t)}applySyntax(e){this.action(this.editor,e)}},Qn=class{constructor(e,t,{standalone:n=!1}={}){this.editor=e,this.options=t,this.standalone=n,this.tools=[],this.toolbar=document.createElement(`div`),this.toolbar.className=n?`toolbar not-prose fj:flex fj:items-center fj:gap-x-1`:`toolbar not-prose fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-b fj:flex fj:items-center fj:gap-x-1 fj:p-1.5 fj:overflow-x-auto`,this.toolbar.setAttribute(`role`,`toolbar`),this.toolbar.setAttribute(`aria-label`,e.label(`Editor toolbar`)),this.init()}destroy(){this.tools.forEach(e=>e.destroy?.())}init(){let e={heading:In,ul:Dn,ol:On,checklist:An,bold:wn,italic:Tn,strikethrough:En,blockquote:jn,code:Un,codeblock:Wn,hr:Gn,table:Kn,link:Nn,image:Rn,undo:zn,redo:Bn,indent:Vn,outdent:Hn,variables:Xn};if(this.options.forEach(t=>{let n,r;if(typeof t==`string`)n=e[t];else if(typeof t==`function`)n=t;else if(t&&typeof t.tool==`function`)n=t.tool,r=t.config;else if(t&&t.custom)n=Zn,r=t.custom;else if(typeof t==`object`){let i=Object.keys(t)[0];r=t[i],n=e[i]}if(n){let e=new n(this.editor,r);this.tools.push(e),e.button&&this.toolbar.appendChild(e.button)}}),!this.standalone){if(this.options.includes(`preview`)){let e=new kn(this.editor);this.editor.previewTool=e,this.toolbar.appendChild(e.button)}this.editor.editorContainer.insertBefore(this.toolbar,this.editor.markdownEditorDiv)}}},$n=class{constructor(e){this.previewContainer=document.createElement(`div`),this.previewContainer.className=`preview-wrapper fj:p-2 fj:hidden fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-l`,this.previewContainer.setAttribute(`role`,`region`),this.previewContainer.setAttribute(`aria-label`,`Preview`),this.previewContent=document.createElement(`div`),this.previewContent.className=`preview-content fj:mte-prose fj:mte-prose-sm fj:md:mte-prose-base fj:me-prose-frutjam fj:p-1.5 fj:overflow-y-auto fj:h-full fj:max-w-full`,this.previewContainer.appendChild(this.previewContent),e.appendChild(this.previewContainer)}getPreviewContent(){return this.previewContent}},er=class{constructor(e,t={}){this.options=t,this.footer=document.createElement(`div`),this.footer.className=`editor-footer not-prose fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-t fj:flex fj:justify-between fj:items-center fj:px-3 fj:py-1 fj:text-xs fj:opacity-60 fj:select-none`,this.footer.setAttribute(`aria-hidden`,`true`),this.positionEl=document.createElement(`span`),this.charsEl=document.createElement(`span`),this.wordsEl=document.createElement(`span`),(this.options.line||this.options.col)&&this.footer.appendChild(this.positionEl),this.options.chars&&this.footer.appendChild(this.charsEl),this.options.words&&this.footer.appendChild(this.wordsEl),e.appendChild(this.footer)}update(e){let t=e.value,n=e.selectionStart??0;if(this.options.line||this.options.col){let e=t.substring(0,n).split(`
155
+ `),r=[];this.options.line&&r.push(`Ln ${e.length}`),this.options.col&&r.push(`Col ${e[e.length-1].length+1}`),this.positionEl.textContent=r.join(`, `)}if(this.options.chars&&(this.charsEl.textContent=`${t.length.toLocaleString()} chars`),this.options.words){let e=t.trim()?t.trim().split(/\s+/).length:0;this.wordsEl.textContent=`${e.toLocaleString()} words`}}},tr=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r)setTimeout(function(){r(e)},0);else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,ee=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let ee=c&&c.oldPos+1<o;if(!u&&!ee)d[r]=void 0;else{if(s=!ee||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);ee()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=ee();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},nr=new class extends tr{};function rr(e,t,n){return nr.diff(e,t,n)}function ir(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function ar(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function or(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function sr(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function cr(e,t){return or(e,t,``)}function lr(e,t){return sr(e,t,``)}function ur(e,t){return t.slice(0,dr(e,t))}function dr(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function fr(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function pr(e,t){if(t)return hr(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function mr(e,t){if(t)return hr(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function hr(e,t){if(!t)return[mr(e),pr(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=fr(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var gr=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,_r=RegExp(`[${gr}]+|\\s+|[^${gr}]`,`ug`);new class extends tr{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=fr(e,r)}else n=e.match(_r)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&vr(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&vr(n,i,r,null,t.intlSegmenter),e}};function vr(e,t,n,r,i){if(t&&n){let[a,o]=hr(t.value,i),[s,c]=hr(n.value,i);if(e){let r=ir(a,s);e.value=sr(e.value,s,r),t.value=cr(t.value,r),n.value=cr(n.value,r)}if(r){let e=ar(o,c);r.value=or(r.value,c,e),t.value=lr(t.value,e),n.value=lr(n.value,e)}}else if(n){if(e){let e=mr(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=mr(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=mr(r.value,i),[a,o]=hr(t.value,i),s=ir(n,a);t.value=cr(t.value,s);let c=ar(cr(n,s),o);t.value=lr(t.value,c),r.value=or(r.value,n,c),e.value=sr(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=mr(r.value,i),n=ur(pr(t.value,i),e);t.value=lr(t.value,n)}else if(e){let n=ur(pr(e.value,i),mr(t.value,i));t.value=cr(t.value,n)}}new class extends tr{tokenize(e){let t=RegExp(`(\\r?\\n)|[${gr}]+|[^\\S\\n\\r]+|[^${gr}]`,`ug`);return e.match(t)||[]}},new class extends tr{constructor(){super(...arguments),this.tokenize=yr}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
157
156
  `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
158
157
  `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
159
158
  `)&&(e=e.slice(0,-1)),t.endsWith(`
160
- `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function gr(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
161
- `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function _r(e){return e==`.`||e==`!`||e==`?`}new class extends ${tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(_r(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends ${tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends ${constructor(){super(...arguments),this.tokenize=gr}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(vr(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function vr(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=vr(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=vr(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends ${tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var yr=class{constructor(e){this.editor=e,this.textarea=e.usertextarea,this.undoStack=[],this.redoStack=[],this.lastValue=this.textarea.value,this.lastSelection={selectionStart:this.textarea.selectionStart,selectionEnd:this.textarea.selectionEnd},this.debounceDelay=1e3,this.maxStackSize=100,this._debounceTimer=null,this._bindEvents()}_bindEvents(){this._keydownHandler=e=>this._onKeyDown(e),this._selectHandler=()=>this._updateLastSelection(),this._mousedownHandler=()=>setTimeout(()=>this._updateLastSelection(),0),this._beforeinputHandler=e=>{e.inputType===`historyUndo`?(e.preventDefault(),this.undo()):e.inputType===`historyRedo`&&(e.preventDefault(),this.redo())},this._inputHandler=e=>this._onInput(e),this._pasteHandler=()=>this._saveState(),this._blurHandler=()=>this._saveState(),this.textarea.addEventListener(`keydown`,this._keydownHandler),this.textarea.addEventListener(`select`,this._selectHandler),this.textarea.addEventListener(`mousedown`,this._mousedownHandler),this.textarea.addEventListener(`beforeinput`,this._beforeinputHandler),this.textarea.addEventListener(`input`,this._inputHandler),this.textarea.addEventListener(`paste`,this._pasteHandler),this.textarea.addEventListener(`blur`,this._blurHandler)}destroy(){clearTimeout(this._debounceTimer),this.textarea.removeEventListener(`keydown`,this._keydownHandler),this.textarea.removeEventListener(`select`,this._selectHandler),this.textarea.removeEventListener(`mousedown`,this._mousedownHandler),this.textarea.removeEventListener(`beforeinput`,this._beforeinputHandler),this.textarea.removeEventListener(`input`,this._inputHandler),this.textarea.removeEventListener(`paste`,this._pasteHandler),this.textarea.removeEventListener(`blur`,this._blurHandler)}_updateLastSelection(){this.lastSelection={selectionStart:this.textarea.selectionStart,selectionEnd:this.textarea.selectionEnd}}_onKeyDown(e){let t=e.metaKey||e.ctrlKey,n=e.key.toLowerCase()===`z`,r=e.key.toLowerCase()===`y`,i=e.shiftKey,a=this.textarea.selectionStart!==this.textarea.selectionEnd,o=e.key===`Backspace`||e.key===`Delete`||e.key===`Enter`;a&&(e.key.length===1||o)&&this._saveState(),(t||o)&&this._saveState(),t&&n&&!i?(e.preventDefault(),this.undo()):t&&(i&&n||!e.metaKey&&r)&&(e.preventDefault(),this.redo())}_onInput(e){clearTimeout(this._debounceTimer);let t=this.textarea.value[this.textarea.selectionStart-1];t&&/[\s.,;:!?()\[\]{}'"`~]/.test(t)?this._saveState():this._debounceTimer=setTimeout(()=>this._saveState(),this.debounceDelay)}_saveState(){let e=this.textarea.value||``;if(e===this.lastValue)return;clearTimeout(this._debounceTimer);let t=er(this.lastValue,e);this.undoStack.push({diff:t,selection:{...this.lastSelection}}),this.undoStack.length>this.maxStackSize&&this.undoStack.shift(),this.lastValue=e,this._updateLastSelection(),this.redoStack=[]}undo(){if(this.undoStack.length===0)return;let e=this.undoStack.pop(),t=this._revertDiff(this.lastValue,e.diff);this.redoStack.push({diff:e.diff,selection:{selectionStart:this.textarea.selectionStart,selectionEnd:this.textarea.selectionEnd}}),this._restoreState(t,e.selection)}redo(){if(this.redoStack.length===0)return;let e=this.redoStack.pop(),t=this._applyDiff(this.lastValue,e.diff);this.undoStack.push({diff:e.diff,selection:{...this.lastSelection}}),this._restoreState(t,e.selection)}_applyDiff(e,t){let n=``;return t.forEach(e=>{e.removed||(n+=e.value)}),n}_revertDiff(e,t){let n=``;return t.forEach(e=>{e.added||(n+=e.value)}),n}_restoreState(e,t){this.textarea.value=e,this.textarea.setSelectionRange(t.selectionStart,t.selectionEnd),this.lastValue=e,this.lastSelection={...t},this.editor.render&&this.editor.render(),this.editor.notifyChange(),this.textarea.focus()}},br=class{constructor(e,t){this.editor=e,this.textarea=e.usertextarea,this.renderCallback=t,this.pairs={"{":`}`,"[":`]`,"(":`)`,"<":`>`,'"':`"`,"'":`'`},this.init()}init(){this.textarea.addEventListener(`keydown`,e=>{switch(e.key){case`Tab`:e.preventDefault(),e.shiftKey?this.outdent():this.indent(),this._triggerUpdate();break;case`Enter`:this.autoIndent(e);break;case`Backspace`:this.handleBackspace(e);break;default:this.pairs[e.key]&&this.handlePairs(e)}})}handlePairs(e){let{textarea:t}=this,{selectionStart:n,selectionEnd:r,value:i}=t,a=e.key;if(n===r&&i[n]===a&&Object.values(this.pairs).includes(a)){e.preventDefault();let r=n+1;t.setSelectionRange(r,r);return}let o=a,s=this.pairs[o];if(s){if(n!==r){e.preventDefault();let a=i.substring(n,r);t.value=i.substring(0,n)+o+a+s+i.substring(r),t.setSelectionRange(n+1,r+1),this._triggerUpdate()}else{e.preventDefault();let a=i.substring(0,n),c=i.substring(r);t.value=a+o+s+c,t.setSelectionRange(n+1,n+1),this._triggerUpdate()}}}handleBackspace(e){let{textarea:t}=this,{selectionStart:n,selectionEnd:r,value:i}=t;if(n===r&&n>0){let r=i[n-1],a=i[n];this.pairs[r]===a&&(e.preventDefault(),t.value=i.substring(0,n-1)+i.substring(n+1),t.setSelectionRange(n-1,n-1),this._triggerUpdate())}}autoIndent(e){let{textarea:t}=this,{selectionStart:n,value:r}=t,i=r.lastIndexOf(`
159
+ `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function yr(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
160
+ `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function br(e){return e==`.`||e==`!`||e==`?`}new class extends tr{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(br(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends tr{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends tr{constructor(){super(...arguments),this.tokenize=yr}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(xr(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function xr(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=xr(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=xr(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends tr{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var Sr=class{constructor(e){this.editor=e,this.textarea=e.usertextarea,this.undoStack=[],this.redoStack=[],this.lastValue=this.textarea.value,this.lastSelection={selectionStart:this.textarea.selectionStart,selectionEnd:this.textarea.selectionEnd},this.debounceDelay=1e3,this.maxStackSize=100,this._debounceTimer=null,this._bindEvents()}_bindEvents(){this._keydownHandler=e=>this._onKeyDown(e),this._selectHandler=()=>this._updateLastSelection(),this._mousedownHandler=()=>setTimeout(()=>this._updateLastSelection(),0),this._beforeinputHandler=e=>{e.inputType===`historyUndo`?(e.preventDefault(),this.undo()):e.inputType===`historyRedo`&&(e.preventDefault(),this.redo())},this._inputHandler=e=>this._onInput(e),this._pasteHandler=()=>this._saveState(),this._blurHandler=()=>this._saveState(),this.textarea.addEventListener(`keydown`,this._keydownHandler),this.textarea.addEventListener(`select`,this._selectHandler),this.textarea.addEventListener(`mousedown`,this._mousedownHandler),this.textarea.addEventListener(`beforeinput`,this._beforeinputHandler),this.textarea.addEventListener(`input`,this._inputHandler),this.textarea.addEventListener(`paste`,this._pasteHandler),this.textarea.addEventListener(`blur`,this._blurHandler)}destroy(){clearTimeout(this._debounceTimer),this.textarea.removeEventListener(`keydown`,this._keydownHandler),this.textarea.removeEventListener(`select`,this._selectHandler),this.textarea.removeEventListener(`mousedown`,this._mousedownHandler),this.textarea.removeEventListener(`beforeinput`,this._beforeinputHandler),this.textarea.removeEventListener(`input`,this._inputHandler),this.textarea.removeEventListener(`paste`,this._pasteHandler),this.textarea.removeEventListener(`blur`,this._blurHandler)}_updateLastSelection(){this.lastSelection={selectionStart:this.textarea.selectionStart,selectionEnd:this.textarea.selectionEnd}}_onKeyDown(e){let t=e.metaKey||e.ctrlKey,n=e.key.toLowerCase()===`z`,r=e.key.toLowerCase()===`y`,i=e.shiftKey,a=this.textarea.selectionStart!==this.textarea.selectionEnd,o=e.key===`Backspace`||e.key===`Delete`||e.key===`Enter`;a&&(e.key.length===1||o)&&this._saveState(),(t||o)&&this._saveState(),t&&n&&!i?(e.preventDefault(),this.undo()):t&&(i&&n||!e.metaKey&&r)&&(e.preventDefault(),this.redo())}_onInput(e){clearTimeout(this._debounceTimer);let t=this.textarea.value[this.textarea.selectionStart-1];t&&/[\s.,;:!?()\[\]{}'"`~]/.test(t)?this._saveState():this._debounceTimer=setTimeout(()=>this._saveState(),this.debounceDelay)}_saveState(){let e=this.textarea.value||``;if(e===this.lastValue)return;clearTimeout(this._debounceTimer);let t=rr(this.lastValue,e);this.undoStack.push({diff:t,selection:{...this.lastSelection}}),this.undoStack.length>this.maxStackSize&&this.undoStack.shift(),this.lastValue=e,this._updateLastSelection(),this.redoStack=[]}undo(){if(this.undoStack.length===0)return;let e=this.undoStack.pop(),t=this._revertDiff(this.lastValue,e.diff);this.redoStack.push({diff:e.diff,selection:{selectionStart:this.textarea.selectionStart,selectionEnd:this.textarea.selectionEnd}}),this._restoreState(t,e.selection)}redo(){if(this.redoStack.length===0)return;let e=this.redoStack.pop(),t=this._applyDiff(this.lastValue,e.diff);this.undoStack.push({diff:e.diff,selection:{...this.lastSelection}}),this._restoreState(t,e.selection)}_applyDiff(e,t){let n=``;return t.forEach(e=>{e.removed||(n+=e.value)}),n}_revertDiff(e,t){let n=``;return t.forEach(e=>{e.added||(n+=e.value)}),n}_restoreState(e,t){this.textarea.value=e,this.textarea.setSelectionRange(t.selectionStart,t.selectionEnd),this.lastValue=e,this.lastSelection={...t},this.editor.render&&this.editor.render(),this.editor.notifyChange(),this.textarea.focus()}},Cr=class{constructor(e,t){this.editor=e,this.textarea=e.usertextarea,this.renderCallback=t,this.pairs={"{":`}`,"[":`]`,"(":`)`,"<":`>`,'"':`"`,"'":`'`},this.init()}init(){this.textarea.addEventListener(`keydown`,e=>{switch(e.key){case`Tab`:e.preventDefault(),e.shiftKey?this.outdent():this.indent(),this._triggerUpdate();break;case`Enter`:this.autoIndent(e);break;case`Backspace`:this.handleBackspace(e);break;default:this.pairs[e.key]&&this.handlePairs(e)}})}handlePairs(e){let{textarea:t}=this,{selectionStart:n,selectionEnd:r,value:i}=t,a=e.key;if(n===r&&i[n]===a&&Object.values(this.pairs).includes(a)){e.preventDefault();let r=n+1;t.setSelectionRange(r,r);return}let o=a,s=this.pairs[o];if(s){if(n!==r){e.preventDefault();let a=i.substring(n,r);t.value=i.substring(0,n)+o+a+s+i.substring(r),t.setSelectionRange(n+1,r+1),this._triggerUpdate()}else{e.preventDefault();let a=i.substring(0,n),c=i.substring(r);t.value=a+o+s+c,t.setSelectionRange(n+1,n+1),this._triggerUpdate()}}}handleBackspace(e){let{textarea:t}=this,{selectionStart:n,selectionEnd:r,value:i}=t;if(n===r&&n>0){let r=i[n-1],a=i[n];this.pairs[r]===a&&(e.preventDefault(),t.value=i.substring(0,n-1)+i.substring(n+1),t.setSelectionRange(n-1,n-1),this._triggerUpdate())}}autoIndent(e){let{textarea:t}=this,{selectionStart:n,value:r}=t,i=r.lastIndexOf(`
162
161
  `,n-1),a=r.substring(i+1,n);if(/^(\s*)([\-\*] |\d+\. )/.test(a))return;let o=(a.match(/^[ \t]*/)||[``])[0],s=r[n-1],c=r[n];if(s===`{`&&c===`}`){e.preventDefault();let i=`
163
162
  `+o+`
164
- `+o;t.value=r.substring(0,n)+i+r.substring(n);let a=n+o.length+1+1;t.setSelectionRange(a,a),this._triggerUpdate();return}if(o.length>0){e.preventDefault();let i=`
163
+ `+o;t.value=r.substring(0,n)+i+r.substring(n);let a=n+o.length+1+1;t.setSelectionRange(a,a),this._triggerUpdate()}else if(o.length>0){e.preventDefault();let i=`
165
164
  `+o;t.value=r.substring(0,n)+i+r.substring(t.selectionEnd);let a=n+i.length;t.setSelectionRange(a,a),this._triggerUpdate()}}_triggerUpdate(){typeof this.renderCallback==`function`&&this.renderCallback(),this.textarea.dispatchEvent(new Event(`input`,{bubbles:!0}))}indent(){let{textarea:e}=this,{selectionStart:t,selectionEnd:n,value:r}=e,i=r.lastIndexOf(`
166
165
  `,t-1)+1,a=r.indexOf(`
167
166
  `,n);a===-1&&(a=r.length);let o=r.substring(i,a).split(`
@@ -170,11 +169,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
170
169
  `,t-1)+1,a=r.indexOf(`
171
170
  `,n);a===-1&&(a=r.length);let o=r.substring(i,a).split(`
172
171
  `),s=0,c=0,l=o.map((e,t)=>e.startsWith(` `)?(t===0&&(s=1),c++,e.substring(1)):e.startsWith(` `)?(t===0&&(s=4),c+=4,e.substring(4)):e).join(`
173
- `);this._applyChange(r.substring(0,i)+l+r.substring(a),Math.max(i,t-s),Math.max(i,n-c))}_applyChange(e,t,n){this.textarea.value=e,this.textarea.setSelectionRange(t,n)}},xr=class{constructor(e){this.editor=e,this.textarea=e.usertextarea,this._keydownHandler=e=>{e.key===`Enter`&&this.handleEnter(e)},this.textarea.addEventListener(`keydown`,this._keydownHandler)}destroy(){this.textarea.removeEventListener(`keydown`,this._keydownHandler)}handleEnter(e){let{selectionStart:t,value:n}=this.textarea,r=n.lastIndexOf(`
172
+ `);this._applyChange(r.substring(0,i)+l+r.substring(a),Math.max(i,t-s),Math.max(i,n-c))}_applyChange(e,t,n){this.textarea.value=e,this.textarea.setSelectionRange(t,n)}},wr=class{constructor(e){this.editor=e,this.textarea=e.usertextarea,this._keydownHandler=e=>{e.key===`Enter`&&this.handleEnter(e)},this.textarea.addEventListener(`keydown`,this._keydownHandler)}destroy(){this.textarea.removeEventListener(`keydown`,this._keydownHandler)}handleEnter(e){let{selectionStart:t,value:n}=this.textarea,r=n.lastIndexOf(`
174
173
  `,t-1)+1,i=n.substring(r,t),a=i.match(/^(\s*)(\d+)\.\s/),o=i.match(/^(\s*)([\-\*] )\[[\s xX]\] /),s=i.match(/^(\s*)([\-\*] )\s*/);if(i.match(/^(\s*)(\d+\.\s|[\-\*] \[[\s xX]\] |[\-\*]\s)$/)){e.preventDefault();let i=n.substring(0,r),a=n.substring(t);this.textarea.value=i+`
175
- `+a,this.textarea.setSelectionRange(r+1,r+1),this.editor.render(),this.editor.notifyChange();return}let c=null;if(a?c=`${a[1]}${parseInt(a[2])+1}. `:o?c=`${o[1]}${o[2]}[ ] `:s&&(c=`${s[1]}${s[2]}`),c){e.preventDefault();let r=`\n${c}`,i=n.substring(0,t),a=n.substring(t);this.textarea.value=i+r+a;let o=t+r.length;this.textarea.setSelectionRange(o,o),this.editor.render(),this.editor.notifyChange()}}},Sr=[{key:`b`,ctrl:!0,shift:!1,ToolClass:Tn,label:`Ctrl+B`,btnClass:`bold-btn`},{key:`i`,ctrl:!0,shift:!1,ToolClass:En,label:`Ctrl+I`,btnClass:`italic-btn`},{key:`k`,ctrl:!0,shift:!1,ToolClass:Pn,label:`Ctrl+K`,btnClass:`link-btn`},{key:"`",ctrl:!0,shift:!1,ToolClass:Hn,label:"Ctrl+`",btnClass:`code-btn`},{key:`s`,ctrl:!0,shift:!0,ToolClass:Dn,label:`Ctrl+Shift+S`,btnClass:`strikethrough-btn`},{key:`l`,ctrl:!0,shift:!1,ToolClass:On,label:`Ctrl+L`,btnClass:`ul-btn`}],Cr=class{constructor(e){this.editor=e,this._handler=this._onKeyDown.bind(this),this._docHandler=this._onDocKeyDown.bind(this),e.usertextarea.addEventListener(`keydown`,this._handler),document.addEventListener(`keydown`,this._docHandler),this._updateTooltips()}_onKeyDown(e){let t=e.ctrlKey||e.metaKey,n=e.shiftKey,r=e.key.toLowerCase();if(t&&n&&r===`f`){e.preventDefault(),this.editor.editorContainer.querySelector(`.preview-btn`)?.click();return}if(t&&!n&&[`1`,`2`,`3`].includes(e.key)){e.preventDefault(),new Fn(this.editor).applyHeading(parseInt(e.key));return}for(let i of Sr)if(r===i.key&&t===i.ctrl&&n===i.shift){e.preventDefault(),new i.ToolClass(this.editor).applySyntax(e);return}}_onDocKeyDown(e){if(e.key===`F11`){let t=this.editor.editorContainer.contains(document.activeElement),n=this.editor.editorContainer.classList.contains(`is-fullscreen`);(t||n)&&(e.preventDefault(),this.editor.editorContainer.querySelector(`.preview-btn`)?.click())}}_updateTooltips(){for(let{btnClass:e,label:t}of Sr){let n=this.editor.editorContainer.querySelector(`.${e}`);n&&(n.title+=` (${t})`)}let e=this.editor.editorContainer.querySelector(`.heading-btn`);e&&(e.title+=` (Ctrl+1/2/3)`);let t=this.editor.editorContainer.querySelector(`.preview-btn`);t&&(t.title+=` (F11)`)}destroy(){this.editor.usertextarea.removeEventListener(`keydown`,this._handler),document.removeEventListener(`keydown`,this._docHandler)}},wr=class{constructor(e){this.editor=e,this._matches=[],this._currentIndex=-1,this._caseSensitive=!1,this._panel=null,this._findInput=null,this._replaceInput=null,this._countEl=null,this._replaceRow=null,this._caseSensitiveBtn=null,this._highlightEl=null,this._scrollHandler=null,this._taHandler=this._onTextareaKeyDown.bind(this),e.usertextarea.addEventListener(`keydown`,this._taHandler)}_onTextareaKeyDown(e){let t=e.ctrlKey||e.metaKey;t&&e.key===`f`?(e.preventDefault(),this.open(!1)):t&&e.key===`h`&&(e.preventDefault(),this.open(!0))}open(e=!1){this._panel||this._buildPanel(),this._panel.hidden=!1,e&&(this._replaceRow.hidden=!1),this._findInput.focus(),this._findInput.select();let t=this.editor.usertextarea.value.substring(this.editor.usertextarea.selectionStart,this.editor.usertextarea.selectionEnd);t&&!t.includes(`
174
+ `+a,this.textarea.setSelectionRange(r+1,r+1),this.editor.render(),this.editor.notifyChange();return}let c=null;if(a?c=`${a[1]}${parseInt(a[2])+1}. `:o?c=`${o[1]}${o[2]}[ ] `:s&&(c=`${s[1]}${s[2]}`),c){e.preventDefault();let r=`\n${c}`,i=n.substring(0,t),a=n.substring(t);this.textarea.value=i+r+a;let o=t+r.length;this.textarea.setSelectionRange(o,o),this.editor.render(),this.editor.notifyChange()}}},Tr=[{key:`b`,ctrl:!0,shift:!1,ToolClass:wn,label:`Ctrl+B`,btnClass:`bold-btn`},{key:`i`,ctrl:!0,shift:!1,ToolClass:Tn,label:`Ctrl+I`,btnClass:`italic-btn`},{key:`k`,ctrl:!0,shift:!1,ToolClass:Nn,label:`Ctrl+K`,btnClass:`link-btn`},{key:"`",ctrl:!0,shift:!1,ToolClass:Un,label:"Ctrl+`",btnClass:`code-btn`},{key:`s`,ctrl:!0,shift:!0,ToolClass:En,label:`Ctrl+Shift+S`,btnClass:`strikethrough-btn`},{key:`l`,ctrl:!0,shift:!1,ToolClass:Dn,label:`Ctrl+L`,btnClass:`ul-btn`}];function Er(e){let t=String(e).split(`+`).map(e=>e.trim().toLowerCase()),n=t.pop();return n?{key:n,ctrl:t.includes(`ctrl`)||t.includes(`cmd`)||t.includes(`meta`),shift:t.includes(`shift`),alt:t.includes(`alt`)}:null}var Dr=class{constructor(e){this.editor=e,this.toolShortcuts=(e.toolbarInstance?.tools??[]).filter(e=>e.shortcut).map(e=>({tool:e,combo:Er(e.shortcut)})).filter(e=>e.combo);let t=(e.toolbarInstance?.tools??[]).find(e=>e instanceof In);this.headingLevels=t?.levels??[1,2,3,4,5,6],this._handler=this._onKeyDown.bind(this),this._docHandler=this._onDocKeyDown.bind(this),e.usertextarea.addEventListener(`keydown`,this._handler),document.addEventListener(`keydown`,this._docHandler),this._updateTooltips()}_onKeyDown(e){let t=e.ctrlKey||e.metaKey,n=e.shiftKey,r=e.key.toLowerCase();if(t&&n&&r===`f`)e.preventDefault(),this.editor.editorContainer.querySelector(`.preview-btn`)?.click();else if(t&&!n&&[`1`,`2`,`3`].includes(e.key)&&this.headingLevels.includes(parseInt(e.key)))e.preventDefault(),new In(this.editor).applyHeading(parseInt(e.key));else{for(let{tool:i,combo:a}of this.toolShortcuts)if(r===a.key&&t===a.ctrl&&n===a.shift&&e.altKey===a.alt){e.preventDefault(),i.applySyntax(e);return}for(let i of Tr)if(r===i.key&&t===i.ctrl&&n===i.shift){e.preventDefault(),new i.ToolClass(this.editor).applySyntax(e);return}}}_onDocKeyDown(e){if(e.key===`F11`){let t=this.editor.editorContainer.contains(document.activeElement),n=this.editor.editorContainer.classList.contains(`is-fullscreen`);(t||n)&&(e.preventDefault(),this.editor.editorContainer.querySelector(`.preview-btn`)?.click())}}_updateTooltips(){for(let{btnClass:e,label:t}of Tr){let n=this.editor.editorContainer.querySelector(`.${e}`);n&&(n.title+=` (${t})`)}let e=this.editor.editorContainer.querySelector(`.heading-btn`),t=this.headingLevels.filter(e=>e<=3);e&&t.length&&(e.title+=` (Ctrl+${t.join(`/`)})`);let n=this.editor.editorContainer.querySelector(`.preview-btn`);n&&(n.title+=` (F11)`);for(let{tool:e}of this.toolShortcuts)e.button&&(e.button.title+=` (${e.shortcut})`)}destroy(){this.editor.usertextarea.removeEventListener(`keydown`,this._handler),document.removeEventListener(`keydown`,this._docHandler)}},Or=class{constructor(e){this.editor=e,this._matches=[],this._currentIndex=-1,this._caseSensitive=!1,this._panel=null,this._findInput=null,this._replaceInput=null,this._countEl=null,this._replaceRow=null,this._caseSensitiveBtn=null,this._highlightEl=null,this._scrollHandler=null,this._taHandler=this._onTextareaKeyDown.bind(this),e.usertextarea.addEventListener(`keydown`,this._taHandler)}_onTextareaKeyDown(e){let t=e.ctrlKey||e.metaKey;t&&e.key===`f`?(e.preventDefault(),this.open(!1)):t&&e.key===`h`&&(e.preventDefault(),this.open(!0))}open(e=!1){this._panel||this._buildPanel(),this._panel.hidden=!1,e&&(this._replaceRow.hidden=!1),this._findInput.focus(),this._findInput.select();let t=this.editor.usertextarea.value.substring(this.editor.usertextarea.selectionStart,this.editor.usertextarea.selectionEnd);t&&!t.includes(`
176
175
  `)&&(this._findInput.value=t),this._scrollHandler||(this._scrollHandler=()=>this._showMatchHighlight(),this.editor.usertextarea.addEventListener(`scroll`,this._scrollHandler)),this._search()}close(){if(!this._panel)return;this._panel.hidden=!0,this._clearMatchHighlight(),this._scrollHandler&&=(this.editor.usertextarea.removeEventListener(`scroll`,this._scrollHandler),null);let e=this.editor.usertextarea;if(this._currentIndex!==-1&&this._matches.length){let{start:t,end:n}=this._matches[this._currentIndex];e.focus(),e.setSelectionRange(t,n)}else e.focus();this._matches=[],this._currentIndex=-1}_buildPanel(){let e=document.createElement(`div`);e.className=`find-replace-panel fj:absolute fj:top-1 fj:right-1 fj:z-20 fj:me-surface fj:me-surface-outline fj:me-surface-rounded fj:p-1.5 fj:flex fj:flex-col fj:gap-1 fj:shadow-lg`,e.setAttribute(`role`,`search`),e.setAttribute(`aria-label`,`Find and replace`);let t=document.createElement(`div`);t.className=`fj:flex fj:items-center fj:gap-1`,this._findInput=document.createElement(`input`),this._findInput.type=`text`,this._findInput.placeholder=`Find`,this._findInput.className=`fj:me-input fj:me-input-xs fj:w-36`,this._findInput.setAttribute(`aria-label`,`Find`),this._findInput.addEventListener(`input`,()=>this._search()),this._findInput.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.shiftKey?this._prev():this._next()),e.key===`Escape`&&(e.preventDefault(),this.close())}),this._countEl=document.createElement(`span`),this._countEl.className=`fj:text-xs fj:opacity-50 fj:whitespace-nowrap fj:min-w-[3.5rem] fj:text-center fj:select-none`,this._countEl.setAttribute(`aria-live`,`polite`);let n=this._iconBtn(`Previous match`,`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m18 15-6-6-6 6"/></svg>`);n.addEventListener(`click`,()=>this._prev());let r=this._iconBtn(`Next match`,`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>`);r.addEventListener(`click`,()=>this._next()),this._caseSensitiveBtn=document.createElement(`button`),this._caseSensitiveBtn.type=`button`,this._caseSensitiveBtn.className=`fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost fj:text-xs fj:font-bold`,this._caseSensitiveBtn.textContent=`Aa`,this._caseSensitiveBtn.setAttribute(`aria-label`,`Match case`),this._caseSensitiveBtn.setAttribute(`aria-pressed`,`false`),this._caseSensitiveBtn.title=`Match case`,this._caseSensitiveBtn.addEventListener(`click`,()=>{this._caseSensitive=!this._caseSensitive,this._caseSensitiveBtn.setAttribute(`aria-pressed`,String(this._caseSensitive)),this._caseSensitiveBtn.classList.toggle(`fj:me-btn-active`,this._caseSensitive),this._search()});let i=document.createElement(`button`);i.type=`button`,i.className=`fj:me-btn fj:me-btn-xs fj:me-btn-ghost fj:text-xs fj:px-1.5`,i.textContent=`Replace`,i.setAttribute(`aria-label`,`Toggle replace row`),i.addEventListener(`click`,()=>{this._replaceRow.hidden=!this._replaceRow.hidden,this._replaceRow.hidden||this._replaceInput.focus()});let a=this._iconBtn(`Close`,`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`);a.addEventListener(`click`,()=>this.close()),t.append(this._findInput,this._countEl,n,r,this._caseSensitiveBtn,i,a),this._replaceRow=document.createElement(`div`),this._replaceRow.className=`fj:flex fj:items-center fj:gap-1`,this._replaceRow.hidden=!0,this._replaceInput=document.createElement(`input`),this._replaceInput.type=`text`,this._replaceInput.placeholder=`Replace`,this._replaceInput.className=`fj:me-input fj:me-input-xs fj:w-36`,this._replaceInput.setAttribute(`aria-label`,`Replace with`),this._replaceInput.addEventListener(`keydown`,e=>{e.key===`Enter`&&this._replace(),e.key===`Escape`&&(e.preventDefault(),this.close())});let o=document.createElement(`button`);o.type=`button`,o.className=`fj:me-btn fj:me-btn-xs fj:me-btn-ghost fj:text-xs fj:px-1.5`,o.textContent=`Replace`,o.addEventListener(`click`,()=>this._replace());let s=document.createElement(`button`);s.type=`button`,s.className=`fj:me-btn fj:me-btn-xs fj:me-btn-ghost fj:text-xs fj:px-1.5`,s.textContent=`All`,s.setAttribute(`aria-label`,`Replace all`),s.addEventListener(`click`,()=>this._replaceAll()),this._replaceRow.append(this._replaceInput,o,s),e.append(t,this._replaceRow),this.editor.markdownEditorDiv.appendChild(e),this._panel=e}_iconBtn(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=`fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost`,n.setAttribute(`aria-label`,e),n.innerHTML=t;let r=n.querySelector(`svg`);return r&&r.setAttribute(`aria-hidden`,`true`),n}_search(){let e=this._findInput?.value??``,t=this.editor.usertextarea.value;if(!e){this._matches=[],this._currentIndex=-1,this._clearMatchHighlight(),this._updateCount();return}let n=this._caseSensitive?t:t.toLowerCase(),r=this._caseSensitive?e:e.toLowerCase();this._matches=[];let i=0;for(;i<=n.length-r.length;){let t=n.indexOf(r,i);if(t===-1)break;this._matches.push({start:t,end:t+e.length}),i=t+1}this._currentIndex=this._matches.length>0?Math.min(Math.max(this._currentIndex,0),this._matches.length-1):-1,this._selectCurrent(),this._updateCount()}_next(){this._matches.length!==0&&(this._currentIndex=(this._currentIndex+1)%this._matches.length,this._selectCurrent(),this._updateCount())}_prev(){this._matches.length!==0&&(this._currentIndex=(this._currentIndex-1+this._matches.length)%this._matches.length,this._selectCurrent(),this._updateCount())}_selectCurrent(){if(this._currentIndex===-1||this._matches.length===0){this._clearMatchHighlight();return}let{start:e}=this._matches[this._currentIndex];this._scrollToMatch(this.editor.usertextarea,e),this._showMatchHighlight()}_scrollToMatch(e,t){let n=parseInt(window.getComputedStyle(e).lineHeight)||20,r=e.value.substring(0,t).split(`
177
- `).length-1,i=Math.floor(e.clientHeight/n);e.scrollTop=Math.max(0,(r-Math.floor(i/2))*n)}_showMatchHighlight(){if(this._clearMatchHighlight(),this._currentIndex===-1||!this._matches.length)return;let{start:e,end:t}=this._matches[this._currentIndex],n=this.editor.usertextarea,r=window.getComputedStyle(n),i=n.parentElement,a=document.createElement(`div`);Object.assign(a.style,{position:`absolute`,visibility:`hidden`,pointerEvents:`none`,top:`0`,left:`0`,right:`0`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,overflowWrap:`break-word`,font:r.font,lineHeight:r.lineHeight,paddingTop:r.paddingTop,paddingRight:r.paddingRight,paddingBottom:r.paddingBottom,paddingLeft:r.paddingLeft,boxSizing:`border-box`});let o=document.createElement(`span`);o.textContent=n.value.substring(e,t)||`​`,a.appendChild(document.createTextNode(n.value.substring(0,e))),a.appendChild(o),a.appendChild(document.createTextNode(n.value.substring(t))),i.appendChild(a);try{let e=i.getBoundingClientRect(),t=o.getBoundingClientRect(),r=document.createElement(`div`);Object.assign(r.style,{position:`absolute`,top:t.top-e.top-n.scrollTop+`px`,left:t.left-e.left+`px`,width:Math.max(t.width,2)+`px`,height:t.height+`px`,background:`color-mix(in oklch, var(--color-primary, oklch(0.6 0.2 250)), transparent 55%)`,borderRadius:`2px`,pointerEvents:`none`,zIndex:`2`}),i.appendChild(r),this._highlightEl=r}finally{i.removeChild(a)}}_clearMatchHighlight(){this._highlightEl?.remove(),this._highlightEl=null}_updateCount(){this._countEl&&(this._matches.length===0?this._countEl.textContent=this._findInput?.value?`No results`:``:this._countEl.textContent=`${this._currentIndex+1} of ${this._matches.length}`)}_replace(){if(this._currentIndex===-1)return;let{start:e,end:t}=this._matches[this._currentIndex],n=this.editor.usertextarea,r=this._replaceInput.value;n.value=n.value.substring(0,e)+r+n.value.substring(t),this.editor.render(),this.editor.notifyChange(),this._search()}_replaceAll(){let e=this._findInput?.value;if(!e)return;let t=this._replaceInput.value,n=this.editor.usertextarea,r=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=this._caseSensitive?`g`:`gi`;n.value=n.value.replace(new RegExp(r,i),t),this.editor.render(),this.editor.notifyChange(),this._currentIndex=0,this._search()}destroy(){this.editor.usertextarea.removeEventListener(`keydown`,this._taHandler),this._scrollHandler&&this.editor.usertextarea.removeEventListener(`scroll`,this._scrollHandler),this._clearMatchHighlight(),this._panel?.remove()}},Tr=/^https?:\/\/\S+$/i,Er=class{constructor(e){this.editor=e,this.textarea=e.usertextarea,this._pasteHandler=e=>this._onPaste(e),this._dropHandler=e=>this._onDrop(e),this._dragOverHandler=e=>{this._carriesFiles(e.dataTransfer)&&e.preventDefault()},this.textarea.addEventListener(`paste`,this._pasteHandler),this.textarea.addEventListener(`drop`,this._dropHandler),this.textarea.addEventListener(`dragover`,this._dragOverHandler)}destroy(){this.textarea.removeEventListener(`paste`,this._pasteHandler),this.textarea.removeEventListener(`drop`,this._dropHandler),this.textarea.removeEventListener(`dragover`,this._dragOverHandler)}_carriesFiles(e){return Array.from(e?.types??[]).includes(`Files`)}_imageFiles(e){return Array.from(e?.files??[]).filter(e=>e.type?.startsWith(`image/`))}_onPaste(e){let t=this._imageFiles(e.clipboardData);if(t.length){if(!this.editor.imageUpload){console.warn(`[MarkdownEditor] An image was pasted but no upload endpoint is configured. Add { image: { fileInput: { uploadUrl: "..." } } } to the toolbar to enable it.`);return}e.preventDefault(),this._uploadAll(t);return}let n=e.clipboardData?.getData(`text/plain`)?.trim(),{selectionStart:r,selectionEnd:i}=this.textarea;if(n&&i>r&&Tr.test(n)){e.preventDefault();let t=`[${this.textarea.value.slice(r,i)}](${n})`;this.editor.insertText(t,t.length,0)}}_onDrop(e){if(!this._carriesFiles(e.dataTransfer))return;e.preventDefault();let t=this._imageFiles(e.dataTransfer);if(t.length){if(!this.editor.imageUpload){console.warn(`[MarkdownEditor] An image was dropped but no upload endpoint is configured. Add { image: { fileInput: { uploadUrl: "..." } } } to the toolbar to enable it.`);return}this._uploadAll(t)}}async _uploadAll(e){for(let t of e){let e=`![${this.editor.label(`Uploading...`)}]()`;this.editor.insertText(e,e.length,0);try{let{path:n,alt:r}=await In(t,this.editor.imageUpload);this._replace(e,`![${r}](${n})`)}catch(t){this._replace(e,`![${this.editor.label(`Upload failed`)}]()`),console.error(`[MarkdownEditor] Image upload failed.`,t)}}}_replace(e,t){let n=this.textarea,r=n.value.indexOf(e);if(r===-1)return;n.value=n.value.slice(0,r)+t+n.value.slice(r+e.length);let i=r+t.length;n.setSelectionRange(i,i),this.editor.render(),this.editor.notifyChange()}},Dr=new ot({breaks:!0});return class{constructor(e,t={}){this.usertextarea=typeof e==`string`?document.querySelector(e):e,this.options=t,this.mode=t.mode||`plain`,this.preview=!this.options.toolbar||this.options.toolbar.includes(`preview`),this.footerOptions=this._parseFooterOptions(t.footer),this.variables=this._parseVariables(t.toolbar),this.imageUpload=this._parseImageUpload(t.toolbar),this.previewTimer=null,this.init(),this.undoRedoManager=new yr(this),this.listManager=new xr(this),this.indentManager=new br(this),this.shortcutManager=new Cr(this),this.findReplace=new wr(this),this.pasteManager=new Er(this)}label(e){return this.options.labels?.[e]??e}_parseImageUpload(e){let t=(Array.isArray(e)?e:[]).find(e=>e&&typeof e==`object`&&e.image)?.image?.fileInput;return t?.uploadUrl?t:null}_parseVariables(e){let t=(Array.isArray(e)?e:[]).find(e=>e&&typeof e==`object`&&Array.isArray(e.variables));return t?t.variables:[]}_parseFooterOptions(e){if(e===!1)return null;let t=e??{};return{line:t.line!==!1,col:t.col!==!1,chars:t.chars!==!1,words:t.words===!0}}init(){this.createEditor(),this.addToolbar(),this.addFooter(),this._toolbarH=this.editorContainer.querySelector(`.toolbar`)?.offsetHeight??0,this._footerH=this.editorContainer.querySelector(`.editor-footer`)?.offsetHeight??0,this._autoGrow()}createEditor(){this.isTextareaValid()&&(this.applyDefaultAttributes(),this.buildEditorLayout(),this.addInputListener(),this.render())}isTextareaValid(){return this.usertextarea.tagName===`TEXTAREA`}applyDefaultAttributes(){this.usertextarea.id&&document.querySelector(`label[for="${this.usertextarea.id}"]`)||this.usertextarea.getAttribute(`aria-label`)||this.usertextarea.getAttribute(`aria-labelledby`)||(this.usertextarea.setAttribute(`aria-label`,this.options.label||`Markdown editor`),this._addedAriaLabel=!0),this.usertextarea.classList.add(`editor-textarea`,`fj:focus:ring-0`,`fj:focus:outline-0`,`fj:border-0`,`fj:border-base-soft`,`fj:px-4`,`fj:py-2`,`fj:max-w-full`,`fj:w-full`,`fj:h-full`,`fj:bg-transparent`,`fj:outline-0`,`fj:appearance-none`,`fj:overflow-y-auto`),this.usertextarea.hasAttribute(`placeholder`)||(this.usertextarea.placeholder=this.options.placeholder||`Write your markdown...`)}buildEditorLayout(){this.editorContainer=document.createElement(`div`),this.editorContainer.className=`
176
+ `).length-1,i=Math.floor(e.clientHeight/n);e.scrollTop=Math.max(0,(r-Math.floor(i/2))*n)}_showMatchHighlight(){if(this._clearMatchHighlight(),this._currentIndex===-1||!this._matches.length)return;let{start:e,end:t}=this._matches[this._currentIndex],n=this.editor.usertextarea,r=window.getComputedStyle(n),i=n.parentElement,a=document.createElement(`div`);Object.assign(a.style,{position:`absolute`,visibility:`hidden`,pointerEvents:`none`,top:`0`,left:`0`,right:`0`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,overflowWrap:`break-word`,font:r.font,lineHeight:r.lineHeight,paddingTop:r.paddingTop,paddingRight:r.paddingRight,paddingBottom:r.paddingBottom,paddingLeft:r.paddingLeft,boxSizing:`border-box`});let o=document.createElement(`span`);o.textContent=n.value.substring(e,t)||`​`,a.appendChild(document.createTextNode(n.value.substring(0,e))),a.appendChild(o),a.appendChild(document.createTextNode(n.value.substring(t))),i.appendChild(a);try{let e=i.getBoundingClientRect(),t=o.getBoundingClientRect(),r=document.createElement(`div`);Object.assign(r.style,{position:`absolute`,top:t.top-e.top-n.scrollTop+`px`,left:t.left-e.left+`px`,width:Math.max(t.width,2)+`px`,height:t.height+`px`,background:`color-mix(in oklch, var(--color-primary, oklch(0.6 0.2 250)), transparent 55%)`,borderRadius:`2px`,pointerEvents:`none`,zIndex:`2`}),i.appendChild(r),this._highlightEl=r}finally{i.removeChild(a)}}_clearMatchHighlight(){this._highlightEl?.remove(),this._highlightEl=null}_updateCount(){this._countEl&&(this._matches.length===0?this._countEl.textContent=this._findInput?.value?`No results`:``:this._countEl.textContent=`${this._currentIndex+1} of ${this._matches.length}`)}_replace(){if(this._currentIndex===-1)return;let{start:e,end:t}=this._matches[this._currentIndex],n=this.editor.usertextarea,r=this._replaceInput.value;n.value=n.value.substring(0,e)+r+n.value.substring(t),this.editor.render(),this.editor.notifyChange(),this._search()}_replaceAll(){let e=this._findInput?.value;if(!e)return;let t=this._replaceInput.value,n=this.editor.usertextarea,r=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=this._caseSensitive?`g`:`gi`;n.value=n.value.replace(new RegExp(r,i),t),this.editor.render(),this.editor.notifyChange(),this._currentIndex=0,this._search()}destroy(){this.editor.usertextarea.removeEventListener(`keydown`,this._taHandler),this._scrollHandler&&this.editor.usertextarea.removeEventListener(`scroll`,this._scrollHandler),this._clearMatchHighlight(),this._panel?.remove()}},kr=/^https?:\/\/\S+$/i,Ar=class{constructor(e){this.editor=e,this.textarea=e.usertextarea,this._pasteHandler=e=>this._onPaste(e),this._dropHandler=e=>this._onDrop(e),this._dragOverHandler=e=>{this._carriesFiles(e.dataTransfer)&&e.preventDefault()},this.textarea.addEventListener(`paste`,this._pasteHandler),this.textarea.addEventListener(`drop`,this._dropHandler),this.textarea.addEventListener(`dragover`,this._dragOverHandler)}destroy(){this.textarea.removeEventListener(`paste`,this._pasteHandler),this.textarea.removeEventListener(`drop`,this._dropHandler),this.textarea.removeEventListener(`dragover`,this._dragOverHandler)}_carriesFiles(e){return Array.from(e?.types??[]).includes(`Files`)}_imageFiles(e){return Array.from(e?.files??[]).filter(e=>e.type?.startsWith(`image/`))}_onPaste(e){let t=this._imageFiles(e.clipboardData);if(t.length){if(!this.editor.imageUpload){console.warn(`[MarkdownEditor] An image was pasted but no upload endpoint is configured. Add { image: { fileInput: { uploadUrl: "..." } } } to the toolbar to enable it.`);return}e.preventDefault(),this._uploadAll(t);return}let n=e.clipboardData?.getData(`text/plain`)?.trim(),{selectionStart:r,selectionEnd:i}=this.textarea;if(n&&i>r&&kr.test(n)){e.preventDefault();let t=`[${this.textarea.value.slice(r,i)}](${n})`;this.editor.insertText(t,t.length,0)}}_onDrop(e){if(!this._carriesFiles(e.dataTransfer))return;e.preventDefault();let t=this._imageFiles(e.dataTransfer);t.length&&(this.editor.imageUpload?this._uploadAll(t):console.warn(`[MarkdownEditor] An image was dropped but no upload endpoint is configured. Add { image: { fileInput: { uploadUrl: "..." } } } to the toolbar to enable it.`))}async _uploadAll(e){for(let t of e){let e=`![${this.editor.label(`Uploading...`)}]()`;this.editor.insertText(e,e.length,0);try{let{path:n,alt:r}=await Ln(t,this.editor.imageUpload);this._replace(e,`![${r}](${n})`)}catch(t){this._replace(e,`![${this.editor.label(`Upload failed`)}]()`),console.error(`[MarkdownEditor] Image upload failed.`,t)}}}_replace(e,t){let n=this.textarea,r=n.value.indexOf(e);if(r===-1)return;n.value=n.value.slice(0,r)+t+n.value.slice(r+e.length);let i=r+t.length;n.setSelectionRange(i,i),this.editor.render(),this.editor.notifyChange()}},jr=new rt({breaks:!0}),Mr=class e{constructor(e,t={}){this.usertextarea=typeof e==`string`?document.querySelector(e):e,this.options=t,this.mode=t.mode||`plain`,this.preview=!this.options.toolbar||this.options.toolbar.includes(`preview`),this.footerOptions=this._parseFooterOptions(t.footer),this.variables=this._parseVariables(t.toolbar),this.imageUpload=this._parseImageUpload(t.toolbar),this.previewTimer=null,this.init(),this.undoRedoManager=new Sr(this),this.listManager=new wr(this),this.indentManager=new Cr(this),this.shortcutManager=new Dr(this),this.findReplace=new Or(this),this.pasteManager=new Ar(this),this._warnIfStylesheetMissing()}_warnIfStylesheetMissing(){e._cssWarned||this.editorContainer?.isConnected&&(getComputedStyle(this.editorContainer).getPropertyValue(`--mte-css`).trim()||(e._cssWarned=!0,console.error(`[MarkdownEditor] Stylesheet not loaded, so the editor will look unstyled.
177
+ Bundlers: import 'markdown-text-editor/style.css'
178
+ Browsers: <link rel="stylesheet" href=".../dist/markdown-text-editor.css">`)))}label(e){return this.options.labels?.[e]??e}_parseImageUpload(e){let t=(Array.isArray(e)?e:[]).find(e=>e&&typeof e==`object`&&e.image)?.image?.fileInput;return t?.uploadUrl?t:null}_parseVariables(e){let t=(Array.isArray(e)?e:[]).find(e=>e&&typeof e==`object`&&Array.isArray(e.variables));return t?t.variables:[]}_parseFooterOptions(e){if(e===!1)return null;let t=e??{};return{line:t.line!==!1,col:t.col!==!1,chars:t.chars!==!1,words:t.words===!0}}init(){this.createEditor(),this.addToolbar(),this.addFooter(),this._toolbarH=this.editorContainer.querySelector(`.toolbar`)?.offsetHeight??0,this._footerH=this.editorContainer.querySelector(`.editor-footer`)?.offsetHeight??0,this._autoGrow()}createEditor(){this.isTextareaValid()&&(this.applyDefaultAttributes(),this.buildEditorLayout(),this.addInputListener(),this.render())}isTextareaValid(){return this.usertextarea.tagName===`TEXTAREA`}applyDefaultAttributes(){this.usertextarea.id&&document.querySelector(`label[for="${this.usertextarea.id}"]`)||this.usertextarea.getAttribute(`aria-label`)||this.usertextarea.getAttribute(`aria-labelledby`)||(this.usertextarea.setAttribute(`aria-label`,this.options.label||`Markdown editor`),this._addedAriaLabel=!0),this.usertextarea.classList.add(`editor-textarea`,`fj:focus:ring-0`,`fj:focus:outline-0`,`fj:border-0`,`fj:border-base-soft`,`fj:px-4`,`fj:py-2`,`fj:max-w-full`,`fj:w-full`,`fj:h-full`,`fj:bg-transparent`,`fj:outline-0`,`fj:appearance-none`,`fj:overflow-y-auto`),this.usertextarea.hasAttribute(`placeholder`)||(this.usertextarea.placeholder=this.options.placeholder||`Write your markdown...`)}buildEditorLayout(){this.editorContainer=document.createElement(`div`),this.editorContainer.className=`
178
179
  markdown-editor-wrapper
179
180
  fj:me-surface
180
181
  fj:me-surface-outline
@@ -218,12 +219,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
218
219
  fj:box-border
219
220
  fj:relative
220
221
  fj:z-10
221
- `,e.appendChild(this.displayLayer)),e.appendChild(this.usertextarea),this.markdownEditorDiv.appendChild(e)}addPreviewWrapper(){let e=new Zn(this.markdownEditorDiv);this.previewContent=e.getPreviewContent()}addInputListener(){this._inputHandler=()=>{this._autoGrow(),this.renderHybrid(),this.debouncedPreview(),this.notifyChange()},this._scrollHandler=()=>{this._scrollRaf||=requestAnimationFrame(()=>{if(this._scrollRaf=null,this.mode===`hybrid`&&(this.displayLayer.scrollTop=this.usertextarea.scrollTop,this.displayLayer.scrollLeft=this.usertextarea.scrollLeft),this.preview&&this.previewContent){let e=this.usertextarea,t=e.scrollTop/(e.scrollHeight-e.clientHeight);this.previewContent.scrollTop=t*(this.previewContent.scrollHeight-this.previewContent.clientHeight)}})},this.usertextarea.addEventListener(`input`,this._inputHandler),this.usertextarea.addEventListener(`scroll`,this._scrollHandler)}debouncedPreview(){this.preview&&(clearTimeout(this.previewTimer),this.previewTimer=setTimeout(()=>{this.previewContent.innerHTML=this._renderMarkdown(this.usertextarea.value),this.wirePreviewCheckboxes();let e=this.usertextarea,t=e.scrollTop/(e.scrollHeight-e.clientHeight);this.previewContent.scrollTop=t*(this.previewContent.scrollHeight-this.previewContent.clientHeight)},150))}_renderMarkdown(e){let t=this.options.renderer??(e=>Dr.parse(e)),n=this.options.sanitizer??(e=>wn.sanitize(e)),r=qn(e,this.variables),i=t(r);return this.options.renderer&&!this._taskListWarned&&/^\s*[-*] \[[ xX]\] /m.test(r)&&!/type=["']?checkbox/.test(i)&&(this._taskListWarned=!0,console.warn(`[MarkdownEditor] Task list syntax found, but the custom renderer emitted no checkboxes. Clickable checkboxes in the preview need a task-list plugin, e.g. markdown-it-task-lists.`)),n(i)}wirePreviewCheckboxes(){this.previewContent.querySelectorAll(`input[type="checkbox"]`).forEach((e,t)=>{e.removeAttribute(`disabled`),e.addEventListener(`click`,n=>{n.preventDefault();let r=this.usertextarea.value.split(`
222
+ `,e.appendChild(this.displayLayer)),e.appendChild(this.usertextarea),this.markdownEditorDiv.appendChild(e)}addPreviewWrapper(){let e=new $n(this.markdownEditorDiv);this.previewContent=e.getPreviewContent()}addInputListener(){this._inputHandler=()=>{this._autoGrow(),this.renderHybrid(),this.debouncedPreview(),this.notifyChange()},this._scrollHandler=()=>{this._scrollRaf||=requestAnimationFrame(()=>{if(this._scrollRaf=null,this.mode===`hybrid`&&(this.displayLayer.scrollTop=this.usertextarea.scrollTop,this.displayLayer.scrollLeft=this.usertextarea.scrollLeft),this.preview&&this.previewContent){let e=this.usertextarea,t=e.scrollTop/(e.scrollHeight-e.clientHeight);this.previewContent.scrollTop=t*(this.previewContent.scrollHeight-this.previewContent.clientHeight)}})},this.usertextarea.addEventListener(`input`,this._inputHandler),this.usertextarea.addEventListener(`scroll`,this._scrollHandler)}debouncedPreview(){this.preview&&(clearTimeout(this.previewTimer),this.previewTimer=setTimeout(()=>{this.previewContent.innerHTML=this._renderMarkdown(this.usertextarea.value),this.wirePreviewCheckboxes();let e=this.usertextarea,t=e.scrollTop/(e.scrollHeight-e.clientHeight);this.previewContent.scrollTop=t*(this.previewContent.scrollHeight-this.previewContent.clientHeight)},150))}renderMarkdown(e){return this._renderMarkdown(e)}createToolbar(e,t=[`bold`,`italic`,`strikethrough`]){let n=Object.create(this);return n.usertextarea=e,n.scrollToView=()=>{},n.render=()=>{},n.notifyChange=()=>{},n.insertText=(t,n=0,r=0)=>{let{selectionStart:i,selectionEnd:a,value:o}=e;e.value=o.slice(0,i)+t+o.slice(a),e.focus(),e.setSelectionRange(i+n,i+t.length-r)},new Qn(n,t,{standalone:!0}).toolbar}_renderMarkdown(e){let t=this.options.renderer??(e=>jr.parse(e)),n=this.options.sanitizer??(e=>Cn.sanitize(e)),r=Jn(e,this.variables),i=t(r);return this.options.renderer&&!this._taskListWarned&&/^\s*[-*] \[[ xX]\] /m.test(r)&&!/type=["']?checkbox/.test(i)&&(this._taskListWarned=!0,console.warn(`[MarkdownEditor] Task list syntax found, but the custom renderer emitted no checkboxes. Clickable checkboxes in the preview need a task-list plugin, e.g. markdown-it-task-lists.`)),n(i)}wirePreviewCheckboxes(){this.previewContent.querySelectorAll(`input[type="checkbox"]`).forEach((e,t)=>{e.removeAttribute(`disabled`),e.addEventListener(`click`,n=>{n.preventDefault();let r=this.usertextarea.value.split(`
222
223
  `),i=0;for(let n=0;n<r.length;n++)if(/^(\s*)([-*] \[[ xX]\] )/.test(r[n])){if(i===t){e.checked?r[n]=r[n].replace(/\[ \]/,`[x]`):r[n]=r[n].replace(/\[[xX]\]/,`[ ]`);break}i++}this.usertextarea.value=r.join(`
223
- `),this.render(),this.notifyChange()})})}addFooter(){if(!this.footerOptions)return;let{line:e,col:t,chars:n,words:r}=this.footerOptions;(e||t||n||r)&&(this.footer=new Qn(this.editorContainer,this.footerOptions),this.footer.update(this.usertextarea),this._footerUpdate=()=>this.footer.update(this.usertextarea),this.usertextarea.addEventListener(`input`,this._footerUpdate),this.usertextarea.addEventListener(`click`,this._footerUpdate),this.usertextarea.addEventListener(`keyup`,this._footerUpdate),this.usertextarea.addEventListener(`focus`,this._footerUpdate))}addToolbar(){new Xn(this,this.options.toolbar||[`undo`,`redo`,`heading`,`blockquote`,`ul`,`ol`,`checklist`,`outdent`,`indent`,`bold`,`italic`,`strikethrough`,`code`,`codeblock`,`hr`,`table`,`link`,`image`,`preview`])}insertText(e,t=0,n=0){let{selectionStart:r,selectionEnd:i}=this.usertextarea,a=this.usertextarea.value;this.usertextarea.value=`${a.substring(0,r)}${e}${a.substring(i)}`,this.usertextarea.focus(),this.usertextarea.setSelectionRange(r+t,r+e.length-n),this.scrollToView(),this.render(),this.notifyChange()}scrollToView(){let e=this.usertextarea,t=e.selectionStart,n=parseInt(window.getComputedStyle(e).lineHeight),r=e.value.substring(0,t).split(`
224
+ `),this.render(),this.notifyChange()})})}addFooter(){if(!this.footerOptions)return;let{line:e,col:t,chars:n,words:r}=this.footerOptions;(e||t||n||r)&&(this.footer=new er(this.editorContainer,this.footerOptions),this.footer.update(this.usertextarea),this._footerUpdate=()=>this.footer.update(this.usertextarea),this.usertextarea.addEventListener(`input`,this._footerUpdate),this.usertextarea.addEventListener(`click`,this._footerUpdate),this.usertextarea.addEventListener(`keyup`,this._footerUpdate),this.usertextarea.addEventListener(`focus`,this._footerUpdate))}addToolbar(){this.toolbarInstance=new Qn(this,this.options.toolbar||[`undo`,`redo`,`heading`,`blockquote`,`ul`,`ol`,`checklist`,`outdent`,`indent`,`bold`,`italic`,`strikethrough`,`code`,`codeblock`,`hr`,`table`,`link`,`image`,`preview`])}insertText(e,t=0,n=0){let{selectionStart:r,selectionEnd:i}=this.usertextarea,a=this.usertextarea.value;this.usertextarea.value=`${a.substring(0,r)}${e}${a.substring(i)}`,this.usertextarea.focus(),this.usertextarea.setSelectionRange(r+t,r+e.length-n),this.scrollToView(),this.render(),this.notifyChange()}scrollToView(){let e=this.usertextarea,t=e.selectionStart,n=parseInt(window.getComputedStyle(e).lineHeight),r=e.value.substring(0,t).split(`
224
225
  `).length-1,i=Math.floor(e.clientHeight/n);e.scrollTop=(r-Math.floor(i/2))*n}_highlight(e){let t=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`);return t=t.replace(/```(\w+)?\n([\s\S]*?)```/g,'<span class="fj:opacity-30">```$1</span>\n$2<span class="fj:opacity-30">```</span>').replace(/`([^`\n]+)`/g,'<span class="fj:opacity-40">`</span><span class="fj:text-accent">$1</span><span class="fj:opacity-40">`</span>').replace(/^(#+ )(.*)$/gm,`<span class="fj:text-primary"><span class="fj:opacity-40">$1</span><span class="faux-bold">$2</span></span>`).replace(/\*\*(.*?)\*\*/g,`<span class="fj:text-secondary"><span class="fj:opacity-40">**</span><span class="faux-bold">$1</span><span class="fj:opacity-40">**</span></span>`).replace(/^([\s]*)([\-\*] |[\d]+\. |\[[\s xX]\] )(.*)$/gm,`$1<span class="fj:text-primary">$2</span>$3`).replace(/(\*|_)(.*?)\1/g,`<span class="fj:text-accent"><span class="fj:opacity-40">$1</span>$2<span class="fj:opacity-40">$1</span></span>`).replace(/~~(.*?)~~/g,`<span class="fj:line-through fj:opacity-70"><span class="fj:opacity-40">~~</span>$1<span class="fj:opacity-40">~~</span></span>`).replace(/(?<!~)(~)([^~]+)\1(?!~)/g,`<span class="fj:line-through fj:opacity-70"><span class="fj:opacity-40">$1</span>$2<span class="fj:opacity-40">$1</span></span>`).replace(/(!?\[)(.*?)(\]\()(.*?)(\))/g,`<span class="fj:opacity-40">$1</span><span class="fj:text-primary">$2</span><span class="fj:opacity-40">$3</span><span class="fj:underline fj:opacity-50">$4</span><span class="fj:opacity-50">$5</span>`),e.endsWith(`
225
226
  `)&&(t+=` `),t}renderHybrid(){if(this.mode!==`hybrid`)return;let e=this.usertextarea.value;if(e===this._lastRaw)return;this._lastRaw=e;let t=this._highlight(e).split(`
226
- `),n=this._lastLines;if(!n||n.length!==t.length){this.displayLayer.innerHTML=``,this._lineNodes=t.map((e,n)=>{let r=document.createElement(`span`);return r.innerHTML=e+(n<t.length-1?`
227
- `:``),this.displayLayer.appendChild(r),r}),this._lastLines=t.slice();return}for(let e=0;e<t.length;e++)t[e]!==n[e]&&(this._lineNodes[e].innerHTML=t[e]+(e<t.length-1?`
228
- `:``),n[e]=t[e])}_autoGrow(){if(this.editorContainer.classList.contains(`is-fullscreen`))return;let e=this.usertextarea;e.style.height=`1px`;let t=e.scrollHeight;e.style.height=``;let n=this.options.maxHeight??500;this.editorContainer.style.height=Math.min(t,n)+this._toolbarH+this._footerH+1+`px`}notifyChange(){this.options.onChange&&this.options.onChange(this.usertextarea.value)}render(){this._autoGrow(),this.renderHybrid(),this.preview&&(this.previewContent.innerHTML=this._renderMarkdown(this.usertextarea.value),this.wirePreviewCheckboxes())}destroy(){this.shortcutManager?.destroy(),this.findReplace?.destroy(),this.previewTool?.destroy(),this.undoRedoManager?.destroy(),this.listManager?.destroy(),this.pasteManager?.destroy(),this._footerUpdate&&(this.usertextarea.removeEventListener(`input`,this._footerUpdate),this.usertextarea.removeEventListener(`click`,this._footerUpdate),this.usertextarea.removeEventListener(`keyup`,this._footerUpdate),this.usertextarea.removeEventListener(`focus`,this._footerUpdate)),this.usertextarea.removeEventListener(`input`,this._inputHandler),this.usertextarea.removeEventListener(`scroll`,this._scrollHandler);let e=this.editorContainer.parentNode;e&&([`editor-textarea`,`fj:focus:ring-0`,`fj:focus:outline-0`,`fj:border-0`,`fj:border-base-soft`,`fj:px-4`,`fj:py-2`,`fj:max-w-full`,`fj:w-full`,`fj:h-full`,`fj:bg-transparent`,`fj:outline-0`,`fj:appearance-none`,`fj:overflow-y-auto`,`fj:text-transparent`,`fj:caret-primary`,`fj:resize-none`,`fj:outline-none`,`fj:m-0`,`fj:box-border`,`fj:relative`,`fj:z-10`].forEach(e=>this.usertextarea.classList.remove(e)),this._addedAriaLabel&&this.usertextarea.removeAttribute(`aria-label`),this.usertextarea.style.height=``,e.insertBefore(this.usertextarea,this.editorContainer),this.editorContainer.remove())}}});
227
+ `),n=this._lastLines;if(!n||n.length!==t.length)this.displayLayer.innerHTML=``,this._lineNodes=t.map((e,n)=>{let r=document.createElement(`span`);return r.innerHTML=e+(n<t.length-1?`
228
+ `:``),this.displayLayer.appendChild(r),r}),this._lastLines=t.slice();else for(let e=0;e<t.length;e++)t[e]!==n[e]&&(this._lineNodes[e].innerHTML=t[e]+(e<t.length-1?`
229
+ `:``),n[e]=t[e])}_autoGrow(){if(this.editorContainer.classList.contains(`is-fullscreen`))return;let e=this.usertextarea;e.style.height=`1px`;let t=e.scrollHeight;e.style.height=``;let n=this.options.maxHeight??500;this.editorContainer.style.height=Math.min(t,n)+this._toolbarH+this._footerH+1+`px`}notifyChange(){this.options.onChange&&this.options.onChange(this.usertextarea.value)}render(){this._autoGrow(),this.renderHybrid(),this.preview&&(this.previewContent.innerHTML=this._renderMarkdown(this.usertextarea.value),this.wirePreviewCheckboxes())}destroy(){this.shortcutManager?.destroy(),this.findReplace?.destroy(),this.previewTool?.destroy(),this.undoRedoManager?.destroy(),this.listManager?.destroy(),this.pasteManager?.destroy(),this.toolbarInstance?.destroy(),this._footerUpdate&&(this.usertextarea.removeEventListener(`input`,this._footerUpdate),this.usertextarea.removeEventListener(`click`,this._footerUpdate),this.usertextarea.removeEventListener(`keyup`,this._footerUpdate),this.usertextarea.removeEventListener(`focus`,this._footerUpdate)),this.usertextarea.removeEventListener(`input`,this._inputHandler),this.usertextarea.removeEventListener(`scroll`,this._scrollHandler);let e=this.editorContainer.parentNode;e&&([`editor-textarea`,`fj:focus:ring-0`,`fj:focus:outline-0`,`fj:border-0`,`fj:border-base-soft`,`fj:px-4`,`fj:py-2`,`fj:max-w-full`,`fj:w-full`,`fj:h-full`,`fj:bg-transparent`,`fj:outline-0`,`fj:appearance-none`,`fj:overflow-y-auto`,`fj:text-transparent`,`fj:caret-primary`,`fj:resize-none`,`fj:outline-none`,`fj:m-0`,`fj:box-border`,`fj:relative`,`fj:z-10`].forEach(e=>this.usertextarea.classList.remove(e)),this._addedAriaLabel&&this.usertextarea.removeAttribute(`aria-label`),this.usertextarea.style.height=``,e.insertBefore(this.usertextarea,this.editorContainer),this.editorContainer.remove())}};return Mr.Tool=$,Mr.modal=Mn,Mr});
229
230
  //# sourceMappingURL=markdown-text-editor.umd.js.map