reactjs-tiptap-editor 1.0.9 → 1.0.11
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/lib/{ActionMenuButton-CmDopTWt.cjs → ActionMenuButton-BLlse5KO.cjs} +1 -1
- package/lib/{ActionMenuButton-C4aNFFa8.js → ActionMenuButton-DTXFBdGX.js} +2 -2
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +7 -7
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +3 -3
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +6 -6
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +3 -3
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +6 -6
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +4 -4
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +3 -3
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +5 -5
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +8 -8
- package/lib/{Drawer-DG0gPU_U.js → Drawer-D0yQ0wR7.js} +6 -6
- package/lib/{Drawer-CTr2snNd.cjs → Drawer-kv6BU_6O.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +8 -7
- package/lib/{Excalidraw-DtezFdjR.cjs → Excalidraw-B82ThkJA.cjs} +1 -1
- package/lib/{Excalidraw-DpgdxOsc.js → Excalidraw-CO4IRHmG.js} +7 -7
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +2 -2
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +3 -3
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +3 -3
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +5 -5
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +5 -5
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +5 -5
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +5 -5
- package/lib/History.cjs +1 -1
- package/lib/History.js +4 -4
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +3 -3
- package/lib/{Icon-C_buGjWy.js → Icon-DRuJhcHK.js} +1 -1
- package/lib/{Icon-b6HQAURz.cjs → Icon-DXePECFW.cjs} +1 -1
- package/lib/{Iframe-CUrXCDxj.cjs → Iframe-03dn9wcM.cjs} +1 -1
- package/lib/{Iframe-De88TYvj.js → Iframe-BEO28NPs.js} +8 -8
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +13 -13
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +14 -14
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +3 -3
- package/lib/{Indent-Bensb2nf.js → Indent-CXurBbOr.js} +5 -5
- package/lib/{Indent-D_KtZNHW.cjs → Indent-Cqjdn3Jt.cjs} +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +3 -3
- package/lib/{Katex-C0dtqznb.js → Katex-Bvj469K1.js} +7 -7
- package/lib/{Katex-NqelWRoi.cjs → Katex-DdWTV5NJ.cjs} +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +5 -5
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-BSZ-vgNB.cjs → LinkEditBlock-8ePAZ-G1.cjs} +1 -1
- package/lib/{LinkEditBlock-Bv12sKvW.js → LinkEditBlock-DjXUEubR.js} +32 -32
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +23 -22
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.js +26 -26
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +5 -5
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +3 -3
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +9 -9
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +39 -266
- package/lib/SlashCommandNodeView-Bl_gwZJB.cjs +1 -0
- package/lib/SlashCommandNodeView-CcqL8ymb.js +254 -0
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +3 -3
- package/lib/{Table-D9ckv6Tb.js → Table-9Y0Cg8Ab.js} +5 -5
- package/lib/{Table-cy1mUM2X.cjs → Table-DBGjezZK.cjs} +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +3 -3
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +5 -5
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +5 -5
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +3 -3
- package/lib/{Twitter-Bvs3sW8F.cjs → Twitter-Cnvt7GBg.cjs} +1 -1
- package/lib/{Twitter-KUvyySA0.js → Twitter-DWwd0vHR.js} +46 -46
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +7 -7
- package/lib/bubble.cjs +4 -4
- package/lib/bubble.js +1659 -1567
- package/lib/{button-U6XpZt2X.cjs → button-BW5bDPz_.cjs} +1 -1
- package/lib/{button-D8SI-g7p.js → button-RnHbJfd-.js} +1 -1
- package/lib/{checkbox-xrY2c5yo.js → checkbox-CLSoR1Qj.js} +1 -1
- package/lib/{checkbox-DaIBNthL.cjs → checkbox-CTEN0q4y.cjs} +1 -1
- package/lib/{dialog-DgnnVCfv.cjs → dialog-CMC9hsCo.cjs} +1 -1
- package/lib/{dialog-DjnkASYP.js → dialog-D_HCtKvc.js} +1 -1
- package/lib/{dropdown-menu-bI14Gyw4.js → dropdown-menu-66q7Ofc5.js} +3 -2
- package/lib/dropdown-menu-DKSAS-w_.cjs +1 -0
- package/lib/extensions/SlashCommand/types.d.ts +1 -0
- package/lib/index-9A6-kVBM.js +1351 -0
- package/lib/{index-4pRt5Vqu.js → index-C3zg3DPB.js} +442 -403
- package/lib/index-C838s-or.cjs +8 -0
- package/lib/index-Cv9Z6dyV.cjs +1 -0
- package/lib/{index-EKFybgpP.js → index-DKt5wfAc.js} +1 -1
- package/lib/{index-BimeTI7q.js → index-DRHrDScg.js} +1 -1
- package/lib/{index-BQ6ZdLsu.js → index-DmPwbBqm.js} +1 -1
- package/lib/{index-CbIQPoF6.js → index-sVScpCFG.js} +20 -20
- package/lib/index.cjs +1 -1
- package/lib/index.js +5 -5
- package/lib/{input-C5zU49Q1.js → input-CvyMYMZG.js} +1 -1
- package/lib/{input-BtDj0NeF.cjs → input-D555880-.cjs} +1 -1
- package/lib/{isNumber-8HKEgTkA.js → isNumber-DF0fU3ob.js} +1 -1
- package/lib/{label-BEUVs-IA.js → label-DsOYPjAo.js} +1 -1
- package/lib/{label-C8BonzOY.cjs → label-E6jF3Xud.cjs} +1 -1
- package/lib/{popover-CPY5lMCj.js → popover-B7ec5-u2.js} +1 -1
- package/lib/{popover-DjL0De8d.cjs → popover-BSzR_R01.cjs} +1 -1
- package/lib/{separator-BlIlS7LP.js → separator-JaTTqb3J.js} +4 -4
- package/lib/{separator-BzMkiI_c.cjs → separator-PGnA-6Hr.cjs} +1 -1
- package/lib/{store-D_GvIPxo.js → store-Cf7tFiiI.js} +1 -1
- package/lib/{store-BSCjQxMK.cjs → store-oDk-lTPM.cjs} +1 -1
- package/lib/style.css +1 -1
- package/lib/{tabs-CHy82_rs.cjs → tabs-BTwiZkWd.cjs} +1 -1
- package/lib/{tabs-tQpXIzfV.js → tabs-CWr9HYaM.js} +1 -1
- package/lib/{textarea-CMDYVXYo.js → textarea-BdeLXbp8.js} +1 -1
- package/lib/{textarea-B-qfanCT.cjs → textarea-Yetl_PZi.cjs} +1 -1
- package/lib/{throttle-BIkZV3Y_.js → throttle-DsowOft0.js} +1 -1
- package/lib/updatePosition-Bbd8ETMv.js +16 -0
- package/lib/updatePosition-M2IyqkI1.cjs +1 -0
- package/lib/{useButtonProps-BqBGuqoP.cjs → useButtonProps-DfnJiJLV.cjs} +1 -1
- package/lib/{useButtonProps-DTngjZge.js → useButtonProps-cMoicZgd.js} +14 -14
- package/package.json +1 -1
- package/lib/dropdown-menu-BvVMltdB.cjs +0 -1
- package/lib/floating-ui.dom-U1vPFQ5f.js +0 -1151
- package/lib/floating-ui.dom-VCrc58uF.cjs +0 -1
- package/lib/index-DvvMf6Wu.cjs +0 -7
- package/lib/updatePosition-GLTrgcib.js +0 -215
- package/lib/updatePosition-u2mTh3mG.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const Tt=["top","right","bottom","left"],wt=["start","end"],xt=Tt.reduce((t,e)=>t.concat(e,e+"-"+wt[0],e+"-"+wt[1]),[]),I=Math.min,L=Math.max,nt=Math.round,X=t=>({x:t,y:t}),Xt={left:"right",right:"left",bottom:"top",top:"bottom"},It={start:"end",end:"start"};function ft(t,e,o){return L(t,I(e,o))}function j(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function N(t){return t.split("-")[1]}function Lt(t){return t==="x"?"y":"x"}function dt(t){return t==="y"?"height":"width"}const Yt=new Set(["top","bottom"]);function _(t){return Yt.has(W(t))?"y":"x"}function mt(t){return Lt(_(t))}function Dt(t,e,o){o===void 0&&(o=!1);const n=N(t),i=mt(t),s=dt(i);let r=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=it(r)),[r,it(r)]}function jt(t){const e=it(t);return[ot(t),e,ot(e)]}function ot(t){return t.replace(/start|end/g,e=>It[e])}const yt=["left","right"],bt=["right","left"],zt=["top","bottom"],Kt=["bottom","top"];function qt(t,e,o){switch(t){case"top":case"bottom":return o?e?bt:yt:e?yt:bt;case"left":case"right":return e?zt:Kt;default:return[]}}function Gt(t,e,o,n){const i=N(t);let s=qt(W(t),o==="start",n);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(ot)))),s}function it(t){return t.replace(/left|right|bottom|top/g,e=>Xt[e])}function Jt(t){return{top:0,right:0,bottom:0,left:0,...t}}function ht(t){return typeof t!="number"?Jt(t):{top:t,right:t,bottom:t,left:t}}function J(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function vt(t,e,o){let{reference:n,floating:i}=t;const s=_(e),r=mt(e),c=dt(r),f=W(e),u=s==="y",a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2,m=n[c]/2-i[c]/2;let d;switch(f){case"top":d={x:a,y:n.y-i.height};break;case"bottom":d={x:a,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:l};break;case"left":d={x:n.x-i.width,y:l};break;default:d={x:n.x,y:n.y}}switch(N(e)){case"start":d[r]-=m*(o&&u?-1:1);break;case"end":d[r]+=m*(o&&u?-1:1);break}return d}const Qt=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:r}=o,c=s.filter(Boolean),f=await(r.isRTL==null?void 0:r.isRTL(e));let u=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:a,y:l}=vt(u,n,f),m=n,d={},h=0;for(let g=0;g<c.length;g++){const{name:p,fn:y}=c[g],{x,y:b,data:A,reset:v}=await y({x:a,y:l,initialPlacement:n,placement:m,strategy:i,middlewareData:d,rects:u,platform:r,elements:{reference:t,floating:e}});a=x??a,l=b??l,d={...d,[p]:{...d[p],...A}},v&&h<=50&&(h++,typeof v=="object"&&(v.placement&&(m=v.placement),v.rects&&(u=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:a,y:l}=vt(u,m,f)),g=-1)}return{x:a,y:l,placement:m,strategy:i,middlewareData:d}};async function Q(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:r,elements:c,strategy:f}=t,{boundary:u="clippingAncestors",rootBoundary:a="viewport",elementContext:l="floating",altBoundary:m=!1,padding:d=0}=j(e,t),h=ht(d),p=c[m?l==="floating"?"reference":"floating":l],y=J(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(p)))==null||o?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:a,strategy:f})),x=l==="floating"?{x:n,y:i,width:r.floating.width,height:r.floating.height}:r.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),A=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},v=J(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:b,strategy:f}):x);return{top:(y.top-v.top+h.top)/A.y,bottom:(v.bottom-y.bottom+h.bottom)/A.y,left:(y.left-v.left+h.left)/A.x,right:(v.right-y.right+h.right)/A.x}}const Ut=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:n,placement:i,rects:s,platform:r,elements:c,middlewareData:f}=e,{element:u,padding:a=0}=j(t,e)||{};if(u==null)return{};const l=ht(a),m={x:o,y:n},d=mt(i),h=dt(d),g=await r.getDimensions(u),p=d==="y",y=p?"top":"left",x=p?"bottom":"right",b=p?"clientHeight":"clientWidth",A=s.reference[h]+s.reference[d]-m[d]-s.floating[h],v=m[d]-s.reference[d],C=await(r.getOffsetParent==null?void 0:r.getOffsetParent(u));let S=C?C[b]:0;(!S||!await(r.isElement==null?void 0:r.isElement(C)))&&(S=c.floating[b]||s.floating[h]);const F=A/2-v/2,P=S/2-g[h]/2-1,w=I(l[y],P),O=I(l[x],P),T=w,D=S-g[h]-O,R=S/2-g[h]/2+F,$=ft(T,R,D),M=!f.arrow&&N(i)!=null&&R!==$&&s.reference[h]/2-(R<T?w:O)-g[h]/2<0,E=M?R<T?R-T:R-D:0;return{[d]:m[d]+E,data:{[d]:$,centerOffset:R-$-E,...M&&{alignmentOffset:E}},reset:M}}});function Zt(t,e,o){return(t?[...o.filter(i=>N(i)===t),...o.filter(i=>N(i)!==t)]:o.filter(i=>W(i)===i)).filter(i=>t?N(i)===t||(e?ot(i)!==i:!1):!0)}const te=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var o,n,i;const{rects:s,middlewareData:r,placement:c,platform:f,elements:u}=e,{crossAxis:a=!1,alignment:l,allowedPlacements:m=xt,autoAlignment:d=!0,...h}=j(t,e),g=l!==void 0||m===xt?Zt(l||null,d,m):m,p=await Q(e,h),y=((o=r.autoPlacement)==null?void 0:o.index)||0,x=g[y];if(x==null)return{};const b=Dt(x,s,await(f.isRTL==null?void 0:f.isRTL(u.floating)));if(c!==x)return{reset:{placement:g[0]}};const A=[p[W(x)],p[b[0]],p[b[1]]],v=[...((n=r.autoPlacement)==null?void 0:n.overflows)||[],{placement:x,overflows:A}],C=g[y+1];if(C)return{data:{index:y+1,overflows:v},reset:{placement:C}};const S=v.map(w=>{const O=N(w.placement);return[w.placement,O&&a?w.overflows.slice(0,2).reduce((T,D)=>T+D,0):w.overflows[0],w.overflows]}).sort((w,O)=>w[1]-O[1]),P=((i=S.filter(w=>w[2].slice(0,N(w[0])?2:3).every(O=>O<=0))[0])==null?void 0:i[0])||S[0][0];return P!==c?{data:{index:y+1,overflows:v},reset:{placement:P}}:{}}}},ee=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:f,elements:u}=e,{mainAxis:a=!0,crossAxis:l=!0,fallbackPlacements:m,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...p}=j(t,e);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const y=W(i),x=_(c),b=W(c)===c,A=await(f.isRTL==null?void 0:f.isRTL(u.floating)),v=m||(b||!g?[it(c)]:jt(c)),C=h!=="none";!m&&C&&v.push(...Gt(c,g,h,A));const S=[c,...v],F=await Q(e,p),P=[];let w=((n=s.flip)==null?void 0:n.overflows)||[];if(a&&P.push(F[y]),l){const R=Dt(i,r,A);P.push(F[R[0]],F[R[1]])}if(w=[...w,{placement:i,overflows:P}],!P.every(R=>R<=0)){var O,T;const R=(((O=s.flip)==null?void 0:O.index)||0)+1,$=S[R];if($&&(!(l==="alignment"?x!==_($):!1)||w.every(k=>_(k.placement)===x?k.overflows[0]>0:!0)))return{data:{index:R,overflows:w},reset:{placement:$}};let M=(T=w.filter(E=>E.overflows[0]<=0).sort((E,k)=>E.overflows[1]-k.overflows[1])[0])==null?void 0:T.placement;if(!M)switch(d){case"bestFit":{var D;const E=(D=w.filter(k=>{if(C){const K=_(k.placement);return K===x||K==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(K=>K>0).reduce((K,_t)=>K+_t,0)]).sort((k,K)=>k[1]-K[1])[0])==null?void 0:D[0];E&&(M=E);break}case"initialPlacement":M=c;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function At(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ot(t){return Tt.some(e=>t[e]>=0)}const ne=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:o}=e,{strategy:n="referenceHidden",...i}=j(t,e);switch(n){case"referenceHidden":{const s=await Q(e,{...i,elementContext:"reference"}),r=At(s,o.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Ot(r)}}}case"escaped":{const s=await Q(e,{...i,altBoundary:!0}),r=At(s,o.floating);return{data:{escapedOffsets:r,escaped:Ot(r)}}}default:return{}}}}};function Et(t){const e=I(...t.map(s=>s.left)),o=I(...t.map(s=>s.top)),n=L(...t.map(s=>s.right)),i=L(...t.map(s=>s.bottom));return{x:e,y:o,width:n-e,height:i-o}}function oe(t){const e=t.slice().sort((i,s)=>i.y-s.y),o=[];let n=null;for(let i=0;i<e.length;i++){const s=e[i];!n||s.y-n.y>n.height/2?o.push([s]):o[o.length-1].push(s),n=s}return o.map(i=>J(Et(i)))}const ie=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:o,elements:n,rects:i,platform:s,strategy:r}=e,{padding:c=2,x:f,y:u}=j(t,e),a=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),l=oe(a),m=J(Et(a)),d=ht(c);function h(){if(l.length===2&&l[0].left>l[1].right&&f!=null&&u!=null)return l.find(p=>f>p.left-d.left&&f<p.right+d.right&&u>p.top-d.top&&u<p.bottom+d.bottom)||m;if(l.length>=2){if(_(o)==="y"){const w=l[0],O=l[l.length-1],T=W(o)==="top",D=w.top,R=O.bottom,$=T?w.left:O.left,M=T?w.right:O.right,E=M-$,k=R-D;return{top:D,bottom:R,left:$,right:M,width:E,height:k,x:$,y:D}}const p=W(o)==="left",y=L(...l.map(w=>w.right)),x=I(...l.map(w=>w.left)),b=l.filter(w=>p?w.left===x:w.right===y),A=b[0].top,v=b[b.length-1].bottom,C=x,S=y,F=S-C,P=v-A;return{top:A,bottom:v,left:C,right:S,width:F,height:P,x:C,y:A}}return m}const g=await s.getElementRects({reference:{getBoundingClientRect:h},floating:n.floating,strategy:r});return i.reference.x!==g.reference.x||i.reference.y!==g.reference.y||i.reference.width!==g.reference.width||i.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}},se=new Set(["left","top"]);async function re(t,e){const{placement:o,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),r=W(o),c=N(o),f=_(o)==="y",u=se.has(r)?-1:1,a=s&&f?-1:1,l=j(e,t);let{mainAxis:m,crossAxis:d,alignmentAxis:h}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return c&&typeof h=="number"&&(d=c==="end"?h*-1:h),f?{x:d*a,y:m*u}:{x:m*u,y:d*a}}const ce=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;const{x:i,y:s,placement:r,middlewareData:c}=e,f=await re(e,t);return r===((o=c.offset)==null?void 0:o.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:r}}}}},le=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:c={fn:p=>{let{x:y,y:x}=p;return{x:y,y:x}}},...f}=j(t,e),u={x:o,y:n},a=await Q(e,f),l=_(W(i)),m=Lt(l);let d=u[m],h=u[l];if(s){const p=m==="y"?"top":"left",y=m==="y"?"bottom":"right",x=d+a[p],b=d-a[y];d=ft(x,d,b)}if(r){const p=l==="y"?"top":"left",y=l==="y"?"bottom":"right",x=h+a[p],b=h-a[y];h=ft(x,h,b)}const g=c.fn({...e,[m]:d,[l]:h});return{...g,data:{x:g.x-o,y:g.y-n,enabled:{[m]:s,[l]:r}}}}}},ae=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var o,n;const{placement:i,rects:s,platform:r,elements:c}=e,{apply:f=()=>{},...u}=j(t,e),a=await Q(e,u),l=W(i),m=N(i),d=_(i)==="y",{width:h,height:g}=s.floating;let p,y;l==="top"||l==="bottom"?(p=l,y=m===(await(r.isRTL==null?void 0:r.isRTL(c.floating))?"start":"end")?"left":"right"):(y=l,p=m==="end"?"top":"bottom");const x=g-a.top-a.bottom,b=h-a.left-a.right,A=I(g-a[p],x),v=I(h-a[y],b),C=!e.middlewareData.shift;let S=A,F=v;if((o=e.middlewareData.shift)!=null&&o.enabled.x&&(F=b),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(S=x),C&&!m){const w=L(a.left,0),O=L(a.right,0),T=L(a.top,0),D=L(a.bottom,0);d?F=h-2*(w!==0||O!==0?w+O:L(a.left,a.right)):S=g-2*(T!==0||D!==0?T+D:L(a.top,a.bottom))}await f({...e,availableWidth:F,availableHeight:S});const P=await r.getDimensions(c.floating);return h!==P.width||g!==P.height?{reset:{rects:!0}}:{}}}};function st(){return typeof window<"u"}function Z(t){return kt(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function z(t){var e;return(e=(kt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function kt(t){return st()?t instanceof Node||t instanceof B(t).Node:!1}function V(t){return st()?t instanceof Element||t instanceof B(t).Element:!1}function Y(t){return st()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function Rt(t){return!st()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}const fe=new Set(["inline","contents"]);function et(t){const{overflow:e,overflowX:o,overflowY:n,display:i}=H(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&!fe.has(i)}const ue=new Set(["table","td","th"]);function de(t){return ue.has(Z(t))}const me=[":popover-open",":modal"];function rt(t){return me.some(e=>{try{return t.matches(e)}catch{return!1}})}const he=["transform","translate","scale","rotate","perspective"],ge=["transform","translate","scale","rotate","perspective","filter"],pe=["paint","layout","strict","content"];function gt(t){const e=pt(),o=V(t)?H(t):t;return he.some(n=>o[n]?o[n]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!e&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!e&&(o.filter?o.filter!=="none":!1)||ge.some(n=>(o.willChange||"").includes(n))||pe.some(n=>(o.contain||"").includes(n))}function we(t){let e=q(t);for(;Y(e)&&!U(e);){if(gt(e))return e;if(rt(e))return null;e=q(e)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const xe=new Set(["html","body","#document"]);function U(t){return xe.has(Z(t))}function H(t){return B(t).getComputedStyle(t)}function ct(t){return V(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(Z(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Rt(t)&&t.host||z(t);return Rt(e)?e.host:e}function Bt(t){const e=q(t);return U(e)?t.ownerDocument?t.ownerDocument.body:t.body:Y(e)&&et(e)?e:Bt(e)}function Ft(t,e,o){var n;e===void 0&&(e=[]);const i=Bt(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),r=B(i);return s?(ut(r),e.concat(r,r.visualViewport||[],et(i)?i:[],[])):e.concat(i,Ft(i,[]))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Mt(t){const e=H(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Y(t),s=i?t.offsetWidth:o,r=i?t.offsetHeight:n,c=nt(o)!==s||nt(n)!==r;return c&&(o=s,n=r),{width:o,height:n,$:c}}function Wt(t){return V(t)?t:t.contextElement}function G(t){const e=Wt(t);if(!Y(e))return X(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:s}=Mt(e);let r=(s?nt(o.width):o.width)/n,c=(s?nt(o.height):o.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const ye=X(0);function $t(t){const e=B(t);return!pt()||!e.visualViewport?ye:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function be(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==B(t)?!1:e}function tt(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),s=Wt(t);let r=X(1);e&&(n?V(n)&&(r=G(n)):r=G(t));const c=be(s,o,n)?$t(s):X(0);let f=(i.left+c.x)/r.x,u=(i.top+c.y)/r.y,a=i.width/r.x,l=i.height/r.y;if(s){const m=B(s),d=n&&V(n)?B(n):n;let h=m,g=ut(h);for(;g&&n&&d!==h;){const p=G(g),y=g.getBoundingClientRect(),x=H(g),b=y.left+(g.clientLeft+parseFloat(x.paddingLeft))*p.x,A=y.top+(g.clientTop+parseFloat(x.paddingTop))*p.y;f*=p.x,u*=p.y,a*=p.x,l*=p.y,f+=b,u+=A,h=B(g),g=ut(h)}}return J({width:a,height:l,x:f,y:u})}function lt(t,e){const o=ct(t).scrollLeft;return e?e.left+o:tt(z(t)).left+o}function Nt(t,e){const o=t.getBoundingClientRect(),n=o.left+e.scrollLeft-lt(t,o),i=o.top+e.scrollTop;return{x:n,y:i}}function ve(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const s=i==="fixed",r=z(n),c=e?rt(e.floating):!1;if(n===r||c&&s)return o;let f={scrollLeft:0,scrollTop:0},u=X(1);const a=X(0),l=Y(n);if((l||!l&&!s)&&((Z(n)!=="body"||et(r))&&(f=ct(n)),Y(n))){const d=tt(n);u=G(n),a.x=d.x+n.clientLeft,a.y=d.y+n.clientTop}const m=r&&!l&&!s?Nt(r,f):X(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-f.scrollLeft*u.x+a.x+m.x,y:o.y*u.y-f.scrollTop*u.y+a.y+m.y}}function Ae(t){return Array.from(t.getClientRects())}function Oe(t){const e=z(t),o=ct(t),n=t.ownerDocument.body,i=L(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=L(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let r=-o.scrollLeft+lt(t);const c=-o.scrollTop;return H(n).direction==="rtl"&&(r+=L(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:r,y:c}}const St=25;function Re(t,e){const o=B(t),n=z(t),i=o.visualViewport;let s=n.clientWidth,r=n.clientHeight,c=0,f=0;if(i){s=i.width,r=i.height;const a=pt();(!a||a&&e==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}const u=lt(n);if(u<=0){const a=n.ownerDocument,l=a.body,m=getComputedStyle(l),d=a.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(n.clientWidth-l.clientWidth-d);h<=St&&(s-=h)}else u<=St&&(s+=u);return{width:s,height:r,x:c,y:f}}const Se=new Set(["absolute","fixed"]);function Ce(t,e){const o=tt(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,s=Y(t)?G(t):X(1),r=t.clientWidth*s.x,c=t.clientHeight*s.y,f=i*s.x,u=n*s.y;return{width:r,height:c,x:f,y:u}}function Ct(t,e,o){let n;if(e==="viewport")n=Re(t,o);else if(e==="document")n=Oe(z(t));else if(V(e))n=Ce(e,o);else{const i=$t(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return J(n)}function Vt(t,e){const o=q(t);return o===e||!V(o)||U(o)?!1:H(o).position==="fixed"||Vt(o,e)}function Pe(t,e){const o=e.get(t);if(o)return o;let n=Ft(t,[]).filter(c=>V(c)&&Z(c)!=="body"),i=null;const s=H(t).position==="fixed";let r=s?q(t):t;for(;V(r)&&!U(r);){const c=H(r),f=gt(r);!f&&c.position==="fixed"&&(i=null),(s?!f&&!i:!f&&c.position==="static"&&!!i&&Se.has(i.position)||et(r)&&!f&&Vt(t,r))?n=n.filter(a=>a!==r):i=c,r=q(r)}return e.set(t,n),n}function Te(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const r=[...o==="clippingAncestors"?rt(e)?[]:Pe(e,this._c):[].concat(o),n],c=r[0],f=r.reduce((u,a)=>{const l=Ct(e,a,i);return u.top=L(l.top,u.top),u.right=I(l.right,u.right),u.bottom=I(l.bottom,u.bottom),u.left=L(l.left,u.left),u},Ct(e,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Le(t){const{width:e,height:o}=Mt(t);return{width:e,height:o}}function De(t,e,o){const n=Y(e),i=z(e),s=o==="fixed",r=tt(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const f=X(0);function u(){f.x=lt(i)}if(n||!n&&!s)if((Z(e)!=="body"||et(i))&&(c=ct(e)),n){const d=tt(e,!0,s,e);f.x=d.x+e.clientLeft,f.y=d.y+e.clientTop}else i&&u();s&&!n&&i&&u();const a=i&&!n&&!s?Nt(i,c):X(0),l=r.left+c.scrollLeft-f.x-a.x,m=r.top+c.scrollTop-f.y-a.y;return{x:l,y:m,width:r.width,height:r.height}}function at(t){return H(t).position==="static"}function Pt(t,e){if(!Y(t)||H(t).position==="fixed")return null;if(e)return e(t);let o=t.offsetParent;return z(t)===o&&(o=o.ownerDocument.body),o}function Ht(t,e){const o=B(t);if(rt(t))return o;if(!Y(t)){let i=q(t);for(;i&&!U(i);){if(V(i)&&!at(i))return i;i=q(i)}return o}let n=Pt(t,e);for(;n&&de(n)&&at(n);)n=Pt(n,e);return n&&U(n)&&at(n)&&!gt(n)?o:n||we(t)||o}const Ee=async function(t){const e=this.getOffsetParent||Ht,o=this.getDimensions,n=await o(t.floating);return{reference:De(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ke(t){return H(t).direction==="rtl"}const Be={convertOffsetParentRelativeRectToViewportRelativeRect:ve,getDocumentElement:z,getClippingRect:Te,getOffsetParent:Ht,getElementRects:Ee,getClientRects:Ae,getDimensions:Le,getScale:G,isElement:V,isRTL:ke},Fe=ce,Me=te,We=le,$e=ee,Ne=ae,Ve=ne,He=Ut,_e=ie,Xe=(t,e,o)=>{const n=new Map,i={platform:Be,...o},s={...i.platform,_c:n};return Qt(t,e,{...i,platform:s})};exports.arrow=He;exports.autoPlacement=Me;exports.computePosition=Xe;exports.flip=$e;exports.hide=Ve;exports.inline=_e;exports.offset=Fe;exports.shift=We;exports.size=Ne;
|
package/lib/index-DvvMf6Wu.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),x=require("react"),qe=require("@radix-ui/react-slot"),ge=require("./index-FSRjMsxW.cjs"),pe=require("./theme.cjs"),k=require("./events.constant-DQYeJpu5.cjs"),De=require("@radix-ui/react-tooltip"),Xe=require("@radix-ui/react-toggle"),W=require("@radix-ui/react-icons"),c=require("lucide-react"),Ce=require("./index-BBNITgNi.cjs");function ee(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const je=ee(x),I=ee(De),Se=ee(Xe),te="-",Ke=e=>{const r=Ze(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const s=a.split(te);return s[0]===""&&s.length!==1&&s.shift(),ke(s,r)||Qe(a)},getConflictingClassGroupIds:(a,s)=>{const h=t[a]||[];return s&&o[a]?[...h,...o[a]]:h}}},ke=(e,r)=>{var a;if(e.length===0)return r.classGroupId;const t=e[0],o=r.nextPart.get(t),l=o?ke(e.slice(1),o):void 0;if(l)return l;if(r.validators.length===0)return;const n=e.join(te);return(a=r.validators.find(({validator:s})=>s(n)))==null?void 0:a.classGroupId},me=/^\[(.+)\]$/,Qe=e=>{if(me.test(e)){const r=me.exec(e)[1],t=r==null?void 0:r.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}},Ze=e=>{const{theme:r,prefix:t}=e,o={nextPart:new Map,validators:[]};return Ye(Object.entries(e.classGroups),t).forEach(([n,a])=>{J(a,o,n,r)}),o},J=(e,r,t,o)=>{e.forEach(l=>{if(typeof l=="string"){const n=l===""?r:fe(r,l);n.classGroupId=t;return}if(typeof l=="function"){if(Je(l)){J(l(o),r,t,o);return}r.validators.push({validator:l,classGroupId:t});return}Object.entries(l).forEach(([n,a])=>{J(a,fe(r,n),t,o)})})},fe=(e,r)=>{let t=e;return r.split(te).forEach(o=>{t.nextPart.has(o)||t.nextPart.set(o,{nextPart:new Map,validators:[]}),t=t.nextPart.get(o)}),t},Je=e=>e.isThemeGetter,Ye=(e,r)=>r?e.map(([t,o])=>{const l=o.map(n=>typeof n=="string"?r+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([a,s])=>[r+a,s])):n);return[t,l]}):e,et=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,t=new Map,o=new Map;const l=(n,a)=>{t.set(n,a),r++,r>e&&(r=0,o=t,t=new Map)};return{get(n){let a=t.get(n);if(a!==void 0)return a;if((a=o.get(n))!==void 0)return l(n,a),a},set(n,a){t.has(n)?t.set(n,a):l(n,a)}}},ze="!",tt=e=>{const{separator:r,experimentalParseClassName:t}=e,o=r.length===1,l=r[0],n=r.length,a=s=>{const h=[];let u=0,p=0,m;for(let f=0;f<s.length;f++){let C=s[f];if(u===0){if(C===l&&(o||s.slice(f,f+n)===r)){h.push(s.slice(p,f)),p=f+n;continue}if(C==="/"){m=f;continue}}C==="["?u++:C==="]"&&u--}const d=h.length===0?s:s.substring(p),b=d.startsWith(ze),j=b?d.substring(1):d,v=m&&m>p?m-p:void 0;return{modifiers:h,hasImportantModifier:b,baseClassName:j,maybePostfixModifierPosition:v}};return t?s=>t({className:s,parseClassName:a}):a},rt=e=>{if(e.length<=1)return e;const r=[];let t=[];return e.forEach(o=>{o[0]==="["?(r.push(...t.sort(),o),t=[]):t.push(o)}),r.push(...t.sort()),r},ot=e=>({cache:et(e.cacheSize),parseClassName:tt(e),...Ke(e)}),nt=/\s+/,st=(e,r)=>{const{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:l}=r,n=[],a=e.trim().split(nt);let s="";for(let h=a.length-1;h>=0;h-=1){const u=a[h],{modifiers:p,hasImportantModifier:m,baseClassName:d,maybePostfixModifierPosition:b}=t(u);let j=!!b,v=o(j?d.substring(0,b):d);if(!v){if(!j){s=u+(s.length>0?" "+s:s);continue}if(v=o(d),!v){s=u+(s.length>0?" "+s:s);continue}j=!1}const f=rt(p).join(":"),C=m?f+ze:f,S=C+v;if(n.includes(S))continue;n.push(S);const H=l(v,j);for(let T=0;T<H.length;++T){const B=H[T];n.push(C+B)}s=u+(s.length>0?" "+s:s)}return s};function it(){let e=0,r,t,o="";for(;e<arguments.length;)(r=arguments[e++])&&(t=Ee(r))&&(o&&(o+=" "),o+=t);return o}const Ee=e=>{if(typeof e=="string")return e;let r,t="";for(let o=0;o<e.length;o++)e[o]&&(r=Ee(e[o]))&&(t&&(t+=" "),t+=r);return t};function lt(e,...r){let t,o,l,n=a;function a(h){const u=r.reduce((p,m)=>m(p),e());return t=ot(u),o=t.cache.get,l=t.cache.set,n=s,s(h)}function s(h){const u=o(h);if(u)return u;const p=st(h,t);return l(h,p),p}return function(){return n(it.apply(null,arguments))}}const w=e=>{const r=t=>t[e]||[];return r.isThemeGetter=!0,r},Me=/^\[(?:([a-z-]+):)?(.+)\]$/i,ct=/^\d+\/\d+$/,at=new Set(["px","full","screen"]),dt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ut=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ht=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,gt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,E=e=>R(e)||at.has(e)||ct.test(e),M=e=>A(e,"length",Ct),R=e=>!!e&&!Number.isNaN(Number(e)),X=e=>A(e,"number",R),V=e=>!!e&&Number.isInteger(Number(e)),mt=e=>e.endsWith("%")&&R(e.slice(0,-1)),g=e=>Me.test(e),L=e=>dt.test(e),ft=new Set(["length","size","percentage"]),xt=e=>A(e,ft,Le),bt=e=>A(e,"position",Le),wt=new Set(["image","url"]),vt=e=>A(e,wt,St),yt=e=>A(e,"",jt),N=()=>!0,A=(e,r,t)=>{const o=Me.exec(e);return o?o[1]?typeof r=="string"?o[1]===r:r.has(o[1]):t(o[2]):!1},Ct=e=>ut.test(e)&&!ht.test(e),Le=()=>!1,jt=e=>gt.test(e),St=e=>pt.test(e),kt=()=>{const e=w("colors"),r=w("spacing"),t=w("blur"),o=w("brightness"),l=w("borderColor"),n=w("borderRadius"),a=w("borderSpacing"),s=w("borderWidth"),h=w("contrast"),u=w("grayscale"),p=w("hueRotate"),m=w("invert"),d=w("gap"),b=w("gradientColorStops"),j=w("gradientColorStopPositions"),v=w("inset"),f=w("margin"),C=w("opacity"),S=w("padding"),H=w("saturate"),T=w("scale"),B=w("sepia"),ie=w("skew"),le=w("space"),ce=w("translate"),$=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",g,r],y=()=>[g,r],ae=()=>["",E,M],G=()=>["auto",R,g],de=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",g],he=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[R,g];return{cacheSize:500,separator:":",theme:{colors:[N],spacing:[E,M],blur:["none","",L,g],brightness:z(),borderColor:[e],borderRadius:["none","","full",L,g],borderSpacing:y(),borderWidth:ae(),contrast:z(),grayscale:P(),hueRotate:z(),invert:P(),gap:y(),gradientColorStops:[e],gradientColorStopPositions:[mt,M],inset:q(),margin:q(),opacity:z(),padding:y(),saturate:z(),scale:z(),sepia:P(),skew:z(),space:y(),translate:y()},classGroups:{aspect:[{aspect:["auto","square","video",g]}],container:["container"],columns:[{columns:[L]}],"break-after":[{"break-after":he()}],"break-before":[{"break-before":he()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...de(),g]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",V,g]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",g]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",V,g]}],"grid-cols":[{"grid-cols":[N]}],"col-start-end":[{col:["auto",{span:["full",V,g]},g]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[N]}],"row-start-end":[{row:["auto",{span:[V,g]},g]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",g]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",g]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],mt:[{mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[le]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[le]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",g,r]}],"min-w":[{"min-w":[g,r,"min","max","fit"]}],"max-w":[{"max-w":[g,r,"none","full","min","max","fit","prose",{screen:[L]},L]}],h:[{h:[g,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[g,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[g,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[g,r,"auto","min","max","fit"]}],"font-size":[{text:["base",L,M]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",X]}],"font-family":[{font:[N]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",g]}],"line-clamp":[{"line-clamp":["none",R,X]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",E,g]}],"list-image":[{"list-image":["none",g]}],"list-style-type":[{list:["none","disc","decimal",g]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",E,M]}],"underline-offset":[{"underline-offset":["auto",E,g]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",g]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...de(),bt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",xt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[C]}],"divide-style":[{divide:O()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[E,g]}],"outline-w":[{outline:[E,M]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[E,M]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",L,yt]}],"shadow-color":[{shadow:[N]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...ue(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ue()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[h]}],"drop-shadow":[{"drop-shadow":["","none",L,g]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[m]}],saturate:[{saturate:[H]}],sepia:[{sepia:[B]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[h]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[H]}],"backdrop-sepia":[{"backdrop-sepia":[B]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",g]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",g]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",g]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[V,g]}],"translate-x":[{"translate-x":[ce]}],"translate-y":[{"translate-y":[ce]}],"skew-x":[{"skew-x":[ie]}],"skew-y":[{"skew-y":[ie]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",g]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",g]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[E,M,X]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},zt=lt(kt);function U(...e){return zt(Ce.clsx(e))}let K;function Q(){return K===void 0&&(K=navigator.platform.includes("Mac")),K}function Te(e){return`${e}`.toLowerCase()==="mod"?Q()?"⌘":"Ctrl":`${e}`.toLowerCase()==="alt"?Q()?"⌥":"Alt":`${e}`.toLowerCase()==="shift"?Q()?"⇧":"Shift":e}function Re(e){return e.map(Te).join(" ")}const Et=x.forwardRef((e,r)=>{const{icon:t=void 0,tooltip:o=void 0,disabled:l=!1,customClass:n="",loading:a=void 0,shortcutKeys:s=void 0,tooltipOptions:h={},action:u=void 0,isActive:p=void 0,children:m,asChild:d=!1,upload:b=!1,initialDisplayedColor:j=void 0,dataState:v=!1,...f}=e,C=Ve[t],S=d?qe.Slot:re;return i.jsxs(Ie,{children:[i.jsx(Be,{asChild:!0,children:i.jsxs(S,{className:U("richtext-w-[32px] richtext-h-[32px]",n),"data-state":v?"on":"off",disabled:l,onClick:u,ref:r,size:"sm",...f,children:[C&&i.jsx(C,{className:"richtext-size-4"}),m]})}),o&&i.jsx(oe,{...h,className:"richtext-tooltip",children:i.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i.jsx("div",{children:o}),!!(s!=null&&s.length)&&i.jsx("span",{children:Re(s)})]})})]})}),Z=typeof window>"u";function xe(e,r,t=window){const o=x.useRef(void 0);x.useEffect(()=>{o.current=r},[r]),x.useEffect(()=>{if(!(t&&t.addEventListener))return;const n=a=>{o.current&&o.current(a)};return t.addEventListener(e,n),()=>{t.removeEventListener(e,n)}},[e,t])}function _(e,r,t={}){const{initializeWithValue:o=!0}=t,l=x.useCallback(d=>t.serializer?t.serializer(d):JSON.stringify(d),[t]),n=x.useCallback(d=>{if(t.deserializer)return t.deserializer(d);if(d==="undefined")return;const b=r instanceof Function?r():r;let j;try{j=JSON.parse(d)}catch(v){return console.error("Error parsing JSON:",v),b}return j},[t,r]),a=x.useCallback(()=>{const d=r instanceof Function?r():r;if(Z)return d;try{const b=window.localStorage.getItem(e);return b?n(b):d}catch(b){return console.warn(`Error reading localStorage key “${e}”:`,b),d}},[r,e,n]),[s,h]=x.useState(()=>o?a():r instanceof Function?r():r),u=x.useCallback(d=>{Z&&console.warn(`Tried setting localStorage key “${e}” even though environment is not a client`);try{const b=d instanceof Function?d(a()):d;window.localStorage.setItem(e,l(b)),h(b),window.dispatchEvent(new StorageEvent("local-storage",{key:e}))}catch(b){console.warn(`Error setting localStorage key “${e}”:`,b)}},[e,l,a]),p=x.useCallback(()=>{Z&&console.warn(`Tried removing localStorage key “${e}” even though environment is not a client`);const d=r instanceof Function?r():r;window.localStorage.removeItem(e),h(d),window.dispatchEvent(new StorageEvent("local-storage",{key:e}))},[e,r]);x.useEffect(()=>{h(a())},[e]);const m=x.useCallback(d=>{d.key&&d.key!==e||h(a())},[e,a]);return xe("storage",m),xe("local-storage",m),[s,u,p]}function Mt(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"})})}function Lt(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})}function Tt(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6",color:"currentColor"})})}function Rt(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6",color:"currentColor"})})}function At(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function Ht(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M21 22H3v-2h18zm0-18H3V2h18zm-11 9.7h4l-2-5.4zM11.2 6h1.7l4.7 12h-2l-.9-2.6H9.4L8.5 18h-2z"})})}function Ae(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:i.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4,d:"M36 19L24 31L12 19z"})})}function Pt(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M9 7v10h6v-2h-4V7z"})})}function Vt(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z"})})}function Nt(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M11 7c-1.1 0-2 .9-2 2v2a2 2 0 0 0 2 2h2v2H9v2h4c1.11 0 2-.89 2-2v-2a2 2 0 0 0-2-2h-2V9h4V7z"})})}function It(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6l1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6l-1.4-1.4z"})})}function Bt(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"})})}function Gt(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"})})}function Ot(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"})})}function Wt(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"})})}function He(){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:[i.jsx("path",{fill:"currentColor",d:"M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"}),i.jsx("path",{fill:"currentColor",d:"M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"})]})}function Pe(){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"icon",viewBox:"0 0 1024 1024",children:[i.jsx("path",{fill:"currentColor",d:"M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"}),i.jsx("path",{fill:"currentColor",d:"m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"})]})}function _t(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentColor",children:[i.jsx("path",{d:"M14.86 22h-4.312c-3.291 0-4.937 0-6.08-.798a4.2 4.2 0 0 1-.863-.805c-.855-1.066-.855-2.6-.855-5.67v-2.545c0-2.963 0-4.445.473-5.628c.761-1.903 2.37-3.403 4.41-4.113C8.9 2 10.49 2 13.667 2c1.816 0 2.723 0 3.448.252c1.166.406 2.085 1.263 2.52 2.35c.27.676.27 1.523.27 3.216V10"}),i.jsx("path",{d:"M2.75 12c0-1.84 1.506-3.333 3.364-3.333c.672 0 1.464.116 2.117-.057a1.67 1.67 0 0 0 1.19-1.179c.174-.647.057-1.432.057-2.098C9.478 3.493 10.984 2 12.84 2m.002 16h2.523m-4.949-4.15c-.126-.8-.281-.801-1.61-.85h-1.01c-.557 0-1.009.448-1.009 1v3c0 .552.452 1 1.01 1h1.816c.39 0 .803-.313.803-.7v-1.1c0-.11-.113-.304-.224-.304H9.068M12.842 13h1.261m0 0h1.262m-1.262 0v4.875M21.251 13h-2.523c-.557 0-1.009.448-1.009 1v1.5m0 0V18m0-2.5h2.523"})]})})}function Ut(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:i.jsx("path",{fill:"currentColor",d:"M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z"})})}function $t(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"4",children:[i.jsx("circle",{cx:"10",cy:"24",r:"4"}),i.jsx("circle",{cx:"38",cy:"10",r:"4"}),i.jsx("circle",{cx:"38",cy:"24",r:"4"}),i.jsx("circle",{cx:"38",cy:"38",r:"4"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M34 38H22V10h12M14 24h20"})]})})}function Ft(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:i.jsx("path",{fill:"currentColor",d:"M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z"})})}function qt(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548",color:"currentColor"})})}function Dt(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function Xt(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",children:[i.jsx("path",{d:"M18 11c0-.818 0-1.57-.152-1.937s-.441-.657-1.02-1.235l-4.736-4.736c-.499-.499-.748-.748-1.058-.896a2 2 0 0 0-.197-.082C10.514 2 10.161 2 9.456 2c-3.245 0-4.868 0-5.967.886a4 4 0 0 0-.603.603C2 4.59 2 6.211 2 9.456V14c0 3.771 0 5.657 1.172 6.828S6.229 22 10 22h8M11 2.5V3c0 2.828 0 4.243.879 5.121C12.757 9 14.172 9 17 9h.5"}),i.jsx("path",{d:"M5 14v2.5M5 19v-2.5M8 14v2.5M8 19v-2.5m-3 0h3m2-2.5h1.25m1.25 0h-1.25m0 0v5m3.25 0v-5l1.75 2.5L18 14v5m2-5v5h2"})]})})}const Ve={Bold:c.Bold,LoaderCircle:c.LoaderCircle,Italic:c.Italic,Underline:c.Underline,Quote:c.Quote,TextQuote:Lt,Strikethrough:c.Strikethrough,Minus:c.Minus,Eraser:c.Eraser,PaintRoller:c.PaintRoller,Redo2:c.Redo2,Undo2:c.Undo2,AlignCenter:W.TextAlignCenterIcon,AlignJustify:W.TextAlignJustifyIcon,AlignLeft:W.TextAlignLeftIcon,AlignRight:W.TextAlignRightIcon,ChevronDown:c.ChevronDown,Subscript:c.Subscript,Superscript:c.Superscript,Code:c.Code,Code2:c.CodeXml,Type:c.Type,IndentIncrease:c.IndentIncrease,IndentDecrease:c.IndentDecrease,List:c.List,ListOrdered:c.ListOrdered,ListTodo:c.ListTodo,Link:c.Link,ImageUp:c.ImageUp,Video:c.Video,Maximize:c.Maximize,Minimize:c.Minimize,Table:c.Table,Sparkles:c.Sparkles,Pencil:c.Pencil,Unlink:c.Unlink,BetweenHorizonalEnd:c.BetweenHorizonalEnd,BetweenHorizonalStart:c.BetweenHorizonalStart,BetweenVerticalStart:c.BetweenVerticalStart,BetweenVerticalEnd:c.BetweenVerticalEnd,TableCellsMerge:c.TableCellsMerge,TableCellsSplit:c.TableCellsSplit,Trash2:c.Trash2,Trash:c.Trash,Replace:c.Replace,ChevronsUpDown:c.ChevronsUpDown,LineHeight:Ht,Word:At,Heading1:c.Heading1,Heading2:c.Heading2,Heading3:c.Heading3,Heading4:c.Heading4,Heading5:c.Heading5,Heading6:c.Heading6,Columns2:c.Columns2,Columns3:c.Columns3,Columns4:c.Columns4,Plus:c.Plus,Grip:c.GripVertical,Copy:c.Copy,Clipboard:c.Clipboard,PanelLeft:c.PanelLeft,PanelRight:c.PanelRight,Columns:c.Columns2,Iframe:c.Frame,MenuDown:Ae,SizeS:Nt,SizeM:Vt,SizeL:Pt,AspectRatio:Mt,Emoji:c.SmilePlus,DeleteColumn:Tt,DeleteRow:Rt,SearchAndReplace:c.Replace,EmojiIcon:c.SmilePlusIcon,KatexIcon:c.Sigma,ExportPdf:He,ExportWord:Pe,ImportWord:Dt,ColumnAddLeft:Bt,ColumnAddRight:Gt,BookMarked:c.BookMarked,Excalidraw:Wt,ZoomIn:c.ZoomIn,ZoomOut:c.ZoomOut,Settings:c.Settings,Eye:c.Eye,TextDirection:Ot,LeftToRight:Ut,RightToLeft:Ft,Attachment:c.Paperclip,GifIcon:_t,ChevronUp:c.ChevronUp,Crop:c.CropIcon,Mermaid:$t,Twitter:qt,CodeView:It,FlipX:c.FlipVertical,FlipY:c.FlipHorizontal,PencilRuler:c.PencilRuler,WrapText:c.WrapText,Loader:c.Loader2,X:c.X,Html:Xt,ExternalLink:c.ExternalLink},be=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,we=Ce.clsx,Ne=(e,r)=>t=>{var o;if((r==null?void 0:r.variants)==null)return we(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:l,defaultVariants:n}=r,a=Object.keys(l).map(u=>{const p=t==null?void 0:t[u],m=n==null?void 0:n[u];if(p===null)return null;const d=be(p)||be(m);return l[u][d]}),s=t&&Object.entries(t).reduce((u,p)=>{let[m,d]=p;return d===void 0||(u[m]=d),u},{}),h=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((u,p)=>{let{class:m,className:d,...b}=p;return Object.entries(b).every(j=>{let[v,f]=j;return Array.isArray(f)?f.includes({...n,...s}[v]):{...n,...s}[v]===f})?[...u,m,d]:u},[]);return we(e,a,h,t==null?void 0:t.class,t==null?void 0:t.className)},Kt=Ne("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),re=je.forwardRef(({className:e,variant:r,size:t,...o},l)=>i.jsx(Se.Root,{ref:l,className:U(Kt({variant:r,size:t,className:e})),...o}));re.displayName=Se.Root.displayName;const Qt=I.Provider,Ie=I.Root,Be=I.Trigger,oe=je.forwardRef(({className:e,sideOffset:r=4,...t},o)=>i.jsx(I.Content,{"data-richtext-portal":!0,ref:o,sideOffset:r,className:U("richtext-z-50 richtext-overflow-hidden richtext-rounded-md richtext-bg-primary richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-primary-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2 !richtext-border-none",e),...t}));oe.displayName=I.Content.displayName;function ne(e){function r(){const n=x.useRef(e),a=x.useCallback(()=>n.current,[]),s=x.useRef(new Set),h=x.useCallback(p=>{n.current={...n.current,...p},s.current.forEach(m=>m())},[]),u=x.useCallback(p=>(s.current.add(p),()=>s.current.delete(p)),[]);return{get:a,set:h,subscribe:u}}const t=x.createContext(null);function o({children:n}){return i.jsx(t.Provider,{value:r(),children:n})}function l(n){const a=x.useContext(t);if(!a)throw new Error("Store not found");return[x.useSyncExternalStore(a.subscribe,()=>n(a.get()),()=>n(e)),a.set]}return{Provider:o,useStore:l}}ne({value:!1});ne({value:!1});const{Provider:Zt,useStore:Ge}=ne({value:!1});function Jt(){const[e]=Ge(r=>r.value);return e}const ve="data-rc-order",ye="data-rc-priority",Yt="rc-util-key",Y=new Map;function er(e,r){if(!e)return!1;if(e.contains)return e.contains(r);let t=r;for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Oe({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:Yt}function se(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function tr(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function We(e){return[...(Y.get(e)||e).children].filter(r=>r.tagName==="STYLE")}function _e(e,r={}){const{csp:t,prepend:o,priority:l=0}=r,n=tr(o),a=n==="prependQueue",s=document.createElement("style");s.setAttribute(ve,n),a&&l&&s.setAttribute(ye,`${l}`),t!=null&&t.nonce&&(s.nonce=t==null?void 0:t.nonce),s.innerHTML=e;const h=se(r),{firstChild:u}=h;if(o){if(a){const p=We(h).filter(m=>{if(!["prepend","prependQueue"].includes(m.getAttribute(ve)))return!1;const d=Number(m.getAttribute(ye)||0);return l>=d});if(p.length>0)return h.insertBefore(s,p.at(-1).nextSibling),s}u.before(s)}else h.append(s);return s}function Ue(e,r={}){const t=se(r);return We(t).find(o=>o.getAttribute(Oe(r))===e)}function $e(e,r={}){const t=Ue(e,r);t&&t.remove()}function rr(e,r){const t=Y.get(e);if(!t||!er(document,t)){const o=_e("",r),{parentNode:l}=o;Y.set(e,l),o.remove()}}function Fe(e,r,t={}){var a,s,h;const o=se(t);rr(o,t);const l=Ue(r,t);if(l)return(a=t.csp)!=null&&a.nonce&&l.nonce!==((s=t.csp)==null?void 0:s.nonce)&&(l.nonce=(h=t.csp)==null?void 0:h.nonce),l.innerHTML!==e&&(l.innerHTML=e),l;const n=_e(e,t);return n.setAttribute(Oe(t),r),n}const or=x.memo(({editor:e,children:r})=>{const[,t]=Ge(l=>l.value);x.useEffect(()=>{t({value:e==null?void 0:e.isEditable})},[e==null?void 0:e.isEditable]);const o=()=>{t({value:e==null?void 0:e.isEditable})};return x.useEffect(()=>(e&&e.on("update",o),()=>{e&&e.off("update",o)}),[e]),i.jsx(i.Fragment,{children:r})});function nr(){const[,e]=ge.x(ge.atomLang),r=o=>{e(l=>({...l,currentLang:o.detail}))},t=o=>{const{lang:l,messages:n}=o.detail;e(a=>{if(a.message[l]){const s={...a.message[l],...n};return{currentLang:a.currentLang,message:{...a.message,[l]:s}}}else return{currentLang:a.currentLang,message:{...a.message,[l]:n}}})};return x.useEffect(()=>{const o=k.listenEvent(k.EVENTS.CHANGE_LANGUAGE,r),l=k.listenEvent(k.EVENTS.MODIFY_LANGUAGE,t);return()=>{o(),l()}},[]),i.jsx(i.Fragment,{})}function sr(){const[e,r]=_("richtext-theme","light"),[t,o]=_("richtext-color","default"),[l,n]=_("richtext-border-radius","0.65rem");x.useEffect(()=>{const u=e||"light",p=t||"default";let m=pe.THEME[u][p];if(!m){m=pe.THEME.light.default;return}return Fe(`
|
|
2
|
-
.reactjs-tiptap-editor, .reactjs-tiptap-editor *,
|
|
3
|
-
div[data-richtext-portal], div[data-richtext-portal] * {
|
|
4
|
-
${Object.entries(m).map(([d,b])=>typeof l=="string"&&d==="radius"?`--${d}: ${l};`:`--${d}: ${b};`).join(`
|
|
5
|
-
`)}
|
|
6
|
-
}
|
|
7
|
-
`,"richtext-theme",{priority:50}),()=>{$e("richtext-theme")}},[e,t,l]);const a=u=>{r(u.detail)},s=u=>{o(u.detail)},h=u=>{n(u.detail)};return x.useEffect(()=>{const u=k.listenEvent(k.EVENTS.CHANGE_THEME,a),p=k.listenEvent(k.EVENTS.CHANGE_COLOR,s),m=k.listenEvent(k.EVENTS.CHANGE_BORDER_RADIUS,h);return()=>{u(),p(),m()}},[]),i.jsx(i.Fragment,{})}function ir({editor:e,children:r,id:t}){return i.jsxs(Zt,{children:[i.jsx(or,{editor:e,id:t,children:r}),i.jsx(nr,{}),i.jsx(sr,{})]})}exports.ActionButton=Et;exports.ExportPdf=He;exports.ExportWord=Pe;exports.MenuDown=Ae;exports.ProviderUniqueId=ir;exports.Toggle=re;exports.Tooltip=Ie;exports.TooltipContent=oe;exports.TooltipProvider=Qt;exports.TooltipTrigger=Be;exports.cn=U;exports.cva=Ne;exports.getShortcutKey=Te;exports.getShortcutKeys=Re;exports.icons=Ve;exports.removeCSS=$e;exports.updateCSS=Fe;exports.useEditableEditor=Jt;exports.useLocalStorage=_;
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { PluginKey as L, Plugin as z } from "@tiptap/pm/state";
|
|
2
|
-
import { DecorationSet as G, Decoration as H } from "@tiptap/pm/view";
|
|
3
|
-
import { e as J, f as Q } from "./index-CbIQPoF6.js";
|
|
4
|
-
import { c as V, s as W, f as X } from "./floating-ui.dom-U1vPFQ5f.js";
|
|
5
|
-
function Y(g) {
|
|
6
|
-
var a;
|
|
7
|
-
const { char: I, allowSpaces: w, allowToIncludeChar: y, allowedPrefixes: m, startOfLine: k, $position: v } = g, B = w && !y, h = J(I), O = new RegExp(`\\s${h}$`), S = k ? "^" : "", M = y ? "" : h, C = B ? new RegExp(`${S}${h}.*?(?=\\s${M}|$)`, "gm") : new RegExp(`${S}(?:^)?${h}[^\\s${M}]*`, "gm"), $ = ((a = v.nodeBefore) == null ? void 0 : a.isText) && v.nodeBefore.text;
|
|
8
|
-
if (!$)
|
|
9
|
-
return null;
|
|
10
|
-
const F = v.pos - $.length, l = Array.from($.matchAll(C)).pop();
|
|
11
|
-
if (!l || l.input === void 0 || l.index === void 0)
|
|
12
|
-
return null;
|
|
13
|
-
const e = l.input.slice(Math.max(0, l.index - 1), l.index), K = new RegExp(`^[${m == null ? void 0 : m.join("")}\0]?$`).test(e);
|
|
14
|
-
if (m !== null && !K)
|
|
15
|
-
return null;
|
|
16
|
-
const q = F + l.index;
|
|
17
|
-
let x = q + l[0].length;
|
|
18
|
-
return B && O.test($.slice(x - 1, x + 1)) && (l[0] += " ", x += 1), q < v.pos && x >= v.pos ? {
|
|
19
|
-
range: {
|
|
20
|
-
from: q,
|
|
21
|
-
to: x
|
|
22
|
-
},
|
|
23
|
-
query: l[0].slice(I.length),
|
|
24
|
-
text: l[0]
|
|
25
|
-
} : null;
|
|
26
|
-
}
|
|
27
|
-
var Z = new L("suggestion");
|
|
28
|
-
function tt({
|
|
29
|
-
pluginKey: g = Z,
|
|
30
|
-
editor: a,
|
|
31
|
-
char: I = "@",
|
|
32
|
-
allowSpaces: w = !1,
|
|
33
|
-
allowToIncludeChar: y = !1,
|
|
34
|
-
allowedPrefixes: m = [" "],
|
|
35
|
-
startOfLine: k = !1,
|
|
36
|
-
decorationTag: v = "span",
|
|
37
|
-
decorationClass: B = "suggestion",
|
|
38
|
-
decorationContent: h = "",
|
|
39
|
-
decorationEmptyClass: O = "is-empty",
|
|
40
|
-
command: S = () => null,
|
|
41
|
-
items: M = () => [],
|
|
42
|
-
render: C = () => ({}),
|
|
43
|
-
allow: $ = () => !0,
|
|
44
|
-
findSuggestionMatch: F = Y
|
|
45
|
-
}) {
|
|
46
|
-
let l;
|
|
47
|
-
const e = C == null ? void 0 : C(), K = () => {
|
|
48
|
-
const n = a.state.selection.$anchor.pos, r = a.view.coordsAtPos(n), { top: i, right: s, bottom: o, left: c } = r;
|
|
49
|
-
try {
|
|
50
|
-
return new DOMRect(c, i, s - c, o - i);
|
|
51
|
-
} catch {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
}, q = (n, r) => r ? () => {
|
|
55
|
-
const i = g.getState(a.state), s = i == null ? void 0 : i.decorationId, o = n.dom.querySelector(`[data-decoration-id="${s}"]`);
|
|
56
|
-
return (o == null ? void 0 : o.getBoundingClientRect()) || null;
|
|
57
|
-
} : K;
|
|
58
|
-
function x(n, r) {
|
|
59
|
-
var i;
|
|
60
|
-
try {
|
|
61
|
-
const o = g.getState(n.state), c = o != null && o.decorationId ? n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`) : null, d = {
|
|
62
|
-
// @ts-ignore editor is available in closure
|
|
63
|
-
editor: a,
|
|
64
|
-
range: (o == null ? void 0 : o.range) || { from: 0, to: 0 },
|
|
65
|
-
query: (o == null ? void 0 : o.query) || null,
|
|
66
|
-
text: (o == null ? void 0 : o.text) || null,
|
|
67
|
-
items: [],
|
|
68
|
-
command: (p) => S({ editor: a, range: (o == null ? void 0 : o.range) || { from: 0, to: 0 }, props: p }),
|
|
69
|
-
decorationNode: c,
|
|
70
|
-
clientRect: q(n, c)
|
|
71
|
-
};
|
|
72
|
-
(i = e == null ? void 0 : e.onExit) == null || i.call(e, d);
|
|
73
|
-
} catch {
|
|
74
|
-
}
|
|
75
|
-
const s = n.state.tr.setMeta(r, { exit: !0 });
|
|
76
|
-
n.dispatch(s);
|
|
77
|
-
}
|
|
78
|
-
const N = new z({
|
|
79
|
-
key: g,
|
|
80
|
-
view() {
|
|
81
|
-
return {
|
|
82
|
-
update: async (n, r) => {
|
|
83
|
-
var i, s, o, c, d, p, E;
|
|
84
|
-
const t = (i = this.key) == null ? void 0 : i.getState(r), f = (s = this.key) == null ? void 0 : s.getState(n.state), u = t.active && f.active && t.range.from !== f.range.from, R = !t.active && f.active, b = t.active && !f.active, P = !R && !b && t.query !== f.query, D = R || u && P, A = P || u, T = b || u && P;
|
|
85
|
-
if (!D && !A && !T)
|
|
86
|
-
return;
|
|
87
|
-
const _ = T && !D ? t : f, j = n.dom.querySelector(`[data-decoration-id="${_.decorationId}"]`);
|
|
88
|
-
l = {
|
|
89
|
-
editor: a,
|
|
90
|
-
range: _.range,
|
|
91
|
-
query: _.query,
|
|
92
|
-
text: _.text,
|
|
93
|
-
items: [],
|
|
94
|
-
command: (U) => S({
|
|
95
|
-
editor: a,
|
|
96
|
-
range: _.range,
|
|
97
|
-
props: U
|
|
98
|
-
}),
|
|
99
|
-
decorationNode: j,
|
|
100
|
-
clientRect: q(n, j)
|
|
101
|
-
}, D && ((o = e == null ? void 0 : e.onBeforeStart) == null || o.call(e, l)), A && ((c = e == null ? void 0 : e.onBeforeUpdate) == null || c.call(e, l)), (A || D) && (l.items = await M({
|
|
102
|
-
editor: a,
|
|
103
|
-
query: _.query
|
|
104
|
-
})), T && ((d = e == null ? void 0 : e.onExit) == null || d.call(e, l)), A && ((p = e == null ? void 0 : e.onUpdate) == null || p.call(e, l)), D && ((E = e == null ? void 0 : e.onStart) == null || E.call(e, l));
|
|
105
|
-
},
|
|
106
|
-
destroy: () => {
|
|
107
|
-
var n;
|
|
108
|
-
l && ((n = e == null ? void 0 : e.onExit) == null || n.call(e, l));
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
},
|
|
112
|
-
state: {
|
|
113
|
-
// Initialize the plugin's internal state.
|
|
114
|
-
init() {
|
|
115
|
-
return {
|
|
116
|
-
active: !1,
|
|
117
|
-
range: {
|
|
118
|
-
from: 0,
|
|
119
|
-
to: 0
|
|
120
|
-
},
|
|
121
|
-
query: null,
|
|
122
|
-
text: null,
|
|
123
|
-
composing: !1
|
|
124
|
-
};
|
|
125
|
-
},
|
|
126
|
-
// Apply changes to the plugin state from a view transaction.
|
|
127
|
-
apply(n, r, i, s) {
|
|
128
|
-
const { isEditable: o } = a, { composing: c } = a.view, { selection: d } = n, { empty: p, from: E } = d, t = { ...r }, f = n.getMeta(g);
|
|
129
|
-
if (f && f.exit)
|
|
130
|
-
return t.active = !1, t.decorationId = null, t.range = { from: 0, to: 0 }, t.query = null, t.text = null, t;
|
|
131
|
-
if (t.composing = c, o && (p || a.view.composing)) {
|
|
132
|
-
(E < r.range.from || E > r.range.to) && !c && !r.composing && (t.active = !1);
|
|
133
|
-
const u = F({
|
|
134
|
-
char: I,
|
|
135
|
-
allowSpaces: w,
|
|
136
|
-
allowToIncludeChar: y,
|
|
137
|
-
allowedPrefixes: m,
|
|
138
|
-
startOfLine: k,
|
|
139
|
-
$position: d.$from
|
|
140
|
-
}), R = `id_${Math.floor(Math.random() * 4294967295)}`;
|
|
141
|
-
u && $({
|
|
142
|
-
editor: a,
|
|
143
|
-
state: s,
|
|
144
|
-
range: u.range,
|
|
145
|
-
isActive: r.active
|
|
146
|
-
}) ? (t.active = !0, t.decorationId = r.decorationId ? r.decorationId : R, t.range = u.range, t.query = u.query, t.text = u.text) : t.active = !1;
|
|
147
|
-
} else
|
|
148
|
-
t.active = !1;
|
|
149
|
-
return t.active || (t.decorationId = null, t.range = { from: 0, to: 0 }, t.query = null, t.text = null), t;
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
props: {
|
|
153
|
-
// Call the keydown hook if suggestion is active.
|
|
154
|
-
handleKeyDown(n, r) {
|
|
155
|
-
var i, s, o, c;
|
|
156
|
-
const { active: d, range: p } = N.getState(n.state);
|
|
157
|
-
if (!d)
|
|
158
|
-
return !1;
|
|
159
|
-
if (r.key === "Escape" || r.key === "Esc") {
|
|
160
|
-
const t = N.getState(n.state), f = (i = l == null ? void 0 : l.decorationNode) != null ? i : null, u = f ?? (t != null && t.decorationId ? n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`) : null);
|
|
161
|
-
if (((s = e == null ? void 0 : e.onKeyDown) == null ? void 0 : s.call(e, { view: n, event: r, range: t.range })) || !1)
|
|
162
|
-
return !0;
|
|
163
|
-
const b = {
|
|
164
|
-
editor: a,
|
|
165
|
-
range: t.range,
|
|
166
|
-
query: t.query,
|
|
167
|
-
text: t.text,
|
|
168
|
-
items: [],
|
|
169
|
-
command: (P) => S({ editor: a, range: t.range, props: P }),
|
|
170
|
-
decorationNode: u,
|
|
171
|
-
// If we have a cached decoration node, use it for the clientRect
|
|
172
|
-
// to avoid another DOM lookup. If not, leave clientRect null and
|
|
173
|
-
// let consumer decide if they want to query.
|
|
174
|
-
clientRect: u ? () => u.getBoundingClientRect() || null : null
|
|
175
|
-
};
|
|
176
|
-
return (o = e == null ? void 0 : e.onExit) == null || o.call(e, b), x(n, g), !0;
|
|
177
|
-
}
|
|
178
|
-
return ((c = e == null ? void 0 : e.onKeyDown) == null ? void 0 : c.call(e, { view: n, event: r, range: p })) || !1;
|
|
179
|
-
},
|
|
180
|
-
// Setup decorator on the currently active suggestion.
|
|
181
|
-
decorations(n) {
|
|
182
|
-
const { active: r, range: i, decorationId: s, query: o } = N.getState(n);
|
|
183
|
-
if (!r)
|
|
184
|
-
return null;
|
|
185
|
-
const c = !(o != null && o.length), d = [B];
|
|
186
|
-
return c && d.push(O), G.create(n.doc, [
|
|
187
|
-
H.inline(i.from, i.to, {
|
|
188
|
-
nodeName: v,
|
|
189
|
-
class: d.join(" "),
|
|
190
|
-
"data-decoration-id": s,
|
|
191
|
-
"data-decoration-content": h
|
|
192
|
-
})
|
|
193
|
-
]);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
return N;
|
|
198
|
-
}
|
|
199
|
-
var lt = tt;
|
|
200
|
-
function rt(g, a) {
|
|
201
|
-
V({
|
|
202
|
-
getBoundingClientRect: () => Q(g.view, g.state.selection.from, g.state.selection.to)
|
|
203
|
-
}, a, {
|
|
204
|
-
placement: "bottom-start",
|
|
205
|
-
strategy: "absolute",
|
|
206
|
-
middleware: [W(), X()]
|
|
207
|
-
}).then(({ x: w, y, strategy: m }) => {
|
|
208
|
-
a.style.width = "max-content", a.style.position = m, a.style.left = `${w}px`, a.style.top = `${y}px`;
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
export {
|
|
212
|
-
tt as S,
|
|
213
|
-
lt as i,
|
|
214
|
-
rt as u
|
|
215
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const z=require("@tiptap/pm/state"),L=require("@tiptap/pm/view"),G=require("./index-BBNITgNi.cjs"),U=require("./floating-ui.dom-VCrc58uF.cjs");function Q(f){var l;const{char:y,allowSpaces:I,allowToIncludeChar:h,allowedPrefixes:m,startOfLine:k,$position:v}=f,B=I&&!h,q=G.escapeForRegEx(y),O=new RegExp(`\\s${q}$`),S=k?"^":"",M=h?"":q,C=B?new RegExp(`${S}${q}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${S}(?:^)?${q}[^\\s${M}]*`,"gm"),$=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!$)return null;const F=v.pos-$.length,a=Array.from($.matchAll(C)).pop();if(!a||a.input===void 0||a.index===void 0)return null;const e=a.input.slice(Math.max(0,a.index-1),a.index),K=new RegExp(`^[${m==null?void 0:m.join("")}\0]?$`).test(e);if(m!==null&&!K)return null;const _=F+a.index;let x=_+a[0].length;return B&&O.test($.slice(x-1,x+1))&&(a[0]+=" ",x+=1),_<v.pos&&x>=v.pos?{range:{from:_,to:x},query:a[0].slice(y.length),text:a[0]}:null}var V=new z.PluginKey("suggestion");function H({pluginKey:f=V,editor:l,char:y="@",allowSpaces:I=!1,allowToIncludeChar:h=!1,allowedPrefixes:m=[" "],startOfLine:k=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:q="",decorationEmptyClass:O="is-empty",command:S=()=>null,items:M=()=>[],render:C=()=>({}),allow:$=()=>!0,findSuggestionMatch:F=Q}){let a;const e=C==null?void 0:C(),K=()=>{const n=l.state.selection.$anchor.pos,i=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=i;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},_=(n,i)=>i?()=>{const r=f.getState(l.state),s=r==null?void 0:r.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return(o==null?void 0:o.getBoundingClientRect())||null}:K;function x(n,i){var r;try{const o=f.getState(n.state),c=o!=null&&o.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,d={editor:l,range:(o==null?void 0:o.range)||{from:0,to:0},query:(o==null?void 0:o.query)||null,text:(o==null?void 0:o.text)||null,items:[],command:p=>S({editor:l,range:(o==null?void 0:o.range)||{from:0,to:0},props:p}),decorationNode:c,clientRect:_(n,c)};(r=e==null?void 0:e.onExit)==null||r.call(e,d)}catch{}const s=n.state.tr.setMeta(i,{exit:!0});n.dispatch(s)}const N=new z.Plugin({key:f,view(){return{update:async(n,i)=>{var r,s,o,c,d,p,E;const t=(r=this.key)==null?void 0:r.getState(i),g=(s=this.key)==null?void 0:s.getState(n.state),u=t.active&&g.active&&t.range.from!==g.range.from,R=!t.active&&g.active,b=t.active&&!g.active,P=!R&&!b&&t.query!==g.query,D=R||u&&P,A=P||u,T=b||u&&P;if(!D&&!A&&!T)return;const w=T&&!D?t:g,j=n.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`);a={editor:l,range:w.range,query:w.query,text:w.text,items:[],command:J=>S({editor:l,range:w.range,props:J}),decorationNode:j,clientRect:_(n,j)},D&&((o=e==null?void 0:e.onBeforeStart)==null||o.call(e,a)),A&&((c=e==null?void 0:e.onBeforeUpdate)==null||c.call(e,a)),(A||D)&&(a.items=await M({editor:l,query:w.query})),T&&((d=e==null?void 0:e.onExit)==null||d.call(e,a)),A&&((p=e==null?void 0:e.onUpdate)==null||p.call(e,a)),D&&((E=e==null?void 0:e.onStart)==null||E.call(e,a))},destroy:()=>{var n;a&&((n=e==null?void 0:e.onExit)==null||n.call(e,a))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,i,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:d}=n,{empty:p,from:E}=d,t={...i},g=n.getMeta(f);if(g&&g.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(p||l.view.composing)){(E<i.range.from||E>i.range.to)&&!c&&!i.composing&&(t.active=!1);const u=F({char:y,allowSpaces:I,allowToIncludeChar:h,allowedPrefixes:m,startOfLine:k,$position:d.$from}),R=`id_${Math.floor(Math.random()*4294967295)}`;u&&$({editor:l,state:s,range:u.range,isActive:i.active})?(t.active=!0,t.decorationId=i.decorationId?i.decorationId:R,t.range=u.range,t.query=u.query,t.text=u.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,i){var r,s,o,c;const{active:d,range:p}=N.getState(n.state);if(!d)return!1;if(i.key==="Escape"||i.key==="Esc"){const t=N.getState(n.state),g=(r=a==null?void 0:a.decorationNode)!=null?r:null,u=g??(t!=null&&t.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e==null?void 0:e.onKeyDown)==null?void 0:s.call(e,{view:n,event:i,range:t.range}))||!1)return!0;const b={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:P=>S({editor:l,range:t.range,props:P}),decorationNode:u,clientRect:u?()=>u.getBoundingClientRect()||null:null};return(o=e==null?void 0:e.onExit)==null||o.call(e,b),x(n,f),!0}return((c=e==null?void 0:e.onKeyDown)==null?void 0:c.call(e,{view:n,event:i,range:p}))||!1},decorations(n){const{active:i,range:r,decorationId:s,query:o}=N.getState(n);if(!i)return null;const c=!(o!=null&&o.length),d=[B];return c&&d.push(O),L.DecorationSet.create(n.doc,[L.Decoration.inline(r.from,r.to,{nodeName:v,class:d.join(" "),"data-decoration-id":s,"data-decoration-content":q})])}}});return N}var W=H;function X(f,l){const y={getBoundingClientRect:()=>G.posToDOMRect(f.view,f.state.selection.from,f.state.selection.to)};U.computePosition(y,l,{placement:"bottom-start",strategy:"absolute",middleware:[U.shift(),U.flip()]}).then(({x:I,y:h,strategy:m})=>{l.style.width="max-content",l.style.position=m,l.style.left=`${I}px`,l.style.top=`${h}px`})}exports.Suggestion=H;exports.index_default=W;exports.updatePosition=X;
|