tiptap-editor-react
Version:
A modern WYSIWYG rich text editor based on tiptap and shadcn ui for React
1 lines • 130 kB
JavaScript
"use strict";var si=Object.create;var ae=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var oi=Object.getOwnPropertyNames;var li=Object.getPrototypeOf,di=Object.prototype.hasOwnProperty;var hi=(t,i,r,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let c of oi(i))!di.call(t,c)&&c!==r&&ae(t,c,{get:()=>i[c],enumerable:!(n=ai(i,c))||n.enumerable});return t};var oe=(t,i,r)=>(r=t!=null?si(li(t)):{},hi(i||!t||!t.__esModule?ae(r,"default",{value:t,enumerable:!0}):r,t));const e=require("react/jsx-runtime"),o=require("react"),p=require("./tiptap-BhYF9Ndj.cjs"),b=require("./index-DGpT32KX.cjs"),xi=require("@radix-ui/react-separator"),N=require("./vendor-Dp07eU0H.cjs"),ui=require("@radix-ui/react-toast"),m=require("lucide-react"),mi=require("@radix-ui/react-tooltip"),Ft=require("katex"),ye=require("@radix-ui/react-slot"),fi=require("@radix-ui/react-toggle"),Ct=require("@radix-ui/react-icons"),gi=require("@radix-ui/react-popover"),pi=require("@radix-ui/react-label"),wi=require("@radix-ui/react-dialog"),Ne=require("re-resizable"),Tt=require("mermaid"),vi=require("tippy.js"),bi=require("react-colorful"),ji=require("@radix-ui/react-switch"),Ci=require("@radix-ui/react-dropdown-menu");function J(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(i,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return i.default=t,Object.freeze(i)}const E=J(o),ke=J(xi),U=J(ui),gt=J(mi),Se=J(fi),mt=J(gi),Te=J(pi),Z=J(wi),Ht=J(ji),H=J(Ci);function L(...t){return N.twMerge(N.clsx(t))}let It;function Et(){return It===void 0&&(It=navigator.platform.includes("Mac")),It}function Me(t){return`${t}`.toLowerCase()==="mod"?Et()?"⌘":"Ctrl":`${t}`.toLowerCase()==="alt"?Et()?"⌥":"Alt":`${t}`.toLowerCase()==="shift"?Et()?"⇧":"Shift":t}function Ae(t){return t.map(Me).join(" ")}const j=o.forwardRef((t,i)=>{const{icon:r=void 0,tooltip:n=void 0,disabled:c=!1,customClass:s="",loading:a=void 0,shortcutKeys:l=void 0,tooltipOptions:d={},action:h=void 0,isActive:x=void 0,children:u,asChild:f=!1,upload:g=!1,...w}=t,C=Yt[r],k=f?ye.Slot:Zt;return e.jsxs(Kt,{children:[e.jsx(Xt,{asChild:!0,children:e.jsxs(k,{"data-state":x!=null&&x()?"on":"off",onClick:h,ref:i,size:"sm",className:L("richtext-w-[32px] richtext-h-[32px]",s),disabled:c,...w,children:[C&&e.jsx(C,{className:"richtext-size-4"}),u]})}),n&&e.jsx(Lt,{...d,children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[e.jsx("div",{children:n}),!!(l!=null&&l.length)&&e.jsx("span",{children:Ae(l)})]})})]})}),Le=N.d(!1);function Ie(){return N.b(Le)}const yi={setDisable:t=>{Le(t)}};function ot(t,i){const{state:r}=i,n=r.selection.$anchor;let c=!1;if(n.depth)for(let s=n.depth;s>0;s--)n.node(s).type.name===t&&(i.dispatchTransaction&&i.dispatchTransaction(r.tr.delete(n.before(s),n.after(s)).scrollIntoView()),c=!0);else{const s=r.selection.node;s&&s.type.name===t&&(i.chain().deleteSelection().run(),c=!0)}if(!c){const s=n.pos;if(s){const a=r.tr.doc.nodeAt(s);a&&a.type.name===t&&(i.dispatchTransaction&&i.dispatchTransaction(r.tr.delete(s,s+a.nodeSize)),c=!0)}}return c}function Ee(t,i,r){return t<i?i:t>r?r:t}const Ni=t=>typeof t=="number",ki=t=>typeof t=="string",Si=t=>typeof t=="function";function Ti(t,i="px"){if(!t)return t;const r=Ni(t)?String(t):t,n=Number.parseFloat(r),c=r.match(/[%a-z]+$/i),s=c?c[0]:i;return Number.isNaN(n)?t:n+s}function Re(t,i){if(!t)return!1;const{extensions:r=[]}=(t==null?void 0:t.extensionManager)??{};return!!r.find(c=>c.name===i)}function Mi(t){return t.map(i=>ki(i)?{value:i,name:i}:i)}const Ai=N.cva("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50",{variants:{variant:{default:"!richtext-bg-primary !richtext-text-primary-foreground hover:!richtext-bg-primary/90",destructive:"richtext-bg-destructive richtext-text-destructive-foreground hover:richtext-bg-destructive/90",outline:"richtext-border richtext-border-input richtext-bg-background hover:richtext-bg-accent hover:richtext-text-accent-foreground",secondary:"richtext-bg-secondary richtext-text-secondary-foreground hover:richtext-bg-secondary/80",ghost:"hover:richtext-bg-accent hover:richtext-text-accent-foreground",link:"richtext-text-primary richtext-underline-offset-4 hover:richtext-underline"},size:{default:"richtext-h-10 richtext-px-4 richtext-py-2",sm:"richtext-h-9 richtext-rounded-md richtext-px-3",lg:"richtext-h-11 richtext-rounded-md richtext-px-8",icon:"richtext-h-10 richtext-w-10"}},defaultVariants:{variant:"default",size:"default"}}),W=E.forwardRef(({className:t,variant:i,size:r,asChild:n=!1,...c},s)=>{const a=n?ye.Slot:"button";return e.jsx(a,{className:L(Ai({variant:i,size:r,className:t})),ref:s,...c})});W.displayName="Button";const _e=H.Root,ze=H.Trigger,le=H.Portal,de=H.Sub,Pt=E.forwardRef(({className:t,inset:i,children:r,...n},c)=>e.jsxs(H.SubTrigger,{ref:c,className:L("richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none focus:richtext-bg-accent data-[state=open]:richtext-bg-accent",i&&"richtext-pl-8",t),...n,children:[r,e.jsx(m.ChevronRight,{className:"richtext-ml-auto richtext-h-4 richtext-w-4"})]}));Pt.displayName=H.SubTrigger.displayName;const Dt=E.forwardRef(({className:t,...i},r)=>e.jsx(H.SubContent,{ref:r,className:L("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-lg data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...i}));Dt.displayName=H.SubContent.displayName;const Gt=E.forwardRef(({className:t,sideOffset:i=4,...r},n)=>e.jsx(H.Portal,{children:e.jsx(H.Content,{ref:n,sideOffset:i,className:L("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...r})}));Gt.displayName=H.Content.displayName;const K=E.forwardRef(({className:t,inset:i,...r},n)=>e.jsx(H.Item,{ref:n,className:L("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",i&&"richtext-pl-8",t),...r}));K.displayName=H.Item.displayName;const Oe=E.forwardRef(({className:t,children:i,checked:r,...n},c)=>e.jsxs(H.CheckboxItem,{ref:c,className:L("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",t),checked:r,...n,children:[e.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:e.jsx(H.ItemIndicator,{children:e.jsx(m.Check,{className:"richtext-h-4 richtext-w-4"})})}),i]}));Oe.displayName=H.CheckboxItem.displayName;const Li=E.forwardRef(({className:t,children:i,...r},n)=>e.jsxs(H.RadioItem,{ref:n,className:L("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",t),...r,children:[e.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:e.jsx(H.ItemIndicator,{children:e.jsx(m.Circle,{className:"richtext-h-2 richtext-w-2 richtext-fill-current"})})}),i]}));Li.displayName=H.RadioItem.displayName;const Ii=E.forwardRef(({className:t,inset:i,...r},n)=>e.jsx(H.Label,{ref:n,className:L("richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-font-semibold",i&&"richtext-pl-8",t),...r}));Ii.displayName=H.Label.displayName;const Ut=E.forwardRef(({className:t,...i},r)=>e.jsx(H.Separator,{ref:r,className:L("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",t),...i}));Ut.displayName=H.Separator.displayName;function He({className:t,...i}){return e.jsx("span",{className:L("richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",t),...i})}He.displayName="DropdownMenuShortcut";const q=E.forwardRef(({className:t,type:i,...r},n)=>e.jsx("input",{type:i,className:L("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",t),ref:n,...r}));q.displayName="Input";const Ei=N.cva("richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),Y=E.forwardRef(({className:t,...i},r)=>e.jsx(Te.Root,{ref:r,className:L(Ei(),t),...i}));Y.displayName=Te.Root.displayName;const ct=mt.Root,st=mt.Trigger,Q=E.forwardRef(({className:t,align:i="center",sideOffset:r=4,...n},c)=>e.jsx(mt.Portal,{children:e.jsx(mt.Content,{ref:c,align:i,sideOffset:r,className:L("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...n})}));Q.displayName=mt.Content.displayName;const X=E.forwardRef(({className:t,orientation:i="horizontal",decorative:r=!0,...n},c)=>e.jsx(ke.Root,{ref:c,decorative:r,orientation:i,className:L("richtext-shrink-0 richtext-bg-border",i==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",t),...n}));X.displayName=ke.Root.displayName;const qt=E.forwardRef(({className:t,...i},r)=>e.jsx(Ht.Root,{className:L("richtext-peer richtext-inline-flex richtext-h-6 richtext-w-11 richtext-shrink-0 richtext-cursor-pointer richtext-items-center richtext-rounded-full richtext-border-2 richtext-border-transparent richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 focus-visible:richtext-ring-offset-background disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 data-[state=checked]:richtext-bg-primary data-[state=unchecked]:richtext-bg-input",t),...i,ref:r,children:e.jsx(Ht.Thumb,{className:L("richtext-pointer-events-none richtext-block richtext-h-5 richtext-w-5 richtext-rounded-full richtext-bg-background richtext-shadow-lg richtext-ring-0 richtext-transition-transform data-[state=checked]:richtext-translate-x-5 data-[state=unchecked]:richtext-translate-x-0")})}));qt.displayName=Ht.Root.displayName;const Ri=U.Provider,Pe=E.forwardRef(({className:t,...i},r)=>e.jsx(U.Viewport,{ref:r,className:L("richtext-fixed richtext-top-0 richtext-z-[100] richtext-flex richtext-max-h-screen richtext-w-full richtext-flex-col-reverse richtext-p-4 sm:richtext-bottom-0 sm:richtext-right-0 sm:richtext-top-auto sm:richtext-flex-col md:richtext-max-w-[420px]",t),...i}));Pe.displayName=U.Viewport.displayName;const _i=N.cva("richtext-group richtext-pointer-events-auto richtext-relative richtext-flex richtext-w-full richtext-items-center richtext-justify-between richtext-space-x-4 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-p-6 richtext-pr-8 richtext-shadow-lg richtext-transition-all data-[swipe=cancel]:richtext-translate-x-0 data-[swipe=end]:richtext-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:richtext-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:richtext-transition-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[swipe=end]:richtext-animate-out data-[state=closed]:richtext-fade-out-80 data-[state=closed]:richtext-slide-out-to-right-full data-[state=open]:richtext-slide-in-from-top-full data-[state=open]:sm:richtext-slide-in-from-bottom-full",{variants:{variant:{default:"richtext-border richtext-bg-background richtext-text-foreground",destructive:"richtext-destructive richtext-group richtext-border-destructive richtext-bg-destructive richtext-text-destructive-foreground"}},defaultVariants:{variant:"default"}}),De=E.forwardRef(({className:t,variant:i,...r},n)=>e.jsx(U.Root,{ref:n,className:L(_i({variant:i}),t),...r}));De.displayName=U.Root.displayName;const zi=E.forwardRef(({className:t,...i},r)=>e.jsx(U.Action,{ref:r,className:L("richtext-inline-flex richtext-h-8 richtext-shrink-0 richtext-items-center richtext-justify-center richtext-rounded-md !richtext-border richtext-bg-transparent richtext-px-3 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-secondary focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 group-[.destructive]:richtext-border-muted/40 group-[.destructive]:hover:richtext-border-destructive/30 group-[.destructive]:hover:richtext-bg-destructive group-[.destructive]:hover:richtext-text-destructive-foreground group-[.destructive]:focus:richtext-ring-destructive",t),...i}));zi.displayName=U.Action.displayName;const Be=E.forwardRef(({className:t,...i},r)=>e.jsx(U.Close,{ref:r,className:L("richtext-absolute richtext-right-2 richtext-top-2 richtext-rounded-md richtext-p-1 richtext-text-foreground/50 richtext-opacity-0 richtext-transition-opacity hover:richtext-text-foreground focus:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 group-hover:richtext-opacity-100 group-[.destructive]:richtext-text-red-300 group-[.destructive]:hover:richtext-text-red-50 group-[.destructive]:focus:richtext-ring-red-400 group-[.destructive]:focus:richtext-ring-offset-red-600",t),"toast-close":"",...i,children:e.jsx(m.X,{className:"richtext-h-4 richtext-w-4"})}));Be.displayName=U.Close.displayName;const Ve=E.forwardRef(({className:t,...i},r)=>e.jsx(U.Title,{ref:r,className:L("richtext-text-sm richtext-font-semibold",t),...i}));Ve.displayName=U.Title.displayName;const $e=E.forwardRef(({className:t,...i},r)=>e.jsx(U.Description,{ref:r,className:L("richtext-text-sm richtext-opacity-90",t),...i}));$e.displayName=U.Description.displayName;const Oi=N.cva("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),Zt=E.forwardRef(({className:t,variant:i,size:r,...n},c)=>e.jsx(Se.Root,{ref:c,className:L(Oi({variant:i,size:r,className:t})),...n}));Zt.displayName=Se.Root.displayName;const Hi=gt.Provider,Kt=gt.Root,Xt=gt.Trigger,Lt=E.forwardRef(({className:t,sideOffset:i=4,...r},n)=>e.jsx(gt.Content,{ref:n,sideOffset:i,className:L("richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-popover-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...r}));Lt.displayName=gt.Content.displayName;const Pi=1,Di=1e6;let Rt=0;function Bi(){return Rt=(Rt+1)%Number.MAX_SAFE_INTEGER,Rt.toString()}const _t=new Map;function he(t){if(_t.has(t))return;const i=setTimeout(()=>{_t.delete(t),ut({type:"REMOVE_TOAST",toastId:t})},Di);_t.set(t,i)}function Vi(t,i){switch(i.type){case"ADD_TOAST":return{...t,toasts:[i.toast,...t.toasts].slice(0,Pi)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===i.toast.id?{...r,...i.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=i;return r?he(r):t.toasts.forEach(n=>{he(n.id)}),{...t,toasts:t.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return i.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==i.toastId)}}}const kt=[];let St={toasts:[]};function ut(t){St=Vi(St,t),kt.forEach(i=>{i(St)})}function $i({...t}){const i=Bi(),r=c=>ut({type:"UPDATE_TOAST",toast:{...c,id:i}}),n=()=>ut({type:"DISMISS_TOAST",toastId:i});return ut({type:"ADD_TOAST",toast:{...t,id:i,open:!0,onOpenChange:c=>{c||n()}}}),{id:i,dismiss:n,update:r}}function We(){const[t,i]=E.useState(St);return E.useEffect(()=>(kt.push(i),()=>{const r=kt.indexOf(i);r>-1&&kt.splice(r,1)}),[t]),{...t,toast:$i,dismiss:r=>ut({type:"DISMISS_TOAST",toastId:r})}}function Wi(t){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"currentColor",d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"})})}function Fi(t){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})}function Gi(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6",color:"currentColor"})})}function Ui(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6",color:"currentColor"})})}function qi(t){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function $(t){const i=Yt[t.name];return i?e.jsx(i,{onClick:t==null?void 0:t.onClick,className:`richtext-w-4 richtext-h-4 ${(t==null?void 0:t.className)||""}`}):null}function Zi(t){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"currentColor",d:"M21 22H3v-2h18zm0-18H3V2h18zm-11 9.7h4l-2-5.4zM11.2 6h1.7l4.7 12h-2l-.9-2.6H9.4L8.5 18h-2z"})})}function Fe(t){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 48 48",...t,children:e.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4,d:"M36 19L24 31L12 19z"})})}function Ki(t){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"currentColor",d:"M9 7v10h6v-2h-4V7z"})})}function Xi(t){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"currentColor",d:"M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z"})})}function Yi(t){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"currentColor",d:"M11 7c-1.1 0-2 .9-2 2v2a2 2 0 0 0 2 2h2v2H9v2h4c1.11 0 2-.89 2-2v-2a2 2 0 0 0-2-2h-2V9h4V7z"})})}function Ji(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function Ge(){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:[e.jsx("path",{fill:"currentColor",d:"M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"}),e.jsx("path",{fill:"currentColor",d:"M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"})]})}function Ue(){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"icon",viewBox:"0 0 1024 1024",children:[e.jsx("path",{fill:"currentColor",d:"M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"}),e.jsx("path",{fill:"currentColor",d:"m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"})]})}function Qi(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"})})}function tr(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"})})}function er(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"currentColor",d:"M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"})})}function ir(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"})})}function rr(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:e.jsx("path",{fill:"currentColor",d:"M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z"})})}function nr(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:e.jsx("path",{fill:"currentColor",d:"M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z"})})}function cr(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentColor",children:[e.jsx("path",{d:"M14.86 22h-4.312c-3.291 0-4.937 0-6.08-.798a4.2 4.2 0 0 1-.863-.805c-.855-1.066-.855-2.6-.855-5.67v-2.545c0-2.963 0-4.445.473-5.628c.761-1.903 2.37-3.403 4.41-4.113C8.9 2 10.49 2 13.667 2c1.816 0 2.723 0 3.448.252c1.166.406 2.085 1.263 2.52 2.35c.27.676.27 1.523.27 3.216V10"}),e.jsx("path",{d:"M2.75 12c0-1.84 1.506-3.333 3.364-3.333c.672 0 1.464.116 2.117-.057a1.67 1.67 0 0 0 1.19-1.179c.174-.647.057-1.432.057-2.098C9.478 3.493 10.984 2 12.84 2m.002 16h2.523m-4.949-4.15c-.126-.8-.281-.801-1.61-.85h-1.01c-.557 0-1.009.448-1.009 1v3c0 .552.452 1 1.01 1h1.816c.39 0 .803-.313.803-.7v-1.1c0-.11-.113-.304-.224-.304H9.068M12.842 13h1.261m0 0h1.262m-1.262 0v4.875M21.251 13h-2.523c-.557 0-1.009.448-1.009 1v1.5m0 0V18m0-2.5h2.523"})]})})}function sr(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:e.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"4",children:[e.jsx("circle",{cx:"10",cy:"24",r:"4"}),e.jsx("circle",{cx:"38",cy:"10",r:"4"}),e.jsx("circle",{cx:"38",cy:"24",r:"4"}),e.jsx("circle",{cx:"38",cy:"38",r:"4"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M34 38H22V10h12M14 24h20"})]})})}function ar(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548",color:"currentColor"})})}function or(){return e.jsxs("svg",{fill:"none",height:"1em",viewBox:"0 0 16 17",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M5.46558 13.8356C4.54472 13.8356 3.79822 13.0891 3.79822 12.1682V10.1674C3.79822 9.72516 3.62255 9.30106 3.30986 8.98837C2.99717 8.67568 2.57307 8.50001 2.13086 8.50001C2.57307 8.50001 2.99717 8.32435 3.30986 8.01166C3.62255 7.69896 3.79822 7.27487 3.79822 6.83265V4.83182C3.79822 3.91096 4.54472 3.16446 5.46558 3.16446",stroke:"#323232",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.25"}),e.jsx("path",{d:"M10.5352 3.16446C11.456 3.16446 12.2025 3.91096 12.2025 4.83182V6.83265C12.2025 7.75351 12.949 8.50001 13.8699 8.50001C12.949 8.50001 12.2025 9.24652 12.2025 10.1674V12.1682C12.2025 13.0891 11.456 13.8356 10.5352 13.8356",stroke:"#323232",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.25"})]})}const Yt={Bold:m.Bold,LoaderCircle:m.LoaderCircle,Italic:m.Italic,Underline:m.Underline,Quote:m.Quote,CodeIcon:or,TextQuote:Fi,Strikethrough:m.Strikethrough,Minus:m.Minus,Eraser:m.Eraser,PaintRoller:m.PaintRoller,Redo2:m.Redo2,Undo2:m.Undo2,AlignCenter:Ct.TextAlignCenterIcon,AlignJustify:Ct.TextAlignJustifyIcon,AlignLeft:Ct.TextAlignLeftIcon,AlignRight:Ct.TextAlignRightIcon,ChevronDown:m.ChevronDown,Subscript:m.Subscript,Superscript:m.Superscript,Code:m.Code,Code2:m.CodeXml,Type:m.Type,IndentIncrease:m.IndentIncrease,IndentDecrease:m.IndentDecrease,List:m.List,ListOrdered:m.ListOrdered,ListTodo:m.ListTodo,Link:m.Link,ImageUp:m.ImageUp,Video:m.Video,Maximize:m.Maximize,Minimize:m.Minimize,Table:m.Table,Sparkles:m.Sparkles,Pencil:m.Pencil,Unlink:m.Unlink,BetweenHorizonalEnd:m.BetweenHorizonalEnd,BetweenHorizonalStart:m.BetweenHorizonalStart,BetweenVerticalStart:m.BetweenVerticalStart,BetweenVerticalEnd:m.BetweenVerticalEnd,TableCellsMerge:m.TableCellsMerge,TableCellsSplit:m.TableCellsSplit,Trash2:m.Trash2,Trash:m.Trash,Replace:m.Replace,ChevronsUpDown:m.ChevronsUpDown,LineHeight:Zi,Word:qi,Heading1:m.Heading1,Heading2:m.Heading2,Heading3:m.Heading3,Heading4:m.Heading4,Heading5:m.Heading5,Heading6:m.Heading6,Columns2:m.Columns2,Columns3:m.Columns3,Columns4:m.Columns4,Plus:m.Plus,Grip:m.GripVertical,Copy:m.Copy,Clipboard:m.Clipboard,PanelLeft:m.PanelLeft,PanelRight:m.PanelRight,Columns:m.Columns2,Iframe:m.Frame,MenuDown:Fe,SizeS:Yi,SizeM:Xi,SizeL:Ki,AspectRatio:Wi,Emoji:m.SmilePlus,DeleteColumn:Gi,DeleteRow:Ui,SearchAndReplace:m.Replace,EmojiIcon:m.SmilePlusIcon,KatexIcon:m.Sigma,ExportPdf:Ge,ExportWord:Ue,ImportWord:Ji,ColumnAddLeft:Qi,ColumnAddRight:tr,BookMarked:m.BookMarked,Excalidraw:er,ZoomIn:m.ZoomIn,ZoomOut:m.ZoomOut,Settings:m.Settings,Eye:m.Eye,TextDirection:ir,LeftToRight:rr,RightToLeft:nr,Attachment:m.Paperclip,GifIcon:cr,ChevronUp:m.ChevronUp,Crop:m.CropIcon,Mermaid:sr,Twitter:ar,FlipX:m.FlipVertical,FlipY:m.FlipHorizontal};function lr({fill:t}){return e.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("g",{id:"icon/填充色",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:e.jsxs("g",{id:"icon/背景颜色",children:[e.jsx("g",{id:"编组",fill:"currentColor",children:e.jsxs("g",{transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)",id:"矩形",children:[e.jsx("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z",fillRule:"nonzero"}),e.jsx("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z",fillRule:"evenodd"}),e.jsx("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z",fillRule:"nonzero"})]})}),e.jsx("path",{d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",id:"矩形",fill:t||"#FBDE28"})]})})})}function qe(t){const[i,r]=o.useState(void 0);function n(a){var l;(l=t.action)==null||l.call(t,a)}function c(){var a;(a=t.action)==null||a.call(t,i)}const s=o.useCallback(N.debounce(a=>{r(a)},350),[]);return e.jsxs("div",{className:"richtext-flex richtext-items-center richtext-h-[32px]",children:[e.jsx(j,{tooltip:t==null?void 0:t.tooltip,disabled:t==null?void 0:t.disabled,action:c,tooltipOptions:t==null?void 0:t.tooltipOptions,shortcutKeys:t==null?void 0:t.shortcutKeys,children:e.jsx("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-text-sm",children:e.jsx(lr,{fill:i})})}),e.jsx(ei,{selectedColor:i,setSelectedColor:s,onChange:n,highlight:!0,disabled:t==null?void 0:t.disabled,children:e.jsx(W,{variant:"ghost",size:"icon",className:"!richtext-w-3 !richtext-h-[32px]",disabled:t==null?void 0:t.disabled,children:e.jsx($,{className:"!richtext-w-3 !richtext-h-3 richtext-text-zinc-500",name:"MenuDown"})})})]})}function Ze(t){const{t:i}=b.useLocale(),[r,n]=o.useState({text:"",link:""}),[c,s]=o.useState(!1);o.useEffect(()=>{var l;if(t!=null&&t.editor){const{href:d,target:h}=(l=t.editor)==null?void 0:l.getAttributes("link"),{from:x,to:u}=t.editor.state.selection,f=t.editor.state.doc.textBetween(x,u," ");n({link:d,text:f}),s(h==="_blank")}},[t==null?void 0:t.editor]);function a(l){l.preventDefault(),l.stopPropagation(),t==null||t.onSetLink(r.link,r.text,c)}return e.jsx("div",{className:"border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:e.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:a,children:[e.jsx(Y,{className:"mb-[6px]",children:i("editor.link.dialog.text")}),e.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:e.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:e.jsx(q,{className:"richtext-w-80",onChange:l=>n({...r,text:l.target.value}),placeholder:"Text",required:!0,type:"text",value:r.text})})}),e.jsx(Y,{className:"mb-[6px]",children:i("editor.link.dialog.link")}),e.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:e.jsxs("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:[e.jsx(q,{className:"richtext-pl-10",onChange:l=>n({...r,link:l.target.value}),required:!0,type:"url",value:r.link}),e.jsx("span",{className:"richtext-absolute richtext-inset-y-0 richtext-start-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2",children:e.jsx($,{className:"richtext-size-5 richtext-text-muted-foreground",name:"Link"})})]})}),e.jsxs("div",{className:"richtext-flex richtext-items-center richtext-space-x-2",children:[e.jsx(Y,{children:i("editor.link.dialog.openInNewTab")}),e.jsx(qt,{checked:c,onCheckedChange:l=>{s(l)}})]}),e.jsx(W,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:i("editor.link.dialog.button.apply")})]})})}function dr(t,i,r=null){return r?t.createChecked({index:i},r):t.createAndFill({index:i})}function hr(t){if(t.cached.columnsNodeTypes)return t.cached.columnsNodeTypes;const i={columns:t.nodes.columns,column:t.nodes.column};return t.cached.columnsNodeTypes=i,i}function xr(t,i,r=null){const n=hr(t),c=[];for(let s=0;s<i;s+=1){const a=dr(n.column,s,r);a&&c.push(a)}return n.columns.createChecked({cols:i},c)}function zt({state:t,dispatch:i,type:r}){const n=p.findParentNode(s=>s.type.name===ft.name)(t.selection),c=p.findParentNode(s=>s.type.name===Jt.name)(t.selection);if(i&&n&&c){const s=n.node,a=c.node.attrs.index,l=s.toJSON();let d=a;r==="delete"?(d=a-1,l.content.splice(a,1)):(d=r==="addBefore"?a:a+1,l.content.splice(d,0,{type:"column",attrs:{index:a},content:[{type:"paragraph"}]})),l.attrs.cols=l.content.length,l.content.forEach((f,g)=>{f.attrs.index=g});const h=N.Node.fromJSON(t.schema,l);let x=n.pos;h.content.forEach((f,g,w)=>{w<d&&(x+=f.nodeSize)});const u=t.tr.setTime(Date.now());u.replaceWith(n.pos,n.pos+n.node.nodeSize,h).setSelection(N.TextSelection.near(u.doc.resolve(x))),i(u)}return!0}function xe({state:t,dispatch:i,type:r}){const n=p.findParentNode(s=>s.type.name===ft.name)(t.selection),c=p.findParentNode(s=>s.type.name===Jt.name)(t.selection);if(i&&n&&c){const s=n.node,a=c.node.attrs.index;let l=0;r==="before"?l=(a-1+s.attrs.cols)%s.attrs.cols:l=(a+1)%s.attrs.cols;let d=n.pos;s.content.forEach((x,u,f)=>{f<l&&(d+=x.nodeSize)});const h=t.tr.setTime(Date.now());return h.setSelection(N.TextSelection.near(h.doc.resolve(d))),i(h),!0}return!1}const ur=200,ft=p.Node.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:ur,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:t=>t.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:t}){return["div",p.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{insertColumns:t=>({tr:i,dispatch:r,editor:n})=>{const c=xr(n.schema,t&&t.cols||3);if(r){const s=i.selection.anchor+1;i.replaceSelectionWith(c).scrollIntoView().setSelection(N.TextSelection.near(i.doc.resolve(s)))}return!0},addColBefore:()=>({dispatch:t,state:i})=>zt({dispatch:t,state:i,type:"addBefore"}),addColAfter:()=>({dispatch:t,state:i})=>zt({dispatch:t,state:i,type:"addAfter"}),deleteCol:()=>({dispatch:t,state:i})=>zt({dispatch:t,state:i,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>xe({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>xe({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}}),Jt=p.Node.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:t=>t.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:t}){return["div",p.mergeAttributes(this.options.HTMLAttributes,t),0]}});var Mt=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(Mt||{});function mr(t,i,r){return t<i?i:t>r?r:t}function fr(t,i,r,n){const{doc:c,selection:s}=t;if(!c||!s||!(s instanceof N.TextSelection||s instanceof N.AllSelection))return t;const{from:a,to:l}=s;return c.nodesBetween(a,l,(d,h)=>{const x=d.type;return r.includes(x.name)?(t=Bt(t,h,i),!1):!p.isList(d.type.name,n.extensionManager.extensions)}),t}function Bt(t,i,r){if(!t.doc)return t;const n=t.doc.nodeAt(i);if(!n)return t;const a=mr((n.attrs.indent||0)+r,0,7);if(a===n.attrs.indent)return t;const l={...n.attrs,indent:a};return t.setNodeMarkup(i,n.type,l,n.marks)}function gr({delta:t,types:i}){return({state:r,dispatch:n,editor:c})=>{const{selection:s}=r;let{tr:a}=r;return a=a.setSelection(s),a=fr(a,t,i,c),a.docChanged?(n&&n(a),!0):!1}}const pt=Z.Root,wt=Z.Trigger,pr=Z.Portal,Ke=E.forwardRef(({className:t,...i},r)=>e.jsx(Z.Overlay,{ref:r,className:L("richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 richtext- data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",t),...i}));Ke.displayName=Z.Overlay.displayName;const lt=E.forwardRef(({className:t,children:i,...r},n)=>e.jsxs(pr,{children:[e.jsx(Ke,{}),e.jsxs(Z.Content,{ref:n,className:L("richtext-dialog-content richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",t),...r,children:[i,e.jsxs(Z.Close,{className:"richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground",children:[e.jsx(m.X,{className:"richtext-h-4 richtext-w-4"}),e.jsx("span",{className:"richtext-sr-only",children:"Close"})]})]})]}));lt.displayName=Z.Content.displayName;function Xe({className:t,...i}){return e.jsx("div",{className:L("richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",t),...i})}Xe.displayName="DialogHeader";function dt({className:t,...i}){return e.jsx("div",{className:L("richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",t),...i})}dt.displayName="DialogFooter";const ht=E.forwardRef(({className:t,...i},r)=>e.jsx(Z.Title,{ref:r,className:L("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight",t),...i}));ht.displayName=Z.Title.displayName;const wr=E.forwardRef(({className:t,...i},r)=>e.jsx(Z.Description,{ref:r,className:L("richtext-text-sm richtext-text-muted-foreground",t),...i}));wr.displayName=Z.Description.displayName;function vr(t){return t.replace(/^.*\/|\..+$/g,"")}function br(t){return t.split(".").pop()}function jr(t){return t<1024?`${t} Byte`:t<1024*1024?`${(t/1024).toFixed(2)} KB`:`${(t/1024/1024).toFixed(2)} MB`}function Cr(t){return t?t==="application/pdf"?"pdf":t.startsWith("application/")&&[".document","word"].some(i=>t.includes(i))?"word":t.startsWith("application/")&&["presentation"].some(i=>t.includes(i))?"excel":t.startsWith("application/")&&["sheet"].some(i=>t.includes(i))?"ppt":t.startsWith("image")?"image":t.startsWith("audio")?"audio":t.startsWith("video")?"video":"file":"file"}function yr(t){return new Promise(i=>{const r=new FileReader;r.addEventListener("load",()=>{i({alt:t.name,src:r.result})},!1),r.readAsDataURL(t)})}function Qt(t,i){const r=t.split(","),n=r[0].match(/:(.*?);/)[1],c=atob(r[r.length-1]);let s=c.length;const a=new Uint8Array(s);for(;s--;)a[s]=c.charCodeAt(s);return new File([a],i,{type:n})}const Nr="_wrap_5y04w_1",kr="_innerWrap_5y04w_15",ue={wrap:Nr,inner