@remarkablejames/editor 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/ActionMenuButton-D9o3Kwmv.cjs +1 -0
- package/lib/{ActionMenuButton-CpmEfz31.js → ActionMenuButton-nxV91Fqo.js} +10 -9
- package/lib/Attachment.cjs +19 -1
- package/lib/Attachment.js +270 -7
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +12 -13
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +10 -11
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +8 -9
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +45 -40
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +14 -13
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +5 -6
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +33 -31
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +8 -9
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +19 -18
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +8 -9
- package/lib/Drawer-Bh-y5bs8.cjs +2 -0
- package/lib/{Drawer-CayP4Ww4.js → Drawer-CF6Z_IA2.js} +36 -30
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +18 -17
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +37 -32
- package/lib/ExportPdf.cjs +3 -3
- package/lib/ExportPdf.js +13 -14
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +6 -6
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +6 -7
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +14 -15
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +28 -28
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +23 -22
- package/lib/History.cjs +1 -1
- package/lib/History.js +11 -11
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +9 -10
- package/lib/Icon-BvGyfX2j.js +15 -0
- package/lib/Icon-wjwoRc9F.cjs +1 -0
- package/lib/Iframe-BbfZKbPY.cjs +1 -0
- package/lib/{Iframe-C6Sb97KS.js → Iframe-Dfd3LI7b.js} +14 -11
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +5 -4
- package/lib/ImageCropper-CY1ETEjC.cjs +10 -0
- package/lib/ImageCropper-DrSdjo9x.js +979 -0
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +83 -80
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +37 -35
- package/lib/{Indent-CcFe8py3.js → Indent-CDVF9DWN.js} +30 -31
- package/lib/Indent-Q1VuhSM2.cjs +1 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +11 -12
- package/lib/{Katex-Bp6AnIUF.js → Katex-DqhWWAA-.js} +22 -18
- package/lib/Katex-K1QU2SB2.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +20 -19
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/LinkEditBlock-CBYGLs3J.cjs +5 -0
- package/lib/{LinkEditBlock-BiHumIJR.js → LinkEditBlock-xP0pGVhB.js} +27 -22
- package/lib/Mention.js +3 -3
- package/lib/{Mermaid-Dlx0XTJj.js → Mermaid-BJ6ryVdY.js} +59 -55
- package/lib/Mermaid-D3_nLeOW.cjs +2 -0
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.js +2 -2
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +28 -26
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +10 -11
- package/lib/PaywallSeparator.cjs +1 -1
- package/lib/PaywallSeparator.js +9 -9
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +39 -34
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +5 -5
- package/lib/SlashCommandNodeView-CUJrDQS7.cjs +1 -0
- package/lib/{SlashCommandNodeView-DzmsYaNc.js → SlashCommandNodeView-DS9FqMiY.js} +23 -21
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +11 -12
- package/lib/Table-CV6pUoVf.cjs +5 -0
- package/lib/{Table-IH34r4jd.js → Table-CcG-JNtV.js} +46 -46
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +11 -12
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +27 -26
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +19 -18
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +8 -9
- package/lib/{Twitter-FVQKPaq6.js → Twitter-BIL3o833.js} +19 -15
- package/lib/Twitter-BfSTqPDh.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video-DAKr90QL.js +231 -0
- package/lib/Video-HAinT0w6.cjs +1 -0
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +5 -4
- package/lib/bubble.cjs +3 -3
- package/lib/bubble.js +112 -101
- package/lib/button-090-I3tp.js +35 -0
- package/lib/button-B4Sz2ZhW.cjs +1 -0
- package/lib/checkbox-BCPsu7yR.cjs +1 -0
- package/lib/checkbox-DiXWHAI0.js +29 -0
- package/lib/{clsx-BUPZHhq3.js → clsx-m_C5j3RU.js} +24 -24
- package/lib/components/RichTextProvider.d.ts +1 -1
- package/lib/dialog-C8J59d2J.cjs +1 -0
- package/lib/dialog-bDkDW-C_.js +95 -0
- package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
- package/lib/dom-dataset-CIEeltF6.js +47 -0
- package/lib/{dropdown-menu-Ce2TorkG.js → dropdown-menu-DWt_xj4h.js} +1 -1
- package/lib/{dropdown-menu-DirUyRAI.cjs → dropdown-menu-tUP872Zv.cjs} +1 -1
- package/lib/events.constant-Bke62qxm.cjs +1 -0
- package/lib/events.constant-CSWD3-ho.js +72 -0
- package/lib/file-i7e4nQY2.cjs +1 -0
- package/lib/file-jDdkhyj7.js +43 -0
- package/lib/{index-RkKGy5oa.js → index-B3Ijnbxs.js} +1 -1
- package/lib/index-BXh8X1ch.cjs +1 -0
- package/lib/{index-Dl3OjzmR.js → index-C1KQsOcg.js} +1 -1
- package/lib/{index-D4M4hrH4.js → index-C8FjP66D.js} +1 -1
- package/lib/index-jMN4V2hr.js +2763 -0
- package/lib/{index-DZj2z9_1.js → index-s3l5RdyW.js} +1 -1
- package/lib/index.cjs +4 -4
- package/lib/index.js +464 -149
- package/lib/input-C_J-pfTx.js +21 -0
- package/lib/input-DwLo4r7V.cjs +1 -0
- package/lib/isNumber-BTYSVlKo.cjs +1 -0
- package/lib/isNumber-WaBzl_0s.js +15 -0
- package/lib/label-BgIVynq3.cjs +1 -0
- package/lib/label-ClsOg9Hr.js +11 -0
- package/lib/{popover-BzJyaFvy.js → popover-BC7FRr8B.js} +1 -1
- package/lib/{popover-BdLwAlrM.cjs → popover-C3A6zzNV.cjs} +1 -1
- package/lib/{renderNodeView-dj6AaFSX.js → renderNodeView-C_hPIdEs.js} +2 -2
- package/lib/select-B8HIWDXf.cjs +1 -0
- package/lib/select-DSKqhVGR.js +120 -0
- package/lib/{separator-D-fyzbfx.js → separator-BJWSNjvr.js} +23 -22
- package/lib/separator-D6ruF682.cjs +1 -0
- package/lib/style.css +1 -1
- package/lib/tabs-D1J1iB7B.js +46 -0
- package/lib/tabs-IEbMQmNX.cjs +1 -0
- package/lib/textarea-Ch5w3PiI.js +20 -0
- package/lib/textarea-CtVdqwSM.cjs +1 -0
- package/lib/theme.cjs +1 -1
- package/lib/theme.js +18 -18
- package/lib/throttle-CRNq0z-O.js +249 -0
- package/lib/throttle-gTTvqDTW.cjs +1 -0
- package/lib/toggle-C9tcMm1r.cjs +1 -0
- package/lib/toggle-CaSwYCk4.js +89 -0
- package/lib/{updatePosition-C294Pixi.js → updatePosition-DvfTZHcH.js} +2 -2
- package/lib/use-toast-C6zPo25l.cjs +1 -0
- package/lib/use-toast-CEOqhXfx.js +97 -0
- package/lib/useButtonProps-D-ruygH7.js +165 -0
- package/lib/useButtonProps-D9ndBdmA.cjs +1 -0
- package/package.json +21 -32
- package/lib/ActionMenuButton-NfiUDE60.cjs +0 -1
- package/lib/Drawer-DlgdaO_B.cjs +0 -2
- package/lib/Iframe-CANdxSpV.cjs +0 -1
- package/lib/Indent-DuB2U6Cs.cjs +0 -1
- package/lib/Katex-DFU1unCm.cjs +0 -4
- package/lib/LinkEditBlock-C2zX0WVK.cjs +0 -5
- package/lib/Mermaid-B8lQSOGn.cjs +0 -2
- package/lib/SlashCommandNodeView-BfWNWGRr.cjs +0 -1
- package/lib/Table-BfM6ywrZ.cjs +0 -5
- package/lib/Twitter-axcoCgD7.cjs +0 -1
- package/lib/index-BynXHtjJ.cjs +0 -28
- package/lib/index-CnKgiZFQ.js +0 -5576
- package/lib/separator-CoQaQmFK.cjs +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remarkablejames/editor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "A modern WYSIWYG rich text editor based on tiptap and shadcn ui for React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"editor",
|
|
@@ -700,27 +700,6 @@
|
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
},
|
|
703
|
-
"scripts": {
|
|
704
|
-
"build:lib": "vite build",
|
|
705
|
-
"build:lib:dev": "vite build --mode development --watch",
|
|
706
|
-
"build:playground": "pnpm build:lib && pnpm --dir ./playground run build",
|
|
707
|
-
"docs:dev": "pnpm --parallel --filter docs... dev",
|
|
708
|
-
"docs:build": "pnpm --filter docs... build",
|
|
709
|
-
"docs:preview": "pnpm -C docs preview",
|
|
710
|
-
"prepublishOnly": "pnpm build:lib",
|
|
711
|
-
"playground": "pnpm --dir ./playground run dev",
|
|
712
|
-
"preview": "pnpm --dir ./playground run preview",
|
|
713
|
-
"lint": "oxlint",
|
|
714
|
-
"lint:fix": "oxlint --fix",
|
|
715
|
-
"fmt": "oxfmt",
|
|
716
|
-
"fmt:check": "oxfmt --check",
|
|
717
|
-
"type-check": "tsc",
|
|
718
|
-
"verify-commit": "verify-commit-msg",
|
|
719
|
-
"prepare": "git-scm-hooks",
|
|
720
|
-
"release": "bumpp -r",
|
|
721
|
-
"gen-changelog": "esno ./scripts/genExtensions.ts && esno ./scripts/changelog.ts",
|
|
722
|
-
"gen-contributors": "contributorkit"
|
|
723
|
-
},
|
|
724
703
|
"dependencies": {
|
|
725
704
|
"@excalidraw/excalidraw": "^0.18.0",
|
|
726
705
|
"@floating-ui/dom": "^1.7.4",
|
|
@@ -842,17 +821,27 @@
|
|
|
842
821
|
"node": ">=18.0.0"
|
|
843
822
|
},
|
|
844
823
|
"packageManager": "pnpm@8.15.9",
|
|
845
|
-
"pnpm": {
|
|
846
|
-
"overrides": {
|
|
847
|
-
"@excalidraw/excalidraw>nanoid": "3.3.11",
|
|
848
|
-
"@excalidraw/mermaid-to-excalidraw": "2.0.0",
|
|
849
|
-
"@excalidraw/mermaid-to-excalidraw>nanoid": "5.1.6",
|
|
850
|
-
"esbuild": "0.25.12",
|
|
851
|
-
"prosemirror-view": "1.41.1"
|
|
852
|
-
}
|
|
853
|
-
},
|
|
854
824
|
"git-hooks": {
|
|
855
825
|
"pre-commit": "npm run lint:fix",
|
|
856
826
|
"commit-msg": "npm run verify-commit"
|
|
827
|
+
},
|
|
828
|
+
"scripts": {
|
|
829
|
+
"build:lib": "vite build",
|
|
830
|
+
"build:lib:dev": "vite build --mode development --watch",
|
|
831
|
+
"build:playground": "pnpm build:lib && pnpm --dir ./playground run build",
|
|
832
|
+
"docs:dev": "pnpm --parallel --filter docs... dev",
|
|
833
|
+
"docs:build": "pnpm --filter docs... build",
|
|
834
|
+
"docs:preview": "pnpm -C docs preview",
|
|
835
|
+
"playground": "pnpm --dir ./playground run dev",
|
|
836
|
+
"preview": "pnpm --dir ./playground run preview",
|
|
837
|
+
"lint": "oxlint",
|
|
838
|
+
"lint:fix": "oxlint --fix",
|
|
839
|
+
"fmt": "oxfmt",
|
|
840
|
+
"fmt:check": "oxfmt --check",
|
|
841
|
+
"type-check": "tsc",
|
|
842
|
+
"verify-commit": "verify-commit-msg",
|
|
843
|
+
"release": "bumpp -r",
|
|
844
|
+
"gen-changelog": "esno ./scripts/genExtensions.ts && esno ./scripts/changelog.ts",
|
|
845
|
+
"gen-contributors": "contributorkit"
|
|
857
846
|
}
|
|
858
|
-
}
|
|
847
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),c=require("./index-BynXHtjJ.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:i,...t},l)=>{var n;const x=c.icons[t.icon],r=h?a.Slot:c.Button;return e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),i&&e.jsx(c.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i&&e.jsx("div",{children:i}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:c.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
|
package/lib/Drawer-DlgdaO_B.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const R=require("./clsx-CXbNJWDD.cjs"),i=require("./index-BynXHtjJ.cjs"),e=require("react/jsx-runtime"),m=require("react"),q=require("./index-DgOXAdKt.cjs"),p=require("easydrawer"),D={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function J({editor:t,node:r,updateAttributes:o,getPos:n,selected:v}){const[j,S]=m.useState({width:q.IMAGE_MAX_SIZE,height:q.IMAGE_MAX_SIZE}),[d,c]=m.useState({width:0,height:0}),[M]=m.useState([D.TOP_LEFT,D.TOP_RIGHT,D.BOTTOM_LEFT,D.BOTTOM_RIGHT]),[b,_]=m.useState(!1),[h,u]=m.useState({x:0,y:0,w:0,h:0,dir:""}),{align:T}=r==null?void 0:r.attrs,f=m.useMemo(()=>{const{src:g,alt:E,width:H,height:L}=r==null?void 0:r.attrs,k=R.isNumber(H)?`${H}px`:H,C=R.isNumber(L)?`${L}px`:L;return{src:g||void 0,alt:E||void 0,style:{width:k||void 0,height:C||void 0}}},[r==null?void 0:r.attrs]),s=m.useMemo(()=>{const{style:{width:g}}=f;return{width:g==="100%"?g:void 0}},[f]);function F(g){c({width:g.target.width,height:g.target.height})}const z=m.useCallback(()=>{t.commands.setNodeSelection(n())},[]),I=m.useCallback(i.throttle(()=>{const{width:g}=getComputedStyle(t.view.dom);S(E=>({...E,width:Number.parseInt(g,10)}))},q.IMAGE_THROTTLE_WAIT_TIME),[t]);function O(g,E){g.preventDefault(),g.stopPropagation();const H=d.width,L=d.height,k=H/L;let C=Number(r.attrs.width),N=Number(r.attrs.height);const y=j.width;C&&!N?(C=C>y?y:C,N=Math.round(C/k)):N&&!C?(C=Math.round(N*k),C=C>y?y:C):!C&&!N?(C=H>y?y:H,N=Math.round(C/k)):C=C>y?y:C,_(!0),u({x:g.clientX,y:g.clientY,w:C,h:N,dir:E})}const x=m.useCallback(i.throttle(g=>{if(g.preventDefault(),g.stopPropagation(),!b)return;const{x:E,w:H,dir:L}=h,k=(g.clientX-E)*(/l/.test(L)?-1:1),{width:C,height:N}=r==null?void 0:r.attrs,y=C/N,G=i.clamp(H+k,q.IMAGE_MIN_SIZE,j.width),Y=Math.round(G/y);o({width:G,height:Y})},q.IMAGE_THROTTLE_WAIT_TIME),[b,h,j,o,r==null?void 0:r.attrs]),a=m.useCallback(g=>{g.preventDefault(),g.stopPropagation(),b&&(u({x:0,y:0,w:0,h:0,dir:""}),_(!1),z())},[b,z]),w=m.useCallback(()=>{document==null||document.addEventListener("mousemove",x,!0),document==null||document.addEventListener("mouseup",a,!0)},[x,a]),A=m.useCallback(()=>{document==null||document.removeEventListener("mousemove",x,!0),document==null||document.removeEventListener("mouseup",a,!0)},[x,a]);m.useEffect(()=>(b?w():A(),()=>{A()}),[b,w,A]);const B=m.useMemo(()=>new ResizeObserver(()=>I()),[I]);return m.useEffect(()=>(B.observe(t.view.dom),()=>{B.disconnect()}),[t.view.dom,B]),e.jsx(R.NodeViewWrapper,{className:"image-view",style:{...s,width:"100%",textAlign:T},children:e.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:{...s,background:"#fff"},className:`image-view__body ${v?"image-view__body--focused":""} ${b?"image-view__body--resizing":""}`,children:[e.jsx("img",{alt:f.alt,className:"image-view__body__image block",height:"auto",onClick:z,onLoad:F,src:f.src,style:f.style}),t.view.editable&&(v||b)&&e.jsx("div",{className:"image-resizer",children:M==null?void 0:M.map(g=>e.jsx("span",{className:`image-resizer__handler image-resizer__handler--${g}`,onMouseDown:E=>O(E,g)},`image-dir-${g}`))})]})})}const W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ee=t=>{t=t.replace(/\r\n/g,`
|
|
2
|
-
`);let r=0,o="";for(;r<t.length;r++){const n=t.charCodeAt(r);n<128?o+=String.fromCharCode(n):n>127&&n<2048?(o+=String.fromCharCode(n>>6|192),o+=String.fromCharCode(63&n|128)):(o+=String.fromCharCode(n>>12|224),o+=String.fromCharCode(n>>6&63|128),o+=String.fromCharCode(63&n|128))}return o},te=t=>{let r,o,n,v,j,S,d,c=0,M="";for(t=ee(t);c<t.length;)r=t.charCodeAt(c++),o=t.charCodeAt(c++),n=t.charCodeAt(c++),v=r>>2,j=(3&r)<<4|o>>4,S=(15&o)<<2|n>>6,d=63&n,isNaN(o)?S=d=64:isNaN(n)&&(d=64),M=M+W.charAt(v)+W.charAt(j)+W.charAt(S)+W.charAt(d);return M},re=t=>typeof t=="string"?"string":typeof SVGElement<"u"&&t instanceof SVGElement?"element":void 0,$=t=>"data:image/svg+xml;base64,"+te(t),oe=t=>$(new XMLSerializer().serializeToString(t)),Z=t=>{switch(re(t)){case"string":return $(t);case"element":return oe(t);default:return t}};function le(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{color:"currentColor",d:"M2 9.2v3.6M12.8 2H9.2M7.5 20H9M20 7.5V9M2.133 4.699c.155-.727.415-1.274.854-1.712c.426-.426.954-.684 1.652-.84m15.228 2.552c-.155-.727-.415-1.274-.854-1.712c-.417-.417-.932-.673-1.608-.83M4.64 19.853c-.698-.156-1.226-.414-1.652-.84c-.43-.43-.69-.965-.845-1.673m11.638 3.626c-1.812.125-3.607-8.326-2.374-9.559s9.684.561 9.559 2.373c-.087 1.187-2.095 1.656-2.037 2.711c.018.309.408.59 1.188 1.154c.543.39 1.096.77 1.629 1.175a.66.66 0 0 1 .234.687a3.35 3.35 0 0 1-2.472 2.473a.66.66 0 0 1-.688-.235c-.404-.533-.784-1.086-1.175-1.628c-.563-.78-.844-1.17-1.153-1.188c-1.055-.059-1.524 1.95-2.71 2.037",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})}function ne(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M20.06 18a4 4 0 0 1-.2-.89c-.67.7-1.48 1.05-2.41 1.05c-.83 0-1.52-.24-2.05-.71c-.53-.45-.8-1.06-.8-1.79c0-.88.33-1.56 1-2.05s1.61-.73 2.83-.73h1.4v-.64q0-.735-.45-1.17c-.3-.29-.75-.43-1.33-.43c-.52 0-.95.12-1.3.36c-.35.25-.52.54-.52.89h-1.46c0-.43.15-.84.45-1.24c.28-.4.71-.71 1.22-.94c.51-.21 1.06-.35 1.69-.35c.98 0 1.74.24 2.29.73s.84 1.16.86 2.02V16c0 .8.1 1.42.3 1.88V18zm-2.4-1.12c.45 0 .88-.11 1.29-.32c.4-.21.7-.49.88-.83v-1.57H18.7c-1.77 0-2.66.47-2.66 1.41c0 .43.15.73.46.96c.3.23.68.35 1.16.35m-12.2-3.17h4.07L7.5 8.29zM6.64 6h1.72l4.71 12h-1.93l-.97-2.57H4.82L3.86 18H1.93z",fill:"currentColor"})})}function se(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M3 21v-4.25L16.2 3.575q.3-.275.663-.425t.762-.15t.775.15t.65.45L20.425 5q.3.275.438.65T21 6.4q0 .4-.137.763t-.438.662L7.25 21zM17.6 7.8L19 6.4L17.6 5l-1.4 1.4z",fill:"currentColor"})})}function ie(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 256 256",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M253.66 106.34a8 8 0 0 0-11.32 0L192 156.69L107.31 72l50.35-50.34a8 8 0 1 0-11.32-11.32L96 60.69a16 16 0 0 0-2.82 18.81L72 100.69a16 16 0 0 0 0 22.62l4.69 4.69l-58.35 58.34a8 8 0 0 0 3.13 13.25l72 24A7.9 7.9 0 0 0 96 224a8 8 0 0 0 5.66-2.34L136 187.31l4.69 4.69a16 16 0 0 0 22.62 0l21.19-21.18a16 16 0 0 0 18.81-2.82l50.35-50.34a8 8 0 0 0 0-11.32M93.84 206.85l-55-18.35L88 139.31L124.69 176ZM152 180.69L83.31 112L104 91.31L172.69 160Z",fill:"currentColor"})})}function ae(t){return e.jsxs("svg",{height:"1em",viewBox:"0 0 16 16",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:[e.jsx("path",{d:"m2.648 9.937l7.29-7.288a2.21 2.21 0 0 1 3.124 0l2.29 2.288a2.21 2.21 0 0 1 0 3.126L10.413 13H12.5a.5.5 0 0 1 0 1H4.501a2.2 2.2 0 0 1-1.563-.647l.707-.707c.227.226.535.354.856.354h4.005a1.2 1.2 0 0 0 .848-.354l1.292-1.293l-4-4l-3.29 3.291a1.21 1.21 0 0 0 0 1.712l.29.29l-.708.707l-.29-.29a2.21 2.21 0 0 1 0-3.126M8 6h6.89a1.2 1.2 0 0 0-.246-.356L14 5H9zm2-2h3l-.645-.644a1.21 1.21 0 0 0-1.71 0zm4.89 3H7.708l1 1H14l.644-.644A1.2 1.2 0 0 0 14.891 7zM9.708 9l1.646 1.646L13 9z",fill:"currentColor"}),e.jsx("path",{d:"M14 11.5a.5.5 0 1 1-1 0a.5.5 0 0 1 1 0m1.5-.5a.5.5 0 1 0 0-1a.5.5 0 0 0 0 1m-1 2a.5.5 0 0 0 0 1h1a.5.5 0 0 0 0-1z",fill:"currentColor"})]})}function ce(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M3 3h18v18H3zm2 2v14h14V5z",fill:"currentColor"})})}function he(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M2 20V4h20v16zm2-2h16V6H4zm0 0V6z",fill:"currentColor"})})}function ue(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8",fill:"currentColor"})})}function de(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M10.363 3.591L2.257 17.125a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636-2.87L13.637 3.59a1.914 1.914 0 0 0-3.274 0z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function ge(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"m6.8 21l-5.2-9l5.2-9h10.4l5.2 9l-5.2 9zm1.15-2h8.1l4.025-7l-4.025-7h-8.1L3.9 12zM12 12",fill:"currentColor"})})}function me(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsxs("g",{fill:"none",fillRule:"evenodd",children:[e.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),e.jsx("path",{d:"M10.586 2.807a2 2 0 0 1 2.828 0l7.778 7.779a2 2 0 0 1 0 2.828l-7.778 7.778a2 2 0 0 1-2.828 0l-7.778-7.778a2 2 0 0 1 0-2.828zM12 4.222L4.222 12L12 19.778L19.778 12z",fill:"currentColor"})]})})}function pe(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M16.01 11H4v2h12.01v3L20 12l-3.99-4z",fill:"currentColor"})})}function xe(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{clipRule:"evenodd",d:"M7.53 3.47a.75.75 0 0 1 0 1.06L5.81 6.25H15a5.75 5.75 0 0 1 0 11.5H8a.75.75 0 0 1 0-1.5h7a4.25 4.25 0 0 0 0-8.5H5.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 0 1 1.06 0",fill:"currentColor",fillRule:"evenodd"})})}function we(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{clipRule:"evenodd",d:"M16.47 3.47a.75.75 0 0 1 1.06 0l3 3a.75.75 0 0 1 0 1.06l-3 3a.75.75 0 1 1-1.06-1.06l1.72-1.72H9a4.25 4.25 0 0 0 0 8.5h7a.75.75 0 0 1 0 1.5H9a5.75 5.75 0 0 1 0-11.5h9.19l-1.72-1.72a.75.75 0 0 1 0-1.06",fill:"currentColor",fillRule:"evenodd"})})}function ve(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M7 21q-.825 0-1.412-.587T5 19V6H4V4h5V3h6v1h5v2h-1v13q0 .825-.587 1.413T17 21zm2-4h2V8H9zm4 0h2V8h-2z",fill:"currentColor"})})}function Ce(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 256 256",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M211.81 83.79a28 28 0 0 1-33.12 4.83l-90.07 90.07a28 28 0 1 1-44.43-6.48a28 28 0 0 1 33.12-4.83l90.07-90.07a28 28 0 1 1 44.43 6.48",fill:"currentColor"})})}function fe(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M12 20.325q-.35 0-.712-.125t-.638-.4l-1.725-1.575q-2.65-2.425-4.788-4.812T2 8.15Q2 5.8 3.575 4.225T7.5 2.65q1.325 0 2.5.562t2 1.538q.825-.975 2-1.537t2.5-.563q2.35 0 3.925 1.575T22 8.15q0 2.875-2.125 5.275T15.05 18.25l-1.7 1.55q-.275.275-.637.4t-.713.125M11.05 6.75q-.725-1.025-1.55-1.563t-2-.537q-1.5 0-2.5 1t-1 2.5q0 1.3.925 2.763t2.213 2.837t2.65 2.575T12 18.3q.85-.775 2.213-1.975t2.65-2.575t2.212-2.837T20 8.15q0-1.5-1-2.5t-2.5-1q-1.175 0-2 .538T12.95 6.75q-.175.25-.425.375T12 7.25t-.525-.125t-.425-.375m.95 4.725",fill:"currentColor"})})}function Te(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"m7.625 6.4l2.8-3.625q.3-.4.713-.587T12 2t.863.188t.712.587l2.8 3.625l4.25 1.425q.65.2 1.025.738t.375 1.187q0 .3-.088.6t-.287.575l-2.75 3.9l.1 4.1q.025.875-.575 1.475t-1.4.6q-.05 0-.55-.075L12 19.675l-4.475 1.25q-.125.05-.275.063T6.975 21q-.8 0-1.4-.6T5 18.925l.1-4.125l-2.725-3.875q-.2-.275-.288-.575T2 9.75q0-.625.363-1.162t1.012-.763zM8.85 8.125L4 9.725L7.1 14.2L7 18.975l5-1.375l5 1.4l-.1-4.8L20 9.775l-4.85-1.65L12 4zM12 11.5",fill:"currentColor"})})}function je(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M12.01 6c2.61 0 4.89 1.86 5.4 4.43l.3 1.5l1.52.11c1.56.11 2.78 1.41 2.78 2.96c0 1.65-1.35 3-3 3h-13c-2.21 0-4-1.79-4-4c0-2.05 1.53-3.76 3.56-3.97l1.07-.11l.5-.95A5.46 5.46 0 0 1 12.01 6m0-2C9.12 4 6.6 5.64 5.35 8.04C2.35 8.36.01 10.91.01 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5c0-2.64-2.05-4.78-4.64-4.96C18.68 6.59 15.65 4 12.01 4",fill:"currentColor"})})}function be(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M5.586 6.45A2 2 0 0 1 7.509 5h11.84a2 2 0 0 1 1.923 2.55l-2.858 10A2 2 0 0 1 16.491 19H4.651a2 2 0 0 1-1.923-2.55z",fill:"none",stroke:"currentColor",strokeWidth:"2"})})}const Se="_wrapper_pva9d_1",Me="_tool_pva9d_17",ye="_active_pva9d_37",Ee="_pen_pva9d_41",He="_line_pva9d_48",Ne="_options_pva9d_56",Ae="_colorWrap_pva9d_66",Le="_color_pva9d_66",ke="_colorActive_pva9d_83",l={wrapper:Se,tool:Me,active:ye,pen:Ee,line:He,options:Ne,colorWrap:Ae,color:Le,colorActive:ke},_e=[p.Color4.blackHighlight,p.Color4.ofRGBA(166/255,81/255,167/255,.3),p.Color4.ofRGBA(247/255,78/255,158/255,.3),p.Color4.ofRGBA(166/255,83/255,88/255,.3),p.Color4.ofRGBA(246/255,130/255,28/255,.3),p.Color4.ofRGBA(166/255,198/255,0,.3),p.Color4.ofRGBA(98/255,186/255,70/255,.3)],U=[p.Color4.black,p.Color4.fromHex("#007AFF"),p.Color4.fromHex("#A651A7"),p.Color4.fromHex("#F74E9E"),p.Color4.fromHex("#FF5358"),p.Color4.fromHex("#F6821C"),p.Color4.fromHex("#FFC600"),p.Color4.fromHex("#62BA46"),p.Color4.fromHex("#E6BFE8"),p.Color4.fromHex("#FEA3D2"),p.Color4.fromHex("#FFA0A3"),p.Color4.fromHex("#FBC276"),p.Color4.fromHex("#FFFB85"),p.Color4.fromHex("#AADC99")];function ze({onChange:t}){const[r,o]=m.useState(p.Color4.blackHighlight);return e.jsx("div",{className:l.colorWrap,children:_e.map((n,v)=>e.jsx("button",{style:{backgroundColor:n.toHexString()},className:i.cn(l.color,{[l.colorActive]:r.toHexString()===n.toHexString()}),onClick:()=>{o(n),t(n)}},v))})}function V({onChange:t}){const[r,o]=m.useState(p.Color4.black);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:l.colorWrap,children:U.slice(0,7).map((n,v)=>e.jsx("button",{style:{backgroundColor:n.toHexString()},className:i.cn(l.color,{[l.colorActive]:r.toHexString()===n.toHexString()}),onClick:()=>{o(n),t(n)}},v))}),e.jsx("div",{className:l.colorWrap,children:U.slice(7).map((n,v)=>e.jsx("button",{style:{backgroundColor:n.toHexString()},className:i.cn(l.color,{[l.colorActive]:r.toHexString()===n.toHexString()}),onClick:()=>{o(n),t(n)}},v))})]})}function Be({setColorPen:t,setThicknessPen:r}){const[o,n]=m.useState(2);return e.jsxs("div",{className:l.options,children:[e.jsx("div",{children:e.jsx(V,{onChange:v=>t(v)})}),e.jsx("div",{className:l.line}),e.jsx("div",{children:e.jsx("input",{max:10,min:1,step:.1,type:"range",value:o,onChange:v=>{r(Number.parseFloat(v.target.value)),n(Number.parseFloat(v.target.value))}})})]})}function qe({setColorHighlight:t}){return e.jsx("div",{className:l.options,children:e.jsx(ze,{onChange:r=>t(r)})})}function Pe({changeColorShape:t,changeBorderColorShape:r,onThicknessChange:o}){return e.jsxs("div",{className:l.options,children:[e.jsx("div",{children:e.jsx(V,{onChange:n=>t(n)})}),e.jsx("div",{className:l.line}),e.jsx("div",{children:e.jsx(V,{onChange:n=>r(n)})}),e.jsx("div",{className:l.line}),e.jsx("div",{children:e.jsx("input",{defaultValue:0,max:20,min:0,step:1,type:"range",onChange:n=>{o(Number.parseFloat(n.target.value))}})})]})}function X(t){const{setColorPen:r,refEditor:o,setThicknessPen:n,setColorHighlight:v,changeBorderColorShape:j,onUndo:S,changeColorShape:d,changeShape:c,onThicknessChange:M,onRedo:b,onClear:_}=t,[h,u]=m.useState(null),[T,f]=m.useState(0);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:l.wrapper,children:[e.jsxs("div",{className:l.pen,children:[e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="select"}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();if(h==="select"){u(null),s[0].setEnabled(!1);return}u("select"),s[0].setEnabled(!0)},children:e.jsx(le,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="text"}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();if(o.current.toolController.setToolEnabled(s[1]),h==="text"){s[1].setEnabled(!1),u(null);return}u("text"),s[1].setEnabled(!0)},children:e.jsx(ne,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="pencil"}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();if(h==="pencil"){u(null),s[2].setEnabled(!1);return}u("pencil"),s[2].setEnabled(!0)},children:e.jsx(se,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="highlighter"}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();if(h==="highlighter"){u(null),s[3].setEnabled(!1);return}u("highlighter"),s[3].setEnabled(!0)},children:e.jsx(ie,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="eraser"}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();if(h==="eraser"){u(null),s[4].setEnabled(!1);return}u("eraser"),s[4].setEnabled(!0)},children:e.jsx(ae,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===0}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(0),f(0)},children:e.jsx(ce,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===1}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(1),f(1)},children:e.jsx(he,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===2}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(2),f(2)},children:e.jsx(ue,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===3}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(3),f(3)},children:e.jsx(de,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===4}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(4),f(4)},children:e.jsx(ge,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===5}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(5),f(5)},children:e.jsx(me,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===6}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(6),f(6)},children:e.jsx(pe,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===7}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(7),f(7)},children:e.jsx(Ce,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===8}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(8),f(8)},children:e.jsx(fe,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===9}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(9),f(9)},children:e.jsx(Te,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===10}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(10),f(10)},children:e.jsx(je,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:h==="shapes"&&T===11}),onClick:()=>{const s=o.current.toolController.getPrimaryTools();o.current.toolController.setToolEnabled(s[5]),u("shapes"),s[5].setEnabled(!0),c(11),f(11)},children:e.jsx(be,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool),onClick:S,children:e.jsx(xe,{})}),e.jsx("button",{className:i.cn(l.tool),onClick:b,children:e.jsx(we,{})}),e.jsx("button",{className:i.cn(l.tool),onClick:_,children:e.jsx(ve,{})})]}),e.jsxs("div",{className:l.optionsWrap,children:[h==="pencil"&&e.jsx(Be,{setColorPen:r,setThicknessPen:n}),h==="highlighter"&&e.jsx(qe,{setColorHighlight:v}),h==="shapes"&&e.jsx(Pe,{changeBorderColorShape:j,changeColorShape:d,changeShape:c,onThicknessChange:M})]})]})})}function K(t=8){return Math.random().toString(36).substring(2,t+2)}let P=!1;function Re(){const t=i.useEditorInstance(),r=i.useButtonProps(Q.name),{isActive:o=void 0,upload:n}=(r==null?void 0:r.componentProps)??{},{editorDisabled:v}=i.useToggleActive(o),[j,S]=m.useState(!1),d=m.useRef(null),c=m.useRef(null),M=()=>{(async()=>{const a=document.querySelector("#easydrawer");a&&(d.current=new p.Editor(a,{wheelEventsEnabled:!1,disableZoom:!0}),c.current=p.makeDropdownToolbar(d.current),c.current.addDefaultToolWidgets())})()};m.useEffect(()=>{j&&setTimeout(()=>{M()},200)},[j]);const b=async()=>{if(d.current){const x=d.current.toSVG(),a=x.outerHTML,w=`drawer-${K()}.svg`;let A=Z(x.outerHTML);if(n){const B=i.dataURLtoFile(A,w);A=await n(B)}t==null||t.chain().focus().setDrawer({type:"drawer",src:A,alt:encodeURIComponent(a),width:426,height:212},!!a).run()}S(!1)},_=x=>{const a=d.current.toolController.getPrimaryTools()[2],w=c.current.getWidgetById("pen-1");a&&w&&(a.setColor(x),w.serializeState())},h=x=>{const a=d.current.toolController.getPrimaryTools()[2],w=c.current.getWidgetById("pen-1");a&&w&&(a.setThickness(x),w.serializeState())},u=x=>{const a=d.current.toolController.getPrimaryTools()[3],w=c.current.getWidgetById("pen-2");a&&w&&(a.setColor(x),w.serializeState())},T=x=>{const a=c.current.getWidgetById("shape");a&&a.setShapeType(x)},f=x=>{const a=d.current.toolController.getPrimaryTools()[5],w=c.current.getWidgetById("shape");a&&w&&(a.setColor(x),w.serializeState())},s=x=>{const a=d.current.toolController.getPrimaryTools()[5],w=c.current.getWidgetById("shape");a&&w&&(a.setThickness(x),w.serializeState())},F=x=>{const a=d.current.toolController.getPrimaryTools()[5],w=c.current.getWidgetById("shape");a&&w&&(a.setBorderColor(x),w.serializeState())},z=()=>{if(P){for(;d.current.history.redoStackSize>0;)d.current.history.redo();P=!1;return}d.current.history.undo()},I=()=>{P||d.current.history.redo()},O=()=>{if(!P){for(;d.current.history.undoStackSize>0;)z();P=!0}};return r?e.jsxs(i.Dialog,{onOpenChange:S,open:j,children:[e.jsx(i.DialogTrigger,{asChild:!0,children:e.jsx(i.ActionButton,{disabled:v,action:()=>{v||S(!0)},icon:"PencilRuler",tooltip:"Drawer"})}),e.jsxs(i.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[e.jsx(i.DialogTitle,{children:"Drawer"}),e.jsxs("div",{style:{height:"600px",width:"100%",borderWidth:1,background:"white",position:"relative"},children:[e.jsx("div",{className:"richtext-size-full",id:"easydrawer"}),e.jsx(X,{changeBorderColorShape:F,changeColorShape:f,changeShape:T,onClear:O,onRedo:I,onThicknessChange:s,onUndo:z,refEditor:d,setColorHighlight:u,setColorPen:_,setThicknessPen:h})]}),e.jsx(i.DialogFooter,{children:e.jsx(i.Button,{onClick:b,type:"button",children:"Save changes"})})]})]}):e.jsx(e.Fragment,{})}const Q=i.index_default.extend({name:"richTextDrawer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),inline:!1,content:"",marks:"",group:"block",draggable:!1,selectable:!0,atom:!0,HTMLAttributes:{class:"drawer"},button:({t:r,extension:o})=>{var n;return{componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,icon:"PencilRuler",tooltip:r("editor.drawer.tooltip"),upload:(n=o==null?void 0:o.options)==null?void 0:n.upload}}}}},addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:r=>{const o=r.querySelector("img"),n=o==null?void 0:o.getAttribute("width");return n?Number.parseInt(n,10):320},renderHTML:r=>({width:r.width})},height:{default:null,parseHTML:r=>{const o=r.querySelector("img"),n=o==null?void 0:o.getAttribute("height");return n?Number.parseInt(n,10):212},renderHTML:r=>({height:r.height})},align:{default:"center",parseHTML:r=>r.getAttribute("align"),renderHTML:r=>({align:r.align})}}},addNodeView(){return R.ReactNodeViewRenderer(J)},addCommands(){return{setDrawer:(t,r)=>({commands:o,editor:n})=>r?o.insertContent({type:this.name,attrs:t}):o.insertContentAt(n.state.selection.anchor,{type:this.name,attrs:t}),setAlignImageDrawer:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:t}){const{align:r}=t;return["div",{style:r?`text-align: ${r};`:"",class:"imageDrawer"},["img",R.mergeAttributes(this.options.HTMLAttributes,t)]]},parseHTML(){return[{tag:"div[class=imageDrawer]",getAttrs:t=>{const r=t.querySelector("img"),o=r==null?void 0:r.getAttribute("width"),n=r==null?void 0:r.getAttribute("height");return{src:r==null?void 0:r.getAttribute("src"),alt:r==null?void 0:r.getAttribute("alt"),width:o?Number.parseInt(o,10):null,height:n?Number.parseInt(n,10):null,align:(r==null?void 0:r.getAttribute("align"))||t.style.textAlign||null}}}]}});exports.ControlDrawer=X;exports.Drawer=Q;exports.RichTextDrawer=Re;exports.i=Z;exports.shortId=K;
|
package/lib/Iframe-CANdxSpV.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const m=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),k=require("re-resizable"),b=require("react"),u=require("./index-BynXHtjJ.cjs");require("./theme.cjs");const p={youtube:{example:"https://www.youtube.com/watch?v=I4sMhHbHYXM",src:"https://www.youtube.com/embed/I4sMhHbHYXM",srcPrefix:"https://www.youtube.com/embed",linkRule:[/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/]},youku:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"https://player.youku.com/embed",linkRule:[String.raw`v.youku.com\/v_show\/id_\w+\=*`],idRule:String.raw`id_\w+\=*`},bilibili:{example:"https://www.bilibili.com/video/BV1EJ411u7DN",src:"https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",srcPrefix:"https://player.bilibili.com/player.html?bvid",linkRule:[String.raw`www.bilibili.com\/video\/\w+`]},qqvideo:{example:"https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",src:"https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",srcPrefix:"https://v.qq.com/txp/iframe/player.html?vid",linkRule:[String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]},amap:{example:"https://ditu.amap.com/",src:"https://www.amap.com/place/B000A45467",srcPrefix:"",linkRule:[String.raw`\.amap\.com`]},baidu_map:{example:"https://j.map.baidu.com/15/fo",src:"https://j.map.baidu.com/15/fo",srcPrefix:"",linkRule:[String.raw`map\.baidu\.com`]},modao:{example:"https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",src:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",srcPrefix:"",linkRule:[String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],tips:"Modao > More > Share > Embed > COPY"},lanhu:{example:"https://lanhuapp.com/link/#/invite?sid=evP7L",src:"https://lanhuapp.com/url/evP7L",srcPrefix:"",linkRule:[String.raw`https:\/\/lanhuapp.com\/url\/\w+`],tips:"Lanhu > Project > Share > Copy Link"},figma:{example:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",src:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",srcPrefix:"https://www.figma.com/embed?embed_host=share&url",linkRule:[String.raw`https:\/\/www.figma.com\/file\/\w+`]},canva:{example:"https://www.canva.cn/design/DAD61-t29UI/view",src:"https://www.canva.cn/design/DAD61-t29UI/view",srcPrefix:"",linkRule:[String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]},processon:{example:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",src:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",srcPrefix:"",linkRule:[String.raw`https:\/\/www.processon.com\/embed\/\w+`]},codepen:{example:"https://codepen.io/mekery/embed/YzyrKOJ",src:"https://codepen.io/mekery/embed/YzyrKOJ",srcPrefix:"",linkRule:[String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]},jinshuju:{example:"https://jinshuju.net/f/q9YvVf",src:"https://jinshuju.net/f/q9YvVf",srcPrefix:"",linkRule:[String.raw`https:\/\/jinshuju.net\/f\/\w+`]},iframe:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"",linkRule:[".+"]},googlemaps:{example:"https://goo.gl/maps/8Ys8b4K1ZJY2",src:"https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",srcPrefix:"",linkRule:[String.raw`https:\/\/goo.gl\/maps\/\w+`]}};function y(e){const t=p.youtube,i=e.matchedUrl;e.validLink=!0;const r=i.split("="),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}/${c}`,e.validId=!0}return e}function S(e){const t=p.youku,i=e.matchedUrl,r=t.idRule,n=new RegExp(r),c=i.match(n);if(c&&c.length>0){const o=c[0].slice(3);e.validId=!0,e.src=`${t.srcPrefix}/${o}`}else e.validId=!1;return e}function I(e){const t=p.bilibili,r=e.matchedUrl.split("/"),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}=${c}`,e.validId=!0}return e}function R(e){const t=p.qqvideo,r=e.matchedUrl.split("/"),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}=${c}`,e.validId=!0}return e}function P(e,t){return t.src=e,t.validId=!0,t}function j(e,t){return t.src=e,t.validId=!0,t}function M(e,t){return t.src=e,t.validId=!0,t.originalLink=e,t}function N(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function q(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function U(e){const t=p.figma;return e.src=`${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`,e.validId=!0,e.originalLink=e.matchedUrl,e}function A(e,t){return t.src=`${t.matchedUrl}?embed`,t.validId=!0,t.originalLink=e,t}function D(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function L(e){return e.src=`${e.matchedUrl}`,e.validId=!0,e.originalLink=e.src,e}function _(e,t){return t.src=`${t.matchedUrl}?background=white&banner=show&embedded=true`,t.validId=!0,t.originalLink=e,t}function $(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function T(e,t,i){if(e==="googlemaps")return i.validLink=!0,i.matchedUrl=t,i;const n=p[e].linkRule;for(const c of n){const o=new RegExp(c),a=t.match(o);if(a&&a.length>0)return i.validLink=!0,i.matchedUrl=e==="youtube"?a[1]:a[0],i}return i}function z(e){var i,r;let t="iframe";return((i=e.includes)!=null&&i.call(e,"youtube")||(r=e.includes)!=null&&r.call(e,"youtu.be"))&&(t="youtube"),e.includes("youku")&&(t="youku"),e.includes("bilibili")&&(t="bilibili"),e.includes("qq")&&(t="qqvideo"),e.includes("amap")&&(t="amap"),e.includes("map.baidu")&&(t="baidu_map"),(e.includes("google.com/maps")||e.includes("maps.app.goo.gl"))&&(t="googlemaps"),e.includes("modao")&&(t="modao"),e.includes("lanhuapp")&&(t="lanhu"),e.includes("figma")&&(t="figma"),e.includes("canva")&&(t="canva"),e.includes("processon")&&(t="processon"),e.includes("codepen")&&(t="codepen"),e.includes("jinshuju")&&(t="jinshuju"),e.includes("iframe")&&(t="iframe"),t}function v(e){let t={validLink:!1,validId:!1,matchedUrl:"",originalLink:e,src:""};const i=z(e);if(t=T(i,e,t),!t.validLink)return t;switch(i){case"youtube":return y(t);case"youku":return S(t);case"bilibili":return I(t);case"qqvideo":return R(t);case"amap":return P(e,t);case"baidu_map":return j(e,t);case"googlemaps":return M(e,t);case"modao":return N(t);case"lanhu":return q(t);case"figma":return U(t);case"canva":return A(e,t);case"processon":return D(e,t);case"codepen":return L(t);case"jinshuju":return _(e,t);case"iframe":return $(e,t);default:return e}}const Y="_wrap_5y04w_1",C="_innerWrap_5y04w_15",g={wrap:Y,innerWrap:C};function E({editor:e,node:t,updateAttributes:i}){const r=u.useEditableEditor(),{src:n,width:c,height:o}=t.attrs,[a,l]=b.useState("");function h(){if(!a)return;const d=v(a);e.chain().updateAttributes(f.name,{src:(d==null?void 0:d.src)||a}).setNodeSelection(e.state.selection.from).focus().run()}const x=b.useCallback(d=>{i({width:d.width,height:d.height})},[i]);return s.jsxs(m.NodeViewWrapper,{children:[!n&&s.jsxs("div",{className:"richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-border richtext-p-[10px]",children:[s.jsx(u.Input,{autoFocus:!0,className:"richtext-flex-1",onInput:d=>l(d.target.value),placeholder:"Enter link",type:"url",value:a}),s.jsx(u.Button,{className:"richtext-w-[60px]",onClick:h,children:"OK"})]}),n&&s.jsx(k.Resizable,{size:{width:Number.parseInt(c),height:Number.parseInt(o)},onResizeStop:(d,B,V,w)=>{x({width:Number.parseInt(c)+w.width,height:Number.parseInt(o)+w.height})},children:s.jsx("div",{className:m.clsx(g.wrap,"render-wrapper"),children:s.jsx("div",{className:g.innerWrap,style:{pointerEvents:r?"none":"auto"},children:s.jsx("iframe",{className:"richtext-my-[12px]",src:n})})})})]})}function H(){const e=u.useButtonProps(f.name),{icon:t=void 0,tooltip:i=void 0,shortcutKeys:r=void 0,tooltipOptions:n={},action:c=void 0,isActive:o=void 0}=(e==null?void 0:e.componentProps)??{},{editorDisabled:a,update:l}=u.useToggleActive(o),h=()=>{a||c&&(c(),l())};return e?s.jsx(u.ActionButton,{action:h,disabled:a,icon:t,shortcutKeys:r,tooltip:i,tooltipOptions:n}):s.jsx(s.Fragment,{})}const f=m.Node3.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"iframe"},button:({editor:t,extension:i,t:r})=>({componentProps:{action:n=>t.commands.setIframe(n),upload:i.options.upload,icon:"Iframe",tooltip:r("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:u.getDatasetAttribute("width")},height:{default:300,parseHTML:u.getDatasetAttribute("height")},src:{default:null,parseHTML:u.getDatasetAttribute("src")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:e}){return["iframe",m.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setIframe:e=>({tr:t,commands:i,chain:r})=>{var c,o,a;if(((a=(o=(c=t.selection)==null?void 0:c.node)==null?void 0:o.type)==null?void 0:a.name)==this.name)return i.updateAttributes(this.name,e);const n=e||{url:""};return r().insertContent({type:this.name,attrs:n}).run()}}},addInputRules(){return[m.nodeInputRule({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return m.ReactNodeViewRenderer(E)}});exports.Iframe=f;exports.RichTextIframe=H;exports.getServiceSrc=v;
|
package/lib/Indent-DuB2U6Cs.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const p=require("./clsx-CXbNJWDD.cjs"),l=require("@tiptap/pm/state"),c=require("react/jsx-runtime"),u=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");var a=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(a||{});function b(t,e,n){return t<e?e:t>n?n:t}function A(t,e,n,o){const{doc:s,selection:r}=t;if(!s||!r||!(r instanceof l.TextSelection||r instanceof l.AllSelection))return t;const{from:i,to:d}=r;return s.nodesBetween(i,d,(m,x)=>{const I=m.type;return n.includes(I.name)?(t=h(t,x,e),!1):!p.isList(m.type.name,o.extensionManager.extensions)}),t}function h(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o)return t;const i=b((o.attrs.indent||0)+n,0,7);if(i===o.attrs.indent)return t;const d={...o.attrs,indent:i};return t.setNodeMarkup(e,o.type,d,o.marks)}function f({delta:t,types:e}){return({state:n,dispatch:o,editor:s})=>{const{selection:r}=n;let{tr:i}=n;return i=i.setSelection(r),i=A(i,t,e,s),i.docChanged?(o&&o(i),!0):!1}}function T(){const t=u.useButtonProps(y.name),{indent:e,outdent:n}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o}=u.useToggleActive(),s=()=>{o||e!=null&&e.action&&(e==null||e.action())},r=()=>{o||n!=null&&n.action&&(n==null||n.action())};return t?c.jsxs(c.Fragment,{children:[c.jsx(u.ActionButton,{action:s,disabled:o,icon:e==null?void 0:e.icon,shortcutKeys:e==null?void 0:e.shortcutKeys,tooltip:e==null?void 0:e.tooltip}),c.jsx(u.ActionButton,{action:r,disabled:o,icon:n==null?void 0:n.icon,shortcutKeys:n==null?void 0:n.shortcutKeys,tooltip:n==null?void 0:n.tooltip})]}):c.jsx(c.Fragment,{})}const y=p.Extension.create({name:"richtextIndentOutdent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:a.min,maxIndent:a.max,button({editor:e,t:n,extension:o}){var s,r;return{componentProps:{indent:{action:()=>{e.commands.indent()},shortcutKeys:((s=o.options.shortcutKeys)==null?void 0:s[0])??["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")},outdent:{action:()=>{e.commands.outdent()},shortcutKeys:((r=o.options.shortcutKeys)==null?void 0:r[1])??["Shift","Tab"],icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>f({delta:a.more,types:this.options.types}),outdent:()=>f({delta:a.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=y;exports.IndentProps=a;exports.RichTextIndent=T;exports.setNodeIndentMarkup=h;
|
package/lib/Katex-DFU1unCm.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";const Dr=require("./clsx-CXbNJWDD.cjs"),Y=require("react/jsx-runtime"),Ya=require("katex"),fr=require("react"),tr=require("./index-BynXHtjJ.cjs");require("./theme.cjs");const qo=require("./index-DgOXAdKt.cjs");var Gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Po(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Io(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var n=function a(){return this instanceof a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(r).forEach(function(a){var t=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(n,a,t.get?t:{enumerable:!0,get:function(){return r[a]}})}),n}function kt(r,e={}){if(typeof r=="object")return r;try{return JSON.parse(r)}catch{return e}}var ae,sn;function Xa(){if(sn)return ae;sn=1;var r=Object.prototype.toString;return ae=function(n){var a=r.call(n),t=a==="[object Arguments]";return t||(t=a!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&r.call(n.callee)==="[object Function]"),t},ae}var oe,ln;function Ro(){if(ln)return oe;ln=1;var r;if(!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,a=Xa(),t=Object.prototype.propertyIsEnumerable,f=!t.call({toString:null},"toString"),i=t.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(y){var h=y.constructor;return h&&h.prototype===y},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},v=(function(){if(typeof window>"u")return!1;for(var y in window)try{if(!c["$"+y]&&e.call(window,y)&&window[y]!==null&&typeof window[y]=="object")try{u(window[y])}catch{return!0}}catch{return!0}return!1})(),p=function(y){if(typeof window>"u"||!v)return u(y);try{return u(y)}catch{return!1}};r=function(h){var S=h!==null&&typeof h=="object",R=n.call(h)==="[object Function]",w=a(h),q=S&&n.call(h)==="[object String]",O=[];if(!S&&!R&&!w)throw new TypeError("Object.keys called on a non-object");var m=i&&R;if(q&&h.length>0&&!e.call(h,0))for(var j=0;j<h.length;++j)O.push(String(j));if(w&&h.length>0)for(var Q=0;Q<h.length;++Q)O.push(String(Q));else for(var H in h)!(m&&H==="prototype")&&e.call(h,H)&&O.push(String(H));if(f)for(var F=p(h),D=0;D<o.length;++D)!(F&&o[D]==="constructor")&&e.call(h,o[D])&&O.push(o[D]);return O}}return oe=r,oe}var ie,cn;function Lt(){if(cn)return ie;cn=1;var r=Array.prototype.slice,e=Xa(),n=Object.keys,a=n?function(i){return n(i)}:Ro(),t=Object.keys;return a.shim=function(){if(Object.keys){var i=(function(){var o=Object.keys(arguments);return o&&o.length===arguments.length})(1,2);i||(Object.keys=function(u){return e(u)?t(r.call(u)):t(u)})}else Object.keys=a;return Object.keys||a},ie=a,ie}var ue,pn;function zr(){if(pn)return ue;pn=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return ue=r,ue}var fe,yn;function Ut(){return yn||(yn=1,fe=SyntaxError),fe}var se,vn;function ar(){return vn||(vn=1,se=TypeError),se}var le,gn;function $o(){return gn||(gn=1,le=Object.getOwnPropertyDescriptor),le}var ce,hn;function qr(){if(hn)return ce;hn=1;var r=$o();if(r)try{r([],"length")}catch{r=null}return ce=r,ce}var pe,dn;function Ht(){if(dn)return pe;dn=1;var r=zr(),e=Ut(),n=ar(),a=qr();return pe=function(f,i,o){if(!f||typeof f!="object"&&typeof f!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,y=!!a&&a(f,i);if(r)r(f,i,{configurable:v===null&&y?y.configurable:!v,enumerable:u===null&&y?y.enumerable:!u,value:o,writable:c===null&&y?y.writable:!c});else if(p||!u&&!c&&!v)f[i]=o;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},pe}var ye,mn;function Gt(){if(mn)return ye;mn=1;var r=zr(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},ye=e,ye}var ve,Sn;function Pr(){if(Sn)return ve;Sn=1;var r=Lt(),e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",n=Object.prototype.toString,a=Array.prototype.concat,t=Ht(),f=function(c){return typeof c=="function"&&n.call(c)==="[object Function]"},i=Gt()(),o=function(c,v,p,y){if(v in c){if(y===!0){if(c[v]===p)return}else if(!f(y)||!y())return}i?t(c,v,p,!0):t(c,v,p)},u=function(c,v){var p=arguments.length>2?arguments[2]:{},y=r(v);e&&(y=a.call(y,Object.getOwnPropertySymbols(v)));for(var h=0;h<y.length;h+=1)o(c,y[h],v[y[h]],p[y[h]])};return u.supportsDescriptors=!!i,ve=u,ve}var ge={exports:{}},he,bn;function zt(){return bn||(bn=1,he=Object),he}var de,An;function Qa(){return An||(An=1,de=Error),de}var me,On;function xo(){return On||(On=1,me=EvalError),me}var Se,wn;function Eo(){return wn||(wn=1,Se=RangeError),Se}var be,qn;function Bo(){return qn||(qn=1,be=ReferenceError),be}var Ae,Pn;function jo(){return Pn||(Pn=1,Ae=URIError),Ae}var Oe,In;function Mo(){return In||(In=1,Oe=Math.abs),Oe}var we,Rn;function To(){return Rn||(Rn=1,we=Math.floor),we}var qe,$n;function Co(){return $n||($n=1,qe=Math.max),qe}var Pe,xn;function Do(){return xn||(xn=1,Pe=Math.min),Pe}var Ie,En;function Fo(){return En||(En=1,Ie=Math.pow),Ie}var Re,Bn;function _o(){return Bn||(Bn=1,Re=Math.round),Re}var $e,jn;function No(){return jn||(jn=1,$e=Number.isNaN||function(e){return e!==e}),$e}var xe,Mn;function Wo(){if(Mn)return xe;Mn=1;var r=No();return xe=function(n){return r(n)||n===0?n:n<0?-1:1},xe}var Ee,Tn;function Vr(){return Tn||(Tn=1,Ee=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),a=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var t=42;e[n]=t;for(var f in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,n);if(o.value!==t||o.enumerable!==!0)return!1}return!0}),Ee}var Be,Cn;function Vt(){if(Cn)return Be;Cn=1;var r=typeof Symbol<"u"&&Symbol,e=Vr();return Be=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Be}var je,Dn;function Za(){return Dn||(Dn=1,je=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),je}var Me,Fn;function ro(){if(Fn)return Me;Fn=1;var r=zt();return Me=r.getPrototypeOf||null,Me}var Te,_n;function ko(){if(_n)return Te;_n=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,a="[object Function]",t=function(u,c){for(var v=[],p=0;p<u.length;p+=1)v[p]=u[p];for(var y=0;y<c.length;y+=1)v[y+u.length]=c[y];return v},f=function(u,c){for(var v=[],p=c,y=0;p<u.length;p+=1,y+=1)v[y]=u[p];return v},i=function(o,u){for(var c="",v=0;v<o.length;v+=1)c+=o[v],v+1<o.length&&(c+=u);return c};return Te=function(u){var c=this;if(typeof c!="function"||e.apply(c)!==a)throw new TypeError(r+c);for(var v=f(arguments,1),p,y=function(){if(this instanceof p){var q=c.apply(this,t(v,arguments));return Object(q)===q?q:this}return c.apply(u,t(v,arguments))},h=n(0,c.length-v.length),S=[],R=0;R<h;R++)S[R]="$"+R;if(p=Function("binder","return function ("+i(S,",")+"){ return binder.apply(this,arguments); }")(y),c.prototype){var w=function(){};w.prototype=c.prototype,p.prototype=new w,w.prototype=null}return p},Te}var Ce,Nn;function Fr(){if(Nn)return Ce;Nn=1;var r=ko();return Ce=Function.prototype.bind||r,Ce}var De,Wn;function Kt(){return Wn||(Wn=1,De=Function.prototype.call),De}var Fe,kn;function Jt(){return kn||(kn=1,Fe=Function.prototype.apply),Fe}var _e,Ln;function Lo(){return Ln||(Ln=1,_e=typeof Reflect<"u"&&Reflect&&Reflect.apply),_e}var Ne,Un;function eo(){if(Un)return Ne;Un=1;var r=Fr(),e=Jt(),n=Kt(),a=Lo();return Ne=a||r.call(n,e),Ne}var We,Hn;function Yt(){if(Hn)return We;Hn=1;var r=Fr(),e=ar(),n=Kt(),a=eo();return We=function(f){if(f.length<1||typeof f[0]!="function")throw new e("a function is required");return a(r,n,f)},We}var ke,Gn;function Uo(){if(Gn)return ke;Gn=1;var r=Yt(),e=qr(),n;try{n=[].__proto__===Array.prototype}catch(i){if(!i||typeof i!="object"||!("code"in i)||i.code!=="ERR_PROTO_ACCESS")throw i}var a=!!n&&e&&e(Object.prototype,"__proto__"),t=Object,f=t.getPrototypeOf;return ke=a&&typeof a.get=="function"?r([a.get]):typeof f=="function"?function(o){return f(o==null?o:t(o))}:!1,ke}var Le,zn;function Xt(){if(zn)return Le;zn=1;var r=Za(),e=ro(),n=Uo();return Le=r?function(t){return r(t)}:e?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return e(t)}:n?function(t){return n(t)}:null,Le}var Ue,Vn;function Qt(){if(Vn)return Ue;Vn=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=Fr();return Ue=n.call(r,e),Ue}var He,Kn;function vr(){if(Kn)return He;Kn=1;var r,e=zt(),n=Qa(),a=xo(),t=Eo(),f=Bo(),i=Ut(),o=ar(),u=jo(),c=Mo(),v=To(),p=Co(),y=Do(),h=Fo(),S=_o(),R=Wo(),w=Function,q=function(T){try{return w('"use strict"; return ('+T+").constructor;")()}catch{}},O=qr(),m=zr(),j=function(){throw new o},Q=O?(function(){try{return arguments.callee,j}catch{try{return O(arguments,"callee").get}catch{return j}}})():j,H=Vt()(),F=Xt(),D=ro(),P=Za(),_=Jt(),L=Kt(),N={},U=typeof Uint8Array>"u"||!F?r:F(Uint8Array),V={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":H&&F?F([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":H&&F?F(F([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!H||!F?r:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":O,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":t,"%ReferenceError%":f,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!H||!F?r:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":H&&F?F(""[Symbol.iterator]()):r,"%Symbol%":H?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":Q,"%TypedArray%":U,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":_,"%Object.defineProperty%":m,"%Object.getPrototypeOf%":D,"%Math.abs%":c,"%Math.floor%":v,"%Math.max%":p,"%Math.min%":y,"%Math.pow%":h,"%Math.round%":S,"%Math.sign%":R,"%Reflect.getPrototypeOf%":P};if(F)try{null.error}catch(T){var sr=F(F(T));V["%Error.prototype%"]=sr}var Rr=function T(A){var I;if(A==="%AsyncFunction%")I=q("async function () {}");else if(A==="%GeneratorFunction%")I=q("function* () {}");else if(A==="%AsyncGeneratorFunction%")I=q("async function* () {}");else if(A==="%AsyncGenerator%"){var b=T("%AsyncGeneratorFunction%");b&&(I=b.prototype)}else if(A==="%AsyncIteratorPrototype%"){var E=T("%AsyncGenerator%");E&&F&&(I=F(E.prototype))}return V[A]=I,I},br={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},or=Fr(),G=Qt(),Ar=or.call(L,Array.prototype.concat),$r=or.call(_,Array.prototype.splice),Or=or.call(L,String.prototype.replace),gr=or.call(L,String.prototype.slice),g=or.call(L,RegExp.prototype.exec),d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,x=/\\(\\)?/g,$=function(A){var I=gr(A,0,1),b=gr(A,-1);if(I==="%"&&b!=="%")throw new i("invalid intrinsic syntax, expected closing `%`");if(b==="%"&&I!=="%")throw new i("invalid intrinsic syntax, expected opening `%`");var E=[];return Or(A,d,function(z,K,J,X){E[E.length]=J?Or(X,x,"$1"):K||z}),E},M=function(A,I){var b=A,E;if(G(br,b)&&(E=br[b],b="%"+E[0]+"%"),G(V,b)){var z=V[b];if(z===N&&(z=Rr(b)),typeof z>"u"&&!I)throw new o("intrinsic "+A+" exists, but is not available. Please file an issue!");return{alias:E,name:b,value:z}}throw new i("intrinsic "+A+" does not exist!")};return He=function(A,I){if(typeof A!="string"||A.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof I!="boolean")throw new o('"allowMissing" argument must be a boolean');if(g(/^%?[^%]*%?$/,A)===null)throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var b=$(A),E=b.length>0?b[0]:"",z=M("%"+E+"%",I),K=z.name,J=z.value,X=!1,rr=z.alias;rr&&(E=rr[0],$r(b,Ar([0,1],rr)));for(var lr=1,ir=!0;lr<b.length;lr+=1){var er=b[lr],cr=gr(er,0,1),pr=gr(er,-1);if((cr==='"'||cr==="'"||cr==="`"||pr==='"'||pr==="'"||pr==="`")&&cr!==pr)throw new i("property names with quotes must have matching quotes");if((er==="constructor"||!ir)&&(X=!0),E+="."+er,K="%"+E+"%",G(V,K))J=V[K];else if(J!=null){if(!(er in J)){if(!I)throw new o("base intrinsic for "+A+" exists, but the property is not available.");return}if(O&&lr+1>=b.length){var yr=O(J,er);ir=!!yr,ir&&"get"in yr&&!("originalValue"in yr.get)?J=yr.get:J=J[er]}else ir=G(J,er),J=J[er];ir&&!X&&(V[K]=J)}}return J},He}var Ge,Jn;function Ho(){if(Jn)return Ge;Jn=1;var r=vr(),e=Ht(),n=Gt()(),a=qr(),t=ar(),f=r("%Math.floor%");return Ge=function(o,u){if(typeof o!="function")throw new t("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||f(u)!==u)throw new t("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],v=!0,p=!0;if("length"in o&&a){var y=a(o,"length");y&&!y.configurable&&(v=!1),y&&!y.writable&&(p=!1)}return(v||p||!c)&&(n?e(o,"length",u,!0,!0):e(o,"length",u)),o},Ge}var ze,Yn;function Go(){if(Yn)return ze;Yn=1;var r=Fr(),e=Jt(),n=eo();return ze=function(){return n(r,e,arguments)},ze}var Xn;function jr(){return Xn||(Xn=1,(function(r){var e=Ho(),n=zr(),a=Yt(),t=Go();r.exports=function(i){var o=a(arguments),u=i.length-(arguments.length-1);return e(o,1+(u>0?u:0),!0)},n?n(r.exports,"apply",{value:t}):r.exports.apply=t})(ge)),ge.exports}var Ve,Qn;function Z(){if(Qn)return Ve;Qn=1;var r=vr(),e=Yt(),n=e([r("%String.prototype.indexOf%")]);return Ve=function(t,f){var i=r(t,!!f);return typeof i=="function"&&n(t,".prototype.")>-1?e([i]):i},Ve}var Ke,Zn;function to(){if(Zn)return Ke;Zn=1;var r=Lt(),e=Vr()(),n=Z(),a=zt(),t=n("Array.prototype.push"),f=n("Object.prototype.propertyIsEnumerable"),i=e?a.getOwnPropertySymbols:null;return Ke=function(u,c){if(u==null)throw new TypeError("target must be an object");var v=a(u);if(arguments.length===1)return v;for(var p=1;p<arguments.length;++p){var y=a(arguments[p]),h=r(y),S=e&&(a.getOwnPropertySymbols||i);if(S)for(var R=S(y),w=0;w<R.length;++w){var q=R[w];f(y,q)&&t(h,q)}for(var O=0;O<h.length;++O){var m=h[O];if(f(y,m)){var j=y[m];v[m]=j}}}return v},Ke}var Je,ra;function no(){if(ra)return Je;ra=1;var r=to(),e=function(){if(!Object.assign)return!1;for(var a="abcdefghijklmnopqrst",t=a.split(""),f={},i=0;i<t.length;++i)f[t[i]]=t[i];var o=Object.assign({},f),u="";for(var c in o)u+=c;return a!==u},n=function(){if(!Object.assign||!Object.preventExtensions)return!1;var a=Object.preventExtensions({1:2});try{Object.assign(a,"xy")}catch{return a[1]==="y"}return!1};return Je=function(){return!Object.assign||e()||n()?r:Object.assign},Je}var Ye,ea;function zo(){if(ea)return Ye;ea=1;var r=Pr(),e=no();return Ye=function(){var a=e();return r(Object,{assign:a},{assign:function(){return Object.assign!==a}}),a},Ye}var Xe,ta;function Vo(){if(ta)return Xe;ta=1;var r=Pr(),e=jr(),n=to(),a=no(),t=zo(),f=e.apply(a()),i=function(u,c){return f(Object,arguments)};return r(i,{getPolyfill:a,implementation:n,shim:t}),Xe=i,Xe}var Qe,na;function ao(){if(na)return Qe;na=1;var r=vr(),e=jr(),n=e(r("String.prototype.indexOf"));return Qe=function(t,f){var i=r(t,!!f);return typeof i=="function"&&n(t,".prototype.")>-1?e(i):i},Qe}var Ze,aa;function Ko(){if(aa)return Ze;aa=1;var r=function(){return typeof(function(){}).name=="string"},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch{e=null}r.functionsHaveConfigurableNames=function(){if(!r()||!e)return!1;var t=e(function(){},"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;return r.boundFunctionsHaveNames=function(){return r()&&typeof n=="function"&&(function(){}).bind().name!==""},Ze=r,Ze}var rt,oa;function Jo(){if(oa)return rt;oa=1;var r=Ht(),e=Gt()(),n=Ko().functionsHaveConfigurableNames(),a=ar();return rt=function(f,i){if(typeof f!="function")throw new a("`fn` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||n)&&(e?r(f,"name",i,!0,!0):r(f,"name",i)),f},rt}var et,ia;function oo(){if(ia)return et;ia=1;var r=Jo(),e=ar(),n=Object;return et=r(function(){if(this==null||this!==n(this))throw new e("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0),et}var tt,ua;function io(){if(ua)return tt;ua=1;var r=oo(),e=Pr().supportsDescriptors,n=Object.getOwnPropertyDescriptor;return tt=function(){if(e&&/a/mig.flags==="gim"){var t=n(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var f="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){f+="d"}}),Object.defineProperty(i,"sticky",{get:function(){f+="y"}}),t.get.call(i),f==="dy")return t.get}}return r},tt}var nt,fa;function Yo(){if(fa)return nt;fa=1;var r=Pr().supportsDescriptors,e=io(),n=qr(),a=Object.defineProperty,t=Qa(),f=Xt(),i=/a/;return nt=function(){if(!r||!f)throw new t("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=e(),c=f(i),v=n(c,"flags");return(!v||v.get!==u)&&a(c,"flags",{configurable:!0,enumerable:!1,get:u}),u},nt}var at,sa;function Xo(){if(sa)return at;sa=1;var r=Pr(),e=jr(),n=oo(),a=io(),t=Yo(),f=e(a());return r(f,{getPolyfill:a,implementation:n,shim:t}),at=f,at}var Cr={exports:{}},ot,la;function Ir(){if(la)return ot;la=1;var r=Vr();return ot=function(){return r()&&!!Symbol.toStringTag},ot}var it,ca;function uo(){if(ca)return it;ca=1;var r=Ir()(),e=Z(),n=e("Object.prototype.toString"),a=function(o){return r&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:n(o)==="[object Arguments]"},t=function(o){return a(o)?!0:o!==null&&typeof o=="object"&&"length"in o&&typeof o.length=="number"&&o.length>=0&&n(o)!=="[object Array]"&&"callee"in o&&n(o.callee)==="[object Function]"},f=(function(){return a(arguments)})();return a.isLegacyArguments=t,it=f?a:t,it}const Qo={},Zo=Object.freeze(Object.defineProperty({__proto__:null,default:Qo},Symbol.toStringTag,{value:"Module"})),ri=Io(Zo);var ut,pa;function Kr(){if(pa)return ut;pa=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=r&&e&&typeof e.get=="function"?e.get:null,a=r&&Map.prototype.forEach,t=typeof Set=="function"&&Set.prototype,f=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,i=t&&f&&typeof f.get=="function"?f.get:null,o=t&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,c=u?WeakMap.prototype.has:null,v=typeof WeakSet=="function"&&WeakSet.prototype,p=v?WeakSet.prototype.has:null,y=typeof WeakRef=="function"&&WeakRef.prototype,h=y?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,R=Object.prototype.toString,w=Function.prototype.toString,q=String.prototype.match,O=String.prototype.slice,m=String.prototype.replace,j=String.prototype.toUpperCase,Q=String.prototype.toLowerCase,H=RegExp.prototype.test,F=Array.prototype.concat,D=Array.prototype.join,P=Array.prototype.slice,_=Math.floor,L=typeof BigInt=="function"?BigInt.prototype.valueOf:null,N=Object.getOwnPropertySymbols,U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,V=typeof Symbol=="function"&&typeof Symbol.iterator=="object",sr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===V||!0)?Symbol.toStringTag:null,Rr=Object.prototype.propertyIsEnumerable,br=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(s){return s.__proto__}:null);function or(s,l){if(s===1/0||s===-1/0||s!==s||s&&s>-1e3&&s<1e3||H.call(/e/,l))return l;var C=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof s=="number"){var W=s<0?-_(-s):_(s);if(W!==s){var k=String(W),B=O.call(l,k.length+1);return m.call(k,C,"$&_")+"."+m.call(m.call(B,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(l,C,"$&_")}var G=ri,Ar=G.custom,$r=z(Ar)?Ar:null,Or={__proto__:null,double:'"',single:"'"},gr={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ut=function s(l,C,W,k){var B=C||{};if(X(B,"quoteStyle")&&!X(Or,B.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(X(B,"maxStringLength")&&(typeof B.maxStringLength=="number"?B.maxStringLength<0&&B.maxStringLength!==1/0:B.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var mr=X(B,"customInspect")?B.customInspect:!0;if(typeof mr!="boolean"&&mr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(X(B,"indent")&&B.indent!==null&&B.indent!==" "&&!(parseInt(B.indent,10)===B.indent&&B.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(X(B,"numericSeparator")&&typeof B.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var wr=B.numericSeparator;if(typeof l>"u")return"undefined";if(l===null)return"null";if(typeof l=="boolean")return l?"true":"false";if(typeof l=="string")return xr(l,B);if(typeof l=="number"){if(l===0)return 1/0/l>0?"0":"-0";var nr=String(l);return wr?or(l,nr):nr}if(typeof l=="bigint"){var Sr=String(l)+"n";return wr?or(l,Sr):Sr}var Xr=typeof B.depth>"u"?5:B.depth;if(typeof W>"u"&&(W=0),W>=Xr&&Xr>0&&typeof l=="object")return $(l)?"[Array]":"[Object]";var Er=Ao(B,W);if(typeof k>"u")k=[];else if(ir(k,l)>=0)return"[Circular]";function ur(Br,kr,wo){if(kr&&(k=P.call(k),k.push(kr)),wo){var fn={depth:B.depth};return X(B,"quoteStyle")&&(fn.quoteStyle=B.quoteStyle),s(Br,fn,W+1,k)}return s(Br,B,W+1,k)}if(typeof l=="function"&&!T(l)){var rn=lr(l),en=Nr(l,ur);return"[Function"+(rn?": "+rn:" (anonymous)")+"]"+(en.length>0?" { "+D.call(en,", ")+" }":"")}if(z(l)){var tn=V?m.call(String(l),/^(Symbol\(.*\))_[^)]*$/,"$1"):U.call(l);return typeof l=="object"&&!V?dr(tn):tn}if(hr(l)){for(var Tr="<"+Q.call(String(l.nodeName)),Qr=l.attributes||[],Wr=0;Wr<Qr.length;Wr++)Tr+=" "+Qr[Wr].name+"="+g(d(Qr[Wr].value),"double",B);return Tr+=">",l.childNodes&&l.childNodes.length&&(Tr+="..."),Tr+="</"+Q.call(String(l.nodeName))+">",Tr}if($(l)){if(l.length===0)return"[]";var Zr=Nr(l,ur);return Er&&!bo(Zr)?"["+Yr(Zr,Er)+"]":"[ "+D.call(Zr,", ")+" ]"}if(A(l)){var re=Nr(l,ur);return!("cause"in Error.prototype)&&"cause"in l&&!Rr.call(l,"cause")?"{ ["+String(l)+"] "+D.call(F.call("[cause]: "+ur(l.cause),re),", ")+" }":re.length===0?"["+String(l)+"]":"{ ["+String(l)+"] "+D.call(re,", ")+" }"}if(typeof l=="object"&&mr){if($r&&typeof l[$r]=="function"&&G)return G(l,{depth:Xr-W});if(mr!=="symbol"&&typeof l.inspect=="function")return l.inspect()}if(er(l)){var nn=[];return a&&a.call(l,function(Br,kr){nn.push(ur(kr,l,!0)+" => "+ur(Br,l))}),Zt("Map",n.call(l),nn,Er)}if(yr(l)){var an=[];return o&&o.call(l,function(Br){an.push(ur(Br,l))}),Zt("Set",i.call(l),an,Er)}if(cr(l))return Jr("WeakMap");if(_r(l))return Jr("WeakSet");if(pr(l))return Jr("WeakRef");if(b(l))return dr(ur(Number(l)));if(K(l))return dr(ur(L.call(l)));if(E(l))return dr(S.call(l));if(I(l))return dr(ur(String(l)));if(typeof window<"u"&&l===window)return"{ [object Window] }";if(typeof globalThis<"u"&&l===globalThis||typeof Gr<"u"&&l===Gr)return"{ [object globalThis] }";if(!M(l)&&!T(l)){var ee=Nr(l,ur),on=br?br(l)===Object.prototype:l instanceof Object||l.constructor===Object,te=l instanceof Object?"":"null prototype",un=!on&&sr&&Object(l)===l&&sr in l?O.call(rr(l),8,-1):te?"Object":"",Oo=on||typeof l.constructor!="function"?"":l.constructor.name?l.constructor.name+" ":"",ne=Oo+(un||te?"["+D.call(F.call([],un||[],te||[]),": ")+"] ":"");return ee.length===0?ne+"{}":Er?ne+"{"+Yr(ee,Er)+"}":ne+"{ "+D.call(ee,", ")+" }"}return String(l)};function g(s,l,C){var W=C.quoteStyle||l,k=Or[W];return k+s+k}function d(s){return m.call(String(s),/"/g,""")}function x(s){return!sr||!(typeof s=="object"&&(sr in s||typeof s[sr]<"u"))}function $(s){return rr(s)==="[object Array]"&&x(s)}function M(s){return rr(s)==="[object Date]"&&x(s)}function T(s){return rr(s)==="[object RegExp]"&&x(s)}function A(s){return rr(s)==="[object Error]"&&x(s)}function I(s){return rr(s)==="[object String]"&&x(s)}function b(s){return rr(s)==="[object Number]"&&x(s)}function E(s){return rr(s)==="[object Boolean]"&&x(s)}function z(s){if(V)return s&&typeof s=="object"&&s instanceof Symbol;if(typeof s=="symbol")return!0;if(!s||typeof s!="object"||!U)return!1;try{return U.call(s),!0}catch{}return!1}function K(s){if(!s||typeof s!="object"||!L)return!1;try{return L.call(s),!0}catch{}return!1}var J=Object.prototype.hasOwnProperty||function(s){return s in this};function X(s,l){return J.call(s,l)}function rr(s){return R.call(s)}function lr(s){if(s.name)return s.name;var l=q.call(w.call(s),/^function\s*([\w$]+)/);return l?l[1]:null}function ir(s,l){if(s.indexOf)return s.indexOf(l);for(var C=0,W=s.length;C<W;C++)if(s[C]===l)return C;return-1}function er(s){if(!n||!s||typeof s!="object")return!1;try{n.call(s);try{i.call(s)}catch{return!0}return s instanceof Map}catch{}return!1}function cr(s){if(!c||!s||typeof s!="object")return!1;try{c.call(s,c);try{p.call(s,p)}catch{return!0}return s instanceof WeakMap}catch{}return!1}function pr(s){if(!h||!s||typeof s!="object")return!1;try{return h.call(s),!0}catch{}return!1}function yr(s){if(!i||!s||typeof s!="object")return!1;try{i.call(s);try{n.call(s)}catch{return!0}return s instanceof Set}catch{}return!1}function _r(s){if(!p||!s||typeof s!="object")return!1;try{p.call(s,p);try{c.call(s,c)}catch{return!0}return s instanceof WeakSet}catch{}return!1}function hr(s){return!s||typeof s!="object"?!1:typeof HTMLElement<"u"&&s instanceof HTMLElement?!0:typeof s.nodeName=="string"&&typeof s.getAttribute=="function"}function xr(s,l){if(s.length>l.maxStringLength){var C=s.length-l.maxStringLength,W="... "+C+" more character"+(C>1?"s":"");return xr(O.call(s,0,l.maxStringLength),l)+W}var k=gr[l.quoteStyle||"single"];k.lastIndex=0;var B=m.call(m.call(s,k,"\\$1"),/[\x00-\x1f]/g,Mr);return g(B,"single",l)}function Mr(s){var l=s.charCodeAt(0),C={8:"b",9:"t",10:"n",12:"f",13:"r"}[l];return C?"\\"+C:"\\x"+(l<16?"0":"")+j.call(l.toString(16))}function dr(s){return"Object("+s+")"}function Jr(s){return s+" { ? }"}function Zt(s,l,C,W){var k=W?Yr(C,W):D.call(C,", ");return s+" ("+l+") {"+k+"}"}function bo(s){for(var l=0;l<s.length;l++)if(ir(s[l],`
|
|
2
|
-
`)>=0)return!1;return!0}function Ao(s,l){var C;if(s.indent===" ")C=" ";else if(typeof s.indent=="number"&&s.indent>0)C=D.call(Array(s.indent+1)," ");else return null;return{base:C,prev:D.call(Array(l+1),C)}}function Yr(s,l){if(s.length===0)return"";var C=`
|
|
3
|
-
`+l.prev+l.base;return C+D.call(s,","+C)+`
|
|
4
|
-
`+l.prev}function Nr(s,l){var C=$(s),W=[];if(C){W.length=s.length;for(var k=0;k<s.length;k++)W[k]=X(s,k)?l(s[k],s):""}var B=typeof N=="function"?N(s):[],mr;if(V){mr={};for(var wr=0;wr<B.length;wr++)mr["$"+B[wr]]=B[wr]}for(var nr in s)X(s,nr)&&(C&&String(Number(nr))===nr&&nr<s.length||V&&mr["$"+nr]instanceof Symbol||(H.call(/[^\w$]/,nr)?W.push(l(nr,s)+": "+l(s[nr],s)):W.push(nr+": "+l(s[nr],s))));if(typeof N=="function")for(var Sr=0;Sr<B.length;Sr++)Rr.call(s,B[Sr])&&W.push("["+l(B[Sr])+"]: "+l(s[B[Sr]],s));return W}return ut}var ft,ya;function ei(){if(ya)return ft;ya=1;var r=Kr(),e=ar(),n=function(o,u,c){for(var v=o,p;(p=v.next)!=null;v=p)if(p.key===u)return v.next=p.next,c||(p.next=o.next,o.next=p),p},a=function(o,u){if(o){var c=n(o,u);return c&&c.value}},t=function(o,u,c){var v=n(o,u);v?v.value=c:o.next={key:u,next:o.next,value:c}},f=function(o,u){return o?!!n(o,u):!1},i=function(o,u){if(o)return n(o,u,!0)};return ft=function(){var u,c={assert:function(v){if(!c.has(v))throw new e("Side channel does not contain "+r(v))},delete:function(v){var p=u&&u.next,y=i(u,v);return y&&p&&p===y&&(u=void 0),!!y},get:function(v){return a(u,v)},has:function(v){return f(u,v)},set:function(v,p){u||(u={next:void 0}),t(u,v,p)}};return c},ft}var st,va;function fo(){if(va)return st;va=1;var r=vr(),e=Z(),n=Kr(),a=ar(),t=r("%Map%",!0),f=e("Map.prototype.get",!0),i=e("Map.prototype.set",!0),o=e("Map.prototype.has",!0),u=e("Map.prototype.delete",!0),c=e("Map.prototype.size",!0);return st=!!t&&function(){var p,y={assert:function(h){if(!y.has(h))throw new a("Side channel does not contain "+n(h))},delete:function(h){if(p){var S=u(p,h);return c(p)===0&&(p=void 0),S}return!1},get:function(h){if(p)return f(p,h)},has:function(h){return p?o(p,h):!1},set:function(h,S){p||(p=new t),i(p,h,S)}};return y},st}var lt,ga;function ti(){if(ga)return lt;ga=1;var r=vr(),e=Z(),n=Kr(),a=fo(),t=ar(),f=r("%WeakMap%",!0),i=e("WeakMap.prototype.get",!0),o=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),c=e("WeakMap.prototype.delete",!0);return lt=f?function(){var p,y,h={assert:function(S){if(!h.has(S))throw new t("Side channel does not contain "+n(S))},delete:function(S){if(f&&S&&(typeof S=="object"||typeof S=="function")){if(p)return c(p,S)}else if(a&&y)return y.delete(S);return!1},get:function(S){return f&&S&&(typeof S=="object"||typeof S=="function")&&p?i(p,S):y&&y.get(S)},has:function(S){return f&&S&&(typeof S=="object"||typeof S=="function")&&p?u(p,S):!!y&&y.has(S)},set:function(S,R){f&&S&&(typeof S=="object"||typeof S=="function")?(p||(p=new f),o(p,S,R)):a&&(y||(y=a()),y.set(S,R))}};return h}:a,lt}var ct,ha;function so(){if(ha)return ct;ha=1;var r=ar(),e=Kr(),n=ei(),a=fo(),t=ti(),f=t||a||n;return ct=function(){var o,u={assert:function(c){if(!u.has(c))throw new r("Side channel does not contain "+e(c))},delete:function(c){return!!o&&o.delete(c)},get:function(c){return o&&o.get(c)},has:function(c){return!!o&&o.has(c)},set:function(c,v){o||(o=f()),o.set(c,v)}};return u},ct}var pt,da;function ni(){if(da)return pt;da=1;var r=Qt(),e=so()(),n=ar(),a={assert:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");if(e.assert(t),!a.has(t,f))throw new n("`"+f+"` is not present on `O`")},get:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var i=e.get(t);return i&&i["$"+f]},has:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var i=e.get(t);return!!i&&r(i,"$"+f)},set:function(t,f,i){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var o=e.get(t);o||(o={},e.set(t,o)),o["$"+f]=i}};return Object.freeze&&Object.freeze(a),pt=a,pt}var yt,ma;function ai(){if(ma)return yt;ma=1;var r=ni(),e=Ut(),n=typeof StopIteration=="object"?StopIteration:null;return yt=function(t){if(!n)throw new e("this environment lacks StopIteration");r.set(t,"[[Done]]",!1);var f={next:function(){var o=r.get(this,"[[Iterator]]"),u=!!r.get(o,"[[Done]]");try{return{done:u,value:u?void 0:o.next()}}catch(c){if(r.set(o,"[[Done]]",!0),c!==n)throw c;return{done:!0,value:void 0}}}};return r.set(f,"[[Iterator]]",t),f},yt}var vt,Sa;function lo(){if(Sa)return vt;Sa=1;var r={}.toString;return vt=Array.isArray||function(e){return r.call(e)=="[object Array]"},vt}var gt,ba;function co(){if(ba)return gt;ba=1;var r=Z(),e=r("String.prototype.valueOf"),n=function(o){try{return e(o),!0}catch{return!1}},a=r("Object.prototype.toString"),t="[object String]",f=Ir()();return gt=function(o){return typeof o=="string"?!0:!o||typeof o!="object"?!1:f?n(o):a(o)===t},gt}var ht,Aa;function po(){if(Aa)return ht;Aa=1;var r=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;r||(n=function(i){return!1});var a=r?Map.prototype.has:null,t=e?Set.prototype.has:null;return!n&&!a&&(n=function(i){return!1}),ht=n||function(i){if(!i||typeof i!="object")return!1;try{if(a.call(i),t)try{t.call(i)}catch{return!0}return i instanceof r}catch{}return!1},ht}var dt,Oa;function yo(){if(Oa)return dt;Oa=1;var r=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;e||(n=function(i){return!1});var a=r?Map.prototype.has:null,t=e?Set.prototype.has:null;return!n&&!t&&(n=function(i){return!1}),dt=n||function(i){if(!i||typeof i!="object")return!1;try{if(t.call(i),a)try{a.call(i)}catch{return!0}return i instanceof e}catch{}return!1},dt}var wa;function oi(){if(wa)return Cr.exports;wa=1;var r=uo(),e=ai();if(Vt()()||Vr()()){var n=Symbol.iterator;Cr.exports=function(P){if(P!=null&&typeof P[n]<"u")return P[n]();if(r(P))return Array.prototype[n].call(P)}}else{var a=lo(),t=co(),f=vr(),i=f("%Map%",!0),o=f("%Set%",!0),u=ao(),c=u("Array.prototype.push"),v=u("String.prototype.charCodeAt"),p=u("String.prototype.slice"),y=function(P,_){var L=P.length;if(_+1>=L)return _+1;var N=v(P,_);if(N<55296||N>56319)return _+1;var U=v(P,_+1);return U<56320||U>57343?_+1:_+2},h=function(P){var _=0;return{next:function(){var N=_>=P.length,U;return N||(U=P[_],_+=1),{done:N,value:U}}}},S=function(P,_){if(a(P)||r(P))return h(P);if(t(P)){var L=0;return{next:function(){var U=y(P,L),V=p(P,L,U);return L=U,{done:U>P.length,value:V}}}}if(_&&typeof P["_es6-shim iterator_"]<"u")return P["_es6-shim iterator_"]()};if(!i&&!o)Cr.exports=function(P){if(P!=null)return S(P,!0)};else{var R=po(),w=yo(),q=u("Map.prototype.forEach",!0),O=u("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var m=u("Map.prototype.iterator",!0),j=u("Set.prototype.iterator",!0);var Q=u("Map.prototype.@@iterator",!0)||u("Map.prototype._es6-shim iterator_",!0),H=u("Set.prototype.@@iterator",!0)||u("Set.prototype._es6-shim iterator_",!0),F=function(P){if(R(P)){if(m)return e(m(P));if(Q)return Q(P);if(q){var _=[];return q(P,function(N,U){c(_,[U,N])}),h(_)}}if(w(P)){if(j)return e(j(P));if(H)return H(P);if(O){var L=[];return O(P,function(N){c(L,N)}),h(L)}}};Cr.exports=function(P){return F(P)||S(P)}}}return Cr.exports}var mt,qa;function vo(){if(qa)return mt;qa=1;var r=function(e){return e!==e};return mt=function(n,a){return n===0&&a===0?1/n===1/a:!!(n===a||r(n)&&r(a))},mt}var St,Pa;function go(){if(Pa)return St;Pa=1;var r=vo();return St=function(){return typeof Object.is=="function"?Object.is:r},St}var bt,Ia;function ii(){if(Ia)return bt;Ia=1;var r=go(),e=Pr();return bt=function(){var a=r();return e(Object,{is:a},{is:function(){return Object.is!==a}}),a},bt}var At,Ra;function ui(){if(Ra)return At;Ra=1;var r=Pr(),e=jr(),n=vo(),a=go(),t=ii(),f=e(a(),Object);return r(f,{getPolyfill:a,implementation:n,shim:t}),At=f,At}var Ot,$a;function ho(){if($a)return Ot;$a=1;var r=jr(),e=Z(),n=vr(),a=n("%ArrayBuffer%",!0),t=e("ArrayBuffer.prototype.byteLength",!0),f=e("Object.prototype.toString"),i=!!a&&!t&&new a(0).slice,o=!!i&&r(i);return Ot=t||o?function(c){if(!c||typeof c!="object")return!1;try{return t?t(c):o(c,0),!0}catch{return!1}}:a?function(c){return f(c)==="[object ArrayBuffer]"}:function(c){return!1},Ot}var wt,xa;function fi(){if(xa)return wt;xa=1;var r=Z(),e=r("Date.prototype.getDay"),n=function(o){try{return e(o),!0}catch{return!1}},a=r("Object.prototype.toString"),t="[object Date]",f=Ir()();return wt=function(o){return typeof o!="object"||o===null?!1:f?n(o):a(o)===t},wt}var qt,Ea;function mo(){if(Ea)return qt;Ea=1;var r=Z(),e=Ir()(),n=Qt(),a=qr(),t;if(e){var f=r("RegExp.prototype.exec"),i={},o=function(){throw i},u={toString:o,valueOf:o};typeof Symbol.toPrimitive=="symbol"&&(u[Symbol.toPrimitive]=o),t=function(y){if(!y||typeof y!="object")return!1;var h=a(y,"lastIndex"),S=h&&n(h,"value");if(!S)return!1;try{f(y,u)}catch(R){return R===i}}}else{var c=r("Object.prototype.toString"),v="[object RegExp]";t=function(y){return!y||typeof y!="object"&&typeof y!="function"?!1:c(y)===v}}return qt=t,qt}var Pt,Ba;function si(){if(Ba)return Pt;Ba=1;var r=Z(),e=r("SharedArrayBuffer.prototype.byteLength",!0);return Pt=e?function(a){if(!a||typeof a!="object")return!1;try{return e(a),!0}catch{return!1}}:function(a){return!1},Pt}var It,ja;function li(){if(ja)return It;ja=1;var r=Z(),e=r("Number.prototype.toString"),n=function(o){try{return e(o),!0}catch{return!1}},a=r("Object.prototype.toString"),t="[object Number]",f=Ir()();return It=function(o){return typeof o=="number"?!0:!o||typeof o!="object"?!1:f?n(o):a(o)===t},It}var Rt,Ma;function ci(){if(Ma)return Rt;Ma=1;var r=Z(),e=r("Boolean.prototype.toString"),n=r("Object.prototype.toString"),a=function(o){try{return e(o),!0}catch{return!1}},t="[object Boolean]",f=Ir()();return Rt=function(o){return typeof o=="boolean"?!0:o===null||typeof o!="object"?!1:f?a(o):n(o)===t},Rt}var Lr={exports:{}},$t,Ta;function pi(){if(Ta)return $t;Ta=1;var r=Z(),e=mo(),n=r("RegExp.prototype.exec"),a=ar();return $t=function(f){if(!e(f))throw new a("`regex` must be a RegExp");return function(o){return n(f,o)!==null}},$t}var Ca;function yi(){if(Ca)return Lr.exports;Ca=1;var r=Z(),e=r("Object.prototype.toString"),n=Vt()(),a=pi();if(n){var t=r("Symbol.prototype.toString"),f=a(/^Symbol\(.*\)$/),i=function(u){return typeof u.valueOf()!="symbol"?!1:f(t(u))};Lr.exports=function(u){if(typeof u=="symbol")return!0;if(!u||typeof u!="object"||e(u)!=="[object Symbol]")return!1;try{return i(u)}catch{return!1}}}else Lr.exports=function(u){return!1};return Lr.exports}var Ur={exports:{}},xt,Da;function vi(){if(Da)return xt;Da=1;var r=typeof BigInt<"u"&&BigInt;return xt=function(){return typeof r=="function"&&typeof BigInt=="function"&&typeof r(42)=="bigint"&&typeof BigInt(42)=="bigint"},xt}var Fa;function gi(){if(Fa)return Ur.exports;Fa=1;var r=vi()();if(r){var e=BigInt.prototype.valueOf,n=function(t){try{return e.call(t),!0}catch{}return!1};Ur.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:n(t)}}else Ur.exports=function(t){return!1};return Ur.exports}var Et,_a;function hi(){if(_a)return Et;_a=1;var r=co(),e=li(),n=ci(),a=yi(),t=gi();return Et=function(i){if(i==null||typeof i!="object"&&typeof i!="function")return null;if(r(i))return"String";if(e(i))return"Number";if(n(i))return"Boolean";if(a(i))return"Symbol";if(t(i))return"BigInt"},Et}var Bt,Na;function di(){if(Na)return Bt;Na=1;var r=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,e=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,n;r||(n=function(i){return!1});var a=r?r.prototype.has:null,t=e?e.prototype.has:null;return!n&&!a&&(n=function(i){return!1}),Bt=n||function(i){if(!i||typeof i!="object")return!1;try{if(a.call(i,a),t)try{t.call(i,t)}catch{return!0}return i instanceof r}catch{}return!1},Bt}var Hr={exports:{}},Wa;function mi(){if(Wa)return Hr.exports;Wa=1;var r=vr(),e=Z(),n=r("%WeakSet%",!0),a=e("WeakSet.prototype.has",!0);if(a){var t=e("WeakMap.prototype.has",!0);Hr.exports=function(i){if(!i||typeof i!="object")return!1;try{if(a(i,a),t)try{t(i,t)}catch{return!0}return i instanceof n}catch{}return!1}}else Hr.exports=function(i){return!1};return Hr.exports}var jt,ka;function Si(){if(ka)return jt;ka=1;var r=po(),e=yo(),n=di(),a=mi();return jt=function(f){if(f&&typeof f=="object"){if(r(f))return"Map";if(e(f))return"Set";if(n(f))return"WeakMap";if(a(f))return"WeakSet"}return!1},jt}var Mt,La;function bi(){if(La)return Mt;La=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,a;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw a}}),a={},e(function(){throw 42},null,n)}catch(O){O!==a&&(e=null)}else e=null;var t=/^\s*class\b/,f=function(m){try{var j=r.call(m);return t.test(j)}catch{return!1}},i=function(m){try{return f(m)?!1:(r.call(m),!0)}catch{return!1}},o=Object.prototype.toString,u="[object Object]",c="[object Function]",v="[object GeneratorFunction]",p="[object HTMLAllCollection]",y="[object HTML document.all class]",h="[object HTMLCollection]",S=typeof Symbol=="function"&&!!Symbol.toStringTag,R=!(0 in[,]),w=function(){return!1};if(typeof document=="object"){var q=document.all;o.call(q)===o.call(document.all)&&(w=function(m){if((R||!m)&&(typeof m>"u"||typeof m=="object"))try{var j=o.call(m);return(j===p||j===y||j===h||j===u)&&m("")==null}catch{}return!1})}return Mt=e?function(m){if(w(m))return!0;if(!m||typeof m!="function"&&typeof m!="object")return!1;try{e(m,null,n)}catch(j){if(j!==a)return!1}return!f(m)&&i(m)}:function(m){if(w(m))return!0;if(!m||typeof m!="function"&&typeof m!="object")return!1;if(S)return i(m);if(f(m))return!1;var j=o.call(m);return j!==c&&j!==v&&!/^\[object HTML/.test(j)?!1:i(m)},Mt}var Tt,Ua;function Ai(){if(Ua)return Tt;Ua=1;var r=bi(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,a=function(u,c,v){for(var p=0,y=u.length;p<y;p++)n.call(u,p)&&(v==null?c(u[p],p,u):c.call(v,u[p],p,u))},t=function(u,c,v){for(var p=0,y=u.length;p<y;p++)v==null?c(u.charAt(p),p,u):c.call(v,u.charAt(p),p,u)},f=function(u,c,v){for(var p in u)n.call(u,p)&&(v==null?c(u[p],p,u):c.call(v,u[p],p,u))};function i(o){return e.call(o)==="[object Array]"}return Tt=function(u,c,v){if(!r(c))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=v),i(u)?a(u,c,p):typeof u=="string"?t(u,c,p):f(u,c,p)},Tt}var Ct,Ha;function Oi(){return Ha||(Ha=1,Ct=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Ct}var Dt,Ga;function wi(){if(Ga)return Dt;Ga=1;var r=Oi(),e=typeof globalThis>"u"?Gr:globalThis;return Dt=function(){for(var a=[],t=0;t<r.length;t++)typeof e[r[t]]=="function"&&(a[a.length]=r[t]);return a},Dt}var Ft,za;function qi(){if(za)return Ft;za=1;var r=Ai(),e=wi(),n=jr(),a=Z(),t=qr(),f=Xt(),i=a("Object.prototype.toString"),o=Ir()(),u=typeof globalThis>"u"?Gr:globalThis,c=e(),v=a("String.prototype.slice"),p=a("Array.prototype.indexOf",!0)||function(w,q){for(var O=0;O<w.length;O+=1)if(w[O]===q)return O;return-1},y={__proto__:null};o&&t&&f?r(c,function(R){var w=new u[R];if(Symbol.toStringTag in w&&f){var q=f(w),O=t(q,Symbol.toStringTag);if(!O&&q){var m=f(q);O=t(m,Symbol.toStringTag)}y["$"+R]=n(O.get)}}):r(c,function(R){var w=new u[R],q=w.slice||w.set;q&&(y["$"+R]=n(q))});var h=function(w){var q=!1;return r(y,function(O,m){if(!q)try{"$"+O(w)===m&&(q=v(m,1))}catch{}}),q},S=function(w){var q=!1;return r(y,function(O,m){if(!q)try{O(w),q=v(m,1)}catch{}}),q};return Ft=function(w){if(!w||typeof w!="object")return!1;if(!o){var q=v(i(w),8,-1);return p(c,q)>-1?q:q!=="Object"?!1:S(w)}return t?h(w):null},Ft}var _t,Va;function Pi(){if(Va)return _t;Va=1;var r=Z(),e=r("ArrayBuffer.prototype.byteLength",!0),n=ho();return _t=function(t){return n(t)?e?e(t):t.byteLength:NaN},_t}var Nt,Ka;function Ii(){if(Ka)return Nt;Ka=1;var r=Vo(),e=ao(),n=Xo(),a=vr(),t=oi(),f=so(),i=ui(),o=uo(),u=lo(),c=ho(),v=fi(),p=mo(),y=si(),h=Lt(),S=hi(),R=Si(),w=qi(),q=Pi(),O=e("SharedArrayBuffer.prototype.byteLength",!0),m=e("Date.prototype.getTime"),j=Object.getPrototypeOf,Q=e("Object.prototype.toString"),H=a("%Set%",!0),F=e("Map.prototype.has",!0),D=e("Map.prototype.get",!0),P=e("Map.prototype.size",!0),_=e("Set.prototype.add",!0),L=e("Set.prototype.delete",!0),N=e("Set.prototype.has",!0),U=e("Set.prototype.size",!0);function V(g,d,x,$){for(var M=t(g),T;(T=M.next())&&!T.done;)if(G(d,T.value,x,$))return L(g,T.value),!0;return!1}function sr(g){if(typeof g>"u")return null;if(typeof g!="object")return typeof g=="symbol"?!1:typeof g=="string"||typeof g=="number"?+g==+g:!0}function Rr(g,d,x,$,M,T){var A=sr(x);if(A!=null)return A;var I=D(d,A),b=r({},M,{strict:!1});return typeof I>"u"&&!F(d,A)||!G($,I,b,T)?!1:!F(g,A)&&G($,I,b,T)}function br(g,d,x){var $=sr(x);return $??(N(d,$)&&!N(g,$))}function or(g,d,x,$,M,T){for(var A=t(g),I,b;(I=A.next())&&!I.done;)if(b=I.value,G(x,b,M,T)&&G($,D(d,b),M,T))return L(g,b),!0;return!1}function G(g,d,x,$){var M=x||{};if(M.strict?i(g,d):g===d)return!0;var T=S(g),A=S(d);if(T!==A)return!1;if(!g||!d||typeof g!="object"&&typeof d!="object")return M.strict?i(g,d):g==d;var I=$.has(g),b=$.has(d),E;if(I&&b){if($.get(g)===$.get(d))return!0}else E={};return I||$.set(g,E),b||$.set(d,E),gr(g,d,M,$)}function Ar(g){return!g||typeof g!="object"||typeof g.length!="number"||typeof g.copy!="function"||typeof g.slice!="function"||g.length>0&&typeof g[0]!="number"?!1:!!(g.constructor&&g.constructor.isBuffer&&g.constructor.isBuffer(g))}function $r(g,d,x,$){if(U(g)!==U(d))return!1;for(var M=t(g),T=t(d),A,I,b;(A=M.next())&&!A.done;)if(A.value&&typeof A.value=="object")b||(b=new H),_(b,A.value);else if(!N(d,A.value)){if(x.strict||!br(g,d,A.value))return!1;b||(b=new H),_(b,A.value)}if(b){for(;(I=T.next())&&!I.done;)if(I.value&&typeof I.value=="object"){if(!V(b,I.value,x.strict,$))return!1}else if(!x.strict&&!N(g,I.value)&&!V(b,I.value,x.strict,$))return!1;return U(b)===0}return!0}function Or(g,d,x,$){if(P(g)!==P(d))return!1;for(var M=t(g),T=t(d),A,I,b,E,z,K;(A=M.next())&&!A.done;)if(E=A.value[0],z=A.value[1],E&&typeof E=="object")b||(b=new H),_(b,E);else if(K=D(d,E),typeof K>"u"&&!F(d,E)||!G(z,K,x,$)){if(x.strict||!Rr(g,d,E,z,x,$))return!1;b||(b=new H),_(b,E)}if(b){for(;(I=T.next())&&!I.done;)if(E=I.value[0],K=I.value[1],E&&typeof E=="object"){if(!or(b,g,E,K,x,$))return!1}else if(!x.strict&&(!g.has(E)||!G(D(g,E),K,x,$))&&!or(b,g,E,K,r({},x,{strict:!1}),$))return!1;return U(b)===0}return!0}function gr(g,d,x,$){var M,T;if(typeof g!=typeof d||g==null||d==null||Q(g)!==Q(d)||o(g)!==o(d))return!1;var A=u(g),I=u(d);if(A!==I)return!1;var b=g instanceof Error,E=d instanceof Error;if(b!==E||(b||E)&&(g.name!==d.name||g.message!==d.message))return!1;var z=p(g),K=p(d);if(z!==K||(z||K)&&(g.source!==d.source||n(g)!==n(d)))return!1;var J=v(g),X=v(d);if(J!==X||(J||X)&&m(g)!==m(d)||x.strict&&j&&j(g)!==j(d))return!1;var rr=w(g),lr=w(d);if(rr!==lr)return!1;if(rr||lr){if(g.length!==d.length)return!1;for(M=0;M<g.length;M++)if(g[M]!==d[M])return!1;return!0}var ir=Ar(g),er=Ar(d);if(ir!==er)return!1;if(ir||er){if(g.length!==d.length)return!1;for(M=0;M<g.length;M++)if(g[M]!==d[M])return!1;return!0}var cr=c(g),pr=c(d);if(cr!==pr)return!1;if(cr||pr)return q(g)!==q(d)?!1:typeof Uint8Array=="function"&&G(new Uint8Array(g),new Uint8Array(d),x,$);var yr=y(g),_r=y(d);if(yr!==_r)return!1;if(yr||_r)return O(g)!==O(d)?!1:typeof Uint8Array=="function"&&G(new Uint8Array(g),new Uint8Array(d),x,$);if(typeof g!=typeof d)return!1;var hr=h(g),xr=h(d);if(hr.length!==xr.length)return!1;for(hr.sort(),xr.sort(),M=hr.length-1;M>=0;M--)if(hr[M]!=xr[M])return!1;for(M=hr.length-1;M>=0;M--)if(T=hr[M],!G(g[T],d[T],x,$))return!1;var Mr=R(g),dr=R(d);return Mr!==dr?!1:Mr==="Set"||dr==="Set"?$r(g,d,x,$):Mr==="Map"?Or(g,d,x,$):!0}return Nt=function(d,x,$){return G(d,x,$,f())},Nt}var Ri=Ii();const $i=Po(Ri);function xi(r){return r}function So(r,e,n,a){const t=xi,[f,i]=fr.useState(t(n)),o=fr.useRef(f);return fr.useEffect(()=>{const u=()=>{const c={...n,...r.getAttributes(e)};Object.keys(c).forEach(p=>{(c[p]===null||c[p]===void 0)&&(c[p]=n?n[p]:null)});const v=t(c);$i(o.current,v)||(i(v),o.current=v)};return r.on("selectionUpdate",u),r.on("transaction",u),()=>{r.off("selectionUpdate",u),r.off("transaction",u)}},[r,n,e,t]),f}function Ei({node:r}){const{text:e,macros:n}=r.attrs,a=fr.useMemo(()=>{try{return Ya.renderToString(decodeURIComponent(e||""),{macros:kt(decodeURIComponent(n||""))})}catch{return e}},[e,n]),t=fr.useMemo(()=>e.trim()?Y.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:a}}):Y.jsx("span",{contentEditable:!1,children:"Not enter a formula"}),[e,a]);return Y.jsx(Dr.NodeViewWrapper,{as:"span",style:{display:"inline-block"},children:t})}function Bi(){const{t:r}=qo.useLocale(),[e,n]=fr.useState(!1),a=tr.useButtonProps(Wt.name),{icon:t=void 0,tooltip:f=void 0,tooltipOptions:i={},isActive:o=void 0}=(a==null?void 0:a.componentProps)??{},{editorDisabled:u}=tr.useToggleActive(o),c=tr.useEditorInstance(),v=So(c,Wt.name,{text:"",macros:""}),{text:p,macros:y}=v,[h,S]=fr.useState(decodeURIComponent(p||"")),[R,w]=fr.useState(decodeURIComponent(y||"")),q=fr.useCallback(()=>{c.chain().focus().setKatex({text:encodeURIComponent(h),macros:encodeURIComponent(R)}).run(),S(""),w(""),n(!1)},[c,h,R]),O=fr.useMemo(()=>{try{return Ya.renderToString(h,{macros:kt(R)})}catch{return h}},[R,h]),m=fr.useMemo(()=>`${h}`.trim()?O:null,[h,O]);return Y.jsxs(tr.Dialog,{onOpenChange:n,open:e,children:[Y.jsx(tr.DialogTrigger,{asChild:!0,disabled:u,children:Y.jsx(tr.ActionButton,{disabled:u,icon:t,tooltip:f,tooltipOptions:i,action:()=>{u||n(!0)}})}),Y.jsxs(tr.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[Y.jsx(tr.DialogTitle,{children:r("editor.formula.dialog.text")}),Y.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:Y.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[Y.jsxs("div",{className:"richtext-flex-1",children:[Y.jsx(tr.Label,{className:"mb-[6px]",children:"Expression"}),Y.jsx(tr.Textarea,{autoFocus:!0,className:"richtext-mb-[10px]",onChange:j=>S(j.target.value),placeholder:"Text",required:!0,rows:10,value:h,style:{color:"hsl(var(--foreground))"}}),Y.jsx(tr.Label,{className:"mb-[6px]",children:"Macros"}),Y.jsx(tr.Textarea,{className:"richtext-flex-1",placeholder:"Macros",rows:10,value:R,onChange:j=>{w(j.target.value)},style:{color:"hsl(var(--foreground))"}})]}),Y.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:m||""},style:{height:"100%",borderWidth:1,minHeight:500,background:"#fff"}})]})}),Y.jsx(tr.DialogFooter,{children:Y.jsx(tr.Button,{onClick:q,type:"button",children:"Save changes"})})]})]})}function Ja(r){return e=>e.getAttribute(r)}const Wt=Dr.Node3.create({name:"katex",group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){return{HTMLAttributes:{class:"katex"},button:({t:r})=>({componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,icon:"KatexIcon",tooltip:r("editor.katex.tooltip")}})}},addAttributes(){return{text:{default:"",parseHTML:Ja("text")},macros:{default:"",parseHTML:Ja("macros")}}},parseHTML(){return[{tag:"span.katex"}]},renderHTML({HTMLAttributes:r}){return["span",Dr.mergeAttributes(this.options&&this.options.HTMLAttributes||{},r)]},addCommands(){return{setKatex:r=>({commands:e})=>e.insertContent({type:this.name,attrs:r})}},addInputRules(){return[Dr.nodeInputRule({find:/^\$katex\$$/,type:this.type})]},addNodeView(){return Dr.ReactNodeViewRenderer(Ei)}});exports.Katex=Wt;exports.RichTextKatex=Bi;exports.safeJSONParse=kt;exports.useAttributes=So;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";const k=require("react/jsx-runtime"),F=require("react"),R=require("./index-BynXHtjJ.cjs");require("./theme.cjs");const I=require("./clsx-CXbNJWDD.cjs"),_=require("@tiptap/pm/state"),Wt=require("./popover-BdLwAlrM.cjs"),we=require("./index-DgOXAdKt.cjs"),He="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",je="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Qt="numeric",Jt="ascii",Vt="alpha",V="asciinumeric",J="alphanumeric",Yt="domain",xe="emoji",Me="scheme",De="slashscheme",Ft="whitespace";function Ue(t,n){return t in n||(n[t]=[]),n[t]}function z(t,n,e){n[Qt]&&(n[V]=!0,n[J]=!0),n[Jt]&&(n[V]=!0,n[Vt]=!0),n[V]&&(n[J]=!0),n[Vt]&&(n[J]=!0),n[J]&&(n[Yt]=!0),n[xe]&&(n[Yt]=!0);for(const i in n){const s=Ue(i,e);s.indexOf(t)<0&&s.push(t)}}function Be(t,n){const e={};for(const i in n)n[i].indexOf(t)>=0&&(e[i]=!0);return e}function y(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}y.groups={};y.prototype={accepts(){return!!this.t},go(t){const n=this,e=n.j[t];if(e)return e;for(let i=0;i<n.jr.length;i++){const s=n.jr[i][0],o=n.jr[i][1];if(o&&s.test(t))return o}return n.jd},has(t,n=!1){return n?t in this.j:!!this.go(t)},ta(t,n,e,i){for(let s=0;s<t.length;s++)this.tt(t[s],n,e,i)},tr(t,n,e,i){i=i||y.groups;let s;return n&&n.j?s=n:(s=new y(n),e&&i&&z(n,e,i)),this.jr.push([t,s]),s},ts(t,n,e,i){let s=this;const o=t.length;if(!o)return s;for(let a=0;a<o-1;a++)s=s.tt(t[a]);return s.tt(t[o-1],n,e,i)},tt(t,n,e,i){i=i||y.groups;const s=this;if(n&&n.j)return s.j[t]=n,n;const o=n;let a,l=s.go(t);if(l?(a=new y,Object.assign(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new y,o){if(i)if(a.t&&typeof a.t=="string"){const d=Object.assign(Be(a.t,i),e);z(o,d,i)}else e&&z(o,e,i);a.t=o}return s.j[t]=a,a}};const f=(t,n,e,i,s)=>t.ta(n,e,i,s),x=(t,n,e,i,s)=>t.tr(n,e,i,s),me=(t,n,e,i,s)=>t.ts(n,e,i,s),r=(t,n,e,i,s)=>t.tt(n,e,i,s),j="WORD",Xt="UWORD",Te="ASCIINUMERICAL",Ce="ALPHANUMERICAL",nt="LOCALHOST",Zt="TLD",te="UTLD",ct="SCHEME",K="SLASH_SCHEME",ne="NUM",ee="WS",ie="NL",Y="OPENBRACE",X="CLOSEBRACE",ut="OPENBRACKET",dt="CLOSEBRACKET",ht="OPENPAREN",ft="CLOSEPAREN",mt="OPENANGLEBRACKET",gt="CLOSEANGLEBRACKET",pt="FULLWIDTHLEFTPAREN",Et="FULLWIDTHRIGHTPAREN",kt="LEFTCORNERBRACKET",At="RIGHTCORNERBRACKET",Lt="LEFTWHITECORNERBRACKET",xt="RIGHTWHITECORNERBRACKET",Tt="FULLWIDTHLESSTHAN",Ct="FULLWIDTHGREATERTHAN",bt="AMPERSAND",Rt="APOSTROPHE",yt="ASTERISK",D="AT",Ot="BACKSLASH",St="BACKTICK",Nt="CARET",U="COLON",se="COMMA",vt="DOLLAR",N="DOT",It="EQUALS",oe="EXCLAMATION",S="HYPHEN",Z="PERCENT",Pt="PIPE",wt="PLUS",Ht="POUND",tt="QUERY",re="QUOTE",be="FULLWIDTHMIDDLEDOT",ae="SEMI",v="SLASH",et="TILDE",jt="UNDERSCORE",Re="EMOJI",Mt="SYM";var ye=Object.freeze({__proto__:null,ALPHANUMERICAL:Ce,AMPERSAND:bt,APOSTROPHE:Rt,ASCIINUMERICAL:Te,ASTERISK:yt,AT:D,BACKSLASH:Ot,BACKTICK:St,CARET:Nt,CLOSEANGLEBRACKET:gt,CLOSEBRACE:X,CLOSEBRACKET:dt,CLOSEPAREN:ft,COLON:U,COMMA:se,DOLLAR:vt,DOT:N,EMOJI:Re,EQUALS:It,EXCLAMATION:oe,FULLWIDTHGREATERTHAN:Ct,FULLWIDTHLEFTPAREN:pt,FULLWIDTHLESSTHAN:Tt,FULLWIDTHMIDDLEDOT:be,FULLWIDTHRIGHTPAREN:Et,HYPHEN:S,LEFTCORNERBRACKET:kt,LEFTWHITECORNERBRACKET:Lt,LOCALHOST:nt,NL:ie,NUM:ne,OPENANGLEBRACKET:mt,OPENBRACE:Y,OPENBRACKET:ut,OPENPAREN:ht,PERCENT:Z,PIPE:Pt,PLUS:wt,POUND:Ht,QUERY:tt,QUOTE:re,RIGHTCORNERBRACKET:At,RIGHTWHITECORNERBRACKET:xt,SCHEME:ct,SEMI:ae,SLASH:v,SLASH_SCHEME:K,SYM:Mt,TILDE:et,TLD:Zt,UNDERSCORE:jt,UTLD:te,UWORD:Xt,WORD:j,WS:ee});const w=/[a-z]/,Q=new RegExp("\\p{L}","u"),Kt=new RegExp("\\p{Emoji}","u"),H=/\d/,_t=/\s/,ge="\r",Gt=`
|
|
2
|
-
`,ze="️",We="",qt="";let rt=null,at=null;function Fe(t=[]){const n={};y.groups=n;const e=new y;rt==null&&(rt=pe(He)),at==null&&(at=pe(je)),r(e,"'",Rt),r(e,"{",Y),r(e,"}",X),r(e,"[",ut),r(e,"]",dt),r(e,"(",ht),r(e,")",ft),r(e,"<",mt),r(e,">",gt),r(e,"(",pt),r(e,")",Et),r(e,"「",kt),r(e,"」",At),r(e,"『",Lt),r(e,"』",xt),r(e,"<",Tt),r(e,">",Ct),r(e,"&",bt),r(e,"*",yt),r(e,"@",D),r(e,"`",St),r(e,"^",Nt),r(e,":",U),r(e,",",se),r(e,"$",vt),r(e,".",N),r(e,"=",It),r(e,"!",oe),r(e,"-",S),r(e,"%",Z),r(e,"|",Pt),r(e,"+",wt),r(e,"#",Ht),r(e,"?",tt),r(e,'"',re),r(e,"/",v),r(e,";",ae),r(e,"~",et),r(e,"_",jt),r(e,"\\",Ot),r(e,"・",be);const i=x(e,H,ne,{[Qt]:!0});x(i,H,i);const s=x(i,w,Te,{[V]:!0}),o=x(i,Q,Ce,{[J]:!0}),a=x(e,w,j,{[Jt]:!0});x(a,H,s),x(a,w,a),x(s,H,s),x(s,w,s);const l=x(e,Q,Xt,{[Vt]:!0});x(l,w),x(l,H,o),x(l,Q,l),x(o,H,o),x(o,w),x(o,Q,o);const d=r(e,Gt,ie,{[Ft]:!0}),h=r(e,ge,ee,{[Ft]:!0}),c=x(e,_t,ee,{[Ft]:!0});r(e,qt,c),r(h,Gt,d),r(h,qt,c),x(h,_t,c),r(c,ge),r(c,Gt),x(c,_t,c),r(c,qt,c);const u=x(e,Kt,Re,{[xe]:!0});r(u,"#"),x(u,Kt,u),r(u,ze,u);const m=r(u,We);r(m,"#"),x(m,Kt,u);const p=[[w,a],[H,s]],b=[[w,null],[Q,l],[H,o]];for(let E=0;E<rt.length;E++)M(e,rt[E],Zt,j,p);for(let E=0;E<at.length;E++)M(e,at[E],te,Xt,b);z(Zt,{tld:!0,ascii:!0},n),z(te,{utld:!0,alpha:!0},n),M(e,"file",ct,j,p),M(e,"mailto",ct,j,p),M(e,"http",K,j,p),M(e,"https",K,j,p),M(e,"ftp",K,j,p),M(e,"ftps",K,j,p),z(ct,{scheme:!0,ascii:!0},n),z(K,{slashscheme:!0,ascii:!0},n),t=t.sort((E,T)=>E[0]>T[0]?1:-1);for(let E=0;E<t.length;E++){const T=t[E][0],L=t[E][1]?{[Me]:!0}:{[De]:!0};T.indexOf("-")>=0?L[Yt]=!0:w.test(T)?H.test(T)?L[V]=!0:L[Jt]=!0:L[Qt]=!0,me(e,T,T,L)}return me(e,"localhost",nt,{ascii:!0}),e.jd=new y(Mt),{start:e,tokens:Object.assign({groups:n},ye)}}function Oe(t,n){const e=Ke(n.replace(/[A-Z]/g,l=>l.toLowerCase())),i=e.length,s=[];let o=0,a=0;for(;a<i;){let l=t,d=null,h=0,c=null,u=-1,m=-1;for(;a<i&&(d=l.go(e[a]));)l=d,l.accepts()?(u=0,m=0,c=l):u>=0&&(u+=e[a].length,m++),h+=e[a].length,o+=e[a].length,a++;o-=u,a-=m,h-=u,s.push({t:c.t,v:n.slice(o-h,o),s:o-h,e:o})}return s}function Ke(t){const n=[],e=t.length;let i=0;for(;i<e;){let s=t.charCodeAt(i),o,a=s<55296||s>56319||i+1===e||(o=t.charCodeAt(i+1))<56320||o>57343?t[i]:t.slice(i,i+2);n.push(a),i+=a.length}return n}function M(t,n,e,i,s){let o;const a=n.length;for(let l=0;l<a-1;l++){const d=n[l];t.j[d]?o=t.j[d]:(o=new y(i),o.jr=s.slice(),t.j[d]=o),t=o}return o=new y(e),o.jr=s.slice(),t.j[n[a-1]]=o,o}function pe(t){const n=[],e=[];let i=0,s="0123456789";for(;i<t.length;){let o=0;for(;s.indexOf(t[i+o])>=0;)o++;if(o>0){n.push(e.join(""));for(let a=parseInt(t.substring(i,i+o),10);a>0;a--)e.pop();i+=o}else e.push(t[i]),i++}return n}const it={defaultProtocol:"http",events:null,format:Ee,formatHref:Ee,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function le(t,n=null){let e=Object.assign({},it);t&&(e=Object.assign(e,t instanceof le?t.o:t));const i=e.ignoreTags,s=[];for(let o=0;o<i.length;o++)s.push(i[o].toUpperCase());this.o=e,n&&(this.defaultRender=n),this.ignoreTags=s}le.prototype={o:it,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,n,e){const i=n!=null;let s=this.o[t];return s&&(typeof s=="object"?(s=e.t in s?s[e.t]:it[t],typeof s=="function"&&i&&(s=s(n,e))):typeof s=="function"&&i&&(s=s(n,e.t,e)),s)},getObj(t,n,e){let i=this.o[t];return typeof i=="function"&&n!=null&&(i=i(n,e.t,e)),i},render(t){const n=t.render(this);return(this.get("render",null,t)||this.defaultRender)(n,t.t,t)}};function Ee(t){return t}function Se(t,n){this.t="token",this.v=t,this.tk=n}Se.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const n=this.toString(),e=t.get("truncate",n,this),i=t.get("format",n,this);return e&&i.length>e?i.substring(0,e)+"…":i},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=it.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const n=this,e=this.toHref(t.get("defaultProtocol")),i=t.get("formatHref",e,this),s=t.get("tagName",e,n),o=this.toFormattedString(t),a={},l=t.get("className",e,n),d=t.get("target",e,n),h=t.get("rel",e,n),c=t.getObj("attributes",e,n),u=t.getObj("events",e,n);return a.href=i,l&&(a.class=l),d&&(a.target=d),h&&(a.rel=h),c&&Object.assign(a,c),{tagName:s,attributes:a,content:o,eventListeners:u}}};function Dt(t,n){class e extends Se{constructor(s,o){super(s,o),this.t=t}}for(const i in n)e.prototype[i]=n[i];return e.t=t,e}const ke=Dt("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ae=Dt("text"),_e=Dt("nl"),lt=Dt("url",{isLink:!0,toHref(t=it.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==nt&&t[1].t===U}}),O=t=>new y(t);function Ge({groups:t}){const n=t.domain.concat([bt,yt,D,Ot,St,Nt,vt,It,S,ne,Z,Pt,wt,Ht,v,Mt,et,jt]),e=[Rt,U,se,N,oe,Z,tt,re,ae,mt,gt,Y,X,dt,ut,ht,ft,pt,Et,kt,At,Lt,xt,Tt,Ct],i=[bt,Rt,yt,Ot,St,Nt,vt,It,S,Y,X,Z,Pt,wt,Ht,tt,v,Mt,et,jt],s=O(),o=r(s,et);f(o,i,o),f(o,t.domain,o);const a=O(),l=O(),d=O();f(s,t.domain,a),f(s,t.scheme,l),f(s,t.slashscheme,d),f(a,i,o),f(a,t.domain,a);const h=r(a,D);r(o,D,h),r(l,D,h),r(d,D,h);const c=r(o,N);f(c,i,o),f(c,t.domain,o);const u=O();f(h,t.domain,u),f(u,t.domain,u);const m=r(u,N);f(m,t.domain,u);const p=O(ke);f(m,t.tld,p),f(m,t.utld,p),r(h,nt,p);const b=r(u,S);r(b,S,b),f(b,t.domain,u),f(p,t.domain,u),r(p,N,m),r(p,S,b);const E=r(p,U);f(E,t.numeric,ke);const T=r(a,S),g=r(a,N);r(T,S,T),f(T,t.domain,a),f(g,i,o),f(g,t.domain,a);const L=O(lt);f(g,t.tld,L),f(g,t.utld,L),f(L,t.domain,a),f(L,i,o),r(L,N,g),r(L,S,T),r(L,D,h);const st=r(L,U),G=O(lt);f(st,t.numeric,G);const C=O(lt),P=O();f(C,n,C),f(C,e,P),f(P,n,C),f(P,e,P),r(L,v,C),r(G,v,C);const q=r(l,U),Ie=r(d,U),Pe=r(Ie,v),Ut=r(Pe,v);f(l,t.domain,a),r(l,N,g),r(l,S,T),f(d,t.domain,a),r(d,N,g),r(d,S,T),f(q,t.domain,C),r(q,v,C),r(q,tt,C),f(Ut,t.domain,C),f(Ut,n,C),r(Ut,v,C);const he=[[Y,X],[ut,dt],[ht,ft],[mt,gt],[pt,Et],[kt,At],[Lt,xt],[Tt,Ct]];for(let Bt=0;Bt<he.length;Bt++){const[fe,zt]=he[Bt],ot=r(C,fe);r(P,fe,ot),r(ot,zt,C);const W=O(lt);f(ot,n,W);const $=O();f(ot,e),f(W,n,W),f(W,e,$),f($,n,W),f($,e,$),r(W,zt,C),r($,zt,C)}return r(s,nt,L),r(s,ie,_e),{start:s,tokens:ye}}function qe(t,n,e){let i=e.length,s=0,o=[],a=[];for(;s<i;){let l=t,d=null,h=null,c=0,u=null,m=-1;for(;s<i&&!(d=l.go(e[s].t));)a.push(e[s++]);for(;s<i&&(h=d||l.go(e[s].t));)d=null,l=h,l.accepts()?(m=0,u=l):m>=0&&m++,s++,c++;if(m<0)s-=c,s<i&&(a.push(e[s]),s++);else{a.length>0&&(o.push($t(Ae,n,a)),a=[]),s-=m,c-=m;const p=u.t,b=e.slice(s-c,s);o.push($t(p,n,b))}}return a.length>0&&o.push($t(Ae,n,a)),o}function $t(t,n,e){const i=e[0].s,s=e[e.length-1].e,o=n.slice(i,s);return new t(o,e)}const $e=typeof console<"u"&&console&&console.warn||(()=>{}),Qe="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",A={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Je(){return y.groups={},A.scanner=null,A.parser=null,A.tokenQueue=[],A.pluginQueue=[],A.customSchemes=[],A.initialized=!1,A}function Le(t,n=!1){if(A.initialized&&$e(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Qe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
3
|
-
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
4
|
-
2. Cannot start or end with "-"
|
|
5
|
-
3. "-" cannot repeat`);A.customSchemes.push([t,n])}function Ve(){A.scanner=Fe(A.customSchemes);for(let t=0;t<A.tokenQueue.length;t++)A.tokenQueue[t][1]({scanner:A.scanner});A.parser=Ge(A.scanner.tokens);for(let t=0;t<A.pluginQueue.length;t++)A.pluginQueue[t][1]({scanner:A.scanner,parser:A.parser});return A.initialized=!0,A}function ce(t){return A.initialized||Ve(),qe(A.parser.start,t,Oe(A.scanner.start,t))}ce.scan=Oe;function Ne(t,n=null,e=null){if(n&&typeof n=="object"){if(e)throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);e=n,n=null}const i=new le(e),s=ce(t),o=[];for(let a=0;a<s.length;a++){const l=s[a];l.isLink&&(!n||l.t===n)&&i.check(l)&&o.push(l.toFormattedObject(i))}return o}var ue="[\0- -\u2029 ]",Ye=new RegExp(ue),Xe=new RegExp(`${ue}$`),Ze=new RegExp(ue,"g");function tn(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function en(t){return new _.Plugin({key:new _.PluginKey("autolink"),appendTransaction:(n,e,i)=>{const s=n.some(h=>h.docChanged)&&!e.doc.eq(i.doc),o=n.some(h=>h.getMeta("preventAutolink"));if(!s||o)return;const{tr:a}=i,l=I.combineTransactionSteps(e.doc,[...n]);if(I.getChangedRanges(l).forEach(({newRange:h})=>{const c=I.findChildrenInRange(i.doc,h,p=>p.isTextblock);let u,m;if(c.length>1)u=c[0],m=i.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(c.length){const p=i.doc.textBetween(h.from,h.to," "," ");if(!Xe.test(p))return;u=c[0],m=i.doc.textBetween(u.pos,h.to,void 0," ")}if(u&&m){const p=m.split(Ye).filter(Boolean);if(p.length<=0)return!1;const b=p[p.length-1],E=u.pos+m.lastIndexOf(b);if(!b)return!1;const T=ce(b).map(g=>g.toObject(t.defaultProtocol));if(!tn(T))return!1;T.filter(g=>g.isLink).map(g=>({...g,from:E+g.start+1,to:E+g.end+1})).filter(g=>i.schema.marks.code?!i.doc.rangeHasMark(g.from,g.to,i.schema.marks.code):!0).filter(g=>t.validate(g.value)).filter(g=>t.shouldAutoLink(g.value)).forEach(g=>{I.getMarksBetween(g.from,g.to,i.doc).some(L=>L.mark.type===t.type)||a.addMark(g.from,g.to,t.type.create({href:g.href}))})}}),!!a.steps.length)return a}})}function nn(t){return new _.Plugin({key:new _.PluginKey("handleClickLink"),props:{handleClick:(n,e,i)=>{var s,o;if(i.button!==0||!n.editable)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let l=null;if(i.target instanceof HTMLAnchorElement)l=i.target;else{let u=i.target;const m=[];for(;u.nodeName!=="DIV";)m.push(u),u=u.parentNode;l=m.find(p=>p.nodeName==="A")}if(!l)return a;const d=I.getAttributes(n.state,t.type.name),h=(s=l==null?void 0:l.href)!=null?s:d.href,c=(o=l==null?void 0:l.target)!=null?o:d.target;l&&h&&(window.open(h,c),a=!0)}return a}}})}function sn(t){return new _.Plugin({key:new _.PluginKey("handlePasteLink"),props:{handlePaste:(n,e,i)=>{const{shouldAutoLink:s}=t,{state:o}=n,{selection:a}=o,{empty:l}=a;if(l)return!1;let d="";i.content.forEach(c=>{d+=c.textContent});const h=Ne(d,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===d);return!d||!h||s!==void 0&&!s(h.href)?!1:t.editor.commands.setMark(t.type,{href:h.href})}}})}function B(t,n){const e=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return n&&n.forEach(i=>{const s=typeof i=="string"?i:i.scheme;s&&e.push(s)}),!t||t.replace(Ze,"").match(new RegExp(`^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var on=I.Mark.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Le(t);return}Le(t.scheme,t.optionalSlashes)})},onDestroy(){Je()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,n)=>!!B(t,n.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const n=t.getAttribute("href");return!n||!this.options.isAllowedUri(n,{defaultValidate:e=>!!B(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:n=>!!B(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",I.mergeAttributes(this.options.HTMLAttributes,t),0]:["a",I.mergeAttributes(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,n)=>n.applyMark("link",n.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,n)=>{var e;const i=((e=t.attrs)==null?void 0:e.href)||"";return`[${n.renderChildren(t)}](${i})`},addCommands(){return{setLink:t=>({chain:n})=>{const{href:e}=t;return this.options.isAllowedUri(e,{defaultValidate:i=>!!B(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?n().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:n})=>{const{href:e}=t||{};return e&&!this.options.isAllowedUri(e,{defaultValidate:i=>!!B(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:n().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[I.markPasteRule({find:t=>{const n=[];if(t){const{protocols:e,defaultProtocol:i}=this.options,s=Ne(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:a=>!!B(a,e),protocols:e,defaultProtocol:i}));s.length&&s.forEach(o=>{this.options.shouldAutoLink(o.value)&&n.push({text:o.value,data:{href:o.href},index:o.start})})}return n},type:this.type,getAttributes:t=>{var n;return{href:(n=t.data)==null?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:n,defaultProtocol:e}=this.options;return this.options.autolink&&t.push(en({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:s=>!!B(s,n),protocols:n,defaultProtocol:e}),shouldAutoLink:this.options.shouldAutoLink})),t.push(nn({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(sn({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}});function rn(){const[t,n]=F.useState(!1),e=R.useEditorInstance(),i=R.useButtonProps(de.name),{isActive:s,icon:o,tooltip:a,target:l,action:d}=(i==null?void 0:i.componentProps)??{},{dataState:h,editorDisabled:c,update:u}=R.useToggleActive(s);function m(p,b,E){c||d&&(d({link:p,text:b,openInNewTab:E}),n(!1),u())}return i?k.jsxs(Wt.Popover,{modal:!0,onOpenChange:n,open:t,children:[k.jsx(Wt.PopoverTrigger,{asChild:!0,"data-state":h?"on":"off",disabled:c,children:k.jsx(R.ActionButton,{dataState:h,disabled:c,tooltip:a,children:k.jsx(R.IconComponent,{name:o})})}),k.jsx(Wt.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:k.jsx(ve,{editor:e,onSetLink:m,open:t,target:l})})]}):k.jsx(k.Fragment,{})}const de=on.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",I.mergeAttributes(this.options.HTMLAttributes,t,{class:"link"}),0]},addOptions(){var e,i;const t=((e=this.parent)==null?void 0:e.call(this))||{},n=(i=t.HTMLAttributes)==null?void 0:i.target;return{...t,openOnClick:!1,button:({editor:s,t:o})=>({componentProps:{action:a=>{const{link:l,text:d,openInNewTab:h}=a;if(!l){s.chain().extendMarkRange("link").unsetLink().run();return}s.isActive("link")&&s.chain().extendMarkRange("link").run();const{from:c}=s.state.selection,u=d.length;s.chain().insertContent({type:"text",text:d,marks:[{type:"link",attrs:{href:/^https?:\/\//i.test(l)?l:`http://${l}`,target:n??(h?"_blank":"")}}]}).setLink({href:l}).setTextSelection({from:c,to:c+u}).focus().run()},isActive:()=>s.isActive("link"),disabled:!s.can().setLink({href:""}),icon:"Link",tooltip:o("editor.link.tooltip"),target:n}})}}});function ve(t){const{t:n}=we.useLocale(),[e,i]=F.useState({text:"",link:""}),[s,o]=F.useState(!1),a=F.useRef(null),l=F.useRef(null),d=R.useExtension(de.name);F.useEffect(()=>{const c=()=>{var st,G,C;const{from:u,to:m,empty:p}=t.editor.state.selection,b=d==null?void 0:d.options;let E="",T="",g=(st=b==null?void 0:b.HTMLAttributes)==null?void 0:st.target;const L=t.editor.state.doc.nodeAt(u);if(L){const P=L.marks.find(q=>q.type.name==="link");P?(T=P.attrs.href||"",g=P.attrs.target,p?E=L.text||"":E=t.editor.state.doc.textBetween(u,m," ")):E=t.editor.state.doc.textBetween(u,m," ")}L||(E=t.editor.state.doc.textBetween(u,m," ")),i({link:T,text:E}),o(t.target?t.target==="_blank":g==="_blank"),t.open&&(E===""?(G=a.current)==null||G.focus():(C=l.current)==null||C.focus())};return c(),t.editor.on("selectionUpdate",c),()=>{t.editor.off("selectionUpdate",c)}},[t.editor,d,t.open]);function h(c){c.preventDefault(),c.stopPropagation(),t==null||t.onSetLink(e.link,e.text,s),i({text:"",link:""})}return k.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-gap-2",children:[k.jsx(R.Label,{className:"mb-[6px]",children:n("editor.link.dialog.text")}),k.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:k.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:k.jsx(R.Input,{className:"richtext-w-80",onChange:c=>i({...e,text:c.target.value}),placeholder:"Text",ref:a,required:!0,type:"text",value:e.text})})}),k.jsx(R.Label,{className:"mb-[6px]",children:n("editor.link.dialog.link")}),k.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:k.jsxs("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:[k.jsx(R.Input,{className:"richtext-pl-10",onChange:c=>i({...e,link:c.target.value}),ref:l,required:!0,type:"url",value:e.link}),k.jsx("span",{className:"richtext-absolute richtext-inset-y-0 richtext-start-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2",children:k.jsx(R.IconComponent,{className:"richtext-size-5 richtext-text-muted-foreground",name:"Link"})})]})}),!t.target&&k.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-1",children:[k.jsx(R.Checkbox,{checked:s,onCheckedChange:c=>{o(c)}}),k.jsx(R.Label,{children:n("editor.link.dialog.openInNewTab")})]}),k.jsxs("div",{className:"richtext-mt-2 richtext-flex richtext-items-center richtext-justify-end richtext-gap-2",children:[(t==null?void 0:t.onClose)&&k.jsx(R.Button,{onClick:t==null?void 0:t.onClose,type:"button",children:n("editor.link.dialog.button.cancel")}),k.jsx(R.Button,{onClick:h,type:"button",children:n("editor.link.dialog.button.apply")})]})]})}exports.Link=de;exports.LinkEditBlock=ve;exports.RichTextLink=rn;
|
package/lib/Mermaid-B8lQSOGn.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var H=Object.create;var A=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var z=(e,i,s,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of _(i))!B.call(e,l)&&l!==s&&A(e,l,{get:()=>i[l],enumerable:!(o=O(i,l))||o.enumerable});return e};var T=(e,i,s)=>(s=e!=null?H($(e)):{},z(i||!e||!e.__esModule?A(s,"default",{value:e,enumerable:!0}):s,e));const N=require("./clsx-CXbNJWDD.cjs"),t=require("react/jsx-runtime"),r=require("react"),c=require("./index-BynXHtjJ.cjs"),L=({editor:e,node:i,updateAttributes:s})=>{var n,d;const o=((n=i==null?void 0:i.attrs)==null?void 0:n.code)??v,l=((d=i==null?void 0:i.attrs)==null?void 0:d.align)??"center",[a,M]=r.useState(o),[b,m]=r.useState(""),[y,u]=r.useState(""),[g,f]=r.useState(!1),[h,w]=r.useState(null),[p,S]=r.useState(!0),D=r.useRef(`mermaid-edit-${Math.random().toString(36).slice(2,9)}`),C=r.useCallback(x=>{f(x),x&&M(o)},[o]);r.useEffect(()=>{import("mermaid").then(x=>{const j=x.default;j.initialize({startOnLoad:!1,darkMode:!1,fontSize:12,theme:"base"}),w(j)}).finally(()=>S(!1))},[]),r.useEffect(()=>{if(!h||!g)return;(async()=>{const j=a.trim();if(!j){m(""),u("");return}try{const E=`${D.current}-${Date.now()}`,{svg:k}=await h.render(E,j);m(k),u("")}catch(E){m(""),u((E==null?void 0:E.message)??"Invalid Mermaid syntax")}})()},[a,h,g]);const I=r.useCallback(()=>{a.trim()&&(s?s({code:a}):e==null||e.chain().focus().setMermaid({code:a,align:l}).run(),f(!1))},[e,a,l,s]);return t.jsxs(c.Dialog,{onOpenChange:C,open:g,children:[t.jsx(c.DialogTrigger,{asChild:!0,children:t.jsx(c.ActionButton,{action:()=>f(!0),icon:"Pencil",tooltip:"Edit Mermaid"})}),t.jsxs(c.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(c.DialogTitle,{children:"Edit Mermaid Diagram"}),t.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:p?t.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-p-10 richtext-text-sm richtext-text-gray-400",children:"Loading Mermaid…"}):t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(c.Textarea,{autoFocus:!0,className:"richtext-flex-1 richtext-font-mono richtext-text-sm",onChange:x=>M(x.target.value),placeholder:v,required:!0,rows:18,value:a,style:{color:"hsl(var(--foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-overflow-auto richtext-rounded-[10px] richtext-p-[10px]",style:{minHeight:400,border:"1px solid hsl(var(--border))",background:"#fff"},children:y?t.jsxs("p",{className:"richtext-max-w-xs richtext-break-words richtext-text-sm richtext-text-red-500",children:["⚠ ",y]}):b?t.jsx("div",{dangerouslySetInnerHTML:{__html:b}}):t.jsx("p",{className:"richtext-text-sm richtext-text-gray-400",children:"Start typing to preview…"})})]})}),t.jsx(c.DialogFooter,{children:t.jsx(c.Button,{disabled:p||!h||!a.trim(),onClick:I,type:"button",children:"Save changes"})})]})]})};function q({editor:e,node:i,updateAttributes:s,selected:o,extension:l}){const[a,M]=r.useState(()=>(e==null?void 0:e.isEditable)??!1);r.useEffect(()=>{const n=()=>M((e==null?void 0:e.isEditable)??!1);return n(),e==null||e.on("editableUpdate",n),e==null||e.on("update",n),()=>{e==null||e.off("editableUpdate",n),e==null||e.off("update",n)}},[e]);const{code:b,align:m,width:y}=i.attrs,u=r.useRef(null),[g,f]=r.useState(""),[h,w]=r.useState(""),[p,S]=r.useState(null),D=r.useRef(`mermaid-view-${Math.random().toString(36).slice(2,9)}`);r.useEffect(()=>{import("mermaid").then(n=>{const d=n.default;d.initialize({startOnLoad:!1,darkMode:!1,fontSize:12,theme:"base"}),S(d)})},[]);const C=r.useCallback(async n=>{if(!(!p||!(n!=null&&n.trim())))try{const d=`${D.current}-${Date.now()}`,{svg:x}=await p.render(d,n);f(x),w("")}catch(d){f(""),w((d==null?void 0:d.message)??"Invalid Mermaid syntax")}},[p]);r.useEffect(()=>{C(b)},[b,C]);const I={textAlign:m??"center",width:y??"100%"};return t.jsx(N.NodeViewWrapper,{className:"mermaid-node-view richtext-relative richtext-my-4",style:I,children:t.jsxs("div",{"data-drag-handle":!0,draggable:a?"true":"false",ref:u,className:["richtext-relative richtext-inline-block richtext-rounded-lg richtext-border richtext-bg-white richtext-p-4 richtext-transition-all",a?o?"richtext-border-gray-300":"richtext-border-transparent":"richtext-pointer-events-none richtext-select-none richtext-border-transparent"].join(" "),style:{maxWidth:"100%"},children:[h?t.jsx("div",{className:"richtext-flex richtext-min-h-[120px] richtext-min-w-[200px] richtext-items-center richtext-justify-center richtext-rounded richtext-bg-red-50 richtext-p-4 richtext-text-sm richtext-text-red-500",children:t.jsxs("span",{children:["⚠ ",h]})}):g?t.jsx("div",{className:"mermaid-svg-container",dangerouslySetInnerHTML:{__html:g}}):t.jsx("div",{className:"richtext-flex richtext-min-h-[120px] richtext-min-w-[200px] richtext-items-center richtext-justify-center richtext-rounded richtext-bg-gray-50 richtext-text-sm richtext-text-gray-400",children:"Rendering…"}),a&&t.jsx("div",{className:"richtext-absolute richtext-right-2 richtext-top-2 richtext-opacity-0 richtext-transition-opacity [.mermaid-node-view:hover_&]:richtext-opacity-100",children:t.jsx(L,{editor:e,node:i,updateAttributes:s,extension:l})})]})})}function F(){const e=c.useEditorInstance(),i=c.useButtonProps(R.name),{tooltipOptions:s={},isActive:o=void 0}=(i==null?void 0:i.componentProps)??{},{editorDisabled:l}=c.useToggleActive(o),[a,M]=r.useState(v),[b,m]=r.useState(""),[y,u]=r.useState(""),[g,f]=r.useState(!1),[h,w]=r.useState(null),[p,S]=r.useState(!0),D=r.useRef(`mermaid-toolbar-${Math.random().toString(36).slice(2,9)}`);r.useEffect(()=>{import("mermaid").then(n=>{const d=n.default;d.initialize({startOnLoad:!1,darkMode:!1,fontSize:12,theme:"base"}),w(d)}).finally(()=>S(!1))},[]),r.useEffect(()=>{if(!h||!g)return;(async()=>{const d=a.trim();if(!d){m(""),u("");return}try{const x=`${D.current}-${Date.now()}`,{svg:j}=await h.render(x,d);m(j),u("")}catch(x){m(""),u((x==null?void 0:x.message)??"Invalid Mermaid syntax")}})()},[a,h,g]);const C=r.useCallback(n=>{f(n),n&&(M(v),m(""),u(""))},[]),I=r.useCallback(()=>{a.trim()&&(e==null||e.chain().focus().setMermaid({code:a,align:"center",width:"100%"}).run(),f(!1))},[e,a]);return t.jsxs(c.Dialog,{onOpenChange:C,open:g,children:[t.jsx(c.DialogTrigger,{asChild:!0,children:t.jsx(c.ActionButton,{disabled:l,icon:"Mermaid",tooltip:"Mermaid",tooltipOptions:s,action:()=>{l||f(!0)}})}),t.jsxs(c.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(c.DialogTitle,{children:"Insert Mermaid Diagram"}),t.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:p?t.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-p-10 richtext-text-sm richtext-text-gray-400",children:"Loading Mermaid…"}):t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(c.Textarea,{autoFocus:!0,className:"richtext-flex-1 richtext-font-mono richtext-text-sm",onChange:n=>M(n.target.value),placeholder:v,required:!0,rows:18,value:a,style:{color:"hsl(var(--foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-overflow-auto richtext-rounded-[10px] richtext-p-[10px]",style:{minHeight:400,border:"1px solid hsl(var(--border))",background:"#fff"},children:y?t.jsxs("p",{className:"richtext-max-w-xs richtext-break-words richtext-text-sm richtext-text-red-500",children:["⚠ ",y]}):b?t.jsx("div",{dangerouslySetInnerHTML:{__html:b}}):t.jsx("p",{className:"richtext-text-sm richtext-text-gray-400",children:"Start typing to preview…"})})]})}),t.jsx(c.DialogFooter,{children:t.jsx(c.Button,{disabled:p||!h||!a.trim(),onClick:I,type:"button",children:"Insert diagram"})})]})]})}const v=`graph TB
|
|
2
|
-
A --> B`,R=N.Node3.create({name:"mermaid",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){return{divider:!1,spacer:!1,HTMLAttributes:{class:"mermaid-node"},button:({editor:e,t:i,extension:s})=>({componentProps:{action:()=>!0,isActive:()=>e.isActive("mermaid"),disabled:!1,editor:e,icon:"Mermaid",tooltip:i("editor.mermaid.tooltip")}})}},addAttributes(){return{code:{default:v,parseHTML:e=>e.getAttribute("data-code")?decodeURIComponent(e.getAttribute("data-code")):v,renderHTML:e=>({"data-code":encodeURIComponent(e.code??"")})},align:{default:"center",parseHTML:e=>e.getAttribute("data-align")??"center",renderHTML:e=>({"data-align":e.align})},width:{default:"100%",parseHTML:e=>e.getAttribute("data-width")??"100%",renderHTML:e=>({"data-width":e.width})}}},parseHTML(){return[{tag:"div[class=mermaid-node]"}]},renderHTML({HTMLAttributes:e,node:i}){const{align:s}=i.attrs,o=s?`text-align: ${s};`:"";return["div",N.mergeAttributes({class:"mermaid-node"},e,{style:o})]},addCommands(){return{setMermaid:e=>({tr:i,commands:s})=>{var o,l,a;return e={code:v,align:"center",width:"100%",...e},((a=(l=(o=i.selection)==null?void 0:o.node)==null?void 0:l.type)==null?void 0:a.name)===this.name?s.updateAttributes(this.name,e):s.insertContent({type:this.name,attrs:e})},setMermaidAlign:e=>({commands:i})=>i.updateAttributes(this.name,{align:e})}},addNodeView(){return N.ReactNodeViewRenderer(q)}});exports.DEFAULT_MERMAID_CODE=v;exports.EditMermaidBlock=L;exports.Mermaid=R;exports.RichTextMermaid=F;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const d=require("react/jsx-runtime"),u=require("react"),x=require("./index-BynXHtjJ.cjs");require("./theme.cjs");const b=require("./index-DgOXAdKt.cjs"),C=require("./index-NsYff_Ni.cjs");function H({t:n}){const o=[{name:"format",title:n("editor.slash.format"),commands:[]},{name:"insert",title:n("editor.slash.insert"),commands:[]}];return b.HEADINGS.forEach(e=>{o[0].commands.push({name:`heading${e}`,label:n(e==="Paragraph"?"editor.paragraph.tooltip":`editor.heading.h${e}.tooltip`),aliases:[`h${e}`,"bt",`bt${e}`],iconName:`Heading${e}`,isActive:t=>e==="Paragraph"?!1:t.isActive("heading",{level:e})||!1,action:({editor:t,range:l})=>{const s=b.HEADINGS.find(m=>t.isActive("heading",{level:m}));if(e==="Paragraph"){s!==void 0&&s!=="Paragraph"&&t.commands.toggleHeading({level:s}),t.chain().focus().deleteRange(l).run();return}if(e){t.chain().focus().deleteRange(l).setHeading({level:e}).run();return}t.chain().focus().deleteRange(l).run()}})}),o[0].commands.push({name:"bulletList",label:n("editor.bulletlist.tooltip"),aliases:["ul","yxlb"],iconName:"List",isActive:e=>e.isActive("bulletList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBulletList().run()}}),o[0].commands.push({name:"orderedlist",label:n("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",isActive:e=>e.isActive("orderedList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleOrderedList().run()}}),o[0].commands.push({name:"taskList",label:n("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],isActive:e=>e.isActive("taskList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleTaskList().run()}}),o[0].commands.push({name:"blockquote",label:n("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",isActive:e=>e.isActive("blockquote"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setBlockquote().run()}}),o[0].commands.push({name:"codeBlock",label:n("editor.codeblock.tooltip"),iconName:"Code2",description:"Code block with syntax highlighting",shouldBeHidden:e=>e.isActive("columns"),isActive:e=>e.isActive("codeBlock"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setCodeBlock().run()}}),o[1].commands.push({name:"image",label:n("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).run();const l=x.EVENTS.UPLOAD_IMAGE(e.id);x.emit(l,!0)}}),o[1].commands.push({name:"table",label:n("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}}),o[1].commands.push({name:"horizontalRule",label:n("editor.horizontalrule.tooltip"),iconName:"Minus",description:"Insert a horizontal divider",aliases:["hr","fgx","fg"],action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setHorizontalRule().run()}}),o[1].commands.push({name:"paywallSeparator",label:"Paywall Separator",iconName:"PaywallIcon",description:"Mark where free content ends and premium content begins",aliases:["paywall","pw","premium","lock"],shouldBeHidden:e=>{let t=!1;return e.state.doc.descendants(l=>{if(l.type.name==="paywallSeparator")return t=!0,!1}),t},action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertPaywall().run()}}),o[1].commands.push({name:"columns",label:n("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",action:({editor:e})=>{e.chain().focus().insertColumns({cols:2}).run()}}),o}function N(n,o){return n.map(t=>({...t,commands:t.commands.filter(l=>{const s=l.label.toLowerCase().trim(),m=o.toLowerCase().trim();if(l.aliases){const f=l.aliases.map(h=>h.toLowerCase().trim()),g=s.match(m),r=f.some(h=>h.match(m));return g||r}return s.match(m)})})).filter(t=>t.commands.length>0)}const q=C.y([]);function L(){const[n,o]=C.V(q);return[n,o]}function j(n,o){const[e]=L(),[t,l]=u.useState(0),[s,m]=u.useState(0),f=u.useRef(null),{t:g}=b.useLocale(),r=N(e,n.query),h=u.useRef([]);u.useImperativeHandle(o,()=>({onKeyDown:v})),u.useEffect(()=>{if(!f.current)return;const a=s*1e3+t,i=h.current[a];i&&i.scrollIntoView({behavior:"smooth",block:"nearest"})},[t,s]);function v({event:a}){return a.key==="ArrowUp"?(A(),!0):a.key==="ArrowDown"?(R(),!0):a.key==="Enter"?(k(),!0):!1}function A(){var c;if(r.length===0)return!1;let a=t-1,i=s;a<0&&(i=s-1,a=((c=r[i])==null?void 0:c.commands.length)-1||0),i<0&&(i=r.length-1,a=r[i].commands.length-1),l(a),m(i)}function R(){if(r.length===0)return!1;const a=r[s].commands;let i=t+1,c=s;a.length-1<i&&(i=0,c=s+1),r.length-1<c&&(c=0),l(i),m(c)}function k(){if(r.length===0||s===-1||t===-1)return!1;w(s,t)}function w(a,i){const c=r[a].commands[i];n==null||n.command(c)}function I(a,i){w(a,i)}function y(a,i,c){h.current[a*1e3+i]=c}return d.jsx("div",{className:"richtext-max-h-[min(80vh,24rem)] richtext-flex-wrap richtext-overflow-y-auto richtext-overflow-x-hidden richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none","data-richtext-portal":!0,ref:f,children:r!=null&&r.length?d.jsx("div",{className:"richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5",children:r==null?void 0:r.map((a,i)=>d.jsxs(u.Fragment,{children:[d.jsx(x.Label,{className:"richtext-mx-[4px] richtext-mb-[4px] richtext-mt-[8px] !richtext-text-[0.65rem] richtext-uppercase",children:a.title}),a.commands.map((c,p)=>d.jsxs("button",{onClick:()=>I(i,p),ref:S=>y(i,p,S),className:x.cn("richtext-flex richtext-w-full richtext-items-center richtext-gap-3 richtext-rounded-sm !richtext-border-none !richtext-bg-transparent richtext-px-2 richtext-py-1.5 richtext-text-left richtext-text-sm richtext-text-foreground !richtext-outline-none richtext-transition-colors hover:!richtext-bg-accent",{"bg-item-active":s===i&&t===p}),children:[c.iconUrl&&d.jsx("img",{alt:"",className:"richtext-size-6",src:c.iconUrl}),c.iconName&&d.jsx(x.IconComponent,{className:"!richtext-mr-1 !richtext-text-lg",name:c.iconName}),c.label]},`command-${p}`))]},`slash-${a.title}`))}):d.jsx("div",{className:"richtext-p-3",children:d.jsx("span",{className:"richtext-text-xs richtext-text-foreground",children:g("editor.slash.empty")})})})}const E=u.forwardRef(j);exports.SlashCommandNodeView=E;exports.renderCommandListDefault=H;exports.useFilterCommandList=N;exports.useSignalCommandList=L;
|