@frontify/fondue 12.0.0-beta.340 → 12.0.0-beta.341

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -36,7 +36,7 @@ ${L2("Ctrl+B")}`),type:u.getPluginType(e,l),icon:t.jsx(y0,{icon:t.jsx(S3,{})}),c
36
36
  `]},eh0={renderAfterEditable:Jd0};class SV extends l0{constructor(l){super(Wd0,{button:Xd0,showIn:[L0.BOTTOM,L0.TOP],...l})}plugins(){return[u.createComboboxPlugin(),u.createEmojiPlugin(eh0)]}}const th0="soft-break-plugin";class yV extends l0{constructor(l){super(th0,{...l})}plugins(){return[u.createSoftBreakPlugin()]}}const lh0="italic-plugin",C5="tw-italic",xV=({attributes:e,children:l})=>t.jsx("span",{...e,className:C5,children:l});class bV extends t0{constructor(l=u.MARK_ITALIC,c=xV){super(l,c)}}const ah0=({editor:e,id:l})=>t.jsx(I0,{id:l,children:t.jsx(u.MarkToolbarButton,{tooltip:p0(`Italic
37
37
  ${L2("Ctrl+I")}`),type:u.getPluginType(e,l),icon:t.jsx(y0,{icon:t.jsx(y3,{})}),classNames:M0(),styles:x0,actionHandler:"onMouseDown"})}),oh0=[{validNodeName:["EM","I"]},{validStyle:{fontStyle:"italic"}}];class HV extends l0{constructor(l){super(lh0,{button:ah0,markupElement:new bV,...l})}plugins(){return[u.createItalicPlugin({deserializeHtml:{rules:[...oh0,{validNodeName:["SPAN"],validClassName:C5}]},options:{hotkey:["mod+i","ctrl+i"]}})]}}const nh0=e=>!!e.match(/^(https?:\/\/|mailto:|tel:).+/),ch0=u.createComponentAs(e=>{var c;const l=u.useFloatingLinkInsert({...e,floatingOptions:{strategy:"fixed"}});return((c=l.style)==null?void 0:c.display)==="none"?null:u.createElementAs("div",l)}),rh0=u.createComponentAs(e=>{var c;const l=Lh0({...e,floatingOptions:{strategy:"fixed"}});return((c=l.style)==null?void 0:c.display)==="none"?null:u.createElementAs("div",l)});u.FloatingLink.EditRoot=rh0,u.FloatingLink.InsertRoot=ch0;const M5=u.FloatingLink,P1="link-plugin",ih0=()=>{const e=u.useFloatingLinkUrlInput({}),{styles:l}=M1();return t.jsx("div",{"data-test-id":"floating-link-edit",className:"tw-bg-white tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]",children:t.jsxs("span",{"data-test-id":"preview-link-flyout",className:"tw-flex tw-justify-between",children:[t.jsx("span",{style:l[P1],className:"tw-pointer-events-none",children:e.defaultValue}),t.jsxs("span",{className:"tw-flex tw-gap-2",children:[t.jsx("span",{role:"button",tabIndex:0,"data-test-id":"edit-link-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:t.jsx(M5.EditButton,{children:t.jsx(f3,{})})}),t.jsx("span",{role:"button",tabIndex:0,"data-test-id":"remove-link-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:t.jsx(M5.UnlinkButton,{children:t.jsx(b3,{})})})]})]})})},Y7=(e,l)=>{const c=u.getAboveNode(e,{match:{type:u.ELEMENT_LINK}});return Array.isArray(c)?l(c[0]):""},sh0=e=>Y7(e,l=>{var c,r;return((r=(c=l.chosenLink)==null?void 0:c.searchResult)==null?void 0:r.link)||""}),dh0=e=>Y7(e,l=>l.url||""),kV=e=>{var l,c;return e.url||((c=(l=e.chosenLink)==null?void 0:l.searchResult)==null?void 0:c.link)||""},hh0=e=>Y7(e,kV),Lh0=({floatingOptions:e,...l})=>{const c=u.useEditorRef(),r=u.usePlateSelectors().keyEditor(),i=u.useFloatingLinkSelectors().mode(),s=u.useFloatingLinkSelectors().isOpen(c.id),{triggerFloatingLinkHotkeys:d="command+k, ctrl+k"}=u.getPluginOptions(c,u.ELEMENT_LINK),h=o.useCallback(()=>{const g=u.getAboveNode(c,{match:{type:u.getPluginType(c,u.ELEMENT_LINK)}});if(g){const[,C]=g;return u.getRangeBoundingClientRect(c,{anchor:u.getStartPoint(c,C),focus:u.getEndPoint(c,C)})}return u.getDefaultBoundingClientRect()},[c]),L=s&&i==="edit",{update:f,style:w,floating:v}=u.useVirtualFloatingLink({editorId:c.id,open:L,getBoundingClientRect:h,...e});return o.useEffect(()=>{const g=hh0(c);if(g&&u.floatingLinkActions.url(g),c.selection&&u.someNode(c,{match:{type:u.getPluginType(c,u.ELEMENT_LINK)}})){u.floatingLinkActions.show("edit",c.id),f();return}u.floatingLinkSelectors.mode()==="edit"&&u.floatingLinkActions.hide()},[c,r,f]),u.useHotkeys(d,g=>{g.preventDefault(),u.floatingLinkSelectors.mode()==="edit"&&u.triggerFloatingLinkEdit(c)},{enableOnContentEditable:!0},[]),u.useFloatingLinkEnter(),u.useFloatingLinkEscape(),{style:{...w,zIndex:1},...l,ref:u.useComposedRef(l.ref,v)}},wh0=({state:e,onTextChange:l,onUrlChange:c,onToggleTab:r,onCancel:i,onSave:s,isValidUrlOrEmpty:d,hasValues:h,testId:L,children:f})=>t.jsxs("div",{"data-test-id":L,className:"tw-bg-white tw-rounded tw-shadow tw-p-7 tw-min-w-[400px] tw-overflow-y-auto",children:[t.jsx(t5,{label:{children:"Text",htmlFor:"linkText",required:!0},children:t.jsx(m1,{id:"linkText",value:e.text,placeholder:"Link Text",onChange:l})}),f,t.jsxs("div",{className:"tw-pt-5",children:[t.jsx(t5,{label:{children:"URL",htmlFor:"url",required:!0},children:t.jsx(m1,{id:"url",value:e.url,placeholder:"https://example.com",focusOnMount:!0,onChange:c})}),!d()&&t.jsx("div",{className:"tw-text-red-65 tw-mt-3",children:"Please enter a valid URL."})]}),t.jsx("div",{className:"tw-pt-5",children:t.jsx(g1,{value:"new-tab",label:"Open in new tab",state:e.newTab,onChange:r})}),t.jsx("div",{className:"tw-mt-3",children:t.jsxs("div",{className:"tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10",children:[t.jsx(H0,{onClick:i,size:n0.Medium,style:J.Default,emphasis:d0.Default,children:"Cancel"}),t.jsx(H0,{onClick:s,size:n0.Medium,icon:t.jsx(l3,{}),disabled:!d()||!h,children:"Save"})]})})]}),fh0={url:"",text:"",newTab:m0.Unchecked},uh0=()=>{const[e,l]=o.useReducer((c,r)=>{const{type:i,payload:s}=r;switch(i){case"NEW_TAB":return{...c,newTab:m0.Checked};case"SAME_TAB":return{...c,newTab:m0.Unchecked};case"URL":case"TEXT":case"INIT":return{...c,...s};default:return c}},fh0);return[e,l]},vh0=()=>{const e=u.useEditorRef(),[l,c]=uh0();o.useEffect(()=>{const w=sh0(e),v=dh0(e);c({type:"INIT",payload:{text:u.floatingLinkSelectors.text(),newTab:u.floatingLinkSelectors.newTab()?m0.Checked:m0.Unchecked,url:w&&v===""?w:u.floatingLinkSelectors.url()}})},[c,e]);const r=w=>{c({type:"TEXT",payload:{text:w}})},i=w=>{c({type:"URL",payload:{url:w}})},s=w=>{c(w?{type:"NEW_TAB"}:{type:"SAME_TAB"})},d=()=>{u.floatingLinkActions.hide()},h=w=>{!f()||!L||(u.floatingLinkActions.text(l.text),u.floatingLinkActions.url(l.url),u.floatingLinkActions.newTab(l.newTab===m0.Checked),u.submitFloatingLink(e)&&(w==null||w.preventDefault()))},L=l.url!==""&&l.text!=="",f=()=>{const{isUrl:w}=u.getPluginOptions(e,u.ELEMENT_LINK);return!l.url||w&&w(l.url)};return u.useHotkeys("enter",h,{enableOnFormTags:["INPUT"]},[]),{state:l,onTextChange:r,onUrlChange:i,onToggleTab:s,onCancel:d,onSave:h,hasValues:L,isValidUrlOrEmpty:f}},gh0=()=>t.jsx(wh0,{...vh0(),testId:"floating-link-insert"}),mh0=({readOnly:e})=>{const l=u.useFloatingLinkSelectors().isEditing();if(e)return null;const c=t.jsx(gh0,{}),r=l?c:t.jsx(ih0,{});return t.jsxs(t.Fragment,{children:[t.jsx(M5.InsertRoot,{children:c}),t.jsx(M5.EditRoot,{children:r})]})},Ah0=({id:e,editorId:l})=>{const c=u.usePlateEditorState(u.useEventPlateId(l)),r=!!u.isRangeInSameBlock(c,{at:c.selection}),i=M0(r);return t.jsx(I0,{id:e,children:t.jsx(u.LinkToolbarButton,{tooltip:p0(r?`Link
38
38
  ${L2("Ctrl+K")}`:"Links can only be set for a single text block."),icon:t.jsx(y0,{icon:t.jsx(s3,{})}),classNames:i,styles:x0,actionHandler:"onMouseDown"})})},Ch0=e=>({...u.useElementProps({...e,elementToAttributes:c=>({href:kV(c),target:c.target||"_self"})}),onMouseOver:c=>{c.stopPropagation()}}),Mh0=e=>{const l=Ch0(e),{attributes:c,children:r}=e,{styles:i}=M1();return t.jsx("a",{...c,href:l.href,target:l.target,style:i[P1],children:r})};class Ih0 extends t0{constructor(l=u.ELEMENT_LINK,c=Mh0){super(l,c)}}const zV=u.createPluginFactory({...u.createLinkPlugin(),renderAfterEditable:mh0,options:{isUrl:nh0,rangeBeforeOptions:{matchString:" ",skipInvalid:!0,afterMatch:!0},triggerFloatingLinkHotkeys:"command+k, ctrl+k"}});class pV extends l0{constructor({styles:c=z0[P1],...r}={}){super(P1,{button:Ah0,markupElement:new Ih0,...r});K(this,"styles",{});this.styles=c}plugins(){return[zV()]}}const E7="tw-border-b tw-border-dashed tw-border-line-x-strong tw-pb-5",TV=`${E7} tw-break-after-column tw-break-inside-avoid-column`,F0=e=>{const l=e.breakAfterColumn;return A([l==="active"&&TV,l==="inactive"&&E7])},G7=e=>A([F0(e),e.align?O7[e.align]:"tw-justify-start","tw-grid tw-grid-cols-[min-content_repeat(3,_auto)]"]),VV=({attributes:e,children:l,element:c})=>t.jsx("p",{className:G7(c),...e,children:t.jsx("span",{className:"tw-w-auto tw-min-w-[10px]",children:l})});class jV extends t0{constructor(l=u.ELEMENT_LIC,c=VV){super(l,c)}}const DV="text-style-plugin",I5="list-plugin",Zh0=(e,{options:{validLiChildrenTypes:l,isSoftBreak:c}})=>{const{insertBreak:r,deleteBackward:i,deleteForward:s,deleteFragment:d}=e;return c?e.insertSoftBreak=()=>{u.insertBreakList(e)||r()}:e.insertBreak=()=>{u.insertBreakList(e)||r()},e.deleteBackward=h=>{u.deleteBackwardList(e,h)||i(h)},e.deleteForward=h=>{u.deleteForwardList(e)||s(h)},e.deleteFragment=h=>{u.deleteFragmentList(e)||d(h)},e.insertFragment=u.insertFragmentList(e),e.normalizeNode=u.normalizeList(e,{validLiChildrenTypes:l}),e},w2="textStyle",FV=u.createPluginFactory({key:w2,isLeaf:!0});class W7 extends l0{constructor(c){super(I5,{leafMarkupElements:[new jV,new KV],...c});K(this,"isSoftBreak");this.isSoftBreak=(c==null?void 0:c.isSoftBreak)??!1}plugins(){return[u.createListPlugin({withOverrides:Zh0,options:{isSoftBreak:this.isSoftBreak}}),FV()]}}const Nh0=e=>u.getAboveNode(e,{match:{type:u.ELEMENT_LI},mode:"lowest"})||u.someNode(e,{match:{type:W0},mode:"lowest"}),Sh0=({editor:e,type:l,children:c})=>{const r=e!=null&&e.selection?u.getMark(e,w2)===l.id:u.someNode(e,{match:{type:l}});return t.jsx("button",{"data-test-id":"textstyle-option",type:"button",className:A(["tw-block tw-w-full tw-text-left tw-px-3 tw-py-2 tw-outline-none tw-cursor-pointer tw-truncate hover:tw-bg-box-neutral-hover hover:w-text-box-neutral-inverse-hover tw-max-h-20 tw-max-w-[15rem] tw-min-h-[2.25rem]",r?"tw-text-box-neutral-inverse tw-bg-box-neutral":"tw-text-text"]),onMouseDown:i=>{i.preventDefault(),i.stopPropagation(),!(!e||!e.selection)&&(u.setMarks(e,{[w2]:l.id}),Nh0(e)||u.toggleNodeType(e,{activeType:l.id,inactiveType:l.id}))},children:c})},yh0=({label:e,open:l,onClick:c},r)=>t.jsx("button",{ref:r,"data-test-id":"textstyle-dropdown-trigger",type:"button",className:"tw-cursor-pointer tw-h-8 tw-w-full",onMouseDown:i=>{i.preventDefault(),i.stopPropagation(),c()},children:t.jsxs("div",{className:A(["tw-relative tw-inline-flex tw-flex-row tw-items-center tw-justify-between tw-overflow-hidden tw-text-text tw-rounded tw-gap-1 tw-px-2 hover:tw-text-box-selected-inverse hover:tw-bg-box-selected tw-h-6 tw-w-28",l&&"tw-text-box-selected-inverse tw-bg-box-selected"]),children:[t.jsx("span",{className:"tw-text-xs tw-truncate",children:e}),t.jsx("div",{className:A(["tw-transition-transform",l&&"tw-rotate-180"]),children:t.jsx(t3,{})})]})}),xh0=o.forwardRef(yh0),bh0=e=>Array.isArray(e.children)?(e.children.find(c=>u.isText(c))??{})[w2]:u.ELEMENT_PARAGRAPH,Hh0=[u.ELEMENT_LI,u.ELEMENT_UL,u.ELEMENT_OL],kh0=e=>!e||!e.selection?[]:Array.from(u.getNodeEntries(e,{unhang:!0,at:e.selection,reverse:!0})).reduce((c,[r])=>{if(!u.isNode(r))return c;const i=r.type===u.ELEMENT_LIC||r.type===W0?bh0(r):r.textStyle;return i&&!c.includes(i)&&!Hh0.includes(i)&&c.push(i),c},[]),zh0=6,ph0=10,Th0={name:"vertical-positioning",phase:"read",fn:({state:e,name:l})=>{if(e.modifiersData[l]._skip)return;const{position:c,maxHeight:r}=d7(e.elements.reference,e.rects.popper.height,zh0+ph0,0);c==="top"&&(e.placement="top-start"),e.styles.popper={maxHeight:`${r}px`},e.reset=!0,e.modifiersData[l]._skip=!0},enabled:!0},Z5="Mixed";var j=(e=>(e.heading1="heading1",e.heading2="heading2",e.heading3="heading3",e.heading4="heading4",e.custom1="custom1",e.custom2="custom2",e.custom3="custom3",e.quote="quote",e.imageCaption="imageCaption",e.imageTitle="imageTitle",e.p="p",e))(j||{});const Vh0=e=>{const[l,c]=o.useState(!1),[r,i]=o.useState(null),[s,d]=o.useState(null),h=u.usePlateEditorState(e),L=kh0(h);let f=Z5;L.length===1?f=L[0]:L.length===0&&(f="p");const w=o.useCallback(()=>{c(g=>!g)},[c]),v=x1.usePopper(r,s,{placement:"bottom-start",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,6]}},{name:"flip",enabled:!1},Th0]});return o.useEffect(()=>{const g=C=>{if(l){const m=C.target;if(s&&s.contains(m)||r&&r.contains(m))return;c(!1)}};return document.addEventListener("pointerdown",g),()=>{document.removeEventListener("pointerdown",g)}},[l,s,c,r]),{state:{isOpen:l,toggle:w,editor:h},dropdownProps:{...v.attributes.popper,style:v.styles.popper},key:f,dropdownRef:d,triggerRef:i}},jh0=({editorId:e,textStyles:l=[]})=>{var v;const{state:{editor:c,toggle:r,isOpen:i},dropdownProps:s,triggerRef:d,dropdownRef:h,key:L}=Vh0(e);let f=Z5;const w=l.find(g=>{var C;return g.id===L&&((C=g.props)==null?void 0:C.label)});return w&&(f=((v=w.props)==null?void 0:v.label)||Z5),t.jsxs(t.Fragment,{children:[t.jsx(xh0,{label:f,open:i,onClick:r,ref:d}),i&&t.jsx("div",{className:"tw-divide-y tw-divide-line tw-bg-base tw-shadow-md tw-border tw-border-line tw-z-[1000] tw-overflow-auto tw-min-h-[40px]",ref:h,...s,children:l.map(g=>{var C;return t.jsx(Sh0,{editor:c,type:g,children:t.jsx("span",{style:g.styles??{},children:(C=g.props)==null?void 0:C.label})},g.id)})})]})},Dh0=({editorId:e,id:l,textStyles:c})=>t.jsx(I0,{id:l,children:t.jsx(jh0,{editorId:e,textStyles:c})}),Fh0=(e,l)=>c=>t.jsx(e,{...c,textStyles:l}),Bh0="textstyle-custom1-plugin";class Oh0 extends l0{constructor({styles:c=z0.custom1,...r}={}){super(j.custom1,{label:"Custom 1",markupElement:new Ph0,...r});K(this,"styles",{});this.styles=c}plugins(){return[Uh0(this.styles)]}}class Ph0 extends t0{constructor(l=Bh0,c=BV){super(l,c)}}const BV=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align;return t.jsx("p",{...l,className:A([i&&D0[i],F0(e)]),style:r,children:c})},Uh0=e=>u.createPluginFactory({key:j.custom1,isElement:!0,deserializeHtml:{rules:[{validClassName:j.custom1}]}})({component:l=>t.jsx(BV,{...l,styles:e})}),Qh0="textstyle-custom2-plugin";class Yh0 extends l0{constructor({styles:c=z0.custom2,...r}={}){super(j.custom2,{label:"Custom 2",markupElement:new Eh0,...r});K(this,"styles",{});this.styles=c}plugins(){return[Gh0(this.styles)]}}class Eh0 extends t0{constructor(l=Qh0,c=OV){super(l,c)}}const OV=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align;return t.jsx("p",{...l,className:A([i&&D0[i],F0(e)]),style:r,children:c})},Gh0=e=>u.createPluginFactory({key:j.custom2,isElement:!0,deserializeHtml:{rules:[{validClassName:j.custom2}]}})({component:l=>t.jsx(OV,{...l,styles:e})}),Wh0="textstyle-custom3-plugin";class qh0 extends l0{constructor({styles:c=z0.custom3,...r}={}){super(j.custom3,{label:"Custom 3",markupElement:new Kh0,...r});K(this,"styles",{});this.styles=c}plugins(){return[$h0(this.styles)]}}class Kh0 extends t0{constructor(l=Wh0,c=PV){super(l,c)}}const PV=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align;return t.jsx("p",{...l,className:A([i&&D0[i],F0(e)]),style:r,children:c})},$h0=e=>u.createPluginFactory({key:j.custom3,isElement:!0,deserializeHtml:{rules:[{validClassName:j.custom3}]}})({component:l=>t.jsx(PV,{...l,styles:e})}),Xh0="textstyle-heading1-plugin";class Jh0 extends l0{constructor({styles:c=z0.heading1,...r}={}){super(j.heading1,{label:"Heading 1",markupElement:new _h0,...r});K(this,"styles",{});this.styles=c}plugins(){return[Rh0(this.styles)]}}class _h0 extends t0{constructor(l=Xh0,c=q7){super(l,c)}}const q7=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align;return t.jsx("h1",{...l,className:A([i&&D0[i],F0(e)]),style:r,children:c})},Rh0=e=>u.createPluginFactory({key:j.heading1,isElement:!0,component:q7,deserializeHtml:{rules:[{validNodeName:["h1","H1"]}]}})({component:l=>t.jsx(q7,{...l,styles:e})}),eL0="textstyle-heading2-plugin";class tL0 extends l0{constructor({styles:c=z0.heading2,...r}={}){super(j.heading2,{label:"Heading 2",markupElement:new lL0,...r});K(this,"styles",{});this.styles=c}plugins(){return[aL0(this.styles)]}}class lL0 extends t0{constructor(l=eL0,c=K7){super(l,c)}}const K7=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align;return t.jsx("h2",{...l,className:A([i&&D0[i],F0(e)]),style:r,children:c})},aL0=e=>u.createPluginFactory({key:j.heading2,isElement:!0,component:K7,deserializeHtml:{rules:[{validNodeName:["h2","H2"]}]}})({component:l=>t.jsx(K7,{...l,styles:e})}),oL0="textstyle-heading3-plugin";class nL0 extends l0{constructor({styles:c=z0.heading3,...r}={}){super(j.heading3,{label:"Heading 3",markupElement:new cL0,...r});K(this,"styles",{});this.styles=c}plugins(){return[rL0(this.styles)]}}class cL0 extends t0{constructor(l=oL0,c=$7){super(l,c)}}const $7=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align;return t.jsx("h3",{...l,className:A([i&&D0[i],F0(e)]),style:r,children:c})},rL0=e=>u.createPluginFactory({key:j.heading3,isElement:!0,component:$7,deserializeHtml:{rules:[{validNodeName:["h3","H3"]}]}})({component:l=>t.jsx($7,{...l,styles:e})}),iL0="textstyle-heading4-plugin";class sL0 extends l0{constructor({styles:c=z0.heading4,...r}={}){super(j.heading4,{label:"Heading 4",markupElement:new dL0,...r});K(this,"styles",{});this.styles=c}plugins(){return[hL0(this.styles)]}}class dL0 extends t0{constructor(l=iL0,c=X7){super(l,c)}}const X7=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align;return t.jsx("h4",{...l,className:A([i&&D0[i],F0(e)]),style:r,children:c})},hL0=e=>u.createPluginFactory({key:j.heading4,isElement:!0,component:X7,deserializeHtml:{rules:[{validNodeName:["h4","H4"]}]}})({component:l=>t.jsx(X7,{...l,styles:e})}),LL0="textstyle-imageCaption-plugin";class wL0 extends l0{constructor({styles:c=z0.imageCaption,...r}={}){super(j.imageCaption,{label:"Image Caption",markupElement:new fL0,...r});K(this,"styles",{});this.styles=c}plugins(){return[uL0(this.styles)]}}class fL0 extends t0{constructor(l=LL0,c=J7){super(l,c)}}const J7=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align;return t.jsx("p",{...l,className:A([i&&D0[i],F0(e)]),style:r,children:c})},uL0=e=>u.createPluginFactory({key:j.imageCaption,isElement:!0,component:J7,deserializeHtml:{rules:[{validClassName:j.imageCaption}]}})({component:l=>t.jsx(J7,{...l,styles:e})}),vL0="textstyle-imageTitle-plugin";class gL0 extends l0{constructor({styles:c=z0.imageTitle,...r}={}){super(j.imageTitle,{label:"Image Title",markupElement:new mL0,...r});K(this,"styles",{});this.styles=c}plugins(){return[AL0(this.styles)]}}class mL0 extends t0{constructor(l=vL0,c=_7){super(l,c)}}const _7=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align;return t.jsx("p",{...l,className:A([i&&D0[i],F0(e)]),style:r,children:c})},AL0=e=>u.createPluginFactory({key:j.imageTitle,isElement:!0,component:_7,deserializeHtml:{rules:[{validClassName:j.imageTitle}]}})({component:l=>t.jsx(_7,{...l,styles:e})});class UV extends l0{constructor({styles:c=z0.p,...r}={}){super(j.p,{markupElement:new YV,label:"Body Text",...r});K(this,"styles",{});this.styles=c}plugins(){return[EV(this.styles)]}}const QV="tw-m-0 tw-px-0 tw-py-0",N5=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align,s=A([i&&D0[i],QV,F0(e)]);return t.jsx("p",{...l,className:s,style:r,children:c})};class YV extends t0{constructor(l=j.p,c=N5){super(l,c)}}const EV=e=>u.createPluginFactory({...u.createParagraphPlugin(),key:j.p,isElement:!0,component:N5})({component:l=>t.jsx(N5,{...l,styles:e})}),CL0="textstyle-quote-plugin";class ML0 extends l0{constructor({styles:c=z0.quote,...r}={}){super(j.quote,{label:"Quote",markupElement:new IL0,...r});K(this,"styles",{});this.styles=c}plugins(){return[GV(this.styles)]}}class IL0 extends t0{constructor(l=CL0,c=S5){super(l,c)}}const S5=({element:e,attributes:l,children:c,styles:r})=>{const i=e.align;return t.jsx("blockquote",{...l,className:A([i&&D0[i],F0(e)]),style:r,children:c})},GV=e=>u.createPluginFactory({key:j.quote,isElement:!0,component:S5,deserializeHtml:{rules:[{validNodeName:["blockquote","BLOCKQUOTE"]}]}})({component:l=>t.jsx(S5,{...l,styles:e})});class WV extends l0{constructor({...c}){super(DV,{button:Fh0(Dh0,c.textStyles),...c});K(this,"textStyles");this.textStyles=c.textStyles}plugins(){return this.textStyles.map(c=>c.plugins()).flat()}}const R7="[&>p]:before:tw-flex [&>p]:before:tw-justify-end [&>p]:before:tw-w-[1.2em] !tw-no-underline !tw-list-item",qV=({attributes:e,children:l,element:c})=>{const{styles:r}=M1();return t.jsx("li",{style:e4(c,r),...e,className:R7,children:l})};class KV extends t0{constructor(l=u.ELEMENT_LI,c=qV){super(l,c)}}const e4=(e,l)=>({...l[$V(e)??j.p],counterIncrement:"count"}),$V=e=>{let l;if(e.type==="a")l=e.children[0].textStyle;else if(e.children)for(const c of e.children){const r=$V(c);r&&(!l||r.startsWith(l))&&(l=r)}else l=e.textStyle;return l},ZL0=["[&>li>p]:before:tw-content-[counter(count,decimal)_'._']","[&>li>p]:before:tw-content-[counter(count,_lower-alpha)_'._']","[&>li>p]:before:tw-content-[counter(count,lower-roman)_'._']"],NL0=(e,l)=>{const c=u.findNodePath(e,l);if(!c)return 0;const r=u.getNodeAncestors(e,c);return Array.from(r).filter(i=>i[0].type===u.ELEMENT_LI).length},t4=e=>`tw-list-none tw-pl-[10px] tw-mb-[10px] tw-ml-[15px] [&>li>p]:before:tw-pr-1 [&>li>p]:before:tw-tabular-nums ${ZL0[e%3]}`,l4={counterReset:"count"},XV=({attributes:e,children:l,element:c})=>{const r=u.usePlateEditorRef(),i=NL0(r,c);return t.jsx("ol",{className:t4(i),...e,style:l4,children:l})};class JV extends t0{constructor(l=u.ELEMENT_OL,c=XV){super(l,c)}}const _V=({editor:e,id:l})=>t.jsx(I0,{id:l,children:t.jsx(u.ListToolbarButton,{tooltip:p0("Ordered list"),type:u.getPluginType(e,l),icon:t.jsx(y0,{icon:t.jsx(L3,{})}),classNames:M0(),styles:x0,actionHandler:"onMouseDown"})});class RV extends W7{constructor(l){super({id:I5,button:_V,markupElement:new JV,...l})}}const a4="[&>li>p]:before:tw-content-['•'] [&>li>p]:before:tw-px-2 tw-list-none tw-pl-[10px] tw-mb-[10px] tw-ml-[15px]",ej=({attributes:e,children:l})=>t.jsx("ul",{className:a4,...e,children:l});class tj extends t0{constructor(l=u.ELEMENT_UL,c=ej){super(l,c)}}const lj=({editor:e,id:l})=>t.jsx(I0,{id:l,children:t.jsx(u.ListToolbarButton,{tooltip:p0("Bullet list"),type:u.getPluginType(e,l),icon:t.jsx(y0,{icon:t.jsx(d3,{})}),classNames:M0(),styles:x0,actionHandler:"onMouseDown"})});class aj extends W7{constructor(l){super({id:I5,button:lj,markupElement:new tj,...l})}}class SL0{constructor(){K(this,"toolbarButtons",{[L0.BOTTOM]:[],[L0.FLOATING]:[],[L0.TOP]:[]})}createGroupOfButtons(l){const c=[],r=[],i=[];for(const{markupElement:s,button:d,id:h,showIn:L}of l){if(!d)continue;const f={id:(s==null?void 0:s.getId())||h,button:d};L.includes(L0.BOTTOM)&&c.push(f),L.includes(L0.TOP)&&r.push(f),L.includes(L0.FLOATING)&&i.push(f)}c.length>0&&this.toolbarButtons[L0.BOTTOM].push(c),r.length>0&&this.toolbarButtons[L0.TOP].push(r),i.length>0&&this.toolbarButtons[L0.FLOATING].push(i)}at(l){return this.toolbarButtons[l]}}class oj{constructor(l){K(this,"platePlugins",new Map);K(this,"markupElements",{});K(this,"inlineElements",[]);K(this,"toolbarButtons",new SL0);K(this,"styles",{});this.props=l}setPlugin(...l){for(const c of l){const r=Array.isArray(c)?c:[c];for(const i of r)this.addElement(i.markupElement),this.addElement(i.markupInputElement),this.addLeafElements(i.leafMarkupElements),this.addPlugin(i),this.addInline(i.inline()),i.styles&&this.addStyles(i.styles,i.id),i.textStyles&&this.addTextStylesOfSubPlugins(i.textStyles);this.hasToolbar&&this.toolbarButtons.createGroupOfButtons(r)}return this}addTextStylesOfSubPlugins(l){for(const c of l)c.styles&&this.addStyles(c.styles,c.id)}addLeafElements(l){if(l===void 0)return;const c=Array.isArray(l)?l:[l];for(const r of c)this.addElement(r)}addElement(l){if(l===void 0)return;const c=l.getId(),r=l.getNode();r&&!this.markupElements[c]&&(this.markupElements[c]=r)}addPlugin(l){l.id&&!this.platePlugins.has(l.id)&&this.platePlugins.set(l.id,l.plugins())}addInline(l){l&&this.inlineElements.push(l)}addStyles(l,c){this.styles[c]=l}get elements(){return{...this.defaultElementsFromPlugins,...this.markupElements}}get defaultElementsFromPlugins(){const l={};for(const c of this.platePlugins.values())for(const r of c){const{key:i,component:s}=r;s&&(l[i]=s)}return l}get plugins(){const l=[];for(const c of this.platePlugins.values())l.push(...c);return l}get buttons(){return this.toolbarButtons}get inline(){return this.inlineElements}get hasToolbar(){var l;return!((l=this.props)!=null&&l.noToolbar)}get getStyles(){return this.styles}}const nj="reset-formatting-plugin",cj="reset-formatting",yL0=e=>{!e||!e.selection||(u.removeMark(e,{key:[u.MARK_BOLD,u.MARK_ITALIC,u.MARK_CODE,u.MARK_UNDERLINE,u.MARK_STRIKETHROUGH]}),u.unwrapList(e,{}),u.setElements(e,{type:u.ELEMENT_PARAGRAPH,align:void 0}))},xL0=u.withPlateProvider(({id:e,...l})=>{const c=u.usePlateEditorState(u.useEventPlateId(e));return t.jsx(u.ToolbarButton,{tooltip:p0("Clear formatting"),onMouseDown:()=>{yL0(c)},...l})}),bL0=({id:e})=>t.jsx(I0,{id:e,children:t.jsx(xL0,{icon:t.jsx(y0,{icon:t.jsx(c3,{})}),classNames:M0(),styles:x0})}),rj=u.createPluginFactory({key:cj,isElement:!1});class ij extends l0{constructor(l){super(nj,{button:bL0,...l})}plugins(){return[rj()]}}const HL0="strikethrough-plugin",o4="!tw-line-through",sj=({attributes:e,children:l})=>t.jsx("span",{...e,className:o4,children:l});class dj extends t0{constructor(l=u.MARK_STRIKETHROUGH,c=sj){super(l,c)}}const kL0=({editor:e,id:l})=>t.jsx(I0,{id:l,children:t.jsx(u.MarkToolbarButton,{tooltip:p0("Strikethrough"),type:u.getPluginType(e,l),icon:t.jsx(y0,{icon:t.jsx(JH,{})}),classNames:M0(),styles:x0,actionHandler:"onMouseDown"})});class hj extends l0{constructor(l){super(HL0,{button:kL0,markupElement:new dj,...l})}plugins(){return[u.createStrikethroughPlugin()]}}const zL0="underline-plugin",y5="tw-underline",Lj=({attributes:e,children:l})=>t.jsx("span",{...e,className:y5,children:l});class wj extends t0{constructor(l=u.MARK_UNDERLINE,c=Lj){super(l,c)}}const pL0=({editor:e,id:l})=>t.jsx(I0,{id:l,children:t.jsx(u.MarkToolbarButton,{tooltip:p0(`Underline
39
- ${L2("Ctrl+U")}`),type:u.getPluginType(e,l),icon:t.jsx(y0,{icon:t.jsx(x3,{})}),classNames:M0(),styles:x0,actionHandler:"onMouseDown"})}),TL0=[{validNodeName:["U"]},{validStyle:{textDecoration:["underline"]}}];class fj extends l0{constructor(l){super(zL0,{button:pL0,markupElement:new wj,...l})}plugins(){return[u.createUnderlinePlugin({deserializeHtml:{rules:[...TL0,{validNodeName:["SPAN"],validClassName:y5}]},options:{hotkey:["mod+u","ctrl+u"]}})]}}const VL0="autoformat-plugin";class jL0 extends l0{constructor(l){super(VL0,{...l})}plugins(){return[u.createAutoformatPlugin({options:{rules:[...u.autoformatPunctuation,...u.autoformatArrow,...u.autoformatLegal,...u.autoformatSubscriptNumbers,...u.autoformatSubscriptSymbols,...u.autoformatSuperscriptNumbers,...u.autoformatSuperscriptSymbols,{mode:"mark",type:[u.MARK_UNDERLINE],match:["_","_"],ignoreTrim:!0},{mode:"mark",type:[u.MARK_BOLD],match:["**","**"],ignoreTrim:!0},{mode:"mark",type:[u.MARK_ITALIC],match:["*","*"],ignoreTrim:!0},{mode:"mark",type:[u.MARK_STRIKETHROUGH],match:["~~","~~"],ignoreTrim:!0},{mode:"mark",type:[u.MARK_CODE],match:["`","`"],ignoreTrim:!0},{mode:"block",match:["# "],type:j.heading1},{mode:"block",match:["## "],type:j.heading2},{mode:"block",match:["### "],type:j.heading3},{mode:"block",match:["#### "],type:j.heading4},{mode:"block",type:u.ELEMENT_UL,match:["- "],preFormat:u.unwrapList,format:l=>u.toggleList(l,{type:u.ELEMENT_UL})},{mode:"block",type:u.ELEMENT_OL,match:["1. ","1) "],preFormat:u.unwrapList,format:l=>u.toggleList(l,{type:u.ELEMENT_OL})},{mode:"block",type:W0,match:["[] "]}]}})]}}const uj=e=>Array.from(u.getNodeEntries(e,{at:[],match:l=>!!l.breakAfterColumn})).length,f2=(e,{key:l=U1,value:c,at:r})=>{const i=s=>u.isBlock(e,s);c?u.setElements(e,{[l]:c},{mode:"lowest",match:i,at:r}):u.unsetNodes(e,l,{match:i,mode:"lowest",at:r})},DL0=(e,l,c)=>{f2(e,{at:l,value:c})},n4=(e,l)=>{const c=Array.from(u.getNodeEntries(e,{at:[],match:r=>!!r.breakAfterColumn}));for(const[r,[,i]]of c.entries())DL0(e,i,r<l-1?"active":"inactive")},vj=(e,l,c)=>{if(c.preventDefault(),c.stopPropagation(),!!(e!=null&&e.selection)&&u.someNode(e,{match:i=>!!i.breakAfterColumn}))f2(e,{value:void 0});else{const i=uj(e),s=Math.max(l-i-1,0);if(s===0)return;const d=Array.from(u.getNodeEntries(e,{at:e.selection,match:h=>u.isBlock(e,h),mode:"lowest"})).slice(-s);for(const h of d)f2(e,{value:"active",at:h[1]})}n4(e,l)},FL0=(e,{options:{hotkey:l}})=>c=>{var r;if(!c.defaultPrevented&&l&&WF(l,c)){const i=e.plugins.find(d=>d.key===U1),s=((r=i==null?void 0:i.options)==null?void 0:r.columns)??1;vj(e,s,c)}},BL0=({id:e,...l})=>{var L,f;const c=u.usePlateEditorState(u.useEventPlateId(e)),r=!!(c!=null&&c.selection)&&u.someNode(c,{match:w=>!!w.breakAfterColumn}),i=(f=(L=c==null?void 0:c.pluginsByKey.breakAfterColumn)==null?void 0:L.options)==null?void 0:f.columns,s=Number(i)||1,d=OL0(c,s,r),h=M0(d);return t.jsx(u.ToolbarButton,{active:r,tooltip:p0(d?`Column Break
39
+ ${L2("Ctrl+U")}`),type:u.getPluginType(e,l),icon:t.jsx(y0,{icon:t.jsx(x3,{})}),classNames:M0(),styles:x0,actionHandler:"onMouseDown"})}),TL0=[{validNodeName:["U"]},{validStyle:{textDecoration:["underline"]}}];class fj extends l0{constructor(l){super(zL0,{button:pL0,markupElement:new wj,...l})}plugins(){return[u.createUnderlinePlugin({deserializeHtml:{rules:[...TL0,{validNodeName:["SPAN"],validClassName:y5}]},options:{hotkey:["mod+u","ctrl+u"]}})]}}const VL0="autoformat-plugin";class jL0 extends l0{constructor(l){super(VL0,{...l})}plugins(){return[u.createAutoformatPlugin({options:{rules:[...u.autoformatPunctuation,...u.autoformatArrow,...u.autoformatLegal,...u.autoformatSubscriptNumbers,...u.autoformatSubscriptSymbols,...u.autoformatSuperscriptNumbers,...u.autoformatSuperscriptSymbols,...u.autoformatFraction,{mode:"mark",type:[u.MARK_UNDERLINE],match:["_","_"],ignoreTrim:!0},{mode:"mark",type:[u.MARK_BOLD],match:["**","**"],ignoreTrim:!0},{mode:"mark",type:[u.MARK_ITALIC],match:["*","*"],ignoreTrim:!0},{mode:"mark",type:[u.MARK_STRIKETHROUGH],match:["~~","~~"],ignoreTrim:!0},{mode:"mark",type:[u.MARK_CODE],match:["`","`"],ignoreTrim:!0},{mode:"block",match:["# "],type:j.heading1},{mode:"block",match:["## "],type:j.heading2},{mode:"block",match:["### "],type:j.heading3},{mode:"block",match:["#### "],type:j.heading4},{mode:"block",type:u.ELEMENT_UL,match:["- "],preFormat:u.unwrapList,format:l=>u.toggleList(l,{type:u.ELEMENT_UL})},{mode:"block",type:u.ELEMENT_OL,match:["1. ","1) "],preFormat:u.unwrapList,format:l=>u.toggleList(l,{type:u.ELEMENT_OL})},{mode:"block",type:W0,match:["[] "]}]}})]}}const uj=e=>Array.from(u.getNodeEntries(e,{at:[],match:l=>!!l.breakAfterColumn})).length,f2=(e,{key:l=U1,value:c,at:r})=>{const i=s=>u.isBlock(e,s);c?u.setElements(e,{[l]:c},{mode:"lowest",match:i,at:r}):u.unsetNodes(e,l,{match:i,mode:"lowest",at:r})},DL0=(e,l,c)=>{f2(e,{at:l,value:c})},n4=(e,l)=>{const c=Array.from(u.getNodeEntries(e,{at:[],match:r=>!!r.breakAfterColumn}));for(const[r,[,i]]of c.entries())DL0(e,i,r<l-1?"active":"inactive")},vj=(e,l,c)=>{if(c.preventDefault(),c.stopPropagation(),!!(e!=null&&e.selection)&&u.someNode(e,{match:i=>!!i.breakAfterColumn}))f2(e,{value:void 0});else{const i=uj(e),s=Math.max(l-i-1,0);if(s===0)return;const d=Array.from(u.getNodeEntries(e,{at:e.selection,match:h=>u.isBlock(e,h),mode:"lowest"})).slice(-s);for(const h of d)f2(e,{value:"active",at:h[1]})}n4(e,l)},FL0=(e,{options:{hotkey:l}})=>c=>{var r;if(!c.defaultPrevented&&l&&WF(l,c)){const i=e.plugins.find(d=>d.key===U1),s=((r=i==null?void 0:i.options)==null?void 0:r.columns)??1;vj(e,s,c)}},BL0=({id:e,...l})=>{var L,f;const c=u.usePlateEditorState(u.useEventPlateId(e)),r=!!(c!=null&&c.selection)&&u.someNode(c,{match:w=>!!w.breakAfterColumn}),i=(f=(L=c==null?void 0:c.pluginsByKey.breakAfterColumn)==null?void 0:L.options)==null?void 0:f.columns,s=Number(i)||1,d=OL0(c,s,r),h=M0(d);return t.jsx(u.ToolbarButton,{active:r,tooltip:p0(d?`Column Break
40
40
  Shift+Ctrl+Return`:"Already at maximum numbers of columns"),onMouseDown:w=>vj(c,s,w),...l,classNames:h})},OL0=(e,l,c)=>uj(e)+1<l||c,gj=({id:e})=>t.jsx(I0,{id:e,children:t.jsx(BL0,{icon:t.jsx(y0,{icon:t.jsx(N3,{})}),classNames:M0(),styles:x0})}),PL0=(e,l)=>{const c=u.getStartPoint(e,l);setTimeout(()=>{u.select(e,{anchor:c,focus:c})})},UL0=e=>{var c;const l=e.plugins.find(r=>r.key===U1);return((c=l==null?void 0:l.options)==null?void 0:c.columns)??1},QL0=e=>{const{apply:l}=e,c=UL0(e);e.apply=r=>{switch(r.type){case"split_node":r.properties={...r.properties,breakAfterColumn:void 0};break;case"merge_node":const i=u.getPointBefore(e,r.path);if(!i)break;const s=u.getParentNode(e,i.path);if(f2(e,{at:i,value:void 0}),n4(e,c),s!=null&&s[0].breakAfterColumn)return PL0(e,r.path),e;break}l(r)},setTimeout(()=>n4(e,c))},U1="breakAfterColumn",c4="normal";class YL0 extends l0{constructor(c){super("break-after-plugin",{button:gj,...c});K(this,"columns");K(this,"gap");this.columns=(c==null?void 0:c.columns)??1,this.gap=(c==null?void 0:c.gap)??c4}plugins(){return[mj(this.columns,this.gap)]}}const mj=(e,l)=>u.createPluginFactory({key:U1,handlers:{onKeyDown:FL0},useHooks:QL0,options:{columns:e,gap:l,hotkey:["shift+ctrl+enter"]}})(),EL0=12,GL0=26,WL0=124,qL0=e=>e.map((l,c)=>({group:l,buttonGroupWidth:l.reduce((r,i)=>i.id===DV?WL0:GL0+r,EL0),index:c})),KL0=(e,l)=>l.reduce((c,{group:r,buttonGroupWidth:i,index:s})=>{const d=Math.max(0,c.length-1);return c[d]=c[d]??[],(c[d]??[{actions:[],buttonGroupWidth:0}]).reduce((L,{buttonGroupWidth:f})=>L+f,0)+i<=e?c[d].push({group:r,buttonGroupWidth:i,index:s}):c.push([{group:r,buttonGroupWidth:i,index:s}]),c.filter(L=>L.length)},[]),$L0=({index:e,children:l})=>t.jsx("div",{"data-test-id":`toolbar-group-${e}`,className:"tw-flex tw-items-center tw-h-9 tw-p-2",children:l}),XL0=({toolbarButtons:e,editorId:l,toolbarWidth:c})=>{const r=u.usePlateEditorRef(l),{editorWidth:i}=nV(),{position:s}=M1(),d=c||i||0,h=qL0(e.at(s)),L=KL0(d,h),f=xj[s];return t.jsx(f.ToolbarWrapper,{editorWidth:i,toolbarWidth:c,toolbarButtonGroups:L,children:L.map((w,v)=>t.jsx("div",{className:"tw-divide-x tw-divide-line tw-flex tw-w-full tw-flex-wrap",children:w.map(({group:g,index:C})=>t.jsx($L0,{index:C,children:g.map((m,I)=>t.jsx(m.button,{editor:r,editorId:l,id:m.id},I.toString()))},C))},v))})},Aj=e=>u.createPlugins(e.plugins,{components:u.createPlateUI(e.elements)}),r4=(e,l)=>({create:()=>Aj(l),toolbar:c=>l.hasToolbar?t.jsx(XL0,{toolbarButtons:l.buttons,editorId:e,toolbarWidth:c}):null,inline:()=>t.jsx(t.Fragment,{children:l.inline.map((c,r)=>t.jsx(c,{},r))}),styles:()=>l.getStyles}),JL0="mention-plugin",_L0=e=>l=>l.text.toLowerCase().includes(e.toLowerCase()),i4=(e,l)=>`${e}:${l}`,s4=e=>{const l=new Map;for(const c of e){const r=i4(c.data.category,c.data.id),i=c.text;l.set(r,i)}return l},Cj=(e,l,c)=>e.get(l)??c;var R0=(e=>(e.GROUP="group",e.ALL="all",e.USER="user",e))(R0||{});const d4=({attributes:e,element:l,nodeProps:c,children:r})=>t.jsx("span",{...e,dir:"auto","data-slate-value":l==null?void 0:l.value,"data-slate-key":l==null?void 0:l.key,"data-slate-category":l==null?void 0:l.category,contentEditable:!1,style:{lineHeight:"10px",padding:"1px",margin:"0 1px",fontWeight:"bold",verticalAlign:"baseline",display:"inline-block",borderRadius:"2px",backgroundColor:"rgb(227, 232, 246)",color:"rgb(130, 95, 255)"},...c,children:r}),RL0=({children:e,...l})=>t.jsxs(d4,{...l,children:[t.jsx("span",{style:{paddingRight:"3px",display:"inline-block",margin:"-1px 0"},children:t.jsx(z2,{})}),e]}),ew0=({children:e,...l})=>t.jsxs(d4,{...l,children:["@",e]}),tw0=({children:e,...l})=>t.jsx(d4,{...l,children:e}),lw0=({category:e,children:l,...c})=>{const r={[R0.USER]:tw0,[R0.GROUP]:RL0,[R0.ALL]:ew0},i=r[e]??r[R0.USER];return t.jsx(i,{...c,children:l})},h4=e=>l=>{const{element:c,children:r}=l,i=i4(c==null?void 0:c.category,String(c==null?void 0:c.id));return t.jsxs(lw0,{category:c==null?void 0:c.category,...l,children:[Cj(e,i,String(c==null?void 0:c.id)),r]})};class Mj extends t0{constructor(l=u.ELEMENT_MENTION){super(l)}setNodeWithMentionable(l){return this.node=h4(s4(l)),this}}const aw0=({image:e,category:l,text:c,id:r})=>{if(e)return t.jsx("img",{src:e,alt:`${r}-${l}-${c}`});switch(l){case R0.GROUP:return t.jsx(z2,{});case R0.ALL:return t.jsx(m3,{});default:return t.jsx(u3,{})}},ow0=({item:e})=>{const{data:{image:l,category:c},key:r,text:i}=e;return t.jsxs("div",{className:"tw-flex tw-items-center tw-w-full tw-min-h-[inherit]",children:[t.jsx("span",{className:"tw-flex tw-items-center tw-justify-center tw-rounded-full tw-mr-2.5 tw-bg-base-alt tw-border tw-border-line-weak tw-w-[22px] tw-h-[22px] tw-shrink-0 tw-overflow-hidden group-hover:tw-border-base group-aria-selected:tw-border-base",children:t.jsx(aw0,{image:l,category:c,text:i,id:r})}),t.jsx("span",{className:"tw-whitespace-nowrap tw-overflow-hidden tw-text-ellipsis",children:i})]})},Ij=[`
41
41
  color: var(--text-color-weak);
42
42
  padding-left: 1.25rem;