@payloadcms/richtext-lexical 3.56.0-internal.299316b → 3.56.0-internal.72f4fd2
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/exports/client/Field-PKJPWZJL.js +2 -0
- package/dist/exports/client/{Field-SOED2PIU.js.map → Field-PKJPWZJL.js.map} +2 -2
- package/dist/exports/client/chunk-CYLMY5ZJ.js +2 -0
- package/dist/exports/client/{chunk-FSKAVN4P.js.map → chunk-CYLMY5ZJ.js.map} +2 -2
- package/dist/exports/client/chunk-YCH4JNUH.js +12 -0
- package/dist/exports/client/{chunk-KZKGNMS3.js.map → chunk-YCH4JNUH.js.map} +2 -2
- package/dist/exports/client/{component-M3U253XK.js → component-3PENNOM3.js} +2 -2
- package/dist/exports/client/index.d.ts +2 -0
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +10 -10
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/blocks/client/component/BlockContent.js +8 -10
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +3 -5
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +20 -37
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +28 -53
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +35 -37
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +20 -30
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/field/RenderLexical/index.d.ts +23 -0
- package/dist/field/RenderLexical/index.d.ts.map +1 -0
- package/dist/field/RenderLexical/index.js +124 -0
- package/dist/field/RenderLexical/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.js +22 -35
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +7 -15
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +7 -15
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +75 -141
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +2 -11
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/nodeTypes.d.ts +13 -1
- package/dist/nodeTypes.d.ts.map +1 -1
- package/dist/nodeTypes.js +4 -1
- package/dist/nodeTypes.js.map +1 -1
- package/dist/utilities/buildEditorState.d.ts +11 -0
- package/dist/utilities/buildEditorState.d.ts.map +1 -0
- package/dist/utilities/buildEditorState.js +76 -0
- package/dist/utilities/buildEditorState.js.map +1 -0
- package/package.json +10 -10
- package/dist/exports/client/Field-SOED2PIU.js +0 -2
- package/dist/exports/client/chunk-FSKAVN4P.js +0 -2
- package/dist/exports/client/chunk-KZKGNMS3.js +0 -12
- /package/dist/exports/client/{component-M3U253XK.js.map → component-3PENNOM3.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use client";import{a as me,c as
|
|
1
|
+
"use client";import{a as me,c as _o,d as To,e as wo}from"./chunk-3BY5IZJD.js";import{a as nt}from"./chunk-DBWINSQN.js";import{a as rt,b as At,c as Ue}from"./chunk-CYLMY5ZJ.js";import{a as de}from"./chunk-INBEEENE.js";import{a as ka}from"./chunk-F26IQ5RE.js";import{a as re,b as Ot,d as Pr,e as Br,f as _a,g as Ta,i as wa,k as Ea,l as Sa}from"./chunk-YCH4JNUH.js";import{a as ba,b as H}from"./chunk-BZZVLW4U.js";function Z(t){return{items:t,key:"basic",label:({i18n:e})=>e.t("lexical:general:slashMenuBasicGroupLabel")}}import{$isElementNode as Se,$isRangeSelection as $t,FORMAT_ELEMENT_COMMAND as Pt}from"lexical";import{jsx as Eo,jsxs as Na}from"react/jsx-runtime";import"react";var Hr=()=>Na("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Eo("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Eo("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Eo("path",{d:"M5 15H15",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as So,jsxs as La}from"react/jsx-runtime";import"react";var jr=()=>La("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[So("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),So("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),So("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as No,jsxs as ya}from"react/jsx-runtime";import"react";var Ft=()=>ya("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[No("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),No("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),No("path",{d:"M2.5 15H12.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Lo,jsxs as Ia}from"react/jsx-runtime";import"react";var Ur=()=>Ia("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Lo("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Lo("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Lo("path",{d:"M7.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});var y=t=>o=>{let r={clientFeatureProps:o};if(typeof t=="function")r.feature=({config:n,featureClientImportMap:l,featureClientSchemaMap:i,featureProviderMap:s,field:u,resolvedFeatures:c,schemaPath:d,unSanitizedEditorConfig:a})=>{let p=t({config:n,featureClientImportMap:l,featureClientSchemaMap:i,featureProviderMap:s,field:u,props:o,resolvedFeatures:c,schemaPath:d,unSanitizedEditorConfig:a});return p.sanitizedClientFeatureProps===null&&(p.sanitizedClientFeatureProps=o),p};else{let n={...t};n.sanitizedClientFeatureProps=o,r.feature=n}return r};var Gr=t=>({type:"dropdown",ChildComponent:Ft,items:t,key:"align",order:30});var Wr=[Gr([{ChildComponent:Ft,isActive:({selection:t})=>{if(!$t(t))return!1;for(let e of t.getNodes()){if(Se(e)&&e.getFormatType()==="left")continue;let o=e.getParent();if(!(Se(o)&&o.getFormatType()==="left"))return!1}return!0},key:"alignLeft",label:({i18n:t})=>t.t("lexical:align:alignLeftLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Pt,"left")},order:1},{ChildComponent:Hr,isActive:({selection:t})=>{if(!$t(t))return!1;for(let e of t.getNodes()){if(Se(e)&&e.getFormatType()==="center")continue;let o=e.getParent();if(!(Se(o)&&o.getFormatType()==="center"))return!1}return!0},key:"alignCenter",label:({i18n:t})=>t.t("lexical:align:alignCenterLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Pt,"center")},order:2},{ChildComponent:Ur,isActive:({selection:t})=>{if(!$t(t))return!1;for(let e of t.getNodes()){if(Se(e)&&e.getFormatType()==="right")continue;let o=e.getParent();if(!(Se(o)&&o.getFormatType()==="right"))return!1}return!0},key:"alignRight",label:({i18n:t})=>t.t("lexical:align:alignRightLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Pt,"right")},order:3},{ChildComponent:jr,isActive:({selection:t})=>{if(!$t(t))return!1;for(let e of t.getNodes()){if(Se(e)&&e.getFormatType()==="justify")continue;let o=e.getParent();if(!(Se(o)&&o.getFormatType()==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:t})=>t.t("lexical:align:alignJustifyLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Pt,"justify")},order:4}])],Ra=y({toolbarFixed:{groups:Wr},toolbarInline:{groups:Wr}});import{$createQuoteNode as Yr,$isQuoteNode as zr,QuoteNode as Da}from"@lexical/rich-text";import{$setBlocksType as qr}from"@lexical/selection";import{$getSelection as Qr,$isRangeSelection as Aa}from"lexical";import{jsx as Vr}from"react/jsx-runtime";import"react";var yo=()=>Vr("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Vr("path",{d:"M13.5353 10.5725C13.5353 9.47709 11.0456 9.99991 11.0456 7.85883C11.0456 6.46464 12.1162 5.61816 13.361 5.61816C14.805 5.61816 16 6.86298 16 8.92937C16 11.2945 14.4564 13.7841 11.1203 14.3816L10.8216 13.1368C12.888 12.4895 13.5353 11.4937 13.5353 10.5725ZM6.71369 10.5725C6.71369 9.47709 4.22407 9.99991 4.22407 7.85883C4.22407 6.46464 5.29461 5.61816 6.53942 5.61816C7.9834 5.61816 9.17842 6.86298 9.17842 8.92937C9.17842 11.2945 7.63485 13.7841 4.29876 14.3816L4 13.1368C6.06639 12.4895 6.71369 11.4937 6.71369 10.5725Z",fill:"currentColor"})});import{jsx as Kr}from"react/jsx-runtime";import"react";var lt=()=>Kr("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Kr("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})});var Q=t=>({type:"dropdown",ChildComponent:lt,items:t,key:"text",order:25});import{$createQuoteNode as va,$isQuoteNode as Jr,QuoteNode as Ma}from"@lexical/rich-text";var Xr={type:"element",dependencies:[Ma],export:(t,e)=>{if(!Jr(t))return null;let o=e(t).split(`
|
|
2
2
|
`),r=[];for(let n of o)r.push("> "+n);return r.join(`
|
|
3
|
-
`)},regExp:/^>\s/,replace:(t,e,o,r)=>{if(r){let l=t.getPreviousSibling();if(Kr(l)){l.splice(l.getChildrenSize(),0,[...e]),l.select(0,0),t.remove();return}}let n=ya();n.append(...e),t.replace(n),n.select(0,0)}};var zr=[Q([{ChildComponent:Lo,isActive:({selection:t})=>{if(!va(t))return!1;for(let e of t.getNodes())if(!Xr(e)&&!Xr(e.getParent()))return!1;return!0},key:"blockquote",label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=qr();Yr(e,()=>Zr())})},order:20}])],Ma=y({markdownTransformers:[Jr],nodes:[Ra],slashMenu:{groups:[Z([{Icon:Lo,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=qr();Yr(e,()=>Zr())})}}])]},toolbarFixed:{groups:zr},toolbarInline:{groups:zr}});import{getTranslation as Vt}from"@payloadcms/translations";import{jsx as yo,jsxs as Da}from"react/jsx-runtime";import"react";var Pt=()=>Da("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[yo("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"8",y:"5"}),yo("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"5",y:"11"}),yo("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"11",y:"11"})]});import{jsx as Qr}from"react/jsx-runtime";import"react";var Bt=()=>Qr("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Qr("path",{clipRule:"evenodd",d:"M5.33333 6.5C5.11232 6.5 4.90036 6.5878 4.74408 6.74408C4.5878 6.90036 4.5 7.11232 4.5 7.33333V12.1667C4.5 12.3877 4.5878 12.5996 4.74408 12.7559C4.90036 12.9122 5.11232 13 5.33333 13H14.6667C14.8877 13 15.0996 12.9122 15.2559 12.7559C15.4122 12.5996 15.5 12.3877 15.5 12.1667V11.6667C15.5 11.3905 15.7239 11.1667 16 11.1667C16.2761 11.1667 16.5 11.3905 16.5 11.6667V12.1667C16.5 12.6529 16.3068 13.1192 15.963 13.463C15.6192 13.8068 15.1529 14 14.6667 14H5.33333C4.8471 14 4.38079 13.8068 4.03697 13.463C3.69315 13.1192 3.5 12.6529 3.5 12.1667V7.33333C3.5 6.8471 3.69315 6.38079 4.03697 6.03697C4.38079 5.69315 4.8471 5.5 5.33333 5.5H10.3333C10.6095 5.5 10.8333 5.72386 10.8333 6C10.8333 6.27614 10.6095 6.5 10.3333 6.5H5.33333ZM13 6.5C12.7239 6.5 12.5 6.27614 12.5 6C12.5 5.72386 12.7239 5.5 13 5.5H16C16.2761 5.5 16.5 5.72386 16.5 6V9C16.5 9.27614 16.2761 9.5 16 9.5C15.7239 9.5 15.5 9.27614 15.5 9V7.20711L13.3536 9.35355C13.1583 9.54882 12.8417 9.54882 12.6464 9.35355C12.4512 9.15829 12.4512 8.84171 12.6464 8.64645L14.7929 6.5H13ZM6.16699 8.33325C6.16699 8.05711 6.39085 7.83325 6.66699 7.83325H11.0003C11.2765 7.83325 11.5003 8.05711 11.5003 8.33325C11.5003 8.60939 11.2765 8.83325 11.0003 8.83325H6.66699C6.39085 8.83325 6.16699 8.60939 6.16699 8.33325ZM6.16699 10.9999C6.16699 10.7238 6.39085 10.4999 6.66699 10.4999H13.3337C13.6098 10.4999 13.8337 10.7238 13.8337 10.9999C13.8337 11.2761 13.6098 11.4999 13.3337 11.4999H6.66699C6.39085 11.4999 6.16699 11.2761 6.16699 10.9999Z",fill:"currentColor",fillRule:"evenodd"})});import{jsx as Aa}from"react/jsx-runtime";import"react";function Ht(t,e){return t?()=>Aa("img",{alt:e??"Block Image",className:"lexical-block-custom-image",src:t,style:{maxHeight:20,maxWidth:20}}):Pt}import{jsx as uc}from"react/jsx-runtime";import dc from"bson-objectid";import"react";import{DecoratorBlockNode as Oa}from"@lexical/react/LexicalDecoratorBlockNode.js";import $a from"bson-objectid";var lt=class extends Oa{__cacheBuster;__fields;constructor({cacheBuster:e,fields:o,format:r,key:n}){super(r,n),this.__fields=o,this.__cacheBuster=e||0}static clone(e){return new this({cacheBuster:e.__cacheBuster,fields:e.__fields,format:e.__format,key:e.__key})}static getType(){return"block"}static importDOM(){return{}}static importJSON(e){e.version===1&&(e={...e,fields:{...e.fields.data},version:2});let o=Fa(e.fields);return o.setFormat(e.format),o}static isInline(){return!1}decorate(e,o){return null}exportDOM(){let e=document.createElement("div"),o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),type:"block",fields:this.getFields(),version:2}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}setFields(e,o){let r=this.getWritable();r.__fields=e,o||r.__cacheBuster++}};function Fa(t){return new lt({fields:{...t,id:t?.id||new $a.default().toHexString()}})}import{jsx as K,jsxs as it,Fragment as Wa}from"react/jsx-runtime";import{Button as rn,Collapsible as Va,Drawer as Ka,EditDepthProvider as Ja,ErrorPill as Xa,Form as za,formatDrawerSlug as Za,FormSubmit as Ya,Pill as qa,RenderFields as Qa,SectionTitle as ec,useConfig as tc,useDocumentForm as oc,useDocumentInfo as nn,useEditDepth as rc,useFormSubmitted as nc,useServerFunctions as lc,useTranslation as ic}from"@payloadcms/ui";import{abortAndIgnore as Io}from"@payloadcms/ui/shared";import{deepCopyObjectSimpleWithoutReactComponents as Ut,reduceFieldsToValues as ln}from"payload/shared";import st,{useCallback as Ro,useEffect as vo,useMemo as at,useRef as Mo}from"react";import{useLexicalComposerContext as sc}from"@lexical/react/LexicalComposerContext";import{getTranslation as ac}from"@payloadcms/translations";import{$getNodeByKey as Gt}from"lexical";import{v4 as cc}from"uuid";import{c as Pa}from"react/compiler-runtime";import{jsx as jt,jsxs as Ba}from"react/jsx-runtime";import{RenderFields as Ha,useFormSubmitted as ja}from"@payloadcms/ui";import Ua,{createContext as Ga}from"react";var en=Ga({initialState:!1}),Re=()=>Ua.use(en),tn=t=>{let e=Pa(13),{BlockDrawer:o,Collapsible:r,CustomBlock:n,EditButton:l,errorCount:i,formSchema:s,initialState:u,nodeKey:c,RemoveButton:d}=t,p=ja()&&i>0,m,f;e[0]!==r||e[1]!==i||e[2]!==p?(f=b=>jt(r,{editButton:b.editButton,errorCount:i,fieldHasErrors:p,Label:b.Label,removeButton:b.removeButton,children:b.children}),e[0]=r,e[1]=i,e[2]=p,e[3]=f):f=e[3],m=f;let h=m,g;return e[4]!==o||e[5]!==h||e[6]!==n||e[7]!==l||e[8]!==d||e[9]!==s||e[10]!==u||e[11]!==c?(g=n?Ba(en,{value:{BlockCollapsible:h,EditButton:l,initialState:u,nodeKey:c,RemoveButton:d},children:[n,jt(o,{})]}):jt(h,{children:jt(Ha,{fields:s,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0})}),e[4]=o,e[5]=h,e[6]=n,e[7]=l,e[8]=d,e[9]=s,e[10]=u,e[11]=c,e[12]=g):g=e[12],g};function on({fields:t}){for(let e in t){let o=t[e];Array.isArray(o?.rows)&&"value"in o&&(o.disableFormData=!0)}return t}var ne="lexical-block",sn=t=>{let{cacheBuster:e,formData:o,nodeKey:r}=t,n=nc(),{id:l,collectionSlug:i,globalSlug:s}=nn(),{fieldProps:{featureClientSchemaMap:u,field:c,initialLexicalFormState:d,permissions:a,readOnly:p,schemaPath:m},uuid:f}=H(),{fields:h}=oc(),g=Mo(new AbortController),b=rc(),[T,v]=st.useState(0),{config:k}=tc(),_=Za({slug:`lexical-blocks-create-${f}-${o.id}`,depth:b}),{toggleDrawer:x}=de(_),{getDocPreferences:N,setDocFieldPreferences:M}=nn(),[O]=sc(),{getFormState:$}=lc(),I=`${m}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}.fields`,[w,C]=st.useState(()=>d?.[o.id]?.formState?{...d?.[o.id]?.formState,blockName:{initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName}}:!1),E=Mo(!1),R=Mo(e);vo(()=>{E.current?(R.current!==e&&C(!1),R.current=e):E.current=!0},[e]);let[L,D]=st.useState(w?._components?.customComponents?.BlockLabel),[S,F]=st.useState(w?._components?.customComponents?.Block);vo(()=>{let j=new AbortController;return o&&!w&&(async()=>{let{state:W}=await $({id:l,collectionSlug:i,data:o,docPermissions:{fields:!0},docPreferences:await N(),documentFormState:Ut(h),globalSlug:s,initialBlockData:o,operation:"update",renderAllFields:!0,schemaPath:I,signal:j.signal});if(W){W.blockName={initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName};let z=ln(Ut(W),!0);O.update(()=>{let V=Gt(r);if(V&&ct(V)){let oe=z;oe.blockType=o.blockType,V.setFields(oe,!0)}}),C(W),D(W._components?.customComponents?.BlockLabel),F(W._components?.customComponents?.Block)}})(),()=>{Io(j)}},[$,I,l,o,O,r,w,i,s,N,h]);let[G,q]=st.useState(d?.[o.id]?.collapsed??!1),te=`${m}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}`,X=u.blocks?.[te]?.[0],U=X.blockReferences?typeof X?.blockReferences?.[0]=="string"?k.blocksMap[X?.blockReferences?.[0]]:X?.blockReferences?.[0]:X?.blocks?.[0],{i18n:Be,t:we}=ic(),ue=Ro(async({formState:j,submit:se})=>{Io(g.current);let W=new AbortController;g.current=W;let{state:z}=await $({id:l,collectionSlug:i,docPermissions:{fields:!0},docPreferences:await N(),documentFormState:Ut(h),formState:j,globalSlug:s,initialBlockFormState:j,operation:"update",renderAllFields:!!se,schemaPath:I,signal:W.signal});if(!z)return j;j.blockName&&(z.blockName=j.blockName);let V=ln(on({fields:Ut(z)}),!0);if(setTimeout(()=>{O.update(()=>{let oe=Gt(r);if(oe&&ct(oe)){let je=V;je.blockType=o.blockType,oe.setFields(je,!0)}})},0),se){D(z._components?.customComponents?.BlockLabel),F(z._components?.customComponents?.Block);let oe=0;for(let je of Object.values(z))je?.valid===!1&&oe++;v(oe)}return z},[$,l,i,N,s,I,o.blockType,h,O,r]);vo(()=>()=>{Io(g.current)},[]);let Rt=Ro(()=>{O.update(()=>{Gt(r)?.remove()})},[O,r]),Ee=U?.labels?.singular?ac(U.labels.singular,Be):U?.slug,vt=Ro(j=>{N().then(se=>{let z=se?.fields?.[c.name]?.collapsed,V=z&&z?.length?z:[];j?V.includes(o.id)||V.push(o.id):V.includes(o.id)&&V.splice(V.indexOf(o.id),1),M(c.name,{collapsed:V,hello:"hi"})})},[N,c.name,M,o.id]),He=at(()=>()=>K(rn,{buttonStyle:"icon-label",className:`${ne}__editButton`,disabled:p,el:"button",icon:"edit",onClick:j=>(j.preventDefault(),j.stopPropagation(),x(),!1),onMouseDown:j=>{j.preventDefault()},round:!0,size:"small",tooltip:we("lexical:blocks:inlineBlocks:edit",{label:Ee})}),[Ee,p,we,x]),Mt=at(()=>()=>K(rn,{buttonStyle:"icon-label",className:`${ne}__removeButton`,disabled:c?.admin?.readOnly||!1,icon:"x",onClick:j=>{j.preventDefault(),Rt()},round:!0,tooltip:"Remove Block"}),[c?.admin?.readOnly,Rt]),bo=at(()=>({children:j,disableBlockName:se,editButton:W,errorCount:z,fieldHasErrors:V,Label:oe,removeButton:je})=>K("div",{className:ne+" "+ne+"-"+o.blockType,children:K(Va,{className:[`${ne}__row`,V?`${ne}__row--has-errors`:`${ne}__row--no-errors`].join(" "),collapsibleStyle:V?"error":"default",header:it("div",{className:`${ne}__block-header`,children:[oe??L?oe??L:it("div",{children:[K(qa,{className:`${ne}__block-pill ${ne}__block-pill-${o?.blockType}`,pillStyle:"white",size:"small",children:Ee??o?.blockType}),!se&&!U?.admin?.disableBlockName&&K(ec,{path:"blockName",readOnly:c?.admin?.readOnly||!1}),V&&K(Xa,{count:z??0,i18n:Be,withMessage:!0})]}),it("div",{children:[S&&W!==!1||!S&&W?K(He,{}):null,je!==!1&&O.isEditable()?K(Mt,{}):null]})]}),isCollapsed:G,onToggle:$r=>{vt($r),q($r)},children:j},0)}),[S,L,He,Mt,Ee,U?.admin?.disableBlockName,O,o.blockType,Be,G,vt,c?.admin?.readOnly]),Or=at(()=>()=>K(Ja,{children:K(Ka,{className:"",slug:_,title:we(`lexical:blocks:inlineBlocks:${o?.id?"edit":"create"}`,{label:Ee??we("lexical:blocks:inlineBlocks:label")}),children:w?it(Wa,{children:[K(Qa,{fields:U?.fields??[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:I,permissions:!0,readOnly:!1}),K(Ya,{programmaticSubmit:!0,children:we("fields:saveChanges")})]}):null})}),[w,_,Ee,we,U?.fields,I,a]),ha=at(()=>w?K(za,{beforeSubmit:[async({formState:j})=>await ue({formState:j,submit:!0})],el:"div",fields:U?.fields??[],initialState:w,onChange:[ue],onSubmit:(j,se)=>{se.blockType=o.blockType,O.update(()=>{let W=Gt(r);W&&ct(W)&&W.setFields(se,!0)}),x()},submitted:n,uuid:cc(),children:K(tn,{baseClass:ne,BlockDrawer:Or,Collapsible:bo,CustomBlock:S,EditButton:He,errorCount:T,formSchema:U?.fields??[],initialState:w,nodeKey:r,RemoveButton:Mt})}):null,[bo,Or,S,U?.fields,Mt,He,O,T,x,U?.fields,w,r,ue,n]);return U?ha:K(bo,{disableBlockName:!0,fieldHasErrors:!0,children:it("div",{className:"lexical-block-not-found",children:["Error: Block '",o.blockType,"' not found in the config but exists in the lexical data"]})})};var pe=class extends lt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){e.version===1&&(e={...e,fields:{...e.fields.data},version:2});let o=Wt(e.fields);return o.setFormat(e.format),o}decorate(e,o){return uc(sn,{cacheBuster:this.getCacheBuster(),formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Wt(t){return new pe({fields:{...t,id:t?.id||new dc.default().toHexString()}})}function ct(t){return t instanceof pe}import{createCommand as an}from"lexical";var Ge=an("INSERT_BLOCK_COMMAND"),We=an("INSERT_INLINE_BLOCK_COMMAND");import{c as mc}from"react/compiler-runtime";import{useLexicalComposerContext as pc}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as fc,$wrapNodeInElement as hc,mergeRegister as gc}from"@lexical/utils";import{formatDrawerSlug as xc,useEditDepth as Cc}from"@payloadcms/ui";import{$createParagraphNode as bc,$getNodeByKey as kc,$getPreviousSelection as _c,$getSelection as Tc,$insertNodes as wc,$isParagraphNode as Ec,$isRangeSelection as Nc,$isRootOrShadowRoot as Sc,COMMAND_PRIORITY_EDITOR as cn}from"lexical";import{useEffect as Lc,useState as yc}from"react";var un=()=>{let t=mc(12),[e]=pc(),[o,r]=yc(null),{setCreatedInlineBlock:n,uuid:l}=H(),i=Cc(),s="lexical-inlineBlocks-create-"+l,u;t[0]!==i||t[1]!==s?(u=xc({slug:s,depth:i}),t[0]=i,t[1]=s,t[2]=u):u=t[2];let c=u,{toggleDrawer:d}=de(c,!0),a;t[3]!==e||t[4]!==n||t[5]!==o?(a=()=>{if(!e.hasNodes([pe]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return gc(e.registerCommand(Ge,m=>(e.update(()=>{let f=Tc()||_c();if(Nc(f)){let h=Wt(m),{focus:g}=f,b=g.getNode();fc(h),Ec(b)&&!b.__first&&b.remove()}}),!0),cn),e.registerCommand(We,m=>{if(o){let h=kc(o);return!h||!To(h)?!1:(h.setFields(m),r(null),!0)}let f=_o(m);return n?.(f),wc([f]),Sc(f.getParentOrThrow())&&hc(f,bc).selectEnd(),!0},cn))},t[3]=e,t[4]=n,t[5]=o,t[6]=a):a=t[6];let p;return t[7]!==e||t[8]!==n||t[9]!==o||t[10]!==d?(p=[e,n,o,d],t[7]=e,t[8]=n,t[9]=o,t[10]=d,t[11]=p):p=t[11],Lc(a,p),null};var Ic=y(({config:t,featureClientSchemaMap:e,props:o,schemaPath:r})=>{let n=`${r}.lexical_internal_feature.blocks.lexical_blocks`,l=`${r}.lexical_internal_feature.blocks.lexical_inline_blocks`,i=e.blocks;if(!i)return{};let s=Object.entries(i).filter(([a])=>a.startsWith(n+".")&&!a.replace(n+".","").includes(".")).map(([,a])=>a[0]),u=Object.entries(i).filter(([a])=>a.startsWith(l+".")&&!a.replace(l+".","").includes(".")).map(([,a])=>a[0]),c=s.map(a=>a.blockReferences?typeof a.blockReferences[0]=="string"?t.blocksMap[a.blockReferences[0]]:a.blockReferences[0]:a.blocks[0]).filter(a=>a!==void 0),d=u.map(a=>a.blockReferences?typeof a.blockReferences[0]=="string"?t.blocksMap[a.blockReferences[0]]:a.blockReferences[0]:a.blocks[0]).filter(a=>a!==void 0);return{nodes:[pe,ko],plugins:[{Component:un,position:"normal"}],sanitizedClientFeatureProps:o,slashMenu:{groups:[c?.length?{items:c.map(a=>({Icon:Ht(a.imageURL,a.imageAltText),key:"block-"+a.slug,keywords:["block","blocks",a.slug],label:({i18n:p})=>a?.labels?.singular?Vt(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(Ge,{blockName:"",blockType:a.slug})}})),key:"blocks",label:({i18n:a})=>a.t("lexical:blocks:label")}:null,d?.length?{items:d.map(a=>({Icon:Bt,key:"inlineBlocks-"+a.slug,keywords:["inlineBlock","inline block",a.slug],label:({i18n:p})=>a?.labels?.singular?Vt(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(We,{blockName:"",blockType:a.slug})}})),key:"inlineBlocks",label:({i18n:a})=>a.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[c.length?{type:"dropdown",ChildComponent:Pt,items:c.map((a,p)=>({ChildComponent:Ht(a.imageURL,a.imageAltText),isActive:void 0,key:"block-"+a.slug,label:({i18n:m})=>a?.labels?.singular?Vt(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(Ge,{blockName:"",blockType:a.slug})},order:p})),key:"blocks",order:20}:null,d?.length?{type:"dropdown",ChildComponent:Bt,items:d.map((a,p)=>({ChildComponent:a.imageURL?Ht(a.imageURL,a.imageAltText):Bt,isActive:void 0,key:"inlineBlock-"+a.slug,label:({i18n:m})=>a?.labels?.singular?Vt(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(We,{blockName:"",blockType:a.slug})},order:p})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}});import{c as Mc}from"react/compiler-runtime";import{jsx as Me,jsxs as $o}from"react/jsx-runtime";import{useLexicalComposerContext as Dc}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as Ac,$createTextNode as Oc,$getRoot as $c,getDOMSelection as Do}from"lexical";import*as hn from"react";import{useCallback as ve,useEffect as Ao,useLayoutEffect as mn,useRef as Oo,useState as Kt}from"react";var Rc=re&&"documentMode"in document?document.documentMode:null,dn=re&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),eC=re&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),tC=re&&"InputEvent"in window&&!Rc?"getTargetRanges"in new window.InputEvent("input"):!1,oC=re&&/Version\/[\d.].*Safari/.test(navigator.userAgent),rC=re&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,nC=re&&/Android/.test(navigator.userAgent),lC=re&&/Win/.test(navigator.platform),vc=re&&/^(?=.*Chrome).*/i.test(navigator.userAgent),iC=re&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!vc;var Fc=t=>{let e=document.createElement("textarea");e.value=t||"",e.style.position="absolute",e.style.opacity="0",document.body?.appendChild(e),e.focus(),e.select();try{let o=document.execCommand("copy");console.log(o)}catch(o){console.error(o)}document.body?.removeChild(e)},Pc=(t,e)=>{let o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e||"")),o.setAttribute("download",t),o.style.display="none",document.body?.appendChild(o),o.click(),document.body?.removeChild(o)},Bc=t=>{let o=((r,n)=>{switch(r){case"click":return` await page.mouse.click(${n.x}, ${n.y});`;case"keydown":return` await page.keyboard.keydown('${n}');`;case"keyup":return` await page.keyboard.keyup('${n}');`;case"press":return` await page.keyboard.press('${n}');`;case"selectAll":return" await selectAll(page);";case"snapshot":return` await assertHTMLSnapshot(page);
|
|
3
|
+
`)},regExp:/^>\s/,replace:(t,e,o,r)=>{if(r){let l=t.getPreviousSibling();if(Jr(l)){l.splice(l.getChildrenSize(),0,[...e]),l.select(0,0),t.remove();return}}let n=va();n.append(...e),t.replace(n),n.select(0,0)}};var Zr=[Q([{ChildComponent:yo,isActive:({selection:t})=>{if(!Aa(t))return!1;for(let e of t.getNodes())if(!zr(e)&&!zr(e.getParent()))return!1;return!0},key:"blockquote",label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Qr();qr(e,()=>Yr())})},order:20}])],Oa=y({markdownTransformers:[Xr],nodes:[Da],slashMenu:{groups:[Z([{Icon:yo,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Qr();qr(e,()=>Yr())})}}])]},toolbarFixed:{groups:Zr},toolbarInline:{groups:Zr}});import{getTranslation as Kt}from"@payloadcms/translations";import{jsx as Io,jsxs as Fa}from"react/jsx-runtime";import"react";var Bt=()=>Fa("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Io("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"8",y:"5"}),Io("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"5",y:"11"}),Io("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"11",y:"11"})]});import{jsx as en}from"react/jsx-runtime";import"react";var Ht=()=>en("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:en("path",{clipRule:"evenodd",d:"M5.33333 6.5C5.11232 6.5 4.90036 6.5878 4.74408 6.74408C4.5878 6.90036 4.5 7.11232 4.5 7.33333V12.1667C4.5 12.3877 4.5878 12.5996 4.74408 12.7559C4.90036 12.9122 5.11232 13 5.33333 13H14.6667C14.8877 13 15.0996 12.9122 15.2559 12.7559C15.4122 12.5996 15.5 12.3877 15.5 12.1667V11.6667C15.5 11.3905 15.7239 11.1667 16 11.1667C16.2761 11.1667 16.5 11.3905 16.5 11.6667V12.1667C16.5 12.6529 16.3068 13.1192 15.963 13.463C15.6192 13.8068 15.1529 14 14.6667 14H5.33333C4.8471 14 4.38079 13.8068 4.03697 13.463C3.69315 13.1192 3.5 12.6529 3.5 12.1667V7.33333C3.5 6.8471 3.69315 6.38079 4.03697 6.03697C4.38079 5.69315 4.8471 5.5 5.33333 5.5H10.3333C10.6095 5.5 10.8333 5.72386 10.8333 6C10.8333 6.27614 10.6095 6.5 10.3333 6.5H5.33333ZM13 6.5C12.7239 6.5 12.5 6.27614 12.5 6C12.5 5.72386 12.7239 5.5 13 5.5H16C16.2761 5.5 16.5 5.72386 16.5 6V9C16.5 9.27614 16.2761 9.5 16 9.5C15.7239 9.5 15.5 9.27614 15.5 9V7.20711L13.3536 9.35355C13.1583 9.54882 12.8417 9.54882 12.6464 9.35355C12.4512 9.15829 12.4512 8.84171 12.6464 8.64645L14.7929 6.5H13ZM6.16699 8.33325C6.16699 8.05711 6.39085 7.83325 6.66699 7.83325H11.0003C11.2765 7.83325 11.5003 8.05711 11.5003 8.33325C11.5003 8.60939 11.2765 8.83325 11.0003 8.83325H6.66699C6.39085 8.83325 6.16699 8.60939 6.16699 8.33325ZM6.16699 10.9999C6.16699 10.7238 6.39085 10.4999 6.66699 10.4999H13.3337C13.6098 10.4999 13.8337 10.7238 13.8337 10.9999C13.8337 11.2761 13.6098 11.4999 13.3337 11.4999H6.66699C6.39085 11.4999 6.16699 11.2761 6.16699 10.9999Z",fill:"currentColor",fillRule:"evenodd"})});import{jsx as $a}from"react/jsx-runtime";import"react";function jt(t,e){return t?()=>$a("img",{alt:e??"Block Image",className:"lexical-block-custom-image",src:t,style:{maxHeight:20,maxWidth:20}}):Bt}import{jsx as pc}from"react/jsx-runtime";import fc from"bson-objectid";import"react";import{DecoratorBlockNode as Pa}from"@lexical/react/LexicalDecoratorBlockNode.js";import Ba from"bson-objectid";var it=class extends Pa{__cacheBuster;__fields;constructor({cacheBuster:e,fields:o,format:r,key:n}){super(r,n),this.__fields=o,this.__cacheBuster=e||0}static clone(e){return new this({cacheBuster:e.__cacheBuster,fields:e.__fields,format:e.__format,key:e.__key})}static getType(){return"block"}static importDOM(){return{}}static importJSON(e){e.version===1&&(e={...e,fields:{...e.fields.data},version:2});let o=Ha(e.fields);return o.setFormat(e.format),o}static isInline(){return!1}decorate(e,o){return null}exportDOM(){let e=document.createElement("div"),o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),type:"block",fields:this.getFields(),version:2}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}setFields(e,o){let r=this.getWritable();r.__fields=e,o||r.__cacheBuster++}};function Ha(t){return new it({fields:{...t,id:t?.id||new Ba.default().toHexString()}})}import{jsx as K,jsxs as st,Fragment as Ja}from"react/jsx-runtime";import{Button as nn,Collapsible as Xa,Drawer as za,EditDepthProvider as Za,ErrorPill as Ya,Form as qa,formatDrawerSlug as Qa,FormSubmit as ec,Pill as tc,RenderFields as oc,SectionTitle as rc,useConfig as nc,useDocumentForm as lc,useDocumentInfo as ln,useEditDepth as ic,useFormSubmitted as sc,useServerFunctions as ac,useTranslation as cc}from"@payloadcms/ui";import{abortAndIgnore as Ro}from"@payloadcms/ui/shared";import{deepCopyObjectSimpleWithoutReactComponents as Gt,reduceFieldsToValues as sn}from"payload/shared";import at,{useCallback as vo,useEffect as Mo,useMemo as ct,useRef as Do}from"react";import{useLexicalComposerContext as uc}from"@lexical/react/LexicalComposerContext";import{getTranslation as dc}from"@payloadcms/translations";import{$getNodeByKey as Wt}from"lexical";import{v4 as mc}from"uuid";import{c as ja}from"react/compiler-runtime";import{jsx as Ut,jsxs as Ua}from"react/jsx-runtime";import{RenderFields as Ga,useFormSubmitted as Wa}from"@payloadcms/ui";import Va,{createContext as Ka}from"react";var tn=Ka({initialState:!1}),Re=()=>Va.use(tn),on=t=>{let e=ja(13),{BlockDrawer:o,Collapsible:r,CustomBlock:n,EditButton:l,errorCount:i,formSchema:s,initialState:u,nodeKey:c,RemoveButton:d}=t,p=Wa()&&i>0,m;e[0]!==r||e[1]!==i||e[2]!==p?(m=g=>Ut(r,{editButton:g.editButton,errorCount:i,fieldHasErrors:p,Label:g.Label,removeButton:g.removeButton,children:g.children}),e[0]=r,e[1]=i,e[2]=p,e[3]=m):m=e[3];let f=m,h;return e[4]!==o||e[5]!==f||e[6]!==n||e[7]!==l||e[8]!==d||e[9]!==s||e[10]!==u||e[11]!==c?(h=n?Ua(tn,{value:{BlockCollapsible:f,EditButton:l,initialState:u,nodeKey:c,RemoveButton:d},children:[n,Ut(o,{})]}):Ut(f,{children:Ut(Ga,{fields:s,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0})}),e[4]=o,e[5]=f,e[6]=n,e[7]=l,e[8]=d,e[9]=s,e[10]=u,e[11]=c,e[12]=h):h=e[12],h};function rn({fields:t}){for(let e in t){let o=t[e];Array.isArray(o?.rows)&&"value"in o&&(o.disableFormData=!0)}return t}var ne="lexical-block",an=t=>{let{cacheBuster:e,formData:o,nodeKey:r}=t,n=sc(),{id:l,collectionSlug:i,globalSlug:s}=ln(),{fieldProps:{featureClientSchemaMap:u,field:c,initialLexicalFormState:d,permissions:a,readOnly:p,schemaPath:m},uuid:f}=H(),{fields:h}=lc(),g=Do(new AbortController),k=ic(),[T,I]=at.useState(0),{config:b}=nc(),_=Qa({slug:`lexical-blocks-create-${f}-${o.id}`,depth:k}),{toggleDrawer:x}=de(_),{getDocPreferences:w,setDocFieldPreferences:v}=ln(),[O]=uc(),{getFormState:F}=ac(),R=`${m}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}.fields`,[E,C]=at.useState(()=>d?.[o.id]?.formState?{...d?.[o.id]?.formState,blockName:{initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName}}:!1),S=Do(!1),M=Do(e);Mo(()=>{S.current?(M.current!==e&&C(!1),M.current=e):S.current=!0},[e]);let[L,D]=at.useState(E?._components?.customComponents?.BlockLabel),[N,$]=at.useState(E?._components?.customComponents?.Block);Mo(()=>{let j=new AbortController;return o&&!E&&(async()=>{let{state:W}=await F({id:l,collectionSlug:i,data:o,docPermissions:{fields:!0},docPreferences:await w(),documentFormState:Gt(h),globalSlug:s,initialBlockData:o,operation:"update",renderAllFields:!0,schemaPath:R,signal:j.signal});if(W){W.blockName={initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName};let z=sn(Gt(W),!0);O.update(()=>{let V=Wt(r);if(V&&ut(V)){let oe=z;oe.blockType=o.blockType,V.setFields(oe,!0)}}),C(W),D(W._components?.customComponents?.BlockLabel),$(W._components?.customComponents?.Block)}})(),()=>{Ro(j)}},[F,R,l,o,O,r,E,i,s,w,h]);let[G,q]=at.useState(d?.[o.id]?.collapsed??!1),te=`${m}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}`,X=u.blocks?.[te]?.[0],U=X.blockReferences?typeof X?.blockReferences?.[0]=="string"?b.blocksMap[X?.blockReferences?.[0]]:X?.blockReferences?.[0]:X?.blocks?.[0],{i18n:Be,t:we}=cc(),ue=vo(async({formState:j,submit:se})=>{Ro(g.current);let W=new AbortController;g.current=W;let{state:z}=await F({id:l,collectionSlug:i,docPermissions:{fields:!0},docPreferences:await w(),documentFormState:Gt(h),formState:j,globalSlug:s,initialBlockFormState:j,operation:"update",renderAllFields:!!se,schemaPath:R,signal:W.signal});if(!z)return j;j.blockName&&(z.blockName=j.blockName);let V=sn(rn({fields:Gt(z)}),!0);if(setTimeout(()=>{O.update(()=>{let oe=Wt(r);if(oe&&ut(oe)){let je=V;je.blockType=o.blockType,oe.setFields(je,!0)}})},0),se){D(z._components?.customComponents?.BlockLabel),$(z._components?.customComponents?.Block);let oe=0;for(let je of Object.values(z))je?.valid===!1&&oe++;I(oe)}return z},[F,l,i,w,s,R,o.blockType,h,O,r]);Mo(()=>()=>{Ro(g.current)},[]);let vt=vo(()=>{O.update(()=>{Wt(r)?.remove()})},[O,r]),Ee=U?.labels?.singular?dc(U.labels.singular,Be):U?.slug,Mt=vo(j=>{w().then(se=>{let z=se?.fields?.[c.name]?.collapsed,V=z&&z?.length?z:[];j?V.includes(o.id)||V.push(o.id):V.includes(o.id)&&V.splice(V.indexOf(o.id),1),v(c.name,{collapsed:V,hello:"hi"})})},[w,c.name,v,o.id]),He=ct(()=>()=>K(nn,{buttonStyle:"icon-label",className:`${ne}__editButton`,disabled:p,el:"button",icon:"edit",onClick:j=>(j.preventDefault(),j.stopPropagation(),x(),!1),onMouseDown:j=>{j.preventDefault()},round:!0,size:"small",tooltip:we("lexical:blocks:inlineBlocks:edit",{label:Ee})}),[Ee,p,we,x]),Dt=ct(()=>()=>K(nn,{buttonStyle:"icon-label",className:`${ne}__removeButton`,disabled:c?.admin?.readOnly||!1,icon:"x",onClick:j=>{j.preventDefault(),vt()},round:!0,tooltip:"Remove Block"}),[c?.admin?.readOnly,vt]),ko=ct(()=>({children:j,disableBlockName:se,editButton:W,errorCount:z,fieldHasErrors:V,Label:oe,removeButton:je})=>K("div",{className:ne+" "+ne+"-"+o.blockType,children:K(Xa,{className:[`${ne}__row`,V?`${ne}__row--has-errors`:`${ne}__row--no-errors`].join(" "),collapsibleStyle:V?"error":"default",header:st("div",{className:`${ne}__block-header`,children:[oe??L?oe??L:st("div",{children:[K(tc,{className:`${ne}__block-pill ${ne}__block-pill-${o?.blockType}`,pillStyle:"white",size:"small",children:Ee??o?.blockType}),!se&&!U?.admin?.disableBlockName&&K(rc,{path:"blockName",readOnly:c?.admin?.readOnly||!1}),V&&K(Ya,{count:z??0,i18n:Be,withMessage:!0})]}),st("div",{children:[N&&W!==!1||!N&&W?K(He,{}):null,je!==!1&&O.isEditable()?K(Dt,{}):null]})]}),isCollapsed:G,onToggle:$r=>{Mt($r),q($r)},children:j},0)}),[N,L,He,Dt,Ee,U?.admin?.disableBlockName,O,o.blockType,Be,G,Mt,c?.admin?.readOnly]),Fr=ct(()=>()=>K(Za,{children:K(za,{className:"",slug:_,title:we(`lexical:blocks:inlineBlocks:${o?.id?"edit":"create"}`,{label:Ee??we("lexical:blocks:inlineBlocks:label")}),children:E?st(Ja,{children:[K(oc,{fields:U?.fields??[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:R,permissions:!0,readOnly:!1}),K(ec,{programmaticSubmit:!0,children:we("fields:saveChanges")})]}):null})}),[E,_,Ee,we,U?.fields,R,a]),Ca=ct(()=>E?K(qa,{beforeSubmit:[async({formState:j})=>await ue({formState:j,submit:!0})],el:"div",fields:U?.fields??[],initialState:E,onChange:[ue],onSubmit:(j,se)=>{se.blockType=o.blockType,O.update(()=>{let W=Wt(r);W&&ut(W)&&W.setFields(se,!0)}),x()},submitted:n,uuid:mc(),children:K(on,{baseClass:ne,BlockDrawer:Fr,Collapsible:ko,CustomBlock:N,EditButton:He,errorCount:T,formSchema:U?.fields??[],initialState:E,nodeKey:r,RemoveButton:Dt})}):null,[ko,Fr,N,U?.fields,Dt,He,O,T,x,U?.fields,E,r,ue,n]);return U?Ca:K(ko,{disableBlockName:!0,fieldHasErrors:!0,children:st("div",{className:"lexical-block-not-found",children:["Error: Block '",o.blockType,"' not found in the config but exists in the lexical data"]})})};var pe=class extends it{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){e.version===1&&(e={...e,fields:{...e.fields.data},version:2});let o=Vt(e.fields);return o.setFormat(e.format),o}decorate(e,o){return pc(an,{cacheBuster:this.getCacheBuster(),formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Vt(t){return new pe({fields:{...t,id:t?.id||new fc.default().toHexString()}})}function ut(t){return t instanceof pe}import{createCommand as cn}from"lexical";var Ge=cn("INSERT_BLOCK_COMMAND"),We=cn("INSERT_INLINE_BLOCK_COMMAND");import{c as hc}from"react/compiler-runtime";import{useLexicalComposerContext as gc}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as xc,$wrapNodeInElement as Cc,mergeRegister as bc}from"@lexical/utils";import{formatDrawerSlug as kc,useEditDepth as _c}from"@payloadcms/ui";import{$createParagraphNode as Tc,$getNodeByKey as wc,$getPreviousSelection as Ec,$getSelection as Sc,$insertNodes as Nc,$isParagraphNode as Lc,$isRangeSelection as yc,$isRootOrShadowRoot as Ic,COMMAND_PRIORITY_EDITOR as un}from"lexical";import{useEffect as Rc,useState as vc}from"react";var dn=()=>{let t=hc(12),[e]=gc(),[o,r]=vc(null),{setCreatedInlineBlock:n,uuid:l}=H(),i=_c(),s="lexical-inlineBlocks-create-"+l,u;t[0]!==i||t[1]!==s?(u=kc({slug:s,depth:i}),t[0]=i,t[1]=s,t[2]=u):u=t[2];let c=u,{toggleDrawer:d}=de(c,!0),a;t[3]!==e||t[4]!==n||t[5]!==o?(a=()=>{if(!e.hasNodes([pe]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return bc(e.registerCommand(Ge,m=>(e.update(()=>{let f=Sc()||Ec();if(yc(f)){let h=Vt(m),{focus:g}=f,k=g.getNode();xc(h),Lc(k)&&!k.__first&&k.remove()}}),!0),un),e.registerCommand(We,m=>{if(o){let h=wc(o);return!h||!wo(h)?!1:(h.setFields(m),r(null),!0)}let f=To(m);return n?.(f),Nc([f]),Ic(f.getParentOrThrow())&&Cc(f,Tc).selectEnd(),!0},un))},t[3]=e,t[4]=n,t[5]=o,t[6]=a):a=t[6];let p;return t[7]!==e||t[8]!==n||t[9]!==o||t[10]!==d?(p=[e,n,o,d],t[7]=e,t[8]=n,t[9]=o,t[10]=d,t[11]=p):p=t[11],Rc(a,p),null};var Mc=y(({config:t,featureClientSchemaMap:e,props:o,schemaPath:r})=>{let n=`${r}.lexical_internal_feature.blocks.lexical_blocks`,l=`${r}.lexical_internal_feature.blocks.lexical_inline_blocks`,i=e.blocks;if(!i)return{};let s=Object.entries(i).filter(([a])=>a.startsWith(n+".")&&!a.replace(n+".","").includes(".")).map(([,a])=>a[0]),u=Object.entries(i).filter(([a])=>a.startsWith(l+".")&&!a.replace(l+".","").includes(".")).map(([,a])=>a[0]),c=s.map(a=>a.blockReferences?typeof a.blockReferences[0]=="string"?t.blocksMap[a.blockReferences[0]]:a.blockReferences[0]:a.blocks[0]).filter(a=>a!==void 0),d=u.map(a=>a.blockReferences?typeof a.blockReferences[0]=="string"?t.blocksMap[a.blockReferences[0]]:a.blockReferences[0]:a.blocks[0]).filter(a=>a!==void 0);return{nodes:[pe,_o],plugins:[{Component:dn,position:"normal"}],sanitizedClientFeatureProps:o,slashMenu:{groups:[c?.length?{items:c.map(a=>({Icon:jt(a.imageURL,a.imageAltText),key:"block-"+a.slug,keywords:["block","blocks",a.slug],label:({i18n:p})=>a?.labels?.singular?Kt(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(Ge,{blockName:"",blockType:a.slug})}})),key:"blocks",label:({i18n:a})=>a.t("lexical:blocks:label")}:null,d?.length?{items:d.map(a=>({Icon:Ht,key:"inlineBlocks-"+a.slug,keywords:["inlineBlock","inline block",a.slug],label:({i18n:p})=>a?.labels?.singular?Kt(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(We,{blockName:"",blockType:a.slug})}})),key:"inlineBlocks",label:({i18n:a})=>a.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[c.length?{type:"dropdown",ChildComponent:Bt,items:c.map((a,p)=>({ChildComponent:jt(a.imageURL,a.imageAltText),isActive:void 0,key:"block-"+a.slug,label:({i18n:m})=>a?.labels?.singular?Kt(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(Ge,{blockName:"",blockType:a.slug})},order:p})),key:"blocks",order:20}:null,d?.length?{type:"dropdown",ChildComponent:Ht,items:d.map((a,p)=>({ChildComponent:a.imageURL?jt(a.imageURL,a.imageAltText):Ht,isActive:void 0,key:"inlineBlock-"+a.slug,label:({i18n:m})=>a?.labels?.singular?Kt(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(We,{blockName:"",blockType:a.slug})},order:p})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}});import{c as Oc}from"react/compiler-runtime";import{jsx as Me,jsxs as $o}from"react/jsx-runtime";import{useLexicalComposerContext as Fc}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as $c,$createTextNode as Pc,$getRoot as Bc,getDOMSelection as Ao}from"lexical";import*as gn from"react";import{useCallback as ve,useEffect as Oo,useLayoutEffect as pn,useRef as Fo,useState as Jt}from"react";var Dc=re&&"documentMode"in document?document.documentMode:null,mn=re&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),pC=re&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),fC=re&&"InputEvent"in window&&!Dc?"getTargetRanges"in new window.InputEvent("input"):!1,hC=re&&/Version\/[\d.].*Safari/.test(navigator.userAgent),gC=re&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,xC=re&&/Android/.test(navigator.userAgent),CC=re&&/Win/.test(navigator.platform),Ac=re&&/^(?=.*Chrome).*/i.test(navigator.userAgent),bC=re&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ac;var Hc=t=>{let e=document.createElement("textarea");e.value=t||"",e.style.position="absolute",e.style.opacity="0",document.body?.appendChild(e),e.focus(),e.select();try{let o=document.execCommand("copy");console.log(o)}catch(o){console.error(o)}document.body?.removeChild(e)},jc=(t,e)=>{let o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e||"")),o.setAttribute("download",t),o.style.display="none",document.body?.appendChild(o),o.click(),document.body?.removeChild(o)},Uc=t=>{let o=((r,n)=>{switch(r){case"click":return` await page.mouse.click(${n.x}, ${n.y});`;case"keydown":return` await page.keyboard.keydown('${n}');`;case"keyup":return` await page.keyboard.keyup('${n}');`;case"press":return` await page.keyboard.press('${n}');`;case"selectAll":return" await selectAll(page);";case"snapshot":return` await assertHTMLSnapshot(page);
|
|
4
4
|
await assertSelection(page, {
|
|
5
5
|
anchorPath: [${n.anchorPath.toString()}],
|
|
6
6
|
anchorOffset: ${n.anchorOffset},
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
`;case"type":return` await page.keyboard.type('${n}');`;default:return""}})(t.name,t.value);switch(t.count){case 1:return o;case 2:return[o,o].join(`
|
|
11
11
|
`);default:return` await repeat(${t.count}, async () => {
|
|
12
12
|
${o}
|
|
13
|
-
);`}};function
|
|
13
|
+
);`}};function Gc(t){return t.key.toLowerCase()==="a"&&(mn?t.metaKey:t.ctrlKey)}function Wc(t){let{anchorNode:e,focusNode:o}=t,{anchorOffset:r,focusOffset:n}=t;return r!==0&&r--,n!==0&&n--,{anchorNode:e,anchorOffset:r,focusNode:o,focusOffset:n}}function fn(t,e){let o=t,r=[];for(;o!==e;)o!=null&&r.unshift(Array.from(o?.parentNode?.childNodes??[]).indexOf(o)),o=o?.parentNode;return r}var hn=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Delete","Enter","Escape"]);function Vc(t){let[e,o]=Jt([]),[r,n]=Jt(!1),[,l]=Jt(""),[i,s]=Jt(""),u=Fo(null),c=Fo(!1),d=Fo(null),a=ve(()=>t,[t]),p=ve(()=>{let b=t.getRootElement(),_=Ao(t._window);return b==null||_==null||_.anchorNode==null||_.focusNode==null||!b.contains(_.anchorNode)||!b.contains(_.focusNode)?null:`
|
|
14
14
|
import {
|
|
15
15
|
initializeE2E,
|
|
16
16
|
assertHTMLSnapshot,
|
|
@@ -27,15 +27,15 @@ describe('Test case', () => {
|
|
|
27
27
|
const {page} = e2e;
|
|
28
28
|
|
|
29
29
|
await page.focus('div[contenteditable="true"]');
|
|
30
|
-
${e.map(
|
|
30
|
+
${e.map(Uc).join(`
|
|
31
31
|
`)}
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
|
-
`},[t,e]),m=ve((k,_)=>{o(x=>{let N=e.length-1,M=e[N];if(M&&M.name===k){if(k==="type")return[...e.slice(0,N),{...M,value:M.value+_}];if(M.value===_)return[...e.slice(0,N),{...M,count:M.count+1}]}return[...x,{name:k,count:1,value:_}]})},[e,o]);mn(()=>{let k=x=>{if(!r)return;let N=x.key;Hc(x)?m("selectAll",""):fn.has(N)?m("press",x.key):[...N].length>1?m("keydown",x.key):m("type",x.key)},_=x=>{if(!r)return;let N=x.key;!fn.has(N)&&[...N].length>1&&m("keyup",x.key)};return t.registerRootListener((x,N)=>{N!==null&&(N.removeEventListener("keydown",k),N.removeEventListener("keyup",_)),x!==null&&(x.addEventListener("keydown",k),x.addEventListener("keyup",_))})},[t,r,m]),mn(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[p]),Ao(()=>{if(e){let k=p();k!==null&&s(k),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[p,e]),Ao(()=>t.registerUpdateListener(({dirtyElements:_,dirtyLeaves:x,editorState:N})=>{if(!r)return;let M=N._selection,O=u.current,$=c.current;if(O!==M){if(x.size===0&&_.size===0&&!$){let w=Do(t._window);if(w&&(w.anchorNode==null||w.focusNode==null))return}u.current=M}c.current=!1;let I=p();I!==null&&s(I)}),[t,p,r,m]),Ao(()=>r?t.registerUpdateListener(()=>{let _=t.getRootElement();_!==null&&l(_?.innerHTML)}):void 0,[t,r]);let f=ve(k=>{r||(k.update(()=>{let _=$c();_.clear();let x=Oc();_.append(Ac().append(x)),x.select()}),o([])),n(_=>!_)},[r]),h=ve(()=>{if(!r)return;let k=Do(t._window);if(k===null||k.anchorNode==null||k.focusNode==null)return;let{anchorNode:_,anchorOffset:x,focusNode:N,focusOffset:M}=jc(k),O=a().getRootElement(),$;_!==null&&($=pn(_,O));let I;N!==null&&(I=pn(N,O)),m("snapshot",{anchorNode:_,anchorOffset:x,anchorPath:$,focusNode:N,focusOffset:M,focusPath:I})},[m,r,a]),g=ve(()=>{Fc(p())},[p]),b=ve(()=>{Pc("test.js",p())},[p]);return[Me("button",{className:`editor-dev-button ${r?"active":""}`,id:"test-recorder-button",onClick:k=>{f(a()),k.preventDefault()},title:r?"Disable test recorder":"Enable test recorder",type:"button",children:r?"Disable test recorder":"Enable test recorder"}),r?$o("div",{className:"test-recorder-output",children:[$o("div",{className:"test-recorder-toolbar",children:[Me("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:k=>{h(),k.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Me("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:k=>{g(),k.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Me("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:k=>{b(),k.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Me("pre",{id:"test-recorder",ref:d,children:i})]}):null]}var gn=()=>{let t=Mc(3),[e]=Dc(),[o,r]=Uc(e),n;return t[0]!==o||t[1]!==r?(n=$o(hn.Fragment,{children:[Me("p",{children:"HI"}),o,r,Me("p",{children:"DONE"})]}),t[0]=o,t[1]=r,t[2]=n):n=t[2],n};var Gc=y({plugins:[{Component:gn,position:"bottom"}]});import{c as Wc}from"react/compiler-runtime";import{jsx as Vc}from"react/jsx-runtime";import{useLexicalComposerContext as Kc}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Jc}from"@lexical/react/LexicalTreeView.js";import"react";var xn=()=>{let t=Wc(2),[e]=Kc(),o;return t[0]!==e?(o=Vc(Jc,{editor:e,timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",treeTypeButtonClassName:"debug-treetype-button",viewClassName:"tree-view-output"}),t[0]=e,t[1]=o):o=t[1],o};var Xc=y({plugins:[{Component:xn,position:"bottom"}]});import{$isTableSelection as zc}from"@lexical/table";import{$isRangeSelection as Zc,FORMAT_TEXT_COMMAND as Yc}from"lexical";import{jsx as Cn}from"react/jsx-runtime";import"react";var bn=()=>Cn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Cn("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})});var Y=t=>({type:"buttons",items:t,key:"format",order:40});var kn={type:"text-format",format:["bold","italic"],tag:"***"},_n={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},Tn={type:"text-format",format:["bold"],tag:"**"},wn={type:"text-format",format:["bold"],intraword:!1,tag:"__"};var En=[Y([{ChildComponent:bn,isActive:({selection:t})=>Zc(t)||zc(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(Yc,"bold")},order:1}])],qc=y(({featureProviderMap:t})=>{let e=[Tn,wn];return t.get("italic")&&e.push(_n,kn),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:En},toolbarInline:{groups:En}}});import{$isTableSelection as eu}from"@lexical/table";import{$isRangeSelection as tu,FORMAT_TEXT_COMMAND as ou}from"lexical";import{jsx as Nn,jsxs as Qc}from"react/jsx-runtime";import"react";var Sn=()=>Qc("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Nn("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),Nn("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]});var Ln={type:"text-format",format:["code"],tag:"`"};var yn=[Y([{ChildComponent:Sn,isActive:({selection:t})=>tu(t)||eu(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(ou,"code")},order:7}])],ru=y({enableFormats:["code"],markdownTransformers:[Ln],toolbarFixed:{groups:yn},toolbarInline:{groups:yn}});import{$isTableSelection as nu}from"@lexical/table";import{$isRangeSelection as lu,FORMAT_TEXT_COMMAND as iu}from"lexical";import{jsx as In}from"react/jsx-runtime";import"react";var Rn=()=>In("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:In("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})});var vn={type:"text-format",format:["italic"],tag:"*"},Mn={type:"text-format",format:["italic"],intraword:!1,tag:"_"};var Dn=[Y([{ChildComponent:Rn,isActive:({selection:t})=>lu(t)||nu(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(iu,"italic")},order:2}])],su=y({enableFormats:["italic"],markdownTransformers:[vn,Mn],toolbarFixed:{groups:Dn},toolbarInline:{groups:Dn}});import{$isTableSelection as cu}from"@lexical/table";import{$isRangeSelection as uu,FORMAT_TEXT_COMMAND as du}from"lexical";import{jsx as An,jsxs as au}from"react/jsx-runtime";import"react";var On=()=>au("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[An("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),An("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]});var $n={type:"text-format",format:["strikethrough"],tag:"~~"};var Fn=[Y([{ChildComponent:On,isActive:({selection:t})=>uu(t)||cu(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(du,"strikethrough")},order:4}])],mu=y({enableFormats:["strikethrough"],markdownTransformers:[$n],toolbarFixed:{groups:Fn},toolbarInline:{groups:Fn}});import{$isTableSelection as pu}from"@lexical/table";import{$isRangeSelection as fu,FORMAT_TEXT_COMMAND as hu}from"lexical";import{jsx as Pn}from"react/jsx-runtime";import"react";var Bn=()=>Pn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Pn("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})});var Hn=[Y([{ChildComponent:Bn,isActive:({selection:t})=>fu(t)||pu(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(hu,"subscript")},order:5}])],gu=y({enableFormats:["subscript"],toolbarFixed:{groups:Hn},toolbarInline:{groups:Hn}});import{$isTableSelection as xu}from"@lexical/table";import{$isRangeSelection as Cu,FORMAT_TEXT_COMMAND as bu}from"lexical";import{jsx as jn}from"react/jsx-runtime";import"react";var Un=()=>jn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:jn("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})});var Gn=[Y([{ChildComponent:Un,isActive:({selection:t})=>Cu(t)||xu(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(bu,"superscript")},order:6}])],ku=y({enableFormats:["superscript"],toolbarFixed:{groups:Gn},toolbarInline:{groups:Gn}});import{$isTableSelection as Tu}from"@lexical/table";import{$isRangeSelection as wu,FORMAT_TEXT_COMMAND as Eu}from"lexical";import{jsx as Wn,jsxs as _u}from"react/jsx-runtime";import"react";var Vn=()=>_u("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Wn("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),Wn("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]});var Kn=[Y([{ChildComponent:Vn,isActive:({selection:t})=>wu(t)||Tu(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(Eu,"underline")},order:3}])],Nu=y({enableFormats:["underline"],toolbarFixed:{groups:Kn},toolbarInline:{groups:Kn}});import{jsx as Bo}from"react/jsx-runtime";import{jsx as Su}from"react/jsx-runtime";function Lu(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}var Jt=({css:t})=>{let e=t?Object.fromEntries(Object.entries(t).map(([o,r])=>[Lu(o),r])):{};return Su("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as yu}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as Iu}from"@lexical/selection";import{$getNodeByKey as Ru,$getState as vu,$setState as Mu,createState as Du,TextNode as Au}from"lexical";import{useEffect as Ou}from"react";var Fo=new Map;function Jn(t){for(let e in t){let o=t[e],r=Du(e,{parse:n=>typeof n=="string"&&Object.keys(o).includes(n)?n:void 0});Fo.set(e,{stateConfig:r,stateValues:o})}}function Po(t,e,o){t.update(()=>{Iu(r=>{let n=Fo.get(e);if(!n)throw new Error(`State config for ${e} not found`);Mu(r,n.stateConfig,o)})})}function Xn(){let[t]=yu();return Ou(()=>t.registerMutationListener(Au,e=>{t.getEditorState().read(()=>{for(let[o,r]of e){if(r==="destroyed")continue;let n=Ru(o),l=t.getElementByKey(o);if(!n||!l)continue;let i=Object.create(null);Fo.forEach((s,u)=>{let c=vu(n,s.stateConfig);if(!c){delete l.dataset[u];return}l.dataset[u]=c;let d=s.stateValues[c]?.css;d&&Object.assign(i,d)}),l.style.cssText="",Object.assign(l.style,i)}})}),[t]),null}var zn=t=>{let e=[];for(let r in t.state){let n=t.state[r];for(let l in n){let i=n[l];e.push({ChildComponent:()=>Bo(Jt,{css:i.css}),key:l,label:i.label,onSelect:({editor:s})=>{Po(s,r,l)}})}}return[{type:"dropdown",ChildComponent:()=>Bo(Jt,{css:{color:"var(--theme-elevation-600)"}}),items:[...[{ChildComponent:()=>Bo(Jt,{}),key:"clear-style",label:({i18n:r})=>r.t("lexical:textState:defaultStyle"),onSelect:({editor:r})=>{for(let n in t.state)Po(r,n,void 0)},order:1}],...e],key:"textState",order:30}]},$u=y(({props:t})=>(Jn(t.state),{plugins:[{Component:Xn,position:"normal"}],toolbarFixed:{groups:zn(t)},toolbarInline:{groups:zn(t)}}));import{$createHeadingNode as Hu,$isHeadingNode as cl,HeadingNode as ju}from"@lexical/rich-text";import{$setBlocksType as Uu}from"@lexical/selection";import{$getSelection as Gu,$isRangeSelection as Wu}from"lexical";import{jsx as Zn}from"react/jsx-runtime";import"react";var Yn=()=>Zn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Zn("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})});import{jsx as qn}from"react/jsx-runtime";import"react";var Qn=()=>qn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:qn("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})});import{jsx as el}from"react/jsx-runtime";import"react";var tl=()=>el("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:el("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})});import{jsx as ol}from"react/jsx-runtime";import"react";var rl=()=>ol("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ol("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});import{jsx as nl}from"react/jsx-runtime";import"react";var ll=()=>nl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:nl("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.1576 10.269C12.6896 10.269 12.3746 10.494 12.2216 10.737H10.8176L11.1956 7.074H15.2546V8.28H12.3206L12.1856 9.549C12.4016 9.351 12.8516 9.126 13.4636 9.126C14.7866 9.126 15.6596 10.053 15.6596 11.358C15.6596 12.609 14.7326 13.608 13.1756 13.608C11.5826 13.608 10.6556 12.753 10.5566 11.511H12.1136C12.1586 12.06 12.5456 12.465 13.1576 12.465C13.8236 12.465 14.1746 11.97 14.1746 11.376C14.1746 10.764 13.8416 10.269 13.1576 10.269Z",fill:"currentColor"})});import{jsx as il}from"react/jsx-runtime";import"react";var sl=()=>il("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:il("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.3646 8.127C12.5456 8.127 12.0416 8.937 12.0416 9.999C12.3296 9.54 12.8246 9.207 13.5536 9.207C14.8586 9.207 15.8036 10.134 15.8036 11.376C15.8036 12.645 14.8226 13.608 13.3196 13.608C11.7266 13.608 10.6196 12.393 10.6196 10.395C10.6196 8.316 11.7716 6.966 13.4186 6.966C14.7056 6.966 15.5786 7.749 15.7316 8.829H14.3186C14.2016 8.415 13.9226 8.127 13.3646 8.127ZM13.3106 12.51C13.9586 12.51 14.3816 12.042 14.3816 11.385C14.3816 10.737 13.9586 10.278 13.3106 10.278C12.6536 10.278 12.2126 10.737 12.2126 11.385C12.2126 12.042 12.6536 12.51 13.3106 12.51Z",fill:"currentColor"})});import{$createHeadingNode as Fu,$isHeadingNode as Pu,HeadingNode as Bu}from"@lexical/rich-text";var Ho=t=>(e,o,r)=>{let n=t(r);n&&(n.append(...o),e.replace(n),n.select(0,0))};var al=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`,r=new RegExp(o);return{type:"element",dependencies:[Bu],export:(n,l)=>{if(!Pu(n))return null;let i=Number(n.getTag().slice(1));return"#".repeat(i)+" "+l(n)},regExp:r,replace:Ho(n=>{let l="h"+n[1]?.length;return Fu(l)})}};var ul=t=>{let e=Gu();Uu(e,()=>Hu(t))},dl={h1:Yn,h2:Qn,h3:tl,h4:rl,h5:ll,h6:sl},Vu=y(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[Q(e.map((r,n)=>({ChildComponent:dl[r],isActive:({selection:l})=>{if(!Wu(l))return!1;for(let i of l.getNodes()){if(cl(i)&&i.getTag()===r)continue;let s=i.getParent();if(!(cl(s)&&s.getTag()===r))return!1}return!0},key:r,label:({i18n:l})=>l.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:l})=>{l.update(()=>{ul(r)})},order:n+2})))];return{markdownTransformers:[al(e)],nodes:[ju],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[Z(e.map(r=>({Icon:dl[r],key:`heading-${r.charAt(1)}`,keywords:["heading",r],label:({i18n:n})=>n.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:n})=>{n.update(()=>{ul(r)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}});import{$isNodeSelection as sd}from"lexical";import{jsx as ml}from"react/jsx-runtime";import"react";var jo=()=>ml("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ml("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})});import{jsx as pl,jsxs as Ku}from"react/jsx-runtime";import"react";var fl=()=>Ku("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[pl("path",{d:"M5 10h10",stroke:"currentColor"}),pl("path",{d:"M10 15V5",stroke:"currentColor"})]});var fe=t=>({type:"dropdown",ChildComponent:fl,items:t,key:"add",order:10});import{addClassNamesToElement as Ju}from"@lexical/utils";import{$applyNodeReplacement as Xu,createCommand as zu,DecoratorNode as Zu}from"lexical";var dt=zu("INSERT_HORIZONTAL_RULE_COMMAND"),ut=class extends Zu{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:Yu,priority:0})}}static importJSON(e){return hl()}createDOM(e){let o=document.createElement("hr");return Ju(o,e.theme.hr),o}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return`
|
|
35
|
-
`}isInline(){return!1}updateDOM(){return!1}};function Yu(){return{node:hl()}}function hl(){return Xu(new ut)}import{$applyNodeReplacement as qu}from"lexical";import"react";var Se=class extends ut{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return mt()}decorate(){return null}exportJSON(){return super.exportJSON()}};function mt(){return qu(new Se)}function Xt(t){return t instanceof Se}var gl={type:"element",dependencies:[Se],export:(t,e)=>Xt(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=mt();e&&t.replace(e)}};import{c as Qu}from"react/compiler-runtime";import{useLexicalComposerContext as ed}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as td}from"@lexical/utils";import{$getSelection as od,$isRangeSelection as rd,COMMAND_PRIORITY_EDITOR as nd}from"lexical";import{useEffect as ld}from"react";var xl=()=>{let t=Qu(3),[e]=ed(),o,r;return t[0]!==e?(o=()=>e.registerCommand(dt,id,nd),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),ld(o,r),null};function id(t){let e=od();if(!rd(e))return!1;if(e.focus.getNode()!==null){let r=mt();td(r)}return!0}var ad=y({markdownTransformers:[gl],nodes:[Se],plugins:[{Component:xl,position:"normal"}],slashMenu:{groups:[Z([{Icon:jo,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(dt,void 0)}}])]},toolbarFixed:{groups:[fe([{ChildComponent:jo,isActive:({selection:t})=>{if(!sd(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Xt(e)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(dt,void 0)}}])]}});import{$findMatchingParent as Ll}from"@lexical/utils";import{$isElementNode as _d,INDENT_CONTENT_COMMAND as Td,OUTDENT_CONTENT_COMMAND as wd}from"lexical";import{jsx as zt,jsxs as cd}from"react/jsx-runtime";import"react";var Cl=()=>cd("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[zt("path",{d:"M2.5 5H10.5",stroke:"currentColor",strokeWidth:"1.5"}),zt("path",{d:"M2.5 10H10.5",stroke:"currentColor",strokeWidth:"1.5"}),zt("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"}),zt("path",{d:"M12.25 7.25L17.25 3.75V10.75L12.25 7.25Z",fill:"currentColor"})]});import{jsx as Zt,jsxs as ud}from"react/jsx-runtime";import"react";var bl=()=>ud("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Zt("path",{d:"M17.5 5H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M17.5 10H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M17.5 15H2.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M7.75 7.25L2.75 3.75V10.75L7.75 7.25Z",fill:"currentColor"})]});import{jsx as dd}from"react/jsx-runtime";import{useLexicalComposerContext as md}from"@lexical/react/LexicalComposerContext";import{TabIndentationPlugin as pd}from"@lexical/react/LexicalTabIndentationPlugin";import{$findMatchingParent as fd,mergeRegister as kl}from"@lexical/utils";import{$getSelection as hd,$isElementNode as El,$isRangeSelection as gd,COMMAND_PRIORITY_LOW as _l,INDENT_CONTENT_COMMAND as Tl,KEY_TAB_COMMAND as xd,OUTDENT_CONTENT_COMMAND as Cd,TabNode as bd}from"lexical";import{useEffect as wl}from"react";var Nl=({clientProps:t})=>{let[e]=md(),{disabledNodes:o,disableTabNode:r}=t;return wl(()=>{if(!(!e||!o?.length))return kl(e.registerCommand(Tl,()=>kd(n=>{if(!o.includes(n.getType())){let l=n.getIndent();n.setIndent(l+1)}}),_l),e.registerUpdateListener(({dirtyElements:n,editorState:l})=>{e.update(()=>{for(let[i]of n){let s=l._nodeMap.get(i);El(s)&&o.includes(s.getType())&&s.getIndent()>0&&s.setIndent(0)}})}))},[e,o]),wl(()=>{if(!(!e||!r))return kl(e.registerCommand(xd,n=>(n.preventDefault(),e.dispatchCommand(n.shiftKey?Cd:Tl,void 0)),_l),e.registerNodeTransform(bd,n=>{n.remove()}))},[e,r]),dd(pd,{})};function kd(t){let e=hd();if(!gd(e))return!1;let o=new Set,r=e.getNodes();for(let n=0;n<r.length;n++){let l=r[n],i=l.getKey();if(o.has(i))continue;let s=fd(l,c=>El(c)&&!c.isInline());if(s===null)continue;let u=s.getKey();s.canIndent()&&!o.has(u)&&(o.add(u),t(s))}return o.size>0}var Sl=t=>({type:"buttons",items:t,key:"indent",order:35});var yl=({disabledNodes:t})=>[Sl([{ChildComponent:Cl,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],r=n=>Il(n)&&n.getIndent()>0;return o.some(n=>r(n)||!!Ll(n,r))},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(wd,void 0)},order:1},{ChildComponent:bl,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],r=n=>Il(n)&&!(t??[]).includes(n.getType());return o.some(n=>r(n)||!!Ll(n,r))},key:"indentIncrease",label:({i18n:e})=>e.t("lexical:indent:increaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Td,void 0)},order:2}])],Ed=y(({props:t})=>{let e=t.disabledNodes??[];return{plugins:[{Component:Nl,position:"normal"}],sanitizedClientFeatureProps:t,toolbarFixed:{groups:yl({disabledNodes:e})},toolbarInline:{groups:yl({disabledNodes:e})}}}),Il=t=>_d(t)&&t.canIndent();import{$findMatchingParent as $m}from"@lexical/utils";import{$getSelection as Zo,$isRangeSelection as ii}from"lexical";import{jsx as Rl}from"react/jsx-runtime";import"react";var vl=()=>Rl("svg",{"aria-hidden":"true",className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Rl("path",{d:"M8.5 11.5L11.5 8.5M8.5 7L9.625 5.875C10.868 4.633 12.882 4.633 14.125 5.875C15.368 7.118 15.368 9.133 14.125 10.375L13 11.5M7 8.5L5.746 9.754C4.56 10.94 4.519 12.85 5.652 14.087C6.814 15.354 8.78 15.449 10.058 14.298L11.5 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});import{$isAtNodeEnd as Ml}from"@lexical/selection";function Ve(t){let{anchor:e}=t,{focus:o}=t,r=t.anchor.getNode(),n=t.focus.getNode();return r===n?r:t.isBackward()?Ml(o)?r:n:Ml(e)?r:n}var Uo=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as Od}from"lexical";import{addClassNamesToElement as Nd,isHTMLAnchorElement as Sd}from"@lexical/utils";import Vo from"bson-objectid";import{$applyNodeReplacement as Ld,$createTextNode as Dl,$getSelection as yd,$isElementNode as Al,$isRangeSelection as Wo,createCommand as Id,ElementNode as Rd}from"lexical";var vd=new Set(["http:","https:","mailto:","sms:","tel:"]),ee=class t extends Rd{__fields;__id;constructor({id:e,fields:o={linkType:"custom",newTab:!1},key:r}){super(r),this.__fields=o,this.__id=e}static clone(e){return new t({id:e.__id,fields:e.__fields,key:e.__key})}static getType(){return"link"}static importDOM(){return{a:e=>({conversion:Md,priority:1})}}static importJSON(e){let o=he({}).updateFromJSON(e);return e.version===1&&typeof e.fields?.doc?.value=="object"&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),e.version===2&&!e.id&&(e.id=new Vo.default().toHexString(),e.version=3),o}canBeEmpty(){return!1}canInsertTextAfter(){return!1}canInsertTextBefore(){return!1}createDOM(e){let o=document.createElement("a");return this.__fields?.linkType==="custom"&&(o.href=this.sanitizeUrl(this.__fields.url??"")),(this.__fields?.newTab??!1)&&(o.target="_blank"),this.__fields?.newTab===!0&&this.__fields?.linkType==="custom"&&(o.rel=Go(o.rel,"add","noopener")),Nd(o,e.theme.link),o}exportJSON(){let e=this.getFields();e?.linkType==="internal"?delete e.url:e?.linkType==="custom"&&delete e.doc;let o={...super.exportJSON(),type:"link",fields:e,version:3},r=this.getID();return r&&(o.id=r),o}extractWithChild(e,o,r){if(!Wo(o))return!1;let n=o.anchor.getNode(),l=o.focus.getNode();return this.isParentOf(n)&&this.isParentOf(l)&&o.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(e,o=!0){let r=this.getParentOrThrow().insertNewAfter(e,o);if(Al(r)){let n=he({fields:this.__fields});return r.append(n),n}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!vd.has(o.protocol))return"about:blank"}catch{return"https://"}return e}setFields(e){let o=this.getWritable();return o.__fields=e,o}setID(e){let o=this.getWritable();return o.__id=e,o}updateDOM(e,o,r){let n=this.__fields?.url,l=this.__fields?.newTab;return n!=null&&n!==e.__fields?.url&&this.__fields?.linkType==="custom"&&(o.href=n),this.__fields?.linkType==="internal"&&e.__fields?.linkType==="custom"&&o.removeAttribute("href"),o.rel==null&&(o.rel=""),l!==e.__fields?.newTab&&(l??!1?(o.target="_blank",this.__fields?.linkType==="custom"&&(o.rel=Go(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=Go(o.rel,"remove","noopener"))),!1}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields).setID(e.id)}};function Md(t){let e=null;if(Sd(t)){let o=t.textContent;o!==null&&o!==""&&(e=he({id:new Vo.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function he({id:t,fields:e}){return Ld(new ee({id:t??new Vo.default().toHexString(),fields:e}))}function J(t){return t instanceof ee}var ae=Id("TOGGLE_LINK_COMMAND");function Ko(t){let e=yd();if(!Wo(e)&&(t===null||!t.selectedNodes?.length))return;let o=Wo(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(l=>{let i=l.getParent();J(i)&&(i.getChildren().forEach(u=>{i.insertBefore(u)}),i.remove())});return}if(o?.length===1){let l=o[0],i=J(l)?l:Dd(l);if(i!==null){i.setFields(t.fields),t.text!=null&&t.text!==i.getTextContent()&&(i.append(Dl(t.text)),i.getChildren().forEach(s=>{s!==i.getLastChild()&&s.remove()}));return}}let r=null,n=null;o?.forEach(l=>{let i=l.getParent();if(!(i===n||i===null||Al(l)&&!l.isInline())){if(J(i)){n=i,i.setFields(t.fields),t.text!=null&&t.text!==i.getTextContent()&&(i.append(Dl(t.text)),i.getChildren().forEach(s=>{s!==i.getLastChild()&&s.remove()}));return}if(i.is(r)||(r=i,n=he({fields:t.fields}),J(i)?l.getPreviousSibling()===null?i.insertBefore(n):i.insertAfter(n):l.insertBefore(n)),J(l)){if(l.is(n))return;if(n!==null){let s=l.getChildren();n.append(...s)}l.remove();return}n!==null&&n.append(l)}})}function Dd(t){return Ad(t,e=>J(e))}function Ad(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function Go(t,e,o){let r,n=`${t}`;if(e==="add"){if(n.includes(o)){let l=new RegExp(o,"g");n=n.replace(l,"").trim()}n=n.trim(),r=n.length===0?`${o}`:`${n} ${o}`}else{let l=new RegExp(o,"g");r=n.replace(l,"").trim()}return r}var Ol={type:"text-match",dependencies:[ee],export:(t,e)=>{if(!J(t))return null;let o=t,{url:r}=o.getFields();return`[${e(o)}](${r})`},importRegExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,regExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,replace:(t,e)=>{let[,o,r]=e,n=he({fields:{doc:null,linkType:"custom",newTab:!1,url:r}}),l=Od(o);return l.setFormat(t.getFormat()),n.append(l),t.replace(n),l},trigger:")"};import{$applyNodeReplacement as $d,$isElementNode as Fd}from"lexical";var ge=class t extends ee{static clone(e){return new t({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){let o=pt({}).updateFromJSON(e);return e.version===1&&typeof e.fields?.doc?.value=="object"&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),o}exportJSON(){let e=super.exportJSON();return{type:"autolink",children:e.children,direction:e.direction,fields:e.fields,format:e.format,indent:e.indent,version:2}}insertNewAfter(e,o=!0){let r=this.getParentOrThrow().insertNewAfter(e,o);if(Fd(r)){let n=pt({fields:this.__fields});return r.append(n),n}return null}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields)}};function pt({fields:t}){return $d(new ge({id:"",fields:t}))}function xe(t){return t instanceof ge}import{c as Pd}from"react/compiler-runtime";import{useLexicalComposerContext as Bd}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Hd}from"@lexical/utils";import{$createTextNode as $l,$getSelection as jd,$isElementNode as Pl,$isLineBreakNode as Bl,$isNodeSelection as Ud,$isRangeSelection as Gd,$isTextNode as ft,TextNode as Wd}from"lexical";import{useEffect as Vd}from"react";function Fl(t,e=o=>o){return o=>{let r=t.exec(o);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function Hl(t,e){for(let o of e){let r=o(t);if(r!=null)return r}return null}var Kd=/[.,;\s]/;function qt(t){return t!==void 0&&Kd.test(t)}function jl(t){return qt(t[t.length-1])}function Xo(t){return qt(t[0])}function Jd(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function Ul(t){let e=t.getPreviousSibling();return Pl(e)&&(e=e.getLastDescendant()),e===null||Bl(e)||ft(e)&&jl(e.getTextContent())}function Gl(t){let e=t.getNextSibling();return Pl(e)&&(e=e.getFirstDescendant()),e===null||Bl(e)||ft(e)&&Xo(e.getTextContent())}function Xd(t,e,o,r){return(t>0?qt(o[t-1]):Ul(r[0]))?e<o.length?qt(o[e]):Gl(r[r.length-1]):!1}function zd(t,e,o){let r=[],n=[],l=[],i=0,s=0,u=[...t];for(;u.length>0;){let c=u[0],a=c.getTextContent().length,p=s;s+a<=e?(r.push(c),i+=a):p>=o?l.push(c):n.push(c),s+=a,u.shift()}return[i,r,n,l]}function Zd(t,e,o,r){let n={linkType:"custom",url:r.url,...r.fields},l=pt({fields:n});if(t.length===1){let i=t[0],s;if(e===0?[s]=i.splitText(o):[,s]=i.splitText(e,o),s){let u=$l(r.text);u.setFormat(s.getFormat()),u.setDetail(s.getDetail()),u.setStyle(s.getStyle()),l.append(u),s.replace(l)}return i}else if(t.length>1){let i=t[0],s=i.getTextContent().length,u;e===0?u=i:[,u]=i.splitText(e);let c=[],d;if(t.forEach(a=>{let m=a.getTextContent().length,f=s,h=s+m;if(f<o)if(h<=o)c.push(a);else{let[g,b]=a.splitText(o-f);g&&c.push(g),d=b}s+=m}),u){let a=jd(),p=a?a.getNodes().find(ft):void 0,m=$l(u.getTextContent());return m.setFormat(u.getFormat()),m.setDetail(u.getDetail()),m.setStyle(u.getStyle()),l.append(m,...c),p&&p===u&&(Gd(a)?m.select(a.anchor.offset,a.focus.offset):Ud(a)&&m.select(0,m.getTextContent().length)),u.replace(l),d}}}function Yd(t,e,o){let r=[...t],n=r.map(u=>u.getTextContent()).join(""),l=n,i,s=0;for(;(i=Hl(l,e))!=null&&i!==null;){let u=i.index,c=i.length,d=u+c;if(Xd(s+u,s+d,n,r)){let[p,,m,f]=zd(r,s+u,s+d),h=s+u-p,g=s+d-p,b=Zd(m,h,g,i);r=b?[b,...f]:f,o(i.url,null),s=0}else s+=d;l=l.substring(d)}}function Jo(t,e,o){let r=t.getChildren(),n=r.length;for(let u=0;u<n;u++){let c=r[u];if(!ft(c)||!c.isSimpleText()){Yt(t),o(null,t.getFields()?.url??null);return}}let l=t.getTextContent(),i=Hl(l,e);if(i===null||i.text!==l){Yt(t),o(null,t.getFields()?.url??null);return}if(!Ul(t)||!Gl(t)){Yt(t),o(null,t.getFields()?.url??null);return}let s=t.getFields()?.url;if(s!==i?.url){let u=t.getFields();u.url=i?.url,t.setFields(u),o(i.url,s??null)}}function qd(t,e,o){let r=t.getPreviousSibling(),n=t.getNextSibling(),l=t.getTextContent();if(xe(r)){let i=r.getFields()?.url?r.getFields()?.url?.startsWith("mailto:")??!1:!1;(!Xo(l)||Jd(l,i))&&(r.append(t),Jo(r,e,o),o(null,r.getFields()?.url??null))}xe(n)&&!jl(l)&&(Yt(n),Jo(n,e,o),o(null,n.getFields()?.url??null))}function Yt(t){let e=t.getChildren(),o=e.length;for(let r=o-1;r>=0;r--)t.insertAfter(e[r]);return t.remove(),e.map(r=>r.getLatest())}function Qd(t){let e=[t],o=t.getNextSibling();for(;o!==null&&ft(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function em(t,e,o){let r=Pd(5),n,l;r[0]!==t||r[1]!==e||r[2]!==o?(n=()=>{if(!t.hasNodes([ge]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let i=(s,u)=>{o?.(s,u)};return Hd(t.registerNodeTransform(Wd,s=>{let u=s.getParentOrThrow(),c=s.getPreviousSibling();if(xe(u))Jo(u,e,i);else if(!J(u)){if(s.isSimpleText()&&(Xo(s.getTextContent())||!xe(c))){let d=Qd(s);Yd(d,e,i)}qd(s,e,i)}}))},l=[t,e,o],r[0]=t,r[1]=e,r[2]=o,r[3]=n,r[4]=l):(n=r[3],l=r[4]),Vd(n,l)}var tm=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,om=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,rm=[Fl(tm,t=>t.startsWith("http")?t:`https://${t}`),Fl(om,t=>`mailto:${t}`)],Wl=()=>{let[t]=Bd();return em(t,rm),null};import{jsx as nm}from"react/jsx-runtime";import{ClickableLinkPlugin as lm}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var Vl=()=>nm(lm,{});import{jsx as wm}from"react/jsx-runtime";import"react";import{createPortal as Em}from"react-dom";import{jsx as Ce,jsxs as ht,Fragment as sm}from"react/jsx-runtime";import{useLexicalComposerContext as am}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as Kl,mergeRegister as Jl}from"@lexical/utils";import{getTranslation as zo}from"@payloadcms/translations";import{CloseMenuIcon as cm,EditIcon as um,ExternalLinkIcon as Xl,formatDrawerSlug as dm,useConfig as mm,useEditDepth as pm,useLocale as fm,useTranslation as hm}from"@payloadcms/ui";import{requests as gm}from"@payloadcms/ui/shared";import{$getSelection as zl,$isLineBreakNode as xm,$isRangeSelection as Zl,COMMAND_PRIORITY_HIGH as Cm,COMMAND_PRIORITY_LOW as Yl,getDOMSelection as bm,KEY_ESCAPE_COMMAND as km,SELECTION_CHANGE_COMMAND as _m}from"lexical";import ql,{useCallback as Ql,useEffect as to,useRef as Tm,useState as De}from"react";function Qt(t,e,o,r=10,n=5){let l=o.parentElement;if(t===null||l==null){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let i=e.getBoundingClientRect(),s=o.getBoundingClientRect(),u=l.getBoundingClientRect(),c=t.top-r,d=t.left-n;c<u.top&&(c+=i.height+t.height+r*2),d+i.width>u.right&&(d=u.right-i.width-n),c-=s.top,d-=s.left,e.style.opacity="1",e.style.transform=`translate(${d}px, ${c}px)`}import{createCommand as im}from"lexical";var eo=im("TOGGLE_LINK_WITH_MODAL_COMMAND");function ei(t){t.preventDefault()}function ti({anchorElem:t}){let[e]=am(),[o,r]=De(),n=Tm(null),[l,i]=De(null),[s,u]=De(null),{fieldProps:{schemaPath:c},uuid:d}=H(),{config:a,getEntityConfig:p}=mm(),{i18n:m,t:f}=hm(),[h,g]=De(),b=pm(),[T,v]=De(!1),[k,_]=De([]),x=fm(),[N,M]=De(!1),O=dm({slug:"lexical-rich-text-link-"+d,depth:b}),{toggleDrawer:$}=de(O),I=Ql(()=>{v(!1),n&&n.current&&(n.current.style.opacity="0",n.current.style.transform="translate(-10000px, -10000px)"),M(!1),i(null),u(null),_([]),g(void 0)},[v,i,u,_]),w=Ql(()=>{let C=zl(),E;if(!Zl(C)||!C){I();return}let R=Ve(C);E=e.getElementByKey(R.getKey())?.getBoundingClientRect();let L=Kl(R,J),D=C.getNodes().filter(X=>!xm(X)).find(X=>{let U=Kl(X,J);return L&&!L.is(U)||U&&!U.is(L)});if(L==null||D){I();return}r(L);let S=L.getFields(),F={...S,id:L.getID(),text:L.getTextContent()};if(S?.linkType==="custom")i(S?.url??null),u(null);else{i(`${a.routes.admin==="/"?"":a.routes.admin}/collections/${S?.doc?.relationTo}/${S?.doc?.value}`);let X=S?.doc?.relationTo?p({collectionSlug:S?.doc?.relationTo}):void 0;if(!X)u(S?.label?String(S?.label):null),i(S?.url?String(S?.url):null);else{let U=typeof S.doc?.value=="object"?S.doc.value.id:S.doc?.value,Be=S.doc?.relationTo;if(!U||!Be)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let we=f("fields:linkedTo",{label:`${zo(X.labels.singular,m)} - ${f("lexical:link:loadingWithEllipsis",m)}`}).replace(/<[^>]*>?/g,"");u(we),gm.get(`${a.serverURL}${a.routes.api}/${Be}/${U}`,{headers:{"Accept-Language":m.language},params:{depth:0,locale:x?.code}}).then(async ue=>{if(!ue.ok)throw new Error(`HTTP error! Status: ${ue.status}`);let Rt=await ue.json(),Ee=X?.admin?.useAsTitle||"id",vt=Rt[Ee],He=f("fields:linkedTo",{label:`${zo(X.labels.singular,m)} - ${vt}`}).replace(/<[^>]*>?/g,"");u(He)}).catch(()=>{let ue=f("fields:linkedTo",{label:`${zo(X.labels.singular,m)} - ${f("general:untitled",m)} - ID: ${U}`}).replace(/<[^>]*>?/g,"");u(ue)})}}g(F),v(!0),_(C?C?.getNodes():[]),xe(L)?M(!0):M(!1);let G=n.current,q=bm(e._window),{activeElement:te}=document;if(G===null)return;let It=e.getRootElement();return q!==null&&It!==null&&It.contains(q.anchorNode)?(E||(E=q.getRangeAt(0).getBoundingClientRect()),E!=null&&(E.y+=40,Qt(E,G,t))):(te==null||te.className!=="link-input")&&(It!==null&&Qt(null,G,t),i(null),u(null)),!0},[e,I,a.routes.admin,a.routes.api,a.serverURL,p,f,m,x?.code,t]);return to(()=>Jl(e.registerCommand(eo,C=>(e.dispatchCommand(ae,C),w(),$(),!0),Yl)),[e,w,$,O]),to(()=>{let C=t.parentElement,E=()=>{e.getEditorState().read(()=>{w()})};return window.addEventListener("resize",E),C?.addEventListener("scroll",E),()=>{window.removeEventListener("resize",E),C?.removeEventListener("scroll",E)}},[t.parentElement,e,w]),to(()=>Jl(e.registerUpdateListener(({editorState:C})=>{C.read(()=>{w()})}),e.registerCommand(_m,()=>(w(),!0),Yl),e.registerCommand(km,()=>T?(I(),!0):!1,Cm)),[e,w,T,I]),to(()=>{e.getEditorState().read(()=>{w()})},[e,w]),ht(ql.Fragment,{children:[Ce("div",{className:"link-editor",ref:n,children:ht("div",{className:"link-input",children:[l&&l.length>0?ht("a",{href:l,rel:"noopener noreferrer",target:"_blank",children:[o?.__fields.newTab?Ce(Xl,{}):null,s!=null&&s.length>0?s:l]}):s!=null&&s.length>0?ht(sm,{children:[o?.__fields.newTab?Ce(Xl,{}):null,Ce("span",{className:"link-input__label-pure",children:s})]}):null,e.isEditable()&&ht(ql.Fragment,{children:[Ce("button",{"aria-label":"Edit link",className:"link-edit",onClick:C=>{C.preventDefault(),$()},onMouseDown:ei,tabIndex:0,type:"button",children:Ce(um,{})}),!N&&Ce("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(ae,null)},onMouseDown:ei,tabIndex:0,type:"button",children:Ce(cm,{})})]})]})}),Ce(ot,{className:"lexical-link-edit-drawer",data:h,drawerSlug:O,drawerTitle:f("fields:editLink"),featureKey:"link",handleDrawerSubmit:(C,E)=>{let R=E,L={...R};delete L.text,e.update(()=>{let D=zl(),S=null;if(Zl(D)?S=Ve(D).getParent():k.length&&(S=k[0]?.getParent()??null),S&&xe(S)){let F=he({fields:L});S.replace(F,!0)}}),e.dispatchCommand(ae,{fields:L,selectedNodes:k,text:R.text})},schemaPath:c,schemaPathSuffix:"fields"})]})}var oi=t=>{let{anchorElem:e=document.body}=t;return Em(wm(ti,{anchorElem:e}),e)};import{c as Lm}from"react/compiler-runtime";import{useLexicalComposerContext as ym}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Im}from"@lexical/utils";import{$getSelection as Rm,$isElementNode as vm,$isRangeSelection as Mm,COMMAND_PRIORITY_LOW as ni,PASTE_COMMAND as Dm}from"lexical";import{useEffect as Am}from"react";var Nm=/^(?:[a-zA-Z][a-zA-Z\d+.-]*:(?:\/\/)?(?:[-;:&=+$,\w]+@)?[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|www\.[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|(?:tel|mailto):[\w+.-]+)(?:\/[+~%/\w-]*)?(?:\?[-;&=%\w]*)?(?:#\w+)?$/,Sm=/^(?:\/[\w\-./]*(?:#\w[\w-]*)?|#[\w\-]+)$/;function ri(t){if(!t)return!1;if(t==="https://"||Nm.test(t)||Sm.test(t))return!0;try{return new URL(t),!0}catch{}return!1}var li=t=>{let e=Lm(5),{clientProps:o}=t,[r]=ym(),n,l;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==r?(n=()=>{if(!r.hasNodes([ee]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Im(r.registerCommand(ae,i=>i===null?(Ko(null),!0):(i.fields?.linkType||(i.fields.linkType=o.defaultLinkType),i.fields?.url||(i.fields.url=o.defaultLinkURL),Ko(i),!0),ni),r.registerCommand(Dm,i=>{let s=Rm();if(!Mm(s)||s.isCollapsed()||!(i instanceof ClipboardEvent)||i.clipboardData==null)return!1;let u=i.clipboardData.getData("text");if(!ri(u))return!1;if(!s.getNodes().some(Om)){let c={doc:null,linkType:"custom",newTab:!1,url:u};return r.dispatchCommand(ae,{fields:c,text:null}),i.preventDefault(),!0}return!1},ni))},l=[o.defaultLinkType,o.defaultLinkURL,r],e[0]=o.defaultLinkType,e[1]=o.defaultLinkURL,e[2]=r,e[3]=n,e[4]=l):(n=e[3],l=e[4]),Am(n,l),null};function Om(t){return vm(t)}var si=[Uo([{ChildComponent:vl,isActive:({selection:t})=>{if(ii(t)){let e=Ve(t);return $m(e,J)!=null}return!1},isEnabled:({selection:t})=>!!(ii(t)&&Zo()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(ae,null);else{let o,r=[];if(t.getEditorState().read(()=>{o=Zo()?.getTextContent(),r=Zo()?.getNodes()??[]}),!o?.length)return;let n={doc:null};t.dispatchCommand(eo,{fields:n,selectedNodes:r,text:o})}},order:1}])],Fm=y(({props:t})=>({markdownTransformers:[Ol],nodes:[ee,t?.disableAutoLinks===!0?null:ge].filter(Boolean),plugins:[{Component:li,position:"normal"},t?.disableAutoLinks===!0||t?.disableAutoLinks==="creationOnly"?null:{Component:Wl,position:"normal"},{Component:Vl,position:"normal"},{Component:oi,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:si},toolbarInline:{groups:si}}));import{$isListNode as Qo,INSERT_CHECK_LIST_COMMAND as pi,ListItemNode as zm,ListNode as Zm}from"@lexical/list";import{$isRangeSelection as Ym}from"lexical";import{jsx as ai,jsxs as Pm}from"react/jsx-runtime";import"react";var Yo=()=>Pm("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ai("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),ai("path",{d:"M7 10L9 12.5L13 7.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Bm}from"react/jsx-runtime";import{ListPlugin as Hm}from"@lexical/react/LexicalListPlugin.js";import"react";var Ke=()=>Bm(Hm,{});function Je(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{$isListNode as Wm,ListItemNode as Vm,ListNode as Km}from"@lexical/list";import{$createListItemNode as jm,$createListNode as Um,$isListItemNode as Gm,$isListNode as qo}from"@lexical/list";var ci=4,Xe=t=>(e,o,r)=>{let n=e.getPreviousSibling(),l=e.getNextSibling(),i=jm(t==="check"?r[3]==="x":void 0);if(qo(l)&&l.getListType()===t){let u=l.getFirstChild();u!==null?u.insertBefore(i):l.append(i),e.remove()}else if(qo(n)&&n.getListType()===t)n.append(i),e.remove();else{let u=Um(t,t==="number"?Number(r[2]):void 0);u.append(i),e.replace(u)}i.append(...o),i.select(0,0);let s=Math.floor(r[1].length/ci);s&&i.setIndent(s)},Ae=(t,e,o)=>{let r=[],n=t.getChildren(),l=0;for(let i of n)if(Gm(i)){if(i.getChildrenSize()===1){let d=i.getFirstChild();if(qo(d)){r.push(Ae(d,e,o+1));continue}}let s=" ".repeat(o*ci),u=t.getListType(),c=u==="number"?`${t.getStart()+l}. `:u==="check"?`- [${i.getChecked()?"x":" "}] `:"- ";r.push(s+c+e(i)),l++}return r.join(`
|
|
36
|
-
`)};var ui={type:"element",dependencies:[Km,Vm],export:(t,e)=>Wm(t)?Ae(t,e,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:Xe("check")};import{jsx as Jm}from"react/jsx-runtime";import{CheckListPlugin as Xm}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var di=()=>Jm(Xm,{});var mi=[Q([{ChildComponent:Yo,isActive:({selection:t})=>{if(!Ym(t))return!1;for(let e of t.getNodes()){if(Qo(e)&&e.getListType()==="check")continue;let o=e.getParent();if(Qo(o)&&o.getListType()==="check")continue;let r=o?.getParent();if(!(Qo(r)&&r.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:t})=>t.t("lexical:checklist:label"),onSelect:({editor:t})=>{t.dispatchCommand(pi,void 0)},order:12}])],qm=y(({featureProviderMap:t})=>{let e=[{Component:di,position:"normal"}];return!t.has("unorderedList")&&!t.has("orderedList")&&e.push({Component:Ke,position:"normal"}),{markdownTransformers:[ui],nodes:t.has("unorderedList")||t.has("orderedList")?[]:[Zm,zm],plugins:e,slashMenu:{groups:[Je([{Icon:Yo,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:o})=>o.t("lexical:checklist:label"),onSelect:({editor:o})=>{o.dispatchCommand(pi,void 0)}}])]},toolbarFixed:{groups:mi},toolbarInline:{groups:mi}}});import{$isListNode as tr,INSERT_ORDERED_LIST_COMMAND as gi,ListItemNode as rp,ListNode as np}from"@lexical/list";import{$isRangeSelection as lp}from"lexical";import{jsx as gt,jsxs as Qm}from"react/jsx-runtime";import"react";var er=()=>Qm("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[gt("path",{d:"M5.89284 12.479C5.89284 13.368 5.26284 13.788 4.38084 14.236C3.75084 14.558 3.43584 14.789 3.40784 15.062H5.89984V16H2.06384V15.573C2.06384 14.523 2.92484 13.935 3.66684 13.501C4.38084 13.088 4.75184 12.878 4.75184 12.458C4.75184 12.08 4.52084 11.835 4.06584 11.835C3.58984 11.835 3.30984 12.199 3.28184 12.654H2.11284C2.18984 11.681 2.87584 10.918 4.07284 10.918C5.15784 10.918 5.89284 11.555 5.89284 12.479Z",fill:"currentColor"}),gt("path",{d:"M2.68608 4.535V3.737C3.54008 3.737 3.90408 3.513 4.02308 2.995H4.89108V8H3.68008L3.68008 4.535H2.68608Z",fill:"currentColor"}),gt("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),gt("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),gt("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as ep,ListItemNode as tp,ListNode as op}from"@lexical/list";var fi={type:"element",dependencies:[op,tp],export:(t,e)=>ep(t)?Ae(t,e,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:Xe("number")};var hi=[Q([{ChildComponent:er,isActive:({selection:t})=>{if(!lp(t))return!1;for(let e of t.getNodes()){if(tr(e)&&e.getListType()==="number")continue;let o=e.getParent();if(tr(o)&&o.getListType()==="number")continue;let r=o?.getParent();if(!(tr(r)&&r.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:t})=>t.t("lexical:orderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(gi,void 0)},order:10}])],ip=y(({featureProviderMap:t})=>({markdownTransformers:[fi],nodes:t.has("orderedList")?[]:[np,rp],plugins:t.has("orderedList")?[]:[{Component:Ke,position:"normal"}],slashMenu:{groups:[Je([{Icon:er,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:e})=>e.t("lexical:orderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(gi,void 0)}}])]},toolbarFixed:{groups:hi},toolbarInline:{groups:hi}}));import{$isListNode as rr,INSERT_UNORDERED_LIST_COMMAND as bi,ListItemNode as dp,ListNode as mp}from"@lexical/list";import{$isRangeSelection as pp}from"lexical";import{jsx as ze,jsxs as sp}from"react/jsx-runtime";import"react";var or=()=>sp("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ze("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),ze("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),ze("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),ze("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),ze("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),ze("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as ap,ListItemNode as cp,ListNode as up}from"@lexical/list";var xi={type:"element",dependencies:[up,cp],export:(t,e)=>ap(t)?Ae(t,e,0):null,regExp:/^(\s*)[-*+]\s/,replace:Xe("bullet")};var Ci=[Q([{ChildComponent:or,isActive:({selection:t})=>{if(!pp(t))return!1;for(let e of t.getNodes()){if(rr(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(rr(o)&&o.getListType()==="bullet")continue;let r=o?.getParent();if(!(rr(r)&&r.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(bi,void 0)},order:11}])],fp=y({markdownTransformers:[xi],nodes:[mp,dp],plugins:[{Component:Ke,position:"normal"}],slashMenu:{groups:[Je([{Icon:or,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(bi,void 0)}}])]},toolbarFixed:{groups:Ci},toolbarInline:{groups:Ci}});import{jsx as hp}from"react/jsx-runtime";import{addClassNamesToElement as gp}from"@lexical/utils";import{DecoratorNode as xp}from"lexical";import*as ki from"react";var Cp=ki.lazy(()=>import("./Component-MBLHTKDK.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),xt=class t extends xp{__data;constructor({data:e,key:o}){super(o),this.__data=e}static clone(e){return new t({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return bp({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return gp(o,"unknownConverted"),o}decorate(){return hp(Cp,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function bp({data:t}){return new xt({data:t})}var kp=y(()=>({nodes:[xt]}));import{jsx as _p}from"react/jsx-runtime";import{addClassNamesToElement as Tp}from"@lexical/utils";import{DecoratorNode as wp}from"lexical";import*as _i from"react";var Ep=_i.lazy(()=>import("./Component-DOSSWC76.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),Ct=class t extends wp{__data;constructor({data:e,key:o}){super(o),this.__data=e}static clone(e){return new t({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return Np({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return Tp(o,"unknownConverted"),o}decorate(){return _p(Ep,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function Np({data:t}){return new Ct({data:t})}var Sp=y(()=>({nodes:[Ct]}));import{$setBlocksType as Ei}from"@lexical/selection";import{$createParagraphNode as Ni,$getSelection as Si,$isParagraphNode as Ti,$isRangeSelection as Lp}from"lexical";var wi=[Q([{ChildComponent:nt,isActive:({selection:t})=>{if(!Lp(t))return!1;for(let e of t.getNodes())if(!Ti(e)&&!Ti(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=Si();Ei(e,()=>Ni())})},order:1}])],yp=y({slashMenu:{groups:[Z([{Icon:nt,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Si();Ei(e,()=>Ni())})}}])]},toolbarFixed:{groups:wi},toolbarInline:{groups:wi}});import{c as zp}from"react/compiler-runtime";import{jsx as Ki}from"react/jsx-runtime";import{useLexicalComposerContext as Zp}from"@lexical/react/LexicalComposerContext";import{useEffect as Yp,useState as qp}from"react";import{jsx as Vi,Fragment as Xp}from"react/jsx-runtime";import"react";import{jsx as Ip}from"react/jsx-runtime";var Li={quote:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Ip("blockquote",{children:o})}};import{jsx as Rp}from"react/jsx-runtime";var yi={heading:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return Rp(r,{children:o})}};import{jsx as vp}from"react/jsx-runtime";var Ii={horizontalrule:vp("hr",{})};import{jsx as Mp}from"react/jsx-runtime";var Ri={linebreak:Mp("br",{})};import{jsx as vi}from"react/jsx-runtime";var Mi=({internalDocToHref:t})=>({autolink:({node:e,nodesToJSX:o})=>{let r=o({nodes:e.children}),n=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0;return vi("a",{href:e.fields.url,rel:n,target:l,children:r})},link:({node:e,nodesToJSX:o})=>{let r=o({nodes:e.children}),n=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0,i=e.fields.url??"";return e.fields.linkType==="internal"&&(t?i=t({linkNode:e}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),i="#")),vi("a",{href:i,rel:n,target:l,children:r})}});import{jsx as Ze,jsxs as Dp,Fragment as Ap}from"react/jsx-runtime";import{v4 as Op}from"uuid";var Di={list:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return Ze(r,{className:`list-${t?.listType}`,children:o})},listitem:({node:t,nodesToJSX:e,parent:o})=>{let r=t.children.some(l=>l.type==="list"),n=e({nodes:t.children});if("listType"in o&&o?.listType==="check"){let l=Op();return Ze("li",{"aria-checked":t.checked?"true":"false",className:`list-item-checkbox${t.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked"}${r?" nestedListItem":""}`,role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:t?.value,children:r?n:Dp(Ap,{children:[Ze("input",{checked:t.checked,id:l,readOnly:!0,type:"checkbox"}),Ze("label",{htmlFor:l,children:n}),Ze("br",{})]})})}else return Ze("li",{className:`${r?"nestedListItem":""}`,style:r?{listStyleType:"none"}:void 0,value:t?.value,children:n})}};import{jsx as nr}from"react/jsx-runtime";var Ai={paragraph:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return o?.length?nr("p",{children:o}):nr("p",{children:nr("br",{})})}};var Oi={tab:" "};import{jsx as bt}from"react/jsx-runtime";var $i={table:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return bt("div",{className:"lexical-table-container",children:bt("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:bt("tbody",{children:o})})})},tablecell:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.headerState>0?"th":"td",n=`lexical-table-cell-header-${t.headerState}`,l={backgroundColor:t.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},i=t.colSpan&&t.colSpan>1?t.colSpan:void 0,s=t.rowSpan&&t.rowSpan>1?t.rowSpan:void 0;return bt(r,{className:`lexical-table-cell ${n}`,colSpan:i,rowSpan:s,style:l,children:o})},tablerow:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return bt("tr",{className:"lexical-table-row",children:o})}};import{jsx as Oe}from"react/jsx-runtime";import"react";var A={DOM_ELEMENT_TYPE:1,DOM_TEXT_TYPE:3,NO_DIRTY_NODES:0,HAS_DIRTY_NODES:1,FULL_RECONCILE:2,IS_NORMAL:0,IS_TOKEN:1,IS_SEGMENTED:2,IS_INERT:3,IS_BOLD:1,IS_ITALIC:2,IS_STRIKETHROUGH:4,IS_UNDERLINE:8,IS_CODE:16,IS_SUBSCRIPT:32,IS_SUPERSCRIPT:64,IS_HIGHLIGHT:128,IS_DIRECTIONLESS:1,IS_UNMERGEABLE:2,IS_ALIGN_LEFT:1,IS_ALIGN_CENTER:2,IS_ALIGN_RIGHT:3,IS_ALIGN_JUSTIFY:4,IS_ALIGN_START:5,IS_ALIGN_END:6},$p=A.IS_BOLD|A.IS_ITALIC|A.IS_STRIKETHROUGH|A.IS_UNDERLINE|A.IS_CODE|A.IS_SUBSCRIPT|A.IS_SUPERSCRIPT|A.IS_HIGHLIGHT,Fp="\xA0",Pp=`
|
|
34
|
+
`},[t,e]),m=ve((b,_)=>{o(x=>{let w=e.length-1,v=e[w];if(v&&v.name===b){if(b==="type")return[...e.slice(0,w),{...v,value:v.value+_}];if(v.value===_)return[...e.slice(0,w),{...v,count:v.count+1}]}return[...x,{name:b,count:1,value:_}]})},[e,o]);pn(()=>{let b=x=>{if(!r)return;let w=x.key;Gc(x)?m("selectAll",""):hn.has(w)?m("press",x.key):[...w].length>1?m("keydown",x.key):m("type",x.key)},_=x=>{if(!r)return;let w=x.key;!hn.has(w)&&[...w].length>1&&m("keyup",x.key)};return t.registerRootListener((x,w)=>{w!==null&&(w.removeEventListener("keydown",b),w.removeEventListener("keyup",_)),x!==null&&(x.addEventListener("keydown",b),x.addEventListener("keyup",_))})},[t,r,m]),pn(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[p]),Oo(()=>{if(e){let b=p();b!==null&&s(b),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[p,e]),Oo(()=>t.registerUpdateListener(({dirtyElements:_,dirtyLeaves:x,editorState:w})=>{if(!r)return;let v=w._selection,O=u.current,F=c.current;if(O!==v){if(x.size===0&&_.size===0&&!F){let E=Ao(t._window);if(E&&(E.anchorNode==null||E.focusNode==null))return}u.current=v}c.current=!1;let R=p();R!==null&&s(R)}),[t,p,r,m]),Oo(()=>r?t.registerUpdateListener(()=>{let _=t.getRootElement();_!==null&&l(_?.innerHTML)}):void 0,[t,r]);let f=ve(b=>{r||(b.update(()=>{let _=Bc();_.clear();let x=Pc();_.append($c().append(x)),x.select()}),o([])),n(_=>!_)},[r]),h=ve(()=>{if(!r)return;let b=Ao(t._window);if(b===null||b.anchorNode==null||b.focusNode==null)return;let{anchorNode:_,anchorOffset:x,focusNode:w,focusOffset:v}=Wc(b),O=a().getRootElement(),F;_!==null&&(F=fn(_,O));let R;w!==null&&(R=fn(w,O)),m("snapshot",{anchorNode:_,anchorOffset:x,anchorPath:F,focusNode:w,focusOffset:v,focusPath:R})},[m,r,a]),g=ve(()=>{Hc(p())},[p]),k=ve(()=>{jc("test.js",p())},[p]);return[Me("button",{className:`editor-dev-button ${r?"active":""}`,id:"test-recorder-button",onClick:b=>{f(a()),b.preventDefault()},title:r?"Disable test recorder":"Enable test recorder",type:"button",children:r?"Disable test recorder":"Enable test recorder"}),r?$o("div",{className:"test-recorder-output",children:[$o("div",{className:"test-recorder-toolbar",children:[Me("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:b=>{h(),b.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Me("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:b=>{g(),b.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Me("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:b=>{k(),b.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Me("pre",{id:"test-recorder",ref:d,children:i})]}):null]}var xn=()=>{let t=Oc(3),[e]=Fc(),[o,r]=Vc(e),n;return t[0]!==o||t[1]!==r?(n=$o(gn.Fragment,{children:[Me("p",{children:"HI"}),o,r,Me("p",{children:"DONE"})]}),t[0]=o,t[1]=r,t[2]=n):n=t[2],n};var Kc=y({plugins:[{Component:xn,position:"bottom"}]});import{c as Jc}from"react/compiler-runtime";import{jsx as Xc}from"react/jsx-runtime";import{useLexicalComposerContext as zc}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Zc}from"@lexical/react/LexicalTreeView.js";import"react";var Cn=()=>{let t=Jc(2),[e]=zc(),o;return t[0]!==e?(o=Xc(Zc,{editor:e,timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",treeTypeButtonClassName:"debug-treetype-button",viewClassName:"tree-view-output"}),t[0]=e,t[1]=o):o=t[1],o};var Yc=y({plugins:[{Component:Cn,position:"bottom"}]});import{$isTableSelection as qc}from"@lexical/table";import{$isRangeSelection as Qc,FORMAT_TEXT_COMMAND as eu}from"lexical";import{jsx as bn}from"react/jsx-runtime";import"react";var kn=()=>bn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:bn("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})});var Y=t=>({type:"buttons",items:t,key:"format",order:40});var _n={type:"text-format",format:["bold","italic"],tag:"***"},Tn={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},wn={type:"text-format",format:["bold"],tag:"**"},En={type:"text-format",format:["bold"],intraword:!1,tag:"__"};var Sn=[Y([{ChildComponent:kn,isActive:({selection:t})=>Qc(t)||qc(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(eu,"bold")},order:1}])],tu=y(({featureProviderMap:t})=>{let e=[wn,En];return t.get("italic")&&e.push(Tn,_n),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:Sn},toolbarInline:{groups:Sn}}});import{$isTableSelection as ru}from"@lexical/table";import{$isRangeSelection as nu,FORMAT_TEXT_COMMAND as lu}from"lexical";import{jsx as Nn,jsxs as ou}from"react/jsx-runtime";import"react";var Ln=()=>ou("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Nn("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),Nn("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]});var yn={type:"text-format",format:["code"],tag:"`"};var In=[Y([{ChildComponent:Ln,isActive:({selection:t})=>nu(t)||ru(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(lu,"code")},order:7}])],iu=y({enableFormats:["code"],markdownTransformers:[yn],toolbarFixed:{groups:In},toolbarInline:{groups:In}});import{$isTableSelection as su}from"@lexical/table";import{$isRangeSelection as au,FORMAT_TEXT_COMMAND as cu}from"lexical";import{jsx as Rn}from"react/jsx-runtime";import"react";var vn=()=>Rn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Rn("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})});var Mn={type:"text-format",format:["italic"],tag:"*"},Dn={type:"text-format",format:["italic"],intraword:!1,tag:"_"};var An=[Y([{ChildComponent:vn,isActive:({selection:t})=>au(t)||su(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(cu,"italic")},order:2}])],uu=y({enableFormats:["italic"],markdownTransformers:[Mn,Dn],toolbarFixed:{groups:An},toolbarInline:{groups:An}});import{$isTableSelection as mu}from"@lexical/table";import{$isRangeSelection as pu,FORMAT_TEXT_COMMAND as fu}from"lexical";import{jsx as On,jsxs as du}from"react/jsx-runtime";import"react";var Fn=()=>du("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[On("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),On("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]});var $n={type:"text-format",format:["strikethrough"],tag:"~~"};var Pn=[Y([{ChildComponent:Fn,isActive:({selection:t})=>pu(t)||mu(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(fu,"strikethrough")},order:4}])],hu=y({enableFormats:["strikethrough"],markdownTransformers:[$n],toolbarFixed:{groups:Pn},toolbarInline:{groups:Pn}});import{$isTableSelection as gu}from"@lexical/table";import{$isRangeSelection as xu,FORMAT_TEXT_COMMAND as Cu}from"lexical";import{jsx as Bn}from"react/jsx-runtime";import"react";var Hn=()=>Bn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Bn("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})});var jn=[Y([{ChildComponent:Hn,isActive:({selection:t})=>xu(t)||gu(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(Cu,"subscript")},order:5}])],bu=y({enableFormats:["subscript"],toolbarFixed:{groups:jn},toolbarInline:{groups:jn}});import{$isTableSelection as ku}from"@lexical/table";import{$isRangeSelection as _u,FORMAT_TEXT_COMMAND as Tu}from"lexical";import{jsx as Un}from"react/jsx-runtime";import"react";var Gn=()=>Un("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Un("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})});var Wn=[Y([{ChildComponent:Gn,isActive:({selection:t})=>_u(t)||ku(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(Tu,"superscript")},order:6}])],wu=y({enableFormats:["superscript"],toolbarFixed:{groups:Wn},toolbarInline:{groups:Wn}});import{$isTableSelection as Su}from"@lexical/table";import{$isRangeSelection as Nu,FORMAT_TEXT_COMMAND as Lu}from"lexical";import{jsx as Vn,jsxs as Eu}from"react/jsx-runtime";import"react";var Kn=()=>Eu("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Vn("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),Vn("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]});var Jn=[Y([{ChildComponent:Kn,isActive:({selection:t})=>Nu(t)||Su(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(Lu,"underline")},order:3}])],yu=y({enableFormats:["underline"],toolbarFixed:{groups:Jn},toolbarInline:{groups:Jn}});import{jsx as Ho}from"react/jsx-runtime";import{jsx as Iu}from"react/jsx-runtime";function Ru(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}var Xt=({css:t})=>{let e=t?Object.fromEntries(Object.entries(t).map(([o,r])=>[Ru(o),r])):{};return Iu("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as vu}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as Mu}from"@lexical/selection";import{$getNodeByKey as Du,$getState as Au,$setState as Ou,createState as Fu,TextNode as $u}from"lexical";import{useEffect as Pu}from"react";var Po=new Map;function Xn(t){for(let e in t){let o=t[e],r=Fu(e,{parse:n=>typeof n=="string"&&Object.keys(o).includes(n)?n:void 0});Po.set(e,{stateConfig:r,stateValues:o})}}function Bo(t,e,o){t.update(()=>{Mu(r=>{let n=Po.get(e);if(!n)throw new Error(`State config for ${e} not found`);Ou(r,n.stateConfig,o)})})}function zn(){let[t]=vu();return Pu(()=>t.registerMutationListener($u,e=>{t.getEditorState().read(()=>{for(let[o,r]of e){if(r==="destroyed")continue;let n=Du(o),l=t.getElementByKey(o);if(!n||!l)continue;let i=Object.create(null);Po.forEach((s,u)=>{let c=Au(n,s.stateConfig);if(!c){delete l.dataset[u];return}l.dataset[u]=c;let d=s.stateValues[c]?.css;d&&Object.assign(i,d)}),l.style.cssText="",Object.assign(l.style,i)}})}),[t]),null}var Zn=t=>{let e=[];for(let r in t.state){let n=t.state[r];for(let l in n){let i=n[l];e.push({ChildComponent:()=>Ho(Xt,{css:i.css}),key:l,label:i.label,onSelect:({editor:s})=>{Bo(s,r,l)}})}}return[{type:"dropdown",ChildComponent:()=>Ho(Xt,{css:{color:"var(--theme-elevation-600)"}}),items:[...[{ChildComponent:()=>Ho(Xt,{}),key:"clear-style",label:({i18n:r})=>r.t("lexical:textState:defaultStyle"),onSelect:({editor:r})=>{for(let n in t.state)Bo(r,n,void 0)},order:1}],...e],key:"textState",order:30}]},Bu=y(({props:t})=>(Xn(t.state),{plugins:[{Component:zn,position:"normal"}],toolbarFixed:{groups:Zn(t)},toolbarInline:{groups:Zn(t)}}));import{$createHeadingNode as Gu,$isHeadingNode as ul,HeadingNode as Wu}from"@lexical/rich-text";import{$setBlocksType as Vu}from"@lexical/selection";import{$getSelection as Ku,$isRangeSelection as Ju}from"lexical";import{jsx as Yn}from"react/jsx-runtime";import"react";var qn=()=>Yn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Yn("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})});import{jsx as Qn}from"react/jsx-runtime";import"react";var el=()=>Qn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Qn("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})});import{jsx as tl}from"react/jsx-runtime";import"react";var ol=()=>tl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:tl("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})});import{jsx as rl}from"react/jsx-runtime";import"react";var nl=()=>rl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:rl("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});import{jsx as ll}from"react/jsx-runtime";import"react";var il=()=>ll("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ll("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.1576 10.269C12.6896 10.269 12.3746 10.494 12.2216 10.737H10.8176L11.1956 7.074H15.2546V8.28H12.3206L12.1856 9.549C12.4016 9.351 12.8516 9.126 13.4636 9.126C14.7866 9.126 15.6596 10.053 15.6596 11.358C15.6596 12.609 14.7326 13.608 13.1756 13.608C11.5826 13.608 10.6556 12.753 10.5566 11.511H12.1136C12.1586 12.06 12.5456 12.465 13.1576 12.465C13.8236 12.465 14.1746 11.97 14.1746 11.376C14.1746 10.764 13.8416 10.269 13.1576 10.269Z",fill:"currentColor"})});import{jsx as sl}from"react/jsx-runtime";import"react";var al=()=>sl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:sl("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.3646 8.127C12.5456 8.127 12.0416 8.937 12.0416 9.999C12.3296 9.54 12.8246 9.207 13.5536 9.207C14.8586 9.207 15.8036 10.134 15.8036 11.376C15.8036 12.645 14.8226 13.608 13.3196 13.608C11.7266 13.608 10.6196 12.393 10.6196 10.395C10.6196 8.316 11.7716 6.966 13.4186 6.966C14.7056 6.966 15.5786 7.749 15.7316 8.829H14.3186C14.2016 8.415 13.9226 8.127 13.3646 8.127ZM13.3106 12.51C13.9586 12.51 14.3816 12.042 14.3816 11.385C14.3816 10.737 13.9586 10.278 13.3106 10.278C12.6536 10.278 12.2126 10.737 12.2126 11.385C12.2126 12.042 12.6536 12.51 13.3106 12.51Z",fill:"currentColor"})});import{$createHeadingNode as Hu,$isHeadingNode as ju,HeadingNode as Uu}from"@lexical/rich-text";var jo=t=>(e,o,r)=>{let n=t(r);n&&(n.append(...o),e.replace(n),n.select(0,0))};var cl=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`,r=new RegExp(o);return{type:"element",dependencies:[Uu],export:(n,l)=>{if(!ju(n))return null;let i=Number(n.getTag().slice(1));return"#".repeat(i)+" "+l(n)},regExp:r,replace:jo(n=>{let l="h"+n[1]?.length;return Hu(l)})}};var dl=t=>{let e=Ku();Vu(e,()=>Gu(t))},ml={h1:qn,h2:el,h3:ol,h4:nl,h5:il,h6:al},Xu=y(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[Q(e.map((r,n)=>({ChildComponent:ml[r],isActive:({selection:l})=>{if(!Ju(l))return!1;for(let i of l.getNodes()){if(ul(i)&&i.getTag()===r)continue;let s=i.getParent();if(!(ul(s)&&s.getTag()===r))return!1}return!0},key:r,label:({i18n:l})=>l.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:l})=>{l.update(()=>{dl(r)})},order:n+2})))];return{markdownTransformers:[cl(e)],nodes:[Wu],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[Z(e.map(r=>({Icon:ml[r],key:`heading-${r.charAt(1)}`,keywords:["heading",r],label:({i18n:n})=>n.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:n})=>{n.update(()=>{dl(r)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}});import{$isNodeSelection as ud}from"lexical";import{jsx as pl}from"react/jsx-runtime";import"react";var Uo=()=>pl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:pl("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})});import{jsx as fl,jsxs as zu}from"react/jsx-runtime";import"react";var hl=()=>zu("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[fl("path",{d:"M5 10h10",stroke:"currentColor"}),fl("path",{d:"M10 15V5",stroke:"currentColor"})]});var fe=t=>({type:"dropdown",ChildComponent:hl,items:t,key:"add",order:10});import{addClassNamesToElement as Zu}from"@lexical/utils";import{$applyNodeReplacement as Yu,createCommand as qu,DecoratorNode as Qu}from"lexical";var mt=qu("INSERT_HORIZONTAL_RULE_COMMAND"),dt=class extends Qu{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:ed,priority:0})}}static importJSON(e){return gl()}createDOM(e){let o=document.createElement("hr");return Zu(o,e.theme.hr),o}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return`
|
|
35
|
+
`}isInline(){return!1}updateDOM(){return!1}};function ed(){return{node:gl()}}function gl(){return Yu(new dt)}import{$applyNodeReplacement as td}from"lexical";import"react";var Ne=class extends dt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return pt()}decorate(){return null}exportJSON(){return super.exportJSON()}};function pt(){return td(new Ne)}function zt(t){return t instanceof Ne}var xl={type:"element",dependencies:[Ne],export:(t,e)=>zt(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=pt();e&&t.replace(e)}};import{c as od}from"react/compiler-runtime";import{useLexicalComposerContext as rd}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as nd}from"@lexical/utils";import{$getSelection as ld,$isRangeSelection as id,COMMAND_PRIORITY_EDITOR as sd}from"lexical";import{useEffect as ad}from"react";var Cl=()=>{let t=od(3),[e]=rd(),o,r;return t[0]!==e?(o=()=>e.registerCommand(mt,cd,sd),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),ad(o,r),null};function cd(t){let e=ld();if(!id(e))return!1;if(e.focus.getNode()!==null){let r=pt();nd(r)}return!0}var dd=y({markdownTransformers:[xl],nodes:[Ne],plugins:[{Component:Cl,position:"normal"}],slashMenu:{groups:[Z([{Icon:Uo,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(mt,void 0)}}])]},toolbarFixed:{groups:[fe([{ChildComponent:Uo,isActive:({selection:t})=>{if(!ud(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return zt(e)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(mt,void 0)}}])]}});import{$findMatchingParent as yl}from"@lexical/utils";import{$isElementNode as Ed,INDENT_CONTENT_COMMAND as Sd,OUTDENT_CONTENT_COMMAND as Nd}from"lexical";import{jsx as Zt,jsxs as md}from"react/jsx-runtime";import"react";var bl=()=>md("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Zt("path",{d:"M2.5 5H10.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M2.5 10H10.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M12.25 7.25L17.25 3.75V10.75L12.25 7.25Z",fill:"currentColor"})]});import{jsx as Yt,jsxs as pd}from"react/jsx-runtime";import"react";var kl=()=>pd("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Yt("path",{d:"M17.5 5H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Yt("path",{d:"M17.5 10H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Yt("path",{d:"M17.5 15H2.5",stroke:"currentColor",strokeWidth:"1.5"}),Yt("path",{d:"M7.75 7.25L2.75 3.75V10.75L7.75 7.25Z",fill:"currentColor"})]});import{jsx as fd}from"react/jsx-runtime";import{useLexicalComposerContext as hd}from"@lexical/react/LexicalComposerContext";import{TabIndentationPlugin as gd}from"@lexical/react/LexicalTabIndentationPlugin";import{$findMatchingParent as xd,mergeRegister as _l}from"@lexical/utils";import{$getSelection as Cd,$isElementNode as Sl,$isRangeSelection as bd,COMMAND_PRIORITY_LOW as Tl,INDENT_CONTENT_COMMAND as wl,KEY_TAB_COMMAND as kd,OUTDENT_CONTENT_COMMAND as _d,TabNode as Td}from"lexical";import{useEffect as El}from"react";var Nl=({clientProps:t})=>{let[e]=hd(),{disabledNodes:o,disableTabNode:r}=t;return El(()=>{if(!(!e||!o?.length))return _l(e.registerCommand(wl,()=>wd(n=>{if(!o.includes(n.getType())){let l=n.getIndent();n.setIndent(l+1)}}),Tl),e.registerUpdateListener(({dirtyElements:n,editorState:l})=>{e.update(()=>{for(let[i]of n){let s=l._nodeMap.get(i);Sl(s)&&o.includes(s.getType())&&s.getIndent()>0&&s.setIndent(0)}})}))},[e,o]),El(()=>{if(!(!e||!r))return _l(e.registerCommand(kd,n=>(n.preventDefault(),e.dispatchCommand(n.shiftKey?_d:wl,void 0)),Tl),e.registerNodeTransform(Td,n=>{n.remove()}))},[e,r]),fd(gd,{})};function wd(t){let e=Cd();if(!bd(e))return!1;let o=new Set,r=e.getNodes();for(let n=0;n<r.length;n++){let l=r[n],i=l.getKey();if(o.has(i))continue;let s=xd(l,c=>Sl(c)&&!c.isInline());if(s===null)continue;let u=s.getKey();s.canIndent()&&!o.has(u)&&(o.add(u),t(s))}return o.size>0}var Ll=t=>({type:"buttons",items:t,key:"indent",order:35});var Il=({disabledNodes:t})=>[Ll([{ChildComponent:bl,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],r=n=>Rl(n)&&n.getIndent()>0;return o.some(n=>r(n)||!!yl(n,r))},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Nd,void 0)},order:1},{ChildComponent:kl,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],r=n=>Rl(n)&&!(t??[]).includes(n.getType());return o.some(n=>r(n)||!!yl(n,r))},key:"indentIncrease",label:({i18n:e})=>e.t("lexical:indent:increaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Sd,void 0)},order:2}])],Ld=y(({props:t})=>{let e=t.disabledNodes??[];return{plugins:[{Component:Nl,position:"normal"}],sanitizedClientFeatureProps:t,toolbarFixed:{groups:Il({disabledNodes:e})},toolbarInline:{groups:Il({disabledNodes:e})}}}),Rl=t=>Ed(t)&&t.canIndent();import{$findMatchingParent as Bm}from"@lexical/utils";import{$getSelection as Yo,$isRangeSelection as si}from"lexical";import{jsx as vl}from"react/jsx-runtime";import"react";var Ml=()=>vl("svg",{"aria-hidden":"true",className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:vl("path",{d:"M8.5 11.5L11.5 8.5M8.5 7L9.625 5.875C10.868 4.633 12.882 4.633 14.125 5.875C15.368 7.118 15.368 9.133 14.125 10.375L13 11.5M7 8.5L5.746 9.754C4.56 10.94 4.519 12.85 5.652 14.087C6.814 15.354 8.78 15.449 10.058 14.298L11.5 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});import{$isAtNodeEnd as Dl}from"@lexical/selection";function Ve(t){let{anchor:e}=t,{focus:o}=t,r=t.anchor.getNode(),n=t.focus.getNode();return r===n?r:t.isBackward()?Dl(o)?r:n:Dl(e)?r:n}var Go=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as Pd}from"lexical";import{addClassNamesToElement as yd,isHTMLAnchorElement as Id}from"@lexical/utils";import Ko from"bson-objectid";import{$applyNodeReplacement as Rd,$createTextNode as Al,$getSelection as vd,$isElementNode as Ol,$isRangeSelection as Vo,createCommand as Md,ElementNode as Dd}from"lexical";var Ad=new Set(["http:","https:","mailto:","sms:","tel:"]),ee=class t extends Dd{__fields;__id;constructor({id:e,fields:o={linkType:"custom",newTab:!1},key:r}){super(r),this.__fields=o,this.__id=e}static clone(e){return new t({id:e.__id,fields:e.__fields,key:e.__key})}static getType(){return"link"}static importDOM(){return{a:e=>({conversion:Od,priority:1})}}static importJSON(e){let o=he({}).updateFromJSON(e);return e.version===1&&typeof e.fields?.doc?.value=="object"&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),e.version===2&&!e.id&&(e.id=new Ko.default().toHexString(),e.version=3),o}canBeEmpty(){return!1}canInsertTextAfter(){return!1}canInsertTextBefore(){return!1}createDOM(e){let o=document.createElement("a");return this.__fields?.linkType==="custom"&&(o.href=this.sanitizeUrl(this.__fields.url??"")),(this.__fields?.newTab??!1)&&(o.target="_blank"),this.__fields?.newTab===!0&&this.__fields?.linkType==="custom"&&(o.rel=Wo(o.rel,"add","noopener")),yd(o,e.theme.link),o}exportJSON(){let e=this.getFields();e?.linkType==="internal"?delete e.url:e?.linkType==="custom"&&delete e.doc;let o={...super.exportJSON(),type:"link",fields:e,version:3},r=this.getID();return r&&(o.id=r),o}extractWithChild(e,o,r){if(!Vo(o))return!1;let n=o.anchor.getNode(),l=o.focus.getNode();return this.isParentOf(n)&&this.isParentOf(l)&&o.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(e,o=!0){let r=this.getParentOrThrow().insertNewAfter(e,o);if(Ol(r)){let n=he({fields:this.__fields});return r.append(n),n}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!Ad.has(o.protocol))return"about:blank"}catch{return"https://"}return e}setFields(e){let o=this.getWritable();return o.__fields=e,o}setID(e){let o=this.getWritable();return o.__id=e,o}updateDOM(e,o,r){let n=this.__fields?.url,l=this.__fields?.newTab;return n!=null&&n!==e.__fields?.url&&this.__fields?.linkType==="custom"&&(o.href=n),this.__fields?.linkType==="internal"&&e.__fields?.linkType==="custom"&&o.removeAttribute("href"),o.rel==null&&(o.rel=""),l!==e.__fields?.newTab&&(l??!1?(o.target="_blank",this.__fields?.linkType==="custom"&&(o.rel=Wo(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=Wo(o.rel,"remove","noopener"))),!1}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields).setID(e.id)}};function Od(t){let e=null;if(Id(t)){let o=t.textContent;o!==null&&o!==""&&(e=he({id:new Ko.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function he({id:t,fields:e}){return Rd(new ee({id:t??new Ko.default().toHexString(),fields:e}))}function J(t){return t instanceof ee}var ae=Md("TOGGLE_LINK_COMMAND");function Jo(t){let e=vd();if(!Vo(e)&&(t===null||!t.selectedNodes?.length))return;let o=Vo(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(l=>{let i=l.getParent();J(i)&&(i.getChildren().forEach(u=>{i.insertBefore(u)}),i.remove())});return}if(o?.length===1){let l=o[0],i=J(l)?l:Fd(l);if(i!==null){i.setFields(t.fields),t.text!=null&&t.text!==i.getTextContent()&&(i.append(Al(t.text)),i.getChildren().forEach(s=>{s!==i.getLastChild()&&s.remove()}));return}}let r=null,n=null;o?.forEach(l=>{let i=l.getParent();if(!(i===n||i===null||Ol(l)&&!l.isInline())){if(J(i)){n=i,i.setFields(t.fields),t.text!=null&&t.text!==i.getTextContent()&&(i.append(Al(t.text)),i.getChildren().forEach(s=>{s!==i.getLastChild()&&s.remove()}));return}if(i.is(r)||(r=i,n=he({fields:t.fields}),J(i)?l.getPreviousSibling()===null?i.insertBefore(n):i.insertAfter(n):l.insertBefore(n)),J(l)){if(l.is(n))return;if(n!==null){let s=l.getChildren();n.append(...s)}l.remove();return}n!==null&&n.append(l)}})}function Fd(t){return $d(t,e=>J(e))}function $d(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function Wo(t,e,o){let r,n=`${t}`;if(e==="add"){if(n.includes(o)){let l=new RegExp(o,"g");n=n.replace(l,"").trim()}n=n.trim(),r=n.length===0?`${o}`:`${n} ${o}`}else{let l=new RegExp(o,"g");r=n.replace(l,"").trim()}return r}var Fl={type:"text-match",dependencies:[ee],export:(t,e)=>{if(!J(t))return null;let o=t,{url:r}=o.getFields();return`[${e(o)}](${r})`},importRegExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,regExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,replace:(t,e)=>{let[,o,r]=e,n=he({fields:{doc:null,linkType:"custom",newTab:!1,url:r}}),l=Pd(o);return l.setFormat(t.getFormat()),n.append(l),t.replace(n),l},trigger:")"};import{$applyNodeReplacement as Bd,$isElementNode as Hd}from"lexical";var ge=class t extends ee{static clone(e){return new t({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){let o=ft({}).updateFromJSON(e);return e.version===1&&typeof e.fields?.doc?.value=="object"&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),o}exportJSON(){let e=super.exportJSON();return{type:"autolink",children:e.children,direction:e.direction,fields:e.fields,format:e.format,indent:e.indent,version:2}}insertNewAfter(e,o=!0){let r=this.getParentOrThrow().insertNewAfter(e,o);if(Hd(r)){let n=ft({fields:this.__fields});return r.append(n),n}return null}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields)}};function ft({fields:t}){return Bd(new ge({id:"",fields:t}))}function xe(t){return t instanceof ge}import{c as jd}from"react/compiler-runtime";import{useLexicalComposerContext as Ud}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Gd}from"@lexical/utils";import{$createTextNode as $l,$getSelection as Wd,$isElementNode as Bl,$isLineBreakNode as Hl,$isNodeSelection as Vd,$isRangeSelection as Kd,$isTextNode as ht,TextNode as Jd}from"lexical";import{useEffect as Xd}from"react";function Pl(t,e=o=>o){return o=>{let r=t.exec(o);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function jl(t,e){for(let o of e){let r=o(t);if(r!=null)return r}return null}var zd=/[.,;\s]/;function Qt(t){return t!==void 0&&zd.test(t)}function Ul(t){return Qt(t[t.length-1])}function zo(t){return Qt(t[0])}function Zd(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function Gl(t){let e=t.getPreviousSibling();return Bl(e)&&(e=e.getLastDescendant()),e===null||Hl(e)||ht(e)&&Ul(e.getTextContent())}function Wl(t){let e=t.getNextSibling();return Bl(e)&&(e=e.getFirstDescendant()),e===null||Hl(e)||ht(e)&&zo(e.getTextContent())}function Yd(t,e,o,r){return(t>0?Qt(o[t-1]):Gl(r[0]))?e<o.length?Qt(o[e]):Wl(r[r.length-1]):!1}function qd(t,e,o){let r=[],n=[],l=[],i=0,s=0,u=[...t];for(;u.length>0;){let c=u[0],a=c.getTextContent().length,p=s;s+a<=e?(r.push(c),i+=a):p>=o?l.push(c):n.push(c),s+=a,u.shift()}return[i,r,n,l]}function Qd(t,e,o,r){let n={linkType:"custom",url:r.url,...r.fields},l=ft({fields:n});if(t.length===1){let i=t[0],s;if(e===0?[s]=i.splitText(o):[,s]=i.splitText(e,o),s){let u=$l(r.text);u.setFormat(s.getFormat()),u.setDetail(s.getDetail()),u.setStyle(s.getStyle()),l.append(u),s.replace(l)}return i}else if(t.length>1){let i=t[0],s=i.getTextContent().length,u;e===0?u=i:[,u]=i.splitText(e);let c=[],d;if(t.forEach(a=>{let m=a.getTextContent().length,f=s,h=s+m;if(f<o)if(h<=o)c.push(a);else{let[g,k]=a.splitText(o-f);g&&c.push(g),d=k}s+=m}),u){let a=Wd(),p=a?a.getNodes().find(ht):void 0,m=$l(u.getTextContent());return m.setFormat(u.getFormat()),m.setDetail(u.getDetail()),m.setStyle(u.getStyle()),l.append(m,...c),p&&p===u&&(Kd(a)?m.select(a.anchor.offset,a.focus.offset):Vd(a)&&m.select(0,m.getTextContent().length)),u.replace(l),d}}}function em(t,e,o){let r=[...t],n=r.map(u=>u.getTextContent()).join(""),l=n,i,s=0;for(;(i=jl(l,e))!=null&&i!==null;){let u=i.index,c=i.length,d=u+c;if(Yd(s+u,s+d,n,r)){let[p,,m,f]=qd(r,s+u,s+d),h=s+u-p,g=s+d-p,k=Qd(m,h,g,i);r=k?[k,...f]:f,o(i.url,null),s=0}else s+=d;l=l.substring(d)}}function Xo(t,e,o){let r=t.getChildren(),n=r.length;for(let u=0;u<n;u++){let c=r[u];if(!ht(c)||!c.isSimpleText()){qt(t),o(null,t.getFields()?.url??null);return}}let l=t.getTextContent(),i=jl(l,e);if(i===null||i.text!==l){qt(t),o(null,t.getFields()?.url??null);return}if(!Gl(t)||!Wl(t)){qt(t),o(null,t.getFields()?.url??null);return}let s=t.getFields()?.url;if(s!==i?.url){let u=t.getFields();u.url=i?.url,t.setFields(u),o(i.url,s??null)}}function tm(t,e,o){let r=t.getPreviousSibling(),n=t.getNextSibling(),l=t.getTextContent();if(xe(r)){let i=r.getFields()?.url?r.getFields()?.url?.startsWith("mailto:")??!1:!1;(!zo(l)||Zd(l,i))&&(r.append(t),Xo(r,e,o),o(null,r.getFields()?.url??null))}xe(n)&&!Ul(l)&&(qt(n),Xo(n,e,o),o(null,n.getFields()?.url??null))}function qt(t){let e=t.getChildren(),o=e.length;for(let r=o-1;r>=0;r--)t.insertAfter(e[r]);return t.remove(),e.map(r=>r.getLatest())}function om(t){let e=[t],o=t.getNextSibling();for(;o!==null&&ht(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function rm(t,e,o){let r=jd(5),n,l;r[0]!==t||r[1]!==e||r[2]!==o?(n=()=>{if(!t.hasNodes([ge]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let i=(s,u)=>{o?.(s,u)};return Gd(t.registerNodeTransform(Jd,s=>{let u=s.getParentOrThrow(),c=s.getPreviousSibling();if(xe(u))Xo(u,e,i);else if(!J(u)){if(s.isSimpleText()&&(zo(s.getTextContent())||!xe(c))){let d=om(s);em(d,e,i)}tm(s,e,i)}}))},l=[t,e,o],r[0]=t,r[1]=e,r[2]=o,r[3]=n,r[4]=l):(n=r[3],l=r[4]),Xd(n,l)}var nm=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,lm=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,im=[Pl(nm,t=>t.startsWith("http")?t:`https://${t}`),Pl(lm,t=>`mailto:${t}`)],Vl=()=>{let[t]=Ud();return rm(t,im),null};import{jsx as sm}from"react/jsx-runtime";import{ClickableLinkPlugin as am}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var Kl=()=>sm(am,{});import{jsx as Nm}from"react/jsx-runtime";import"react";import{createPortal as Lm}from"react-dom";import{jsx as Ce,jsxs as gt,Fragment as um}from"react/jsx-runtime";import{useLexicalComposerContext as dm}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as Jl,mergeRegister as Xl}from"@lexical/utils";import{getTranslation as Zo}from"@payloadcms/translations";import{CloseMenuIcon as mm,EditIcon as pm,ExternalLinkIcon as zl,formatDrawerSlug as fm,useConfig as hm,useEditDepth as gm,useLocale as xm,useTranslation as Cm}from"@payloadcms/ui";import{requests as bm}from"@payloadcms/ui/shared";import{$getSelection as Zl,$isLineBreakNode as km,$isRangeSelection as Yl,COMMAND_PRIORITY_HIGH as _m,COMMAND_PRIORITY_LOW as ql,getDOMSelection as Tm,KEY_ESCAPE_COMMAND as wm,SELECTION_CHANGE_COMMAND as Em}from"lexical";import Ql,{useCallback as ei,useEffect as oo,useRef as Sm,useState as De}from"react";function eo(t,e,o,r=10,n=5){let l=o.parentElement;if(t===null||l==null){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let i=e.getBoundingClientRect(),s=o.getBoundingClientRect(),u=l.getBoundingClientRect(),c=t.top-r,d=t.left-n;c<u.top&&(c+=i.height+t.height+r*2),d+i.width>u.right&&(d=u.right-i.width-n),c-=s.top,d-=s.left,e.style.opacity="1",e.style.transform=`translate(${d}px, ${c}px)`}import{createCommand as cm}from"lexical";var to=cm("TOGGLE_LINK_WITH_MODAL_COMMAND");function ti(t){t.preventDefault()}function oi({anchorElem:t}){let[e]=dm(),[o,r]=De(),n=Sm(null),[l,i]=De(null),[s,u]=De(null),{fieldProps:{schemaPath:c},uuid:d}=H(),{config:a,getEntityConfig:p}=hm(),{i18n:m,t:f}=Cm(),[h,g]=De(),k=gm(),[T,I]=De(!1),[b,_]=De([]),x=xm(),[w,v]=De(!1),O=fm({slug:"lexical-rich-text-link-"+d,depth:k}),{toggleDrawer:F}=de(O),R=ei(()=>{I(!1),n&&n.current&&(n.current.style.opacity="0",n.current.style.transform="translate(-10000px, -10000px)"),v(!1),i(null),u(null),_([]),g(void 0)},[I,i,u,_]),E=ei(()=>{let C=Zl(),S;if(!Yl(C)||!C){R();return}let M=Ve(C);S=e.getElementByKey(M.getKey())?.getBoundingClientRect();let L=Jl(M,J),D=C.getNodes().filter(X=>!km(X)).find(X=>{let U=Jl(X,J);return L&&!L.is(U)||U&&!U.is(L)});if(L==null||D){R();return}r(L);let N=L.getFields(),$={...N,id:L.getID(),text:L.getTextContent()};if(N?.linkType==="custom")i(N?.url??null),u(null);else{i(`${a.routes.admin==="/"?"":a.routes.admin}/collections/${N?.doc?.relationTo}/${N?.doc?.value}`);let X=N?.doc?.relationTo?p({collectionSlug:N?.doc?.relationTo}):void 0;if(!X)u(N?.label?String(N?.label):null),i(N?.url?String(N?.url):null);else{let U=typeof N.doc?.value=="object"?N.doc.value.id:N.doc?.value,Be=N.doc?.relationTo;if(!U||!Be)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let we=f("fields:linkedTo",{label:`${Zo(X.labels.singular,m)} - ${f("lexical:link:loadingWithEllipsis",m)}`}).replace(/<[^>]*>?/g,"");u(we),bm.get(`${a.serverURL}${a.routes.api}/${Be}/${U}`,{headers:{"Accept-Language":m.language},params:{depth:0,locale:x?.code}}).then(async ue=>{if(!ue.ok)throw new Error(`HTTP error! Status: ${ue.status}`);let vt=await ue.json(),Ee=X?.admin?.useAsTitle||"id",Mt=vt[Ee],He=f("fields:linkedTo",{label:`${Zo(X.labels.singular,m)} - ${Mt}`}).replace(/<[^>]*>?/g,"");u(He)}).catch(()=>{let ue=f("fields:linkedTo",{label:`${Zo(X.labels.singular,m)} - ${f("general:untitled",m)} - ID: ${U}`}).replace(/<[^>]*>?/g,"");u(ue)})}}g($),I(!0),_(C?C?.getNodes():[]),xe(L)?v(!0):v(!1);let G=n.current,q=Tm(e._window),{activeElement:te}=document;if(G===null)return;let Rt=e.getRootElement();return q!==null&&Rt!==null&&Rt.contains(q.anchorNode)?(S||(S=q.getRangeAt(0).getBoundingClientRect()),S!=null&&(S.y+=40,eo(S,G,t))):(te==null||te.className!=="link-input")&&(Rt!==null&&eo(null,G,t),i(null),u(null)),!0},[e,R,a.routes.admin,a.routes.api,a.serverURL,p,f,m,x?.code,t]);return oo(()=>Xl(e.registerCommand(to,C=>(e.dispatchCommand(ae,C),E(),F(),!0),ql)),[e,E,F,O]),oo(()=>{let C=t.parentElement,S=()=>{e.getEditorState().read(()=>{E()})};return window.addEventListener("resize",S),C?.addEventListener("scroll",S),()=>{window.removeEventListener("resize",S),C?.removeEventListener("scroll",S)}},[t.parentElement,e,E]),oo(()=>Xl(e.registerUpdateListener(({editorState:C})=>{C.read(()=>{E()})}),e.registerCommand(Em,()=>(E(),!0),ql),e.registerCommand(wm,()=>T?(R(),!0):!1,_m)),[e,E,T,R]),oo(()=>{e.getEditorState().read(()=>{E()})},[e,E]),gt(Ql.Fragment,{children:[Ce("div",{className:"link-editor",ref:n,children:gt("div",{className:"link-input",children:[l&&l.length>0?gt("a",{href:l,rel:"noopener noreferrer",target:"_blank",children:[o?.__fields.newTab?Ce(zl,{}):null,s!=null&&s.length>0?s:l]}):s!=null&&s.length>0?gt(um,{children:[o?.__fields.newTab?Ce(zl,{}):null,Ce("span",{className:"link-input__label-pure",children:s})]}):null,e.isEditable()&>(Ql.Fragment,{children:[Ce("button",{"aria-label":"Edit link",className:"link-edit",onClick:C=>{C.preventDefault(),F()},onMouseDown:ti,tabIndex:0,type:"button",children:Ce(pm,{})}),!w&&Ce("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(ae,null)},onMouseDown:ti,tabIndex:0,type:"button",children:Ce(mm,{})})]})]})}),Ce(rt,{className:"lexical-link-edit-drawer",data:h,drawerSlug:O,drawerTitle:f("fields:editLink"),featureKey:"link",handleDrawerSubmit:(C,S)=>{let M=S,L={...M};delete L.text,e.update(()=>{let D=Zl(),N=null;if(Yl(D)?N=Ve(D).getParent():b.length&&(N=b[0]?.getParent()??null),N&&xe(N)){let $=he({fields:L});N.replace($,!0)}}),e.dispatchCommand(ae,{fields:L,selectedNodes:b,text:M.text})},schemaPath:c,schemaPathSuffix:"fields"})]})}var ri=t=>{let{anchorElem:e=document.body}=t;return Lm(Nm(oi,{anchorElem:e}),e)};import{c as Rm}from"react/compiler-runtime";import{useLexicalComposerContext as vm}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Mm}from"@lexical/utils";import{$getSelection as Dm,$isElementNode as Am,$isRangeSelection as Om,COMMAND_PRIORITY_LOW as li,PASTE_COMMAND as Fm}from"lexical";import{useEffect as $m}from"react";var ym=/^(?:[a-zA-Z][a-zA-Z\d+.-]*:(?:\/\/)?(?:[-;:&=+$,\w]+@)?[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|www\.[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|(?:tel|mailto):[\w+.-]+)(?:\/[+~%/\w-]*)?(?:\?[-;&=%\w]*)?(?:#\w+)?$/,Im=/^(?:\/[\w\-./]*(?:#\w[\w-]*)?|#[\w\-]+)$/;function ni(t){if(!t)return!1;if(t==="https://"||ym.test(t)||Im.test(t))return!0;try{return new URL(t),!0}catch{}return!1}var ii=t=>{let e=Rm(5),{clientProps:o}=t,[r]=vm(),n,l;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==r?(n=()=>{if(!r.hasNodes([ee]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Mm(r.registerCommand(ae,i=>i===null?(Jo(null),!0):(i.fields?.linkType||(i.fields.linkType=o.defaultLinkType),i.fields?.url||(i.fields.url=o.defaultLinkURL),Jo(i),!0),li),r.registerCommand(Fm,i=>{let s=Dm();if(!Om(s)||s.isCollapsed()||!(i instanceof ClipboardEvent)||i.clipboardData==null)return!1;let u=i.clipboardData.getData("text");if(!ni(u))return!1;if(!s.getNodes().some(Pm)){let c={doc:null,linkType:"custom",newTab:!1,url:u};return r.dispatchCommand(ae,{fields:c,text:null}),i.preventDefault(),!0}return!1},li))},l=[o.defaultLinkType,o.defaultLinkURL,r],e[0]=o.defaultLinkType,e[1]=o.defaultLinkURL,e[2]=r,e[3]=n,e[4]=l):(n=e[3],l=e[4]),$m(n,l),null};function Pm(t){return Am(t)}var ai=[Go([{ChildComponent:Ml,isActive:({selection:t})=>{if(si(t)){let e=Ve(t);return Bm(e,J)!=null}return!1},isEnabled:({selection:t})=>!!(si(t)&&Yo()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(ae,null);else{let o,r=[];if(t.getEditorState().read(()=>{o=Yo()?.getTextContent(),r=Yo()?.getNodes()??[]}),!o?.length)return;let n={doc:null};t.dispatchCommand(to,{fields:n,selectedNodes:r,text:o})}},order:1}])],Hm=y(({props:t})=>({markdownTransformers:[Fl],nodes:[ee,t?.disableAutoLinks===!0?null:ge].filter(Boolean),plugins:[{Component:ii,position:"normal"},t?.disableAutoLinks===!0||t?.disableAutoLinks==="creationOnly"?null:{Component:Vl,position:"normal"},{Component:Kl,position:"normal"},{Component:ri,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:ai},toolbarInline:{groups:ai}}));import{$isListNode as er,INSERT_CHECK_LIST_COMMAND as fi,ListItemNode as qm,ListNode as Qm}from"@lexical/list";import{$isRangeSelection as ep}from"lexical";import{jsx as ci,jsxs as jm}from"react/jsx-runtime";import"react";var qo=()=>jm("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ci("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),ci("path",{d:"M7 10L9 12.5L13 7.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Um}from"react/jsx-runtime";import{ListPlugin as Gm}from"@lexical/react/LexicalListPlugin.js";import"react";var Ke=()=>Um(Gm,{});function Je(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{$isListNode as Jm,ListItemNode as Xm,ListNode as zm}from"@lexical/list";import{$createListItemNode as Wm,$createListNode as Vm,$isListItemNode as Km,$isListNode as Qo}from"@lexical/list";var ui=4,Xe=t=>(e,o,r)=>{let n=e.getPreviousSibling(),l=e.getNextSibling(),i=Wm(t==="check"?r[3]==="x":void 0);if(Qo(l)&&l.getListType()===t){let u=l.getFirstChild();u!==null?u.insertBefore(i):l.append(i),e.remove()}else if(Qo(n)&&n.getListType()===t)n.append(i),e.remove();else{let u=Vm(t,t==="number"?Number(r[2]):void 0);u.append(i),e.replace(u)}i.append(...o),i.select(0,0);let s=Math.floor(r[1].length/ui);s&&i.setIndent(s)},Ae=(t,e,o)=>{let r=[],n=t.getChildren(),l=0;for(let i of n)if(Km(i)){if(i.getChildrenSize()===1){let d=i.getFirstChild();if(Qo(d)){r.push(Ae(d,e,o+1));continue}}let s=" ".repeat(o*ui),u=t.getListType(),c=u==="number"?`${t.getStart()+l}. `:u==="check"?`- [${i.getChecked()?"x":" "}] `:"- ";r.push(s+c+e(i)),l++}return r.join(`
|
|
36
|
+
`)};var di={type:"element",dependencies:[zm,Xm],export:(t,e)=>Jm(t)?Ae(t,e,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:Xe("check")};import{jsx as Zm}from"react/jsx-runtime";import{CheckListPlugin as Ym}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var mi=()=>Zm(Ym,{});var pi=[Q([{ChildComponent:qo,isActive:({selection:t})=>{if(!ep(t))return!1;for(let e of t.getNodes()){if(er(e)&&e.getListType()==="check")continue;let o=e.getParent();if(er(o)&&o.getListType()==="check")continue;let r=o?.getParent();if(!(er(r)&&r.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:t})=>t.t("lexical:checklist:label"),onSelect:({editor:t})=>{t.dispatchCommand(fi,void 0)},order:12}])],tp=y(({featureProviderMap:t})=>{let e=[{Component:mi,position:"normal"}];return!t.has("unorderedList")&&!t.has("orderedList")&&e.push({Component:Ke,position:"normal"}),{markdownTransformers:[di],nodes:t.has("unorderedList")||t.has("orderedList")?[]:[Qm,qm],plugins:e,slashMenu:{groups:[Je([{Icon:qo,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:o})=>o.t("lexical:checklist:label"),onSelect:({editor:o})=>{o.dispatchCommand(fi,void 0)}}])]},toolbarFixed:{groups:pi},toolbarInline:{groups:pi}}});import{$isListNode as or,INSERT_ORDERED_LIST_COMMAND as xi,ListItemNode as ip,ListNode as sp}from"@lexical/list";import{$isRangeSelection as ap}from"lexical";import{jsx as xt,jsxs as op}from"react/jsx-runtime";import"react";var tr=()=>op("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[xt("path",{d:"M5.89284 12.479C5.89284 13.368 5.26284 13.788 4.38084 14.236C3.75084 14.558 3.43584 14.789 3.40784 15.062H5.89984V16H2.06384V15.573C2.06384 14.523 2.92484 13.935 3.66684 13.501C4.38084 13.088 4.75184 12.878 4.75184 12.458C4.75184 12.08 4.52084 11.835 4.06584 11.835C3.58984 11.835 3.30984 12.199 3.28184 12.654H2.11284C2.18984 11.681 2.87584 10.918 4.07284 10.918C5.15784 10.918 5.89284 11.555 5.89284 12.479Z",fill:"currentColor"}),xt("path",{d:"M2.68608 4.535V3.737C3.54008 3.737 3.90408 3.513 4.02308 2.995H4.89108V8H3.68008L3.68008 4.535H2.68608Z",fill:"currentColor"}),xt("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),xt("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),xt("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as rp,ListItemNode as np,ListNode as lp}from"@lexical/list";var hi={type:"element",dependencies:[lp,np],export:(t,e)=>rp(t)?Ae(t,e,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:Xe("number")};var gi=[Q([{ChildComponent:tr,isActive:({selection:t})=>{if(!ap(t))return!1;for(let e of t.getNodes()){if(or(e)&&e.getListType()==="number")continue;let o=e.getParent();if(or(o)&&o.getListType()==="number")continue;let r=o?.getParent();if(!(or(r)&&r.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:t})=>t.t("lexical:orderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(xi,void 0)},order:10}])],cp=y(({featureProviderMap:t})=>({markdownTransformers:[hi],nodes:t.has("orderedList")?[]:[sp,ip],plugins:t.has("orderedList")?[]:[{Component:Ke,position:"normal"}],slashMenu:{groups:[Je([{Icon:tr,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:e})=>e.t("lexical:orderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(xi,void 0)}}])]},toolbarFixed:{groups:gi},toolbarInline:{groups:gi}}));import{$isListNode as nr,INSERT_UNORDERED_LIST_COMMAND as ki,ListItemNode as fp,ListNode as hp}from"@lexical/list";import{$isRangeSelection as gp}from"lexical";import{jsx as ze,jsxs as up}from"react/jsx-runtime";import"react";var rr=()=>up("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ze("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),ze("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),ze("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),ze("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),ze("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),ze("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as dp,ListItemNode as mp,ListNode as pp}from"@lexical/list";var Ci={type:"element",dependencies:[pp,mp],export:(t,e)=>dp(t)?Ae(t,e,0):null,regExp:/^(\s*)[-*+]\s/,replace:Xe("bullet")};var bi=[Q([{ChildComponent:rr,isActive:({selection:t})=>{if(!gp(t))return!1;for(let e of t.getNodes()){if(nr(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(nr(o)&&o.getListType()==="bullet")continue;let r=o?.getParent();if(!(nr(r)&&r.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(ki,void 0)},order:11}])],xp=y({markdownTransformers:[Ci],nodes:[hp,fp],plugins:[{Component:Ke,position:"normal"}],slashMenu:{groups:[Je([{Icon:rr,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(ki,void 0)}}])]},toolbarFixed:{groups:bi},toolbarInline:{groups:bi}});import{jsx as Cp}from"react/jsx-runtime";import{addClassNamesToElement as bp}from"@lexical/utils";import{DecoratorNode as kp}from"lexical";import*as _i from"react";var _p=_i.lazy(()=>import("./Component-MBLHTKDK.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),Ct=class t extends kp{__data;constructor({data:e,key:o}){super(o),this.__data=e}static clone(e){return new t({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return Tp({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return bp(o,"unknownConverted"),o}decorate(){return Cp(_p,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function Tp({data:t}){return new Ct({data:t})}var wp=y(()=>({nodes:[Ct]}));import{jsx as Ep}from"react/jsx-runtime";import{addClassNamesToElement as Sp}from"@lexical/utils";import{DecoratorNode as Np}from"lexical";import*as Ti from"react";var Lp=Ti.lazy(()=>import("./Component-DOSSWC76.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),bt=class t extends Np{__data;constructor({data:e,key:o}){super(o),this.__data=e}static clone(e){return new t({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return yp({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return Sp(o,"unknownConverted"),o}decorate(){return Ep(Lp,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function yp({data:t}){return new bt({data:t})}var Ip=y(()=>({nodes:[bt]}));import{$setBlocksType as Si}from"@lexical/selection";import{$createParagraphNode as Ni,$getSelection as Li,$isParagraphNode as wi,$isRangeSelection as Rp}from"lexical";var Ei=[Q([{ChildComponent:lt,isActive:({selection:t})=>{if(!Rp(t))return!1;for(let e of t.getNodes())if(!wi(e)&&!wi(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=Li();Si(e,()=>Ni())})},order:1}])],vp=y({slashMenu:{groups:[Z([{Icon:lt,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Li();Si(e,()=>Ni())})}}])]},toolbarFixed:{groups:Ei},toolbarInline:{groups:Ei}});import{c as qp}from"react/compiler-runtime";import{jsx as Ji}from"react/jsx-runtime";import{useLexicalComposerContext as Qp}from"@lexical/react/LexicalComposerContext";import{useEffect as ef,useState as tf}from"react";import{jsx as Ki,Fragment as Yp}from"react/jsx-runtime";import"react";import{jsx as Mp}from"react/jsx-runtime";var yi={quote:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Mp("blockquote",{children:o})}};import{jsx as Dp}from"react/jsx-runtime";var Ii={heading:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return Dp(r,{children:o})}};import{jsx as Ap}from"react/jsx-runtime";var Ri={horizontalrule:Ap("hr",{})};import{jsx as Op}from"react/jsx-runtime";var vi={linebreak:Op("br",{})};import{jsx as Mi}from"react/jsx-runtime";var Di=({internalDocToHref:t})=>({autolink:({node:e,nodesToJSX:o})=>{let r=o({nodes:e.children}),n=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0;return Mi("a",{href:e.fields.url,rel:n,target:l,children:r})},link:({node:e,nodesToJSX:o})=>{let r=o({nodes:e.children}),n=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0,i=e.fields.url??"";return e.fields.linkType==="internal"&&(t?i=t({linkNode:e}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),i="#")),Mi("a",{href:i,rel:n,target:l,children:r})}});import{jsx as Ze,jsxs as Fp,Fragment as $p}from"react/jsx-runtime";import{v4 as Pp}from"uuid";var Ai={list:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return Ze(r,{className:`list-${t?.listType}`,children:o})},listitem:({node:t,nodesToJSX:e,parent:o})=>{let r=t.children.some(l=>l.type==="list"),n=e({nodes:t.children});if("listType"in o&&o?.listType==="check"){let l=Pp();return Ze("li",{"aria-checked":t.checked?"true":"false",className:`list-item-checkbox${t.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked"}${r?" nestedListItem":""}`,role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:t?.value,children:r?n:Fp($p,{children:[Ze("input",{checked:t.checked,id:l,readOnly:!0,type:"checkbox"}),Ze("label",{htmlFor:l,children:n}),Ze("br",{})]})})}else return Ze("li",{className:`${r?"nestedListItem":""}`,style:r?{listStyleType:"none"}:void 0,value:t?.value,children:n})}};import{jsx as lr}from"react/jsx-runtime";var Oi={paragraph:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return o?.length?lr("p",{children:o}):lr("p",{children:lr("br",{})})}};var Fi={tab:" "};import{jsx as kt}from"react/jsx-runtime";var $i={table:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return kt("div",{className:"lexical-table-container",children:kt("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:kt("tbody",{children:o})})})},tablecell:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.headerState>0?"th":"td",n=`lexical-table-cell-header-${t.headerState}`,l={backgroundColor:t.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},i=t.colSpan&&t.colSpan>1?t.colSpan:void 0,s=t.rowSpan&&t.rowSpan>1?t.rowSpan:void 0;return kt(r,{className:`lexical-table-cell ${n}`,colSpan:i,rowSpan:s,style:l,children:o})},tablerow:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return kt("tr",{className:"lexical-table-row",children:o})}};import{jsx as Oe}from"react/jsx-runtime";import"react";var A={DOM_ELEMENT_TYPE:1,DOM_TEXT_TYPE:3,NO_DIRTY_NODES:0,HAS_DIRTY_NODES:1,FULL_RECONCILE:2,IS_NORMAL:0,IS_TOKEN:1,IS_SEGMENTED:2,IS_INERT:3,IS_BOLD:1,IS_ITALIC:2,IS_STRIKETHROUGH:4,IS_UNDERLINE:8,IS_CODE:16,IS_SUBSCRIPT:32,IS_SUPERSCRIPT:64,IS_HIGHLIGHT:128,IS_DIRECTIONLESS:1,IS_UNMERGEABLE:2,IS_ALIGN_LEFT:1,IS_ALIGN_CENTER:2,IS_ALIGN_RIGHT:3,IS_ALIGN_JUSTIFY:4,IS_ALIGN_START:5,IS_ALIGN_END:6},Bp=A.IS_BOLD|A.IS_ITALIC|A.IS_STRIKETHROUGH|A.IS_UNDERLINE|A.IS_CODE|A.IS_SUBSCRIPT|A.IS_SUPERSCRIPT|A.IS_HIGHLIGHT,Hp="\xA0",jp=`
|
|
37
37
|
|
|
38
|
-
`,Fi="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Pi="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Bp=new RegExp("^[^"+Pi+"]*["+Fi+"]"),Hp=new RegExp("^[^"+Fi+"]*["+Pi+"]"),jp={bold:A.IS_BOLD,code:A.IS_CODE,highlight:A.IS_HIGHLIGHT,italic:A.IS_ITALIC,strikethrough:A.IS_STRIKETHROUGH,subscript:A.IS_SUBSCRIPT,superscript:A.IS_SUPERSCRIPT,underline:A.IS_UNDERLINE},Up={directionless:A.IS_DIRECTIONLESS,unmergeable:A.IS_UNMERGEABLE},Gp={center:A.IS_ALIGN_CENTER,end:A.IS_ALIGN_END,justify:A.IS_ALIGN_JUSTIFY,left:A.IS_ALIGN_LEFT,right:A.IS_ALIGN_RIGHT,start:A.IS_ALIGN_START},Wp={[A.IS_ALIGN_CENTER]:"center",[A.IS_ALIGN_END]:"end",[A.IS_ALIGN_JUSTIFY]:"justify",[A.IS_ALIGN_LEFT]:"left",[A.IS_ALIGN_RIGHT]:"right",[A.IS_ALIGN_START]:"start"},Vp={normal:A.IS_NORMAL,segmented:A.IS_SEGMENTED,token:A.IS_TOKEN},Kp={[A.IS_NORMAL]:"normal",[A.IS_SEGMENTED]:"segmented",[A.IS_TOKEN]:"token"};var Bi={text:({node:t})=>{let e=t.text;return t.format&A.IS_BOLD&&(e=Oe("strong",{children:e})),t.format&A.IS_ITALIC&&(e=Oe("em",{children:e})),t.format&A.IS_STRIKETHROUGH&&(e=Oe("span",{style:{textDecoration:"line-through"},children:e})),t.format&A.IS_UNDERLINE&&(e=Oe("span",{style:{textDecoration:"underline"},children:e})),t.format&A.IS_CODE&&(e=Oe("code",{children:e})),t.format&A.IS_SUBSCRIPT&&(e=Oe("sub",{children:e})),t.format&A.IS_SUPERSCRIPT&&(e=Oe("sup",{children:e})),e}};import{jsx as kt}from"react/jsx-runtime";var Hi={upload:({node:t})=>{let e=t;if(typeof e.value!="object")return null;let o=e.value,r=o.url;if(!o.mimeType.startsWith("image"))return kt("a",{href:r,rel:"noopener noreferrer",children:o.filename});if(!o.sizes||!Object.keys(o.sizes).length)return kt("img",{alt:o.filename,height:o.height,src:r,width:o.width});let n=[];for(let l in o.sizes){let i=o.sizes[l];if(!i||!i.width||!i.height||!i.mimeType||!i.filesize||!i.filename||!i.url)continue;let s=i?.url;n.push(kt("source",{media:`(max-width: ${i.width}px)`,srcSet:s,type:i.mimeType},l))}return n.push(kt("img",{alt:o?.filename,height:o?.height,src:r,width:o?.width},"image")),kt("picture",{children:n})}};var Ye={...Ai,...Bi,...Ri,...Li,...$i,...yi,...Ii,...Di,...Mi({}),...Hi,...Oi};import{jsx as Ui,Fragment as Jp}from"react/jsx-runtime";import lr from"react";function ji(t){let e=!!t?.root?.children?.length,o=!1;if(t?.root?.children?.length===1&&t?.root?.children[0]?.type==="paragraph"){let r=t?.root?.children[0];if(!r?.children||r?.children?.length===0)o=!0;else if(r?.children?.length===1){let n=r?.children[0];n?.type==="text"&&(n?.text?.length||(o=!0))}}return!(!e||o)}function Gi({converters:t,data:e,disableIndent:o,disableTextAlign:r}){return ji(e)?Wi({converters:t,disableIndent:o,disableTextAlign:r,nodes:e?.root?.children,parent:e?.root}):Ui(Jp,{})}function Wi({converters:t,disableIndent:e,disableTextAlign:o,nodes:r,parent:n}){let l=t.unknown;return r.map((s,u)=>{let c;s.type==="block"?(c=t?.blocks?.[s?.fields?.blockType],!c&&!l&&console.error(`Lexical => JSX converter: Blocks converter: found ${s?.fields?.blockType} block, but no converter is provided`)):s.type==="inlineBlock"?(c=t?.inlineBlocks?.[s?.fields?.blockType],!c&&!l&&console.error(`Lexical => JSX converter: Inline Blocks converter: found ${s?.fields?.blockType} inline block, but no converter is provided`)):c=t[s.type];try{!c&&l&&(c=l);let d;c?d=typeof c=="function"?c({childIndex:u,converters:t,node:s,nodesToJSX:m=>Wi({converters:m.converters??t,disableIndent:m.disableIndent??e,disableTextAlign:m.disableTextAlign??o,nodes:m.nodes,parent:m.parent??{...s,parent:n}}),parent:n}):c:d=Ui("span",{children:"unknown node"},u);let a={};if(!o&&(!Array.isArray(o)||!o?.includes(s.type))&&"format"in s&&s.format)switch(s.format){case"center":a.textAlign="center";break;case"end":a.textAlign="right";break;case"justify":a.textAlign="justify";break;case"left":break;case"right":a.textAlign="right";break;case"start":a.textAlign="left";break}if(!e&&(!Array.isArray(e)||!e?.includes(s.type))&&"indent"in s&&s.indent&&s.type!=="listitem"&&(a.paddingInlineStart=`${Number(s.indent)*40}px`),lr.isValidElement(d)){if(a.textAlign||a.paddingInlineStart){let p={...a,...d?.props?.style??{}};return lr.cloneElement(d,{key:u,style:p})}return lr.cloneElement(d,{key:u})}return d}catch(d){return console.error("Error converting lexical node to JSX:",d,"node:",s),null}}).filter(Boolean)}var ir=({className:t,converters:e,data:o,disableContainer:r,disableIndent:n,disableTextAlign:l})=>{if(!o)return null;let i={};e?typeof e=="function"?i=e({defaultConverters:Ye}):i=e:i=Ye;let s=o&&!Array.isArray(o)&&typeof o=="object"&&"root"in o&&Gi({converters:i,data:o,disableIndent:n,disableTextAlign:l});return r?Vi(Xp,{children:s}):Vi("div",{className:t??"payload-richtext",children:s})};function Ji(){let t=zp(7),[e]=Zp(),o;t[0]!==e?(o=e.getEditorState().toJSON(),t[0]=e,t[1]=o):o=t[1];let[r,n]=qp(o),l,i;t[2]!==e?(l=()=>e.registerUpdateListener(u=>{let{editorState:c}=u;n(c.toJSON())}),i=[e],t[2]=e,t[3]=l,t[4]=i):(l=t[3],i=t[4]),Yp(l,i);let s;return t[5]!==r?(s=Ki("div",{className:"debug-jsx-converter",children:Ki(ir,{converters:Ye,data:r})}),t[5]=r,t[6]=s):s=t[6],s}var Qp=y({plugins:[{Component:Ji,position:"bottom"}]});var B={amber:{50:"oklch(0.987 0.022 95.277)",100:"oklch(0.962 0.059 95.617)",200:"oklch(0.924 0.12 95.746)",300:"oklch(0.879 0.169 91.605)",400:"oklch(0.828 0.189 84.429)",500:"oklch(0.769 0.188 70.08)",600:"oklch(0.666 0.179 58.318)",700:"oklch(0.555 0.163 48.998)",800:"oklch(0.473 0.137 46.201)",900:"oklch(0.414 0.112 45.904)",950:"oklch(0.279 0.077 45.635)"},black:"#000",blue:{50:"oklch(0.97 0.014 254.604)",100:"oklch(0.932 0.032 255.585)",200:"oklch(0.882 0.059 254.128)",300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)",800:"oklch(0.424 0.199 265.638)",900:"oklch(0.379 0.146 265.522)",950:"oklch(0.282 0.091 267.935)"},current:"currentColor",cyan:{50:"oklch(0.984 0.019 200.873)",100:"oklch(0.956 0.045 203.388)",200:"oklch(0.917 0.08 205.041)",300:"oklch(0.865 0.127 207.078)",400:"oklch(0.789 0.154 211.53)",500:"oklch(0.715 0.143 215.221)",600:"oklch(0.609 0.126 221.723)",700:"oklch(0.52 0.105 223.128)",800:"oklch(0.45 0.085 224.283)",900:"oklch(0.398 0.07 227.392)",950:"oklch(0.302 0.056 229.695)"},emerald:{50:"oklch(0.979 0.021 166.113)",100:"oklch(0.95 0.052 163.051)",200:"oklch(0.905 0.093 164.15)",300:"oklch(0.845 0.143 164.978)",400:"oklch(0.765 0.177 163.223)",500:"oklch(0.696 0.17 162.48)",600:"oklch(0.596 0.145 163.225)",700:"oklch(0.508 0.118 165.612)",800:"oklch(0.432 0.095 166.913)",900:"oklch(0.378 0.077 168.94)",950:"oklch(0.262 0.051 172.552)"},fuchsia:{50:"oklch(0.977 0.017 320.058)",100:"oklch(0.952 0.037 318.852)",200:"oklch(0.903 0.076 319.62)",300:"oklch(0.833 0.145 321.434)",400:"oklch(0.74 0.238 322.16)",500:"oklch(0.667 0.295 322.15)",600:"oklch(0.591 0.293 322.896)",700:"oklch(0.518 0.253 323.949)",800:"oklch(0.452 0.211 324.591)",900:"oklch(0.401 0.17 325.612)",950:"oklch(0.293 0.136 325.661)"},gray:{50:"oklch(0.985 0.002 247.839)",100:"oklch(0.967 0.003 264.542)",200:"oklch(0.928 0.006 264.531)",300:"oklch(0.872 0.01 258.338)",400:"oklch(0.707 0.022 261.325)",500:"oklch(0.551 0.027 264.364)",600:"oklch(0.446 0.03 256.802)",700:"oklch(0.373 0.034 259.733)",800:"oklch(0.278 0.033 256.848)",900:"oklch(0.21 0.034 264.665)",950:"oklch(0.13 0.028 261.692)"},green:{50:"oklch(0.982 0.018 155.826)",100:"oklch(0.962 0.044 156.743)",200:"oklch(0.925 0.084 155.995)",300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)",800:"oklch(0.448 0.119 151.328)",900:"oklch(0.393 0.095 152.535)",950:"oklch(0.266 0.065 152.934)"},indigo:{50:"oklch(0.962 0.018 272.314)",100:"oklch(0.93 0.034 272.788)",200:"oklch(0.87 0.065 274.039)",300:"oklch(0.785 0.115 274.713)",400:"oklch(0.673 0.182 276.935)",500:"oklch(0.585 0.233 277.117)",600:"oklch(0.511 0.262 276.966)",700:"oklch(0.457 0.24 277.023)",800:"oklch(0.398 0.195 277.366)",900:"oklch(0.359 0.144 278.697)",950:"oklch(0.257 0.09 281.288)"},inherit:"inherit",lime:{50:"oklch(0.986 0.031 120.757)",100:"oklch(0.967 0.067 122.328)",200:"oklch(0.938 0.127 124.321)",300:"oklch(0.897 0.196 126.665)",400:"oklch(0.841 0.238 128.85)",500:"oklch(0.768 0.233 130.85)",600:"oklch(0.648 0.2 131.684)",700:"oklch(0.532 0.157 131.589)",800:"oklch(0.453 0.124 130.933)",900:"oklch(0.405 0.101 131.063)",950:"oklch(0.274 0.072 132.109)"},neutral:{50:"oklch(0.985 0 0)",100:"oklch(0.97 0 0)",200:"oklch(0.922 0 0)",300:"oklch(0.87 0 0)",400:"oklch(0.708 0 0)",500:"oklch(0.556 0 0)",600:"oklch(0.439 0 0)",700:"oklch(0.371 0 0)",800:"oklch(0.269 0 0)",900:"oklch(0.205 0 0)",950:"oklch(0.145 0 0)"},orange:{50:"oklch(0.98 0.016 73.684)",100:"oklch(0.954 0.038 75.164)",200:"oklch(0.901 0.076 70.697)",300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)",800:"oklch(0.47 0.157 37.304)",900:"oklch(0.408 0.123 38.172)",950:"oklch(0.266 0.079 36.259)"},pink:{50:"oklch(0.971 0.014 343.198)",100:"oklch(0.948 0.028 342.258)",200:"oklch(0.899 0.061 343.231)",300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)",800:"oklch(0.459 0.187 3.815)",900:"oklch(0.408 0.153 2.432)",950:"oklch(0.284 0.109 3.907)"},purple:{50:"oklch(0.977 0.014 308.299)",100:"oklch(0.946 0.033 307.174)",200:"oklch(0.902 0.063 306.703)",300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)",800:"oklch(0.438 0.218 303.724)",900:"oklch(0.381 0.176 304.987)",950:"oklch(0.291 0.149 302.717)"},red:{50:"oklch(0.971 0.013 17.38)",100:"oklch(0.936 0.032 17.717)",200:"oklch(0.885 0.062 18.334)",300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)",800:"oklch(0.444 0.177 26.899)",900:"oklch(0.396 0.141 25.723)",950:"oklch(0.258 0.092 26.042)"},rose:{50:"oklch(0.969 0.015 12.422)",100:"oklch(0.941 0.03 12.58)",200:"oklch(0.892 0.058 10.001)",300:"oklch(0.81 0.117 11.638)",400:"oklch(0.712 0.194 13.428)",500:"oklch(0.645 0.246 16.439)",600:"oklch(0.586 0.253 17.585)",700:"oklch(0.514 0.222 16.935)",800:"oklch(0.455 0.188 13.697)",900:"oklch(0.41 0.159 10.272)",950:"oklch(0.271 0.105 12.094)"},sky:{50:"oklch(0.977 0.013 236.62)",100:"oklch(0.951 0.026 236.824)",200:"oklch(0.901 0.058 230.902)",300:"oklch(0.828 0.111 230.318)",400:"oklch(0.746 0.16 232.661)",500:"oklch(0.685 0.169 237.323)",600:"oklch(0.588 0.158 241.966)",700:"oklch(0.5 0.134 242.749)",800:"oklch(0.443 0.11 240.79)",900:"oklch(0.391 0.09 240.876)",950:"oklch(0.293 0.066 243.157)"},slate:{50:"oklch(0.984 0.003 247.858)",100:"oklch(0.968 0.007 247.896)",200:"oklch(0.929 0.013 255.508)",300:"oklch(0.869 0.022 252.894)",400:"oklch(0.704 0.04 256.788)",500:"oklch(0.554 0.046 257.417)",600:"oklch(0.446 0.043 257.281)",700:"oklch(0.372 0.044 257.287)",800:"oklch(0.279 0.041 260.031)",900:"oklch(0.208 0.042 265.755)",950:"oklch(0.129 0.042 264.695)"},stone:{50:"oklch(0.985 0.001 106.423)",100:"oklch(0.97 0.001 106.424)",200:"oklch(0.923 0.003 48.717)",300:"oklch(0.869 0.005 56.366)",400:"oklch(0.709 0.01 56.259)",500:"oklch(0.553 0.013 58.071)",600:"oklch(0.444 0.011 73.639)",700:"oklch(0.374 0.01 67.558)",800:"oklch(0.268 0.007 34.298)",900:"oklch(0.216 0.006 56.043)",950:"oklch(0.147 0.004 49.25)"},teal:{50:"oklch(0.984 0.014 180.72)",100:"oklch(0.953 0.051 180.801)",200:"oklch(0.91 0.096 180.426)",300:"oklch(0.855 0.138 181.071)",400:"oklch(0.777 0.152 181.912)",500:"oklch(0.704 0.14 182.503)",600:"oklch(0.6 0.118 184.704)",700:"oklch(0.511 0.096 186.391)",800:"oklch(0.437 0.078 188.216)",900:"oklch(0.386 0.063 188.416)",950:"oklch(0.277 0.046 192.524)"},transparent:"transparent",violet:{50:"oklch(0.969 0.016 293.756)",100:"oklch(0.943 0.029 294.588)",200:"oklch(0.894 0.057 293.283)",300:"oklch(0.811 0.111 293.571)",400:"oklch(0.702 0.183 293.541)",500:"oklch(0.606 0.25 292.717)",600:"oklch(0.541 0.281 293.009)",700:"oklch(0.491 0.27 292.581)",800:"oklch(0.432 0.232 292.759)",900:"oklch(0.38 0.189 293.745)",950:"oklch(0.283 0.141 291.089)"},white:"#fff",yellow:{50:"oklch(0.987 0.026 102.212)",100:"oklch(0.973 0.071 103.193)",200:"oklch(0.945 0.129 101.54)",300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",800:"oklch(0.476 0.114 61.907)",900:"oklch(0.421 0.095 57.708)",950:"oklch(0.286 0.066 53.813)"},zinc:{50:"oklch(0.985 0 0)",100:"oklch(0.967 0.001 286.375)",200:"oklch(0.92 0.004 286.32)",300:"oklch(0.871 0.006 286.286)",400:"oklch(0.705 0.015 286.067)",500:"oklch(0.552 0.016 285.938)",600:"oklch(0.442 0.017 285.786)",700:"oklch(0.37 0.013 285.805)",800:"oklch(0.274 0.006 286.033)",900:"oklch(0.21 0.006 285.885)",950:"oklch(0.141 0.005 285.823)"}},ef={text:{"text-red":{css:{color:`light-dark(${B.red[600]}, ${B.red[400]})`},label:"Red"},"text-orange":{css:{color:`light-dark(${B.orange[600]}, ${B.orange[400]})`},label:"Orange"},"text-yellow":{css:{color:`light-dark(${B.yellow[700]}, ${B.yellow[300]})`},label:"Yellow"},"text-green":{css:{color:`light-dark(${B.green[700]}, ${B.green[400]})`},label:"Green"},"text-blue":{css:{color:`light-dark(${B.blue[600]}, ${B.blue[400]})`},label:"Blue"},"text-purple":{css:{color:`light-dark(${B.purple[600]}, ${B.purple[400]})`},label:"Purple"},"text-pink":{css:{color:`light-dark(${B.pink[600]}, ${B.pink[400]})`},label:"Pink"}},background:{"bg-red":{css:{"background-color":`light-dark(${B.red[400]}, ${B.red[600]})`},label:"Red"},"bg-orange":{css:{"background-color":`light-dark(${B.orange[400]}, ${B.orange[600]})`},label:"Orange"},"bg-yellow":{css:{"background-color":`light-dark(${B.yellow[300]}, ${B.yellow[700]})`},label:"Yellow"},"bg-green":{css:{"background-color":`light-dark(${B.green[400]}, ${B.green[700]})`},label:"Green"},"bg-blue":{css:{"background-color":`light-dark(${B.blue[400]}, ${B.blue[600]})`},label:"Blue"},"bg-purple":{css:{"background-color":`light-dark(${B.purple[400]}, ${B.purple[600]})`},label:"Purple"},"bg-pink":{css:{"background-color":`light-dark(${B.pink[400]}, ${B.pink[600]})`},label:"Pink"}}};import{$isNodeSelection as Bf}from"lexical";import{jsx as _t,jsxs as tf}from"react/jsx-runtime";import"react";var sr=()=>tf("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[_t("g",{clipPath:"url(#clip0_4397_10817)",children:_t("path",{d:"M7.75 12.25L15.25 4.75M15.25 4.75H11.5M15.25 4.75V8.5M13 11.5V13.75C13 14.5784 12.3284 15.25 11.5 15.25H6.25C5.42157 15.25 4.75 14.5784 4.75 13.75V8.5C4.75 7.67157 5.42157 7 6.25 7H8.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),_t("defs",{children:_t("clipPath",{id:"clip0_4397_10817",children:_t("rect",{fill:"currentColor",height:"12",transform:"translate(4 4)",width:"12"})})})]});import{jsx as nf}from"react/jsx-runtime";import*as zi from"react";import{DecoratorBlockNode as of}from"@lexical/react/LexicalDecoratorBlockNode.js";function rf(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:Xi({relationTo:o,value:e})}:null}var Tt=class extends of{__data;constructor({data:e,format:o,key:r}){super(o,r),this.__data=e}static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"relationship"}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:rf,priority:2}}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id);let o={relationTo:e.relationTo,value:e.value},r=Xi(o);return r.setFormat(e.format),r}static isInline(){return!1}decorate(e,o){return null}exportDOM(){let e=document.createElement("div");e.setAttribute("data-lexical-relationship-id",String(typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value)),e.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship",version:2}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value}`}setData(e){let o=this.getWritable();o.__data=e}};function Xi(t){return new Tt({data:t})}var lf=zi.lazy(()=>import("./RelationshipComponent-APF3CN47.js").then(t=>({default:t.RelationshipComponent})));function sf(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:$e({relationTo:o,value:e})}:null}var be=class extends Tt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:sf,priority:2}}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id);let o={relationTo:e.relationTo,value:e.value},r=$e(o);return r.setFormat(e.format),r}decorate(e,o){return nf(lf,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function $e(t){return new be({data:t})}function ar(t){return t instanceof be}import{c as Nf}from"react/compiler-runtime";import{jsx as Sf}from"react/jsx-runtime";import{useLexicalComposerContext as Lf}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as yf}from"@lexical/utils";import{useConfig as If}from"@payloadcms/ui";import{$getPreviousSelection as Rf,$getSelection as vf,$isParagraphNode as Mf,$isRangeSelection as Df,COMMAND_PRIORITY_EDITOR as Af,createCommand as Of}from"lexical";import{useEffect as $f}from"react";import{c as bf}from"react/compiler-runtime";import{jsx as oo}from"react/jsx-runtime";import{useLexicalComposerContext as kf}from"@lexical/react/LexicalComposerContext.js";import{$getNodeByKey as _f,COMMAND_PRIORITY_EDITOR as Tf}from"lexical";import{useEffect as wf,useState as qi}from"react";import{c as af}from"react/compiler-runtime";import{jsx as cf}from"react/jsx-runtime";import{useLexicalComposerContext as uf}from"@lexical/react/LexicalComposerContext";import{useListDrawer as df,useModal as mf}from"@payloadcms/ui";import{$getNodeByKey as Zi,$getPreviousSelection as pf,$getRoot as ff,$getSelection as hf,$isRangeSelection as gf,$setSelection as xf}from"lexical";import{useEffect as Cf,useState as Yi}from"react";var wt=t=>{let e=af(23),[o]=uf(),[r,n]=Yi(null),[l,i]=Yi(!1),[s,u,c]=df(t),{closeDrawer:d,drawerSlug:a,isDrawerOpen:p,openDrawer:m}=c,{modalState:f}=mf(),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{let $=hf()??pf();n($)},e[0]=h):h=e[0];let g=h,b;e[1]!==o||e[2]!==r?(b=()=>{r&&o.update(()=>{if(gf(r)){let{anchor:$,focus:I}=r;Zi($.key)&&Zi(I.key)&&xf(r.clone())}else ff().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=r,e[3]=b):b=e[3];let T=b,v;e[4]!==d?(v=()=>{d()},e[4]=d,e[5]=v):v=e[5];let k=v,_,x;e[6]!==a||e[7]!==f||e[8]!==T||e[9]!==l?(_=()=>{if(!l)return;let $=f[a];$&&!$?.isOpen&&(i(!1),setTimeout(()=>{T()},1))},x=[f,a,T,l],e[6]=a,e[7]=f,e[8]=T,e[9]=l,e[10]=_,e[11]=x):(_=e[10],x=e[11]),Cf(_,x);let N;e[12]!==u?(N=$=>cf(u,{...$,onClick:()=>{g()}}),e[12]=u,e[13]=N):N=e[13];let M;e[14]!==m?(M=()=>{g(),m(),i(!0)},e[14]=m,e[15]=M):M=e[15];let O;return e[16]!==s||e[17]!==k||e[18]!==p||e[19]!==a||e[20]!==N||e[21]!==M?(O={closeListDrawer:k,isListDrawerOpen:p,ListDrawer:s,listDrawerSlug:a,ListDrawerToggler:N,openListDrawer:M},e[16]=s,e[17]=k,e[18]=p,e[19]=a,e[20]=N,e[21]=M,e[22]=O):O=e[22],O};var Ef=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=_f(o);n&&n.replace($e({relationTo:e,value:r}))}):t.dispatchCommand(cr,{relationTo:e,value:r})},Qi=t=>{let e=bf(16),{enabledCollectionSlugs:o}=t,[r]=kf(),n;e[0]!==o?.[0]?(n=()=>o?.[0],e[0]=o?.[0],e[1]=n):n=e[1];let[l]=qi(n),[i,s]=qi(null),u=o||void 0,c;e[2]!==l||e[3]!==u?(c={collectionSlugs:u,selectedCollection:l},e[2]=l,e[3]=u,e[4]=c):c=e[4];let{closeListDrawer:d,ListDrawer:a,openListDrawer:p}=wt(c),m,f;e[5]!==r||e[6]!==p?(m=()=>r.registerCommand(rt,T=>(s(T?.replace?T?.replace.nodeKey:null),p(),!0),Tf),f=[r,p],e[5]=r,e[6]=p,e[7]=m,e[8]=f):(m=e[7],f=e[8]),wf(m,f);let h;e[9]!==d||e[10]!==r||e[11]!==i?(h=T=>{let{collectionSlug:v,doc:k}=T;Ef({editor:r,relationTo:v,replaceNodeKey:i,value:k.id}),d()},e[9]=d,e[10]=r,e[11]=i,e[12]=h):h=e[12];let g=h,b;return e[13]!==a||e[14]!==g?(b=oo(a,{onSelect:g}),e[13]=a,e[14]=g,e[15]=b):b=e[15],b},es=t=>(t?.enabledCollectionSlugs?.length??-1)>0?oo(Qi,{...t}):oo(Dt,{...t,children:oo(Qi,{...t})});var cr=Of("INSERT_RELATIONSHIP_COMMAND"),ts=t=>{let e=Nf(10),{clientProps:o}=t,[r]=Lf(),{config:n}=If(),{collections:l}=n,i=null;if(o?.enabledCollections)i=o?.enabledCollections;else if(o?.disabledCollections){let d;if(e[0]!==o?.disabledCollections||e[1]!==l){let a;e[3]!==o?.disabledCollections?(a=p=>{let{slug:m}=p;return!o?.disabledCollections?.includes(m)},e[3]=o?.disabledCollections,e[4]=a):a=e[4],d=l.filter(a).map(Ff),e[0]=o?.disabledCollections,e[1]=l,e[2]=d}else d=e[2];i=d}let s,u;e[5]!==r?(s=()=>{if(!r.hasNodes([be]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return r.registerCommand(cr,Pf,Af)},u=[r],e[5]=r,e[6]=s,e[7]=u):(s=e[6],u=e[7]),$f(s,u);let c;return e[8]!==i?(c=Sf(es,{enabledCollectionSlugs:i}),e[8]=i,e[9]=c):c=e[9],c};function Ff(t){let{slug:e}=t;return e}function Pf(t){let e=vf()||Rf();if(Df(e)){let o=$e(t),{focus:r}=e,n=r.getNode();yf(o),Mf(n)&&!n.__first&&n.remove()}return!0}var Hf=y({nodes:[be],plugins:[{Component:ts,position:"normal"}],slashMenu:{groups:[Z([{Icon:sr,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(rt,{replace:!1})}}])]},toolbarFixed:{groups:[fe([{ChildComponent:sr,isActive:({selection:t})=>{if(!Bf(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return ar(e)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(rt,{replace:!1})}}])]}});import{c as us}from"react/compiler-runtime";import{jsx as le,jsxs as p0}from"react/jsx-runtime";import{useLexicalComposerContext as f0}from"@lexical/react/LexicalComposerContext.js";import{useScrollInfo as h0,useThrottledEffect as g0,useTranslation as x0}from"@payloadcms/ui";import*as ke from"react";import{useMemo as C0}from"react";import{c as jf}from"react/compiler-runtime";import{jsx as Uf}from"react/jsx-runtime";import{mergeRegister as Gf}from"@lexical/utils";import{$addUpdateTag as Wf,$getSelection as Vf}from"lexical";import{useDeferredValue as Kf,useEffect as Jf,useState as Xf}from"react";var os="toolbar-popup__button",Et=t=>{let e=jf(23),{children:o,editor:r,item:n}=t,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={active:!1,enabled:!0},e[0]=l):l=e[0];let[i,s]=Xf(l),u=Kf(i),c=H(),d,a=u.enabled?"":"disabled",p=u.active?"active":"",m=n.key?`${os}-${n.key}`:"",f;e[1]!==a||e[2]!==p||e[3]!==m?(f=[os,a,p,m].filter(Boolean),e[1]=a,e[2]=p,e[3]=m,e[4]=f):f=e[4],d=f.join(" ");let h=d,g;e[5]!==r||e[6]!==c||e[7]!==n?(g=()=>{r.getEditorState().read(()=>{let O=Vf();if(!O)return;let $=n.isActive?n.isActive({editor:r,editorConfigContext:c,selection:O}):!1,I=n.isEnabled?n.isEnabled({editor:r,editorConfigContext:c,selection:O}):!0;s(w=>w.active===$&&w.enabled===I?w:{active:$,enabled:I})})},e[5]=r,e[6]=c,e[7]=n,e[8]=g):g=e[8];let b=g,T=At(),v,k;e[9]!==r||e[10]!==T||e[11]!==b?(v=()=>{T(b);let O=()=>T(b),$=Gf(r.registerUpdateListener(O));return document.addEventListener("mouseup",O),()=>{$(),document.removeEventListener("mouseup",O)}},k=[r,T,b],e[9]=r,e[10]=T,e[11]=b,e[12]=v,e[13]=k):(v=e[12],k=e[13]),Jf(v,k);let _;e[14]!==i||e[15]!==r||e[16]!==n?(_=()=>{i.enabled&&r.focus(()=>{r.update(zf),n.onSelect?.({editor:r,isActive:i.active})})},e[14]=i,e[15]=r,e[16]=n,e[17]=_):_=e[17];let x=_,N=Zf,M;return e[18]!==o||e[19]!==h||e[20]!==x||e[21]!==n.key?(M=Uf("button",{className:h,"data-button-key":n.key,onClick:x,onMouseDown:N,type:"button",children:o}),e[18]=o,e[19]=h,e[20]=x,e[21]=n.key,e[22]=M):M=e[22],M};function zf(){Wf("toolbar")}function Zf(t){t.preventDefault()}import{c as r0}from"react/compiler-runtime";import{jsx as qe}from"react/jsx-runtime";import cs,{useCallback as n0,useDeferredValue as l0,useEffect as i0,useMemo as s0}from"react";import{mergeRegister as a0}from"@lexical/utils";import{useTranslation as c0}from"@payloadcms/ui";import{$getSelection as u0}from"lexical";import{jsx as Le,jsxs as rs}from"react/jsx-runtime";import{Button as Yf}from"@payloadcms/ui";import{$addUpdateTag as qf,isDOMNode as Qf}from"lexical";import ro,{useCallback as e0,useEffect as no,useMemo as ls,useRef as ur,useState as dr}from"react";import{createPortal as t0}from"react-dom";var ns="toolbar-popup__dropdown-item",is=ro.createContext(null);function ss({active:t,children:e,editor:o,enabled:r,Icon:n,item:l,itemKey:i,tooltip:s}){let u=ls(()=>[ns,r===!1?"disabled":"",t?"active":"",l?.key?`${ns}-${l.key}`:""].filter(Boolean).join(" "),[r,t,l.key]),c=ur(null),d=ro.use(is);if(d===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:a}=d;return no(()=>{c?.current!=null&&a(c)},[c,a]),Le(Yf,{"aria-label":s,buttonStyle:"none",className:u,disabled:r===!1,extraButtonProps:{"data-item-key":i},icon:n,iconPosition:"left",iconStyle:"none",onClick:()=>{r!==!1&&o.focus(()=>{o.update(()=>{qf("toolbar")}),l.onSelect?.({editor:o,isActive:t})})},onMouseDown:p=>{p.preventDefault()},ref:c,tooltip:s,type:"button",children:e})}function o0({children:t,dropDownRef:e,itemsContainerClassNames:o,onClose:r}){let[n,l]=dr(),[i,s]=dr(),u=e0(a=>{l(p=>p!=null?[...p,a]:[a])},[l]),c=a=>{if(n==null)return;let{key:p}=a;["ArrowDown","ArrowUp","Escape","Tab"].includes(p)&&a.preventDefault(),p==="Escape"||p==="Tab"?r():p==="ArrowUp"?s(m=>{if(m==null)return n[0];let f=n.indexOf(m)-1;return n[f===-1?n.length-1:f]}):p==="ArrowDown"&&s(m=>m==null?n[0]:n[n.indexOf(m)+1])},d=ls(()=>({registerItem:u}),[u]);return no(()=>{n!=null&&i==null&&s(n[0]),i!=null&&i?.current!=null&&i.current.focus()},[n,i]),Le(is,{value:d,children:Le("div",{className:(o??["toolbar-popup__dropdown-items"]).join(" "),onKeyDown:c,ref:e,children:t})})}function as({buttonAriaLabel:t,buttonClassName:e,children:o,disabled:r=!1,dropdownKey:n,Icon:l,itemsContainerClassNames:i,label:s,stopCloseOnClickSelf:u}){let c=ur(null),d=ur(null),[a,p]=dr(!1),m=()=>{p(!1),d?.current!=null&&d.current.focus()};no(()=>{let h=d.current,g=c.current;if(a&&h!==null&&g!==null){let{left:b,top:T}=h.getBoundingClientRect(),v=window.scrollY||document.documentElement.scrollTop;g.style.top=`${T+v+h.offsetHeight+5}px`,g.style.left=`${Math.min(b-5,window.innerWidth-g.offsetWidth-20)}px`}},[c,d,a]),no(()=>{let h=d.current;if(h!==null&&a){let g=b=>{let T=b.target;Qf(T)&&(u&&c.current&&c.current.contains(T)||h.contains(T)||p(!1))};return document.addEventListener("click",g),()=>{document.removeEventListener("click",g)}}},[c,d,a,u]);let f=t0(Le(o0,{dropDownRef:c,itemsContainerClassNames:i,onClose:m,children:o}),document.body);return rs(ro.Fragment,{children:[rs("button",{"aria-label":t,className:e+(a?" active":""),"data-dropdown-key":n,disabled:r,onClick:h=>{h.preventDefault(),p(!a)},onMouseDown:h=>{h.preventDefault()},ref:d,type:"button",children:[l&&Le(l,{}),s&&Le("span",{className:"toolbar-popup__dropdown-label",children:s}),Le("i",{className:"toolbar-popup__dropdown-caret"})]}),a&&Le(ro.Fragment,{children:f})]})}var mr="toolbar-popup__dropdown",d0=t=>{let e=r0(18),{active:o,anchorElem:r,editor:n,enabled:l,item:i}=t,{i18n:s}=c0(),{fieldProps:u}=H(),{featureClientSchemaMap:c,schemaPath:d}=u;if(i.Component){let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==i?(f=i?.Component&&qe(i.Component,{active:o,anchorElem:r,editor:n,enabled:l,item:i},i.key),e[0]=o,e[1]=r,e[2]=n,e[3]=l,e[4]=i,e[5]=f):f=e[5],f}let a=i.key,p;if(i.label){let f;e[6]!==c||e[7]!==s||e[8]!==i||e[9]!==d?(f=typeof i.label=="function"?i.label({featureClientSchemaMap:c,i18n:s,schemaPath:d}):i.label,e[6]=c,e[7]=s,e[8]=i,e[9]=d,e[10]=f):f=e[10],a=f}a.length>25?p=a.substring(0,25)+"...":p=a;let m;return e[11]!==o||e[12]!==p||e[13]!==n||e[14]!==l||e[15]!==i||e[16]!==a?(m=qe(ss,{active:o,editor:n,enabled:l,Icon:i?.ChildComponent?qe(i.ChildComponent,{}):void 0,item:i,itemKey:i.key,tooltip:a,children:qe("span",{className:"text",children:p})},i.key),e[11]=o,e[12]=p,e[13]=n,e[14]=l,e[15]=i,e[16]=a,e[17]=m):m=e[17],m},m0=cs.memo(d0),Fe=({anchorElem:t,classNames:e,editor:o,group:r,Icon:n,itemsContainerClassNames:l,label:i,maxActiveItems:s,onActiveChange:u})=>{let[c,d]=cs.useState({activeItemKeys:[],enabledGroup:!0,enabledItemKeys:[]}),a=l0(c),p=H(),{items:m,key:f}=r,h=At(),g=n0(()=>{o.getEditorState().read(()=>{let T=u0();if(!T)return;let v=[],k=[],_=[];for(let x of m)x.isActive&&(!s||v.length<s)&&x.isActive({editor:o,editorConfigContext:p,selection:T})&&(v.push(x.key),k.push(x)),x.isEnabled?x.isEnabled({editor:o,editorConfigContext:p,selection:T})&&_.push(x.key):_.push(x.key);d({activeItemKeys:v,enabledGroup:r.isEnabled?r.isEnabled({editor:o,editorConfigContext:p,selection:T}):!0,enabledItemKeys:_}),u&&u({activeItems:k})})},[o,p,r,m,s,u]);i0(()=>(h(g),a0(o.registerUpdateListener(async()=>{await h(g)}))),[o,h,g]);let b=s0(()=>m?.length?m.map(T=>qe(m0,{active:a.activeItemKeys.includes(T.key),anchorElem:t,editor:o,enabled:a.enabledItemKeys.includes(T.key),item:T},T.key)):null,[m,a,t,o]);return qe(as,{buttonAriaLabel:`${f} dropdown`,buttonClassName:[mr,`${mr}-${f}`,...e||[]].filter(Boolean).join(" "),disabled:!a.enabledGroup,dropdownKey:f,Icon:n,itemsContainerClassNames:[`${mr}-items`,...l||[]],label:i,children:b},f)};function b0({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&le(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?le(Et,{editor:e,item:o,children:le(o.ChildComponent,{})},o.key):null}function k0(t){let e=us(23),{anchorElem:o,editor:r,editorConfig:n,group:l,index:i}=t,{i18n:s}=x0(),{fieldProps:u}=H(),{featureClientSchemaMap:c,schemaPath:d}=u,[a,p]=ke.useState(void 0),[m,f]=ke.useState(void 0),h;e[0]!==l.ChildComponent||e[1]!==l.items||e[2]!==l.type?(h=()=>{l?.type==="dropdown"&&l.items.length&&l.ChildComponent?f(()=>l.ChildComponent):f(void 0)},e[0]=l.ChildComponent,e[1]=l.items,e[2]=l.type,e[3]=h):h=e[3];let g;e[4]!==l?(g=[l],e[4]=l,e[5]=g):g=e[5],ke.useEffect(h,g);let b;e[6]!==c||e[7]!==l.ChildComponent||e[8]!==l.items||e[9]!==l.type||e[10]!==s||e[11]!==d?(b=_=>{let{activeItems:x}=_;if(!x.length){l?.type==="dropdown"&&l.items.length&&l.ChildComponent?(f(()=>l.ChildComponent),p(void 0)):(f(void 0),p(void 0));return}let N=x[0],M=N.key;N.label&&(M=typeof N.label=="function"?N.label({featureClientSchemaMap:c,i18n:s,schemaPath:d}):N.label),M.length>25&&(M=M.substring(0,25)+"..."),x.length===1?(p(M),f(()=>N.ChildComponent)):(p(s.t("lexical:general:toolbarItemsActive",{count:x.length})),l?.type==="dropdown"&&l.items.length&&l.ChildComponent?f(()=>l.ChildComponent):f(void 0))},e[6]=c,e[7]=l.ChildComponent,e[8]=l.items,e[9]=l.type,e[10]=s,e[11]=d,e[12]=b):b=e[12];let T=b,v=`fixed-toolbar__group fixed-toolbar__group-${l.key}`,k;return e[13]!==m||e[14]!==o||e[15]!==a||e[16]!==r||e[17]!==n.features.toolbarFixed?.groups.length||e[18]!==l||e[19]!==i||e[20]!==T||e[21]!==v?(k=p0("div",{className:v,"data-toolbar-group-key":l.key,children:[l.type==="dropdown"&&l.items.length?m?le(Fe,{anchorElem:o,editor:r,group:l,Icon:m,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a,maxActiveItems:l.maxActiveItems??1,onActiveChange:T}):le(Fe,{anchorElem:o,editor:r,group:l,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a,maxActiveItems:l.maxActiveItems??1,onActiveChange:T}):null,l.type==="buttons"&&l.items.length?l.items.map(_=>le(b0,{anchorElem:o,editor:r,item:_},_.key)):null,i<n.features.toolbarFixed?.groups.length-1&&le("div",{className:"divider"})]},l.key),e[13]=m,e[14]=o,e[15]=a,e[16]=r,e[17]=n.features.toolbarFixed?.groups.length,e[18]=l,e[19]=i,e[20]=T,e[21]=v,e[22]=k):k=e[22],k}function _0({anchorElem:t,clientProps:e,editor:o,editorConfig:r,parentWithFixedToolbar:n}){let l=ke.useRef(null),{y:i}=h0(),s=C0(()=>{if(!n||e?.disableIfParentHasFixedToolbar)return null;let c=n.editorContainerRef.current.previousElementSibling;for(;c;){if(c.classList.contains("fixed-toolbar"))return c;c=c.previousElementSibling}return null},[e?.disableIfParentHasFixedToolbar,n]);return g0(()=>{if(!s)return;let u=l.current;if(!u)return;let c=u.getBoundingClientRect(),d=s.getBoundingClientRect();if(!(c.bottom<d.top||c.top>d.bottom))u.classList.remove("fixed-toolbar"),u.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),s.classList.remove("fixed-toolbar"),s.classList.add("fixed-toolbar","fixed-toolbar--hide");else{if(!u.classList.contains("fixed-toolbar--overlapping"))return;u.classList.remove("fixed-toolbar--overlapping"),u.classList.add("fixed-toolbar"),s.classList.remove("fixed-toolbar--hide"),s.classList.add("fixed-toolbar")}},50,[l,s,i]),le("div",{className:"fixed-toolbar",onFocus:u=>{u.stopPropagation()},ref:l,children:o.isEditable()&&le(ke.Fragment,{children:r?.features&&r.features?.toolbarFixed?.groups.map((u,c)=>le(k0,{anchorElem:t,editor:o,editorConfig:r,group:u,index:c},u.key))})})}var ds=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return ds(t.parentEditor)}return!1},ms=t=>{let e=us(6),{clientProps:o}=t,[r]=f0(),n=H(),{editorConfig:l}=n,i=o.applyToFocusedEditor&&n.focusedEditor?.editor||r,s=o.applyToFocusedEditor&&n.focusedEditor?.editorConfig||l,u,c;if(e[0]!==o.disableIfParentHasFixedToolbar||e[1]!==i||e[2]!==s||e[3]!==n){c=Symbol.for("react.early_return_sentinel");e:{let d=ds(n);if(o?.disableIfParentHasFixedToolbar&&d){c=null;break e}if(!s?.features?.toolbarFixed?.groups?.length){c=null;break e}u=le(_0,{anchorElem:document.body,editor:i,editorConfig:s,parentWithFixedToolbar:d})}e[0]=o.disableIfParentHasFixedToolbar,e[1]=i,e[2]=s,e[3]=n,e[4]=u,e[5]=c}else u=e[4],c=e[5];return c!==Symbol.for("react.early_return_sentinel")?c:u};var T0=y({plugins:[{Component:ms,position:"aboveContainer"}]});import{c as hs}from"react/compiler-runtime";import{jsx as ce,jsxs as gs}from"react/jsx-runtime";import{useLexicalComposerContext as w0}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as xs}from"@lexical/utils";import{$getSelection as Cs,$isRangeSelection as ps,$isTextNode as E0,COMMAND_PRIORITY_LOW as N0,getDOMSelection as bs,SELECTION_CHANGE_COMMAND as S0}from"lexical";import{useCallback as io,useEffect as Nt,useRef as fs,useState as L0}from"react";import*as so from"react";import{createPortal as y0}from"react-dom";function pr(t,e){let o=t.getRangeAt(0),r;if(t.anchorNode===e){let n=e;for(;n.firstElementChild!=null;)n=n.firstElementChild;r=n.getBoundingClientRect()}else r=o.getBoundingClientRect();return r}function lo(t){let{alwaysDisplayOnTop:e=!1,anchorElem:o,anchorFlippedOffset:r=0,floatingElem:n,horizontalOffset:l=32,horizontalPosition:i="left",specialHandlingForCaret:s=!1,targetRect:u,verticalGap:c=10}=t,d=o.parentElement;if(u===null||d==null){n.style.opacity="0",n.style.transform="translate(-10000px, -10000px)";return}let a=n.getBoundingClientRect(),p=o.getBoundingClientRect(),m=d.getBoundingClientRect(),f=u.top-a.height-c,h=u.left-l;i==="center"&&(h=u.left+u.width/2-a.width/2);let g=0;return!e&&f<m.top&&!s&&(g=a.height+u.height+c*2,f+=g),i==="center"?h+a.width>m.right?h=m.right-a.width-l:h<m.left&&(h=m.left+l):h+a.width>m.right&&(h=m.right-a.width-l),h-=p.left,n.style.opacity="1",s&&r!==0?(f-=p.bottom-r+a.height-3,n.style.transform=`translate(${h}px, ${f}px) rotate(180deg)`):(f-=p.top,n.style.transform=`translate(${h}px, ${f}px)`),g}function I0({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&ce(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?ce(Et,{editor:e,item:o,children:ce(o.ChildComponent,{})},o.key):null}function R0(t){let e=hs(19),{anchorElem:o,editor:r,group:n,index:l}=t,{editorConfig:i}=H(),[s,u]=so.useState(),c;e[0]!==n.ChildComponent||e[1]!==n.items||e[2]!==n.type?(c=()=>{n?.type==="dropdown"&&n.items.length&&n.ChildComponent?u(()=>n.ChildComponent):u(void 0)},e[0]=n.ChildComponent,e[1]=n.items,e[2]=n.type,e[3]=c):c=e[3];let d;e[4]!==n?(d=[n],e[4]=n,e[5]=d):d=e[5],so.useEffect(c,d);let a;e[6]!==n.ChildComponent||e[7]!==n.items||e[8]!==n.type?(a=h=>{let{activeItems:g}=h;if(!g.length){n?.type==="dropdown"&&n.items.length&&n.ChildComponent?u(()=>n.ChildComponent):u(void 0);return}let b=g[0];u(()=>b?.ChildComponent)},e[6]=n.ChildComponent,e[7]=n.items,e[8]=n.type,e[9]=a):a=e[9];let p=a,m=`inline-toolbar-popup__group inline-toolbar-popup__group-${n.key}`,f;return e[10]!==s||e[11]!==o||e[12]!==r||e[13]!==i.features.toolbarInline?.groups.length||e[14]!==n||e[15]!==l||e[16]!==p||e[17]!==m?(f=gs("div",{className:m,"data-toolbar-group-key":n.key,children:[n.type==="dropdown"&&n.items.length?s?ce(Fe,{anchorElem:o,editor:r,group:n,Icon:s,maxActiveItems:n.maxActiveItems??1,onActiveChange:p}):ce(Fe,{anchorElem:o,editor:r,group:n,maxActiveItems:n.maxActiveItems??1,onActiveChange:p}):null,n.type==="buttons"&&n.items.length?n.items.map(h=>ce(I0,{anchorElem:o,editor:r,item:h},h.key)):null,l<i.features.toolbarInline?.groups.length-1&&ce("div",{className:"divider"})]},n.key),e[10]=s,e[11]=o,e[12]=r,e[13]=i.features.toolbarInline?.groups.length,e[14]=n,e[15]=l,e[16]=p,e[17]=m,e[18]=f):f=e[18],f}function v0({anchorElem:t,editor:e}){let o=fs(null),r=fs(null),{editorConfig:n}=H(),l=io(()=>{if(o?.current){let c=o.current.style.opacity==="0",d=o.current.style.pointerEvents==="none";c||(o.current.style.opacity="0"),d||(o.current.style.pointerEvents="none")}},[o]),i=io(c=>{if(o?.current&&(c.buttons===1||c.buttons===3)){let d=o.current.style.opacity==="0",a=o.current.style.pointerEvents==="none";if(!d||!a){let p=c.clientX,m=c.clientY,f=document.elementFromPoint(p,m);o.current.contains(f)||l()}}},[l]),s=io(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);Nt(()=>(document.addEventListener("mousemove",i),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)}),[o,i,s]);let u=io(()=>{let c=Cs(),d=bs(e._window);if(o.current===null)return;let a=t.querySelector(":scope > .link-editor"),p=a!==null&&"style"in a&&a?.style?.opacity==="1",m=e.getRootElement();if(c!==null&&d!==null&&!d.isCollapsed&&m!==null&&m.contains(d.anchorNode)){let f=pr(d,m),h=lo({alwaysDisplayOnTop:p,anchorElem:t,floatingElem:o.current,horizontalPosition:"center",targetRect:f});r.current&&lo({anchorElem:o.current,anchorFlippedOffset:h,floatingElem:r.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:f,verticalGap:8})}else l()},[e,l,t]);return Nt(()=>{let c=t.parentElement,d=()=>{e.getEditorState().read(()=>{u()})};return window.addEventListener("resize",d),c&&c.addEventListener("scroll",d),()=>{window.removeEventListener("resize",d),c&&c.removeEventListener("scroll",d)}},[e,u,t]),Nt(()=>(e.getEditorState().read(()=>{u()}),xs(e.registerUpdateListener(({editorState:c})=>{c.read(()=>{u()})}),e.registerCommand(S0,()=>(u(),!1),N0))),[e,u]),gs("div",{className:"inline-toolbar-popup",ref:o,children:[ce("div",{className:"caret",ref:r}),n?.features&&n.features?.toolbarInline?.groups.map((c,d)=>ce(R0,{anchorElem:t,editor:e,group:c,index:d},c.key))]})}function M0(t,e){let o=hs(12),[r,n]=L0(!1),l;o[0]!==t?(l=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let p=Cs(),m=bs(t._window),f=t.getRootElement();if(m!==null&&(!ps(p)||f===null||!f.contains(m.anchorNode))){n(!1);return}if(!ps(p))return;if(p.getTextContent()!==""){let g=p.getNodes(),b=!1;for(let T of g)if(E0(T)){n(!0),b=!0;break}b||n(!1)}else n(!1);let h=p.getTextContent().replace(/\n/g,"");if(!p.isCollapsed()&&h===""){n(!1);return}})},o[0]=t,o[1]=l):l=o[1];let i=l,s,u;o[2]!==i?(s=()=>(document.addEventListener("selectionchange",i),document.addEventListener("mouseup",i),()=>{document.removeEventListener("selectionchange",i),document.removeEventListener("mouseup",i)}),u=[i],o[2]=i,o[3]=s,o[4]=u):(s=o[3],u=o[4]),Nt(s,u);let c,d;if(o[5]!==t||o[6]!==i?(c=()=>xs(t.registerUpdateListener(()=>{i()}),t.registerRootListener(()=>{t.getRootElement()===null&&n(!1)})),d=[t,i],o[5]=t,o[6]=i,o[7]=c,o[8]=d):(c=o[7],d=o[8]),Nt(c,d),!r||!t.isEditable())return null;let a;return o[9]!==e||o[10]!==t?(a=y0(ce(v0,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=a):a=o[11],a}var ks=t=>{let{anchorElem:e}=t,[o]=w0();return M0(o,e)};var D0=y({plugins:[{Component:ks,position:"floatingAnchorElem"}]});import{TableCellNode as _h,TableNode as Th,TableRowNode as wh}from"@lexical/table";import{jsx as _s}from"react/jsx-runtime";import"react";var fr=()=>_s("svg",{className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:_s("path",{clipRule:"evenodd",d:"M5.33333 4.5C4.8731 4.5 4.5 4.8731 4.5 5.33333V7.5H9.5V4.5H5.33333ZM5.33333 3.5C4.32081 3.5 3.5 4.32081 3.5 5.33333V14.6667C3.5 15.6792 4.32081 16.5 5.33333 16.5H14.6667C15.6792 16.5 16.5 15.6792 16.5 14.6667V5.33333C16.5 4.32081 15.6792 3.5 14.6667 3.5H5.33333ZM10.5 4.5V7.5H15.5V5.33333C15.5 4.8731 15.1269 4.5 14.6667 4.5H10.5ZM15.5 8.5H10.5V11.5H15.5V8.5ZM15.5 12.5H10.5V15.5H14.6667C15.1269 15.5 15.5 15.1269 15.5 14.6667V12.5ZM9.5 15.5V12.5H4.5V14.6667C4.5 15.1269 4.8731 15.5 5.33333 15.5H9.5ZM4.5 11.5H9.5V8.5H4.5V11.5Z",fill:"currentColor",fillRule:"evenodd"})});import{$createTableCellNode as A0,$createTableNode as O0,$createTableRowNode as $0,$isTableCellNode as Ts,$isTableNode as hr,$isTableRowNode as gr,TableCellHeaderStates as ao,TableCellNode as F0,TableNode as P0,TableRowNode as B0}from"@lexical/table";import{$isParagraphNode as H0,$isTextNode as j0}from"lexical";var Es=/^\|(.+)\|\s?$/,U0=/^(\| ?:?-*:? ?)+\|\s?$/,Ns=({allTransformers:t})=>({type:"element",dependencies:[P0,B0,F0],export:e=>{if(!hr(e))return null;let o=[];for(let r of e.getChildren()){let n=[];if(!gr(r))continue;let l=!1;for(let i of r.getChildren())Ts(i)&&(n.push(Pr(t,i).replace(/\n/g,"\\n").trim()),i.__headerState===ao.ROW&&(l=!0));o.push(`| ${n.join(" | ")} |`),l&&o.push(`| ${n.map(i=>"---").join(" | ")} |`)}return o.join(`
|
|
39
|
-
`)},regExp:
|
|
40
|
-
`);let o=A0(ao.NO_STATUS);return Fr(t,e,o),o},ws=(t,e)=>{let o=t.match(Es);return!o||!o[1]?null:o[1].split("|").map(r=>Ss(r,e))};import{c as V0}from"react/compiler-runtime";import{jsx as P,jsxs as _e}from"react/jsx-runtime";import{useLexicalComposerContext as vs}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as K0}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as ys,$deleteTableColumnAtSelection as J0,$deleteTableRowAtSelection as X0,$getNodeTriplet as z0,$getTableCellNodeFromLexicalNode as Is,$getTableColumnIndexFromTableCellNode as Z0,$getTableNodeFromLexicalNodeOrThrow as Ie,$getTableRowIndexFromTableCellNode as Y0,$insertTableColumnAtSelection as q0,$insertTableRowAtSelection as Q0,$isTableCellNode as Ms,$isTableSelection as St,$mergeCells as e1,$unmergeCell as t1,getTableElement as Cr,getTableObserverFromTableElement as br,TableCellHeaderStates as ye,TableCellNode as o1}from"@lexical/table";import{mergeRegister as r1}from"@lexical/utils";import{useScrollInfo as n1}from"@payloadcms/ui";import{$getSelection as uo,$isElementNode as l1,$isRangeSelection as kr,$isTextNode as i1,$setSelection as s1,COMMAND_PRIORITY_CRITICAL as a1,getDOMSelection as c1,isDOMNode as u1,SELECTION_CHANGE_COMMAND as d1}from"lexical";import*as _r from"react";import{useCallback as ie,useEffect as Qe,useRef as co,useState as et}from"react";import{createPortal as Ds}from"react-dom";import{jsx as xr,jsxs as W0}from"react/jsx-runtime";import"react";var Ls=()=>W0("svg",{fill:"none",height:"18",viewBox:"0 0 20 20",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[xr("path",{d:"M5 11C5.55228 11 6 10.5523 6 10C6 9.44772 5.55228 9 5 9C4.44772 9 4 9.44772 4 10C4 10.5523 4.44772 11 5 11Z",fill:"currentColor"}),xr("path",{d:"M10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z",fill:"currentColor"}),xr("path",{d:"M15 11C15.5523 11 16 10.5523 16 10C16 9.44772 15.5523 9 15 9C14.4477 9 14 9.44772 14 10C14 10.5523 14.4477 11 15 11Z",fill:"currentColor"})]});function Rs(t){let e=t.getShape();return{columns:e.toX-e.fromX+1,rows:e.toY-e.fromY+1}}function m1(){let t=uo();if(kr(t)&&!t.isCollapsed()||St(t)&&!t.anchor.is(t.focus)||!kr(t)&&!St(t))return!1;let[e]=z0(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function p1(t){let e=t.getLastDescendant();i1(e)?e.select():l1(e)?e.selectEnd():e!==null&&e.selectNext()}function f1({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:r,tableCellNode:n}){let[l]=vs(),i=co(null),[s,u]=et(n),[c,d]=et({columns:1,rows:1}),[a,p]=et(!1),[m,f]=et(!1),{y:h}=n1();Qe(()=>l.registerMutationListener(o1,C=>{C.get(s.getKey())==="updated"&&l.getEditorState().read(()=>{u(s.getLatest())})},{skipInitialization:!0}),[l,s]),Qe(()=>{l.getEditorState().read(()=>{let C=uo();if(St(C)){let E=Rs(C);d(Rs(C)),p(E.columns>1||E.rows>1)}f(m1())})},[l]),Qe(()=>{let C=e.current,E=i.current,R=l.getRootElement();if(C!=null&&E!=null&&R!=null){let L=R.getBoundingClientRect(),D=C.getBoundingClientRect();E.style.opacity="1";let S=E.getBoundingClientRect(),F=5,G=D.right+F;if(G+S.width>window.innerWidth||G+S.width>L.right){let te=D.left-S.width-F;G=(te<0?F:te)+window.pageXOffset}E.style.left=`${G+window.pageXOffset}px`;let q=D.top;if(q+S.height>window.innerHeight){let te=D.bottom-S.height;q=te<0?F:te}E.style.top=`${q}px`}},[e,i,l,h]),Qe(()=>{function C(E){i.current!=null&&e.current!=null&&u1(E.target)&&!i.current.contains(E.target)&&!e.current.contains(E.target)&&r(!1)}return window.addEventListener("click",C),()=>window.removeEventListener("click",C)},[r,e]);let g=ie(()=>{l.update(()=>{if(s.isAttached()){let C=Ie(s),E=Cr(C,l.getElementByKey(C.getKey()));if(E===null)throw new Error("Expected to find tableElement in DOM");let R=br(E);R!==null&&R.$clearHighlight(),C.markDirty(),u(s.getLatest())}s1(null)})},[l,s]),b=()=>{l.update(()=>{let C=uo();if(!St(C))return;let R=C.getNodes().filter(Ms),L=e1(R);L&&(p1(L),o())})},T=()=>{l.update(()=>{t1()})},v=ie(C=>{l.update(()=>{for(let E=0;E<c.rows;E++)Q0(C);o()})},[l,o,c.rows]),k=ie(C=>{l.update(()=>{for(let E=0;E<c.columns;E++)q0(C);o()})},[l,o,c.columns]),_=ie(()=>{l.update(()=>{X0(),o()})},[l,o]),x=ie(()=>{l.update(()=>{Ie(s).remove(),g(),o()})},[l,s,g,o]),N=ie(()=>{l.update(()=>{J0(),o()})},[l,o]),M=ie(()=>{l.update(()=>{let C=Ie(s),E=Y0(s),[R]=ys(C,null,null),L=new Set,D=s.getHeaderStyles()^ye.ROW;if(R[E])for(let S=0;S<R[E].length;S++){let F=R[E][S];F?.cell&&(L.has(F.cell)||(L.add(F.cell),F.cell.setHeaderStyles(D,ye.ROW)))}g(),o()})},[l,s,g,o]),O=ie(()=>{l.update(()=>{let C=Ie(s),E=Z0(s),[R]=ys(C,null,null),L=new Set,D=s.getHeaderStyles()^ye.COLUMN;if(R)for(let S=0;S<R.length;S++){let F=R?.[S]?.[E];F?.cell&&(L.has(F.cell)||(L.add(F.cell),F.cell.setHeaderStyles(D,ye.COLUMN)))}g(),o()})},[l,s,g,o]),$=ie(()=>{l.update(()=>{if(s.isAttached()){let C=Ie(s);C&&C.setRowStriping(!C.getRowStriping())}g(),o()})},[l,s,g,o]),I=ie(()=>{l.update(()=>{if(s.isAttached()){let C=Ie(s);C&&C.setFrozenColumns(C.getFrozenColumns()===0?1:0)}g(),o()})},[l,s,g,o]),w=null;return t&&(a?w=P("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>b(),type:"button",children:P("span",{className:"text",children:"Merge cells"})}):m&&(w=P("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>T(),type:"button",children:P("span",{className:"text",children:"Unmerge cells"})}))),Ds(_e("div",{className:"table-action-menu-dropdown",onClick:C=>{C.stopPropagation()},ref:i,children:[w?_e(_r.Fragment,{children:[w,P("hr",{})]}):null,P("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>$(),type:"button",children:P("span",{className:"text",children:"Toggle Row Striping"})}),P("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>I(),type:"button",children:P("span",{className:"text",children:"Toggle First Column Freeze"})}),P("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>v(!1),type:"button",children:_e("span",{className:"text",children:["Insert ",c.rows===1?"row":`${c.rows} rows`," above"]})}),P("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>v(!0),type:"button",children:_e("span",{className:"text",children:["Insert ",c.rows===1?"row":`${c.rows} rows`," below"]})}),P("hr",{}),P("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>k(!1),type:"button",children:_e("span",{className:"text",children:["Insert ",c.columns===1?"column":`${c.columns} columns`," ","left"]})}),P("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>k(!0),type:"button",children:_e("span",{className:"text",children:["Insert ",c.columns===1?"column":`${c.columns} columns`," ","right"]})}),P("hr",{}),P("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>N(),type:"button",children:P("span",{className:"text",children:"Delete column"})}),P("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>_(),type:"button",children:P("span",{className:"text",children:"Delete row"})}),P("button",{className:"item","data-test-id":"table-delete",onClick:()=>x(),type:"button",children:P("span",{className:"text",children:"Delete table"})}),P("hr",{}),P("button",{className:"item","data-test-id":"table-row-header",onClick:()=>M(),type:"button",children:_e("span",{className:"text",children:[(s.__headerState&ye.ROW)===ye.ROW?"Remove":"Add"," ","row header"]})}),P("button",{className:"item","data-test-id":"table-column-header",onClick:()=>O(),type:"button",children:_e("span",{className:"text",children:[(s.__headerState&ye.COLUMN)===ye.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function h1({anchorElem:t,cellMerge:e}){let[o]=vs(),r=co(null),n=co(null),[l,i]=et(!1),[s,u]=et(null),c=ie(()=>{let a=r.current,p=uo(),m=c1(o._window),f=document.activeElement;function h(){a&&(a.classList.remove("table-cell-action-button-container--active"),a.classList.add("table-cell-action-button-container--inactive")),u(null)}if(p==null||a==null)return h();let g=o.getRootElement(),b=null,T=null;if(kr(p)&&g!==null&&m!==null&&g.contains(m.anchorNode)){let k=Is(p.anchor.getNode());if(k==null||(T=o.getElementByKey(k.getKey()),T==null||!k.isAttached()))return h();let _=Ie(k),x=Cr(_,o.getElementByKey(_.getKey()));if(x===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");b=br(x),u(k)}else if(St(p)){let k=Is(p.anchor.getNode());if(!Ms(k))throw new Error("TableSelection anchorNode must be a TableCellNode");let _=Ie(k),x=Cr(_,o.getElementByKey(_.getKey()));if(x===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");b=br(x),T=o.getElementByKey(k.getKey())}else if(!f)return h();if(b===null||T===null)return h();let v=!b||!b.isSelecting;if(a.classList.toggle("table-cell-action-button-container--active",v),a.classList.toggle("table-cell-action-button-container--inactive",!v),v){let k=T.getBoundingClientRect(),_=t.getBoundingClientRect(),x=k.top-_.top,N=k.right-_.left;a.style.transform=`translate(${N}px, ${x}px)`}},[o,t]);Qe(()=>{let a,p=()=>{a=void 0,o.getEditorState().read(c)},m=()=>(a===void 0&&(a=setTimeout(p,0)),!1);return r1(o.registerUpdateListener(m),o.registerCommand(d1,m,a1),o.registerRootListener((f,h)=>{h&&h.removeEventListener("pointerup",m),f&&(f.addEventListener("pointerup",m),m())}),()=>clearTimeout(a))});let d=co(s);return Qe(()=>{d.current!==s&&i(!1),d.current=s},[d,s]),P("div",{className:"table-cell-action-button-container",ref:r,children:s!=null&&_e(_r.Fragment,{children:[P("button",{className:"table-cell-action-button",onClick:a=>{a.stopPropagation(),i(!l)},ref:n,type:"button",children:P(Ls,{})}),l&&P(f1,{cellMerge:e,contextRef:n,onClose:()=>i(!1),setIsMenuOpen:i,tableCellNode:s})]})})}var As=t=>{let e=V0(3),{anchorElem:o}=t,r=K0(),n;return e[0]!==o||e[1]!==r?(n=Ds(r?P(h1,{anchorElem:o??document.body,cellMerge:!0}):null,o??document.body),e[0]=o,e[1]=r,e[2]=n):n=e[2],n};import{c as g1}from"react/compiler-runtime";import{jsx as po,jsxs as x1}from"react/jsx-runtime";import{useLexicalComposerContext as C1}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as b1}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as k1,$getTableNodeFromLexicalNodeOrThrow as Tr,$getTableRowIndexFromTableCellNode as _1,$isTableCellNode as Os,$isTableRowNode as T1,getDOMCellFromTarget as w1,getTableElement as E1,TableNode as $s}from"@lexical/table";import{calculateZoomLevel as Fs,mergeRegister as N1}from"@lexical/utils";import{$getNearestNodeFromDOMNode as wr,isHTMLElement as S1,SKIP_SCROLL_INTO_VIEW_TAG as Ps}from"lexical";import*as Hs from"react";import{useCallback as Lt,useEffect as Er,useRef as mo,useState as tt}from"react";import{createPortal as L1}from"react-dom";var y1=33,Bs=92;function I1({editor:t}){let e=mo(null),o=mo(null),r=mo(null),[n,l]=tt(!1),i=H(),s=mo(null),[u,c]=tt(null),[d,a]=tt(null),[p,m]=tt(!1),[f,h]=tt(null),g=Lt(()=>{a(null),e.current=null,h(null),s.current=null,r.current=null},[]),b=I=>(I.buttons&1)===1;Er(()=>{let I=new Set;return N1(t.registerMutationListener($s,w=>{for(let[C,E]of w)E==="destroyed"?I.delete(C):I.add(C);l(I.size>0)}),t.registerNodeTransform($s,w=>{if(w.getColWidths())return w;let C=w.getColumnCount(),E=Bs;return w.setColWidths(Array(C).fill(E)),w}))},[t]),Er(()=>{if(!n)return;let I=R=>{let L=R.target;if(S1(L)){if(f){c({x:R.clientX,y:R.clientY});return}if(m(b(R)),!(o.current&&o.current.contains(L))&&e.current!==L){e.current=L;let D=w1(L);D&&d!==D?t.getEditorState().read(()=>{let S=wr(D.elem);if(!S)throw new Error("TableCellResizer: Table cell node not found.");let F=Tr(S),G=E1(F,t.getElementByKey(F.getKey()));if(!G)throw new Error("TableCellResizer: Table element not found.");e.current=L,r.current=G.getBoundingClientRect(),a(D)},{editor:t}):D==null&&g()}}},w=R=>{m(!0)},C=R=>{m(!1)},E=t.registerRootListener((R,L)=>{L?.removeEventListener("mousemove",I),L?.removeEventListener("mousedown",w),L?.removeEventListener("mouseup",C),R?.addEventListener("mousemove",I),R?.addEventListener("mousedown",w),R?.addEventListener("mouseup",C)});return()=>{E()}},[d,f,t,n,g]);let T=I=>I==="bottom",v=Lt(I=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let w=wr(d.elem);if(!Os(w))throw new Error("TableCellResizer: Table cell node not found.");let C=Tr(w),E=_1(w),R=C.getChildren(),D=w.getColSpan()===C.getColumnCount()?E:E+w.getRowSpan()-1;if(D>=R.length||D<0)throw new Error("Expected table cell to be inside of table row.");let S=R[D];if(!T1(S))throw new Error("Expected table row");let F=S.getHeight();if(F===void 0){let q=S.getChildren();F=Math.min(...q.map(te=>k(te,t)??1/0))}let G=Math.max(F+I,y1);S.setHeight(G)},{tag:Ps})},[d,t]),k=(I,w)=>w.getElementByKey(I.getKey())?.clientHeight,_=(I,w)=>{let C;return w.forEach(E=>{E.forEach((R,L)=>{R.cell===I&&(C=L)})}),C},x=Lt(I=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let w=wr(d.elem);if(!Os(w))throw new Error("TableCellResizer: Table cell node not found.");let C=Tr(w),[E]=k1(C,null,null),R=_(w,E);if(R===void 0)throw new Error("TableCellResizer: Table column not found.");let L=C.getColWidths();if(!L)return;let D=L[R];if(D===void 0)return;let S=[...L],F=Math.max(D+I,Bs);S[R]=F,C.setColWidths(S)},{tag:Ps})},[d,t]),N=Lt(I=>{let w=C=>{if(C.preventDefault(),C.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");if(s.current){let{x:E,y:R}=s.current;if(d===null)return;let L=Fs(C.target);if(T(I)){let D=(C.clientY-R)/L;v(D)}else{let D=(C.clientX-E)/L;x(D)}g(),document.removeEventListener("mouseup",w)}};return w},[d,g,x,v]),M=Lt(I=>w=>{if(w.preventDefault(),w.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");s.current={x:w.clientX,y:w.clientY},c(s.current),h(I),document.addEventListener("mouseup",N(I))},[d,N]),[O,$]=tt({bottom:null,left:null,right:null,top:null});return Er(()=>{if(d){let{height:I,left:w,top:C,width:E}=d.elem.getBoundingClientRect(),R=Fs(d.elem),L=10,D={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${L}px`,left:`${window.scrollX+w}px`,top:`${window.scrollY+C+I-L/2}px`,width:`${E}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${I}px`,left:`${window.scrollX+w+E-L/2}px`,top:`${window.scrollY+C}px`,width:`${L}px`}},S=r.current;f&&u&&S&&(T(f)?(D[f].left=`${window.scrollX+S.left}px`,D[f].top=`${window.scrollY+u.y/R}px`,D[f].height="3px",D[f].width=`${S.width}px`):(D[f].top=`${window.scrollY+S.top}px`,D[f].left=`${window.scrollX+u.x/R}px`,D[f].width="3px",D[f].height=`${S.height}px`),D[f].backgroundColor="#adf"),$(D)}else $({bottom:null,left:null,right:null,top:null})},[d,f,u]),po("div",{ref:o,children:d!=null&&!p&&x1(Hs.Fragment,{children:[po("div",{className:`${i.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:M("right"),style:O.right||void 0}),po("div",{className:`${i.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:M("bottom"),style:O.bottom||void 0})]})})}var js=()=>{let t=g1(3),[e]=C1(),o=b1(),r,n;return t[0]!==e||t[1]!==o?(n=o?L1(po(I1,{editor:e}),document.body):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],r=n,r};import{c as F1}from"react/compiler-runtime";import{jsx as Nr,jsxs as P1,Fragment as B1}from"react/jsx-runtime";import{useLexicalComposerContext as zs}from"@lexical/react/LexicalComposerContext";import{$getTableAndElementByKey as H1,$getTableColumnIndexFromTableCellNode as j1,$getTableRowIndexFromTableCellNode as U1,$insertTableColumnAtSelection as G1,$insertTableRowAtSelection as W1,$isTableCellNode as V1,$isTableNode as Ws,getTableElement as K1,TableNode as J1}from"@lexical/table";import{$findMatchingParent as X1,mergeRegister as z1}from"@lexical/utils";import{$getNearestNodeFromDOMNode as Vs,isHTMLElement as Z1}from"lexical";import{useEffect as Ks,useMemo as Y1,useRef as Js,useState as fo}from"react";import"react";import{createPortal as q1}from"react-dom";import{c as A1}from"react/compiler-runtime";import{useEffect as O1,useRef as $1}from"react";var R1="Expected a function",v1=Math.max,M1=Math.min;function D1(t,e,o){let r,n,l=0,i,s=!1,u=!1,c,d,a,p=!0;if(typeof t!="function")throw new TypeError(R1);e=e||0,typeof o=="object"&&(s=!!o.leading,u="maxWait"in o,c=u?v1(o.maxWait||0,e):c,p="trailing"in o?!!o.trailing:p);function m(x){let N=r,M=i;return r=i=void 0,l=x,d=t.apply(M,N),d}function f(x){return l=x,a=setTimeout(b,e),s?m(x):d}function h(x){let N=x-n,M=x-l,O=e-N;return u?M1(O,c-M):O}function g(x){let N=x-n,M=x-l;return n===void 0||N>=e||N<0||u&&M>=c}function b(){let x=Date.now();if(g(x))return T(x);a=setTimeout(b,h(x))}function T(x){return a=void 0,p&&r?m(x):(r=i=void 0,d)}function v(){a!==void 0&&clearTimeout(a),l=0,r=n=i=a=void 0}function k(){return a===void 0?d:T(Date.now())}function _(){let x=Date.now(),N=g(x);if(r=arguments,i=this,n=x,N){if(a===void 0)return f(n);if(u)return clearTimeout(a),a=setTimeout(b,e),m(n)}return a===void 0&&(a=setTimeout(b,e)),d}return _.cancel=v,_.flush=k,_}var Us=D1;function Gs(t,e,o){let r=A1(6),n=$1(null),l,i;r[0]!==t||r[1]!==o||r[2]!==e?(l=()=>(n.current=Us(t,e,{maxWait:o}),()=>{n.current?.cancel()}),i=[t,e,o],r[0]=t,r[1]=o,r[2]=e,r[3]=l,r[4]=i):(l=r[3],i=r[4]),O1(l,i);let s;return r[5]===Symbol.for("react.memo_cache_sentinel")?(s=(...c)=>{let d=c;n.current&&n.current(...d)},r[5]=s):s=r[5],s}var Xs=20;function Q1({anchorElem:t}){let[e]=zs(),o=H(),[r,n]=fo(!1),[l,i]=fo(!1),[s,u]=fo(!1),[c,d]=fo({}),a=Js(new Set),p=Js(null),m=Gs(g=>{let{isOutside:b,tableDOMNode:T}=eh(g,o.editorConfig?.lexical);if(b){n(!1),i(!1);return}if(!T)return;p.current=T;let v=null,k=null,_=null;if(e.getEditorState().read(()=>{let L=Vs(T);if(V1(L)){let D=X1(L,S=>Ws(S));if(!Ws(D))return;if(_=K1(D,e.getElementByKey(D.getKey())),_){let S=D.getChildrenSize(),F=D.getChildAtIndex(0)?.getChildrenSize(),G=U1(L),q=j1(L);G===S-1?v=L:q===F-1&&(k=L)}}},{editor:e}),!_)return;let x=_.parentElement;if(!x)return;let{bottom:N,height:M,left:O,right:$,width:I,y:w}=_.getBoundingClientRect(),C=!1;x&&x.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(C=x.scrollWidth>x.clientWidth);let{left:E,y:R}=t.getBoundingClientRect();v?(i(!1),n(!0),d({height:Xs,left:C&&x?x.offsetLeft:O-E,top:N-R+5,width:C&&x?x.offsetWidth:I})):k&&(i(!0),n(!1),d({height:M,left:$-E+5,top:w-R,width:Xs}))},50,250),f=Y1(()=>new ResizeObserver(()=>{n(!1),i(!1)}),[]);Ks(()=>{if(s)return document.addEventListener("mousemove",m),()=>{n(!1),i(!1),document.removeEventListener("mousemove",m)}},[s,m]),Ks(()=>z1(e.registerMutationListener(J1,g=>{e.getEditorState().read(()=>{let b=!1;for(let[T,v]of g)switch(v){case"created":{a.current.add(T),b=!0;break}case"destroyed":{a.current.delete(T),b=!0;break}default:break}if(b){f.disconnect();for(let T of a.current){let{tableElement:v}=H1(T);f.observe(v)}u(a.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let h=g=>{e.update(()=>{p.current&&(Vs(p.current)?.selectEnd(),g?(W1(),n(!1)):(G1(),i(!1)))})};return e?.isEditable()?P1(B1,{children:[r&&Nr("button",{"aria-label":"Add Row",className:o.editorConfig.lexical.theme.tableAddRows,onClick:()=>h(!0),style:{...c},type:"button"}),l&&Nr("button",{"aria-label":"Add Column",className:o.editorConfig.lexical.theme.tableAddColumns,onClick:()=>h(!1),style:{...c},type:"button"})]}):null}function eh(t,e){let o=t.target;if(Z1(o)){let r=o.closest(`td.${e.theme.tableCell}, th.${e.theme.tableCell}`);return{isOutside:!(r||o.closest(`button.${e.theme.tableAddRows}`)||o.closest(`button.${e.theme.tableAddColumns}`)||o.closest(`div.${e.theme.tableCellResizer}`)),tableDOMNode:r}}else return{isOutside:!0,tableDOMNode:null}}function Zs(t){let e=F1(2),{anchorElem:o}=t,r=o===void 0?document.body:o,[n]=zs();if(!n?.isEditable())return null;let l;return e[0]!==r?(l=q1(Nr(Q1,{anchorElem:r}),r),e[0]=r,e[1]=l):l=e[1],l}import{c as th}from"react/compiler-runtime";import{jsx as Sr,jsxs as oh}from"react/jsx-runtime";import{useLexicalComposerContext as rh}from"@lexical/react/LexicalComposerContext";import{TablePlugin as nh}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as lh,TableCellNode as ih,TableNode as sh,TableRowNode as ah}from"@lexical/table";import{mergeRegister as ch}from"@lexical/utils";import{formatDrawerSlug as uh,useEditDepth as dh}from"@payloadcms/ui";import{$getSelection as mh,$isRangeSelection as ph,COMMAND_PRIORITY_EDITOR as fh,createCommand as hh}from"lexical";import{createContext as gh,use as xh,useEffect as Ch,useMemo as bh,useState as kh}from"react";import*as Ys from"react";var ho=hh("OPEN_EMBED_DRAWER_COMMAND"),qs=gh({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function Qs({children:t}){let[e,o]=kh({cellEditorConfig:null,cellEditorPlugins:null});return Sr(qs,{value:bh(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(r,n)=>{o({cellEditorConfig:r,cellEditorPlugins:n})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var ea=()=>{let t=th(16),[e]=rh(),o=xh(qs),r=dh(),{fieldProps:n,uuid:l}=H(),{schemaPath:i}=n,s="lexical-table-create-"+l,u;t[0]!==r||t[1]!==s?(u=uh({slug:s,depth:r}),t[0]=r,t[1]=s,t[2]=u):u=t[2];let c=u,{toggleDrawer:d}=de(c,!0),a;t[3]!==e||t[4]!==d?(a=()=>{if(!e.hasNodes([sh,ah,ih]))throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return ch(e.registerCommand(ho,()=>{let h=null;return e.getEditorState().read(()=>{let g=mh();ph(g)&&(h=g)}),h&&d(),!0},fh))},t[3]=e,t[4]=d,t[5]=a):a=t[5];let p;t[6]!==o||t[7]!==e||t[8]!==d?(p=[o,e,d],t[6]=o,t[7]=e,t[8]=d,t[9]=p):p=t[9],Ch(a,p);let m;t[10]!==e?(m=(h,g)=>{!g.columns||!g.rows||e.dispatchCommand(lh,{columns:String(g.columns),rows:String(g.rows)})},t[10]=e,t[11]=m):m=t[11];let f;return t[12]!==c||t[13]!==i||t[14]!==m?(f=oh(Ys.Fragment,{children:[Sr(ot,{drawerSlug:c,drawerTitle:"Create Table",featureKey:"experimental_table",handleDrawerSubmit:m,schemaPath:i,schemaPathSuffix:"fields"}),Sr(nh,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]}),t[12]=c,t[13]=i,t[14]=m,t[15]=f):f=t[15],f};var Eh=y({markdownTransformers:[Ns],nodes:[Th,_h,wh],plugins:[{Component:ea,position:"normal"},{Component:js,position:"normal"},{Component:As,position:"floatingAnchorElem"},{Component:Zs,position:"floatingAnchorElem"}],providers:[Qs],slashMenu:{groups:[Z([{Icon:fr,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(ho,{})}}])]},toolbarFixed:{groups:[fe([{ChildComponent:fr,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(ho,{})}}])]}});import{$isNodeSelection as tg}from"lexical";import{jsx as Lr,jsxs as Nh}from"react/jsx-runtime";import"react";var yr=()=>Nh("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Lr("path",{d:"M14.6667 4H5.33333C4.59695 4 4 4.59695 4 5.33333V14.6667C4 15.403 4.59695 16 5.33333 16H14.6667C15.403 16 16 15.403 16 14.6667V5.33333C16 4.59695 15.403 4 14.6667 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),Lr("path",{d:"M7.99984 9.33366C8.73622 9.33366 9.33317 8.73671 9.33317 8.00033C9.33317 7.26395 8.73622 6.66699 7.99984 6.66699C7.26346 6.66699 6.6665 7.26395 6.6665 8.00033C6.6665 8.73671 7.26346 9.33366 7.99984 9.33366Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),Lr("path",{d:"M16 11.9995L13.9427 9.94214C13.6926 9.69218 13.3536 9.55176 13 9.55176C12.6464 9.55176 12.3074 9.69218 12.0573 9.94214L6 15.9995",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as Rh}from"react/jsx-runtime";import ra from"bson-objectid";import{$applyNodeReplacement as vh}from"lexical";import*as na from"react";import{jsx as Sh}from"react/jsx-runtime";import{DecoratorBlockNode as Lh}from"@lexical/react/LexicalDecoratorBlockNode.js";import ta from"bson-objectid";import{$applyNodeReplacement as yh}from"lexical";import"react";function Ir(t){return t.parentElement!=null&&t.parentElement.tagName==="LI"&&t.previousSibling===null&&t.getAttribute("aria-roledescription")==="checkbox"}function Ih(t){if(t.hasAttribute("data-lexical-upload-relation-to")&&t.hasAttribute("data-lexical-upload-id")){let o=t.getAttribute("data-lexical-upload-id"),r=t.getAttribute("data-lexical-upload-relation-to");if(o!=null&&r!=null)return{node:oa({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||Ir(e),null}var yt=class extends Lh{__data;constructor({data:e,format:o,key:r}){super(o,r),this.__data=e}static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"upload"}static importDOM(){return{img:e=>({conversion:Ih,priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new ta.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value},r=oa({data:o});return r.setFormat(e.format),r}static isInline(){return!1}decorate(){return Sh(RawUploadComponent,{data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportDOM(){let e=document.createElement("img");return e.setAttribute("data-lexical-upload-id",String(this.__data?.value)),e.setAttribute("data-lexical-upload-relation-to",this.__data?.relationTo),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(e){let o=this.getWritable();o.__data=e}updateDOM(){return!1}};function oa({data:t}){return t?.id||(t.id=new ta.default().toHexString()),yh(new yt({data:t}))}var Mh=na.lazy(()=>import("./component-M3U253XK.js").then(t=>({default:t.UploadComponent})));function Dh(t){if(t.hasAttribute("data-lexical-upload-relation-to")&&t.hasAttribute("data-lexical-upload-id")){let o=t.getAttribute("data-lexical-upload-id"),r=t.getAttribute("data-lexical-upload-relation-to");if(o!=null&&r!=null)return{node:Pe({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||Ir(e),null}var Te=class extends yt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:Dh,priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new ra.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value},r=Pe({data:o});return r.setFormat(e.format),r}decorate(){return Rh(Mh,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Pe({data:t}){return t?.id||(t.id=new ra.default().toHexString()),vh(new Te({data:t}))}function Rr(t){return t instanceof Te}import{c as jh}from"react/compiler-runtime";import{jsx as Uh}from"react/jsx-runtime";import{useLexicalComposerContext as Gh}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Wh,mergeRegister as Vh}from"@lexical/utils";import{useConfig as Kh}from"@payloadcms/ui";import{$getPreviousSelection as Jh,$getSelection as Xh,$isParagraphNode as zh,$isRangeSelection as Zh,COMMAND_PRIORITY_EDITOR as Yh,createCommand as qh}from"lexical";import{useEffect as Qh}from"react";import{c as la}from"react/compiler-runtime";import{jsx as vr}from"react/jsx-runtime";import{useLexicalComposerContext as ia}from"@lexical/react/LexicalComposerContext.js";import{toast as Ah}from"@payloadcms/ui";import{$getNodeByKey as Oh,COMMAND_PRIORITY_EDITOR as sa}from"lexical";import{useEffect as aa,useState as $h}from"react";var Fh=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=Oh(o);n&&n.replace(Pe({data:{fields:null,relationTo:e,value:r}}))}):t.dispatchCommand(Mr,{fields:null,relationTo:e,value:r})},Ph=t=>{let e=la(13),{enabledCollectionSlugs:o}=t,[r]=ia(),[n,l]=$h(null),i;e[0]!==o?(i={collectionSlugs:o,uploads:!0},e[0]=o,e[1]=i):i=e[1];let{closeListDrawer:s,ListDrawer:u,openListDrawer:c}=wt(i),d,a;e[2]!==r||e[3]!==c?(d=()=>r.registerCommand(Ue,h=>(l(h?.replace?h?.replace.nodeKey:null),c(),!0),sa),a=[r,c],e[2]=r,e[3]=c,e[4]=d,e[5]=a):(d=e[4],a=e[5]),aa(d,a);let p;e[6]!==s||e[7]!==r||e[8]!==n?(p=h=>{let{collectionSlug:g,doc:b}=h;s(),Fh({editor:r,relationTo:g,replaceNodeKey:n,value:b.id})},e[6]=s,e[7]=r,e[8]=n,e[9]=p):p=e[9];let m=p,f;return e[10]!==u||e[11]!==m?(f=vr(u,{onSelect:m}),e[10]=u,e[11]=m,e[12]=f):f=e[12],f},Bh=()=>{let t=la(3),[e]=ia(),o,r;return t[0]!==e?(o=()=>e.registerCommand(Ue,Hh,sa),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),aa(o,r),null},ca=t=>vr(Dt,{...t,FallbackComponent:Bh,uploads:!0,children:vr(Ph,{...t})});function Hh(){return Ah.error("No upload collections enabled"),!0}var Mr=qh("INSERT_UPLOAD_COMMAND"),ua=t=>{let e=jh(5),[o]=Gh(),{config:r}=Kh(),{collections:n}=r,l,i;e[0]!==o?(l=()=>{if(!o.hasNodes([Te]))throw new Error("UploadPlugin: UploadNode not registered on editor");return Vh(o.registerCommand(Mr,u=>(o.update(()=>{let c=Xh()||Jh();if(Zh(c)){let d=Pe({data:{id:u.id,fields:u.fields,relationTo:u.relationTo,value:u.value}}),{focus:a}=c,p=a.getNode();Wh(d),zh(p)&&!p.__first&&p.remove()}}),!0),Yh))},i=[o],e[0]=o,e[1]=l,e[2]=i):(l=e[1],i=e[2]),Qh(l,i);let s;return e[3]!==n?(s=Uh(ca,{enabledCollectionSlugs:n.map(eg)}),e[3]=n,e[4]=s):s=e[4],s};function eg(t){let{slug:e}=t;return e}var og=y({nodes:[Te],plugins:[{Component:ua,position:"normal"}],slashMenu:{groups:[Z([{Icon:yr,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ue,{replace:!1})}}])]},toolbarFixed:{groups:[fe([{ChildComponent:yr,isActive:({selection:t})=>{if(!tg(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Rr(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ue,{replace:!1})}}])]}});import{c as ng}from"react/compiler-runtime";import{jsx as Ar}from"react/jsx-runtime";import{ShimmerEffect as lg,useConfig as ig}from"@payloadcms/ui";import{lazy as sg,Suspense as ag,useEffect as cg,useState as ug}from"react";var da={block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",codeHighlight:{atrule:"LexicalEditorTheme__tokenAttr",attr:"LexicalEditorTheme__tokenAttr",boolean:"LexicalEditorTheme__tokenProperty",builtin:"LexicalEditorTheme__tokenSelector",cdata:"LexicalEditorTheme__tokenComment",char:"LexicalEditorTheme__tokenSelector",class:"LexicalEditorTheme__tokenFunction","class-name":"LexicalEditorTheme__tokenFunction",comment:"LexicalEditorTheme__tokenComment",constant:"LexicalEditorTheme__tokenProperty",deleted:"LexicalEditorTheme__tokenProperty",doctype:"LexicalEditorTheme__tokenComment",entity:"LexicalEditorTheme__tokenOperator",function:"LexicalEditorTheme__tokenFunction",important:"LexicalEditorTheme__tokenVariable",inserted:"LexicalEditorTheme__tokenSelector",keyword:"LexicalEditorTheme__tokenAttr",namespace:"LexicalEditorTheme__tokenVariable",number:"LexicalEditorTheme__tokenProperty",operator:"LexicalEditorTheme__tokenOperator",prolog:"LexicalEditorTheme__tokenComment",property:"LexicalEditorTheme__tokenProperty",punctuation:"LexicalEditorTheme__tokenPunctuation",regex:"LexicalEditorTheme__tokenVariable",selector:"LexicalEditorTheme__tokenSelector",string:"LexicalEditorTheme__tokenSelector",symbol:"LexicalEditorTheme__tokenProperty",tag:"LexicalEditorTheme__tokenProperty",url:"LexicalEditorTheme__tokenOperator",variable:"LexicalEditorTheme__tokenVariable"},embedBlock:{base:"LexicalEditorTheme__embedBlock",focus:"LexicalEditorTheme__embedBlockFocus"},hashtag:"LexicalEditorTheme__hashtag",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",hrSelected:"LexicalEditorTheme__hrSelected",indent:"LexicalEditorTheme__indent",inlineImage:"LexicalEditor__inline-image",link:"LexicalEditorTheme__link",list:{checklist:"LexicalEditorTheme__checklist",listitem:"LexicalEditorTheme__listItem",listitemChecked:"LexicalEditorTheme__listItemChecked",listitemUnchecked:"LexicalEditorTheme__listItemUnchecked",nested:{listitem:"LexicalEditorTheme__nestedListItem"},olDepth:["LexicalEditorTheme__ol1","LexicalEditorTheme__ol2","LexicalEditorTheme__ol3","LexicalEditorTheme__ol4","LexicalEditorTheme__ol5"],ul:"LexicalEditorTheme__ul"},ltr:"LexicalEditorTheme__ltr",mark:"LexicalEditorTheme__mark",markOverlap:"LexicalEditorTheme__markOverlap",paragraph:"LexicalEditorTheme__paragraph",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",rtl:"LexicalEditorTheme__rtl",tab:"LexicalEditorTheme__tabNode",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableAlignment:{center:"LexicalEditorTheme__tableAlignmentCenter",right:"LexicalEditorTheme__tableAlignmentRight"},tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableFrozenColumn:"LexicalEditorTheme__tableFrozenColumn",tableRowStriping:"LexicalEditorTheme__tableRowStriping",tableScrollableWrapper:"LexicalEditorTheme__tableScrollableWrapper",tableSelected:"LexicalEditorTheme__tableSelected",tableSelection:"LexicalEditorTheme__tableSelection",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"editor-upload"};var go={namespace:"lexical",theme:da};function ma({config:t,featureClientImportMap:e,featureClientSchemaMap:o,field:r,schemaPath:n,unSanitizedEditorConfig:l}){for(let c of l.features)if(!c?.clientFeatureProps?.featureKey||c?.clientFeatureProps?.order===void 0||c?.clientFeatureProps?.order===null)throw new Error("A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.");l.features=l.features.sort((c,d)=>c.clientFeatureProps.order-d.clientFeatureProps.order);let i=new Map;for(let c of l.features)i.set(c.clientFeatureProps.featureKey,c);let s=new Map,u=0;for(let c of l.features){let d=typeof c.feature=="function"?c.feature({config:t,featureClientImportMap:e,featureClientSchemaMap:o,featureProviderMap:i,field:r,resolvedFeatures:s,schemaPath:n,unSanitizedEditorConfig:l}):c.feature;d.key=c.clientFeatureProps.featureKey,d.order=u,s.set(c.clientFeatureProps.featureKey,d),u++}return s}import{deepMerge as rg}from"payload/shared";var pa=t=>{let e={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},o={};if(t.forEach(r=>{r.key==="toolbarFixed"&&r.sanitizedClientFeatureProps?.customGroups&&(o={...o,...r.sanitizedClientFeatureProps.customGroups})}),!t?.size)return e;t.forEach(r=>{if(r.providers?.length&&(e.providers=e.providers.concat(r.providers)),r.enableFormats?.length&&e.enabledFormats.push(...r.enableFormats),r.nodes?.length)for(let n of r.nodes)e.nodes.push(n);if(r.plugins?.length&&r.plugins.forEach((n,l)=>{e.plugins?.push({clientProps:r.sanitizedClientFeatureProps,Component:n.Component,key:r.key+l,position:n.position})}),r.toolbarInline?.groups?.length)for(let n of r.toolbarInline.groups){let l=e.toolbarInline.groups.find(i=>i.key===n.key);l?e.toolbarInline.groups=e.toolbarInline.groups.filter(i=>i.key!==n.key):l={...n,items:[]},n?.items?.length&&(l.items=l.items.concat(n.items)),e.toolbarInline?.groups.push(l)}if(r.toolbarFixed?.groups?.length)for(let n of r.toolbarFixed.groups){let l=e.toolbarFixed.groups.find(i=>i.key===n.key);l?e.toolbarFixed.groups=e.toolbarFixed.groups.filter(i=>i.key!==n.key):l={...n,items:[]},n?.items?.length&&(l.items=l.items.concat(n.items)),e.toolbarFixed?.groups.push(l)}if(r.slashMenu?.groups){r.slashMenu.dynamicGroups?.length&&(e.slashMenu.dynamicGroups=e.slashMenu.dynamicGroups.concat(r.slashMenu.dynamicGroups));for(let n of r.slashMenu.groups){let l=e.slashMenu.groups.find(i=>i.key===n.key);l?e.slashMenu.groups=e.slashMenu.groups.filter(i=>i.key!==n.key):l={...n,items:[]},n?.items?.length&&(l.items=l.items.concat(n.items)),e.slashMenu.groups.push(l)}}if(r.markdownTransformers?.length)for(let n of r.markdownTransformers)typeof n=="function"?e.markdownTransformers.push(n({allNodes:e.nodes,allTransformers:e.markdownTransformers})):e.markdownTransformers.push(n);e.enabledFeatures.push(r.key)}),Object.keys(o).length>0&&(e.toolbarFixed.groups=e.toolbarFixed.groups.map(r=>{let n=o[r.key];return n?rg(r,n):r})),e.toolbarInline.groups.sort((r,n)=>r.order&&n.order?r.order-n.order:r.order?-1:n.order?1:0),e.toolbarFixed.groups.sort((r,n)=>r.order&&n.order?r.order-n.order:r.order?-1:n.order?1:0);for(let r of e.toolbarInline.groups)r.items.sort((n,l)=>n.order&&l.order?n.order-l.order:n.order?-1:l.order?1:0);for(let r of e.toolbarFixed.groups)r.items.sort((n,l)=>n.order&&l.order?n.order-l.order:n.order?-1:l.order?1:0);return e};function Dr(t,e,o){return{admin:o,features:pa(t),lexical:e,resolvedFeatureMap:t}}var dg=sg(()=>import("./Field-SOED2PIU.js").then(t=>({default:t.RichText}))),mg=t=>{let e=ng(16),{admin:o,clientFeatures:r,featureClientImportMap:n,featureClientSchemaMap:l,field:i,lexicalEditorConfig:s,schemaPath:u}=t,c;e[0]!==o?(c=o===void 0?{}:o,e[0]=o,e[1]=c):c=e[1];let d=c,a=s===void 0?go:s,{config:p}=ig(),[m,f]=ug(null),h,g;e[2]!==d||e[3]!==r||e[4]!==p||e[5]!==n||e[6]!==l||e[7]!==i||e[8]!==m||e[9]!==a||e[10]!==u?(h=()=>{if(m)return;let T=[];for(let[_,x]of Object.entries(r))x.clientFeatureProvider&&T.push(x.clientFeatureProvider(x.clientFeatureProps));let v=a||go,k=ma({config:p,featureClientImportMap:n,featureClientSchemaMap:l,field:i,schemaPath:u??i.name,unSanitizedEditorConfig:{features:T,lexical:v}});f(Dr(k,v,d))},g=[a,d,m,r,n,l,i,p,u],e[2]=d,e[3]=r,e[4]=p,e[5]=n,e[6]=l,e[7]=i,e[8]=m,e[9]=a,e[10]=u,e[11]=h,e[12]=g):(h=e[11],g=e[12]),cg(h,g);let b;return e[13]!==m||e[14]!==t?(b=Ar(ag,{fallback:Ar(lg,{height:"35vh"}),children:m&&Ar(dg,{...t,editorConfig:m})}),e[13]=m,e[14]=t,e[15]=b):b=e[15],b};function pg(t){return t instanceof HTMLElement}function fg(...t){return t.filter(Boolean).join(" ")}var xo=new WeakMap;function fa(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function Co(t,e){let o=xo.get(t);if(o===void 0){let r=new Set,n=i=>{o!==void 0&&(o.start=fa(i))},l=i=>{if(o===void 0)return;let{start:s}=o;if(s===null)return;let u=fa(i);for(let c of r)u!==null&&c([u[0]-s[0],u[1]-s[1]],i)};t.addEventListener("touchstart",n),t.addEventListener("touchend",l),o={handleTouchend:l,handleTouchstart:n,listeners:r,start:null},xo.set(t,o)}return o.listeners.add(e),()=>{hg(t,e)}}function hg(t,e){let o=xo.get(t);if(o===void 0)return;let{listeners:r}=o;r.delete(e),r.size===0&&(xo.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function gg(t,e){return Co(t,(o,r)=>{let[n,l]=o;n<0&&-n>Math.abs(l)&&e(n,r)})}function xg(t,e){return Co(t,(o,r)=>{let[n,l]=o;n>0&&n>Math.abs(l)&&e(n,r)})}function Cg(t,e){return Co(t,(o,r)=>{let[n,l]=o;l<0&&-l>Math.abs(n)&&e(n,r)})}function bg(t,e){return Co(t,(o,r)=>{let[n,l]=o;l>0&&l>Math.abs(n)&&e(n,r)})}import{c as kg}from"react/compiler-runtime";import{jsx as _g}from"react/jsx-runtime";import"react";var Tg=()=>{let t=kg(2),{EditButton:e}=me(),o;return t[0]!==e?(o=e?_g(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as wg}from"react/compiler-runtime";import{jsx as Eg}from"react/jsx-runtime";import"react";var Ng=()=>{let t=wg(2),{RemoveButton:e}=me(),o;return t[0]!==e?(o=e?Eg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Sg}from"react/compiler-runtime";import{jsx as Lg}from"react/jsx-runtime";import"react";var yg=()=>{let t=Sg(2),{Label:e}=me(),o;return t[0]!==e?(o=e?Lg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Ig}from"react/compiler-runtime";import{jsx as Rg}from"react/jsx-runtime";import"react";var vg=t=>{let e=Ig(3),{children:o}=t,{InlineBlockContainer:r}=me(),n;return e[0]!==r||e[1]!==o?(n=r?Rg(r,{children:o}):null,e[0]=r,e[1]=o,e[2]=n):n=e[2],n};import{c as Mg}from"react/compiler-runtime";import{jsx as Dg}from"react/jsx-runtime";import"react";var Ag=t=>{let e=Mg(6),{children:o,editButton:r,Label:n,removeButton:l}=t,{BlockCollapsible:i}=Re(),s;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==r||e[4]!==l?(s=i?Dg(i,{editButton:r,Label:n,removeButton:l,children:o}):null,e[0]=i,e[1]=n,e[2]=o,e[3]=r,e[4]=l,e[5]=s):s=e[5],s};import{c as Og}from"react/compiler-runtime";import{jsx as $g}from"react/jsx-runtime";import"react";var Fg=()=>{let t=Og(2),{EditButton:e}=Re(),o;return t[0]!==e?(o=e?$g(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Pg}from"react/compiler-runtime";import{jsx as Bg}from"react/jsx-runtime";import"react";var Hg=()=>{let t=Pg(2),{RemoveButton:e}=Re(),o;return t[0]!==e?(o=e?Bg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{stringify as jg}from"qs-esm";var Ug=({apiURL:t,depth:e,draft:o,locale:r})=>async({id:l,collectionSlug:i,select:s})=>{let u=jg({depth:e??0,draft:o??!1,locale:r,select:s},{addQueryPrefix:!0});return await fetch(`${t}/${i}/${l}${u}`,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(d=>d.json())};export{pt as $createAutoLinkNode,Wt as $createBlockNode,_o as $createInlineBlockNode,he as $createLinkNode,$e as $createRelationshipNode,Pe as $createUploadNode,xe as $isAutoLinkNode,ct as $isBlockNode,To as $isInlineBlockNode,J as $isLinkNode,ar as $isRelationshipNode,Rr as $isUploadNode,La as AlignFeatureClient,ge as AutoLinkNode,Ag as BlockCollapsible,Fg as BlockEditButton,pe as BlockNode,Hg as BlockRemoveButton,Ma as BlockquoteFeatureClient,Ic as BlocksFeatureClient,qc as BoldFeatureClient,re as CAN_USE_DOM,qm as ChecklistFeatureClient,Up as DETAIL_TYPE_TO_DETAIL,Pp as DOUBLE_LINE_BREAK,Qp as DebugJsxConverterFeatureClient,Wp as ELEMENT_FORMAT_TO_TYPE,Gp as ELEMENT_TYPE_TO_FORMAT,ka as ENABLE_SLASH_MENU_COMMAND,ga as EditorConfigProvider,ot as FieldsDrawer,T0 as FixedToolbarFeatureClient,Vu as HeadingFeatureClient,ad as HorizontalRuleFeatureClient,Ge as INSERT_BLOCK_COMMAND,We as INSERT_INLINE_BLOCK_COMMAND,$p as IS_ALL_FORMATTING,Ed as IndentFeatureClient,vg as InlineBlockContainer,Tg as InlineBlockEditButton,yg as InlineBlockLabel,ko as InlineBlockNode,Ng as InlineBlockRemoveButton,ru as InlineCodeFeatureClient,D0 as InlineToolbarFeatureClient,su as ItalicFeatureClient,Hp as LTR_REGEX,kp as LexicalPluginToLexicalFeatureClient,Fm as LinkFeatureClient,ee as LinkNode,Fp as NON_BREAKING_SPACE,A as NodeFormat,ip as OrderedListFeatureClient,yp as ParagraphFeatureClient,Ca as Point,Bp as RTL_REGEX,_a as Rect,Hf as RelationshipFeatureClient,be as RelationshipNode,mg as RichTextField,Sp as SlateToLexicalFeatureClient,mu as StrikethroughFeatureClient,gu as SubscriptFeatureClient,ku as SuperscriptFeatureClient,Vp as TEXT_MODE_TO_TYPE,jp as TEXT_TYPE_TO_FORMAT,Kp as TEXT_TYPE_TO_MODE,ae as TOGGLE_LINK_COMMAND,Eh as TableFeatureClient,Gc as TestRecorderFeatureClient,$u as TextStateFeatureClient,Et as ToolbarButton,Fe as ToolbarDropdown,Xc as TreeViewFeatureClient,Nu as UnderlineFeatureClient,fp as UnorderedListFeatureClient,og as UploadFeatureClient,Te as UploadNode,bg as addSwipeDownListener,gg as addSwipeLeftListener,xg as addSwipeRightListener,Cg as addSwipeUpListener,Ho as createBlockNode,y as createClientFeature,ef as defaultColors,go as defaultEditorLexicalConfig,pr as getDOMRangeRect,Ta as getEnabledNodes,Ug as getRestPopulateFn,Ve as getSelectedNode,pg as isHTMLElement,ba as isPoint,fg as joinClasses,Dr as sanitizeClientEditorConfig,pa as sanitizeClientFeatures,lo as setFloatingElemPosition,Qt as setFloatingElemPositionForLinkEditor,Z as slashMenuBasicGroupWithItems,fe as toolbarAddDropdownGroupWithItems,Uo as toolbarFeatureButtonsGroupWithItems,Y as toolbarFormatGroupWithItems,Q as toolbarTextDropdownGroupWithItems,Re as useBlockComponentContext,H as useEditorConfigContext,me as useInlineBlockComponentContext,xa as useLexicalDocumentDrawer,de as useLexicalDrawer,wt as useLexicalListDrawer};
|
|
38
|
+
`,Pi="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Bi="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Up=new RegExp("^[^"+Bi+"]*["+Pi+"]"),Gp=new RegExp("^[^"+Pi+"]*["+Bi+"]"),Wp={bold:A.IS_BOLD,code:A.IS_CODE,highlight:A.IS_HIGHLIGHT,italic:A.IS_ITALIC,strikethrough:A.IS_STRIKETHROUGH,subscript:A.IS_SUBSCRIPT,superscript:A.IS_SUPERSCRIPT,underline:A.IS_UNDERLINE},Vp={directionless:A.IS_DIRECTIONLESS,unmergeable:A.IS_UNMERGEABLE},Kp={center:A.IS_ALIGN_CENTER,end:A.IS_ALIGN_END,justify:A.IS_ALIGN_JUSTIFY,left:A.IS_ALIGN_LEFT,right:A.IS_ALIGN_RIGHT,start:A.IS_ALIGN_START},Jp={[A.IS_ALIGN_CENTER]:"center",[A.IS_ALIGN_END]:"end",[A.IS_ALIGN_JUSTIFY]:"justify",[A.IS_ALIGN_LEFT]:"left",[A.IS_ALIGN_RIGHT]:"right",[A.IS_ALIGN_START]:"start"},Xp={normal:A.IS_NORMAL,segmented:A.IS_SEGMENTED,token:A.IS_TOKEN},zp={[A.IS_NORMAL]:"normal",[A.IS_SEGMENTED]:"segmented",[A.IS_TOKEN]:"token"};var Hi={text:({node:t})=>{let e=t.text;return t.format&A.IS_BOLD&&(e=Oe("strong",{children:e})),t.format&A.IS_ITALIC&&(e=Oe("em",{children:e})),t.format&A.IS_STRIKETHROUGH&&(e=Oe("span",{style:{textDecoration:"line-through"},children:e})),t.format&A.IS_UNDERLINE&&(e=Oe("span",{style:{textDecoration:"underline"},children:e})),t.format&A.IS_CODE&&(e=Oe("code",{children:e})),t.format&A.IS_SUBSCRIPT&&(e=Oe("sub",{children:e})),t.format&A.IS_SUPERSCRIPT&&(e=Oe("sup",{children:e})),e}};import{jsx as _t}from"react/jsx-runtime";var ji={upload:({node:t})=>{let e=t;if(typeof e.value!="object")return null;let o=e.value,r=o.url;if(!o.mimeType.startsWith("image"))return _t("a",{href:r,rel:"noopener noreferrer",children:o.filename});if(!o.sizes||!Object.keys(o.sizes).length)return _t("img",{alt:o.filename,height:o.height,src:r,width:o.width});let n=[];for(let l in o.sizes){let i=o.sizes[l];if(!i||!i.width||!i.height||!i.mimeType||!i.filesize||!i.filename||!i.url)continue;let s=i?.url;n.push(_t("source",{media:`(max-width: ${i.width}px)`,srcSet:s,type:i.mimeType},l))}return n.push(_t("img",{alt:o?.filename,height:o?.height,src:r,width:o?.width},"image")),_t("picture",{children:n})}};var Ye={...Oi,...Hi,...vi,...yi,...$i,...Ii,...Ri,...Ai,...Di({}),...ji,...Fi};import{jsx as Gi,Fragment as Zp}from"react/jsx-runtime";import ir from"react";function Ui(t){let e=!!t?.root?.children?.length,o=!1;if(t?.root?.children?.length===1&&t?.root?.children[0]?.type==="paragraph"){let r=t?.root?.children[0];if(!r?.children||r?.children?.length===0)o=!0;else if(r?.children?.length===1){let n=r?.children[0];n?.type==="text"&&(n?.text?.length||(o=!0))}}return!(!e||o)}function Wi({converters:t,data:e,disableIndent:o,disableTextAlign:r}){return Ui(e)?Vi({converters:t,disableIndent:o,disableTextAlign:r,nodes:e?.root?.children,parent:e?.root}):Gi(Zp,{})}function Vi({converters:t,disableIndent:e,disableTextAlign:o,nodes:r,parent:n}){let l=t.unknown;return r.map((s,u)=>{let c;s.type==="block"?(c=t?.blocks?.[s?.fields?.blockType],!c&&!l&&console.error(`Lexical => JSX converter: Blocks converter: found ${s?.fields?.blockType} block, but no converter is provided`)):s.type==="inlineBlock"?(c=t?.inlineBlocks?.[s?.fields?.blockType],!c&&!l&&console.error(`Lexical => JSX converter: Inline Blocks converter: found ${s?.fields?.blockType} inline block, but no converter is provided`)):c=t[s.type];try{!c&&l&&(c=l);let d;c?d=typeof c=="function"?c({childIndex:u,converters:t,node:s,nodesToJSX:m=>Vi({converters:m.converters??t,disableIndent:m.disableIndent??e,disableTextAlign:m.disableTextAlign??o,nodes:m.nodes,parent:m.parent??{...s,parent:n}}),parent:n}):c:d=Gi("span",{children:"unknown node"},u);let a={};if(!o&&(!Array.isArray(o)||!o?.includes(s.type))&&"format"in s&&s.format)switch(s.format){case"center":a.textAlign="center";break;case"end":a.textAlign="right";break;case"justify":a.textAlign="justify";break;case"left":break;case"right":a.textAlign="right";break;case"start":a.textAlign="left";break}if(!e&&(!Array.isArray(e)||!e?.includes(s.type))&&"indent"in s&&s.indent&&s.type!=="listitem"&&(a.paddingInlineStart=`${Number(s.indent)*40}px`),ir.isValidElement(d)){if(a.textAlign||a.paddingInlineStart){let p={...a,...d?.props?.style??{}};return ir.cloneElement(d,{key:u,style:p})}return ir.cloneElement(d,{key:u})}return d}catch(d){return console.error("Error converting lexical node to JSX:",d,"node:",s),null}}).filter(Boolean)}var sr=({className:t,converters:e,data:o,disableContainer:r,disableIndent:n,disableTextAlign:l})=>{if(!o)return null;let i={};e?typeof e=="function"?i=e({defaultConverters:Ye}):i=e:i=Ye;let s=o&&!Array.isArray(o)&&typeof o=="object"&&"root"in o&&Wi({converters:i,data:o,disableIndent:n,disableTextAlign:l});return r?Ki(Yp,{children:s}):Ki("div",{className:t??"payload-richtext",children:s})};function Xi(){let t=qp(7),[e]=Qp(),o;t[0]!==e?(o=e.getEditorState().toJSON(),t[0]=e,t[1]=o):o=t[1];let[r,n]=tf(o),l,i;t[2]!==e?(l=()=>e.registerUpdateListener(u=>{let{editorState:c}=u;n(c.toJSON())}),i=[e],t[2]=e,t[3]=l,t[4]=i):(l=t[3],i=t[4]),ef(l,i);let s;return t[5]!==r?(s=Ji("div",{className:"debug-jsx-converter",children:Ji(sr,{converters:Ye,data:r})}),t[5]=r,t[6]=s):s=t[6],s}var of=y({plugins:[{Component:Xi,position:"bottom"}]});var B={amber:{50:"oklch(0.987 0.022 95.277)",100:"oklch(0.962 0.059 95.617)",200:"oklch(0.924 0.12 95.746)",300:"oklch(0.879 0.169 91.605)",400:"oklch(0.828 0.189 84.429)",500:"oklch(0.769 0.188 70.08)",600:"oklch(0.666 0.179 58.318)",700:"oklch(0.555 0.163 48.998)",800:"oklch(0.473 0.137 46.201)",900:"oklch(0.414 0.112 45.904)",950:"oklch(0.279 0.077 45.635)"},black:"#000",blue:{50:"oklch(0.97 0.014 254.604)",100:"oklch(0.932 0.032 255.585)",200:"oklch(0.882 0.059 254.128)",300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)",800:"oklch(0.424 0.199 265.638)",900:"oklch(0.379 0.146 265.522)",950:"oklch(0.282 0.091 267.935)"},current:"currentColor",cyan:{50:"oklch(0.984 0.019 200.873)",100:"oklch(0.956 0.045 203.388)",200:"oklch(0.917 0.08 205.041)",300:"oklch(0.865 0.127 207.078)",400:"oklch(0.789 0.154 211.53)",500:"oklch(0.715 0.143 215.221)",600:"oklch(0.609 0.126 221.723)",700:"oklch(0.52 0.105 223.128)",800:"oklch(0.45 0.085 224.283)",900:"oklch(0.398 0.07 227.392)",950:"oklch(0.302 0.056 229.695)"},emerald:{50:"oklch(0.979 0.021 166.113)",100:"oklch(0.95 0.052 163.051)",200:"oklch(0.905 0.093 164.15)",300:"oklch(0.845 0.143 164.978)",400:"oklch(0.765 0.177 163.223)",500:"oklch(0.696 0.17 162.48)",600:"oklch(0.596 0.145 163.225)",700:"oklch(0.508 0.118 165.612)",800:"oklch(0.432 0.095 166.913)",900:"oklch(0.378 0.077 168.94)",950:"oklch(0.262 0.051 172.552)"},fuchsia:{50:"oklch(0.977 0.017 320.058)",100:"oklch(0.952 0.037 318.852)",200:"oklch(0.903 0.076 319.62)",300:"oklch(0.833 0.145 321.434)",400:"oklch(0.74 0.238 322.16)",500:"oklch(0.667 0.295 322.15)",600:"oklch(0.591 0.293 322.896)",700:"oklch(0.518 0.253 323.949)",800:"oklch(0.452 0.211 324.591)",900:"oklch(0.401 0.17 325.612)",950:"oklch(0.293 0.136 325.661)"},gray:{50:"oklch(0.985 0.002 247.839)",100:"oklch(0.967 0.003 264.542)",200:"oklch(0.928 0.006 264.531)",300:"oklch(0.872 0.01 258.338)",400:"oklch(0.707 0.022 261.325)",500:"oklch(0.551 0.027 264.364)",600:"oklch(0.446 0.03 256.802)",700:"oklch(0.373 0.034 259.733)",800:"oklch(0.278 0.033 256.848)",900:"oklch(0.21 0.034 264.665)",950:"oklch(0.13 0.028 261.692)"},green:{50:"oklch(0.982 0.018 155.826)",100:"oklch(0.962 0.044 156.743)",200:"oklch(0.925 0.084 155.995)",300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)",800:"oklch(0.448 0.119 151.328)",900:"oklch(0.393 0.095 152.535)",950:"oklch(0.266 0.065 152.934)"},indigo:{50:"oklch(0.962 0.018 272.314)",100:"oklch(0.93 0.034 272.788)",200:"oklch(0.87 0.065 274.039)",300:"oklch(0.785 0.115 274.713)",400:"oklch(0.673 0.182 276.935)",500:"oklch(0.585 0.233 277.117)",600:"oklch(0.511 0.262 276.966)",700:"oklch(0.457 0.24 277.023)",800:"oklch(0.398 0.195 277.366)",900:"oklch(0.359 0.144 278.697)",950:"oklch(0.257 0.09 281.288)"},inherit:"inherit",lime:{50:"oklch(0.986 0.031 120.757)",100:"oklch(0.967 0.067 122.328)",200:"oklch(0.938 0.127 124.321)",300:"oklch(0.897 0.196 126.665)",400:"oklch(0.841 0.238 128.85)",500:"oklch(0.768 0.233 130.85)",600:"oklch(0.648 0.2 131.684)",700:"oklch(0.532 0.157 131.589)",800:"oklch(0.453 0.124 130.933)",900:"oklch(0.405 0.101 131.063)",950:"oklch(0.274 0.072 132.109)"},neutral:{50:"oklch(0.985 0 0)",100:"oklch(0.97 0 0)",200:"oklch(0.922 0 0)",300:"oklch(0.87 0 0)",400:"oklch(0.708 0 0)",500:"oklch(0.556 0 0)",600:"oklch(0.439 0 0)",700:"oklch(0.371 0 0)",800:"oklch(0.269 0 0)",900:"oklch(0.205 0 0)",950:"oklch(0.145 0 0)"},orange:{50:"oklch(0.98 0.016 73.684)",100:"oklch(0.954 0.038 75.164)",200:"oklch(0.901 0.076 70.697)",300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)",800:"oklch(0.47 0.157 37.304)",900:"oklch(0.408 0.123 38.172)",950:"oklch(0.266 0.079 36.259)"},pink:{50:"oklch(0.971 0.014 343.198)",100:"oklch(0.948 0.028 342.258)",200:"oklch(0.899 0.061 343.231)",300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)",800:"oklch(0.459 0.187 3.815)",900:"oklch(0.408 0.153 2.432)",950:"oklch(0.284 0.109 3.907)"},purple:{50:"oklch(0.977 0.014 308.299)",100:"oklch(0.946 0.033 307.174)",200:"oklch(0.902 0.063 306.703)",300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)",800:"oklch(0.438 0.218 303.724)",900:"oklch(0.381 0.176 304.987)",950:"oklch(0.291 0.149 302.717)"},red:{50:"oklch(0.971 0.013 17.38)",100:"oklch(0.936 0.032 17.717)",200:"oklch(0.885 0.062 18.334)",300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)",800:"oklch(0.444 0.177 26.899)",900:"oklch(0.396 0.141 25.723)",950:"oklch(0.258 0.092 26.042)"},rose:{50:"oklch(0.969 0.015 12.422)",100:"oklch(0.941 0.03 12.58)",200:"oklch(0.892 0.058 10.001)",300:"oklch(0.81 0.117 11.638)",400:"oklch(0.712 0.194 13.428)",500:"oklch(0.645 0.246 16.439)",600:"oklch(0.586 0.253 17.585)",700:"oklch(0.514 0.222 16.935)",800:"oklch(0.455 0.188 13.697)",900:"oklch(0.41 0.159 10.272)",950:"oklch(0.271 0.105 12.094)"},sky:{50:"oklch(0.977 0.013 236.62)",100:"oklch(0.951 0.026 236.824)",200:"oklch(0.901 0.058 230.902)",300:"oklch(0.828 0.111 230.318)",400:"oklch(0.746 0.16 232.661)",500:"oklch(0.685 0.169 237.323)",600:"oklch(0.588 0.158 241.966)",700:"oklch(0.5 0.134 242.749)",800:"oklch(0.443 0.11 240.79)",900:"oklch(0.391 0.09 240.876)",950:"oklch(0.293 0.066 243.157)"},slate:{50:"oklch(0.984 0.003 247.858)",100:"oklch(0.968 0.007 247.896)",200:"oklch(0.929 0.013 255.508)",300:"oklch(0.869 0.022 252.894)",400:"oklch(0.704 0.04 256.788)",500:"oklch(0.554 0.046 257.417)",600:"oklch(0.446 0.043 257.281)",700:"oklch(0.372 0.044 257.287)",800:"oklch(0.279 0.041 260.031)",900:"oklch(0.208 0.042 265.755)",950:"oklch(0.129 0.042 264.695)"},stone:{50:"oklch(0.985 0.001 106.423)",100:"oklch(0.97 0.001 106.424)",200:"oklch(0.923 0.003 48.717)",300:"oklch(0.869 0.005 56.366)",400:"oklch(0.709 0.01 56.259)",500:"oklch(0.553 0.013 58.071)",600:"oklch(0.444 0.011 73.639)",700:"oklch(0.374 0.01 67.558)",800:"oklch(0.268 0.007 34.298)",900:"oklch(0.216 0.006 56.043)",950:"oklch(0.147 0.004 49.25)"},teal:{50:"oklch(0.984 0.014 180.72)",100:"oklch(0.953 0.051 180.801)",200:"oklch(0.91 0.096 180.426)",300:"oklch(0.855 0.138 181.071)",400:"oklch(0.777 0.152 181.912)",500:"oklch(0.704 0.14 182.503)",600:"oklch(0.6 0.118 184.704)",700:"oklch(0.511 0.096 186.391)",800:"oklch(0.437 0.078 188.216)",900:"oklch(0.386 0.063 188.416)",950:"oklch(0.277 0.046 192.524)"},transparent:"transparent",violet:{50:"oklch(0.969 0.016 293.756)",100:"oklch(0.943 0.029 294.588)",200:"oklch(0.894 0.057 293.283)",300:"oklch(0.811 0.111 293.571)",400:"oklch(0.702 0.183 293.541)",500:"oklch(0.606 0.25 292.717)",600:"oklch(0.541 0.281 293.009)",700:"oklch(0.491 0.27 292.581)",800:"oklch(0.432 0.232 292.759)",900:"oklch(0.38 0.189 293.745)",950:"oklch(0.283 0.141 291.089)"},white:"#fff",yellow:{50:"oklch(0.987 0.026 102.212)",100:"oklch(0.973 0.071 103.193)",200:"oklch(0.945 0.129 101.54)",300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",800:"oklch(0.476 0.114 61.907)",900:"oklch(0.421 0.095 57.708)",950:"oklch(0.286 0.066 53.813)"},zinc:{50:"oklch(0.985 0 0)",100:"oklch(0.967 0.001 286.375)",200:"oklch(0.92 0.004 286.32)",300:"oklch(0.871 0.006 286.286)",400:"oklch(0.705 0.015 286.067)",500:"oklch(0.552 0.016 285.938)",600:"oklch(0.442 0.017 285.786)",700:"oklch(0.37 0.013 285.805)",800:"oklch(0.274 0.006 286.033)",900:"oklch(0.21 0.006 285.885)",950:"oklch(0.141 0.005 285.823)"}},rf={text:{"text-red":{css:{color:`light-dark(${B.red[600]}, ${B.red[400]})`},label:"Red"},"text-orange":{css:{color:`light-dark(${B.orange[600]}, ${B.orange[400]})`},label:"Orange"},"text-yellow":{css:{color:`light-dark(${B.yellow[700]}, ${B.yellow[300]})`},label:"Yellow"},"text-green":{css:{color:`light-dark(${B.green[700]}, ${B.green[400]})`},label:"Green"},"text-blue":{css:{color:`light-dark(${B.blue[600]}, ${B.blue[400]})`},label:"Blue"},"text-purple":{css:{color:`light-dark(${B.purple[600]}, ${B.purple[400]})`},label:"Purple"},"text-pink":{css:{color:`light-dark(${B.pink[600]}, ${B.pink[400]})`},label:"Pink"}},background:{"bg-red":{css:{"background-color":`light-dark(${B.red[400]}, ${B.red[600]})`},label:"Red"},"bg-orange":{css:{"background-color":`light-dark(${B.orange[400]}, ${B.orange[600]})`},label:"Orange"},"bg-yellow":{css:{"background-color":`light-dark(${B.yellow[300]}, ${B.yellow[700]})`},label:"Yellow"},"bg-green":{css:{"background-color":`light-dark(${B.green[400]}, ${B.green[700]})`},label:"Green"},"bg-blue":{css:{"background-color":`light-dark(${B.blue[400]}, ${B.blue[600]})`},label:"Blue"},"bg-purple":{css:{"background-color":`light-dark(${B.purple[400]}, ${B.purple[600]})`},label:"Purple"},"bg-pink":{css:{"background-color":`light-dark(${B.pink[400]}, ${B.pink[600]})`},label:"Pink"}}};import{$isNodeSelection as Uf}from"lexical";import{jsx as Tt,jsxs as nf}from"react/jsx-runtime";import"react";var ar=()=>nf("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Tt("g",{clipPath:"url(#clip0_4397_10817)",children:Tt("path",{d:"M7.75 12.25L15.25 4.75M15.25 4.75H11.5M15.25 4.75V8.5M13 11.5V13.75C13 14.5784 12.3284 15.25 11.5 15.25H6.25C5.42157 15.25 4.75 14.5784 4.75 13.75V8.5C4.75 7.67157 5.42157 7 6.25 7H8.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),Tt("defs",{children:Tt("clipPath",{id:"clip0_4397_10817",children:Tt("rect",{fill:"currentColor",height:"12",transform:"translate(4 4)",width:"12"})})})]});import{jsx as af}from"react/jsx-runtime";import*as Zi from"react";import{DecoratorBlockNode as lf}from"@lexical/react/LexicalDecoratorBlockNode.js";function sf(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:zi({relationTo:o,value:e})}:null}var wt=class extends lf{__data;constructor({data:e,format:o,key:r}){super(o,r),this.__data=e}static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"relationship"}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:sf,priority:2}}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id);let o={relationTo:e.relationTo,value:e.value},r=zi(o);return r.setFormat(e.format),r}static isInline(){return!1}decorate(e,o){return null}exportDOM(){let e=document.createElement("div");e.setAttribute("data-lexical-relationship-id",String(typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value)),e.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship",version:2}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value}`}setData(e){let o=this.getWritable();o.__data=e}};function zi(t){return new wt({data:t})}var cf=Zi.lazy(()=>import("./RelationshipComponent-APF3CN47.js").then(t=>({default:t.RelationshipComponent})));function uf(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:Fe({relationTo:o,value:e})}:null}var be=class extends wt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:uf,priority:2}}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id);let o={relationTo:e.relationTo,value:e.value},r=Fe(o);return r.setFormat(e.format),r}decorate(e,o){return af(cf,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Fe(t){return new be({data:t})}function cr(t){return t instanceof be}import{c as yf}from"react/compiler-runtime";import{jsx as If}from"react/jsx-runtime";import{useLexicalComposerContext as Rf}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as vf}from"@lexical/utils";import{useConfig as Mf}from"@payloadcms/ui";import{$getPreviousSelection as Df,$getSelection as Af,$isParagraphNode as Of,$isRangeSelection as Ff,COMMAND_PRIORITY_EDITOR as $f,createCommand as Pf}from"lexical";import{useEffect as Bf}from"react";import{c as Tf}from"react/compiler-runtime";import{jsx as ro}from"react/jsx-runtime";import{useLexicalComposerContext as wf}from"@lexical/react/LexicalComposerContext.js";import{$getNodeByKey as Ef,COMMAND_PRIORITY_EDITOR as Sf}from"lexical";import{useEffect as Nf,useState as Qi}from"react";import{c as df}from"react/compiler-runtime";import{jsx as mf}from"react/jsx-runtime";import{useLexicalComposerContext as pf}from"@lexical/react/LexicalComposerContext";import{useListDrawer as ff,useModal as hf}from"@payloadcms/ui";import{$getNodeByKey as Yi,$getPreviousSelection as gf,$getRoot as xf,$getSelection as Cf,$isRangeSelection as bf,$setSelection as kf}from"lexical";import{useEffect as _f,useState as qi}from"react";var Et=t=>{let e=df(23),[o]=pf(),[r,n]=qi(null),[l,i]=qi(!1),[s,u,c]=ff(t),{closeDrawer:d,drawerSlug:a,isDrawerOpen:p,openDrawer:m}=c,{modalState:f}=hf(),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{let F=Cf()??gf();n(F)},e[0]=h):h=e[0];let g=h,k;e[1]!==o||e[2]!==r?(k=()=>{r&&o.update(()=>{if(bf(r)){let{anchor:F,focus:R}=r;Yi(F.key)&&Yi(R.key)&&kf(r.clone())}else xf().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=r,e[3]=k):k=e[3];let T=k,I;e[4]!==d?(I=()=>{d()},e[4]=d,e[5]=I):I=e[5];let b=I,_,x;e[6]!==a||e[7]!==f||e[8]!==T||e[9]!==l?(_=()=>{if(!l)return;let F=f[a];F&&!F?.isOpen&&(i(!1),setTimeout(()=>{T()},1))},x=[f,a,T,l],e[6]=a,e[7]=f,e[8]=T,e[9]=l,e[10]=_,e[11]=x):(_=e[10],x=e[11]),_f(_,x);let w;e[12]!==u?(w=F=>mf(u,{...F,onClick:()=>{g()}}),e[12]=u,e[13]=w):w=e[13];let v;e[14]!==m?(v=()=>{g(),m(),i(!0)},e[14]=m,e[15]=v):v=e[15];let O;return e[16]!==s||e[17]!==b||e[18]!==p||e[19]!==a||e[20]!==w||e[21]!==v?(O={closeListDrawer:b,isListDrawerOpen:p,ListDrawer:s,listDrawerSlug:a,ListDrawerToggler:w,openListDrawer:v},e[16]=s,e[17]=b,e[18]=p,e[19]=a,e[20]=w,e[21]=v,e[22]=O):O=e[22],O};var Lf=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=Ef(o);n&&n.replace(Fe({relationTo:e,value:r}))}):t.dispatchCommand(ur,{relationTo:e,value:r})},es=t=>{let e=Tf(16),{enabledCollectionSlugs:o}=t,[r]=wf(),n;e[0]!==o?.[0]?(n=()=>o?.[0],e[0]=o?.[0],e[1]=n):n=e[1];let[l]=Qi(n),[i,s]=Qi(null),u=o||void 0,c;e[2]!==l||e[3]!==u?(c={collectionSlugs:u,selectedCollection:l},e[2]=l,e[3]=u,e[4]=c):c=e[4];let{closeListDrawer:d,ListDrawer:a,openListDrawer:p}=Et(c),m,f;e[5]!==r||e[6]!==p?(m=()=>r.registerCommand(nt,T=>(s(T?.replace?T?.replace.nodeKey:null),p(),!0),Sf),f=[r,p],e[5]=r,e[6]=p,e[7]=m,e[8]=f):(m=e[7],f=e[8]),Nf(m,f);let h;e[9]!==d||e[10]!==r||e[11]!==i?(h=T=>{let{collectionSlug:I,doc:b}=T;Lf({editor:r,relationTo:I,replaceNodeKey:i,value:b.id}),d()},e[9]=d,e[10]=r,e[11]=i,e[12]=h):h=e[12];let g=h,k;return e[13]!==a||e[14]!==g?(k=ro(a,{onSelect:g}),e[13]=a,e[14]=g,e[15]=k):k=e[15],k},ts=t=>(t?.enabledCollectionSlugs?.length??-1)>0?ro(es,{...t}):ro(At,{...t,children:ro(es,{...t})});var ur=Pf("INSERT_RELATIONSHIP_COMMAND"),os=t=>{let e=yf(5),{clientProps:o}=t,[r]=Rf(),{config:n}=Mf(),{collections:l}=n,i=null;if(o?.enabledCollections)i=o?.enabledCollections;else if(o?.disabledCollections){let c;e[0]!==o?.disabledCollections?(c=d=>{let{slug:a}=d;return!o?.disabledCollections?.includes(a)},e[0]=o?.disabledCollections,e[1]=c):c=e[1],i=l.filter(c).map(Hf)}let s,u;return e[2]!==r?(s=()=>{if(!r.hasNodes([be]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return r.registerCommand(ur,jf,$f)},u=[r],e[2]=r,e[3]=s,e[4]=u):(s=e[3],u=e[4]),Bf(s,u),If(ts,{enabledCollectionSlugs:i})};function Hf(t){let{slug:e}=t;return e}function jf(t){let e=Af()||Df();if(Ff(e)){let o=Fe(t),{focus:r}=e,n=r.getNode();vf(o),Of(n)&&!n.__first&&n.remove()}return!0}var Gf=y({nodes:[be],plugins:[{Component:os,position:"normal"}],slashMenu:{groups:[Z([{Icon:ar,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(nt,{replace:!1})}}])]},toolbarFixed:{groups:[fe([{ChildComponent:ar,isActive:({selection:t})=>{if(!Uf(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return cr(e)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(nt,{replace:!1})}}])]}});import{c as ds}from"react/compiler-runtime";import{jsx as le,jsxs as g0}from"react/jsx-runtime";import{useLexicalComposerContext as x0}from"@lexical/react/LexicalComposerContext.js";import{useScrollInfo as C0,useThrottledEffect as b0,useTranslation as k0}from"@payloadcms/ui";import*as ke from"react";import{useMemo as _0}from"react";import{c as Wf}from"react/compiler-runtime";import{jsx as Vf}from"react/jsx-runtime";import{mergeRegister as Kf}from"@lexical/utils";import{$addUpdateTag as Jf,$getSelection as Xf}from"lexical";import{useDeferredValue as zf,useEffect as Zf,useState as Yf}from"react";var rs="toolbar-popup__button",St=t=>{let e=Wf(23),{children:o,editor:r,item:n}=t,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={active:!1,enabled:!0},e[0]=l):l=e[0];let[i,s]=Yf(l),u=zf(i),c=H(),d=u.enabled?"":"disabled",a=u.active?"active":"",p=n.key?`${rs}-${n.key}`:"",m;e[1]!==d||e[2]!==a||e[3]!==p?(m=[rs,d,a,p].filter(Boolean),e[1]=d,e[2]=a,e[3]=p,e[4]=m):m=e[4];let f=m.join(" "),h;e[5]!==r||e[6]!==c||e[7]!==n?(h=()=>{r.getEditorState().read(()=>{let v=Xf();if(!v)return;let O=n.isActive?n.isActive({editor:r,editorConfigContext:c,selection:v}):!1,F=n.isEnabled?n.isEnabled({editor:r,editorConfigContext:c,selection:v}):!0;s(R=>R.active===O&&R.enabled===F?R:{active:O,enabled:F})})},e[5]=r,e[6]=c,e[7]=n,e[8]=h):h=e[8];let g=h,k=Ot(),T,I;e[9]!==r||e[10]!==k||e[11]!==g?(T=()=>{k(g);let v=()=>k(g),O=Kf(r.registerUpdateListener(v));return document.addEventListener("mouseup",v),()=>{O(),document.removeEventListener("mouseup",v)}},I=[r,k,g],e[9]=r,e[10]=k,e[11]=g,e[12]=T,e[13]=I):(T=e[12],I=e[13]),Zf(T,I);let b;e[14]!==i||e[15]!==r||e[16]!==n?(b=()=>{i.enabled&&r.focus(()=>{r.update(qf),n.onSelect?.({editor:r,isActive:i.active})})},e[14]=i,e[15]=r,e[16]=n,e[17]=b):b=e[17];let _=b,x=Qf,w;return e[18]!==o||e[19]!==f||e[20]!==_||e[21]!==n.key?(w=Vf("button",{className:f,"data-button-key":n.key,onClick:_,onMouseDown:x,type:"button",children:o}),e[18]=o,e[19]=f,e[20]=_,e[21]=n.key,e[22]=w):w=e[22],w};function qf(){Jf("toolbar")}function Qf(t){t.preventDefault()}import{c as i0}from"react/compiler-runtime";import{jsx as qe}from"react/jsx-runtime";import us,{useCallback as s0,useDeferredValue as a0,useEffect as c0,useMemo as u0}from"react";import{mergeRegister as d0}from"@lexical/utils";import{useTranslation as m0}from"@payloadcms/ui";import{$getSelection as p0}from"lexical";import{jsx as Le,jsxs as ns}from"react/jsx-runtime";import{Button as e0}from"@payloadcms/ui";import{$addUpdateTag as t0,isDOMNode as o0}from"lexical";import no,{useCallback as r0,useEffect as lo,useMemo as is,useRef as dr,useState as mr}from"react";import{createPortal as n0}from"react-dom";var ls="toolbar-popup__dropdown-item",ss=no.createContext(null);function as({active:t,children:e,editor:o,enabled:r,Icon:n,item:l,itemKey:i,tooltip:s}){let u=is(()=>[ls,r===!1?"disabled":"",t?"active":"",l?.key?`${ls}-${l.key}`:""].filter(Boolean).join(" "),[r,t,l.key]),c=dr(null),d=no.use(ss);if(d===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:a}=d;return lo(()=>{c?.current!=null&&a(c)},[c,a]),Le(e0,{"aria-label":s,buttonStyle:"none",className:u,disabled:r===!1,extraButtonProps:{"data-item-key":i},icon:n,iconPosition:"left",iconStyle:"none",onClick:()=>{r!==!1&&o.focus(()=>{o.update(()=>{t0("toolbar")}),l.onSelect?.({editor:o,isActive:t})})},onMouseDown:p=>{p.preventDefault()},ref:c,tooltip:s,type:"button",children:e})}function l0({children:t,dropDownRef:e,itemsContainerClassNames:o,onClose:r}){let[n,l]=mr(),[i,s]=mr(),u=r0(a=>{l(p=>p!=null?[...p,a]:[a])},[l]),c=a=>{if(n==null)return;let{key:p}=a;["ArrowDown","ArrowUp","Escape","Tab"].includes(p)&&a.preventDefault(),p==="Escape"||p==="Tab"?r():p==="ArrowUp"?s(m=>{if(m==null)return n[0];let f=n.indexOf(m)-1;return n[f===-1?n.length-1:f]}):p==="ArrowDown"&&s(m=>m==null?n[0]:n[n.indexOf(m)+1])},d=is(()=>({registerItem:u}),[u]);return lo(()=>{n!=null&&i==null&&s(n[0]),i!=null&&i?.current!=null&&i.current.focus()},[n,i]),Le(ss,{value:d,children:Le("div",{className:(o??["toolbar-popup__dropdown-items"]).join(" "),onKeyDown:c,ref:e,children:t})})}function cs({buttonAriaLabel:t,buttonClassName:e,children:o,disabled:r=!1,dropdownKey:n,Icon:l,itemsContainerClassNames:i,label:s,stopCloseOnClickSelf:u}){let c=dr(null),d=dr(null),[a,p]=mr(!1),m=()=>{p(!1),d?.current!=null&&d.current.focus()};lo(()=>{let h=d.current,g=c.current;if(a&&h!==null&&g!==null){let{left:k,top:T}=h.getBoundingClientRect(),I=window.scrollY||document.documentElement.scrollTop;g.style.top=`${T+I+h.offsetHeight+5}px`,g.style.left=`${Math.min(k-5,window.innerWidth-g.offsetWidth-20)}px`}},[c,d,a]),lo(()=>{let h=d.current;if(h!==null&&a){let g=k=>{let T=k.target;o0(T)&&(u&&c.current&&c.current.contains(T)||h.contains(T)||p(!1))};return document.addEventListener("click",g),()=>{document.removeEventListener("click",g)}}},[c,d,a,u]);let f=n0(Le(l0,{dropDownRef:c,itemsContainerClassNames:i,onClose:m,children:o}),document.body);return ns(no.Fragment,{children:[ns("button",{"aria-label":t,className:e+(a?" active":""),"data-dropdown-key":n,disabled:r,onClick:h=>{h.preventDefault(),p(!a)},onMouseDown:h=>{h.preventDefault()},ref:d,type:"button",children:[l&&Le(l,{}),s&&Le("span",{className:"toolbar-popup__dropdown-label",children:s}),Le("i",{className:"toolbar-popup__dropdown-caret"})]}),a&&Le(no.Fragment,{children:f})]})}var pr="toolbar-popup__dropdown",f0=t=>{let e=i0(14),{active:o,anchorElem:r,editor:n,enabled:l,item:i}=t,{i18n:s}=m0(),{fieldProps:u}=H(),{featureClientSchemaMap:c,schemaPath:d}=u;if(i.Component){let p;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==i?(p=i?.Component&&qe(i.Component,{active:o,anchorElem:r,editor:n,enabled:l,item:i},i.key),e[0]=o,e[1]=r,e[2]=n,e[3]=l,e[4]=i,e[5]=p):p=e[5],p}let a;if(e[6]!==o||e[7]!==n||e[8]!==l||e[9]!==c||e[10]!==s||e[11]!==i||e[12]!==d){let p=i.key,m;i.label&&(p=typeof i.label=="function"?i.label({featureClientSchemaMap:c,i18n:s,schemaPath:d}):i.label),p.length>25?m=p.substring(0,25)+"...":m=p,a=qe(as,{active:o,editor:n,enabled:l,Icon:i?.ChildComponent?qe(i.ChildComponent,{}):void 0,item:i,itemKey:i.key,tooltip:p,children:qe("span",{className:"text",children:m})},i.key),e[6]=o,e[7]=n,e[8]=l,e[9]=c,e[10]=s,e[11]=i,e[12]=d,e[13]=a}else a=e[13];return a},h0=us.memo(f0),$e=({anchorElem:t,classNames:e,editor:o,group:r,Icon:n,itemsContainerClassNames:l,label:i,maxActiveItems:s,onActiveChange:u})=>{let[c,d]=us.useState({activeItemKeys:[],enabledGroup:!0,enabledItemKeys:[]}),a=a0(c),p=H(),{items:m,key:f}=r,h=Ot(),g=s0(()=>{o.getEditorState().read(()=>{let T=p0();if(!T)return;let I=[],b=[],_=[];for(let x of m)x.isActive&&(!s||I.length<s)&&x.isActive({editor:o,editorConfigContext:p,selection:T})&&(I.push(x.key),b.push(x)),x.isEnabled?x.isEnabled({editor:o,editorConfigContext:p,selection:T})&&_.push(x.key):_.push(x.key);d({activeItemKeys:I,enabledGroup:r.isEnabled?r.isEnabled({editor:o,editorConfigContext:p,selection:T}):!0,enabledItemKeys:_}),u&&u({activeItems:b})})},[o,p,r,m,s,u]);c0(()=>(h(g),d0(o.registerUpdateListener(async()=>{await h(g)}))),[o,h,g]);let k=u0(()=>m?.length?m.map(T=>qe(h0,{active:a.activeItemKeys.includes(T.key),anchorElem:t,editor:o,enabled:a.enabledItemKeys.includes(T.key),item:T},T.key)):null,[m,a,t,o]);return qe(cs,{buttonAriaLabel:`${f} dropdown`,buttonClassName:[pr,`${pr}-${f}`,...e||[]].filter(Boolean).join(" "),disabled:!a.enabledGroup,dropdownKey:f,Icon:n,itemsContainerClassNames:[`${pr}-items`,...l||[]],label:i,children:k},f)};function T0({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&le(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?le(St,{editor:e,item:o,children:le(o.ChildComponent,{})},o.key):null}function w0(t){let e=ds(23),{anchorElem:o,editor:r,editorConfig:n,group:l,index:i}=t,{i18n:s}=k0(),{fieldProps:u}=H(),{featureClientSchemaMap:c,schemaPath:d}=u,[a,p]=ke.useState(void 0),[m,f]=ke.useState(void 0),h;e[0]!==l.ChildComponent||e[1]!==l.items||e[2]!==l.type?(h=()=>{l?.type==="dropdown"&&l.items.length&&l.ChildComponent?f(()=>l.ChildComponent):f(void 0)},e[0]=l.ChildComponent,e[1]=l.items,e[2]=l.type,e[3]=h):h=e[3];let g;e[4]!==l?(g=[l],e[4]=l,e[5]=g):g=e[5],ke.useEffect(h,g);let k;e[6]!==c||e[7]!==l.ChildComponent||e[8]!==l.items||e[9]!==l.type||e[10]!==s||e[11]!==d?(k=_=>{let{activeItems:x}=_;if(!x.length){l?.type==="dropdown"&&l.items.length&&l.ChildComponent?(f(()=>l.ChildComponent),p(void 0)):(f(void 0),p(void 0));return}let w=x[0],v=w.key;w.label&&(v=typeof w.label=="function"?w.label({featureClientSchemaMap:c,i18n:s,schemaPath:d}):w.label),v.length>25&&(v=v.substring(0,25)+"..."),x.length===1?(p(v),f(()=>w.ChildComponent)):(p(s.t("lexical:general:toolbarItemsActive",{count:x.length})),l?.type==="dropdown"&&l.items.length&&l.ChildComponent?f(()=>l.ChildComponent):f(void 0))},e[6]=c,e[7]=l.ChildComponent,e[8]=l.items,e[9]=l.type,e[10]=s,e[11]=d,e[12]=k):k=e[12];let T=k,I=`fixed-toolbar__group fixed-toolbar__group-${l.key}`,b;return e[13]!==m||e[14]!==o||e[15]!==a||e[16]!==r||e[17]!==n.features.toolbarFixed?.groups.length||e[18]!==l||e[19]!==i||e[20]!==T||e[21]!==I?(b=g0("div",{className:I,"data-toolbar-group-key":l.key,children:[l.type==="dropdown"&&l.items.length?m?le($e,{anchorElem:o,editor:r,group:l,Icon:m,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a,maxActiveItems:l.maxActiveItems??1,onActiveChange:T}):le($e,{anchorElem:o,editor:r,group:l,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a,maxActiveItems:l.maxActiveItems??1,onActiveChange:T}):null,l.type==="buttons"&&l.items.length?l.items.map(_=>le(T0,{anchorElem:o,editor:r,item:_},_.key)):null,i<n.features.toolbarFixed?.groups.length-1&&le("div",{className:"divider"})]},l.key),e[13]=m,e[14]=o,e[15]=a,e[16]=r,e[17]=n.features.toolbarFixed?.groups.length,e[18]=l,e[19]=i,e[20]=T,e[21]=I,e[22]=b):b=e[22],b}function E0({anchorElem:t,clientProps:e,editor:o,editorConfig:r,parentWithFixedToolbar:n}){let l=ke.useRef(null),{y:i}=C0(),s=_0(()=>{if(!n||e?.disableIfParentHasFixedToolbar)return null;let c=n.editorContainerRef.current.previousElementSibling;for(;c;){if(c.classList.contains("fixed-toolbar"))return c;c=c.previousElementSibling}return null},[e?.disableIfParentHasFixedToolbar,n]);return b0(()=>{if(!s)return;let u=l.current;if(!u)return;let c=u.getBoundingClientRect(),d=s.getBoundingClientRect();if(!(c.bottom<d.top||c.top>d.bottom))u.classList.remove("fixed-toolbar"),u.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),s.classList.remove("fixed-toolbar"),s.classList.add("fixed-toolbar","fixed-toolbar--hide");else{if(!u.classList.contains("fixed-toolbar--overlapping"))return;u.classList.remove("fixed-toolbar--overlapping"),u.classList.add("fixed-toolbar"),s.classList.remove("fixed-toolbar--hide"),s.classList.add("fixed-toolbar")}},50,[l,s,i]),le("div",{className:"fixed-toolbar",onFocus:u=>{u.stopPropagation()},ref:l,children:o.isEditable()&&le(ke.Fragment,{children:r?.features&&r.features?.toolbarFixed?.groups.map((u,c)=>le(w0,{anchorElem:t,editor:o,editorConfig:r,group:u,index:c},u.key))})})}var ms=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return ms(t.parentEditor)}return!1},ps=t=>{let e=ds(6),{clientProps:o}=t,[r]=x0(),n=H(),{editorConfig:l}=n,i=o.applyToFocusedEditor&&n.focusedEditor?.editor||r,s=o.applyToFocusedEditor&&n.focusedEditor?.editorConfig||l,u,c;if(e[0]!==o.disableIfParentHasFixedToolbar||e[1]!==i||e[2]!==s||e[3]!==n){c=Symbol.for("react.early_return_sentinel");e:{let d=ms(n);if(o?.disableIfParentHasFixedToolbar&&d){c=null;break e}if(!s?.features?.toolbarFixed?.groups?.length){c=null;break e}u=le(E0,{anchorElem:document.body,editor:i,editorConfig:s,parentWithFixedToolbar:d})}e[0]=o.disableIfParentHasFixedToolbar,e[1]=i,e[2]=s,e[3]=n,e[4]=u,e[5]=c}else u=e[4],c=e[5];return c!==Symbol.for("react.early_return_sentinel")?c:u};var S0=y({plugins:[{Component:ps,position:"aboveContainer"}]});import{c as gs}from"react/compiler-runtime";import{jsx as ce,jsxs as xs}from"react/jsx-runtime";import{useLexicalComposerContext as N0}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Cs}from"@lexical/utils";import{$getSelection as bs,$isRangeSelection as fs,$isTextNode as L0,COMMAND_PRIORITY_LOW as y0,getDOMSelection as ks,SELECTION_CHANGE_COMMAND as I0}from"lexical";import{useCallback as so,useEffect as Nt,useRef as hs,useState as R0}from"react";import*as ao from"react";import{createPortal as v0}from"react-dom";function fr(t,e){let o=t.getRangeAt(0),r;if(t.anchorNode===e){let n=e;for(;n.firstElementChild!=null;)n=n.firstElementChild;r=n.getBoundingClientRect()}else r=o.getBoundingClientRect();return r}function io(t){let{alwaysDisplayOnTop:e=!1,anchorElem:o,anchorFlippedOffset:r=0,floatingElem:n,horizontalOffset:l=32,horizontalPosition:i="left",specialHandlingForCaret:s=!1,targetRect:u,verticalGap:c=10}=t,d=o.parentElement;if(u===null||d==null){n.style.opacity="0",n.style.transform="translate(-10000px, -10000px)";return}let a=n.getBoundingClientRect(),p=o.getBoundingClientRect(),m=d.getBoundingClientRect(),f=u.top-a.height-c,h=u.left-l;i==="center"&&(h=u.left+u.width/2-a.width/2);let g=0;return!e&&f<m.top&&!s&&(g=a.height+u.height+c*2,f+=g),i==="center"?h+a.width>m.right?h=m.right-a.width-l:h<m.left&&(h=m.left+l):h+a.width>m.right&&(h=m.right-a.width-l),h-=p.left,n.style.opacity="1",s&&r!==0?(f-=p.bottom-r+a.height-3,n.style.transform=`translate(${h}px, ${f}px) rotate(180deg)`):(f-=p.top,n.style.transform=`translate(${h}px, ${f}px)`),g}function M0({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&ce(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?ce(St,{editor:e,item:o,children:ce(o.ChildComponent,{})},o.key):null}function D0(t){let e=gs(19),{anchorElem:o,editor:r,group:n,index:l}=t,{editorConfig:i}=H(),[s,u]=ao.useState(),c;e[0]!==n.ChildComponent||e[1]!==n.items||e[2]!==n.type?(c=()=>{n?.type==="dropdown"&&n.items.length&&n.ChildComponent?u(()=>n.ChildComponent):u(void 0)},e[0]=n.ChildComponent,e[1]=n.items,e[2]=n.type,e[3]=c):c=e[3];let d;e[4]!==n?(d=[n],e[4]=n,e[5]=d):d=e[5],ao.useEffect(c,d);let a;e[6]!==n.ChildComponent||e[7]!==n.items||e[8]!==n.type?(a=h=>{let{activeItems:g}=h;if(!g.length){n?.type==="dropdown"&&n.items.length&&n.ChildComponent?u(()=>n.ChildComponent):u(void 0);return}let k=g[0];u(()=>k?.ChildComponent)},e[6]=n.ChildComponent,e[7]=n.items,e[8]=n.type,e[9]=a):a=e[9];let p=a,m=`inline-toolbar-popup__group inline-toolbar-popup__group-${n.key}`,f;return e[10]!==s||e[11]!==o||e[12]!==r||e[13]!==i.features.toolbarInline?.groups.length||e[14]!==n||e[15]!==l||e[16]!==p||e[17]!==m?(f=xs("div",{className:m,"data-toolbar-group-key":n.key,children:[n.type==="dropdown"&&n.items.length?s?ce($e,{anchorElem:o,editor:r,group:n,Icon:s,maxActiveItems:n.maxActiveItems??1,onActiveChange:p}):ce($e,{anchorElem:o,editor:r,group:n,maxActiveItems:n.maxActiveItems??1,onActiveChange:p}):null,n.type==="buttons"&&n.items.length?n.items.map(h=>ce(M0,{anchorElem:o,editor:r,item:h},h.key)):null,l<i.features.toolbarInline?.groups.length-1&&ce("div",{className:"divider"})]},n.key),e[10]=s,e[11]=o,e[12]=r,e[13]=i.features.toolbarInline?.groups.length,e[14]=n,e[15]=l,e[16]=p,e[17]=m,e[18]=f):f=e[18],f}function A0({anchorElem:t,editor:e}){let o=hs(null),r=hs(null),{editorConfig:n}=H(),l=so(()=>{if(o?.current){let c=o.current.style.opacity==="0",d=o.current.style.pointerEvents==="none";c||(o.current.style.opacity="0"),d||(o.current.style.pointerEvents="none")}},[o]),i=so(c=>{if(o?.current&&(c.buttons===1||c.buttons===3)){let d=o.current.style.opacity==="0",a=o.current.style.pointerEvents==="none";if(!d||!a){let p=c.clientX,m=c.clientY,f=document.elementFromPoint(p,m);o.current.contains(f)||l()}}},[l]),s=so(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);Nt(()=>(document.addEventListener("mousemove",i),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)}),[o,i,s]);let u=so(()=>{let c=bs(),d=ks(e._window);if(o.current===null)return;let a=t.querySelector(":scope > .link-editor"),p=a!==null&&"style"in a&&a?.style?.opacity==="1",m=e.getRootElement();if(c!==null&&d!==null&&!d.isCollapsed&&m!==null&&m.contains(d.anchorNode)){let f=fr(d,m),h=io({alwaysDisplayOnTop:p,anchorElem:t,floatingElem:o.current,horizontalPosition:"center",targetRect:f});r.current&&io({anchorElem:o.current,anchorFlippedOffset:h,floatingElem:r.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:f,verticalGap:8})}else l()},[e,l,t]);return Nt(()=>{let c=t.parentElement,d=()=>{e.getEditorState().read(()=>{u()})};return window.addEventListener("resize",d),c&&c.addEventListener("scroll",d),()=>{window.removeEventListener("resize",d),c&&c.removeEventListener("scroll",d)}},[e,u,t]),Nt(()=>(e.getEditorState().read(()=>{u()}),Cs(e.registerUpdateListener(({editorState:c})=>{c.read(()=>{u()})}),e.registerCommand(I0,()=>(u(),!1),y0))),[e,u]),xs("div",{className:"inline-toolbar-popup",ref:o,children:[ce("div",{className:"caret",ref:r}),n?.features&&n.features?.toolbarInline?.groups.map((c,d)=>ce(D0,{anchorElem:t,editor:e,group:c,index:d},c.key))]})}function O0(t,e){let o=gs(12),[r,n]=R0(!1),l;o[0]!==t?(l=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let p=bs(),m=ks(t._window),f=t.getRootElement();if(m!==null&&(!fs(p)||f===null||!f.contains(m.anchorNode))){n(!1);return}if(!fs(p))return;if(p.getTextContent()!==""){let g=p.getNodes(),k=!1;for(let T of g)if(L0(T)){n(!0),k=!0;break}k||n(!1)}else n(!1);let h=p.getTextContent().replace(/\n/g,"");if(!p.isCollapsed()&&h===""){n(!1);return}})},o[0]=t,o[1]=l):l=o[1];let i=l,s,u;o[2]!==i?(s=()=>(document.addEventListener("selectionchange",i),document.addEventListener("mouseup",i),()=>{document.removeEventListener("selectionchange",i),document.removeEventListener("mouseup",i)}),u=[i],o[2]=i,o[3]=s,o[4]=u):(s=o[3],u=o[4]),Nt(s,u);let c,d;if(o[5]!==t||o[6]!==i?(c=()=>Cs(t.registerUpdateListener(()=>{i()}),t.registerRootListener(()=>{t.getRootElement()===null&&n(!1)})),d=[t,i],o[5]=t,o[6]=i,o[7]=c,o[8]=d):(c=o[7],d=o[8]),Nt(c,d),!r||!t.isEditable())return null;let a;return o[9]!==e||o[10]!==t?(a=v0(ce(A0,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=a):a=o[11],a}var _s=t=>{let{anchorElem:e}=t,[o]=N0();return O0(o,e)};var F0=y({plugins:[{Component:_s,position:"floatingAnchorElem"}]});import{TableCellNode as Eh,TableNode as Sh,TableRowNode as Nh}from"@lexical/table";import{jsx as Ts}from"react/jsx-runtime";import"react";var hr=()=>Ts("svg",{className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Ts("path",{clipRule:"evenodd",d:"M5.33333 4.5C4.8731 4.5 4.5 4.8731 4.5 5.33333V7.5H9.5V4.5H5.33333ZM5.33333 3.5C4.32081 3.5 3.5 4.32081 3.5 5.33333V14.6667C3.5 15.6792 4.32081 16.5 5.33333 16.5H14.6667C15.6792 16.5 16.5 15.6792 16.5 14.6667V5.33333C16.5 4.32081 15.6792 3.5 14.6667 3.5H5.33333ZM10.5 4.5V7.5H15.5V5.33333C15.5 4.8731 15.1269 4.5 14.6667 4.5H10.5ZM15.5 8.5H10.5V11.5H15.5V8.5ZM15.5 12.5H10.5V15.5H14.6667C15.1269 15.5 15.5 15.1269 15.5 14.6667V12.5ZM9.5 15.5V12.5H4.5V14.6667C4.5 15.1269 4.8731 15.5 5.33333 15.5H9.5ZM4.5 11.5H9.5V8.5H4.5V11.5Z",fill:"currentColor",fillRule:"evenodd"})});import{$createTableCellNode as $0,$createTableNode as P0,$createTableRowNode as B0,$isTableCellNode as ws,$isTableNode as gr,$isTableRowNode as xr,TableCellHeaderStates as co,TableCellNode as H0,TableNode as j0,TableRowNode as U0}from"@lexical/table";import{$isParagraphNode as G0,$isTextNode as W0}from"lexical";var Ss=/^\|(.+)\|\s?$/,V0=/^(\| ?:?-*:? ?)+\|\s?$/,Ns=({allTransformers:t})=>({type:"element",dependencies:[j0,U0,H0],export:e=>{if(!gr(e))return null;let o=[];for(let r of e.getChildren()){let n=[];if(!xr(r))continue;let l=!1;for(let i of r.getChildren())ws(i)&&(n.push(Br(t,i).replace(/\n/g,"\\n").trim()),i.__headerState===co.ROW&&(l=!0));o.push(`| ${n.join(" | ")} |`),l&&o.push(`| ${n.map(i=>"---").join(" | ")} |`)}return o.join(`
|
|
39
|
+
`)},regExp:Ss,replace:(e,o,r)=>{let n=r[0];if(!n)return;if(V0.test(n)){let a=e.getPreviousSibling();if(!a||!gr(a))return;let p=a.getChildren(),m=p[p.length-1];if(!m||!xr(m))return;m.getChildren().forEach(f=>{ws(f)&&f.setHeaderStyles(co.ROW,co.ROW)}),e.remove();return}let l=Es(n,t);if(l==null)return;let i=[l],s=e.getPreviousSibling(),u=l.length;for(;s&&!(!G0(s)||s.getChildrenSize()!==1);){let a=s.getFirstChild();if(!W0(a))break;let p=Es(a.getTextContent(),t);if(p==null)break;u=Math.max(u,p.length),i.unshift(p);let m=s.getPreviousSibling();s.remove(),s=m}let c=P0();for(let a of i){let p=B0();c.append(p);for(let m=0;m<u;m++)p.append(m<a.length?a[m]:Ls("",t))}let d=e.getPreviousSibling();gr(d)&&K0(d)===u?(d.append(...c.getChildren()),e.remove()):e.replace(c),c.selectEnd()}});function K0(t){let e=t.getFirstChild();return xr(e)?e.getChildrenSize():0}var Ls=(t,e)=>{t=t.replace(/\\n/g,`
|
|
40
|
+
`);let o=$0(co.NO_STATUS);return Pr(t,e,o),o},Es=(t,e)=>{let o=t.match(Ss);return!o||!o[1]?null:o[1].split("|").map(r=>Ls(r,e))};import{c as X0}from"react/compiler-runtime";import{jsx as P,jsxs as _e}from"react/jsx-runtime";import{useLexicalComposerContext as Ms}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as z0}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as Is,$deleteTableColumnAtSelection as Z0,$deleteTableRowAtSelection as Y0,$getNodeTriplet as q0,$getTableCellNodeFromLexicalNode as Rs,$getTableColumnIndexFromTableCellNode as Q0,$getTableNodeFromLexicalNodeOrThrow as Ie,$getTableRowIndexFromTableCellNode as e1,$insertTableColumnAtSelection as t1,$insertTableRowAtSelection as o1,$isTableCellNode as Ds,$isTableSelection as Lt,$mergeCells as r1,$unmergeCell as n1,getTableElement as br,getTableObserverFromTableElement as kr,TableCellHeaderStates as ye,TableCellNode as l1}from"@lexical/table";import{mergeRegister as i1}from"@lexical/utils";import{useScrollInfo as s1}from"@payloadcms/ui";import{$getSelection as mo,$isElementNode as a1,$isRangeSelection as _r,$isTextNode as c1,$setSelection as u1,COMMAND_PRIORITY_CRITICAL as d1,getDOMSelection as m1,isDOMNode as p1,SELECTION_CHANGE_COMMAND as f1}from"lexical";import*as Tr from"react";import{useCallback as ie,useEffect as Qe,useRef as uo,useState as et}from"react";import{createPortal as As}from"react-dom";import{jsx as Cr,jsxs as J0}from"react/jsx-runtime";import"react";var ys=()=>J0("svg",{fill:"none",height:"18",viewBox:"0 0 20 20",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[Cr("path",{d:"M5 11C5.55228 11 6 10.5523 6 10C6 9.44772 5.55228 9 5 9C4.44772 9 4 9.44772 4 10C4 10.5523 4.44772 11 5 11Z",fill:"currentColor"}),Cr("path",{d:"M10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z",fill:"currentColor"}),Cr("path",{d:"M15 11C15.5523 11 16 10.5523 16 10C16 9.44772 15.5523 9 15 9C14.4477 9 14 9.44772 14 10C14 10.5523 14.4477 11 15 11Z",fill:"currentColor"})]});function vs(t){let e=t.getShape();return{columns:e.toX-e.fromX+1,rows:e.toY-e.fromY+1}}function h1(){let t=mo();if(_r(t)&&!t.isCollapsed()||Lt(t)&&!t.anchor.is(t.focus)||!_r(t)&&!Lt(t))return!1;let[e]=q0(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function g1(t){let e=t.getLastDescendant();c1(e)?e.select():a1(e)?e.selectEnd():e!==null&&e.selectNext()}function x1({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:r,tableCellNode:n}){let[l]=Ms(),i=uo(null),[s,u]=et(n),[c,d]=et({columns:1,rows:1}),[a,p]=et(!1),[m,f]=et(!1),{y:h}=s1();Qe(()=>l.registerMutationListener(l1,C=>{C.get(s.getKey())==="updated"&&l.getEditorState().read(()=>{u(s.getLatest())})},{skipInitialization:!0}),[l,s]),Qe(()=>{l.getEditorState().read(()=>{let C=mo();if(Lt(C)){let S=vs(C);d(vs(C)),p(S.columns>1||S.rows>1)}f(h1())})},[l]),Qe(()=>{let C=e.current,S=i.current,M=l.getRootElement();if(C!=null&&S!=null&&M!=null){let L=M.getBoundingClientRect(),D=C.getBoundingClientRect();S.style.opacity="1";let N=S.getBoundingClientRect(),$=5,G=D.right+$;if(G+N.width>window.innerWidth||G+N.width>L.right){let te=D.left-N.width-$;G=(te<0?$:te)+window.pageXOffset}S.style.left=`${G+window.pageXOffset}px`;let q=D.top;if(q+N.height>window.innerHeight){let te=D.bottom-N.height;q=te<0?$:te}S.style.top=`${q}px`}},[e,i,l,h]),Qe(()=>{function C(S){i.current!=null&&e.current!=null&&p1(S.target)&&!i.current.contains(S.target)&&!e.current.contains(S.target)&&r(!1)}return window.addEventListener("click",C),()=>window.removeEventListener("click",C)},[r,e]);let g=ie(()=>{l.update(()=>{if(s.isAttached()){let C=Ie(s),S=br(C,l.getElementByKey(C.getKey()));if(S===null)throw new Error("Expected to find tableElement in DOM");let M=kr(S);M!==null&&M.$clearHighlight(),C.markDirty(),u(s.getLatest())}u1(null)})},[l,s]),k=()=>{l.update(()=>{let C=mo();if(!Lt(C))return;let M=C.getNodes().filter(Ds),L=r1(M);L&&(g1(L),o())})},T=()=>{l.update(()=>{n1()})},I=ie(C=>{l.update(()=>{for(let S=0;S<c.rows;S++)o1(C);o()})},[l,o,c.rows]),b=ie(C=>{l.update(()=>{for(let S=0;S<c.columns;S++)t1(C);o()})},[l,o,c.columns]),_=ie(()=>{l.update(()=>{Y0(),o()})},[l,o]),x=ie(()=>{l.update(()=>{Ie(s).remove(),g(),o()})},[l,s,g,o]),w=ie(()=>{l.update(()=>{Z0(),o()})},[l,o]),v=ie(()=>{l.update(()=>{let C=Ie(s),S=e1(s),[M]=Is(C,null,null),L=new Set,D=s.getHeaderStyles()^ye.ROW;if(M[S])for(let N=0;N<M[S].length;N++){let $=M[S][N];$?.cell&&(L.has($.cell)||(L.add($.cell),$.cell.setHeaderStyles(D,ye.ROW)))}g(),o()})},[l,s,g,o]),O=ie(()=>{l.update(()=>{let C=Ie(s),S=Q0(s),[M]=Is(C,null,null),L=new Set,D=s.getHeaderStyles()^ye.COLUMN;if(M)for(let N=0;N<M.length;N++){let $=M?.[N]?.[S];$?.cell&&(L.has($.cell)||(L.add($.cell),$.cell.setHeaderStyles(D,ye.COLUMN)))}g(),o()})},[l,s,g,o]),F=ie(()=>{l.update(()=>{if(s.isAttached()){let C=Ie(s);C&&C.setRowStriping(!C.getRowStriping())}g(),o()})},[l,s,g,o]),R=ie(()=>{l.update(()=>{if(s.isAttached()){let C=Ie(s);C&&C.setFrozenColumns(C.getFrozenColumns()===0?1:0)}g(),o()})},[l,s,g,o]),E=null;return t&&(a?E=P("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>k(),type:"button",children:P("span",{className:"text",children:"Merge cells"})}):m&&(E=P("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>T(),type:"button",children:P("span",{className:"text",children:"Unmerge cells"})}))),As(_e("div",{className:"table-action-menu-dropdown",onClick:C=>{C.stopPropagation()},ref:i,children:[E?_e(Tr.Fragment,{children:[E,P("hr",{})]}):null,P("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>F(),type:"button",children:P("span",{className:"text",children:"Toggle Row Striping"})}),P("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>R(),type:"button",children:P("span",{className:"text",children:"Toggle First Column Freeze"})}),P("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>I(!1),type:"button",children:_e("span",{className:"text",children:["Insert ",c.rows===1?"row":`${c.rows} rows`," above"]})}),P("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>I(!0),type:"button",children:_e("span",{className:"text",children:["Insert ",c.rows===1?"row":`${c.rows} rows`," below"]})}),P("hr",{}),P("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>b(!1),type:"button",children:_e("span",{className:"text",children:["Insert ",c.columns===1?"column":`${c.columns} columns`," ","left"]})}),P("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>b(!0),type:"button",children:_e("span",{className:"text",children:["Insert ",c.columns===1?"column":`${c.columns} columns`," ","right"]})}),P("hr",{}),P("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>w(),type:"button",children:P("span",{className:"text",children:"Delete column"})}),P("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>_(),type:"button",children:P("span",{className:"text",children:"Delete row"})}),P("button",{className:"item","data-test-id":"table-delete",onClick:()=>x(),type:"button",children:P("span",{className:"text",children:"Delete table"})}),P("hr",{}),P("button",{className:"item","data-test-id":"table-row-header",onClick:()=>v(),type:"button",children:_e("span",{className:"text",children:[(s.__headerState&ye.ROW)===ye.ROW?"Remove":"Add"," ","row header"]})}),P("button",{className:"item","data-test-id":"table-column-header",onClick:()=>O(),type:"button",children:_e("span",{className:"text",children:[(s.__headerState&ye.COLUMN)===ye.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function C1({anchorElem:t,cellMerge:e}){let[o]=Ms(),r=uo(null),n=uo(null),[l,i]=et(!1),[s,u]=et(null),c=ie(()=>{let a=r.current,p=mo(),m=m1(o._window),f=document.activeElement;function h(){a&&(a.classList.remove("table-cell-action-button-container--active"),a.classList.add("table-cell-action-button-container--inactive")),u(null)}if(p==null||a==null)return h();let g=o.getRootElement(),k=null,T=null;if(_r(p)&&g!==null&&m!==null&&g.contains(m.anchorNode)){let b=Rs(p.anchor.getNode());if(b==null||(T=o.getElementByKey(b.getKey()),T==null||!b.isAttached()))return h();let _=Ie(b),x=br(_,o.getElementByKey(_.getKey()));if(x===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");k=kr(x),u(b)}else if(Lt(p)){let b=Rs(p.anchor.getNode());if(!Ds(b))throw new Error("TableSelection anchorNode must be a TableCellNode");let _=Ie(b),x=br(_,o.getElementByKey(_.getKey()));if(x===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");k=kr(x),T=o.getElementByKey(b.getKey())}else if(!f)return h();if(k===null||T===null)return h();let I=!k||!k.isSelecting;if(a.classList.toggle("table-cell-action-button-container--active",I),a.classList.toggle("table-cell-action-button-container--inactive",!I),I){let b=T.getBoundingClientRect(),_=t.getBoundingClientRect(),x=b.top-_.top,w=b.right-_.left;a.style.transform=`translate(${w}px, ${x}px)`}},[o,t]);Qe(()=>{let a,p=()=>{a=void 0,o.getEditorState().read(c)},m=()=>(a===void 0&&(a=setTimeout(p,0)),!1);return i1(o.registerUpdateListener(m),o.registerCommand(f1,m,d1),o.registerRootListener((f,h)=>{h&&h.removeEventListener("pointerup",m),f&&(f.addEventListener("pointerup",m),m())}),()=>clearTimeout(a))});let d=uo(s);return Qe(()=>{d.current!==s&&i(!1),d.current=s},[d,s]),P("div",{className:"table-cell-action-button-container",ref:r,children:s!=null&&_e(Tr.Fragment,{children:[P("button",{className:"table-cell-action-button",onClick:a=>{a.stopPropagation(),i(!l)},ref:n,type:"button",children:P(ys,{})}),l&&P(x1,{cellMerge:e,contextRef:n,onClose:()=>i(!1),setIsMenuOpen:i,tableCellNode:s})]})})}var Os=t=>{let e=X0(3),{anchorElem:o}=t,r=z0(),n;return e[0]!==o||e[1]!==r?(n=As(r?P(C1,{anchorElem:o??document.body,cellMerge:!0}):null,o??document.body),e[0]=o,e[1]=r,e[2]=n):n=e[2],n};import{c as b1}from"react/compiler-runtime";import{jsx as fo,jsxs as k1}from"react/jsx-runtime";import{useLexicalComposerContext as _1}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as T1}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as w1,$getTableNodeFromLexicalNodeOrThrow as wr,$getTableRowIndexFromTableCellNode as E1,$isTableCellNode as Fs,$isTableRowNode as S1,getDOMCellFromTarget as N1,getTableElement as L1,TableNode as $s}from"@lexical/table";import{calculateZoomLevel as Ps,mergeRegister as y1}from"@lexical/utils";import{$getNearestNodeFromDOMNode as Er,isHTMLElement as I1,SKIP_SCROLL_INTO_VIEW_TAG as Bs}from"lexical";import*as js from"react";import{useCallback as yt,useEffect as Sr,useRef as po,useState as tt}from"react";import{createPortal as R1}from"react-dom";var v1=33,Hs=92;function M1({editor:t}){let e=po(null),o=po(null),r=po(null),[n,l]=tt(!1),i=H(),s=po(null),[u,c]=tt(null),[d,a]=tt(null),[p,m]=tt(!1),[f,h]=tt(null),g=yt(()=>{a(null),e.current=null,h(null),s.current=null,r.current=null},[]),k=R=>(R.buttons&1)===1;Sr(()=>{let R=new Set;return y1(t.registerMutationListener($s,E=>{for(let[C,S]of E)S==="destroyed"?R.delete(C):R.add(C);l(R.size>0)}),t.registerNodeTransform($s,E=>{if(E.getColWidths())return E;let C=E.getColumnCount(),S=Hs;return E.setColWidths(Array(C).fill(S)),E}))},[t]),Sr(()=>{if(!n)return;let R=M=>{let L=M.target;if(I1(L)){if(f){c({x:M.clientX,y:M.clientY});return}if(m(k(M)),!(o.current&&o.current.contains(L))&&e.current!==L){e.current=L;let D=N1(L);D&&d!==D?t.getEditorState().read(()=>{let N=Er(D.elem);if(!N)throw new Error("TableCellResizer: Table cell node not found.");let $=wr(N),G=L1($,t.getElementByKey($.getKey()));if(!G)throw new Error("TableCellResizer: Table element not found.");e.current=L,r.current=G.getBoundingClientRect(),a(D)},{editor:t}):D==null&&g()}}},E=M=>{m(!0)},C=M=>{m(!1)},S=t.registerRootListener((M,L)=>{L?.removeEventListener("mousemove",R),L?.removeEventListener("mousedown",E),L?.removeEventListener("mouseup",C),M?.addEventListener("mousemove",R),M?.addEventListener("mousedown",E),M?.addEventListener("mouseup",C)});return()=>{S()}},[d,f,t,n,g]);let T=R=>R==="bottom",I=yt(R=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let E=Er(d.elem);if(!Fs(E))throw new Error("TableCellResizer: Table cell node not found.");let C=wr(E),S=E1(E),M=C.getChildren(),D=E.getColSpan()===C.getColumnCount()?S:S+E.getRowSpan()-1;if(D>=M.length||D<0)throw new Error("Expected table cell to be inside of table row.");let N=M[D];if(!S1(N))throw new Error("Expected table row");let $=N.getHeight();if($===void 0){let q=N.getChildren();$=Math.min(...q.map(te=>b(te,t)??1/0))}let G=Math.max($+R,v1);N.setHeight(G)},{tag:Bs})},[d,t]),b=(R,E)=>E.getElementByKey(R.getKey())?.clientHeight,_=(R,E)=>{let C;return E.forEach(S=>{S.forEach((M,L)=>{M.cell===R&&(C=L)})}),C},x=yt(R=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let E=Er(d.elem);if(!Fs(E))throw new Error("TableCellResizer: Table cell node not found.");let C=wr(E),[S]=w1(C,null,null),M=_(E,S);if(M===void 0)throw new Error("TableCellResizer: Table column not found.");let L=C.getColWidths();if(!L)return;let D=L[M];if(D===void 0)return;let N=[...L],$=Math.max(D+R,Hs);N[M]=$,C.setColWidths(N)},{tag:Bs})},[d,t]),w=yt(R=>{let E=C=>{if(C.preventDefault(),C.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");if(s.current){let{x:S,y:M}=s.current;if(d===null)return;let L=Ps(C.target);if(T(R)){let D=(C.clientY-M)/L;I(D)}else{let D=(C.clientX-S)/L;x(D)}g(),document.removeEventListener("mouseup",E)}};return E},[d,g,x,I]),v=yt(R=>E=>{if(E.preventDefault(),E.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");s.current={x:E.clientX,y:E.clientY},c(s.current),h(R),document.addEventListener("mouseup",w(R))},[d,w]),[O,F]=tt({bottom:null,left:null,right:null,top:null});return Sr(()=>{if(d){let{height:R,left:E,top:C,width:S}=d.elem.getBoundingClientRect(),M=Ps(d.elem),L=10,D={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${L}px`,left:`${window.scrollX+E}px`,top:`${window.scrollY+C+R-L/2}px`,width:`${S}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${R}px`,left:`${window.scrollX+E+S-L/2}px`,top:`${window.scrollY+C}px`,width:`${L}px`}},N=r.current;f&&u&&N&&(T(f)?(D[f].left=`${window.scrollX+N.left}px`,D[f].top=`${window.scrollY+u.y/M}px`,D[f].height="3px",D[f].width=`${N.width}px`):(D[f].top=`${window.scrollY+N.top}px`,D[f].left=`${window.scrollX+u.x/M}px`,D[f].width="3px",D[f].height=`${N.height}px`),D[f].backgroundColor="#adf"),F(D)}else F({bottom:null,left:null,right:null,top:null})},[d,f,u]),fo("div",{ref:o,children:d!=null&&!p&&k1(js.Fragment,{children:[fo("div",{className:`${i.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:v("right"),style:O.right||void 0}),fo("div",{className:`${i.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:v("bottom"),style:O.bottom||void 0})]})})}var Us=()=>{let t=b1(3),[e]=_1(),o=T1(),r;return t[0]!==e||t[1]!==o?(r=o?R1(fo(M1,{editor:e}),document.body):null,t[0]=e,t[1]=o,t[2]=r):r=t[2],r};import{c as H1}from"react/compiler-runtime";import{jsx as Nr,jsxs as j1,Fragment as U1}from"react/jsx-runtime";import{useLexicalComposerContext as Zs}from"@lexical/react/LexicalComposerContext";import{$getTableAndElementByKey as G1,$getTableColumnIndexFromTableCellNode as W1,$getTableRowIndexFromTableCellNode as V1,$insertTableColumnAtSelection as K1,$insertTableRowAtSelection as J1,$isTableCellNode as X1,$isTableNode as Vs,getTableElement as z1,TableNode as Z1}from"@lexical/table";import{$findMatchingParent as Y1,mergeRegister as q1}from"@lexical/utils";import{$getNearestNodeFromDOMNode as Ks,isHTMLElement as Q1}from"lexical";import{useEffect as Js,useMemo as eh,useRef as Xs,useState as ho}from"react";import"react";import{createPortal as th}from"react-dom";import{c as $1}from"react/compiler-runtime";import{useEffect as P1,useRef as B1}from"react";var D1="Expected a function",A1=Math.max,O1=Math.min;function F1(t,e,o){let r,n,l=0,i,s=!1,u=!1,c,d,a,p=!0;if(typeof t!="function")throw new TypeError(D1);e=e||0,typeof o=="object"&&(s=!!o.leading,u="maxWait"in o,c=u?A1(o.maxWait||0,e):c,p="trailing"in o?!!o.trailing:p);function m(x){let w=r,v=i;return r=i=void 0,l=x,d=t.apply(v,w),d}function f(x){return l=x,a=setTimeout(k,e),s?m(x):d}function h(x){let w=x-n,v=x-l,O=e-w;return u?O1(O,c-v):O}function g(x){let w=x-n,v=x-l;return n===void 0||w>=e||w<0||u&&v>=c}function k(){let x=Date.now();if(g(x))return T(x);a=setTimeout(k,h(x))}function T(x){return a=void 0,p&&r?m(x):(r=i=void 0,d)}function I(){a!==void 0&&clearTimeout(a),l=0,r=n=i=a=void 0}function b(){return a===void 0?d:T(Date.now())}function _(){let x=Date.now(),w=g(x);if(r=arguments,i=this,n=x,w){if(a===void 0)return f(n);if(u)return clearTimeout(a),a=setTimeout(k,e),m(n)}return a===void 0&&(a=setTimeout(k,e)),d}return _.cancel=I,_.flush=b,_}var Gs=F1;function Ws(t,e,o){let r=$1(6),n=B1(null),l,i;r[0]!==t||r[1]!==o||r[2]!==e?(l=()=>(n.current=Gs(t,e,{maxWait:o}),()=>{n.current?.cancel()}),i=[t,e,o],r[0]=t,r[1]=o,r[2]=e,r[3]=l,r[4]=i):(l=r[3],i=r[4]),P1(l,i);let s;return r[5]===Symbol.for("react.memo_cache_sentinel")?(s=(...c)=>{let d=c;n.current&&n.current(...d)},r[5]=s):s=r[5],s}var zs=20;function oh({anchorElem:t}){let[e]=Zs(),o=H(),[r,n]=ho(!1),[l,i]=ho(!1),[s,u]=ho(!1),[c,d]=ho({}),a=Xs(new Set),p=Xs(null),m=Ws(g=>{let{isOutside:k,tableDOMNode:T}=rh(g,o.editorConfig?.lexical);if(k){n(!1),i(!1);return}if(!T)return;p.current=T;let I=null,b=null,_=null;if(e.getEditorState().read(()=>{let L=Ks(T);if(X1(L)){let D=Y1(L,N=>Vs(N));if(!Vs(D))return;if(_=z1(D,e.getElementByKey(D.getKey())),_){let N=D.getChildrenSize(),$=D.getChildAtIndex(0)?.getChildrenSize(),G=V1(L),q=W1(L);G===N-1?I=L:q===$-1&&(b=L)}}},{editor:e}),!_)return;let x=_.parentElement;if(!x)return;let{bottom:w,height:v,left:O,right:F,width:R,y:E}=_.getBoundingClientRect(),C=!1;x&&x.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(C=x.scrollWidth>x.clientWidth);let{left:S,y:M}=t.getBoundingClientRect();I?(i(!1),n(!0),d({height:zs,left:C&&x?x.offsetLeft:O-S,top:w-M+5,width:C&&x?x.offsetWidth:R})):b&&(i(!0),n(!1),d({height:v,left:F-S+5,top:E-M,width:zs}))},50,250),f=eh(()=>new ResizeObserver(()=>{n(!1),i(!1)}),[]);Js(()=>{if(s)return document.addEventListener("mousemove",m),()=>{n(!1),i(!1),document.removeEventListener("mousemove",m)}},[s,m]),Js(()=>q1(e.registerMutationListener(Z1,g=>{e.getEditorState().read(()=>{let k=!1;for(let[T,I]of g)switch(I){case"created":{a.current.add(T),k=!0;break}case"destroyed":{a.current.delete(T),k=!0;break}default:break}if(k){f.disconnect();for(let T of a.current){let{tableElement:I}=G1(T);f.observe(I)}u(a.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let h=g=>{e.update(()=>{p.current&&(Ks(p.current)?.selectEnd(),g?(J1(),n(!1)):(K1(),i(!1)))})};return e?.isEditable()?j1(U1,{children:[r&&Nr("button",{"aria-label":"Add Row",className:o.editorConfig.lexical.theme.tableAddRows,onClick:()=>h(!0),style:{...c},type:"button"}),l&&Nr("button",{"aria-label":"Add Column",className:o.editorConfig.lexical.theme.tableAddColumns,onClick:()=>h(!1),style:{...c},type:"button"})]}):null}function rh(t,e){let o=t.target;if(Q1(o)){let r=o.closest(`td.${e.theme.tableCell}, th.${e.theme.tableCell}`);return{isOutside:!(r||o.closest(`button.${e.theme.tableAddRows}`)||o.closest(`button.${e.theme.tableAddColumns}`)||o.closest(`div.${e.theme.tableCellResizer}`)),tableDOMNode:r}}else return{isOutside:!0,tableDOMNode:null}}function Ys(t){let e=H1(2),{anchorElem:o}=t,r=o===void 0?document.body:o,[n]=Zs();if(!n?.isEditable())return null;let l;return e[0]!==r?(l=th(Nr(oh,{anchorElem:r}),r),e[0]=r,e[1]=l):l=e[1],l}import{c as nh}from"react/compiler-runtime";import{jsx as Lr,jsxs as lh}from"react/jsx-runtime";import{useLexicalComposerContext as ih}from"@lexical/react/LexicalComposerContext";import{TablePlugin as sh}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as ah,TableCellNode as ch,TableNode as uh,TableRowNode as dh}from"@lexical/table";import{mergeRegister as mh}from"@lexical/utils";import{formatDrawerSlug as ph,useEditDepth as fh}from"@payloadcms/ui";import{$getSelection as hh,$isRangeSelection as gh,COMMAND_PRIORITY_EDITOR as xh,createCommand as Ch}from"lexical";import{createContext as bh,use as kh,useEffect as _h,useMemo as Th,useState as wh}from"react";import*as qs from"react";var go=Ch("OPEN_EMBED_DRAWER_COMMAND"),Qs=bh({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function ea({children:t}){let[e,o]=wh({cellEditorConfig:null,cellEditorPlugins:null});return Lr(Qs,{value:Th(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(r,n)=>{o({cellEditorConfig:r,cellEditorPlugins:n})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var ta=()=>{let t=nh(16),[e]=ih(),o=kh(Qs),r=fh(),{fieldProps:n,uuid:l}=H(),{schemaPath:i}=n,s="lexical-table-create-"+l,u;t[0]!==r||t[1]!==s?(u=ph({slug:s,depth:r}),t[0]=r,t[1]=s,t[2]=u):u=t[2];let c=u,{toggleDrawer:d}=de(c,!0),a;t[3]!==e||t[4]!==d?(a=()=>{if(!e.hasNodes([uh,dh,ch]))throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return mh(e.registerCommand(go,()=>{let h=null;return e.getEditorState().read(()=>{let g=hh();gh(g)&&(h=g)}),h&&d(),!0},xh))},t[3]=e,t[4]=d,t[5]=a):a=t[5];let p;t[6]!==o||t[7]!==e||t[8]!==d?(p=[o,e,d],t[6]=o,t[7]=e,t[8]=d,t[9]=p):p=t[9],_h(a,p);let m;t[10]!==e?(m=(h,g)=>{!g.columns||!g.rows||e.dispatchCommand(ah,{columns:String(g.columns),rows:String(g.rows)})},t[10]=e,t[11]=m):m=t[11];let f;return t[12]!==c||t[13]!==i||t[14]!==m?(f=lh(qs.Fragment,{children:[Lr(rt,{drawerSlug:c,drawerTitle:"Create Table",featureKey:"experimental_table",handleDrawerSubmit:m,schemaPath:i,schemaPathSuffix:"fields"}),Lr(sh,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]}),t[12]=c,t[13]=i,t[14]=m,t[15]=f):f=t[15],f};var Lh=y({markdownTransformers:[Ns],nodes:[Sh,Eh,Nh],plugins:[{Component:ta,position:"normal"},{Component:Us,position:"normal"},{Component:Os,position:"floatingAnchorElem"},{Component:Ys,position:"floatingAnchorElem"}],providers:[ea],slashMenu:{groups:[Z([{Icon:hr,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(go,{})}}])]},toolbarFixed:{groups:[fe([{ChildComponent:hr,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(go,{})}}])]}});import{$isNodeSelection as ng}from"lexical";import{jsx as yr,jsxs as yh}from"react/jsx-runtime";import"react";var Ir=()=>yh("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[yr("path",{d:"M14.6667 4H5.33333C4.59695 4 4 4.59695 4 5.33333V14.6667C4 15.403 4.59695 16 5.33333 16H14.6667C15.403 16 16 15.403 16 14.6667V5.33333C16 4.59695 15.403 4 14.6667 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),yr("path",{d:"M7.99984 9.33366C8.73622 9.33366 9.33317 8.73671 9.33317 8.00033C9.33317 7.26395 8.73622 6.66699 7.99984 6.66699C7.26346 6.66699 6.6665 7.26395 6.6665 8.00033C6.6665 8.73671 7.26346 9.33366 7.99984 9.33366Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),yr("path",{d:"M16 11.9995L13.9427 9.94214C13.6926 9.69218 13.3536 9.55176 13 9.55176C12.6464 9.55176 12.3074 9.69218 12.0573 9.94214L6 15.9995",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as Dh}from"react/jsx-runtime";import na from"bson-objectid";import{$applyNodeReplacement as Ah}from"lexical";import*as la from"react";import{jsx as Ih}from"react/jsx-runtime";import{DecoratorBlockNode as Rh}from"@lexical/react/LexicalDecoratorBlockNode.js";import oa from"bson-objectid";import{$applyNodeReplacement as vh}from"lexical";import"react";function Rr(t){return t.parentElement!=null&&t.parentElement.tagName==="LI"&&t.previousSibling===null&&t.getAttribute("aria-roledescription")==="checkbox"}function Mh(t){if(t.hasAttribute("data-lexical-upload-relation-to")&&t.hasAttribute("data-lexical-upload-id")){let o=t.getAttribute("data-lexical-upload-id"),r=t.getAttribute("data-lexical-upload-relation-to");if(o!=null&&r!=null)return{node:ra({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||Rr(e),null}var It=class extends Rh{__data;constructor({data:e,format:o,key:r}){super(o,r),this.__data=e}static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"upload"}static importDOM(){return{img:e=>({conversion:Mh,priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new oa.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value},r=ra({data:o});return r.setFormat(e.format),r}static isInline(){return!1}decorate(){return Ih(RawUploadComponent,{data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportDOM(){let e=document.createElement("img");return e.setAttribute("data-lexical-upload-id",String(this.__data?.value)),e.setAttribute("data-lexical-upload-relation-to",this.__data?.relationTo),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(e){let o=this.getWritable();o.__data=e}updateDOM(){return!1}};function ra({data:t}){return t?.id||(t.id=new oa.default().toHexString()),vh(new It({data:t}))}var Oh=la.lazy(()=>import("./component-3PENNOM3.js").then(t=>({default:t.UploadComponent})));function Fh(t){if(t.hasAttribute("data-lexical-upload-relation-to")&&t.hasAttribute("data-lexical-upload-id")){let o=t.getAttribute("data-lexical-upload-id"),r=t.getAttribute("data-lexical-upload-relation-to");if(o!=null&&r!=null)return{node:Pe({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||Rr(e),null}var Te=class extends It{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:Fh,priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new na.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value},r=Pe({data:o});return r.setFormat(e.format),r}decorate(){return Dh(Oh,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Pe({data:t}){return t?.id||(t.id=new na.default().toHexString()),Ah(new Te({data:t}))}function vr(t){return t instanceof Te}import{c as Wh}from"react/compiler-runtime";import{jsx as Vh}from"react/jsx-runtime";import{useLexicalComposerContext as Kh}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Jh,mergeRegister as Xh}from"@lexical/utils";import{useConfig as zh}from"@payloadcms/ui";import{$getPreviousSelection as Zh,$getSelection as Yh,$isParagraphNode as qh,$isRangeSelection as Qh,COMMAND_PRIORITY_EDITOR as eg,createCommand as tg}from"lexical";import{useEffect as og}from"react";import{c as ia}from"react/compiler-runtime";import{jsx as Mr}from"react/jsx-runtime";import{useLexicalComposerContext as sa}from"@lexical/react/LexicalComposerContext.js";import{toast as $h}from"@payloadcms/ui";import{$getNodeByKey as Ph,COMMAND_PRIORITY_EDITOR as aa}from"lexical";import{useEffect as ca,useState as Bh}from"react";var Hh=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=Ph(o);n&&n.replace(Pe({data:{fields:null,relationTo:e,value:r}}))}):t.dispatchCommand(Dr,{fields:null,relationTo:e,value:r})},jh=t=>{let e=ia(13),{enabledCollectionSlugs:o}=t,[r]=sa(),[n,l]=Bh(null),i;e[0]!==o?(i={collectionSlugs:o,uploads:!0},e[0]=o,e[1]=i):i=e[1];let{closeListDrawer:s,ListDrawer:u,openListDrawer:c}=Et(i),d,a;e[2]!==r||e[3]!==c?(d=()=>r.registerCommand(Ue,h=>(l(h?.replace?h?.replace.nodeKey:null),c(),!0),aa),a=[r,c],e[2]=r,e[3]=c,e[4]=d,e[5]=a):(d=e[4],a=e[5]),ca(d,a);let p;e[6]!==s||e[7]!==r||e[8]!==n?(p=h=>{let{collectionSlug:g,doc:k}=h;s(),Hh({editor:r,relationTo:g,replaceNodeKey:n,value:k.id})},e[6]=s,e[7]=r,e[8]=n,e[9]=p):p=e[9];let m=p,f;return e[10]!==u||e[11]!==m?(f=Mr(u,{onSelect:m}),e[10]=u,e[11]=m,e[12]=f):f=e[12],f},Uh=()=>{let t=ia(3),[e]=sa(),o,r;return t[0]!==e?(o=()=>e.registerCommand(Ue,Gh,aa),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),ca(o,r),null},ua=t=>Mr(At,{...t,FallbackComponent:Uh,uploads:!0,children:Mr(jh,{...t})});function Gh(){return $h.error("No upload collections enabled"),!0}var Dr=tg("INSERT_UPLOAD_COMMAND"),da=t=>{let e=Wh(5),[o]=Kh(),{config:r}=zh(),{collections:n}=r,l,i;e[0]!==o?(l=()=>{if(!o.hasNodes([Te]))throw new Error("UploadPlugin: UploadNode not registered on editor");return Xh(o.registerCommand(Dr,u=>(o.update(()=>{let c=Yh()||Zh();if(Qh(c)){let d=Pe({data:{id:u.id,fields:u.fields,relationTo:u.relationTo,value:u.value}}),{focus:a}=c,p=a.getNode();Jh(d),qh(p)&&!p.__first&&p.remove()}}),!0),eg))},i=[o],e[0]=o,e[1]=l,e[2]=i):(l=e[1],i=e[2]),og(l,i);let s;return e[3]!==n?(s=Vh(ua,{enabledCollectionSlugs:n.map(rg)}),e[3]=n,e[4]=s):s=e[4],s};function rg(t){let{slug:e}=t;return e}var lg=y({nodes:[Te],plugins:[{Component:da,position:"normal"}],slashMenu:{groups:[Z([{Icon:Ir,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ue,{replace:!1})}}])]},toolbarFixed:{groups:[fe([{ChildComponent:Ir,isActive:({selection:t})=>{if(!ng(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return vr(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ue,{replace:!1})}}])]}});import{c as sg}from"react/compiler-runtime";import{jsx as Or}from"react/jsx-runtime";import{ShimmerEffect as ag,useConfig as cg}from"@payloadcms/ui";import{lazy as ug,Suspense as dg,useEffect as mg,useState as pg}from"react";var ma={block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",codeHighlight:{atrule:"LexicalEditorTheme__tokenAttr",attr:"LexicalEditorTheme__tokenAttr",boolean:"LexicalEditorTheme__tokenProperty",builtin:"LexicalEditorTheme__tokenSelector",cdata:"LexicalEditorTheme__tokenComment",char:"LexicalEditorTheme__tokenSelector",class:"LexicalEditorTheme__tokenFunction","class-name":"LexicalEditorTheme__tokenFunction",comment:"LexicalEditorTheme__tokenComment",constant:"LexicalEditorTheme__tokenProperty",deleted:"LexicalEditorTheme__tokenProperty",doctype:"LexicalEditorTheme__tokenComment",entity:"LexicalEditorTheme__tokenOperator",function:"LexicalEditorTheme__tokenFunction",important:"LexicalEditorTheme__tokenVariable",inserted:"LexicalEditorTheme__tokenSelector",keyword:"LexicalEditorTheme__tokenAttr",namespace:"LexicalEditorTheme__tokenVariable",number:"LexicalEditorTheme__tokenProperty",operator:"LexicalEditorTheme__tokenOperator",prolog:"LexicalEditorTheme__tokenComment",property:"LexicalEditorTheme__tokenProperty",punctuation:"LexicalEditorTheme__tokenPunctuation",regex:"LexicalEditorTheme__tokenVariable",selector:"LexicalEditorTheme__tokenSelector",string:"LexicalEditorTheme__tokenSelector",symbol:"LexicalEditorTheme__tokenProperty",tag:"LexicalEditorTheme__tokenProperty",url:"LexicalEditorTheme__tokenOperator",variable:"LexicalEditorTheme__tokenVariable"},embedBlock:{base:"LexicalEditorTheme__embedBlock",focus:"LexicalEditorTheme__embedBlockFocus"},hashtag:"LexicalEditorTheme__hashtag",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",hrSelected:"LexicalEditorTheme__hrSelected",indent:"LexicalEditorTheme__indent",inlineImage:"LexicalEditor__inline-image",link:"LexicalEditorTheme__link",list:{checklist:"LexicalEditorTheme__checklist",listitem:"LexicalEditorTheme__listItem",listitemChecked:"LexicalEditorTheme__listItemChecked",listitemUnchecked:"LexicalEditorTheme__listItemUnchecked",nested:{listitem:"LexicalEditorTheme__nestedListItem"},olDepth:["LexicalEditorTheme__ol1","LexicalEditorTheme__ol2","LexicalEditorTheme__ol3","LexicalEditorTheme__ol4","LexicalEditorTheme__ol5"],ul:"LexicalEditorTheme__ul"},ltr:"LexicalEditorTheme__ltr",mark:"LexicalEditorTheme__mark",markOverlap:"LexicalEditorTheme__markOverlap",paragraph:"LexicalEditorTheme__paragraph",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",rtl:"LexicalEditorTheme__rtl",tab:"LexicalEditorTheme__tabNode",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableAlignment:{center:"LexicalEditorTheme__tableAlignmentCenter",right:"LexicalEditorTheme__tableAlignmentRight"},tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableFrozenColumn:"LexicalEditorTheme__tableFrozenColumn",tableRowStriping:"LexicalEditorTheme__tableRowStriping",tableScrollableWrapper:"LexicalEditorTheme__tableScrollableWrapper",tableSelected:"LexicalEditorTheme__tableSelected",tableSelection:"LexicalEditorTheme__tableSelection",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"editor-upload"};var xo={namespace:"lexical",theme:ma};function pa({config:t,featureClientImportMap:e,featureClientSchemaMap:o,field:r,schemaPath:n,unSanitizedEditorConfig:l}){for(let c of l.features)if(!c?.clientFeatureProps?.featureKey||c?.clientFeatureProps?.order===void 0||c?.clientFeatureProps?.order===null)throw new Error("A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.");l.features=l.features.sort((c,d)=>c.clientFeatureProps.order-d.clientFeatureProps.order);let i=new Map;for(let c of l.features)i.set(c.clientFeatureProps.featureKey,c);let s=new Map,u=0;for(let c of l.features){let d=typeof c.feature=="function"?c.feature({config:t,featureClientImportMap:e,featureClientSchemaMap:o,featureProviderMap:i,field:r,resolvedFeatures:s,schemaPath:n,unSanitizedEditorConfig:l}):c.feature;d.key=c.clientFeatureProps.featureKey,d.order=u,s.set(c.clientFeatureProps.featureKey,d),u++}return s}import{deepMerge as ig}from"payload/shared";var fa=t=>{let e={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},o={};if(t.forEach(r=>{r.key==="toolbarFixed"&&r.sanitizedClientFeatureProps?.customGroups&&(o={...o,...r.sanitizedClientFeatureProps.customGroups})}),!t?.size)return e;t.forEach(r=>{if(r.providers?.length&&(e.providers=e.providers.concat(r.providers)),r.enableFormats?.length&&e.enabledFormats.push(...r.enableFormats),r.nodes?.length)for(let n of r.nodes)e.nodes.push(n);if(r.plugins?.length&&r.plugins.forEach((n,l)=>{e.plugins?.push({clientProps:r.sanitizedClientFeatureProps,Component:n.Component,key:r.key+l,position:n.position})}),r.toolbarInline?.groups?.length)for(let n of r.toolbarInline.groups){let l=e.toolbarInline.groups.find(i=>i.key===n.key);l?e.toolbarInline.groups=e.toolbarInline.groups.filter(i=>i.key!==n.key):l={...n,items:[]},n?.items?.length&&(l.items=l.items.concat(n.items)),e.toolbarInline?.groups.push(l)}if(r.toolbarFixed?.groups?.length)for(let n of r.toolbarFixed.groups){let l=e.toolbarFixed.groups.find(i=>i.key===n.key);l?e.toolbarFixed.groups=e.toolbarFixed.groups.filter(i=>i.key!==n.key):l={...n,items:[]},n?.items?.length&&(l.items=l.items.concat(n.items)),e.toolbarFixed?.groups.push(l)}if(r.slashMenu?.groups){r.slashMenu.dynamicGroups?.length&&(e.slashMenu.dynamicGroups=e.slashMenu.dynamicGroups.concat(r.slashMenu.dynamicGroups));for(let n of r.slashMenu.groups){let l=e.slashMenu.groups.find(i=>i.key===n.key);l?e.slashMenu.groups=e.slashMenu.groups.filter(i=>i.key!==n.key):l={...n,items:[]},n?.items?.length&&(l.items=l.items.concat(n.items)),e.slashMenu.groups.push(l)}}if(r.markdownTransformers?.length)for(let n of r.markdownTransformers)typeof n=="function"?e.markdownTransformers.push(n({allNodes:e.nodes,allTransformers:e.markdownTransformers})):e.markdownTransformers.push(n);e.enabledFeatures.push(r.key)}),Object.keys(o).length>0&&(e.toolbarFixed.groups=e.toolbarFixed.groups.map(r=>{let n=o[r.key];return n?ig(r,n):r})),e.toolbarInline.groups.sort((r,n)=>r.order&&n.order?r.order-n.order:r.order?-1:n.order?1:0),e.toolbarFixed.groups.sort((r,n)=>r.order&&n.order?r.order-n.order:r.order?-1:n.order?1:0);for(let r of e.toolbarInline.groups)r.items.sort((n,l)=>n.order&&l.order?n.order-l.order:n.order?-1:l.order?1:0);for(let r of e.toolbarFixed.groups)r.items.sort((n,l)=>n.order&&l.order?n.order-l.order:n.order?-1:l.order?1:0);return e};function Ar(t,e,o){return{admin:o,features:fa(t),lexical:e,resolvedFeatureMap:t}}var fg=ug(()=>import("./Field-PKJPWZJL.js").then(t=>({default:t.RichText}))),hg=t=>{let e=sg(16),{admin:o,clientFeatures:r,featureClientImportMap:n,featureClientSchemaMap:l,field:i,lexicalEditorConfig:s,schemaPath:u}=t,c;e[0]!==o?(c=o===void 0?{}:o,e[0]=o,e[1]=c):c=e[1];let d=c,a=s===void 0?xo:s,{config:p}=cg(),[m,f]=pg(null),h,g;e[2]!==d||e[3]!==r||e[4]!==p||e[5]!==n||e[6]!==l||e[7]!==i||e[8]!==m||e[9]!==a||e[10]!==u?(h=()=>{if(m)return;let T=[];for(let[_,x]of Object.entries(r))x.clientFeatureProvider&&T.push(x.clientFeatureProvider(x.clientFeatureProps));let I=a||xo,b=pa({config:p,featureClientImportMap:n,featureClientSchemaMap:l,field:i,schemaPath:u??i.name,unSanitizedEditorConfig:{features:T,lexical:I}});f(Ar(b,I,d))},g=[a,d,m,r,n,l,i,p,u],e[2]=d,e[3]=r,e[4]=p,e[5]=n,e[6]=l,e[7]=i,e[8]=m,e[9]=a,e[10]=u,e[11]=h,e[12]=g):(h=e[11],g=e[12]),mg(h,g);let k;return e[13]!==m||e[14]!==t?(k=Or(dg,{fallback:Or(ag,{height:"35vh"}),children:m&&Or(fg,{...t,editorConfig:m})}),e[13]=m,e[14]=t,e[15]=k):k=e[15],k};function gg(t){return t instanceof HTMLElement}function xg(...t){return t.filter(Boolean).join(" ")}var Co=new WeakMap;function ha(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function bo(t,e){let o=Co.get(t);if(o===void 0){let r=new Set,n=i=>{o!==void 0&&(o.start=ha(i))},l=i=>{if(o===void 0)return;let{start:s}=o;if(s===null)return;let u=ha(i);for(let c of r)u!==null&&c([u[0]-s[0],u[1]-s[1]],i)};t.addEventListener("touchstart",n),t.addEventListener("touchend",l),o={handleTouchend:l,handleTouchstart:n,listeners:r,start:null},Co.set(t,o)}return o.listeners.add(e),()=>{Cg(t,e)}}function Cg(t,e){let o=Co.get(t);if(o===void 0)return;let{listeners:r}=o;r.delete(e),r.size===0&&(Co.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function bg(t,e){return bo(t,(o,r)=>{let[n,l]=o;n<0&&-n>Math.abs(l)&&e(n,r)})}function kg(t,e){return bo(t,(o,r)=>{let[n,l]=o;n>0&&n>Math.abs(l)&&e(n,r)})}function _g(t,e){return bo(t,(o,r)=>{let[n,l]=o;l<0&&-l>Math.abs(n)&&e(n,r)})}function Tg(t,e){return bo(t,(o,r)=>{let[n,l]=o;l>0&&l>Math.abs(n)&&e(n,r)})}import{c as wg}from"react/compiler-runtime";import{jsx as Eg}from"react/jsx-runtime";import"react";var Sg=()=>{let t=wg(2),{EditButton:e}=me(),o;return t[0]!==e?(o=e?Eg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Ng}from"react/compiler-runtime";import{jsx as Lg}from"react/jsx-runtime";import"react";var yg=()=>{let t=Ng(2),{RemoveButton:e}=me(),o;return t[0]!==e?(o=e?Lg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Ig}from"react/compiler-runtime";import{jsx as Rg}from"react/jsx-runtime";import"react";var vg=()=>{let t=Ig(2),{Label:e}=me(),o;return t[0]!==e?(o=e?Rg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Mg}from"react/compiler-runtime";import{jsx as Dg}from"react/jsx-runtime";import"react";var Ag=t=>{let e=Mg(3),{children:o}=t,{InlineBlockContainer:r}=me(),n;return e[0]!==r||e[1]!==o?(n=r?Dg(r,{children:o}):null,e[0]=r,e[1]=o,e[2]=n):n=e[2],n};import{c as Og}from"react/compiler-runtime";import{jsx as Fg}from"react/jsx-runtime";import"react";var $g=t=>{let e=Og(6),{children:o,editButton:r,Label:n,removeButton:l}=t,{BlockCollapsible:i}=Re(),s;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==r||e[4]!==l?(s=i?Fg(i,{editButton:r,Label:n,removeButton:l,children:o}):null,e[0]=i,e[1]=n,e[2]=o,e[3]=r,e[4]=l,e[5]=s):s=e[5],s};import{c as Pg}from"react/compiler-runtime";import{jsx as Bg}from"react/jsx-runtime";import"react";var Hg=()=>{let t=Pg(2),{EditButton:e}=Re(),o;return t[0]!==e?(o=e?Bg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as jg}from"react/compiler-runtime";import{jsx as Ug}from"react/jsx-runtime";import"react";var Gg=()=>{let t=jg(2),{RemoveButton:e}=Re(),o;return t[0]!==e?(o=e?Ug(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{stringify as Wg}from"qs-esm";var Vg=({apiURL:t,depth:e,draft:o,locale:r})=>async({id:l,collectionSlug:i,select:s})=>{let u=Wg({depth:e??0,draft:o??!1,locale:r,select:s},{addQueryPrefix:!0});return await fetch(`${t}/${i}/${l}${u}`,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(d=>d.json())};import{c as Kg}from"react/compiler-runtime";import{jsx as ot}from"react/jsx-runtime";import{FieldContext as Jg,FieldPathContext as ga,ServerFunctionsContext as xa,ShimmerEffect as Xg,useServerFunctions as zg}from"@payloadcms/ui";import Zg,{useEffect as Yg,useRef as qg}from"react";var Qg=t=>{let e=Kg(9),{field:o,initialValue:r,Loading:n,path:l,schemaPath:i,setValue:s,value:u}=t,[c,d]=Zg.useState(null),a=zg(),{_internal_renderField:p}=a,[m,f]=i.split("."),h=l??(o&&"name"in o?o?.name:"")??"",g;e[0]!==p||e[1]!==o||e[2]!==r||e[3]!==l||e[4]!==i?(g=()=>{(async function(){let{Field:O}=await p({field:o,initialValue:r??void 0,path:l,schemaPath:i});d(O)})()},e[0]=p,e[1]=o,e[2]=r,e[3]=l,e[4]=i,e[5]=g):g=e[5];let k=g,T=qg(!1),I,b;if(e[6]!==k?(I=()=>{T.current||(T.current=!0,k())},b=[k],e[6]=k,e[7]=I,e[8]=b):(I=e[7],b=e[8]),Yg(I,b),!c)return typeof n<"u"?n:ot(Xg,{});let _={...a,getFormState:async w=>a.getFormState({...w,collectionSlug:m==="collection"?f:void 0,globalSlug:m==="global"?f:void 0})};if(typeof u>"u"&&!s)return ot(xa,{value:{..._},children:ot(ga,{value:h,children:c},h)});let x={disabled:!1,formInitializing:!1,formProcessing:!1,formSubmitted:!1,initialValue:u,path:h,setValue:s??ex,showError:!1,value:u};return ot(xa,{value:{..._},children:ot(ga,{value:h,children:ot(Jg,{value:x,children:c})},h)})};function ex(){}function tx({nodes:t,text:e}){let o={root:{type:"root",children:[],direction:"ltr",format:"",indent:0,version:1}};return e&&o.root.children.push({type:"paragraph",children:[{type:"text",detail:0,format:0,mode:"normal",style:"",text:e,version:1}],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),t?.length&&o.root.children.push(...t),o}export{ft as $createAutoLinkNode,Vt as $createBlockNode,To as $createInlineBlockNode,he as $createLinkNode,Fe as $createRelationshipNode,Pe as $createUploadNode,xe as $isAutoLinkNode,ut as $isBlockNode,wo as $isInlineBlockNode,J as $isLinkNode,cr as $isRelationshipNode,vr as $isUploadNode,Ra as AlignFeatureClient,ge as AutoLinkNode,$g as BlockCollapsible,Hg as BlockEditButton,pe as BlockNode,Gg as BlockRemoveButton,Oa as BlockquoteFeatureClient,Mc as BlocksFeatureClient,tu as BoldFeatureClient,re as CAN_USE_DOM,tp as ChecklistFeatureClient,Vp as DETAIL_TYPE_TO_DETAIL,jp as DOUBLE_LINE_BREAK,of as DebugJsxConverterFeatureClient,Jp as ELEMENT_FORMAT_TO_TYPE,Kp as ELEMENT_TYPE_TO_FORMAT,wa as ENABLE_SLASH_MENU_COMMAND,ba as EditorConfigProvider,rt as FieldsDrawer,S0 as FixedToolbarFeatureClient,Xu as HeadingFeatureClient,dd as HorizontalRuleFeatureClient,Ge as INSERT_BLOCK_COMMAND,We as INSERT_INLINE_BLOCK_COMMAND,Bp as IS_ALL_FORMATTING,Ld as IndentFeatureClient,Ag as InlineBlockContainer,Sg as InlineBlockEditButton,vg as InlineBlockLabel,_o as InlineBlockNode,yg as InlineBlockRemoveButton,iu as InlineCodeFeatureClient,F0 as InlineToolbarFeatureClient,uu as ItalicFeatureClient,Gp as LTR_REGEX,wp as LexicalPluginToLexicalFeatureClient,Hm as LinkFeatureClient,ee as LinkNode,Hp as NON_BREAKING_SPACE,A as NodeFormat,cp as OrderedListFeatureClient,vp as ParagraphFeatureClient,_a as Point,Up as RTL_REGEX,Ea as Rect,Gf as RelationshipFeatureClient,be as RelationshipNode,Qg as RenderLexical,hg as RichTextField,Ip as SlateToLexicalFeatureClient,hu as StrikethroughFeatureClient,bu as SubscriptFeatureClient,wu as SuperscriptFeatureClient,Xp as TEXT_MODE_TO_TYPE,Wp as TEXT_TYPE_TO_FORMAT,zp as TEXT_TYPE_TO_MODE,ae as TOGGLE_LINK_COMMAND,Lh as TableFeatureClient,Kc as TestRecorderFeatureClient,Bu as TextStateFeatureClient,St as ToolbarButton,$e as ToolbarDropdown,Yc as TreeViewFeatureClient,yu as UnderlineFeatureClient,xp as UnorderedListFeatureClient,lg as UploadFeatureClient,Te as UploadNode,Tg as addSwipeDownListener,bg as addSwipeLeftListener,kg as addSwipeRightListener,_g as addSwipeUpListener,tx as buildEditorState,jo as createBlockNode,y as createClientFeature,rf as defaultColors,xo as defaultEditorLexicalConfig,fr as getDOMRangeRect,Sa as getEnabledNodes,Vg as getRestPopulateFn,Ve as getSelectedNode,gg as isHTMLElement,Ta as isPoint,xg as joinClasses,Ar as sanitizeClientEditorConfig,fa as sanitizeClientFeatures,io as setFloatingElemPosition,eo as setFloatingElemPositionForLinkEditor,Z as slashMenuBasicGroupWithItems,fe as toolbarAddDropdownGroupWithItems,Go as toolbarFeatureButtonsGroupWithItems,Y as toolbarFormatGroupWithItems,Q as toolbarTextDropdownGroupWithItems,Re as useBlockComponentContext,H as useEditorConfigContext,me as useInlineBlockComponentContext,ka as useLexicalDocumentDrawer,de as useLexicalDrawer,Et as useLexicalListDrawer};
|
|
41
41
|
//# sourceMappingURL=index.js.map
|