@payloadcms/richtext-lexical 3.41.0-canary.1 → 3.41.0-internal.72eae46
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-EY5V65PS.js → Field-6GAC5Y2D.js} +2 -2
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/{chunk-DOZWITPU.js → chunk-LUNX5J6B.js} +2 -2
- package/dist/exports/client/{chunk-DOZWITPU.js.map → chunk-LUNX5J6B.js.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/plugin/index.js +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +1 -2
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +96 -124
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +3 -4
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +85 -179
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -4
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.js +1 -3
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/package.json +18 -15
- package/dist/scss/custom.css +0 -1
- /package/dist/exports/client/{Field-EY5V65PS.js.map → Field-6GAC5Y2D.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use client";import{a as
|
|
1
|
+
"use client";import{a as Ce,c as bo,d as ko,e as _o}from"./chunk-3BY5IZJD.js";import{a as at}from"./chunk-DBWINSQN.js";import{a as st,b as At,c as Ke}from"./chunk-FSKAVN4P.js";import{a as xe}from"./chunk-INBEEENE.js";import{a as fa}from"./chunk-F26IQ5RE.js";import{a as ce,c as Fr,d as Pr,e as ha,f as ga,h as xa,j as Ca,k as ba}from"./chunk-LUNX5J6B.js";import{a as pa,b as j}from"./chunk-BZZVLW4U.js";function ee(t){return{items:t,key:"basic",label:({i18n:e})=>e.t("lexical:general:slashMenuBasicGroupLabel")}}import{$isElementNode as Re,$isRangeSelection as $t,FORMAT_ELEMENT_COMMAND as Ft}from"lexical";import{jsx as To,jsxs as ka}from"react/jsx-runtime";import"react";var Br=()=>ka("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:[To("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),To("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),To("path",{d:"M5 15H15",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as wo,jsxs as _a}from"react/jsx-runtime";import"react";var Hr=()=>_a("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:[wo("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),wo("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),wo("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Eo,jsxs as Ta}from"react/jsx-runtime";import"react";var Ot=()=>Ta("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:"M2.5 15H12.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as No,jsxs as wa}from"react/jsx-runtime";import"react";var jr=()=>wa("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:"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:c,resolvedFeatures:u,schemaPath:d,unSanitizedEditorConfig:a})=>{let p=t({config:n,featureClientImportMap:l,featureClientSchemaMap:i,featureProviderMap:s,field:c,props:o,resolvedFeatures:u,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 Ur=t=>({type:"dropdown",ChildComponent:Ot,items:t,key:"align",order:30});var Gr=[Ur([{ChildComponent:Ot,isActive:({selection:t})=>{if(!$t(t))return!1;for(let e of t.getNodes()){if(Re(e)&&e.getFormatType()==="left")continue;let o=e.getParent();if(!(Re(o)&&o.getFormatType()==="left"))return!1}return!0},key:"alignLeft",label:({i18n:t})=>t.t("lexical:align:alignLeftLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Ft,"left")},order:1},{ChildComponent:Br,isActive:({selection:t})=>{if(!$t(t))return!1;for(let e of t.getNodes()){if(Re(e)&&e.getFormatType()==="center")continue;let o=e.getParent();if(!(Re(o)&&o.getFormatType()==="center"))return!1}return!0},key:"alignCenter",label:({i18n:t})=>t.t("lexical:align:alignCenterLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Ft,"center")},order:2},{ChildComponent:jr,isActive:({selection:t})=>{if(!$t(t))return!1;for(let e of t.getNodes()){if(Re(e)&&e.getFormatType()==="right")continue;let o=e.getParent();if(!(Re(o)&&o.getFormatType()==="right"))return!1}return!0},key:"alignRight",label:({i18n:t})=>t.t("lexical:align:alignRightLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Ft,"right")},order:3},{ChildComponent:Hr,isActive:({selection:t})=>{if(!$t(t))return!1;for(let e of t.getNodes()){if(Re(e)&&e.getFormatType()==="justify")continue;let o=e.getParent();if(!(Re(o)&&o.getFormatType()==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:t})=>t.t("lexical:align:alignJustifyLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Ft,"justify")},order:4}])],Ea=y({toolbarFixed:{groups:Gr},toolbarInline:{groups:Gr}});import{$createQuoteNode as Zr,$isQuoteNode as Xr,QuoteNode as La}from"@lexical/rich-text";import{$setBlocksType as Yr}from"@lexical/selection";import{$getSelection as qr,$isRangeSelection as ya}from"lexical";import{jsx as Wr}from"react/jsx-runtime";import"react";var So=()=>Wr("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:Wr("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 Vr}from"react/jsx-runtime";import"react";var ct=()=>Vr("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:Vr("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 le=t=>({type:"dropdown",ChildComponent:ct,items:t,key:"text",order:25});import{$createQuoteNode as Na,$isQuoteNode as Kr,QuoteNode as Sa}from"@lexical/rich-text";var Jr={type:"element",dependencies:[Sa],export:(t,e)=>{if(!Kr(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(Yr(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 en=[le([{ChildComponent:yo,isActive:({selection:t})=>{if(!va(t))return!1;for(let e of t.getNodes())if(!Qr(e)&&!Qr(e.getParent()))return!1;return!0},key:"blockquote",label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=rn();on(e,()=>tn())})},order:20}])],Ma=y({markdownTransformers:[qr],nodes:[Ra],slashMenu:{groups:[ee([{Icon:yo,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=rn();on(e,()=>tn())})}}])]},toolbarFixed:{groups:en},toolbarInline:{groups:en}});import{getTranslation as Kt}from"@payloadcms/translations";import{jsx as Io,jsxs as Aa}from"react/jsx-runtime";import"react";var Bt=()=>Aa("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 nn}from"react/jsx-runtime";import"react";var Ht=()=>nn("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",{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 Da}from"react/jsx-runtime";import"react";function jt(t,e){return t?()=>Da("img",{alt:e??"Block Image",className:"lexical-block-custom-image",src:t,style:{maxHeight:20,maxWidth:20}}):Bt}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 ut=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 ut({fields:{...t,id:t?.id||new $a.default().toHexString()}})}import{jsx as Z,jsxs as dt,Fragment as Wa}from"react/jsx-runtime";import{Button as cn,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 un,useEditDepth as rc,useFormSubmitted as nc,useServerFunctions as lc,useTranslation as ic}from"@payloadcms/ui";import{abortAndIgnore as Ro}from"@payloadcms/ui/shared";import{deepCopyObjectSimpleWithoutReactComponents as Gt,reduceFieldsToValues as dn}from"payload/shared";import mt,{useCallback as vo,useEffect as Mo,useMemo as pt,useRef as Ao}from"react";import{useLexicalComposerContext as sc}from"@lexical/react/LexicalComposerContext";import{getTranslation as ac}from"@payloadcms/translations";import{$getNodeByKey as Wt}from"lexical";import{v4 as cc}from"uuid";import{c as Pa}from"react/compiler-runtime";import{jsx as Ut,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 ln=Ga({initialState:!1}),$e=()=>Ua.use(ln),sn=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=k=>Ut(r,{editButton:k.editButton,errorCount:i,fieldHasErrors:p,Label:k.Label,removeButton:k.removeButton,children:k.children}),e[0]=r,e[1]=i,e[2]=p,e[3]=f):f=e[3],m=f;let h=m,x;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?(x=n?Ba(ln,{value:{BlockCollapsible:h,EditButton:l,initialState:u,nodeKey:c,RemoveButton:d},children:[n,Ut(o,{})]}):Ut(h,{children:Ut(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]=x):x=e[12],x};function an({fields:t}){for(let e in t){let o=t[e];Array.isArray(o?.rows)&&"value"in o&&(o.disableFormData=!0)}return t}var de="lexical-block",mn=t=>{let{cacheBuster:e,formData:o,nodeKey:r}=t,n=nc(),{id:l,collectionSlug:i,globalSlug:s}=un(),{fieldProps:{featureClientSchemaMap:u,field:c,initialLexicalFormState:d,permissions:a,readOnly:p,schemaPath:m},uuid:f}=G(),{fields:h}=oc(),x=Ao(new AbortController),k=rc(),[I,A]=mt.useState(0),{config:b}=tc(),_=Za({slug:`lexical-blocks-create-${f}-${o.id}`,depth:k}),{toggleDrawer:g}=Ce(_),{getDocPreferences:w,setDocFieldPreferences:M}=un(),[D]=sc(),{getFormState:P}=lc(),v=`${m}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}.fields`,[N,C]=mt.useState(()=>d?.[o.id]?.formState?{...d?.[o.id]?.formState,blockName:{initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName}}:!1),E=Ao(!1),L=Ao(e);Mo(()=>{E.current?(L.current!==e&&C(!1),L.current=e):E.current=!0},[e]);let[S,R]=mt.useState(N?._components?.customComponents?.BlockLabel),[T,$]=mt.useState(N?._components?.customComponents?.Block);Mo(()=>{let V=new AbortController;return o&&!N&&(async()=>{let{state:X}=await P({id:l,collectionSlug:i,data:o,docPermissions:{fields:!0},docPreferences:await w(),documentFormState:Gt(h),globalSlug:s,initialBlockData:o,operation:"update",renderAllFields:!0,schemaPath:v,signal:V.signal});if(X){X.blockName={initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName};let Q=dn(Gt(X),!0);D.update(()=>{let z=Wt(r);if(z&&ft(z)){let ae=Q;ae.blockType=o.blockType,z.setFields(ae,!0)}}),C(X),R(X._components?.customComponents?.BlockLabel),$(X._components?.customComponents?.Block)}})(),()=>{Ro(V)}},[P,v,l,o,D,r,N,i,s,w,h]);let[F,W]=mt.useState(d?.[o.id]?.collapsed??!1),K=`${m}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}`,j=u.blocks?.[K]?.[0],U=j.blockReferences?typeof j?.blockReferences?.[0]=="string"?b.blocksMap[j?.blockReferences?.[0]]:j?.blockReferences?.[0]:j?.blocks?.[0],{i18n:oe,t:ue}=ic(),q=vo(async({formState:V,submit:he})=>{Ro(x.current);let X=new AbortController;x.current=X;let{state:Q}=await P({id:l,collectionSlug:i,docPermissions:{fields:!0},docPreferences:await w(),documentFormState:Gt(h),formState:V,globalSlug:s,initialBlockFormState:V,operation:"update",renderAllFields:!!he,schemaPath:v,signal:X.signal});if(!Q)return V;V.blockName&&(Q.blockName=V.blockName);let z=dn(an({fields:Gt(Q)}),!0);if(setTimeout(()=>{D.update(()=>{let ae=Wt(r);if(ae&&ft(ae)){let Ve=z;Ve.blockType=o.blockType,ae.setFields(Ve,!0)}})},0),he){R(Q._components?.customComponents?.BlockLabel),$(Q._components?.customComponents?.Block);let ae=0;for(let Ve of Object.values(Q))Ve?.valid===!1&&ae++;A(ae)}return Q},[P,l,i,w,s,v,o.blockType,h,D,r]);Mo(()=>()=>{Ro(x.current)},[]);let J=vo(()=>{D.update(()=>{Wt(r)?.remove()})},[D,r]),re=U?.labels?.singular?ac(U.labels.singular,oe):U?.slug,ne=vo(V=>{w().then(he=>{let Q=he?.fields?.[c.name]?.collapsed,z=Q&&Q?.length?Q:[];V?z.includes(o.id)||z.push(o.id):z.includes(o.id)&&z.splice(z.indexOf(o.id),1),M(c.name,{collapsed:z,hello:"hi"})})},[w,c.name,M,o.id]),se=pt(()=>()=>Z(cn,{buttonStyle:"icon-label",className:`${de}__editButton`,disabled:p,el:"button",icon:"edit",onClick:V=>(V.preventDefault(),V.stopPropagation(),g(),!1),onMouseDown:V=>{V.preventDefault()},round:!0,size:"small",tooltip:ue("lexical:blocks:inlineBlocks:edit",{label:re})}),[re,p,ue,g]),Oe=pt(()=>()=>Z(cn,{buttonStyle:"icon-label",className:`${de}__removeButton`,disabled:c?.admin?.readOnly||!1,icon:"x",onClick:V=>{V.preventDefault(),J()},round:!0,tooltip:"Remove Block"}),[c?.admin?.readOnly,J]),it=pt(()=>({children:V,disableBlockName:he,editButton:X,errorCount:Q,fieldHasErrors:z,Label:ae,removeButton:Ve})=>Z("div",{className:de+" "+de+"-"+o.blockType,children:Z(Va,{className:[`${de}__row`,z?`${de}__row--has-errors`:`${de}__row--no-errors`].join(" "),collapsibleStyle:z?"error":"default",header:dt("div",{className:`${de}__block-header`,children:[ae??S?ae??S:dt("div",{children:[Z(qa,{className:`${de}__block-pill ${de}__block-pill-${o?.blockType}`,pillStyle:"white",size:"small",children:re??o?.blockType}),!he&&!U?.admin?.disableBlockName&&Z(ec,{path:"blockName",readOnly:c?.admin?.readOnly||!1}),z&&Z(Xa,{count:Q??0,i18n:oe,withMessage:!0})]}),dt("div",{children:[T&&X!==!1||!T&&X?Z(se,{}):null,Ve!==!1&&D.isEditable()?Z(Oe,{}):null]})]}),isCollapsed:F,onToggle:jr=>{ne(jr),W(jr)},children:V},0)}),[T,S,se,Oe,re,U?.admin?.disableBlockName,D,o.blockType,oe,F,ne,c?.admin?.readOnly]),Hr=pt(()=>()=>Z(Ja,{children:Z(Ka,{className:"",slug:_,title:ue(`lexical:blocks:inlineBlocks:${o?.id?"edit":"create"}`,{label:re??ue("lexical:blocks:inlineBlocks:label")}),children:N?dt(Wa,{children:[Z(Qa,{fields:U?.fields??[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:v,permissions:!0,readOnly:!1}),Z(Ya,{programmaticSubmit:!0,children:ue("fields:saveChanges")})]}):null})}),[N,_,re,ue,U?.fields,v,a]),ha=pt(()=>N?Z(za,{beforeSubmit:[async({formState:V})=>await q({formState:V,submit:!0})],el:"div",fields:U?.fields??[],initialState:N,onChange:[q],onSubmit:(V,he)=>{he.blockType=o.blockType,D.update(()=>{let X=Wt(r);X&&ft(X)&&X.setFields(he,!0)}),g()},submitted:n,uuid:cc(),children:Z(sn,{baseClass:de,BlockDrawer:Hr,Collapsible:it,CustomBlock:T,EditButton:se,errorCount:I,formSchema:U?.fields??[],initialState:N,nodeKey:r,RemoveButton:Oe})}):null,[it,Hr,T,U?.fields,Oe,se,D,I,g,U?.fields,N,r,q,n]);return U?ha:Z(it,{disableBlockName:!0,fieldHasErrors:!0,children:dt("div",{className:"lexical-block-not-found",children:["Error: Block '",o.blockType,"' not found in the config but exists in the lexical data"]})})};var ke=class extends ut{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 uc(mn,{cacheBuster:this.getCacheBuster(),formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Vt(t){return new ke({fields:{...t,id:t?.id||new dc.default().toHexString()}})}function ft(t){return t instanceof ke}import{createCommand as pn}from"lexical";var Je=pn("INSERT_BLOCK_COMMAND"),Xe=pn("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 fn}from"lexical";import{useEffect as Lc,useState as yc}from"react";var hn=()=>{let t=mc(12),[e]=pc(),[o,r]=yc(null),{setCreatedInlineBlock:n,uuid:l}=G(),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}=Ce(c,!0),a;t[3]!==e||t[4]!==n||t[5]!==o?(a=()=>{if(!e.hasNodes([ke]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return gc(e.registerCommand(Je,m=>(e.update(()=>{let f=Tc()||_c();if(Nc(f)){let h=Vt(m),{focus:x}=f,k=x.getNode();fc(h),Ec(k)&&!k.__first&&k.remove()}}),!0),fn),e.registerCommand(Xe,m=>{if(o){let h=kc(o);return!h||!wo(h)?!1:(h.setFields(m),r(null),!0)}let f=To(m);return n?.(f),wc([f]),Sc(f.getParentOrThrow())&&hc(f,bc).selectEnd(),!0},fn))},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:[ke,_o],plugins:[{Component:hn,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(Je,{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(Xe,{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(Je,{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(Xe,{blockName:"",blockType:a.slug})},order:p})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}});import{c as Mc}from"react/compiler-runtime";import{jsx as Pe,jsxs as Fo}from"react/jsx-runtime";import{useLexicalComposerContext as Ac}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as Dc,$createTextNode as Oc,$getRoot as $c,getDOMSelection as Do}from"lexical";import*as kn from"react";import{useCallback as Fe,useEffect as Oo,useLayoutEffect as xn,useRef as $o,useState as Jt}from"react";var Rc=ce&&"documentMode"in document?document.documentMode:null,gn=ce&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),zx=ce&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Zx=ce&&"InputEvent"in window&&!Rc?"getTargetRanges"in new window.InputEvent("input"):!1,Yx=ce&&/Version\/[\d.].*Safari/.test(navigator.userAgent),qx=ce&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Qx=ce&&/Android/.test(navigator.userAgent),eC=ce&&/Win/.test(navigator.platform),vc=ce&&/^(?=.*Chrome).*/i.test(navigator.userAgent),tC=ce&&/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(Kr(l)){l.splice(l.getChildrenSize(),0,[...e]),l.select(0,0),t.remove();return}}let n=Na();n.append(...e),t.replace(n),n.select(0,0)}};var zr=[le([{ChildComponent:So,isActive:({selection:t})=>{if(!ya(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}])],Ia=y({markdownTransformers:[Jr],nodes:[La],slashMenu:{groups:[ee([{Icon:So,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 Lo,jsxs as Ra}from"react/jsx-runtime";import"react";var Pt=()=>Ra("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("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"8",y:"5"}),Lo("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"5",y:"11"}),Lo("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 va}from"react/jsx-runtime";import"react";function Ht(t,e){return t?()=>va("img",{alt:e??"Block Image",className:"lexical-block-custom-image",src:t,style:{maxHeight:20,maxWidth:20}}):Pt}import{jsx as sc}from"react/jsx-runtime";import ac from"bson-objectid";import"react";import{DecoratorBlockNode as Ma}from"@lexical/react/LexicalDecoratorBlockNode.js";import Da from"bson-objectid";var ut=class extends Ma{__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=Aa(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 Aa(t){return new ut({fields:{...t,id:t?.id||new Da.default().toHexString()}})}import{jsx as z,jsxs as dt,Fragment as ja}from"react/jsx-runtime";import{Button as rn,Collapsible as Ua,Drawer as Ga,EditDepthProvider as Wa,ErrorPill as Va,Form as Ka,formatDrawerSlug as Ja,FormSubmit as Xa,Pill as za,RenderFields as Za,SectionTitle as Ya,useConfig as qa,useDocumentForm as Qa,useDocumentInfo as nn,useEditDepth as ec,useFormSubmitted as tc,useServerFunctions as oc,useTranslation as rc}from"@payloadcms/ui";import{abortAndIgnore as yo}from"@payloadcms/ui/shared";import{deepCopyObjectSimpleWithoutReactComponents as Ut,reduceFieldsToValues as ln}from"payload/shared";import mt,{useCallback as Io,useEffect as Ro,useMemo as pt,useRef as vo}from"react";import{useLexicalComposerContext as nc}from"@lexical/react/LexicalComposerContext";import{getTranslation as lc}from"@payloadcms/translations";import{$getNodeByKey as Gt}from"lexical";import{v4 as ic}from"uuid";import{c as Oa}from"react/compiler-runtime";import{jsx as jt,jsxs as $a}from"react/jsx-runtime";import{RenderFields as Fa,useFormSubmitted as Pa}from"@payloadcms/ui";import Ba,{createContext as Ha}from"react";var en=Ha({initialState:!1}),Oe=()=>Ba.use(en),tn=t=>{let e=Oa(13),{BlockDrawer:o,Collapsible:r,CustomBlock:n,EditButton:l,errorCount:i,formSchema:s,initialState:c,nodeKey:u,RemoveButton:d}=t,p=Pa()&&i>0,m,f;e[0]!==r||e[1]!==i||e[2]!==p?(f=x=>jt(r,{editButton:x.editButton,errorCount:i,fieldHasErrors:p,Label:x.Label,removeButton:x.removeButton,children:x.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]!==c||e[11]!==u?(g=n?$a(en,{value:{BlockCollapsible:h,EditButton:l,initialState:c,nodeKey:u,RemoveButton:d},children:[n,jt(o,{})]}):jt(h,{children:jt(Fa,{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]=c,e[11]=u,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 de="lexical-block",sn=t=>{let{cacheBuster:e,formData:o,nodeKey:r}=t,n=tc(),{id:l,collectionSlug:i,globalSlug:s}=nn(),{fieldProps:{featureClientSchemaMap:c,field:u,initialLexicalFormState:d,permissions:a,readOnly:p,schemaPath:m},uuid:f}=j(),{fields:h}=Qa(),g=vo(new AbortController),x=ec(),[S,D]=mt.useState(0),{config:k}=qa(),_=Ja({slug:`lexical-blocks-create-${f}-${o.id}`,depth:x}),{toggleDrawer:b}=xe(_),{getDocPreferences:N,setDocFieldPreferences:M}=nn(),[O]=nc(),{getFormState:F}=oc(),I=`${m}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}.fields`,[w,C]=mt.useState(()=>d?.[o.id]?.formState?{...d?.[o.id]?.formState,blockName:{initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName}}:!1),E=vo(!1),R=vo(e);Ro(()=>{E.current?(R.current!==e&&C(!1),R.current=e):E.current=!0},[e]);let[L,v]=mt.useState(w?._components?.customComponents?.BlockLabel),[T,$]=mt.useState(w?._components?.customComponents?.Block);Ro(()=>{let G=new AbortController;return o&&!w&&(async()=>{let{state:J}=await F({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:G.signal});if(J){J.blockName={initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName};let Q=ln(Ut(J),!0);O.update(()=>{let X=Gt(r);if(X&&ft(X)){let ae=Q;ae.blockType=o.blockType,X.setFields(ae,!0)}}),C(J),v(J._components?.customComponents?.BlockLabel),$(J._components?.customComponents?.Block)}})(),()=>{yo(G)}},[F,I,l,o,O,r,w,i,s,N,h]);let[H,W]=mt.useState(d?.[o.id]?.collapsed??!1),Y=`${m}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}`,V=c.blocks?.[Y]?.[0],U=V.blockReferences?typeof V?.blockReferences?.[0]=="string"?k.blocksMap[V?.blockReferences?.[0]]:V?.blockReferences?.[0]:V?.blocks?.[0],{i18n:oe,t:ue}=rc(),q=Io(async({formState:G,submit:fe})=>{yo(g.current);let J=new AbortController;g.current=J;let{state:Q}=await F({id:l,collectionSlug:i,docPermissions:{fields:!0},docPreferences:await N(),documentFormState:Ut(h),formState:G,globalSlug:s,initialBlockFormState:G,operation:"update",renderAllFields:!!fe,schemaPath:I,signal:J.signal});if(!Q)return G;G.blockName&&(Q.blockName=G.blockName);let X=ln(on({fields:Ut(Q)}),!0);if(setTimeout(()=>{O.update(()=>{let ae=Gt(r);if(ae&&ft(ae)){let Ve=X;Ve.blockType=o.blockType,ae.setFields(Ve,!0)}})},0),fe){v(Q._components?.customComponents?.BlockLabel),$(Q._components?.customComponents?.Block);let ae=0;for(let Ve of Object.values(Q))Ve?.valid===!1&&ae++;D(ae)}return Q},[F,l,i,N,s,I,o.blockType,h,O,r]);Ro(()=>()=>{yo(g.current)},[]);let K=Io(()=>{O.update(()=>{Gt(r)?.remove()})},[O,r]),re=U?.labels?.singular?lc(U.labels.singular,oe):U?.slug,ne=Io(G=>{N().then(fe=>{let Q=fe?.fields?.[u.name]?.collapsed,X=Q&&Q?.length?Q:[];G?X.includes(o.id)||X.push(o.id):X.includes(o.id)&&X.splice(X.indexOf(o.id),1),M(u.name,{collapsed:X,hello:"hi"})})},[N,u.name,M,o.id]),se=pt(()=>()=>z(rn,{buttonStyle:"icon-label",className:`${de}__editButton`,disabled:p,el:"button",icon:"edit",onClick:G=>(G.preventDefault(),G.stopPropagation(),b(),!1),onMouseDown:G=>{G.preventDefault()},round:!0,size:"small",tooltip:ue("lexical:blocks:inlineBlocks:edit",{label:re})}),[re,p,ue,b]),Ae=pt(()=>()=>z(rn,{buttonStyle:"icon-label",className:`${de}__removeButton`,disabled:u?.admin?.readOnly||!1,icon:"x",onClick:G=>{G.preventDefault(),K()},round:!0,tooltip:"Remove Block"}),[u?.admin?.readOnly,K]),it=pt(()=>({children:G,disableBlockName:fe,editButton:J,errorCount:Q,fieldHasErrors:X,Label:ae,removeButton:Ve})=>z("div",{className:de+" "+de+"-"+o.blockType,children:z(Ua,{className:[`${de}__row`,X?`${de}__row--has-errors`:`${de}__row--no-errors`].join(" "),collapsibleStyle:X?"error":"default",header:dt("div",{className:`${de}__block-header`,children:[ae??L?ae??L:dt("div",{children:[z(za,{className:`${de}__block-pill ${de}__block-pill-${o?.blockType}`,pillStyle:"white",size:"small",children:re??o?.blockType}),!fe&&!U?.admin?.disableBlockName&&z(Ya,{path:"blockName",readOnly:u?.admin?.readOnly||!1}),X&&z(Va,{count:Q??0,i18n:oe,withMessage:!0})]}),dt("div",{children:[T&&J!==!1||!T&&J?z(se,{}):null,Ve!==!1&&O.isEditable()?z(Ae,{}):null]})]}),isCollapsed:H,onToggle:$r=>{ne($r),W($r)},children:G},0)}),[T,L,se,Ae,re,U?.admin?.disableBlockName,O,o.blockType,oe,H,ne,u?.admin?.readOnly]),Or=pt(()=>()=>z(Wa,{children:z(Ga,{className:"",slug:_,title:ue(`lexical:blocks:inlineBlocks:${o?.id?"edit":"create"}`,{label:re??ue("lexical:blocks:inlineBlocks:label")}),children:w?dt(ja,{children:[z(Za,{fields:U?.fields??[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:I,permissions:!0,readOnly:!1}),z(Xa,{programmaticSubmit:!0,children:ue("fields:saveChanges")})]}):null})}),[w,_,re,ue,U?.fields,I,a]),ma=pt(()=>w?z(Ka,{beforeSubmit:[async({formState:G})=>await q({formState:G,submit:!0})],el:"div",fields:U?.fields??[],initialState:w,onChange:[q],onSubmit:(G,fe)=>{fe.blockType=o.blockType,O.update(()=>{let J=Gt(r);J&&ft(J)&&J.setFields(fe,!0)}),b()},submitted:n,uuid:ic(),children:z(tn,{baseClass:de,BlockDrawer:Or,Collapsible:it,CustomBlock:T,EditButton:se,errorCount:S,formSchema:U?.fields??[],initialState:w,nodeKey:r,RemoveButton:Ae})}):null,[it,Or,T,U?.fields,Ae,se,O,S,b,U?.fields,w,r,q,n]);return U?ma:z(it,{disableBlockName:!0,fieldHasErrors:!0,children:dt("div",{className:"lexical-block-not-found",children:["Error: Block '",o.blockType,"' not found in the config but exists in the lexical data"]})})};var be=class extends ut{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 sc(sn,{cacheBuster:this.getCacheBuster(),formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Wt(t){return new be({fields:{...t,id:t?.id||new ac.default().toHexString()}})}function ft(t){return t instanceof be}import{createCommand as an}from"lexical";var Je=an("INSERT_BLOCK_COMMAND"),Xe=an("INSERT_INLINE_BLOCK_COMMAND");import{c as cc}from"react/compiler-runtime";import{useLexicalComposerContext as uc}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as dc,$wrapNodeInElement as mc,mergeRegister as pc}from"@lexical/utils";import{formatDrawerSlug as fc,useEditDepth as hc}from"@payloadcms/ui";import{$createParagraphNode as gc,$getNodeByKey as xc,$getPreviousSelection as Cc,$getSelection as bc,$insertNodes as kc,$isParagraphNode as _c,$isRangeSelection as Tc,$isRootOrShadowRoot as wc,COMMAND_PRIORITY_EDITOR as cn}from"lexical";import{useEffect as Ec,useState as Nc}from"react";var un=()=>{let t=cc(12),[e]=uc(),[o,r]=Nc(null),{setCreatedInlineBlock:n,uuid:l}=j(),i=hc(),s="lexical-inlineBlocks-create-"+l,c;t[0]!==i||t[1]!==s?(c=fc({slug:s,depth:i}),t[0]=i,t[1]=s,t[2]=c):c=t[2];let u=c,{toggleDrawer:d}=xe(u,!0),a;t[3]!==e||t[4]!==n||t[5]!==o?(a=()=>{if(!e.hasNodes([be]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return pc(e.registerCommand(Je,m=>(e.update(()=>{let f=bc()||Cc();if(Tc(f)){let h=Wt(m),{focus:g}=f,x=g.getNode();dc(h),_c(x)&&!x.__first&&x.remove()}}),!0),cn),e.registerCommand(Xe,m=>{if(o){let h=xc(o);return!h||!_o(h)?!1:(h.setFields(m),r(null),!0)}let f=ko(m);return n?.(f),kc([f]),wc(f.getParentOrThrow())&&mc(f,gc).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],Ec(a,p),null};var Sc=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]),c=Object.entries(i).filter(([a])=>a.startsWith(l+".")&&!a.replace(l+".","").includes(".")).map(([,a])=>a[0]),u=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=c.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:[be,bo],plugins:[{Component:un,position:"normal"}],sanitizedClientFeatureProps:o,slashMenu:{groups:[u?.length?{items:u.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(Je,{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(Xe,{blockName:"",blockType:a.slug})}})),key:"inlineBlocks",label:({i18n:a})=>a.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[u.length?{type:"dropdown",ChildComponent:Pt,items:u.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(Je,{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(Xe,{blockName:"",blockType:a.slug})},order:p})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}});import{c as Ic}from"react/compiler-runtime";import{jsx as Fe,jsxs as Oo}from"react/jsx-runtime";import{useLexicalComposerContext as Rc}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as vc,$createTextNode as Mc,$getRoot as Dc,getDOMSelection as Mo}from"lexical";import*as hn from"react";import{useCallback as $e,useEffect as Do,useLayoutEffect as mn,useRef as Ao,useState as Kt}from"react";var Lc=ce&&"documentMode"in document?document.documentMode:null,dn=ce&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),e2=ce&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),t2=ce&&"InputEvent"in window&&!Lc?"getTargetRanges"in new window.InputEvent("input"):!1,o2=ce&&/Version\/[\d.].*Safari/.test(navigator.userAgent),r2=ce&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,n2=ce&&/Android/.test(navigator.userAgent),l2=ce&&/Win/.test(navigator.platform),yc=ce&&/^(?=.*Chrome).*/i.test(navigator.userAgent),i2=ce&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!yc;var Ac=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)},Oc=(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)},$c=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 Fc(t){return t.key.toLowerCase()==="a"&&(dn?t.metaKey:t.ctrlKey)}function Pc(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 pn(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 fn=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Delete","Enter","Escape"]);function Bc(t){let[e,o]=Kt([]),[r,n]=Kt(!1),[,l]=Kt(""),[i,s]=Kt(""),c=Ao(null),u=Ao(!1),d=Ao(null),a=$e(()=>t,[t]),p=$e(()=>{let k=t.getRootElement(),_=Mo(t._window);return k==null||_==null||_.anchorNode==null||_.focusNode==null||!k.contains(_.anchorNode)||!k.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($c).join(`
|
|
31
31
|
`)}
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
|
-
`},[t,e]),m=Fe((b,_)=>{o(g=>{let w=e.length-1,M=e[w];if(M&&M.name===b){if(b==="type")return[...e.slice(0,w),{...M,value:M.value+_}];if(M.value===_)return[...e.slice(0,w),{...M,count:M.count+1}]}return[...g,{name:b,count:1,value:_}]})},[e,o]);xn(()=>{let b=g=>{if(!r)return;let w=g.key;Hc(g)?m("selectAll",""):bn.has(w)?m("press",g.key):[...w].length>1?m("keydown",g.key):m("type",g.key)},_=g=>{if(!r)return;let w=g.key;!bn.has(w)&&[...w].length>1&&m("keyup",g.key)};return t.registerRootListener((g,w)=>{w!==null&&(w.removeEventListener("keydown",b),w.removeEventListener("keyup",_)),g!==null&&(g.addEventListener("keydown",b),g.addEventListener("keyup",_))})},[t,r,m]),xn(()=>{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:g,editorState:w})=>{if(!r)return;let M=w._selection,D=u.current,P=c.current;if(D!==M){if(g.size===0&&_.size===0&&!P){let N=Do(t._window);if(N&&(N.anchorNode==null||N.focusNode==null))return}u.current=M}c.current=!1;let v=p();v!==null&&s(v)}),[t,p,r,m]),Oo(()=>r?t.registerUpdateListener(()=>{let _=t.getRootElement();_!==null&&l(_?.innerHTML)}):void 0,[t,r]);let f=Fe(b=>{r||(b.update(()=>{let _=$c();_.clear();let g=Oc();_.append(Dc().append(g)),g.select()}),o([])),n(_=>!_)},[r]),h=Fe(()=>{if(!r)return;let b=Do(t._window);if(b===null||b.anchorNode==null||b.focusNode==null)return;let{anchorNode:_,anchorOffset:g,focusNode:w,focusOffset:M}=jc(b),D=a().getRootElement(),P;_!==null&&(P=Cn(_,D));let v;w!==null&&(v=Cn(w,D)),m("snapshot",{anchorNode:_,anchorOffset:g,anchorPath:P,focusNode:w,focusOffset:M,focusPath:v})},[m,r,a]),x=Fe(()=>{Fc(p())},[p]),k=Fe(()=>{Pc("test.js",p())},[p]);return[Pe("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?Fo("div",{className:"test-recorder-output",children:[Fo("div",{className:"test-recorder-toolbar",children:[Pe("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:b=>{h(),b.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Pe("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:b=>{x(),b.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Pe("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:b=>{k(),b.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Pe("pre",{id:"test-recorder",ref:d,children:i})]}):null]}var _n=()=>{let t=Mc(3),[e]=Ac(),[o,r]=Uc(e),n;return t[0]!==o||t[1]!==r?(n=Fo(kn.Fragment,{children:[Pe("p",{children:"HI"}),o,r,Pe("p",{children:"DONE"})]}),t[0]=o,t[1]=r,t[2]=n):n=t[2],n};var Gc=y({plugins:[{Component:_n,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 Tn=()=>{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:Tn,position:"bottom"}]});import{$isTableSelection as zc}from"@lexical/table";import{$isRangeSelection as Zc,FORMAT_TEXT_COMMAND as Yc}from"lexical";import{jsx as wn}from"react/jsx-runtime";import"react";var En=()=>wn("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:"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 te=t=>({type:"buttons",items:t,key:"format",order:40});var Nn={type:"text-format",format:["bold","italic"],tag:"***"},Sn={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},Ln={type:"text-format",format:["bold"],tag:"**"},yn={type:"text-format",format:["bold"],intraword:!1,tag:"__"};var In=[te([{ChildComponent:En,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=[Ln,yn];return t.get("italic")&&e.push(Sn,Nn),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:In},toolbarInline:{groups:In}}});import{$isTableSelection as eu}from"@lexical/table";import{$isRangeSelection as tu,FORMAT_TEXT_COMMAND as ou}from"lexical";import{jsx as Rn,jsxs as Qc}from"react/jsx-runtime";import"react";var vn=()=>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:[Rn("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),Rn("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]});var Mn={type:"text-format",format:["code"],tag:"`"};var An=[te([{ChildComponent:vn,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:[Mn],toolbarFixed:{groups:An},toolbarInline:{groups:An}});import{$isTableSelection as nu}from"@lexical/table";import{$isRangeSelection as lu,FORMAT_TEXT_COMMAND as iu}from"lexical";import{jsx as Dn}from"react/jsx-runtime";import"react";var On=()=>Dn("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:Dn("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 $n={type:"text-format",format:["italic"],tag:"*"},Fn={type:"text-format",format:["italic"],intraword:!1,tag:"_"};var Pn=[te([{ChildComponent:On,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:[$n,Fn],toolbarFixed:{groups:Pn},toolbarInline:{groups:Pn}});import{$isTableSelection as cu}from"@lexical/table";import{$isRangeSelection as uu,FORMAT_TEXT_COMMAND as du}from"lexical";import{jsx as Bn,jsxs as au}from"react/jsx-runtime";import"react";var Hn=()=>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:[Bn("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"}),Bn("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]});var jn={type:"text-format",format:["strikethrough"],tag:"~~"};var Un=[te([{ChildComponent:Hn,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:[jn],toolbarFixed:{groups:Un},toolbarInline:{groups:Un}});import{$isTableSelection as pu}from"@lexical/table";import{$isRangeSelection as fu,FORMAT_TEXT_COMMAND as hu}from"lexical";import{jsx as Gn}from"react/jsx-runtime";import"react";var Wn=()=>Gn("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:Gn("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 Vn=[te([{ChildComponent:Wn,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:Vn},toolbarInline:{groups:Vn}});import{$isTableSelection as xu}from"@lexical/table";import{$isRangeSelection as Cu,FORMAT_TEXT_COMMAND as bu}from"lexical";import{jsx as Kn}from"react/jsx-runtime";import"react";var Jn=()=>Kn("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:Kn("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 Xn=[te([{ChildComponent:Jn,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:Xn},toolbarInline:{groups:Xn}});import{$isTableSelection as Tu}from"@lexical/table";import{$isRangeSelection as wu,FORMAT_TEXT_COMMAND as Eu}from"lexical";import{jsx as zn,jsxs as _u}from"react/jsx-runtime";import"react";var Zn=()=>_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:[zn("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"}),zn("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]});var Yn=[te([{ChildComponent:Zn,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:Yn},toolbarInline:{groups:Yn}});import{jsx as Ho}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 Xt=({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 Au,TextNode as Du}from"lexical";import{useEffect as Ou}from"react";var Po=new Map;function qn(t){for(let e in t){let o=t[e],r=Au(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(()=>{Iu(r=>{let n=Po.get(e);if(!n)throw new Error(`State config for ${e} not found`);Mu(r,n.stateConfig,o)})})}function Qn(){let[t]=yu();return Ou(()=>t.registerMutationListener(Du,e=>{t.getEditorState().read(()=>{for(let[o,r]of e){if(r==="destroyed")continue;let n=Ru(o),l=t.getElementByKey(o);!n||!l||Po.forEach((i,s)=>{let u=vu(n,i.stateConfig);if(!u){delete l.dataset[s],l.style.cssText="";return}l.dataset[s]=u;let c=i.stateValues[u]?.css;c&&Object.entries(c).forEach(([d,a])=>{l.style.setProperty(d,a)})})}})}),[t]),null}var el=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:"Default style",onSelect:({editor:r})=>{for(let n in t.state)Bo(r,n,void 0)},order:1}],...e],key:"textState",order:30}]},$u=y(({props:t})=>(qn(t.state),{plugins:[{Component:Qn,position:"normal"}],toolbarFixed:{groups:el(t)},toolbarInline:{groups:el(t)}}));import{$createHeadingNode as Hu,$isHeadingNode as fl,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 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.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 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:"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 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:"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 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.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 cl}from"react/jsx-runtime";import"react";var ul=()=>cl("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:cl("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 dl}from"react/jsx-runtime";import"react";var ml=()=>dl("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:dl("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 jo=t=>(e,o,r)=>{let n=t(r);n&&(n.append(...o),e.replace(n),n.select(0,0))};var pl=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:jo(n=>{let l="h"+n[1]?.length;return Fu(l)})}};var hl=t=>{let e=Gu();Uu(e,()=>Hu(t))},gl={h1:ol,h2:nl,h3:il,h4:al,h5:ul,h6:ml},Vu=y(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[le(e.map((r,n)=>({ChildComponent:gl[r],isActive:({selection:l})=>{if(!Wu(l))return!1;for(let i of l.getNodes()){if(fl(i)&&i.getTag()===r)continue;let s=i.getParent();if(!(fl(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(()=>{hl(r)})},order:n+2})))];return{markdownTransformers:[pl(e)],nodes:[ju],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[ee(e.map(r=>({Icon:gl[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(()=>{hl(r)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}});import{$isNodeSelection as sd}from"lexical";import{jsx as xl}from"react/jsx-runtime";import"react";var Uo=()=>xl("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:xl("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})});import{jsx as Cl,jsxs as Ku}from"react/jsx-runtime";import"react";var bl=()=>Ku("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Cl("path",{d:"M5 10h10",stroke:"currentColor"}),Cl("path",{d:"M10 15V5",stroke:"currentColor"})]});var _e=t=>({type:"dropdown",ChildComponent:bl,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 gt=zu("INSERT_HORIZONTAL_RULE_COMMAND"),ht=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 kl()}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:kl()}}function kl(){return Xu(new ht)}import{$applyNodeReplacement as qu}from"lexical";import"react";var Me=class extends ht{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return xt()}decorate(){return null}exportJSON(){return super.exportJSON()}};function xt(){return qu(new Me)}function zt(t){return t instanceof Me}var _l={type:"element",dependencies:[Me],export:(t,e)=>zt(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=xt();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 Tl=()=>{let t=Qu(3),[e]=ed(),o,r;return t[0]!==e?(o=()=>e.registerCommand(gt,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=xt();td(r)}return!0}var ad=y({markdownTransformers:[_l],nodes:[Me],plugins:[{Component:Tl,position:"normal"}],slashMenu:{groups:[ee([{Icon:Uo,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(gt,void 0)}}])]},toolbarFixed:{groups:[_e([{ChildComponent:Uo,isActive:({selection:t})=>{if(!sd(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(gt,void 0)}}])]}});import{$findMatchingParent as Ml}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 wl=()=>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 Yt,jsxs as ud}from"react/jsx-runtime";import"react";var El=()=>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:[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 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 Nl}from"@lexical/utils";import{$getSelection as hd,$isElementNode as Il,$isRangeSelection as gd,COMMAND_PRIORITY_LOW as Sl,INDENT_CONTENT_COMMAND as Ll,KEY_TAB_COMMAND as xd,OUTDENT_CONTENT_COMMAND as Cd,TabNode as bd}from"lexical";import{useEffect as yl}from"react";var Rl=({clientProps:t})=>{let[e]=md(),{disabledNodes:o,disableTabNode:r}=t;return yl(()=>{if(!(!e||!o?.length))return Nl(e.registerCommand(Ll,()=>kd(n=>{if(!o.includes(n.getType())){let l=n.getIndent();n.setIndent(l+1)}}),Sl),e.registerUpdateListener(({dirtyElements:n,editorState:l})=>{e.update(()=>{for(let[i]of n){let s=l._nodeMap.get(i);Il(s)&&o.includes(s.getType())&&s.getIndent()>0&&s.setIndent(0)}})}))},[e,o]),yl(()=>{if(!(!e||!r))return Nl(e.registerCommand(xd,n=>(n.preventDefault(),e.dispatchCommand(n.shiftKey?Cd:Ll,void 0)),Sl),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=>Il(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 vl=t=>({type:"buttons",items:t,key:"indent",order:35});var Al=({disabledNodes:t})=>[vl([{ChildComponent:wl,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],r=n=>Dl(n)&&n.getIndent()>0;return o.some(n=>r(n)||!!Ml(n,r))},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(wd,void 0)},order:1},{ChildComponent:El,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],r=n=>Dl(n)&&!(t??[]).includes(n.getType());return o.some(n=>r(n)||!!Ml(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:Rl,position:"normal"}],sanitizedClientFeatureProps:t,toolbarFixed:{groups:Al({disabledNodes:e})},toolbarInline:{groups:Al({disabledNodes:e})}}}),Dl=t=>_d(t)&&t.canIndent();import{$findMatchingParent as $m}from"@lexical/utils";import{$getSelection as Yo,$isRangeSelection as di}from"lexical";import{jsx as Ol}from"react/jsx-runtime";import"react";var $l=()=>Ol("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:Ol("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 Fl}from"@lexical/selection";function ze(t){let{anchor:e}=t,{focus:o}=t,r=t.anchor.getNode(),n=t.focus.getNode();return r===n?r:t.isBackward()?Fl(o)?r:n:Fl(e)?r:n}var Go=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 Ko from"bson-objectid";import{$applyNodeReplacement as Ld,$createTextNode as Pl,$getSelection as yd,$isElementNode as Bl,$isRangeSelection as Vo,createCommand as Id,ElementNode as Rd}from"lexical";var vd=new Set(["http:","https:","mailto:","sms:","tel:"]),ie=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=Te({}).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")),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(!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(Bl(r)){let n=Te({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=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 Md(t){let e=null;if(Sd(t)){let o=t.textContent;o!==null&&o!==""&&(e=Te({id:new Ko.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function Te({id:t,fields:e}){return Ld(new ie({id:t??new Ko.default().toHexString(),fields:e}))}function Y(t){return t instanceof ie}var ge=Id("TOGGLE_LINK_COMMAND");function Jo(t){let e=yd();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();Y(i)&&(i.getChildren().forEach(u=>{i.insertBefore(u)}),i.remove())});return}if(o?.length===1){let l=o[0],i=Y(l)?l:Ad(l);if(i!==null){i.setFields(t.fields),t.text!=null&&t.text!==i.getTextContent()&&(i.append(Pl(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||Bl(l)&&!l.isInline())){if(Y(i)){n=i,i.setFields(t.fields),t.text!=null&&t.text!==i.getTextContent()&&(i.append(Pl(t.text)),i.getChildren().forEach(s=>{s!==i.getLastChild()&&s.remove()}));return}if(i.is(r)||(r=i,n=Te({fields:t.fields}),Y(i)?l.getPreviousSibling()===null?i.insertBefore(n):i.insertAfter(n):l.insertBefore(n)),Y(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 Ad(t){return Dd(t,e=>Y(e))}function Dd(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 Hl={type:"text-match",dependencies:[ie],export:(t,e)=>{if(!Y(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=Te({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 we=class t extends ie{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=Ct({}).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=Ct({fields:this.__fields});return r.append(n),n}return null}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields)}};function Ct({fields:t}){return $d(new we({id:"",fields:t}))}function Ee(t){return t instanceof we}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 jl,$getSelection as jd,$isElementNode as Gl,$isLineBreakNode as Wl,$isNodeSelection as Ud,$isRangeSelection as Gd,$isTextNode as bt,TextNode as Wd}from"lexical";import{useEffect as Vd}from"react";function Ul(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 Vl(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 Kl(t){return Qt(t[t.length-1])}function zo(t){return Qt(t[0])}function Jd(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function Jl(t){let e=t.getPreviousSibling();return Gl(e)&&(e=e.getLastDescendant()),e===null||Wl(e)||bt(e)&&Kl(e.getTextContent())}function Xl(t){let e=t.getNextSibling();return Gl(e)&&(e=e.getFirstDescendant()),e===null||Wl(e)||bt(e)&&zo(e.getTextContent())}function Xd(t,e,o,r){return(t>0?Qt(o[t-1]):Jl(r[0]))?e<o.length?Qt(o[e]):Xl(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=Ct({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=jl(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[x,k]=a.splitText(o-f);x&&c.push(x),d=k}s+=m}),u){let a=jd(),p=a?a.getNodes().find(bt):void 0,m=jl(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=Vl(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,x=s+d-p,k=Zd(m,h,x,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(!bt(c)||!c.isSimpleText()){qt(t),o(null,t.getFields()?.url??null);return}}let l=t.getTextContent(),i=Vl(l,e);if(i===null||i.text!==l){qt(t),o(null,t.getFields()?.url??null);return}if(!Jl(t)||!Xl(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 qd(t,e,o){let r=t.getPreviousSibling(),n=t.getNextSibling(),l=t.getTextContent();if(Ee(r)){let i=r.getFields()?.url?r.getFields()?.url?.startsWith("mailto:")??!1:!1;(!zo(l)||Jd(l,i))&&(r.append(t),Xo(r,e,o),o(null,r.getFields()?.url??null))}Ee(n)&&!Kl(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 Qd(t){let e=[t],o=t.getNextSibling();for(;o!==null&&bt(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([we]))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(Ee(u))Xo(u,e,i);else if(!Y(u)){if(s.isSimpleText()&&(zo(s.getTextContent())||!Ee(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=[Ul(tm,t=>t.startsWith("http")?t:`https://${t}`),Ul(om,t=>`mailto:${t}`)],zl=()=>{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 Zl=()=>nm(lm,{});import{jsx as wm}from"react/jsx-runtime";import"react";import{createPortal as Em}from"react-dom";import{jsx as Ne,jsxs as kt,Fragment as sm}from"react/jsx-runtime";import{useLexicalComposerContext as am}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as Yl,mergeRegister as ql}from"@lexical/utils";import{getTranslation as Zo}from"@payloadcms/translations";import{CloseMenuIcon as cm,EditIcon as um,ExternalLinkIcon as Ql,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 ei,$isLineBreakNode as xm,$isRangeSelection as ti,COMMAND_PRIORITY_HIGH as Cm,COMMAND_PRIORITY_LOW as oi,getDOMSelection as bm,KEY_ESCAPE_COMMAND as km,SELECTION_CHANGE_COMMAND as _m}from"lexical";import ri,{useCallback as ni,useEffect as oo,useRef as Tm,useState as Be}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 im}from"lexical";var to=im("TOGGLE_LINK_WITH_MODAL_COMMAND");function li(t){t.preventDefault()}function ii({anchorElem:t}){let[e]=am(),[o,r]=Be(),n=Tm(null),[l,i]=Be(null),[s,u]=Be(null),{fieldProps:{schemaPath:c},uuid:d}=G(),{config:a,getEntityConfig:p}=mm(),{i18n:m,t:f}=hm(),[h,x]=Be(),k=pm(),[I,A]=Be(!1),[b,_]=Be([]),g=fm(),[w,M]=Be(!1),D=dm({slug:"lexical-rich-text-link-"+d,depth:k}),{toggleDrawer:P}=Ce(D),v=ni(()=>{A(!1),n&&n.current&&(n.current.style.opacity="0",n.current.style.transform="translate(-10000px, -10000px)"),M(!1),i(null),u(null),_([]),x(void 0)},[A,i,u,_]),N=ni(()=>{let C=ei(),E;if(!ti(C)||!C){v();return}let L=ze(C);E=e.getElementByKey(L.getKey())?.getBoundingClientRect();let S=Yl(L,Y),R=C.getNodes().filter(j=>!xm(j)).find(j=>{let U=Yl(j,Y);return S&&!S.is(U)||U&&!U.is(S)});if(S==null||R){v();return}r(S);let T=S.getFields(),$={...T,id:S.getID(),text:S.getTextContent()};if(T?.linkType==="custom")i(T?.url??null),u(null);else{i(`${a.routes.admin==="/"?"":a.routes.admin}/collections/${T?.doc?.relationTo}/${T?.doc?.value}`);let j=T?.doc?.relationTo?p({collectionSlug:T?.doc?.relationTo}):void 0;if(!j)u(T?.label?String(T?.label):null),i(T?.url?String(T?.url):null);else{let U=typeof T.doc?.value=="object"?T.doc.value.id:T.doc?.value,oe=T.doc?.relationTo;if(!U||!oe)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let ue=f("fields:linkedTo",{label:`${Zo(j.labels.singular,m)} - ${f("lexical:link:loadingWithEllipsis",m)}`}).replace(/<[^>]*>?/g,"");u(ue),gm.get(`${a.serverURL}${a.routes.api}/${oe}/${U}`,{headers:{"Accept-Language":m.language},params:{depth:0,locale:g?.code}}).then(async q=>{if(!q.ok)throw new Error(`HTTP error! Status: ${q.status}`);let J=await q.json(),re=j?.admin?.useAsTitle||"id",ne=J[re],se=f("fields:linkedTo",{label:`${Zo(j.labels.singular,m)} - ${ne}`}).replace(/<[^>]*>?/g,"");u(se)}).catch(()=>{let q=f("fields:linkedTo",{label:`${Zo(j.labels.singular,m)} - ${f("general:untitled",m)} - ID: ${U}`}).replace(/<[^>]*>?/g,"");u(q)})}}x($),A(!0),_(C?C?.getNodes():[]),Ee(S)?M(!0):M(!1);let F=n.current,W=bm(e._window),{activeElement:K}=document;if(F===null)return;let fe=e.getRootElement();return W!==null&&fe!==null&&fe.contains(W.anchorNode)?(E||(E=W.getRangeAt(0).getBoundingClientRect()),E!=null&&(E.y+=40,eo(E,F,t))):(K==null||K.className!=="link-input")&&(fe!==null&&eo(null,F,t),i(null),u(null)),!0},[e,v,a.routes.admin,a.routes.api,a.serverURL,p,f,m,g?.code,t]);return oo(()=>ql(e.registerCommand(to,C=>(e.dispatchCommand(ge,C),N(),P(),!0),oi)),[e,N,P,D]),oo(()=>{let C=t.parentElement,E=()=>{e.getEditorState().read(()=>{N()})};return window.addEventListener("resize",E),C?.addEventListener("scroll",E),()=>{window.removeEventListener("resize",E),C?.removeEventListener("scroll",E)}},[t.parentElement,e,N]),oo(()=>ql(e.registerUpdateListener(({editorState:C})=>{C.read(()=>{N()})}),e.registerCommand(_m,()=>(N(),!0),oi),e.registerCommand(km,()=>I?(v(),!0):!1,Cm)),[e,N,I,v]),oo(()=>{e.getEditorState().read(()=>{N()})},[e,N]),kt(ri.Fragment,{children:[Ne("div",{className:"link-editor",ref:n,children:kt("div",{className:"link-input",children:[l&&l.length>0?kt("a",{href:l,rel:"noopener noreferrer",target:"_blank",children:[o?.__fields.newTab?Ne(Ql,{}):null,s!=null&&s.length>0?s:l]}):s!=null&&s.length>0?kt(sm,{children:[o?.__fields.newTab?Ne(Ql,{}):null,Ne("span",{className:"link-input__label-pure",children:s})]}):null,e.isEditable()&&kt(ri.Fragment,{children:[Ne("button",{"aria-label":"Edit link",className:"link-edit",onClick:C=>{C.preventDefault(),P()},onMouseDown:li,tabIndex:0,type:"button",children:Ne(um,{})}),!w&&Ne("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(ge,null)},onMouseDown:li,tabIndex:0,type:"button",children:Ne(cm,{})})]})]})}),Ne(st,{className:"lexical-link-edit-drawer",data:h,drawerSlug:D,drawerTitle:f("fields:editLink"),featureKey:"link",handleDrawerSubmit:(C,E)=>{let L=E,S={...L};delete S.text,e.update(()=>{let R=ei(),T=null;if(ti(R)?T=ze(R).getParent():b.length&&(T=b[0]?.getParent()??null),T&&Ee(T)){let $=Te({fields:S});T.replace($,!0)}}),e.dispatchCommand(ge,{fields:S,selectedNodes:b,text:L.text})},schemaPath:c,schemaPathSuffix:"fields"})]})}var si=t=>{let{anchorElem:e=document.body}=t;return Em(wm(ii,{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 ci,PASTE_COMMAND as Am}from"lexical";import{useEffect as Dm}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 ai(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 ui=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([ie]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Im(r.registerCommand(ge,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),ci),r.registerCommand(Am,i=>{let s=Rm();if(!Mm(s)||s.isCollapsed()||!(i instanceof ClipboardEvent)||i.clipboardData==null)return!1;let u=i.clipboardData.getData("text");if(!ai(u))return!1;if(!s.getNodes().some(Om)){let c={doc:null,linkType:"custom",newTab:!1,url:u};return r.dispatchCommand(ge,{fields:c,text:null}),i.preventDefault(),!0}return!1},ci))},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]),Dm(n,l),null};function Om(t){return vm(t)}var mi=[Go([{ChildComponent:$l,isActive:({selection:t})=>{if(di(t)){let e=ze(t);return $m(e,Y)!=null}return!1},isEnabled:({selection:t})=>!!(di(t)&&Yo()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(ge,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}])],Fm=y(({props:t})=>({markdownTransformers:[Hl],nodes:[ie,t?.disableAutoLinks===!0?null:we].filter(Boolean),plugins:[{Component:ui,position:"normal"},t?.disableAutoLinks===!0||t?.disableAutoLinks==="creationOnly"?null:{Component:zl,position:"normal"},{Component:Zl,position:"normal"},{Component:si,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:mi},toolbarInline:{groups:mi}}));import{$isListNode as er,INSERT_CHECK_LIST_COMMAND as Ci,ListItemNode as zm,ListNode as Zm}from"@lexical/list";import{$isRangeSelection as Ym}from"lexical";import{jsx as pi,jsxs as Pm}from"react/jsx-runtime";import"react";var qo=()=>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:[pi("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),pi("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 Ze=()=>Bm(Hm,{});function Ye(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 fi=4,qe=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/fi);s&&i.setIndent(s)},He=(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(He(d,e,o+1));continue}}let s=" ".repeat(o*fi),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 hi={type:"element",dependencies:[Km,Vm],export:(t,e)=>Wm(t)?He(t,e,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:qe("check")};import{jsx as Jm}from"react/jsx-runtime";import{CheckListPlugin as Xm}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var gi=()=>Jm(Xm,{});var xi=[le([{ChildComponent:qo,isActive:({selection:t})=>{if(!Ym(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(Ci,void 0)},order:12}])],qm=y(({featureProviderMap:t})=>{let e=[{Component:gi,position:"normal"}];return!t.has("unorderedList")&&!t.has("orderedList")&&e.push({Component:Ze,position:"normal"}),{markdownTransformers:[hi],nodes:t.has("unorderedList")||t.has("orderedList")?[]:[Zm,zm],plugins:e,slashMenu:{groups:[Ye([{Icon:qo,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:o})=>o.t("lexical:checklist:label"),onSelect:({editor:o})=>{o.dispatchCommand(Ci,void 0)}}])]},toolbarFixed:{groups:xi},toolbarInline:{groups:xi}}});import{$isListNode as or,INSERT_ORDERED_LIST_COMMAND as _i,ListItemNode as rp,ListNode as np}from"@lexical/list";import{$isRangeSelection as lp}from"lexical";import{jsx as _t,jsxs as Qm}from"react/jsx-runtime";import"react";var tr=()=>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:[_t("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"}),_t("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"}),_t("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),_t("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),_t("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as ep,ListItemNode as tp,ListNode as op}from"@lexical/list";var bi={type:"element",dependencies:[op,tp],export:(t,e)=>ep(t)?He(t,e,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:qe("number")};var ki=[le([{ChildComponent:tr,isActive:({selection:t})=>{if(!lp(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(_i,void 0)},order:10}])],ip=y(({featureProviderMap:t})=>({markdownTransformers:[bi],nodes:t.has("orderedList")?[]:[np,rp],plugins:t.has("orderedList")?[]:[{Component:Ze,position:"normal"}],slashMenu:{groups:[Ye([{Icon:tr,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:e})=>e.t("lexical:orderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(_i,void 0)}}])]},toolbarFixed:{groups:ki},toolbarInline:{groups:ki}}));import{$isListNode as nr,INSERT_UNORDERED_LIST_COMMAND as Ei,ListItemNode as dp,ListNode as mp}from"@lexical/list";import{$isRangeSelection as pp}from"lexical";import{jsx as Qe,jsxs as sp}from"react/jsx-runtime";import"react";var rr=()=>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:[Qe("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Qe("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Qe("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Qe("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),Qe("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),Qe("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as ap,ListItemNode as cp,ListNode as up}from"@lexical/list";var Ti={type:"element",dependencies:[up,cp],export:(t,e)=>ap(t)?He(t,e,0):null,regExp:/^(\s*)[-*+]\s/,replace:qe("bullet")};var wi=[le([{ChildComponent:rr,isActive:({selection:t})=>{if(!pp(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(Ei,void 0)},order:11}])],fp=y({markdownTransformers:[Ti],nodes:[mp,dp],plugins:[{Component:Ze,position:"normal"}],slashMenu:{groups:[Ye([{Icon:rr,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ei,void 0)}}])]},toolbarFixed:{groups:wi},toolbarInline:{groups:wi}});import{jsx as hp}from"react/jsx-runtime";import{addClassNamesToElement as gp}from"@lexical/utils";import{DecoratorNode as xp}from"lexical";import*as Ni from"react";var Cp=Ni.lazy(()=>import("./Component-MBLHTKDK.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),Tt=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 Tt({data:t})}var kp=y(()=>({nodes:[Tt]}));import{jsx as _p}from"react/jsx-runtime";import{addClassNamesToElement as Tp}from"@lexical/utils";import{DecoratorNode as wp}from"lexical";import*as Si from"react";var Ep=Si.lazy(()=>import("./Component-DOSSWC76.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),wt=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 wt({data:t})}var Sp=y(()=>({nodes:[wt]}));import{$setBlocksType as Ii}from"@lexical/selection";import{$createParagraphNode as Ri,$getSelection as vi,$isParagraphNode as Li,$isRangeSelection as Lp}from"lexical";var yi=[le([{ChildComponent:ct,isActive:({selection:t})=>{if(!Lp(t))return!1;for(let e of t.getNodes())if(!Li(e)&&!Li(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=vi();Ii(e,()=>Ri())})},order:1}])],yp=y({slashMenu:{groups:[ee([{Icon:ct,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=vi();Ii(e,()=>Ri())})}}])]},toolbarFixed:{groups:yi},toolbarInline:{groups:yi}});import{c as zp}from"react/compiler-runtime";import{jsx as Zp}from"react/jsx-runtime";import{useLexicalComposerContext as Yp}from"@lexical/react/LexicalComposerContext";import{useEffect as qp,useState as Qp}from"react";import{jsx as Zi,Fragment as Xp}from"react/jsx-runtime";import"react";import{jsx as Ip}from"react/jsx-runtime";var Mi={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 Ai={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 Di={horizontalrule:vp("hr",{})};import{jsx as Mp}from"react/jsx-runtime";var Oi={linebreak:Mp("br",{})};import{jsx as $i}from"react/jsx-runtime";var Fi=({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 $i("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="#")),$i("a",{href:i,rel:n,target:l,children:r})}});import{jsx as et,jsxs as Ap,Fragment as Dp}from"react/jsx-runtime";import{v4 as Op}from"uuid";var Pi={list:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return et(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 et("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:Ap(Dp,{children:[et("input",{checked:t.checked,id:l,readOnly:!0,type:"checkbox"}),et("label",{htmlFor:l,children:n}),et("br",{})]})})}else return et("li",{className:`${r?"nestedListItem":""}`,style:r?{listStyleType:"none"}:void 0,value:t?.value,children:n})}};import{jsx as lr}from"react/jsx-runtime";var Bi={paragraph:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return o?.length?lr("p",{children:o}):lr("p",{children:lr("br",{})})}};var Hi={tab:" "};import{jsx as Et}from"react/jsx-runtime";var ji={table:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Et("div",{className:"lexical-table-container",children:Et("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:Et("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 Et(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 Et("tr",{className:"lexical-table-row",children:o})}};import{jsx as je}from"react/jsx-runtime";import"react";var O={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=O.IS_BOLD|O.IS_ITALIC|O.IS_STRIKETHROUGH|O.IS_UNDERLINE|O.IS_CODE|O.IS_SUBSCRIPT|O.IS_SUPERSCRIPT|O.IS_HIGHLIGHT,Fp="\xA0",Pp=`
|
|
34
|
+
`},[t,e]),m=$e((k,_)=>{o(b=>{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[...b,{name:k,count:1,value:_}]})},[e,o]);mn(()=>{let k=b=>{if(!r)return;let N=b.key;Fc(b)?m("selectAll",""):fn.has(N)?m("press",b.key):[...N].length>1?m("keydown",b.key):m("type",b.key)},_=b=>{if(!r)return;let N=b.key;!fn.has(N)&&[...N].length>1&&m("keyup",b.key)};return t.registerRootListener((b,N)=>{N!==null&&(N.removeEventListener("keydown",k),N.removeEventListener("keyup",_)),b!==null&&(b.addEventListener("keydown",k),b.addEventListener("keyup",_))})},[t,r,m]),mn(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[p]),Do(()=>{if(e){let k=p();k!==null&&s(k),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[p,e]),Do(()=>t.registerUpdateListener(({dirtyElements:_,dirtyLeaves:b,editorState:N})=>{if(!r)return;let M=N._selection,O=c.current,F=u.current;if(O!==M){if(b.size===0&&_.size===0&&!F){let w=Mo(t._window);if(w&&(w.anchorNode==null||w.focusNode==null))return}c.current=M}u.current=!1;let I=p();I!==null&&s(I)}),[t,p,r,m]),Do(()=>r?t.registerUpdateListener(()=>{let _=t.getRootElement();_!==null&&l(_?.innerHTML)}):void 0,[t,r]);let f=$e(k=>{r||(k.update(()=>{let _=Dc();_.clear();let b=Mc();_.append(vc().append(b)),b.select()}),o([])),n(_=>!_)},[r]),h=$e(()=>{if(!r)return;let k=Mo(t._window);if(k===null||k.anchorNode==null||k.focusNode==null)return;let{anchorNode:_,anchorOffset:b,focusNode:N,focusOffset:M}=Pc(k),O=a().getRootElement(),F;_!==null&&(F=pn(_,O));let I;N!==null&&(I=pn(N,O)),m("snapshot",{anchorNode:_,anchorOffset:b,anchorPath:F,focusNode:N,focusOffset:M,focusPath:I})},[m,r,a]),g=$e(()=>{Ac(p())},[p]),x=$e(()=>{Oc("test.js",p())},[p]);return[Fe("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?Oo("div",{className:"test-recorder-output",children:[Oo("div",{className:"test-recorder-toolbar",children:[Fe("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:k=>{h(),k.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Fe("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:k=>{g(),k.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Fe("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:k=>{x(),k.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Fe("pre",{id:"test-recorder",ref:d,children:i})]}):null]}var gn=()=>{let t=Ic(3),[e]=Rc(),[o,r]=Bc(e),n;return t[0]!==o||t[1]!==r?(n=Oo(hn.Fragment,{children:[Fe("p",{children:"HI"}),o,r,Fe("p",{children:"DONE"})]}),t[0]=o,t[1]=r,t[2]=n):n=t[2],n};var Hc=y({plugins:[{Component:gn,position:"bottom"}]});import{c as jc}from"react/compiler-runtime";import{jsx as Uc}from"react/jsx-runtime";import{useLexicalComposerContext as Gc}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Wc}from"@lexical/react/LexicalTreeView.js";import"react";var xn=()=>{let t=jc(2),[e]=Gc(),o;return t[0]!==e?(o=Uc(Wc,{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 Vc=y({plugins:[{Component:xn,position:"bottom"}]});import{$isTableSelection as Kc}from"@lexical/table";import{$isRangeSelection as Jc,FORMAT_TEXT_COMMAND as Xc}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 te=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=[te([{ChildComponent:bn,isActive:({selection:t})=>Jc(t)||Kc(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(Xc,"bold")},order:1}])],zc=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 Yc}from"@lexical/table";import{$isRangeSelection as qc,FORMAT_TEXT_COMMAND as Qc}from"lexical";import{jsx as Nn,jsxs as Zc}from"react/jsx-runtime";import"react";var Sn=()=>Zc("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=[te([{ChildComponent:Sn,isActive:({selection:t})=>qc(t)||Yc(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(Qc,"code")},order:7}])],eu=y({enableFormats:["code"],markdownTransformers:[Ln],toolbarFixed:{groups:yn},toolbarInline:{groups:yn}});import{$isTableSelection as tu}from"@lexical/table";import{$isRangeSelection as ou,FORMAT_TEXT_COMMAND as ru}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=[te([{ChildComponent:Rn,isActive:({selection:t})=>ou(t)||tu(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(ru,"italic")},order:2}])],nu=y({enableFormats:["italic"],markdownTransformers:[vn,Mn],toolbarFixed:{groups:Dn},toolbarInline:{groups:Dn}});import{$isTableSelection as iu}from"@lexical/table";import{$isRangeSelection as su,FORMAT_TEXT_COMMAND as au}from"lexical";import{jsx as An,jsxs as lu}from"react/jsx-runtime";import"react";var On=()=>lu("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=[te([{ChildComponent:On,isActive:({selection:t})=>su(t)||iu(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(au,"strikethrough")},order:4}])],cu=y({enableFormats:["strikethrough"],markdownTransformers:[$n],toolbarFixed:{groups:Fn},toolbarInline:{groups:Fn}});import{$isTableSelection as uu}from"@lexical/table";import{$isRangeSelection as du,FORMAT_TEXT_COMMAND as mu}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=[te([{ChildComponent:Bn,isActive:({selection:t})=>du(t)||uu(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(mu,"subscript")},order:5}])],pu=y({enableFormats:["subscript"],toolbarFixed:{groups:Hn},toolbarInline:{groups:Hn}});import{$isTableSelection as fu}from"@lexical/table";import{$isRangeSelection as hu,FORMAT_TEXT_COMMAND as gu}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=[te([{ChildComponent:Un,isActive:({selection:t})=>hu(t)||fu(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(gu,"superscript")},order:6}])],xu=y({enableFormats:["superscript"],toolbarFixed:{groups:Gn},toolbarInline:{groups:Gn}});import{$isTableSelection as bu}from"@lexical/table";import{$isRangeSelection as ku,FORMAT_TEXT_COMMAND as _u}from"lexical";import{jsx as Wn,jsxs as Cu}from"react/jsx-runtime";import"react";var Vn=()=>Cu("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=[te([{ChildComponent:Vn,isActive:({selection:t})=>ku(t)||bu(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(_u,"underline")},order:3}])],Tu=y({enableFormats:["underline"],toolbarFixed:{groups:Kn},toolbarInline:{groups:Kn}});import{jsx as Po}from"react/jsx-runtime";import{jsx as wu}from"react/jsx-runtime";function Eu(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])=>[Eu(o),r])):{};return wu("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as Nu}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as Su}from"@lexical/selection";import{$getNodeByKey as Lu,$getState as yu,$setState as Iu,createState as Ru,TextNode as vu}from"lexical";import{useEffect as Mu}from"react";var $o=new Map;function Jn(t){for(let e in t){let o=t[e],r=Ru(e,{parse:n=>typeof n=="string"&&Object.keys(o).includes(n)?n:void 0});$o.set(e,{stateConfig:r,stateValues:o})}}function Fo(t,e,o){t.update(()=>{Su(r=>{let n=$o.get(e);if(!n)throw new Error(`State config for ${e} not found`);Iu(r,n.stateConfig,o)})})}function Xn(){let[t]=Nu();return Mu(()=>t.registerMutationListener(vu,e=>{t.getEditorState().read(()=>{for(let[o,r]of e){if(r==="destroyed")continue;let n=Lu(o),l=t.getElementByKey(o);!n||!l||$o.forEach((i,s)=>{let c=yu(n,i.stateConfig);if(!c){delete l.dataset[s],l.style.cssText="";return}l.dataset[s]=c;let u=i.stateValues[c]?.css;u&&Object.entries(u).forEach(([d,a])=>{l.style.setProperty(d,a)})})}})}),[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:()=>Po(Jt,{css:i.css}),key:l,label:i.label,onSelect:({editor:s})=>{Fo(s,r,l)}})}}return[{type:"dropdown",ChildComponent:()=>Po(Jt,{css:{color:"var(--theme-elevation-600)"}}),items:[...[{ChildComponent:()=>Po(Jt,{}),key:"clear-style",label:"Default style",onSelect:({editor:r})=>{for(let n in t.state)Fo(r,n,void 0)},order:1}],...e],key:"textState",order:30}]},Du=y(({props:t})=>(Jn(t.state),{plugins:[{Component:Xn,position:"normal"}],toolbarFixed:{groups:zn(t)},toolbarInline:{groups:zn(t)}}));import{$createHeadingNode as Fu,$isHeadingNode as cl,HeadingNode as Pu}from"@lexical/rich-text";import{$setBlocksType as Bu}from"@lexical/selection";import{$getSelection as Hu,$isRangeSelection as ju}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 Au,$isHeadingNode as Ou,HeadingNode as $u}from"@lexical/rich-text";var Bo=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:[$u],export:(n,l)=>{if(!Ou(n))return null;let i=Number(n.getTag().slice(1));return"#".repeat(i)+" "+l(n)},regExp:r,replace:Bo(n=>{let l="h"+n[1]?.length;return Au(l)})}};var ul=t=>{let e=Hu();Bu(e,()=>Fu(t))},dl={h1:Yn,h2:Qn,h3:tl,h4:rl,h5:ll,h6:sl},Uu=y(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[le(e.map((r,n)=>({ChildComponent:dl[r],isActive:({selection:l})=>{if(!ju(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:[Pu],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[ee(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 nd}from"lexical";import{jsx as ml}from"react/jsx-runtime";import"react";var Ho=()=>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 Gu}from"react/jsx-runtime";import"react";var fl=()=>Gu("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 ke=t=>({type:"dropdown",ChildComponent:fl,items:t,key:"add",order:10});import{addClassNamesToElement as Wu}from"@lexical/utils";import{$applyNodeReplacement as Vu,createCommand as Ku,DecoratorNode as Ju}from"lexical";var gt=Ku("INSERT_HORIZONTAL_RULE_COMMAND"),ht=class extends Ju{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:Xu,priority:0})}}static importJSON(e){return hl()}createDOM(e){let o=document.createElement("hr");return Wu(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 Xu(){return{node:hl()}}function hl(){return Vu(new ht)}import{$applyNodeReplacement as zu}from"lexical";import"react";var ve=class extends ht{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return xt()}decorate(){return null}exportJSON(){return super.exportJSON()}};function xt(){return zu(new ve)}function Xt(t){return t instanceof ve}var gl={type:"element",dependencies:[ve],export:(t,e)=>Xt(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=xt();e&&t.replace(e)}};import{c as Zu}from"react/compiler-runtime";import{useLexicalComposerContext as Yu}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as qu}from"@lexical/utils";import{$getSelection as Qu,$isRangeSelection as ed,COMMAND_PRIORITY_EDITOR as td}from"lexical";import{useEffect as od}from"react";var xl=()=>{let t=Zu(3),[e]=Yu(),o,r;return t[0]!==e?(o=()=>e.registerCommand(gt,rd,td),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),od(o,r),null};function rd(t){let e=Qu();if(!ed(e))return!1;if(e.focus.getNode()!==null){let r=xt();qu(r)}return!0}var ld=y({markdownTransformers:[gl],nodes:[ve],plugins:[{Component:xl,position:"normal"}],slashMenu:{groups:[ee([{Icon:Ho,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(gt,void 0)}}])]},toolbarFixed:{groups:[ke([{ChildComponent:Ho,isActive:({selection:t})=>{if(!nd(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(gt,void 0)}}])]}});import{$findMatchingParent as Ll}from"@lexical/utils";import{$isElementNode as Cd,INDENT_CONTENT_COMMAND as bd,OUTDENT_CONTENT_COMMAND as kd}from"lexical";import{jsx as zt,jsxs as id}from"react/jsx-runtime";import"react";var Cl=()=>id("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 sd}from"react/jsx-runtime";import"react";var bl=()=>sd("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 ad}from"react/jsx-runtime";import{useLexicalComposerContext as cd}from"@lexical/react/LexicalComposerContext";import{TabIndentationPlugin as ud}from"@lexical/react/LexicalTabIndentationPlugin";import{$findMatchingParent as dd,mergeRegister as kl}from"@lexical/utils";import{$getSelection as md,$isElementNode as El,$isRangeSelection as pd,COMMAND_PRIORITY_LOW as _l,INDENT_CONTENT_COMMAND as Tl,KEY_TAB_COMMAND as fd,OUTDENT_CONTENT_COMMAND as hd,TabNode as gd}from"lexical";import{useEffect as wl}from"react";var Nl=({clientProps:t})=>{let[e]=cd(),{disabledNodes:o,disableTabNode:r}=t;return wl(()=>{if(!(!e||!o?.length))return kl(e.registerCommand(Tl,()=>xd(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(fd,n=>(n.preventDefault(),e.dispatchCommand(n.shiftKey?hd:Tl,void 0)),_l),e.registerNodeTransform(gd,n=>{n.remove()}))},[e,r]),ad(ud,{})};function xd(t){let e=md();if(!pd(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=dd(l,u=>El(u)&&!u.isInline());if(s===null)continue;let c=s.getKey();s.canIndent()&&!o.has(c)&&(o.add(c),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(kd,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(bd,void 0)},order:2}])],_d=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=>Cd(t)&&t.canIndent();import{$findMatchingParent as Dm}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 ze(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 jo=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as Md}from"lexical";import{addClassNamesToElement as Td,isHTMLAnchorElement as wd}from"@lexical/utils";import Wo from"bson-objectid";import{$applyNodeReplacement as Ed,$createTextNode as Dl,$getSelection as Nd,$isElementNode as Al,$isRangeSelection as Go,createCommand as Sd,ElementNode as Ld}from"lexical";var yd=new Set(["http:","https:","mailto:","sms:","tel:"]),ie=class t extends Ld{__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:Id,priority:1})}}static importJSON(e){let o=_e({}).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 Wo.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=Uo(o.rel,"add","noopener")),Td(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(!Go(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=_e({fields:this.__fields});return r.append(n),n}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!yd.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=Uo(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=Uo(o.rel,"remove","noopener"))),!1}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields).setID(e.id)}};function Id(t){let e=null;if(wd(t)){let o=t.textContent;o!==null&&o!==""&&(e=_e({id:new Wo.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function _e({id:t,fields:e}){return Ed(new ie({id:t??new Wo.default().toHexString(),fields:e}))}function Z(t){return t instanceof ie}var he=Sd("TOGGLE_LINK_COMMAND");function Vo(t){let e=Nd();if(!Go(e)&&(t===null||!t.selectedNodes?.length))return;let o=Go(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(l=>{let i=l.getParent();Z(i)&&(i.getChildren().forEach(c=>{i.insertBefore(c)}),i.remove())});return}if(o?.length===1){let l=o[0],i=Z(l)?l:Rd(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(Z(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=_e({fields:t.fields}),Z(i)?l.getPreviousSibling()===null?i.insertBefore(n):i.insertAfter(n):l.insertBefore(n)),Z(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 Rd(t){return vd(t,e=>Z(e))}function vd(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function Uo(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:[ie],export:(t,e)=>{if(!Z(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=_e({fields:{doc:null,linkType:"custom",newTab:!1,url:r}}),l=Md(o);return l.setFormat(t.getFormat()),n.append(l),t.replace(n),l},trigger:")"};import{$applyNodeReplacement as Dd,$isElementNode as Ad}from"lexical";var Te=class t extends ie{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=Ct({}).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(Ad(r)){let n=Ct({fields:this.__fields});return r.append(n),n}return null}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields)}};function Ct({fields:t}){return Dd(new Te({id:"",fields:t}))}function we(t){return t instanceof Te}import{c as Od}from"react/compiler-runtime";import{useLexicalComposerContext as $d}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Fd}from"@lexical/utils";import{$createTextNode as $l,$getSelection as Pd,$isElementNode as Pl,$isLineBreakNode as Bl,$isNodeSelection as Bd,$isRangeSelection as Hd,$isTextNode as bt,TextNode as jd}from"lexical";import{useEffect as Ud}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 Gd=/[.,;\s]/;function qt(t){return t!==void 0&&Gd.test(t)}function jl(t){return qt(t[t.length-1])}function Jo(t){return qt(t[0])}function Wd(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)||bt(e)&&jl(e.getTextContent())}function Gl(t){let e=t.getNextSibling();return Pl(e)&&(e=e.getFirstDescendant()),e===null||Bl(e)||bt(e)&&Jo(e.getTextContent())}function Vd(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 Kd(t,e,o){let r=[],n=[],l=[],i=0,s=0,c=[...t];for(;c.length>0;){let u=c[0],a=u.getTextContent().length,p=s;s+a<=e?(r.push(u),i+=a):p>=o?l.push(u):n.push(u),s+=a,c.shift()}return[i,r,n,l]}function Jd(t,e,o,r){let n={linkType:"custom",url:r.url,...r.fields},l=Ct({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 c=$l(r.text);c.setFormat(s.getFormat()),c.setDetail(s.getDetail()),c.setStyle(s.getStyle()),l.append(c),s.replace(l)}return i}else if(t.length>1){let i=t[0],s=i.getTextContent().length,c;e===0?c=i:[,c]=i.splitText(e);let u=[],d;if(t.forEach(a=>{let m=a.getTextContent().length,f=s,h=s+m;if(f<o)if(h<=o)u.push(a);else{let[g,x]=a.splitText(o-f);g&&u.push(g),d=x}s+=m}),c){let a=Pd(),p=a?a.getNodes().find(bt):void 0,m=$l(c.getTextContent());return m.setFormat(c.getFormat()),m.setDetail(c.getDetail()),m.setStyle(c.getStyle()),l.append(m,...u),p&&p===c&&(Hd(a)?m.select(a.anchor.offset,a.focus.offset):Bd(a)&&m.select(0,m.getTextContent().length)),c.replace(l),d}}}function Xd(t,e,o){let r=[...t],n=r.map(c=>c.getTextContent()).join(""),l=n,i,s=0;for(;(i=Hl(l,e))!=null&&i!==null;){let c=i.index,u=i.length,d=c+u;if(Vd(s+c,s+d,n,r)){let[p,,m,f]=Kd(r,s+c,s+d),h=s+c-p,g=s+d-p,x=Jd(m,h,g,i);r=x?[x,...f]:f,o(i.url,null),s=0}else s+=d;l=l.substring(d)}}function Ko(t,e,o){let r=t.getChildren(),n=r.length;for(let c=0;c<n;c++){let u=r[c];if(!bt(u)||!u.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 c=t.getFields();c.url=i?.url,t.setFields(c),o(i.url,s??null)}}function zd(t,e,o){let r=t.getPreviousSibling(),n=t.getNextSibling(),l=t.getTextContent();if(we(r)){let i=r.getFields()?.url?r.getFields()?.url?.startsWith("mailto:")??!1:!1;(!Jo(l)||Wd(l,i))&&(r.append(t),Ko(r,e,o),o(null,r.getFields()?.url??null))}we(n)&&!jl(l)&&(Yt(n),Ko(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 Zd(t){let e=[t],o=t.getNextSibling();for(;o!==null&&bt(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function Yd(t,e,o){let r=Od(5),n,l;r[0]!==t||r[1]!==e||r[2]!==o?(n=()=>{if(!t.hasNodes([Te]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let i=(s,c)=>{o?.(s,c)};return Fd(t.registerNodeTransform(jd,s=>{let c=s.getParentOrThrow(),u=s.getPreviousSibling();if(we(c))Ko(c,e,i);else if(!Z(c)){if(s.isSimpleText()&&(Jo(s.getTextContent())||!we(u))){let d=Zd(s);Xd(d,e,i)}zd(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]),Ud(n,l)}var qd=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,Qd=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,em=[Fl(qd,t=>t.startsWith("http")?t:`https://${t}`),Fl(Qd,t=>`mailto:${t}`)],Wl=()=>{let[t]=$d();return Yd(t,em),null};import{jsx as tm}from"react/jsx-runtime";import{ClickableLinkPlugin as om}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var Vl=()=>tm(om,{});import{jsx as km}from"react/jsx-runtime";import"react";import{createPortal as _m}from"react-dom";import{jsx as Ee,jsxs as kt,Fragment as nm}from"react/jsx-runtime";import{useLexicalComposerContext as lm}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as Kl,mergeRegister as Jl}from"@lexical/utils";import{getTranslation as Xo}from"@payloadcms/translations";import{CloseMenuIcon as im,EditIcon as sm,ExternalLinkIcon as Xl,formatDrawerSlug as am,useConfig as cm,useEditDepth as um,useLocale as dm,useTranslation as mm}from"@payloadcms/ui";import{requests as pm}from"@payloadcms/ui/shared";import{$getSelection as zl,$isLineBreakNode as fm,$isRangeSelection as Zl,COMMAND_PRIORITY_HIGH as hm,COMMAND_PRIORITY_LOW as Yl,getDOMSelection as gm,KEY_ESCAPE_COMMAND as xm,SELECTION_CHANGE_COMMAND as Cm}from"lexical";import ql,{useCallback as Ql,useEffect as to,useRef as bm,useState as Pe}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(),c=l.getBoundingClientRect(),u=t.top-r,d=t.left-n;u<c.top&&(u+=i.height+t.height+r*2),d+i.width>c.right&&(d=c.right-i.width-n),u-=s.top,d-=s.left,e.style.opacity="1",e.style.transform=`translate(${d}px, ${u}px)`}import{createCommand as rm}from"lexical";var eo=rm("TOGGLE_LINK_WITH_MODAL_COMMAND");function ei(t){t.preventDefault()}function ti({anchorElem:t}){let[e]=lm(),[o,r]=Pe(),n=bm(null),[l,i]=Pe(null),[s,c]=Pe(null),{fieldProps:{schemaPath:u},uuid:d}=j(),{config:a,getEntityConfig:p}=cm(),{i18n:m,t:f}=mm(),[h,g]=Pe(),x=um(),[S,D]=Pe(!1),[k,_]=Pe([]),b=dm(),[N,M]=Pe(!1),O=am({slug:"lexical-rich-text-link-"+d,depth:x}),{toggleDrawer:F}=xe(O),I=Ql(()=>{D(!1),n&&n.current&&(n.current.style.opacity="0",n.current.style.transform="translate(-10000px, -10000px)"),M(!1),i(null),c(null),_([]),g(void 0)},[D,i,c,_]),w=Ql(()=>{let C=zl(),E;if(!Zl(C)||!C){I();return}let R=ze(C);E=e.getElementByKey(R.getKey())?.getBoundingClientRect();let L=Kl(R,Z),v=C.getNodes().filter(V=>!fm(V)).find(V=>{let U=Kl(V,Z);return L&&!L.is(U)||U&&!U.is(L)});if(L==null||v){I();return}r(L);let T=L.getFields(),$={...T,id:L.getID(),text:L.getTextContent()};if(T?.linkType==="custom")i(T?.url??null),c(null);else{i(`${a.routes.admin==="/"?"":a.routes.admin}/collections/${T?.doc?.relationTo}/${T?.doc?.value}`);let V=T?.doc?.relationTo?p({collectionSlug:T?.doc?.relationTo}):void 0;if(!V)c(T?.label?String(T?.label):null),i(T?.url?String(T?.url):null);else{let U=typeof T.doc?.value=="object"?T.doc.value.id:T.doc?.value,oe=T.doc?.relationTo;if(!U||!oe)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let ue=f("fields:linkedTo",{label:`${Xo(V.labels.singular,m)} - ${f("lexical:link:loadingWithEllipsis",m)}`}).replace(/<[^>]*>?/g,"");c(ue),pm.get(`${a.serverURL}${a.routes.api}/${oe}/${U}`,{headers:{"Accept-Language":m.language},params:{depth:0,locale:b?.code}}).then(async q=>{if(!q.ok)throw new Error(`HTTP error! Status: ${q.status}`);let K=await q.json(),re=V?.admin?.useAsTitle||"id",ne=K[re],se=f("fields:linkedTo",{label:`${Xo(V.labels.singular,m)} - ${ne}`}).replace(/<[^>]*>?/g,"");c(se)}).catch(()=>{let q=f("fields:linkedTo",{label:`${Xo(V.labels.singular,m)} - ${f("general:untitled",m)} - ID: ${U}`}).replace(/<[^>]*>?/g,"");c(q)})}}g($),D(!0),_(C?C?.getNodes():[]),we(L)?M(!0):M(!1);let H=n.current,W=gm(e._window),{activeElement:Y}=document;if(H===null)return;let We=e.getRootElement();return W!==null&&We!==null&&We.contains(W.anchorNode)?(E||(E=W.getRangeAt(0).getBoundingClientRect()),E!=null&&(E.y+=40,Qt(E,H,t))):(Y==null||Y.className!=="link-input")&&(We!==null&&Qt(null,H,t),i(null),c(null)),!0},[e,I,a.routes.admin,a.routes.api,a.serverURL,p,f,m,b?.code,t]);return to(()=>Jl(e.registerCommand(eo,C=>(e.dispatchCommand(he,C),w(),F(),!0),Yl)),[e,w,F,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(Cm,()=>(w(),!0),Yl),e.registerCommand(xm,()=>S?(I(),!0):!1,hm)),[e,w,S,I]),to(()=>{e.getEditorState().read(()=>{w()})},[e,w]),kt(ql.Fragment,{children:[Ee("div",{className:"link-editor",ref:n,children:kt("div",{className:"link-input",children:[l&&l.length>0?kt("a",{href:l,rel:"noopener noreferrer",target:"_blank",children:[o?.__fields.newTab?Ee(Xl,{}):null,s!=null&&s.length>0?s:l]}):s!=null&&s.length>0?kt(nm,{children:[o?.__fields.newTab?Ee(Xl,{}):null,Ee("span",{className:"link-input__label-pure",children:s})]}):null,e.isEditable()&&kt(ql.Fragment,{children:[Ee("button",{"aria-label":"Edit link",className:"link-edit",onClick:C=>{C.preventDefault(),F()},onMouseDown:ei,tabIndex:0,type:"button",children:Ee(sm,{})}),!N&&Ee("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(he,null)},onMouseDown:ei,tabIndex:0,type:"button",children:Ee(im,{})})]})]})}),Ee(st,{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 v=zl(),T=null;if(Zl(v)?T=ze(v).getParent():k.length&&(T=k[0]?.getParent()??null),T&&we(T)){let $=_e({fields:L});T.replace($,!0)}}),e.dispatchCommand(he,{fields:L,selectedNodes:k,text:R.text})},schemaPath:u,schemaPathSuffix:"fields"})]})}var oi=t=>{let{anchorElem:e=document.body}=t;return _m(km(ti,{anchorElem:e}),e)};import{c as Em}from"react/compiler-runtime";import{useLexicalComposerContext as Nm}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Sm}from"@lexical/utils";import{$getSelection as Lm,$isElementNode as ym,$isRangeSelection as Im,COMMAND_PRIORITY_LOW as ni,PASTE_COMMAND as Rm}from"lexical";import{useEffect as vm}from"react";var Tm=/^(?:[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+)?$/,wm=/^(?:\/[\w\-./]*(?:#\w[\w-]*)?|#[\w\-]+)$/;function ri(t){if(!t)return!1;if(t==="https://"||Tm.test(t)||wm.test(t))return!0;try{return new URL(t),!0}catch{}return!1}var li=t=>{let e=Em(5),{clientProps:o}=t,[r]=Nm(),n,l;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==r?(n=()=>{if(!r.hasNodes([ie]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Sm(r.registerCommand(he,i=>i===null?(Vo(null),!0):(i.fields?.linkType||(i.fields.linkType=o.defaultLinkType),i.fields?.url||(i.fields.url=o.defaultLinkURL),Vo(i),!0),ni),r.registerCommand(Rm,i=>{let s=Lm();if(!Im(s)||s.isCollapsed()||!(i instanceof ClipboardEvent)||i.clipboardData==null)return!1;let c=i.clipboardData.getData("text");if(!ri(c))return!1;if(!s.getNodes().some(Mm)){let u={doc:null,linkType:"custom",newTab:!1,url:c};return r.dispatchCommand(he,{fields:u,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]),vm(n,l),null};function Mm(t){return ym(t)}var si=[jo([{ChildComponent:vl,isActive:({selection:t})=>{if(ii(t)){let e=ze(t);return Dm(e,Z)!=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(he,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}])],Am=y(({props:t})=>({markdownTransformers:[Ol],nodes:[ie,t?.disableAutoLinks===!0?null:Te].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 Km,ListNode as Jm}from"@lexical/list";import{$isRangeSelection as Xm}from"lexical";import{jsx as ai,jsxs as Om}from"react/jsx-runtime";import"react";var Zo=()=>Om("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 $m}from"react/jsx-runtime";import{ListPlugin as Fm}from"@lexical/react/LexicalListPlugin.js";import"react";var Ze=()=>$m(Fm,{});function Ye(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{$isListNode as jm,ListItemNode as Um,ListNode as Gm}from"@lexical/list";import{$createListItemNode as Pm,$createListNode as Bm,$isListItemNode as Hm,$isListNode as Yo}from"@lexical/list";var ci=4,qe=t=>(e,o,r)=>{let n=e.getPreviousSibling(),l=e.getNextSibling(),i=Pm(t==="check"?r[3]==="x":void 0);if(Yo(l)&&l.getListType()===t){let c=l.getFirstChild();c!==null?c.insertBefore(i):l.append(i),e.remove()}else if(Yo(n)&&n.getListType()===t)n.append(i),e.remove();else{let c=Bm(t,t==="number"?Number(r[2]):void 0);c.append(i),e.replace(c)}i.append(...o),i.select(0,0);let s=Math.floor(r[1].length/ci);s&&i.setIndent(s)},Be=(t,e,o)=>{let r=[],n=t.getChildren(),l=0;for(let i of n)if(Hm(i)){if(i.getChildrenSize()===1){let d=i.getFirstChild();if(Yo(d)){r.push(Be(d,e,o+1));continue}}let s=" ".repeat(o*ci),c=t.getListType(),u=c==="number"?`${t.getStart()+l}. `:c==="check"?`- [${i.getChecked()?"x":" "}] `:"- ";r.push(s+u+e(i)),l++}return r.join(`
|
|
36
|
+
`)};var ui={type:"element",dependencies:[Gm,Um],export:(t,e)=>jm(t)?Be(t,e,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:qe("check")};import{jsx as Wm}from"react/jsx-runtime";import{CheckListPlugin as Vm}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var di=()=>Wm(Vm,{});var mi=[le([{ChildComponent:Zo,isActive:({selection:t})=>{if(!Xm(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}])],zm=y(({featureProviderMap:t})=>{let e=[{Component:di,position:"normal"}];return!t.has("unorderedList")&&!t.has("orderedList")&&e.push({Component:Ze,position:"normal"}),{markdownTransformers:[ui],nodes:t.has("unorderedList")||t.has("orderedList")?[]:[Jm,Km],plugins:e,slashMenu:{groups:[Ye([{Icon:Zo,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 er,INSERT_ORDERED_LIST_COMMAND as gi,ListItemNode as ep,ListNode as tp}from"@lexical/list";import{$isRangeSelection as op}from"lexical";import{jsx as _t,jsxs as Zm}from"react/jsx-runtime";import"react";var Qo=()=>Zm("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("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"}),_t("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"}),_t("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),_t("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),_t("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as Ym,ListItemNode as qm,ListNode as Qm}from"@lexical/list";var fi={type:"element",dependencies:[Qm,qm],export:(t,e)=>Ym(t)?Be(t,e,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:qe("number")};var hi=[le([{ChildComponent:Qo,isActive:({selection:t})=>{if(!op(t))return!1;for(let e of t.getNodes()){if(er(e)&&e.getListType()==="number")continue;let o=e.getParent();if(er(o)&&o.getListType()==="number")continue;let r=o?.getParent();if(!(er(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}])],rp=y(({featureProviderMap:t})=>({markdownTransformers:[fi],nodes:t.has("orderedList")?[]:[tp,ep],plugins:t.has("orderedList")?[]:[{Component:Ze,position:"normal"}],slashMenu:{groups:[Ye([{Icon:Qo,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 or,INSERT_UNORDERED_LIST_COMMAND as bi,ListItemNode as ap,ListNode as cp}from"@lexical/list";import{$isRangeSelection as up}from"lexical";import{jsx as Qe,jsxs as np}from"react/jsx-runtime";import"react";var tr=()=>np("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:[Qe("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Qe("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Qe("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Qe("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),Qe("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),Qe("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as lp,ListItemNode as ip,ListNode as sp}from"@lexical/list";var xi={type:"element",dependencies:[sp,ip],export:(t,e)=>lp(t)?Be(t,e,0):null,regExp:/^(\s*)[-*+]\s/,replace:qe("bullet")};var Ci=[le([{ChildComponent:tr,isActive:({selection:t})=>{if(!up(t))return!1;for(let e of t.getNodes()){if(or(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(or(o)&&o.getListType()==="bullet")continue;let r=o?.getParent();if(!(or(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}])],dp=y({markdownTransformers:[xi],nodes:[cp,ap],plugins:[{Component:Ze,position:"normal"}],slashMenu:{groups:[Ye([{Icon:tr,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 mp}from"react/jsx-runtime";import{addClassNamesToElement as pp}from"@lexical/utils";import{DecoratorNode as fp}from"lexical";import*as ki from"react";var hp=ki.lazy(()=>import("./Component-MBLHTKDK.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),Tt=class t extends fp{__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 gp({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return pp(o,"unknownConverted"),o}decorate(){return mp(hp,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function gp({data:t}){return new Tt({data:t})}var xp=y(()=>({nodes:[Tt]}));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-DOSSWC76.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),wt=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 wt({data:t})}var wp=y(()=>({nodes:[wt]}));import{$setBlocksType as Ei}from"@lexical/selection";import{$createParagraphNode as Ni,$getSelection as Si,$isParagraphNode as Ti,$isRangeSelection as Ep}from"lexical";var wi=[le([{ChildComponent:ct,isActive:({selection:t})=>{if(!Ep(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}])],Np=y({slashMenu:{groups:[ee([{Icon:ct,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 Kp}from"react/compiler-runtime";import{jsx as Jp}from"react/jsx-runtime";import{useLexicalComposerContext as Xp}from"@lexical/react/LexicalComposerContext";import{useEffect as zp,useState as Zp}from"react";import{jsx as Vi,Fragment as Vp}from"react/jsx-runtime";import"react";import{jsx as Sp}from"react/jsx-runtime";var Li={quote:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Sp("blockquote",{children:o})}};import{jsx as Lp}from"react/jsx-runtime";var yi={heading:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return Lp(r,{children:o})}};import{jsx as yp}from"react/jsx-runtime";var Ii={horizontalrule:yp("hr",{})};import{jsx as Ip}from"react/jsx-runtime";var Ri={linebreak:Ip("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 et,jsxs as Rp,Fragment as vp}from"react/jsx-runtime";import{v4 as Mp}from"uuid";var Di={list:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return et(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=Mp();return et("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:Rp(vp,{children:[et("input",{checked:t.checked,id:l,readOnly:!0,type:"checkbox"}),et("label",{htmlFor:l,children:n}),et("br",{})]})})}else return et("li",{className:`${r?"nestedListItem":""}`,style:r?{listStyleType:"none"}:void 0,value:t?.value,children:n})}};import{jsx as rr}from"react/jsx-runtime";var Ai={paragraph:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return o?.length?rr("p",{children:o}):rr("p",{children:rr("br",{})})}};var Oi={tab:" "};import{jsx as Et}from"react/jsx-runtime";var $i={table:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Et("div",{className:"lexical-table-container",children:Et("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:Et("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 Et(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 Et("tr",{className:"lexical-table-row",children:o})}};import{jsx as He}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},Dp=A.IS_BOLD|A.IS_ITALIC|A.IS_STRIKETHROUGH|A.IS_UNDERLINE|A.IS_CODE|A.IS_SUBSCRIPT|A.IS_SUPERSCRIPT|A.IS_HIGHLIGHT,Ap="\xA0",Op=`
|
|
37
37
|
|
|
38
|
-
`,Ui="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Gi="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Bp=new RegExp("^[^"+Gi+"]*["+Ui+"]"),Hp=new RegExp("^[^"+Ui+"]*["+Gi+"]"),jp={bold:O.IS_BOLD,code:O.IS_CODE,highlight:O.IS_HIGHLIGHT,italic:O.IS_ITALIC,strikethrough:O.IS_STRIKETHROUGH,subscript:O.IS_SUBSCRIPT,superscript:O.IS_SUPERSCRIPT,underline:O.IS_UNDERLINE},Up={directionless:O.IS_DIRECTIONLESS,unmergeable:O.IS_UNMERGEABLE},Gp={center:O.IS_ALIGN_CENTER,end:O.IS_ALIGN_END,justify:O.IS_ALIGN_JUSTIFY,left:O.IS_ALIGN_LEFT,right:O.IS_ALIGN_RIGHT,start:O.IS_ALIGN_START},Wp={[O.IS_ALIGN_CENTER]:"center",[O.IS_ALIGN_END]:"end",[O.IS_ALIGN_JUSTIFY]:"justify",[O.IS_ALIGN_LEFT]:"left",[O.IS_ALIGN_RIGHT]:"right",[O.IS_ALIGN_START]:"start"},Vp={normal:O.IS_NORMAL,segmented:O.IS_SEGMENTED,token:O.IS_TOKEN},Kp={[O.IS_NORMAL]:"normal",[O.IS_SEGMENTED]:"segmented",[O.IS_TOKEN]:"token"};var Wi={text:({node:t})=>{let e=t.text;return t.format&O.IS_BOLD&&(e=je("strong",{children:e})),t.format&O.IS_ITALIC&&(e=je("em",{children:e})),t.format&O.IS_STRIKETHROUGH&&(e=je("span",{style:{textDecoration:"line-through"},children:e})),t.format&O.IS_UNDERLINE&&(e=je("span",{style:{textDecoration:"underline"},children:e})),t.format&O.IS_CODE&&(e=je("code",{children:e})),t.format&O.IS_SUBSCRIPT&&(e=je("sub",{children:e})),t.format&O.IS_SUPERSCRIPT&&(e=je("sup",{children:e})),e}};import{jsx as Nt}from"react/jsx-runtime";var Vi={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 Nt("a",{href:r,rel:"noopener noreferrer",children:o.filename});if(!o.sizes||!Object.keys(o.sizes).length)return Nt("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(Nt("source",{media:`(max-width: ${i.width}px)`,srcSet:s,type:i.mimeType},l))}return n.push(Nt("img",{alt:o?.filename,height:o?.height,src:r,width:o?.width},"image")),Nt("picture",{children:n})}};var tt={...Bi,...Wi,...Oi,...Mi,...ji,...Ai,...Di,...Pi,...Fi({}),...Vi,...Hi};import{jsx as Ji,Fragment as Jp}from"react/jsx-runtime";import ir from"react";function Ki(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 Xi({converters:t,data:e,disableIndent:o,disableTextAlign:r}){return Ki(e)?zi({converters:t,disableIndent:o,disableTextAlign:r,nodes:e?.root?.children,parent:e?.root}):Ji(Jp,{})}function zi({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=>zi({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=Ji("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)*2}em`),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:tt}):i=e:i=tt;let s=o&&!Array.isArray(o)&&typeof o=="object"&&"root"in o&&Xi({converters:i,data:o,disableIndent:n,disableTextAlign:l});return r?Zi(Xp,{children:s}):Zi("div",{className:t??"payload-richtext",children:s})};function Yi(){let t=zp(7),[e]=Yp(),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]),qp(l,i);let s;return t[5]!==r?(s=Zp(sr,{converters:tt,data:r}),t[5]=r,t[6]=s):s=t[6],s}var ef=y({plugins:[{Component:Yi,position:"bottom"}]});var H={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)"}},tf={text:{"text-red":{css:{color:`light-dark(${H.red[600]}, ${H.red[400]})`},label:"Red"},"text-orange":{css:{color:`light-dark(${H.orange[600]}, ${H.orange[400]})`},label:"Orange"},"text-yellow":{css:{color:`light-dark(${H.yellow[700]}, ${H.yellow[300]})`},label:"Yellow"},"text-green":{css:{color:`light-dark(${H.green[700]}, ${H.green[400]})`},label:"Green"},"text-blue":{css:{color:`light-dark(${H.blue[600]}, ${H.blue[400]})`},label:"Blue"},"text-purple":{css:{color:`light-dark(${H.purple[600]}, ${H.purple[400]})`},label:"Purple"},"text-pink":{css:{color:`light-dark(${H.pink[600]}, ${H.pink[400]})`},label:"Pink"}},background:{"bg-red":{css:{"background-color":`light-dark(${H.red[400]}, ${H.red[600]})`},label:"Red"},"bg-orange":{css:{"background-color":`light-dark(${H.orange[400]}, ${H.orange[600]})`},label:"Orange"},"bg-yellow":{css:{"background-color":`light-dark(${H.yellow[300]}, ${H.yellow[700]})`},label:"Yellow"},"bg-green":{css:{"background-color":`light-dark(${H.green[400]}, ${H.green[700]})`},label:"Green"},"bg-blue":{css:{"background-color":`light-dark(${H.blue[400]}, ${H.blue[600]})`},label:"Blue"},"bg-purple":{css:{"background-color":`light-dark(${H.purple[400]}, ${H.purple[600]})`},label:"Purple"},"bg-pink":{css:{"background-color":`light-dark(${H.pink[400]}, ${H.pink[600]})`},label:"Pink"}}};import{$isNodeSelection as Hf}from"lexical";import{jsx as St,jsxs as of}from"react/jsx-runtime";import"react";var ar=()=>of("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:[St("g",{clipPath:"url(#clip0_4397_10817)",children:St("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"})}),St("defs",{children:St("clipPath",{id:"clip0_4397_10817",children:St("rect",{fill:"currentColor",height:"12",transform:"translate(4 4)",width:"12"})})})]});import{jsx as lf}from"react/jsx-runtime";import*as Qi from"react";import{DecoratorBlockNode as rf}from"@lexical/react/LexicalDecoratorBlockNode.js";function nf(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:qi({relationTo:o,value:e})}:null}var Lt=class extends rf{__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:nf,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=qi(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 qi(t){return new Lt({data:t})}var sf=Qi.lazy(()=>import("./RelationshipComponent-APF3CN47.js").then(t=>({default:t.RelationshipComponent})));function af(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:Ue({relationTo:o,value:e})}:null}var Se=class extends Lt{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:af,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=Ue(o);return r.setFormat(e.format),r}decorate(e,o){return lf(sf,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Ue(t){return new Se({data:t})}function cr(t){return t instanceof Se}import{c as Sf}from"react/compiler-runtime";import{jsx as Lf}from"react/jsx-runtime";import{useLexicalComposerContext as yf}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as If}from"@lexical/utils";import{useConfig as Rf}from"@payloadcms/ui";import{$getPreviousSelection as vf,$getSelection as Mf,$isParagraphNode as Af,$isRangeSelection as Df,COMMAND_PRIORITY_EDITOR as Of,createCommand as $f}from"lexical";import{useEffect as Ff}from"react";import{c as kf}from"react/compiler-runtime";import{jsx as ro}from"react/jsx-runtime";import{useLexicalComposerContext as _f}from"@lexical/react/LexicalComposerContext.js";import{$getNodeByKey as Tf,COMMAND_PRIORITY_EDITOR as wf}from"lexical";import{useEffect as Ef,useState as os}from"react";import{c as cf}from"react/compiler-runtime";import{jsx as uf}from"react/jsx-runtime";import{useLexicalComposerContext as df}from"@lexical/react/LexicalComposerContext";import{useListDrawer as mf,useModal as pf}from"@payloadcms/ui";import{$getNodeByKey as es,$getPreviousSelection as ff,$getRoot as hf,$getSelection as gf,$isRangeSelection as xf,$setSelection as Cf}from"lexical";import{useEffect as bf,useState as ts}from"react";var yt=t=>{let e=cf(23),[o]=df(),[r,n]=ts(null),[l,i]=ts(!1),[s,u,c]=mf(t),{closeDrawer:d,drawerSlug:a,isDrawerOpen:p,openDrawer:m}=c,{modalState:f}=pf(),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{let P=gf()??ff();n(P)},e[0]=h):h=e[0];let x=h,k;e[1]!==o||e[2]!==r?(k=()=>{r&&o.update(()=>{if(xf(r)){let{anchor:P,focus:v}=r;es(P.key)&&es(v.key)&&Cf(r.clone())}else hf().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=r,e[3]=k):k=e[3];let I=k,A;e[4]!==d?(A=()=>{d()},e[4]=d,e[5]=A):A=e[5];let b=A,_,g;e[6]!==a||e[7]!==f||e[8]!==I||e[9]!==l?(_=()=>{if(!l)return;let P=f[a];P&&!P?.isOpen&&(i(!1),setTimeout(()=>{I()},1))},g=[f,a,I,l],e[6]=a,e[7]=f,e[8]=I,e[9]=l,e[10]=_,e[11]=g):(_=e[10],g=e[11]),bf(_,g);let w;e[12]!==u?(w=P=>uf(u,{...P,onClick:()=>{x()}}),e[12]=u,e[13]=w):w=e[13];let M;e[14]!==m?(M=()=>{x(),m(),i(!0)},e[14]=m,e[15]=M):M=e[15];let D;return e[16]!==s||e[17]!==b||e[18]!==p||e[19]!==a||e[20]!==w||e[21]!==M?(D={closeListDrawer:b,isListDrawerOpen:p,ListDrawer:s,listDrawerSlug:a,ListDrawerToggler:w,openListDrawer:M},e[16]=s,e[17]=b,e[18]=p,e[19]=a,e[20]=w,e[21]=M,e[22]=D):D=e[22],D};var Nf=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=Tf(o);n&&n.replace(Ue({relationTo:e,value:r}))}):t.dispatchCommand(ur,{relationTo:e,value:r})},rs=t=>{let e=kf(16),{enabledCollectionSlugs:o}=t,[r]=_f(),n;e[0]!==o?.[0]?(n=()=>o?.[0],e[0]=o?.[0],e[1]=n):n=e[1];let[l]=os(n),[i,s]=os(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}=yt(c),m,f;e[5]!==r||e[6]!==p?(m=()=>r.registerCommand(at,I=>(s(I?.replace?I?.replace.nodeKey:null),p(),!0),wf),f=[r,p],e[5]=r,e[6]=p,e[7]=m,e[8]=f):(m=e[7],f=e[8]),Ef(m,f);let h;e[9]!==d||e[10]!==r||e[11]!==i?(h=I=>{let{collectionSlug:A,doc:b}=I;Nf({editor:r,relationTo:A,replaceNodeKey:i,value:b.id}),d()},e[9]=d,e[10]=r,e[11]=i,e[12]=h):h=e[12];let x=h,k;return e[13]!==a||e[14]!==x?(k=ro(a,{onSelect:x}),e[13]=a,e[14]=x,e[15]=k):k=e[15],k},ns=t=>(t?.enabledCollectionSlugs?.length??-1)>0?ro(rs,{...t}):ro(Ot,{...t,children:ro(rs,{...t})});var ur=$f("INSERT_RELATIONSHIP_COMMAND"),ls=t=>{let e=Sf(10),{clientProps:o}=t,[r]=yf(),{config:n}=Rf(),{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(Pf),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([Se]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return r.registerCommand(ur,Bf,Of)},u=[r],e[5]=r,e[6]=s,e[7]=u):(s=e[6],u=e[7]),Ff(s,u);let c;return e[8]!==i?(c=Lf(ns,{enabledCollectionSlugs:i}),e[8]=i,e[9]=c):c=e[9],c};function Pf(t){let{slug:e}=t;return e}function Bf(t){let e=Mf()||vf();if(Df(e)){let o=Ue(t),{focus:r}=e,n=r.getNode();If(o),Af(n)&&!n.__first&&n.remove()}return!0}var jf=y({nodes:[Se],plugins:[{Component:ls,position:"normal"}],slashMenu:{groups:[ee([{Icon:ar,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(at,{replace:!1})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:ar,isActive:({selection:t})=>{if(!Hf(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(at,{replace:!1})}}])]}});import{c as ms}from"react/compiler-runtime";import{jsx as me,jsxs as i0}from"react/jsx-runtime";import{useLexicalComposerContext as s0}from"@lexical/react/LexicalComposerContext.js";import{useScrollInfo as a0,useThrottledEffect as c0,useTranslation as u0}from"@payloadcms/ui";import*as Le from"react";import{useMemo as d0}from"react";import{c as Uf}from"react/compiler-runtime";import{jsx as Gf}from"react/jsx-runtime";import{mergeRegister as Wf}from"@lexical/utils";import{$addUpdateTag as Vf,$getSelection as Kf}from"lexical";import{useEffect as no,useState as dr}from"react";var mr="toolbar-popup__button",It=t=>{let e=Uf(34),{children:o,editor:r,item:n}=t,[l,i]=dr(!0),[s,u]=dr(!1),[c,d]=dr(mr),a=G(),p;e[0]!==s||e[1]!==r||e[2]!==a||e[3]!==l||e[4]!==n?(p=()=>{r.getEditorState().read(()=>{let M=Kf();if(M){if(n.isActive){let D=n.isActive({editor:r,editorConfigContext:a,selection:M});s!==D&&u(D)}if(n.isEnabled){let D=n.isEnabled({editor:r,editorConfigContext:a,selection:M});l!==D&&i(D)}}})},e[0]=s,e[1]=r,e[2]=a,e[3]=l,e[4]=n,e[5]=p):p=e[5];let m=p,f,h;e[6]!==m?(f=()=>{m()},h=[m],e[6]=m,e[7]=f,e[8]=h):(f=e[7],h=e[8]),no(f,h);let x,k;e[9]!==m?(x=()=>(document.addEventListener("mouseup",m),()=>{document.removeEventListener("mouseup",m)}),k=[m],e[9]=m,e[10]=x,e[11]=k):(x=e[10],k=e[11]),no(x,k);let I,A;e[12]!==r||e[13]!==m?(I=()=>Wf(r.registerUpdateListener(()=>{m()})),A=[r,m],e[12]=r,e[13]=m,e[14]=I,e[15]=A):(I=e[14],A=e[15]),no(I,A);let b;e[16]!==s||e[17]!==l||e[18]!==n.key?(b=()=>{d([mr,l===!1?"disabled":"",s?"active":"",n?.key?`${mr}-`+n.key:""].filter(Boolean).join(" "))},e[16]=s,e[17]=l,e[18]=n.key,e[19]=b):b=e[19];let _;e[20]!==s||e[21]!==c||e[22]!==l||e[23]!==n.key?(_=[l,s,c,n.key],e[20]=s,e[21]=c,e[22]=l,e[23]=n.key,e[24]=_):_=e[24],no(b,_);let g;e[25]!==s||e[26]!==r||e[27]!==l||e[28]!==n?(g=()=>{if(l!==!1)return r.focus(()=>{r.update(Jf),n.onSelect?.({editor:r,isActive:s})}),!0},e[25]=s,e[26]=r,e[27]=l,e[28]=n,e[29]=g):g=e[29];let w;return e[30]!==o||e[31]!==c||e[32]!==g?(w=Gf("button",{className:c,onClick:g,onMouseDown:Xf,type:"button",children:o}),e[30]=o,e[31]=c,e[32]=g,e[33]=w):w=e[33],w};function Jf(){Vf("toolbar")}function Xf(t){t.preventDefault()}import{c as ds}from"react/compiler-runtime";import{jsx as ot}from"react/jsx-runtime";import hr,{useEffect as us}from"react";import{mergeRegister as o0}from"@lexical/utils";import{useTranslation as r0}from"@payloadcms/ui";import{$getSelection as n0}from"lexical";import{jsx as Ae,jsxs as is}from"react/jsx-runtime";import{Button as zf}from"@payloadcms/ui";import{$addUpdateTag as Zf,isDOMNode as Yf}from"lexical";import lo,{useCallback as qf,useEffect as Rt,useMemo as Qf,useRef as fr,useState as io}from"react";import{createPortal as e0}from"react-dom";var pr="toolbar-popup__dropdown-item",ss=lo.createContext(null);function as({active:t,children:e,editor:o,enabled:r,Icon:n,item:l,tooltip:i}){let[s,u]=io(pr);Rt(()=>{u([pr,r===!1?"disabled":"",t?"active":"",l?.key?`${pr}-${l.key}`:""].filter(Boolean).join(" "))},[r,t,s,l.key]);let c=fr(null),d=lo.use(ss);if(d===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:a}=d;return Rt(()=>{c?.current!=null&&a(c)},[c,a]),Ae(zf,{"aria-label":i,buttonStyle:"none",className:s,disabled:r===!1,icon:n,iconPosition:"left",iconStyle:"none",onClick:()=>{r!==!1&&o.focus(()=>{o.update(()=>{Zf("toolbar")}),l.onSelect?.({editor:o,isActive:t})})},onMouseDown:p=>{p.preventDefault()},ref:c,tooltip:i,type:"button",children:e})}function t0({children:t,dropDownRef:e,itemsContainerClassNames:o,onClose:r}){let[n,l]=io(),[i,s]=io(),u=qf(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=Qf(()=>({registerItem:u}),[u]);return Rt(()=>{n!=null&&i==null&&s(n[0]),i!=null&&i?.current!=null&&i.current.focus()},[n,i]),Ae(ss,{value:d,children:Ae("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,Icon:n,itemsContainerClassNames:l,label:i,stopCloseOnClickSelf:s}){let u=fr(null),c=fr(null),[d,a]=io(!1),p=()=>{a(!1),c?.current!=null&&c.current.focus()};Rt(()=>{let f=c.current,h=u.current;if(d&&f!==null&&h!==null){let{left:x,top:k}=f.getBoundingClientRect(),I=window.scrollY||document.documentElement.scrollTop;h.style.top=`${k+I+f.offsetHeight+5}px`,h.style.left=`${Math.min(x-5,window.innerWidth-h.offsetWidth-20)}px`}},[u,c,d]),Rt(()=>{let f=c.current;if(f!==null&&d){let h=x=>{let k=x.target;Yf(k)&&(s&&u.current&&u.current.contains(k)||f.contains(k)||a(!1))};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[u,c,d,s]);let m=e0(Ae(t0,{dropDownRef:u,itemsContainerClassNames:l,onClose:p,children:o}),document.body);return is(lo.Fragment,{children:[is("button",{"aria-label":t,className:e+(d?" active":""),disabled:r,onClick:f=>{f.preventDefault(),a(!d)},onMouseDown:f=>{f.preventDefault()},ref:c,type:"button",children:[n&&Ae(n,{}),i&&Ae("span",{className:"toolbar-popup__dropdown-label",children:i}),Ae("i",{className:"toolbar-popup__dropdown-caret"})]}),d&&Ae(lo.Fragment,{children:m})]})}var gr="toolbar-popup__dropdown",l0=t=>{let e=ds(18),{active:o,anchorElem:r,editor:n,enabled:l,item:i}=t,{i18n:s}=r0(),{fieldProps:u}=G(),{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&&ot(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=ot(as,{active:o,editor:n,enabled:l,Icon:i?.ChildComponent?ot(i.ChildComponent,{}):void 0,item:i,tooltip:a,children:ot("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},Ge=t=>{let e=ds(36),{anchorElem:o,classNames:r,editor:n,group:l,Icon:i,itemsContainerClassNames:s,label:u,maxActiveItems:c,onActiveChange:d}=t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];let[p,m]=hr.useState(a),f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[1]=f):f=e[1];let[h,x]=hr.useState(f),[k,I]=hr.useState(!0),A=G(),{items:b,key:_}=l,g;e[2]!==n||e[3]!==A||e[4]!==l||e[5]!==b||e[6]!==c||e[7]!==d?(g=()=>{n.getEditorState().read(()=>{let F=n0();if(!F)return;let W=[],K=[],fe=[];for(let j of b)j.isActive&&(!c||W.length<c)&&j.isActive({editor:n,editorConfigContext:A,selection:F})&&(W.push(j.key),K.push(j)),j.isEnabled?j.isEnabled({editor:n,editorConfigContext:A,selection:F})&&fe.push(j.key):fe.push(j.key);l.isEnabled&&I(l.isEnabled({editor:n,editorConfigContext:A,selection:F})),m(W),x(fe),d&&d({activeItems:K})})},e[2]=n,e[3]=A,e[4]=l,e[5]=b,e[6]=c,e[7]=d,e[8]=g):g=e[8];let w=g,M,D;e[9]!==w?(M=()=>{w()},D=[w],e[9]=w,e[10]=M,e[11]=D):(M=e[10],D=e[11]),us(M,D);let P,v;e[12]!==n||e[13]!==w?(P=()=>o0(n.registerUpdateListener(()=>{w()})),v=[n,w],e[12]=n,e[13]=w,e[14]=P,e[15]=v):(P=e[14],v=e[15]),us(P,v);let N=`${_} dropdown`,C=`${gr}-${_}`,E;e[16]!==r?(E=r||[],e[16]=r,e[17]=E):E=e[17];let L;e[18]!==E||e[19]!==C?(L=[gr,C,...E].filter(Boolean),e[18]=E,e[19]=C,e[20]=L):L=e[20];let S=L.join(" "),R=!k,T;e[21]!==s?(T=s||[],e[21]=s,e[22]=T):T=e[22];let $;return e[23]!==i||e[24]!==p||e[25]!==o||e[26]!==n||e[27]!==h||e[28]!==_||e[29]!==b||e[30]!==u||e[31]!==S||e[32]!==R||e[33]!==T||e[34]!==N?($=ot(cs,{buttonAriaLabel:N,buttonClassName:S,disabled:R,Icon:i,itemsContainerClassNames:[`${gr}-items`,...T],label:u,children:b.length?b.map(F=>ot(l0,{active:p.includes(F.key),anchorElem:o,editor:n,enabled:h.includes(F.key),item:F},F.key)):null},_),e[23]=i,e[24]=p,e[25]=o,e[26]=n,e[27]=h,e[28]=_,e[29]=b,e[30]=u,e[31]=S,e[32]=R,e[33]=T,e[34]=N,e[35]=$):$=e[35],$};function m0({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&me(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?me(It,{editor:e,item:o,children:me(o.ChildComponent,{})},o.key):null}function p0(t){let e=ms(23),{anchorElem:o,editor:r,editorConfig:n,group:l,index:i}=t,{i18n:s}=u0(),{fieldProps:u}=G(),{featureClientSchemaMap:c,schemaPath:d}=u,[a,p]=Le.useState(void 0),[m,f]=Le.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 x;e[4]!==l?(x=[l],e[4]=l,e[5]=x):x=e[5],Le.useEffect(h,x);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:g}=_;if(!g.length){l?.type==="dropdown"&&l.items.length&&l.ChildComponent?(f(()=>l.ChildComponent),p(void 0)):(f(void 0),p(void 0));return}let w=g[0],M=w.key;w.label&&(M=typeof w.label=="function"?w.label({featureClientSchemaMap:c,i18n:s,schemaPath:d}):w.label),M.length>25&&(M=M.substring(0,25)+"..."),g.length===1?(p(M),f(()=>w.ChildComponent)):(p(s.t("lexical:general:toolbarItemsActive",{count:g.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 I=k,A=`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]!==I||e[21]!==A?(b=i0("div",{className:A,children:[l.type==="dropdown"&&l.items.length?m?me(Ge,{anchorElem:o,editor:r,group:l,Icon:m,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a,maxActiveItems:l.maxActiveItems??1,onActiveChange:I}):me(Ge,{anchorElem:o,editor:r,group:l,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a,maxActiveItems:l.maxActiveItems??1,onActiveChange:I}):null,l.type==="buttons"&&l.items.length?l.items.map(_=>me(m0,{anchorElem:o,editor:r,item:_},_.key)):null,i<n.features.toolbarFixed?.groups.length-1&&me("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]=I,e[21]=A,e[22]=b):b=e[22],b}function f0({anchorElem:t,clientProps:e,editor:o,editorConfig:r,parentWithFixedToolbar:n}){let l=Le.useRef(null),{y:i}=a0(),s=d0(()=>{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 c0(()=>{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]),me("div",{className:"fixed-toolbar",onFocus:u=>{u.stopPropagation()},ref:l,children:o.isEditable()&&me(Le.Fragment,{children:r?.features&&r.features?.toolbarFixed?.groups.map((u,c)=>me(p0,{anchorElem:t,editor:o,editorConfig:r,group:u,index:c},u.key))})})}var ps=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return ps(t.parentEditor)}return!1},fs=t=>{let e=ms(6),{clientProps:o}=t,[r]=s0(),n=G(),{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=ps(n);if(o?.disableIfParentHasFixedToolbar&&d){c=null;break e}if(!s?.features?.toolbarFixed?.groups?.length){c=null;break e}u=me(f0,{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 h0=y({plugins:[{Component:fs,position:"aboveContainer"}]});import{c as xs}from"react/compiler-runtime";import{jsx as xe,jsxs as Cs}from"react/jsx-runtime";import{useLexicalComposerContext as g0}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as bs}from"@lexical/utils";import{$getSelection as ks,$isRangeSelection as hs,$isTextNode as x0,COMMAND_PRIORITY_LOW as C0,getDOMSelection as _s,SELECTION_CHANGE_COMMAND as b0}from"lexical";import{useCallback as ao,useEffect as vt,useRef as gs,useState as k0}from"react";import*as co from"react";import{createPortal as _0}from"react-dom";function xr(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 so(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 x=0;return!e&&f<m.top&&!s&&(x=a.height+u.height+c*2,f+=x),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)`),x}function T0({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&xe(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?xe(It,{editor:e,item:o,children:xe(o.ChildComponent,{})},o.key):null}function w0(t){let e=xs(19),{anchorElem:o,editor:r,group:n,index:l}=t,{editorConfig:i}=G(),[s,u]=co.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],co.useEffect(c,d);let a;e[6]!==n.ChildComponent||e[7]!==n.items||e[8]!==n.type?(a=h=>{let{activeItems:x}=h;if(!x.length){n?.type==="dropdown"&&n.items.length&&n.ChildComponent?u(()=>n.ChildComponent):u(void 0);return}let k=x[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=Cs("div",{className:m,children:[n.type==="dropdown"&&n.items.length?s?xe(Ge,{anchorElem:o,editor:r,group:n,Icon:s,maxActiveItems:n.maxActiveItems??1,onActiveChange:p}):xe(Ge,{anchorElem:o,editor:r,group:n,maxActiveItems:n.maxActiveItems??1,onActiveChange:p}):null,n.type==="buttons"&&n.items.length?n.items.map(h=>xe(T0,{anchorElem:o,editor:r,item:h},h.key)):null,l<i.features.toolbarInline?.groups.length-1&&xe("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 E0({anchorElem:t,editor:e}){let o=gs(null),r=gs(null),{editorConfig:n}=G(),l=ao(()=>{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=ao(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=ao(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);vt(()=>(document.addEventListener("mousemove",i),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)}),[o,i,s]);let u=ao(()=>{let c=ks(),d=_s(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=xr(d,m),h=so({alwaysDisplayOnTop:p,anchorElem:t,floatingElem:o.current,horizontalPosition:"center",targetRect:f});r.current&&so({anchorElem:o.current,anchorFlippedOffset:h,floatingElem:r.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:f,verticalGap:8})}else l()},[e,l,t]);return vt(()=>{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]),vt(()=>(e.getEditorState().read(()=>{u()}),bs(e.registerUpdateListener(({editorState:c})=>{c.read(()=>{u()})}),e.registerCommand(b0,()=>(u(),!1),C0))),[e,u]),Cs("div",{className:"inline-toolbar-popup",ref:o,children:[xe("div",{className:"caret",ref:r}),n?.features&&n.features?.toolbarInline?.groups.map((c,d)=>xe(w0,{anchorElem:t,editor:e,group:c,index:d},c.key))]})}function N0(t,e){let o=xs(12),[r,n]=k0(!1),l;o[0]!==t?(l=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let p=ks(),m=_s(t._window),f=t.getRootElement();if(m!==null&&(!hs(p)||f===null||!f.contains(m.anchorNode))){n(!1);return}if(!hs(p))return;if(p.getTextContent()!==""){let x=p.getNodes(),k=!1;for(let I of x)if(x0(I)){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]),vt(s,u);let c,d;if(o[5]!==t||o[6]!==i?(c=()=>bs(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]),vt(c,d),!r||!t.isEditable())return null;let a;return o[9]!==e||o[10]!==t?(a=_0(xe(E0,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=a):a=o[11],a}var Ts=t=>{let{anchorElem:e}=t,[o]=g0();return N0(o,e)};var S0=y({plugins:[{Component:Ts,position:"floatingAnchorElem"}]});import{TableCellNode as gh,TableNode as xh,TableRowNode as Ch}from"@lexical/table";import{jsx as ws}from"react/jsx-runtime";import"react";var Cr=()=>ws("svg",{className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ws("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 L0,$createTableNode as y0,$createTableRowNode as I0,$isTableCellNode as Es,$isTableNode as br,$isTableRowNode as kr,TableCellHeaderStates as uo,TableCellNode as R0,TableNode as v0,TableRowNode as M0}from"@lexical/table";import{$isParagraphNode as A0,$isTextNode as D0}from"lexical";var Ss=/^\|(.+)\|\s?$/,O0=/^(\| ?:?-*:? ?)+\|\s?$/,Ls=({allTransformers:t})=>({type:"element",dependencies:[v0,M0,R0],export:e=>{if(!br(e))return null;let o=[];for(let r of e.getChildren()){let n=[];if(!kr(r))continue;let l=!1;for(let i of r.getChildren())Es(i)&&(n.push(Gr(t,i).replace(/\n/g,"\\n").trim()),i.__headerState===uo.ROW&&(l=!0));o.push(`| ${n.join(" | ")} |`),l&&o.push(`| ${n.map(i=>"---").join(" | ")} |`)}return o.join(`
|
|
39
|
-
`)},regExp:
|
|
40
|
-
`);let o=L0(uo.NO_STATUS);return Ur(t,e,o),o},Ns=(t,e)=>{let o=t.match(Ss);return!o||!o[1]?null:o[1].split("|").map(r=>ys(r,e))};import{c as P0}from"react/compiler-runtime";import{jsx as B,jsxs as ye}from"react/jsx-runtime";import{useLexicalComposerContext as Ms}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as B0}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as Tr,$deleteTableColumn__EXPERIMENTAL as H0,$deleteTableRow__EXPERIMENTAL as j0,$getNodeTriplet as U0,$getTableCellNodeFromLexicalNode as Rs,$getTableColumnIndexFromTableCellNode as G0,$getTableNodeFromLexicalNodeOrThrow as Ie,$getTableRowIndexFromTableCellNode as W0,$insertTableColumn__EXPERIMENTAL as V0,$insertTableRow__EXPERIMENTAL as K0,$isTableCellNode as As,$isTableSelection as Mt,$unmergeCell as J0,getTableElement as wr,getTableObserverFromTableElement as Er,TableCellHeaderStates as De,TableCellNode as X0}from"@lexical/table";import{mergeRegister as z0}from"@lexical/utils";import{useScrollInfo as Z0}from"@payloadcms/ui";import{$createParagraphNode as Y0,$getSelection as po,$isElementNode as q0,$isParagraphNode as Q0,$isRangeSelection as Nr,$isTextNode as e1,$setSelection as t1,COMMAND_PRIORITY_CRITICAL as o1,getDOMSelection as r1,isDOMNode as n1,SELECTION_CHANGE_COMMAND as l1}from"lexical";import*as Sr from"react";import{useCallback as pe,useEffect as rt,useRef as mo,useState as nt}from"react";import{createPortal as Ds}from"react-dom";import{jsx as _r,jsxs as F0}from"react/jsx-runtime";import"react";var Is=()=>F0("svg",{fill:"none",height:"18",viewBox:"0 0 20 20",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[_r("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"}),_r("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"}),_r("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 i1(){let t=po();if(Nr(t)&&!t.isCollapsed()||Mt(t)&&!t.anchor.is(t.focus)||!Nr(t)&&!Mt(t))return!1;let[e]=U0(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function s1(t){if(t.getChildrenSize()!==1)return!1;let e=t.getFirstChildOrThrow();return!(!Q0(e)||!e.isEmpty())}function a1(t){let e=t.getLastDescendant();e1(e)?e.select():q0(e)?e.selectEnd():e!==null&&e.selectNext()}function c1({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:r,tableCellNode:n}){let[l]=Ms(),i=mo(null),[s,u]=nt(n),[c,d]=nt({columns:1,rows:1}),[a,p]=nt(!1),[m,f]=nt(!1),{y:h}=Z0();rt(()=>l.registerMutationListener(X0,C=>{C.get(s.getKey())==="updated"&&l.getEditorState().read(()=>{u(s.getLatest())})},{skipInitialization:!0}),[l,s]),rt(()=>{l.getEditorState().read(()=>{let C=po();if(Mt(C)){let E=vs(C);d(vs(C)),p(E.columns>1||E.rows>1)}f(i1())})},[l]),rt(()=>{let C=e.current,E=i.current,L=l.getRootElement();if(C!=null&&E!=null&&L!=null){let S=L.getBoundingClientRect(),R=C.getBoundingClientRect();E.style.opacity="1";let T=E.getBoundingClientRect(),$=5,F=R.right+$;if(F+T.width>window.innerWidth||F+T.width>S.right){let K=R.left-T.width-$;F=(K<0?$:K)+window.pageXOffset}E.style.left=`${F+window.pageXOffset}px`;let W=R.top;if(W+T.height>window.innerHeight){let K=R.bottom-T.height;W=K<0?$:K}E.style.top=`${W}px`}},[e,i,l,h]),rt(()=>{function C(E){i.current!=null&&e.current!=null&&n1(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 x=pe(()=>{l.update(()=>{if(s.isAttached()){let C=Ie(s),E=wr(C,l.getElementByKey(C.getKey()));if(E===null)throw new Error("Expected to find tableElement in DOM");let L=Er(E);L!==null&&L.$clearHighlight(),C.markDirty(),u(s.getLatest())}t1(null)})},[l,s]),k=()=>{l.update(()=>{let C=po();if(Mt(C)){let L=C.getNodes().filter(As);if(L.length===0)return;let S=Ie(L[0]),[R]=Tr(S,null,null),T=1/0,$=-1/0,F=1/0,W=-1/0,K=new Set;for(let q of R)for(let J of q){if(!J||!J.cell)continue;let re=J.cell.getKey();if(!K.has(re)&&L.some(ne=>ne.is(J.cell))){K.add(re);let ne=J.startRow,se=J.startColumn,Oe=J.cell.__rowSpan||1,it=J.cell.__colSpan||1;T=Math.min(T,ne),$=Math.max($,ne+Oe-1),F=Math.min(F,se),W=Math.max(W,se+it-1)}}if(T===1/0||F===1/0)return;let fe=$-T+1,j=W-F+1,U=R?.[T]?.[F];if(!U?.cell)return;let oe=U.cell;oe.setColSpan(j),oe.setRowSpan(fe);let ue=new Set([oe.getKey()]);for(let q=T;q<=$;q++)for(let J=F;J<=W;J++){let re=R?.[q]?.[J];if(!re?.cell)continue;let ne=re.cell,se=ne.getKey();ue.has(se)||(ue.add(se),s1(ne)||oe.append(...ne.getChildren()),ne.remove())}oe.getChildrenSize()===0&&oe.append(Y0()),a1(oe),o()}})},I=()=>{l.update(()=>{J0()})},A=pe(C=>{l.update(()=>{for(let E=0;E<c.rows;E++)K0(C);o()})},[l,o,c.rows]),b=pe(C=>{l.update(()=>{for(let E=0;E<c.columns;E++)V0(C);o()})},[l,o,c.columns]),_=pe(()=>{l.update(()=>{j0(),o()})},[l,o]),g=pe(()=>{l.update(()=>{Ie(s).remove(),x(),o()})},[l,s,x,o]),w=pe(()=>{l.update(()=>{H0(),o()})},[l,o]),M=pe(()=>{l.update(()=>{let C=Ie(s),E=W0(s),[L]=Tr(C,null,null),S=new Set,R=s.getHeaderStyles()^De.ROW;if(L[E])for(let T=0;T<L[E].length;T++){let $=L[E][T];$?.cell&&(S.has($.cell)||(S.add($.cell),$.cell.setHeaderStyles(R,De.ROW)))}x(),o()})},[l,s,x,o]),D=pe(()=>{l.update(()=>{let C=Ie(s),E=G0(s),[L]=Tr(C,null,null),S=new Set,R=s.getHeaderStyles()^De.COLUMN;if(L)for(let T=0;T<L.length;T++){let $=L?.[T]?.[E];$?.cell&&(S.has($.cell)||(S.add($.cell),$.cell.setHeaderStyles(R,De.COLUMN)))}x(),o()})},[l,s,x,o]),P=pe(()=>{l.update(()=>{if(s.isAttached()){let C=Ie(s);C&&C.setRowStriping(!C.getRowStriping())}x(),o()})},[l,s,x,o]),v=pe(()=>{l.update(()=>{if(s.isAttached()){let C=Ie(s);C&&C.setFrozenColumns(C.getFrozenColumns()===0?1:0)}x(),o()})},[l,s,x,o]),N=null;return t&&(a?N=B("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>k(),type:"button",children:B("span",{className:"text",children:"Merge cells"})}):m&&(N=B("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>I(),type:"button",children:B("span",{className:"text",children:"Unmerge cells"})}))),Ds(ye("div",{className:"table-action-menu-dropdown",onClick:C=>{C.stopPropagation()},ref:i,children:[N?ye(Sr.Fragment,{children:[N,B("hr",{})]}):null,B("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>P(),type:"button",children:B("span",{className:"text",children:"Toggle Row Striping"})}),B("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>v(),type:"button",children:B("span",{className:"text",children:"Toggle First Column Freeze"})}),B("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>A(!1),type:"button",children:ye("span",{className:"text",children:["Insert ",c.rows===1?"row":`${c.rows} rows`," above"]})}),B("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>A(!0),type:"button",children:ye("span",{className:"text",children:["Insert ",c.rows===1?"row":`${c.rows} rows`," below"]})}),B("hr",{}),B("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>b(!1),type:"button",children:ye("span",{className:"text",children:["Insert ",c.columns===1?"column":`${c.columns} columns`," ","left"]})}),B("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>b(!0),type:"button",children:ye("span",{className:"text",children:["Insert ",c.columns===1?"column":`${c.columns} columns`," ","right"]})}),B("hr",{}),B("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>w(),type:"button",children:B("span",{className:"text",children:"Delete column"})}),B("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>_(),type:"button",children:B("span",{className:"text",children:"Delete row"})}),B("button",{className:"item","data-test-id":"table-delete",onClick:()=>g(),type:"button",children:B("span",{className:"text",children:"Delete table"})}),B("hr",{}),B("button",{className:"item","data-test-id":"table-row-header",onClick:()=>M(),type:"button",children:ye("span",{className:"text",children:[(s.__headerState&De.ROW)===De.ROW?"Remove":"Add"," ","row header"]})}),B("button",{className:"item","data-test-id":"table-column-header",onClick:()=>D(),type:"button",children:ye("span",{className:"text",children:[(s.__headerState&De.COLUMN)===De.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function u1({anchorElem:t,cellMerge:e}){let[o]=Ms(),r=mo(null),n=mo(null),[l,i]=nt(!1),[s,u]=nt(null),c=pe(()=>{let a=r.current,p=po(),m=r1(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 x=o.getRootElement(),k=null,I=null;if(Nr(p)&&x!==null&&m!==null&&x.contains(m.anchorNode)){let b=Rs(p.anchor.getNode());if(b==null||(I=o.getElementByKey(b.getKey()),I==null||!b.isAttached()))return h();let _=Ie(b),g=wr(_,o.getElementByKey(_.getKey()));if(g===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");k=Er(g),u(b)}else if(Mt(p)){let b=Rs(p.anchor.getNode());if(!As(b))throw new Error("TableSelection anchorNode must be a TableCellNode");let _=Ie(b),g=wr(_,o.getElementByKey(_.getKey()));if(g===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");k=Er(g),I=o.getElementByKey(b.getKey())}else if(!f)return h();if(k===null||I===null)return h();let A=!k||!k.isSelecting;if(a.classList.toggle("table-cell-action-button-container--active",A),a.classList.toggle("table-cell-action-button-container--inactive",!A),A){let b=I.getBoundingClientRect(),_=t.getBoundingClientRect(),g=b.top-_.top,w=b.right-_.left;a.style.transform=`translate(${w}px, ${g}px)`}},[o,t]);rt(()=>{let a,p=()=>{a=void 0,o.getEditorState().read(c)},m=()=>(a===void 0&&(a=setTimeout(p,0)),!1);return z0(o.registerUpdateListener(m),o.registerCommand(l1,m,o1),o.registerRootListener((f,h)=>{h&&h.removeEventListener("pointerup",m),f&&(f.addEventListener("pointerup",m),m())}),()=>clearTimeout(a))});let d=mo(s);return rt(()=>{d.current!==s&&i(!1),d.current=s},[d,s]),B("div",{className:"table-cell-action-button-container",ref:r,children:s!=null&&ye(Sr.Fragment,{children:[B("button",{className:"table-cell-action-button",onClick:a=>{a.stopPropagation(),i(!l)},ref:n,type:"button",children:B(Is,{})}),l&&B(c1,{cellMerge:e,contextRef:n,onClose:()=>i(!1),setIsMenuOpen:i,tableCellNode:s})]})})}var Os=t=>{let e=P0(3),{anchorElem:o}=t,r=B0(),n;return e[0]!==o||e[1]!==r?(n=Ds(r?B(u1,{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 d1}from"react/compiler-runtime";import{jsx as ho,jsxs as m1}from"react/jsx-runtime";import{useLexicalComposerContext as p1}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as f1}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as h1,$getTableNodeFromLexicalNodeOrThrow as Lr,$getTableRowIndexFromTableCellNode as g1,$isTableCellNode as $s,$isTableRowNode as x1,getDOMCellFromTarget as C1,getTableElement as b1,TableNode as Fs}from"@lexical/table";import{calculateZoomLevel as Ps,mergeRegister as k1}from"@lexical/utils";import{$getNearestNodeFromDOMNode as yr,isHTMLElement as _1}from"lexical";import*as Hs from"react";import{useCallback as At,useEffect as Ir,useRef as fo,useState as lt}from"react";import{createPortal as T1}from"react-dom";var w1=33,Bs=92;function E1({editor:t}){let e=fo(null),o=fo(null),r=fo(null),[n,l]=lt(!1),i=G(),s=fo(null),[u,c]=lt(null),[d,a]=lt(null),[p,m]=lt(!1),[f,h]=lt(null),x=At(()=>{a(null),e.current=null,h(null),s.current=null,r.current=null},[]),k=v=>(v.buttons&1)===1;Ir(()=>{let v=new Set;return k1(t.registerMutationListener(Fs,N=>{for(let[C,E]of N)E==="destroyed"?v.delete(C):v.add(C);l(v.size>0)}),t.registerNodeTransform(Fs,N=>{if(N.getColWidths())return N;let C=N.getColumnCount(),E=Bs;return N.setColWidths(Array(C).fill(E)),N}))},[t]),Ir(()=>{if(!n)return;let v=L=>{let S=L.target;if(_1(S)){if(f){c({x:L.clientX,y:L.clientY});return}if(m(k(L)),!(o.current&&o.current.contains(S))&&e.current!==S){e.current=S;let R=C1(S);R&&d!==R?t.getEditorState().read(()=>{let T=yr(R.elem);if(!T)throw new Error("TableCellResizer: Table cell node not found.");let $=Lr(T),F=b1($,t.getElementByKey($.getKey()));if(!F)throw new Error("TableCellResizer: Table element not found.");e.current=S,r.current=F.getBoundingClientRect(),a(R)},{editor:t}):R==null&&x()}}},N=L=>{m(!0)},C=L=>{m(!1)},E=t.registerRootListener((L,S)=>{S?.removeEventListener("mousemove",v),S?.removeEventListener("mousedown",N),S?.removeEventListener("mouseup",C),L?.addEventListener("mousemove",v),L?.addEventListener("mousedown",N),L?.addEventListener("mouseup",C)});return()=>{E()}},[d,f,t,n,x]);let I=v=>v==="bottom",A=At(v=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let N=yr(d.elem);if(!$s(N))throw new Error("TableCellResizer: Table cell node not found.");let C=Lr(N),E=g1(N),L=C.getChildren(),R=N.getColSpan()===C.getColumnCount()?E:E+N.getRowSpan()-1;if(R>=L.length||R<0)throw new Error("Expected table cell to be inside of table row.");let T=L[R];if(!x1(T))throw new Error("Expected table row");let $=T.getHeight();if($===void 0){let W=T.getChildren();$=Math.min(...W.map(K=>b(K,t)??1/0))}let F=Math.max($+v,w1);T.setHeight(F)},{tag:"skip-scroll-into-view"})},[d,t]),b=(v,N)=>N.getElementByKey(v.getKey())?.clientHeight,_=(v,N)=>{let C;return N.forEach(E=>{E.forEach((L,S)=>{L.cell===v&&(C=S)})}),C},g=At(v=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let N=yr(d.elem);if(!$s(N))throw new Error("TableCellResizer: Table cell node not found.");let C=Lr(N),[E]=h1(C,null,null),L=_(N,E);if(L===void 0)throw new Error("TableCellResizer: Table column not found.");let S=C.getColWidths();if(!S)return;let R=S[L];if(R===void 0)return;let T=[...S],$=Math.max(R+v,Bs);T[L]=$,C.setColWidths(T)},{tag:"skip-scroll-into-view"})},[d,t]),w=At(v=>{let N=C=>{if(C.preventDefault(),C.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");if(s.current){let{x:E,y:L}=s.current;if(d===null)return;let S=Ps(C.target);if(I(v)){let R=(C.clientY-L)/S;A(R)}else{let R=(C.clientX-E)/S;g(R)}x(),document.removeEventListener("mouseup",N)}};return N},[d,x,g,A]),M=At(v=>N=>{if(N.preventDefault(),N.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");s.current={x:N.clientX,y:N.clientY},c(s.current),h(v),document.addEventListener("mouseup",w(v))},[d,w]),[D,P]=lt({bottom:null,left:null,right:null,top:null});return Ir(()=>{if(d){let{height:v,left:N,top:C,width:E}=d.elem.getBoundingClientRect(),L=Ps(d.elem),S=10,R={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${S}px`,left:`${window.scrollX+N}px`,top:`${window.scrollY+C+v-S/2}px`,width:`${E}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${v}px`,left:`${window.scrollX+N+E-S/2}px`,top:`${window.scrollY+C}px`,width:`${S}px`}},T=r.current;f&&u&&T&&(I(f)?(R[f].left=`${window.scrollX+T.left}px`,R[f].top=`${window.scrollY+u.y/L}px`,R[f].height="3px",R[f].width=`${T.width}px`):(R[f].top=`${window.scrollY+T.top}px`,R[f].left=`${window.scrollX+u.x/L}px`,R[f].width="3px",R[f].height=`${T.height}px`),R[f].backgroundColor="#adf"),P(R)}else P({bottom:null,left:null,right:null,top:null})},[d,f,u]),ho("div",{ref:o,children:d!=null&&!p&&m1(Hs.Fragment,{children:[ho("div",{className:`${i.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:M("right"),style:D.right||void 0}),ho("div",{className:`${i.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:M("bottom"),style:D.bottom||void 0})]})})}var js=()=>{let t=d1(3),[e]=p1(),o=f1(),r,n;return t[0]!==e||t[1]!==o?(n=o?T1(ho(E1,{editor:e}),document.body):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],r=n,r};import{c as M1}from"react/compiler-runtime";import{jsx as Rr,jsxs as A1,Fragment as D1}from"react/jsx-runtime";import{useLexicalComposerContext as zs}from"@lexical/react/LexicalComposerContext";import{$getTableAndElementByKey as O1,$getTableColumnIndexFromTableCellNode as $1,$getTableRowIndexFromTableCellNode as F1,$insertTableColumn__EXPERIMENTAL as P1,$insertTableRow__EXPERIMENTAL as B1,$isTableCellNode as H1,$isTableNode as Ws,getTableElement as j1,TableNode as U1}from"@lexical/table";import{$findMatchingParent as G1,mergeRegister as W1}from"@lexical/utils";import{$getNearestNodeFromDOMNode as Vs,isHTMLElement as V1}from"lexical";import{useEffect as Ks,useMemo as K1,useRef as Js,useState as go}from"react";import"react";import{createPortal as J1}from"react-dom";import{c as I1}from"react/compiler-runtime";import{useEffect as R1,useRef as v1}from"react";var N1="Expected a function",S1=Math.max,L1=Math.min;function y1(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(N1);e=e||0,typeof o=="object"&&(s=!!o.leading,u="maxWait"in o,c=u?S1(o.maxWait||0,e):c,p="trailing"in o?!!o.trailing:p);function m(g){let w=r,M=i;return r=i=void 0,l=g,d=t.apply(M,w),d}function f(g){return l=g,a=setTimeout(k,e),s?m(g):d}function h(g){let w=g-n,M=g-l,D=e-w;return u?L1(D,c-M):D}function x(g){let w=g-n,M=g-l;return n===void 0||w>=e||w<0||u&&M>=c}function k(){let g=Date.now();if(x(g))return I(g);a=setTimeout(k,h(g))}function I(g){return a=void 0,p&&r?m(g):(r=i=void 0,d)}function A(){a!==void 0&&clearTimeout(a),l=0,r=n=i=a=void 0}function b(){return a===void 0?d:I(Date.now())}function _(){let g=Date.now(),w=x(g);if(r=arguments,i=this,n=g,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=A,_.flush=b,_}var Us=y1;function Gs(t,e,o){let r=I1(6),n=v1(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]),R1(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 X1({anchorElem:t}){let[e]=zs(),o=G(),[r,n]=go(!1),[l,i]=go(!1),[s,u]=go(!1),[c,d]=go({}),a=Js(new Set),p=Js(null),m=Gs(x=>{let{isOutside:k,tableDOMNode:I}=z1(x,o.editorConfig?.lexical);if(k){n(!1),i(!1);return}if(!I)return;p.current=I;let A=null,b=null,_=null;if(e.getEditorState().read(()=>{let S=Vs(I);if(H1(S)){let R=G1(S,T=>Ws(T));if(!Ws(R))return;if(_=j1(R,e.getElementByKey(R.getKey())),_){let T=R.getChildrenSize(),$=R.getChildAtIndex(0)?.getChildrenSize(),F=F1(S),W=$1(S);F===T-1?A=S:W===$-1&&(b=S)}}},{editor:e}),!_)return;let g=_.parentElement;if(!g)return;let{bottom:w,height:M,left:D,right:P,width:v,y:N}=_.getBoundingClientRect(),C=!1;g&&g.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(C=g.scrollWidth>g.clientWidth);let{left:E,y:L}=t.getBoundingClientRect();A?(i(!1),n(!0),d({height:Xs,left:C&&g?g.offsetLeft:D-E,top:w-L+5,width:C&&g?g.offsetWidth:v})):b&&(i(!0),n(!1),d({height:M,left:P-E+5,top:N-L,width:Xs}))},50,250),f=K1(()=>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(()=>W1(e.registerMutationListener(U1,x=>{e.getEditorState().read(()=>{let k=!1;for(let[I,A]of x)switch(A){case"created":{a.current.add(I),k=!0;break}case"destroyed":{a.current.delete(I),k=!0;break}default:break}if(k){f.disconnect();for(let I of a.current){let{tableElement:A}=O1(I);f.observe(A)}u(a.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let h=x=>{e.update(()=>{p.current&&(Vs(p.current)?.selectEnd(),x?(B1(),n(!1)):(P1(),i(!1)))})};return e?.isEditable()?A1(D1,{children:[r&&Rr("button",{"aria-label":"Add Row",className:o.editorConfig.lexical.theme.tableAddRows,onClick:()=>h(!0),style:{...c},type:"button"}),l&&Rr("button",{"aria-label":"Add Column",className:o.editorConfig.lexical.theme.tableAddColumns,onClick:()=>h(!1),style:{...c},type:"button"})]}):null}function z1(t,e){let o=t.target;if(V1(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=M1(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=J1(Rr(X1,{anchorElem:r}),r),e[0]=r,e[1]=l):l=e[1],l}import{c as Z1}from"react/compiler-runtime";import{jsx as vr,jsxs as Y1}from"react/jsx-runtime";import{useLexicalComposerContext as q1}from"@lexical/react/LexicalComposerContext";import{TablePlugin as Q1}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as eh,TableCellNode as th,TableNode as oh,TableRowNode as rh}from"@lexical/table";import{mergeRegister as nh}from"@lexical/utils";import{formatDrawerSlug as lh,useEditDepth as ih}from"@payloadcms/ui";import{$getSelection as sh,$isRangeSelection as ah,COMMAND_PRIORITY_EDITOR as ch,createCommand as uh}from"lexical";import{createContext as dh,use as mh,useEffect as ph,useMemo as fh,useState as hh}from"react";import*as Ys from"react";var xo=uh("OPEN_EMBED_DRAWER_COMMAND"),qs=dh({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function Qs({children:t}){let[e,o]=hh({cellEditorConfig:null,cellEditorPlugins:null});return vr(qs,{value:fh(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(r,n)=>{o({cellEditorConfig:r,cellEditorPlugins:n})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var ea=()=>{let t=Z1(16),[e]=q1(),o=mh(qs),r=ih(),{fieldProps:n,uuid:l}=G(),{schemaPath:i}=n,s="lexical-table-create-"+l,u;t[0]!==r||t[1]!==s?(u=lh({slug:s,depth:r}),t[0]=r,t[1]=s,t[2]=u):u=t[2];let c=u,{toggleDrawer:d}=Ce(c,!0),a;t[3]!==e||t[4]!==d?(a=()=>{if(!e.hasNodes([oh,rh,th]))throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return nh(e.registerCommand(xo,()=>{let h;return h=null,e.getEditorState().read(()=>{let x=sh();ah(x)&&(h=x)}),h&&d(),!0},ch))},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],ph(a,p);let m;t[10]!==e?(m=(h,x)=>{!x.columns||!x.rows||e.dispatchCommand(eh,{columns:String(x.columns),rows:String(x.rows)})},t[10]=e,t[11]=m):m=t[11];let f;return t[12]!==c||t[13]!==i||t[14]!==m?(f=Y1(Ys.Fragment,{children:[vr(st,{drawerSlug:c,drawerTitle:"Create Table",featureKey:"experimental_table",handleDrawerSubmit:m,schemaPath:i,schemaPathSuffix:"fields"}),vr(Q1,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]}),t[12]=c,t[13]=i,t[14]=m,t[15]=f):f=t[15],f};var bh=y({markdownTransformers:[Ls],nodes:[xh,gh,Ch],plugins:[{Component:ea,position:"normal"},{Component:js,position:"normal"},{Component:Os,position:"floatingAnchorElem"},{Component:Zs,position:"floatingAnchorElem"}],providers:[Qs],slashMenu:{groups:[ee([{Icon:Cr,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(xo,{})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:Cr,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(xo,{})}}])]}});import{$isNodeSelection as Zh}from"lexical";import{jsx as Mr,jsxs as kh}from"react/jsx-runtime";import"react";var Ar=()=>kh("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:[Mr("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"}),Mr("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"}),Mr("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 Nh}from"react/jsx-runtime";import ra from"bson-objectid";import{$applyNodeReplacement as Sh}from"lexical";import*as na from"react";import{jsx as _h}from"react/jsx-runtime";import{DecoratorBlockNode as Th}from"@lexical/react/LexicalDecoratorBlockNode.js";import ta from"bson-objectid";import{$applyNodeReplacement as wh}from"lexical";import"react";function Dr(t){return t.parentElement!=null&&t.parentElement.tagName==="LI"&&t.previousSibling===null&&t.getAttribute("aria-roledescription")==="checkbox"}function Eh(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:///")||Dr(e),null}var Dt=class extends Th{__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:Eh,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 _h(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()),wh(new Dt({data:t}))}var Lh=na.lazy(()=>import("./component-NNKG7K3O.js").then(t=>({default:t.UploadComponent})));function yh(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:We({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||Dr(e),null}var Re=class extends Dt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:yh,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=We({data:o});return r.setFormat(e.format),r}decorate(){return Nh(Lh,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function We({data:t}){return t?.id||(t.id=new ra.default().toHexString()),Sh(new Re({data:t}))}function Or(t){return t instanceof Re}import{c as $h}from"react/compiler-runtime";import{jsx as Fh}from"react/jsx-runtime";import{useLexicalComposerContext as Ph}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Bh,mergeRegister as Hh}from"@lexical/utils";import{useConfig as jh}from"@payloadcms/ui";import{$getPreviousSelection as Uh,$getSelection as Gh,$isParagraphNode as Wh,$isRangeSelection as Vh,COMMAND_PRIORITY_EDITOR as Kh,createCommand as Jh}from"lexical";import{useEffect as Xh}from"react";import{c as la}from"react/compiler-runtime";import{jsx as $r}from"react/jsx-runtime";import{useLexicalComposerContext as ia}from"@lexical/react/LexicalComposerContext.js";import{toast as Ih}from"@payloadcms/ui";import{$getNodeByKey as Rh,COMMAND_PRIORITY_EDITOR as sa}from"lexical";import{useEffect as aa,useState as vh}from"react";var Mh=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=Rh(o);n&&n.replace(We({data:{fields:null,relationTo:e,value:r}}))}):t.dispatchCommand(Fr,{fields:null,relationTo:e,value:r})},Ah=t=>{let e=la(13),{enabledCollectionSlugs:o}=t,[r]=ia(),[n,l]=vh(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}=yt(i),d,a;e[2]!==r||e[3]!==c?(d=()=>r.registerCommand(Ke,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:x,doc:k}=h;s(),Mh({editor:r,relationTo:x,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=$r(u,{onSelect:m}),e[10]=u,e[11]=m,e[12]=f):f=e[12],f},Dh=()=>{let t=la(3),[e]=ia(),o,r;return t[0]!==e?(o=()=>e.registerCommand(Ke,Oh,sa),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),aa(o,r),null},ca=t=>$r(Ot,{...t,FallbackComponent:Dh,uploads:!0,children:$r(Ah,{...t})});function Oh(){return Ih.error("No upload collections enabled"),!0}var Fr=Jh("INSERT_UPLOAD_COMMAND"),ua=t=>{let e=$h(5),[o]=Ph(),{config:r}=jh(),{collections:n}=r,l,i;e[0]!==o?(l=()=>{if(!o.hasNodes([Re]))throw new Error("UploadPlugin: UploadNode not registered on editor");return Hh(o.registerCommand(Fr,u=>(o.update(()=>{let c=Gh()||Uh();if(Vh(c)){let d=We({data:{id:u.id,fields:u.fields,relationTo:u.relationTo,value:u.value}}),{focus:a}=c,p=a.getNode();Bh(d),Wh(p)&&!p.__first&&p.remove()}}),!0),Kh))},i=[o],e[0]=o,e[1]=l,e[2]=i):(l=e[1],i=e[2]),Xh(l,i);let s;return e[3]!==n?(s=Fh(ca,{enabledCollectionSlugs:n.map(zh)}),e[3]=n,e[4]=s):s=e[4],s};function zh(t){let{slug:e}=t;return e}var Yh=y({nodes:[Re],plugins:[{Component:ua,position:"normal"}],slashMenu:{groups:[ee([{Icon:Ar,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ke,{replace:!1})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:Ar,isActive:({selection:t})=>{if(!Zh(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Or(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ke,{replace:!1})}}])]}});import{c as Qh}from"react/compiler-runtime";import{jsx as Br}from"react/jsx-runtime";import{ShimmerEffect as eg,useConfig as tg}from"@payloadcms/ui";import{lazy as og,Suspense as rg,useEffect as ng,useState as lg}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 Co={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 qh}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?qh(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 Pr(t,e,o){return{admin:o,features:pa(t),lexical:e,resolvedFeatureMap:t}}var ig=og(()=>import("./Field-EY5V65PS.js").then(t=>({default:t.RichText}))),sg=t=>{let e=Qh(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?Co:s,{config:p}=tg(),[m,f]=lg(null),h,x;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 I=[];for(let[_,g]of Object.entries(r))g.clientFeatureProvider&&I.push(g.clientFeatureProvider(g.clientFeatureProps));let A=a||Co,b=ma({config:p,featureClientImportMap:n,featureClientSchemaMap:l,field:i,schemaPath:u??i.name,unSanitizedEditorConfig:{features:I,lexical:A}});f(Pr(b,A,d))},x=[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]=x):(h=e[11],x=e[12]),ng(h,x);let k;return e[13]!==m||e[14]!==t?(k=Br(rg,{fallback:Br(eg,{height:"35vh"}),children:m&&Br(ig,{...t,editorConfig:m})}),e[13]=m,e[14]=t,e[15]=k):k=e[15],k};function ag(t){return t instanceof HTMLElement}function cg(...t){return t.filter(Boolean).join(" ")}var bo=new WeakMap;function fa(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function ko(t,e){let o=bo.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},bo.set(t,o)}return o.listeners.add(e),()=>{ug(t,e)}}function ug(t,e){let o=bo.get(t);if(o===void 0)return;let{listeners:r}=o;r.delete(e),r.size===0&&(bo.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function dg(t,e){return ko(t,(o,r)=>{let[n,l]=o;n<0&&-n>Math.abs(l)&&e(n,r)})}function mg(t,e){return ko(t,(o,r)=>{let[n,l]=o;n>0&&n>Math.abs(l)&&e(n,r)})}function pg(t,e){return ko(t,(o,r)=>{let[n,l]=o;l<0&&-l>Math.abs(n)&&e(n,r)})}function fg(t,e){return ko(t,(o,r)=>{let[n,l]=o;l>0&&l>Math.abs(n)&&e(n,r)})}import{c as hg}from"react/compiler-runtime";import{jsx as gg}from"react/jsx-runtime";import"react";var xg=()=>{let t=hg(2),{EditButton:e}=be(),o;return t[0]!==e?(o=e?gg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Cg}from"react/compiler-runtime";import{jsx as bg}from"react/jsx-runtime";import"react";var kg=()=>{let t=Cg(2),{RemoveButton:e}=be(),o;return t[0]!==e?(o=e?bg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as _g}from"react/compiler-runtime";import{jsx as Tg}from"react/jsx-runtime";import"react";var wg=()=>{let t=_g(2),{Label:e}=be(),o;return t[0]!==e?(o=e?Tg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Eg}from"react/compiler-runtime";import{jsx as Ng}from"react/jsx-runtime";import"react";var Sg=t=>{let e=Eg(3),{children:o}=t,{InlineBlockContainer:r}=be(),n;return e[0]!==r||e[1]!==o?(n=r?Ng(r,{children:o}):null,e[0]=r,e[1]=o,e[2]=n):n=e[2],n};import{c as Lg}from"react/compiler-runtime";import{jsx as yg}from"react/jsx-runtime";import"react";var Ig=t=>{let e=Lg(6),{children:o,editButton:r,Label:n,removeButton:l}=t,{BlockCollapsible:i}=$e(),s;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==r||e[4]!==l?(s=i?yg(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 Rg}from"react/compiler-runtime";import{jsx as vg}from"react/jsx-runtime";import"react";var Mg=()=>{let t=Rg(2),{EditButton:e}=$e(),o;return t[0]!==e?(o=e?vg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Ag}from"react/compiler-runtime";import{jsx as Dg}from"react/jsx-runtime";import"react";var Og=()=>{let t=Ag(2),{RemoveButton:e}=$e(),o;return t[0]!==e?(o=e?Dg(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{stringify as $g}from"qs-esm";var Fg=({apiURL:t,depth:e,draft:o,locale:r})=>async({id:l,collectionSlug:i,select:s})=>{let u=$g({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{Ct as $createAutoLinkNode,Vt as $createBlockNode,To as $createInlineBlockNode,Te as $createLinkNode,Ue as $createRelationshipNode,We as $createUploadNode,Ee as $isAutoLinkNode,ft as $isBlockNode,wo as $isInlineBlockNode,Y as $isLinkNode,cr as $isRelationshipNode,Or as $isUploadNode,La as AlignFeatureClient,we as AutoLinkNode,Ig as BlockCollapsible,Mg as BlockEditButton,ke as BlockNode,Og as BlockRemoveButton,Ma as BlockquoteFeatureClient,Ic as BlocksFeatureClient,qc as BoldFeatureClient,ce as CAN_USE_DOM,qm as ChecklistFeatureClient,Up as DETAIL_TYPE_TO_DETAIL,Pp as DOUBLE_LINE_BREAK,ef as DebugJsxConverterFeatureClient,Wp as ELEMENT_FORMAT_TO_TYPE,Gp as ELEMENT_TYPE_TO_FORMAT,ka as ENABLE_SLASH_MENU_COMMAND,ga as EditorConfigProvider,st as FieldsDrawer,h0 as FixedToolbarFeatureClient,Vu as HeadingFeatureClient,ad as HorizontalRuleFeatureClient,Je as INSERT_BLOCK_COMMAND,Xe as INSERT_INLINE_BLOCK_COMMAND,$p as IS_ALL_FORMATTING,Ed as IndentFeatureClient,Sg as InlineBlockContainer,xg as InlineBlockEditButton,wg as InlineBlockLabel,_o as InlineBlockNode,kg as InlineBlockRemoveButton,ru as InlineCodeFeatureClient,S0 as InlineToolbarFeatureClient,su as ItalicFeatureClient,Hp as LTR_REGEX,kp as LexicalPluginToLexicalFeatureClient,Fm as LinkFeatureClient,ie as LinkNode,Fp as NON_BREAKING_SPACE,O as NodeFormat,ip as OrderedListFeatureClient,yp as ParagraphFeatureClient,Ca as Point,Bp as RTL_REGEX,_a as Rect,jf as RelationshipFeatureClient,Se as RelationshipNode,sg 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,ge as TOGGLE_LINK_COMMAND,bh as TableFeatureClient,Gc as TestRecorderFeatureClient,$u as TextStateFeatureClient,It as ToolbarButton,Ge as ToolbarDropdown,Xc as TreeViewFeatureClient,Nu as UnderlineFeatureClient,fp as UnorderedListFeatureClient,Yh as UploadFeatureClient,Re as UploadNode,fg as addSwipeDownListener,dg as addSwipeLeftListener,mg as addSwipeRightListener,pg as addSwipeUpListener,jo as createBlockNode,y as createClientFeature,tf as defaultColors,Co as defaultEditorLexicalConfig,xr as getDOMRangeRect,Ta as getEnabledNodes,Fg as getRestPopulateFn,ze as getSelectedNode,ag as isHTMLElement,ba as isPoint,cg as joinClasses,Pr as sanitizeClientEditorConfig,pa as sanitizeClientFeatures,so as setFloatingElemPosition,eo as setFloatingElemPositionForLinkEditor,ee as slashMenuBasicGroupWithItems,_e as toolbarAddDropdownGroupWithItems,Go as toolbarFeatureButtonsGroupWithItems,te as toolbarFormatGroupWithItems,le as toolbarTextDropdownGroupWithItems,$e as useBlockComponentContext,G as useEditorConfigContext,be as useInlineBlockComponentContext,xa as useLexicalDocumentDrawer,Ce as useLexicalDrawer,yt as useLexicalListDrawer};
|
|
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",$p=new RegExp("^[^"+Pi+"]*["+Fi+"]"),Fp=new RegExp("^[^"+Fi+"]*["+Pi+"]"),Pp={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},Bp={directionless:A.IS_DIRECTIONLESS,unmergeable:A.IS_UNMERGEABLE},Hp={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"},Up={normal:A.IS_NORMAL,segmented:A.IS_SEGMENTED,token:A.IS_TOKEN},Gp={[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=He("strong",{children:e})),t.format&A.IS_ITALIC&&(e=He("em",{children:e})),t.format&A.IS_STRIKETHROUGH&&(e=He("span",{style:{textDecoration:"line-through"},children:e})),t.format&A.IS_UNDERLINE&&(e=He("span",{style:{textDecoration:"underline"},children:e})),t.format&A.IS_CODE&&(e=He("code",{children:e})),t.format&A.IS_SUBSCRIPT&&(e=He("sub",{children:e})),t.format&A.IS_SUPERSCRIPT&&(e=He("sup",{children:e})),e}};import{jsx as Nt}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 Nt("a",{href:r,rel:"noopener noreferrer",children:o.filename});if(!o.sizes||!Object.keys(o.sizes).length)return Nt("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(Nt("source",{media:`(max-width: ${i.width}px)`,srcSet:s,type:i.mimeType},l))}return n.push(Nt("img",{alt:o?.filename,height:o?.height,src:r,width:o?.width},"image")),Nt("picture",{children:n})}};var tt={...Ai,...Bi,...Ri,...Li,...$i,...yi,...Ii,...Di,...Mi({}),...Hi,...Oi};import{jsx as Ui,Fragment as Wp}from"react/jsx-runtime";import nr 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(Wp,{})}function Wi({converters:t,disableIndent:e,disableTextAlign:o,nodes:r,parent:n}){let l=t.unknown;return r.map((s,c)=>{let u;s.type==="block"?(u=t?.blocks?.[s?.fields?.blockType],!u&&!l&&console.error(`Lexical => JSX converter: Blocks converter: found ${s?.fields?.blockType} block, but no converter is provided`)):s.type==="inlineBlock"?(u=t?.inlineBlocks?.[s?.fields?.blockType],!u&&!l&&console.error(`Lexical => JSX converter: Inline Blocks converter: found ${s?.fields?.blockType} inline block, but no converter is provided`)):u=t[s.type];try{!u&&l&&(u=l);let d;u?d=typeof u=="function"?u({childIndex:c,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}):u:d=Ui("span",{children:"unknown node"},c);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)*2}em`),nr.isValidElement(d)){if(a.textAlign||a.paddingInlineStart){let p={...a,...d?.props?.style??{}};return nr.cloneElement(d,{key:c,style:p})}return nr.cloneElement(d,{key:c})}return d}catch(d){return console.error("Error converting lexical node to JSX:",d,"node:",s),null}}).filter(Boolean)}var lr=({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:tt}):i=e:i=tt;let s=o&&!Array.isArray(o)&&typeof o=="object"&&"root"in o&&Gi({converters:i,data:o,disableIndent:n,disableTextAlign:l});return r?Vi(Vp,{children:s}):Vi("div",{className:t??"payload-richtext",children:s})};function Ki(){let t=Kp(7),[e]=Xp(),o;t[0]!==e?(o=e.getEditorState().toJSON(),t[0]=e,t[1]=o):o=t[1];let[r,n]=Zp(o),l,i;t[2]!==e?(l=()=>e.registerUpdateListener(c=>{let{editorState:u}=c;n(u.toJSON())}),i=[e],t[2]=e,t[3]=l,t[4]=i):(l=t[3],i=t[4]),zp(l,i);let s;return t[5]!==r?(s=Jp(lr,{converters:tt,data:r}),t[5]=r,t[6]=s):s=t[6],s}var Yp=y({plugins:[{Component:Ki,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)"}},qp={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 Ff}from"lexical";import{jsx as St,jsxs as Qp}from"react/jsx-runtime";import"react";var ir=()=>Qp("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:[St("g",{clipPath:"url(#clip0_4397_10817)",children:St("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"})}),St("defs",{children:St("clipPath",{id:"clip0_4397_10817",children:St("rect",{fill:"currentColor",height:"12",transform:"translate(4 4)",width:"12"})})})]});import{jsx as of}from"react/jsx-runtime";import*as Xi from"react";import{DecoratorBlockNode as ef}from"@lexical/react/LexicalDecoratorBlockNode.js";function tf(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:Ji({relationTo:o,value:e})}:null}var Lt=class extends ef{__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:tf,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=Ji(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 Ji(t){return new Lt({data:t})}var rf=Xi.lazy(()=>import("./RelationshipComponent-APF3CN47.js").then(t=>({default:t.RelationshipComponent})));function nf(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:je({relationTo:o,value:e})}:null}var Ne=class extends Lt{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:nf,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=je(o);return r.setFormat(e.format),r}decorate(e,o){return of(rf,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function je(t){return new Ne({data:t})}function sr(t){return t instanceof Ne}import{c as wf}from"react/compiler-runtime";import{jsx as Ef}from"react/jsx-runtime";import{useLexicalComposerContext as Nf}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Sf}from"@lexical/utils";import{useConfig as Lf}from"@payloadcms/ui";import{$getPreviousSelection as yf,$getSelection as If,$isParagraphNode as Rf,$isRangeSelection as vf,COMMAND_PRIORITY_EDITOR as Mf,createCommand as Df}from"lexical";import{useEffect as Af}from"react";import{c as xf}from"react/compiler-runtime";import{jsx as oo}from"react/jsx-runtime";import{useLexicalComposerContext as Cf}from"@lexical/react/LexicalComposerContext.js";import{$getNodeByKey as bf,COMMAND_PRIORITY_EDITOR as kf}from"lexical";import{useEffect as _f,useState as Yi}from"react";import{c as lf}from"react/compiler-runtime";import{jsx as sf}from"react/jsx-runtime";import{useLexicalComposerContext as af}from"@lexical/react/LexicalComposerContext";import{useListDrawer as cf,useModal as uf}from"@payloadcms/ui";import{$getNodeByKey as zi,$getPreviousSelection as df,$getRoot as mf,$getSelection as pf,$isRangeSelection as ff,$setSelection as hf}from"lexical";import{useEffect as gf,useState as Zi}from"react";var yt=t=>{let e=lf(23),[o]=af(),[r,n]=Zi(null),[l,i]=Zi(!1),[s,c,u]=cf(t),{closeDrawer:d,drawerSlug:a,isDrawerOpen:p,openDrawer:m}=u,{modalState:f}=uf(),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{let F=pf()??df();n(F)},e[0]=h):h=e[0];let g=h,x;e[1]!==o||e[2]!==r?(x=()=>{r&&o.update(()=>{if(ff(r)){let{anchor:F,focus:I}=r;zi(F.key)&&zi(I.key)&&hf(r.clone())}else mf().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=r,e[3]=x):x=e[3];let S=x,D;e[4]!==d?(D=()=>{d()},e[4]=d,e[5]=D):D=e[5];let k=D,_,b;e[6]!==a||e[7]!==f||e[8]!==S||e[9]!==l?(_=()=>{if(!l)return;let F=f[a];F&&!F?.isOpen&&(i(!1),setTimeout(()=>{S()},1))},b=[f,a,S,l],e[6]=a,e[7]=f,e[8]=S,e[9]=l,e[10]=_,e[11]=b):(_=e[10],b=e[11]),gf(_,b);let N;e[12]!==c?(N=F=>sf(c,{...F,onClick:()=>{g()}}),e[12]=c,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 Tf=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=bf(o);n&&n.replace(je({relationTo:e,value:r}))}):t.dispatchCommand(ar,{relationTo:e,value:r})},qi=t=>{let e=xf(16),{enabledCollectionSlugs:o}=t,[r]=Cf(),n;e[0]!==o?.[0]?(n=()=>o?.[0],e[0]=o?.[0],e[1]=n):n=e[1];let[l]=Yi(n),[i,s]=Yi(null),c=o||void 0,u;e[2]!==l||e[3]!==c?(u={collectionSlugs:c,selectedCollection:l},e[2]=l,e[3]=c,e[4]=u):u=e[4];let{closeListDrawer:d,ListDrawer:a,openListDrawer:p}=yt(u),m,f;e[5]!==r||e[6]!==p?(m=()=>r.registerCommand(at,S=>(s(S?.replace?S?.replace.nodeKey:null),p(),!0),kf),f=[r,p],e[5]=r,e[6]=p,e[7]=m,e[8]=f):(m=e[7],f=e[8]),_f(m,f);let h;e[9]!==d||e[10]!==r||e[11]!==i?(h=S=>{let{collectionSlug:D,doc:k}=S;Tf({editor:r,relationTo:D,replaceNodeKey:i,value:k.id}),d()},e[9]=d,e[10]=r,e[11]=i,e[12]=h):h=e[12];let g=h,x;return e[13]!==a||e[14]!==g?(x=oo(a,{onSelect:g}),e[13]=a,e[14]=g,e[15]=x):x=e[15],x},Qi=t=>(t?.enabledCollectionSlugs?.length??-1)>0?oo(qi,{...t}):oo(At,{...t,children:oo(qi,{...t})});var ar=Df("INSERT_RELATIONSHIP_COMMAND"),es=t=>{let e=wf(10),{clientProps:o}=t,[r]=Nf(),{config:n}=Lf(),{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(Of),e[0]=o?.disabledCollections,e[1]=l,e[2]=d}else d=e[2];i=d}let s,c;e[5]!==r?(s=()=>{if(!r.hasNodes([Ne]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return r.registerCommand(ar,$f,Mf)},c=[r],e[5]=r,e[6]=s,e[7]=c):(s=e[6],c=e[7]),Af(s,c);let u;return e[8]!==i?(u=Ef(Qi,{enabledCollectionSlugs:i}),e[8]=i,e[9]=u):u=e[9],u};function Of(t){let{slug:e}=t;return e}function $f(t){let e=If()||yf();if(vf(e)){let o=je(t),{focus:r}=e,n=r.getNode();Sf(o),Rf(n)&&!n.__first&&n.remove()}return!0}var Pf=y({nodes:[Ne],plugins:[{Component:es,position:"normal"}],slashMenu:{groups:[ee([{Icon:ir,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(at,{replace:!1})}}])]},toolbarFixed:{groups:[ke([{ChildComponent:ir,isActive:({selection:t})=>{if(!Ff(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return sr(e)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(at,{replace:!1})}}])]}});import{c as cs}from"react/compiler-runtime";import{jsx as me,jsxs as d0}from"react/jsx-runtime";import{useLexicalComposerContext as m0}from"@lexical/react/LexicalComposerContext.js";import{useScrollInfo as p0,useThrottledEffect as f0,useTranslation as h0}from"@payloadcms/ui";import*as Se from"react";import{useMemo as g0}from"react";import{c as Bf}from"react/compiler-runtime";import{jsx as Hf}from"react/jsx-runtime";import{mergeRegister as jf}from"@lexical/utils";import{$addUpdateTag as Uf,$getSelection as Gf}from"lexical";import{useDeferredValue as Wf,useEffect as Vf,useState as Kf}from"react";var ts="toolbar-popup__button",It=t=>{let e=Bf(21),{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]=Kf(l),c=Wf(i),u=j(),d,a=c.enabled?"":"disabled",p=c.active?"active":"",m=n.key?`${ts}-${n.key}`:"",f;e[1]!==a||e[2]!==p||e[3]!==m?(f=[ts,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]!==u||e[7]!==n?(g=()=>{r.getEditorState().read(()=>{let M=Gf();if(!M)return;let O=n.isActive?n.isActive({editor:r,editorConfigContext:u,selection:M}):!1,F=n.isEnabled?n.isEnabled({editor:r,editorConfigContext:u,selection:M}):!0;s(I=>I.active===O&&I.enabled===F?I:{active:O,enabled:F})})},e[5]=r,e[6]=u,e[7]=n,e[8]=g):g=e[8];let x=g,S,D;e[9]!==r||e[10]!==x?(S=()=>{let M=()=>requestIdleCallback(x),O=jf(r.registerUpdateListener(M));return document.addEventListener("mouseup",x),()=>{O(),document.removeEventListener("mouseup",x)}},D=[r,x],e[9]=r,e[10]=x,e[11]=S,e[12]=D):(S=e[11],D=e[12]),Vf(S,D);let k;e[13]!==i||e[14]!==r||e[15]!==n?(k=()=>{i.enabled&&r.focus(()=>{r.update(Jf),n.onSelect?.({editor:r,isActive:i.active})})},e[13]=i,e[14]=r,e[15]=n,e[16]=k):k=e[16];let _=k,b=Xf,N;return e[17]!==o||e[18]!==h||e[19]!==_?(N=Hf("button",{className:h,onClick:_,onMouseDown:b,type:"button",children:o}),e[17]=o,e[18]=h,e[19]=_,e[20]=N):N=e[20],N};function Jf(){Uf("toolbar")}function Xf(t){t.preventDefault()}import{c as t0}from"react/compiler-runtime";import{jsx as ot}from"react/jsx-runtime";import as,{useCallback as o0,useDeferredValue as r0,useEffect as n0,useMemo as l0}from"react";import{mergeRegister as i0}from"@lexical/utils";import{useTranslation as s0}from"@payloadcms/ui";import{$getSelection as a0}from"lexical";import{jsx as Me,jsxs as os}from"react/jsx-runtime";import{Button as zf}from"@payloadcms/ui";import{$addUpdateTag as Zf,isDOMNode as Yf}from"lexical";import ro,{useCallback as qf,useEffect as no,useMemo as ns,useRef as cr,useState as ur}from"react";import{createPortal as Qf}from"react-dom";var rs="toolbar-popup__dropdown-item",ls=ro.createContext(null);function is({active:t,children:e,editor:o,enabled:r,Icon:n,item:l,tooltip:i}){let s=ns(()=>[rs,r===!1?"disabled":"",t?"active":"",l?.key?`${rs}-${l.key}`:""].filter(Boolean).join(" "),[r,t,l.key]),c=cr(null),u=ro.use(ls);if(u===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:d}=u;return no(()=>{c?.current!=null&&d(c)},[c,d]),Me(zf,{"aria-label":i,buttonStyle:"none",className:s,disabled:r===!1,icon:n,iconPosition:"left",iconStyle:"none",onClick:()=>{r!==!1&&o.focus(()=>{o.update(()=>{Zf("toolbar")}),l.onSelect?.({editor:o,isActive:t})})},onMouseDown:a=>{a.preventDefault()},ref:c,tooltip:i,type:"button",children:e})}function e0({children:t,dropDownRef:e,itemsContainerClassNames:o,onClose:r}){let[n,l]=ur(),[i,s]=ur(),c=qf(a=>{l(p=>p!=null?[...p,a]:[a])},[l]),u=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=ns(()=>({registerItem:c}),[c]);return no(()=>{n!=null&&i==null&&s(n[0]),i!=null&&i?.current!=null&&i.current.focus()},[n,i]),Me(ls,{value:d,children:Me("div",{className:(o??["toolbar-popup__dropdown-items"]).join(" "),onKeyDown:u,ref:e,children:t})})}function ss({buttonAriaLabel:t,buttonClassName:e,children:o,disabled:r=!1,Icon:n,itemsContainerClassNames:l,label:i,stopCloseOnClickSelf:s}){let c=cr(null),u=cr(null),[d,a]=ur(!1),p=()=>{a(!1),u?.current!=null&&u.current.focus()};no(()=>{let f=u.current,h=c.current;if(d&&f!==null&&h!==null){let{left:g,top:x}=f.getBoundingClientRect(),S=window.scrollY||document.documentElement.scrollTop;h.style.top=`${x+S+f.offsetHeight+5}px`,h.style.left=`${Math.min(g-5,window.innerWidth-h.offsetWidth-20)}px`}},[c,u,d]),no(()=>{let f=u.current;if(f!==null&&d){let h=g=>{let x=g.target;Yf(x)&&(s&&c.current&&c.current.contains(x)||f.contains(x)||a(!1))};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[c,u,d,s]);let m=Qf(Me(e0,{dropDownRef:c,itemsContainerClassNames:l,onClose:p,children:o}),document.body);return os(ro.Fragment,{children:[os("button",{"aria-label":t,className:e+(d?" active":""),disabled:r,onClick:f=>{f.preventDefault(),a(!d)},onMouseDown:f=>{f.preventDefault()},ref:u,type:"button",children:[n&&Me(n,{}),i&&Me("span",{className:"toolbar-popup__dropdown-label",children:i}),Me("i",{className:"toolbar-popup__dropdown-caret"})]}),d&&Me(ro.Fragment,{children:m})]})}var dr="toolbar-popup__dropdown",c0=t=>{let e=t0(18),{active:o,anchorElem:r,editor:n,enabled:l,item:i}=t,{i18n:s}=s0(),{fieldProps:c}=j(),{featureClientSchemaMap:u,schemaPath:d}=c;if(i.Component){let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==i?(f=i?.Component&&ot(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]!==u||e[7]!==s||e[8]!==i||e[9]!==d?(f=typeof i.label=="function"?i.label({featureClientSchemaMap:u,i18n:s,schemaPath:d}):i.label,e[6]=u,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=ot(is,{active:o,editor:n,enabled:l,Icon:i?.ChildComponent?ot(i.ChildComponent,{}):void 0,item:i,tooltip:a,children:ot("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},u0=as.memo(c0),Ue=({anchorElem:t,classNames:e,editor:o,group:r,Icon:n,itemsContainerClassNames:l,label:i,maxActiveItems:s,onActiveChange:c})=>{let[u,d]=as.useState({activeItemKeys:[],enabledGroup:!0,enabledItemKeys:[]}),a=r0(u),p=j(),{items:m,key:f}=r,h=o0(()=>{o.getEditorState().read(()=>{let x=a0();if(!x)return;let S=[],D=[],k=[];for(let _ of m)_.isActive&&(!s||S.length<s)&&_.isActive({editor:o,editorConfigContext:p,selection:x})&&(S.push(_.key),D.push(_)),_.isEnabled?_.isEnabled({editor:o,editorConfigContext:p,selection:x})&&k.push(_.key):k.push(_.key);d({activeItemKeys:S,enabledGroup:r.isEnabled?r.isEnabled({editor:o,editorConfigContext:p,selection:x}):!0,enabledItemKeys:k}),c&&c({activeItems:D})})},[o,p,r,m,s,c]);n0(()=>i0(o.registerUpdateListener(()=>{requestIdleCallback(()=>{h()})})),[o,h]);let g=l0(()=>m?.length?m.map(x=>ot(u0,{active:a.activeItemKeys.includes(x.key),anchorElem:t,editor:o,enabled:a.enabledItemKeys.includes(x.key),item:x},x.key)):null,[m,a,t,o]);return ot(ss,{buttonAriaLabel:`${f} dropdown`,buttonClassName:[dr,`${dr}-${f}`,...e||[]].filter(Boolean).join(" "),disabled:!a.enabledGroup,Icon:n,itemsContainerClassNames:[`${dr}-items`,...l||[]],label:i,children:g},f)};function x0({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&me(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?me(It,{editor:e,item:o,children:me(o.ChildComponent,{})},o.key):null}function C0(t){let e=cs(23),{anchorElem:o,editor:r,editorConfig:n,group:l,index:i}=t,{i18n:s}=h0(),{fieldProps:c}=j(),{featureClientSchemaMap:u,schemaPath:d}=c,[a,p]=Se.useState(void 0),[m,f]=Se.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],Se.useEffect(h,g);let x;e[6]!==u||e[7]!==l.ChildComponent||e[8]!==l.items||e[9]!==l.type||e[10]!==s||e[11]!==d?(x=_=>{let{activeItems:b}=_;if(!b.length){l?.type==="dropdown"&&l.items.length&&l.ChildComponent?(f(()=>l.ChildComponent),p(void 0)):(f(void 0),p(void 0));return}let N=b[0],M=N.key;N.label&&(M=typeof N.label=="function"?N.label({featureClientSchemaMap:u,i18n:s,schemaPath:d}):N.label),M.length>25&&(M=M.substring(0,25)+"..."),b.length===1?(p(M),f(()=>N.ChildComponent)):(p(s.t("lexical:general:toolbarItemsActive",{count:b.length})),l?.type==="dropdown"&&l.items.length&&l.ChildComponent?f(()=>l.ChildComponent):f(void 0))},e[6]=u,e[7]=l.ChildComponent,e[8]=l.items,e[9]=l.type,e[10]=s,e[11]=d,e[12]=x):x=e[12];let S=x,D=`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]!==S||e[21]!==D?(k=d0("div",{className:D,children:[l.type==="dropdown"&&l.items.length?m?me(Ue,{anchorElem:o,editor:r,group:l,Icon:m,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a,maxActiveItems:l.maxActiveItems??1,onActiveChange:S}):me(Ue,{anchorElem:o,editor:r,group:l,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a,maxActiveItems:l.maxActiveItems??1,onActiveChange:S}):null,l.type==="buttons"&&l.items.length?l.items.map(_=>me(x0,{anchorElem:o,editor:r,item:_},_.key)):null,i<n.features.toolbarFixed?.groups.length-1&&me("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]=S,e[21]=D,e[22]=k):k=e[22],k}function b0({anchorElem:t,clientProps:e,editor:o,editorConfig:r,parentWithFixedToolbar:n}){let l=Se.useRef(null),{y:i}=p0(),s=g0(()=>{if(!n||e?.disableIfParentHasFixedToolbar)return null;let u=n.editorContainerRef.current.previousElementSibling;for(;u;){if(u.classList.contains("fixed-toolbar"))return u;u=u.previousElementSibling}return null},[e?.disableIfParentHasFixedToolbar,n]);return f0(()=>{if(!s)return;let c=l.current;if(!c)return;let u=c.getBoundingClientRect(),d=s.getBoundingClientRect();if(!(u.bottom<d.top||u.top>d.bottom))c.classList.remove("fixed-toolbar"),c.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),s.classList.remove("fixed-toolbar"),s.classList.add("fixed-toolbar","fixed-toolbar--hide");else{if(!c.classList.contains("fixed-toolbar--overlapping"))return;c.classList.remove("fixed-toolbar--overlapping"),c.classList.add("fixed-toolbar"),s.classList.remove("fixed-toolbar--hide"),s.classList.add("fixed-toolbar")}},50,[l,s,i]),me("div",{className:"fixed-toolbar",onFocus:c=>{c.stopPropagation()},ref:l,children:o.isEditable()&&me(Se.Fragment,{children:r?.features&&r.features?.toolbarFixed?.groups.map((c,u)=>me(C0,{anchorElem:t,editor:o,editorConfig:r,group:c,index:u},c.key))})})}var us=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return us(t.parentEditor)}return!1},ds=t=>{let e=cs(6),{clientProps:o}=t,[r]=m0(),n=j(),{editorConfig:l}=n,i=o.applyToFocusedEditor&&n.focusedEditor?.editor||r,s=o.applyToFocusedEditor&&n.focusedEditor?.editorConfig||l,c,u;if(e[0]!==o.disableIfParentHasFixedToolbar||e[1]!==i||e[2]!==s||e[3]!==n){u=Symbol.for("react.early_return_sentinel");e:{let d=us(n);if(o?.disableIfParentHasFixedToolbar&&d){u=null;break e}if(!s?.features?.toolbarFixed?.groups?.length){u=null;break e}c=me(b0,{anchorElem:document.body,editor:i,editorConfig:s,parentWithFixedToolbar:d})}e[0]=o.disableIfParentHasFixedToolbar,e[1]=i,e[2]=s,e[3]=n,e[4]=c,e[5]=u}else c=e[4],u=e[5];return u!==Symbol.for("react.early_return_sentinel")?u:c};var k0=y({plugins:[{Component:ds,position:"aboveContainer"}]});import{c as fs}from"react/compiler-runtime";import{jsx as ge,jsxs as hs}from"react/jsx-runtime";import{useLexicalComposerContext as _0}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as gs}from"@lexical/utils";import{$getSelection as xs,$isRangeSelection as ms,$isTextNode as T0,COMMAND_PRIORITY_LOW as w0,getDOMSelection as Cs,SELECTION_CHANGE_COMMAND as E0}from"lexical";import{useCallback as io,useEffect as Rt,useRef as ps,useState as N0}from"react";import*as so from"react";import{createPortal as S0}from"react-dom";function mr(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:c,verticalGap:u=10}=t,d=o.parentElement;if(c===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=c.top-a.height-u,h=c.left-l;i==="center"&&(h=c.left+c.width/2-a.width/2);let g=0;return!e&&f<m.top&&!s&&(g=a.height+c.height+u*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 L0({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&ge(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?ge(It,{editor:e,item:o,children:ge(o.ChildComponent,{})},o.key):null}function y0(t){let e=fs(19),{anchorElem:o,editor:r,group:n,index:l}=t,{editorConfig:i}=j(),[s,c]=so.useState(),u;e[0]!==n.ChildComponent||e[1]!==n.items||e[2]!==n.type?(u=()=>{n?.type==="dropdown"&&n.items.length&&n.ChildComponent?c(()=>n.ChildComponent):c(void 0)},e[0]=n.ChildComponent,e[1]=n.items,e[2]=n.type,e[3]=u):u=e[3];let d;e[4]!==n?(d=[n],e[4]=n,e[5]=d):d=e[5],so.useEffect(u,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?c(()=>n.ChildComponent):c(void 0);return}let x=g[0];c(()=>x?.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=hs("div",{className:m,children:[n.type==="dropdown"&&n.items.length?s?ge(Ue,{anchorElem:o,editor:r,group:n,Icon:s,maxActiveItems:n.maxActiveItems??1,onActiveChange:p}):ge(Ue,{anchorElem:o,editor:r,group:n,maxActiveItems:n.maxActiveItems??1,onActiveChange:p}):null,n.type==="buttons"&&n.items.length?n.items.map(h=>ge(L0,{anchorElem:o,editor:r,item:h},h.key)):null,l<i.features.toolbarInline?.groups.length-1&&ge("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 I0({anchorElem:t,editor:e}){let o=ps(null),r=ps(null),{editorConfig:n}=j(),l=io(()=>{if(o?.current){let u=o.current.style.opacity==="0",d=o.current.style.pointerEvents==="none";u||(o.current.style.opacity="0"),d||(o.current.style.pointerEvents="none")}},[o]),i=io(u=>{if(o?.current&&(u.buttons===1||u.buttons===3)){let d=o.current.style.opacity==="0",a=o.current.style.pointerEvents==="none";if(!d||!a){let p=u.clientX,m=u.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"))},[]);Rt(()=>(document.addEventListener("mousemove",i),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)}),[o,i,s]);let c=io(()=>{let u=xs(),d=Cs(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(u!==null&&d!==null&&!d.isCollapsed&&m!==null&&m.contains(d.anchorNode)){let f=mr(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 Rt(()=>{let u=t.parentElement,d=()=>{e.getEditorState().read(()=>{c()})};return window.addEventListener("resize",d),u&&u.addEventListener("scroll",d),()=>{window.removeEventListener("resize",d),u&&u.removeEventListener("scroll",d)}},[e,c,t]),Rt(()=>(e.getEditorState().read(()=>{c()}),gs(e.registerUpdateListener(({editorState:u})=>{u.read(()=>{c()})}),e.registerCommand(E0,()=>(c(),!1),w0))),[e,c]),hs("div",{className:"inline-toolbar-popup",ref:o,children:[ge("div",{className:"caret",ref:r}),n?.features&&n.features?.toolbarInline?.groups.map((u,d)=>ge(y0,{anchorElem:t,editor:e,group:u,index:d},u.key))]})}function R0(t,e){let o=fs(12),[r,n]=N0(!1),l;o[0]!==t?(l=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let p=xs(),m=Cs(t._window),f=t.getRootElement();if(m!==null&&(!ms(p)||f===null||!f.contains(m.anchorNode))){n(!1);return}if(!ms(p))return;if(p.getTextContent()!==""){let g=p.getNodes(),x=!1;for(let S of g)if(T0(S)){n(!0),x=!0;break}x||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,c;o[2]!==i?(s=()=>(document.addEventListener("selectionchange",i),document.addEventListener("mouseup",i),()=>{document.removeEventListener("selectionchange",i),document.removeEventListener("mouseup",i)}),c=[i],o[2]=i,o[3]=s,o[4]=c):(s=o[3],c=o[4]),Rt(s,c);let u,d;if(o[5]!==t||o[6]!==i?(u=()=>gs(t.registerUpdateListener(()=>{i()}),t.registerRootListener(()=>{t.getRootElement()===null&&n(!1)})),d=[t,i],o[5]=t,o[6]=i,o[7]=u,o[8]=d):(u=o[7],d=o[8]),Rt(u,d),!r||!t.isEditable())return null;let a;return o[9]!==e||o[10]!==t?(a=S0(ge(I0,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=a):a=o[11],a}var bs=t=>{let{anchorElem:e}=t,[o]=_0();return R0(o,e)};var v0=y({plugins:[{Component:bs,position:"floatingAnchorElem"}]});import{TableCellNode as _h,TableNode as Th,TableRowNode as wh}from"@lexical/table";import{jsx as ks}from"react/jsx-runtime";import"react";var pr=()=>ks("svg",{className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ks("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 M0,$createTableNode as D0,$createTableRowNode as A0,$isTableCellNode as _s,$isTableNode as fr,$isTableRowNode as hr,TableCellHeaderStates as ao,TableCellNode as O0,TableNode as $0,TableRowNode as F0}from"@lexical/table";import{$isParagraphNode as P0,$isTextNode as B0}from"lexical";var ws=/^\|(.+)\|\s?$/,H0=/^(\| ?:?-*:? ?)+\|\s?$/,Es=({allTransformers:t})=>({type:"element",dependencies:[$0,F0,O0],export:e=>{if(!fr(e))return null;let o=[];for(let r of e.getChildren()){let n=[];if(!hr(r))continue;let l=!1;for(let i of r.getChildren())_s(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:ws,replace:(e,o,r)=>{let n=r[0];if(!n)return;if(H0.test(n)){let a=e.getPreviousSibling();if(!a||!fr(a))return;let p=a.getChildren(),m=p[p.length-1];if(!m||!hr(m))return;m.getChildren().forEach(f=>{_s(f)&&f.setHeaderStyles(ao.ROW,ao.ROW)}),e.remove();return}let l=Ts(n,t);if(l==null)return;let i=[l],s=e.getPreviousSibling(),c=l.length;for(;s&&!(!P0(s)||s.getChildrenSize()!==1);){let a=s.getFirstChild();if(!B0(a))break;let p=Ts(a.getTextContent(),t);if(p==null)break;c=Math.max(c,p.length),i.unshift(p);let m=s.getPreviousSibling();s.remove(),s=m}let u=D0();for(let a of i){let p=A0();u.append(p);for(let m=0;m<c;m++)p.append(m<a.length?a[m]:Ns("",t))}let d=e.getPreviousSibling();fr(d)&&j0(d)===c?(d.append(...u.getChildren()),e.remove()):e.replace(u),u.selectEnd()}});function j0(t){let e=t.getFirstChild();return hr(e)?e.getChildrenSize():0}var Ns=(t,e)=>{t=t.replace(/\\n/g,`
|
|
40
|
+
`);let o=M0(ao.NO_STATUS);return Fr(t,e,o),o},Ts=(t,e)=>{let o=t.match(ws);return!o||!o[1]?null:o[1].split("|").map(r=>Ns(r,e))};import{c as G0}from"react/compiler-runtime";import{jsx as P,jsxs as Le}from"react/jsx-runtime";import{useLexicalComposerContext as Is}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as W0}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as xr,$deleteTableColumn__EXPERIMENTAL as V0,$deleteTableRow__EXPERIMENTAL as K0,$getNodeTriplet as J0,$getTableCellNodeFromLexicalNode as Ls,$getTableColumnIndexFromTableCellNode as X0,$getTableNodeFromLexicalNodeOrThrow as ye,$getTableRowIndexFromTableCellNode as z0,$insertTableColumn__EXPERIMENTAL as Z0,$insertTableRow__EXPERIMENTAL as Y0,$isTableCellNode as Rs,$isTableSelection as vt,$unmergeCell as q0,getTableElement as Cr,getTableObserverFromTableElement as br,TableCellHeaderStates as De,TableCellNode as Q0}from"@lexical/table";import{mergeRegister as e1}from"@lexical/utils";import{useScrollInfo as t1}from"@payloadcms/ui";import{$createParagraphNode as o1,$getSelection as uo,$isElementNode as r1,$isParagraphNode as n1,$isRangeSelection as kr,$isTextNode as l1,$setSelection as i1,COMMAND_PRIORITY_CRITICAL as s1,getDOMSelection as a1,isDOMNode as c1,SELECTION_CHANGE_COMMAND as u1}from"lexical";import*as _r from"react";import{useCallback as pe,useEffect as rt,useRef as co,useState as nt}from"react";import{createPortal as vs}from"react-dom";import{jsx as gr,jsxs as U0}from"react/jsx-runtime";import"react";var Ss=()=>U0("svg",{fill:"none",height:"18",viewBox:"0 0 20 20",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[gr("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"}),gr("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"}),gr("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 ys(t){let e=t.getShape();return{columns:e.toX-e.fromX+1,rows:e.toY-e.fromY+1}}function d1(){let t=uo();if(kr(t)&&!t.isCollapsed()||vt(t)&&!t.anchor.is(t.focus)||!kr(t)&&!vt(t))return!1;let[e]=J0(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function m1(t){if(t.getChildrenSize()!==1)return!1;let e=t.getFirstChildOrThrow();return!(!n1(e)||!e.isEmpty())}function p1(t){let e=t.getLastDescendant();l1(e)?e.select():r1(e)?e.selectEnd():e!==null&&e.selectNext()}function f1({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:r,tableCellNode:n}){let[l]=Is(),i=co(null),[s,c]=nt(n),[u,d]=nt({columns:1,rows:1}),[a,p]=nt(!1),[m,f]=nt(!1),{y:h}=t1();rt(()=>l.registerMutationListener(Q0,C=>{C.get(s.getKey())==="updated"&&l.getEditorState().read(()=>{c(s.getLatest())})},{skipInitialization:!0}),[l,s]),rt(()=>{l.getEditorState().read(()=>{let C=uo();if(vt(C)){let E=ys(C);d(ys(C)),p(E.columns>1||E.rows>1)}f(d1())})},[l]),rt(()=>{let C=e.current,E=i.current,R=l.getRootElement();if(C!=null&&E!=null&&R!=null){let L=R.getBoundingClientRect(),v=C.getBoundingClientRect();E.style.opacity="1";let T=E.getBoundingClientRect(),$=5,H=v.right+$;if(H+T.width>window.innerWidth||H+T.width>L.right){let Y=v.left-T.width-$;H=(Y<0?$:Y)+window.pageXOffset}E.style.left=`${H+window.pageXOffset}px`;let W=v.top;if(W+T.height>window.innerHeight){let Y=v.bottom-T.height;W=Y<0?$:Y}E.style.top=`${W}px`}},[e,i,l,h]),rt(()=>{function C(E){i.current!=null&&e.current!=null&&c1(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=pe(()=>{l.update(()=>{if(s.isAttached()){let C=ye(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(),c(s.getLatest())}i1(null)})},[l,s]),x=()=>{l.update(()=>{let C=uo();if(vt(C)){let R=C.getNodes().filter(Rs);if(R.length===0)return;let L=ye(R[0]),[v]=xr(L,null,null),T=1/0,$=-1/0,H=1/0,W=-1/0,Y=new Set;for(let q of v)for(let K of q){if(!K||!K.cell)continue;let re=K.cell.getKey();if(!Y.has(re)&&R.some(ne=>ne.is(K.cell))){Y.add(re);let ne=K.startRow,se=K.startColumn,Ae=K.cell.__rowSpan||1,it=K.cell.__colSpan||1;T=Math.min(T,ne),$=Math.max($,ne+Ae-1),H=Math.min(H,se),W=Math.max(W,se+it-1)}}if(T===1/0||H===1/0)return;let We=$-T+1,V=W-H+1,U=v?.[T]?.[H];if(!U?.cell)return;let oe=U.cell;oe.setColSpan(V),oe.setRowSpan(We);let ue=new Set([oe.getKey()]);for(let q=T;q<=$;q++)for(let K=H;K<=W;K++){let re=v?.[q]?.[K];if(!re?.cell)continue;let ne=re.cell,se=ne.getKey();ue.has(se)||(ue.add(se),m1(ne)||oe.append(...ne.getChildren()),ne.remove())}oe.getChildrenSize()===0&&oe.append(o1()),p1(oe),o()}})},S=()=>{l.update(()=>{q0()})},D=pe(C=>{l.update(()=>{for(let E=0;E<u.rows;E++)Y0(C);o()})},[l,o,u.rows]),k=pe(C=>{l.update(()=>{for(let E=0;E<u.columns;E++)Z0(C);o()})},[l,o,u.columns]),_=pe(()=>{l.update(()=>{K0(),o()})},[l,o]),b=pe(()=>{l.update(()=>{ye(s).remove(),g(),o()})},[l,s,g,o]),N=pe(()=>{l.update(()=>{V0(),o()})},[l,o]),M=pe(()=>{l.update(()=>{let C=ye(s),E=z0(s),[R]=xr(C,null,null),L=new Set,v=s.getHeaderStyles()^De.ROW;if(R[E])for(let T=0;T<R[E].length;T++){let $=R[E][T];$?.cell&&(L.has($.cell)||(L.add($.cell),$.cell.setHeaderStyles(v,De.ROW)))}g(),o()})},[l,s,g,o]),O=pe(()=>{l.update(()=>{let C=ye(s),E=X0(s),[R]=xr(C,null,null),L=new Set,v=s.getHeaderStyles()^De.COLUMN;if(R)for(let T=0;T<R.length;T++){let $=R?.[T]?.[E];$?.cell&&(L.has($.cell)||(L.add($.cell),$.cell.setHeaderStyles(v,De.COLUMN)))}g(),o()})},[l,s,g,o]),F=pe(()=>{l.update(()=>{if(s.isAttached()){let C=ye(s);C&&C.setRowStriping(!C.getRowStriping())}g(),o()})},[l,s,g,o]),I=pe(()=>{l.update(()=>{if(s.isAttached()){let C=ye(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:()=>x(),type:"button",children:P("span",{className:"text",children:"Merge cells"})}):m&&(w=P("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>S(),type:"button",children:P("span",{className:"text",children:"Unmerge cells"})}))),vs(Le("div",{className:"table-action-menu-dropdown",onClick:C=>{C.stopPropagation()},ref:i,children:[w?Le(_r.Fragment,{children:[w,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:()=>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:()=>D(!1),type:"button",children:Le("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," above"]})}),P("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>D(!0),type:"button",children:Le("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," below"]})}),P("hr",{}),P("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>k(!1),type:"button",children:Le("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","left"]})}),P("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>k(!0),type:"button",children:Le("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.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:()=>b(),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:Le("span",{className:"text",children:[(s.__headerState&De.ROW)===De.ROW?"Remove":"Add"," ","row header"]})}),P("button",{className:"item","data-test-id":"table-column-header",onClick:()=>O(),type:"button",children:Le("span",{className:"text",children:[(s.__headerState&De.COLUMN)===De.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function h1({anchorElem:t,cellMerge:e}){let[o]=Is(),r=co(null),n=co(null),[l,i]=nt(!1),[s,c]=nt(null),u=pe(()=>{let a=r.current,p=uo(),m=a1(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")),c(null)}if(p==null||a==null)return h();let g=o.getRootElement(),x=null,S=null;if(kr(p)&&g!==null&&m!==null&&g.contains(m.anchorNode)){let k=Ls(p.anchor.getNode());if(k==null||(S=o.getElementByKey(k.getKey()),S==null||!k.isAttached()))return h();let _=ye(k),b=Cr(_,o.getElementByKey(_.getKey()));if(b===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");x=br(b),c(k)}else if(vt(p)){let k=Ls(p.anchor.getNode());if(!Rs(k))throw new Error("TableSelection anchorNode must be a TableCellNode");let _=ye(k),b=Cr(_,o.getElementByKey(_.getKey()));if(b===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");x=br(b),S=o.getElementByKey(k.getKey())}else if(!f)return h();if(x===null||S===null)return h();let D=!x||!x.isSelecting;if(a.classList.toggle("table-cell-action-button-container--active",D),a.classList.toggle("table-cell-action-button-container--inactive",!D),D){let k=S.getBoundingClientRect(),_=t.getBoundingClientRect(),b=k.top-_.top,N=k.right-_.left;a.style.transform=`translate(${N}px, ${b}px)`}},[o,t]);rt(()=>{let a,p=()=>{a=void 0,o.getEditorState().read(u)},m=()=>(a===void 0&&(a=setTimeout(p,0)),!1);return e1(o.registerUpdateListener(m),o.registerCommand(u1,m,s1),o.registerRootListener((f,h)=>{h&&h.removeEventListener("pointerup",m),f&&(f.addEventListener("pointerup",m),m())}),()=>clearTimeout(a))});let d=co(s);return rt(()=>{d.current!==s&&i(!1),d.current=s},[d,s]),P("div",{className:"table-cell-action-button-container",ref:r,children:s!=null&&Le(_r.Fragment,{children:[P("button",{className:"table-cell-action-button",onClick:a=>{a.stopPropagation(),i(!l)},ref:n,type:"button",children:P(Ss,{})}),l&&P(f1,{cellMerge:e,contextRef:n,onClose:()=>i(!1),setIsMenuOpen:i,tableCellNode:s})]})})}var Ms=t=>{let e=G0(3),{anchorElem:o}=t,r=W0(),n;return e[0]!==o||e[1]!==r?(n=vs(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 Ds,$isTableRowNode as T1,getDOMCellFromTarget as w1,getTableElement as E1,TableNode as As}from"@lexical/table";import{calculateZoomLevel as Os,mergeRegister as N1}from"@lexical/utils";import{$getNearestNodeFromDOMNode as wr,isHTMLElement as S1}from"lexical";import*as Fs from"react";import{useCallback as Mt,useEffect as Er,useRef as mo,useState as lt}from"react";import{createPortal as L1}from"react-dom";var y1=33,$s=92;function I1({editor:t}){let e=mo(null),o=mo(null),r=mo(null),[n,l]=lt(!1),i=j(),s=mo(null),[c,u]=lt(null),[d,a]=lt(null),[p,m]=lt(!1),[f,h]=lt(null),g=Mt(()=>{a(null),e.current=null,h(null),s.current=null,r.current=null},[]),x=I=>(I.buttons&1)===1;Er(()=>{let I=new Set;return N1(t.registerMutationListener(As,w=>{for(let[C,E]of w)E==="destroyed"?I.delete(C):I.add(C);l(I.size>0)}),t.registerNodeTransform(As,w=>{if(w.getColWidths())return w;let C=w.getColumnCount(),E=$s;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){u({x:R.clientX,y:R.clientY});return}if(m(x(R)),!(o.current&&o.current.contains(L))&&e.current!==L){e.current=L;let v=w1(L);v&&d!==v?t.getEditorState().read(()=>{let T=wr(v.elem);if(!T)throw new Error("TableCellResizer: Table cell node not found.");let $=Tr(T),H=E1($,t.getElementByKey($.getKey()));if(!H)throw new Error("TableCellResizer: Table element not found.");e.current=L,r.current=H.getBoundingClientRect(),a(v)},{editor:t}):v==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 S=I=>I==="bottom",D=Mt(I=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let w=wr(d.elem);if(!Ds(w))throw new Error("TableCellResizer: Table cell node not found.");let C=Tr(w),E=_1(w),R=C.getChildren(),v=w.getColSpan()===C.getColumnCount()?E:E+w.getRowSpan()-1;if(v>=R.length||v<0)throw new Error("Expected table cell to be inside of table row.");let T=R[v];if(!T1(T))throw new Error("Expected table row");let $=T.getHeight();if($===void 0){let W=T.getChildren();$=Math.min(...W.map(Y=>k(Y,t)??1/0))}let H=Math.max($+I,y1);T.setHeight(H)},{tag:"skip-scroll-into-view"})},[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},b=Mt(I=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let w=wr(d.elem);if(!Ds(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 v=L[R];if(v===void 0)return;let T=[...L],$=Math.max(v+I,$s);T[R]=$,C.setColWidths(T)},{tag:"skip-scroll-into-view"})},[d,t]),N=Mt(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=Os(C.target);if(S(I)){let v=(C.clientY-R)/L;D(v)}else{let v=(C.clientX-E)/L;b(v)}g(),document.removeEventListener("mouseup",w)}};return w},[d,g,b,D]),M=Mt(I=>w=>{if(w.preventDefault(),w.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");s.current={x:w.clientX,y:w.clientY},u(s.current),h(I),document.addEventListener("mouseup",N(I))},[d,N]),[O,F]=lt({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=Os(d.elem),L=10,v={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`}},T=r.current;f&&c&&T&&(S(f)?(v[f].left=`${window.scrollX+T.left}px`,v[f].top=`${window.scrollY+c.y/R}px`,v[f].height="3px",v[f].width=`${T.width}px`):(v[f].top=`${window.scrollY+T.top}px`,v[f].left=`${window.scrollX+c.x/R}px`,v[f].width="3px",v[f].height=`${T.height}px`),v[f].backgroundColor="#adf"),F(v)}else F({bottom:null,left:null,right:null,top:null})},[d,f,c]),po("div",{ref:o,children:d!=null&&!p&&x1(Fs.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 Ps=()=>{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 Ks}from"@lexical/react/LexicalComposerContext";import{$getTableAndElementByKey as H1,$getTableColumnIndexFromTableCellNode as j1,$getTableRowIndexFromTableCellNode as U1,$insertTableColumn__EXPERIMENTAL as G1,$insertTableRow__EXPERIMENTAL as W1,$isTableCellNode as V1,$isTableNode as js,getTableElement as K1,TableNode as J1}from"@lexical/table";import{$findMatchingParent as X1,mergeRegister as z1}from"@lexical/utils";import{$getNearestNodeFromDOMNode as Us,isHTMLElement as Z1}from"lexical";import{useEffect as Gs,useMemo as Y1,useRef as Ws,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,c=!1,u,d,a,p=!0;if(typeof t!="function")throw new TypeError(R1);e=e||0,typeof o=="object"&&(s=!!o.leading,c="maxWait"in o,u=c?v1(o.maxWait||0,e):u,p="trailing"in o?!!o.trailing:p);function m(b){let N=r,M=i;return r=i=void 0,l=b,d=t.apply(M,N),d}function f(b){return l=b,a=setTimeout(x,e),s?m(b):d}function h(b){let N=b-n,M=b-l,O=e-N;return c?M1(O,u-M):O}function g(b){let N=b-n,M=b-l;return n===void 0||N>=e||N<0||c&&M>=u}function x(){let b=Date.now();if(g(b))return S(b);a=setTimeout(x,h(b))}function S(b){return a=void 0,p&&r?m(b):(r=i=void 0,d)}function D(){a!==void 0&&clearTimeout(a),l=0,r=n=i=a=void 0}function k(){return a===void 0?d:S(Date.now())}function _(){let b=Date.now(),N=g(b);if(r=arguments,i=this,n=b,N){if(a===void 0)return f(n);if(c)return clearTimeout(a),a=setTimeout(x,e),m(n)}return a===void 0&&(a=setTimeout(x,e)),d}return _.cancel=D,_.flush=k,_}var Bs=D1;function Hs(t,e,o){let r=A1(6),n=$1(null),l,i;r[0]!==t||r[1]!==o||r[2]!==e?(l=()=>(n.current=Bs(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=(...u)=>{let d=u;n.current&&n.current(...d)},r[5]=s):s=r[5],s}var Vs=20;function Q1({anchorElem:t}){let[e]=Ks(),o=j(),[r,n]=fo(!1),[l,i]=fo(!1),[s,c]=fo(!1),[u,d]=fo({}),a=Ws(new Set),p=Ws(null),m=Hs(g=>{let{isOutside:x,tableDOMNode:S}=eh(g,o.editorConfig?.lexical);if(x){n(!1),i(!1);return}if(!S)return;p.current=S;let D=null,k=null,_=null;if(e.getEditorState().read(()=>{let L=Us(S);if(V1(L)){let v=X1(L,T=>js(T));if(!js(v))return;if(_=K1(v,e.getElementByKey(v.getKey())),_){let T=v.getChildrenSize(),$=v.getChildAtIndex(0)?.getChildrenSize(),H=U1(L),W=j1(L);H===T-1?D=L:W===$-1&&(k=L)}}},{editor:e}),!_)return;let b=_.parentElement;if(!b)return;let{bottom:N,height:M,left:O,right:F,width:I,y:w}=_.getBoundingClientRect(),C=!1;b&&b.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(C=b.scrollWidth>b.clientWidth);let{left:E,y:R}=t.getBoundingClientRect();D?(i(!1),n(!0),d({height:Vs,left:C&&b?b.offsetLeft:O-E,top:N-R+5,width:C&&b?b.offsetWidth:I})):k&&(i(!0),n(!1),d({height:M,left:F-E+5,top:w-R,width:Vs}))},50,250),f=Y1(()=>new ResizeObserver(()=>{n(!1),i(!1)}),[]);Gs(()=>{if(s)return document.addEventListener("mousemove",m),()=>{n(!1),i(!1),document.removeEventListener("mousemove",m)}},[s,m]),Gs(()=>z1(e.registerMutationListener(J1,g=>{e.getEditorState().read(()=>{let x=!1;for(let[S,D]of g)switch(D){case"created":{a.current.add(S),x=!0;break}case"destroyed":{a.current.delete(S),x=!0;break}default:break}if(x){f.disconnect();for(let S of a.current){let{tableElement:D}=H1(S);f.observe(D)}c(a.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let h=g=>{e.update(()=>{p.current&&(Us(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:{...u},type:"button"}),l&&Nr("button",{"aria-label":"Add Column",className:o.editorConfig.lexical.theme.tableAddColumns,onClick:()=>h(!1),style:{...u},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 Js(t){let e=F1(2),{anchorElem:o}=t,r=o===void 0?document.body:o,[n]=Ks();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 Xs from"react";var ho=hh("OPEN_EMBED_DRAWER_COMMAND"),zs=gh({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function Zs({children:t}){let[e,o]=kh({cellEditorConfig:null,cellEditorPlugins:null});return Sr(zs,{value:bh(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(r,n)=>{o({cellEditorConfig:r,cellEditorPlugins:n})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var Ys=()=>{let t=th(16),[e]=rh(),o=xh(zs),r=dh(),{fieldProps:n,uuid:l}=j(),{schemaPath:i}=n,s="lexical-table-create-"+l,c;t[0]!==r||t[1]!==s?(c=uh({slug:s,depth:r}),t[0]=r,t[1]=s,t[2]=c):c=t[2];let u=c,{toggleDrawer:d}=xe(u,!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]!==u||t[13]!==i||t[14]!==m?(f=oh(Xs.Fragment,{children:[Sr(st,{drawerSlug:u,drawerTitle:"Create Table",featureKey:"experimental_table",handleDrawerSubmit:m,schemaPath:i,schemaPathSuffix:"fields"}),Sr(nh,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]}),t[12]=u,t[13]=i,t[14]=m,t[15]=f):f=t[15],f};var Eh=y({markdownTransformers:[Es],nodes:[Th,_h,wh],plugins:[{Component:Ys,position:"normal"},{Component:Ps,position:"normal"},{Component:Ms,position:"floatingAnchorElem"},{Component:Js,position:"floatingAnchorElem"}],providers:[Zs],slashMenu:{groups:[ee([{Icon:pr,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(ho,{})}}])]},toolbarFixed:{groups:[ke([{ChildComponent:pr,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 ea from"bson-objectid";import{$applyNodeReplacement as vh}from"lexical";import*as ta from"react";import{jsx as Sh}from"react/jsx-runtime";import{DecoratorBlockNode as Lh}from"@lexical/react/LexicalDecoratorBlockNode.js";import qs 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:Qs({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||Ir(e),null}var Dt=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 qs.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value},r=Qs({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 Qs({data:t}){return t?.id||(t.id=new qs.default().toHexString()),yh(new Dt({data:t}))}var Mh=ta.lazy(()=>import("./component-NNKG7K3O.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:Ge({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||Ir(e),null}var Ie=class extends Dt{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 ea.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value},r=Ge({data:o});return r.setFormat(e.format),r}decorate(){return Rh(Mh,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Ge({data:t}){return t?.id||(t.id=new ea.default().toHexString()),vh(new Ie({data:t}))}function Rr(t){return t instanceof Ie}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 oa}from"react/compiler-runtime";import{jsx as vr}from"react/jsx-runtime";import{useLexicalComposerContext as ra}from"@lexical/react/LexicalComposerContext.js";import{toast as Ah}from"@payloadcms/ui";import{$getNodeByKey as Oh,COMMAND_PRIORITY_EDITOR as na}from"lexical";import{useEffect as la,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(Ge({data:{fields:null,relationTo:e,value:r}}))}):t.dispatchCommand(Mr,{fields:null,relationTo:e,value:r})},Ph=t=>{let e=oa(13),{enabledCollectionSlugs:o}=t,[r]=ra(),[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:c,openListDrawer:u}=yt(i),d,a;e[2]!==r||e[3]!==u?(d=()=>r.registerCommand(Ke,h=>(l(h?.replace?h?.replace.nodeKey:null),u(),!0),na),a=[r,u],e[2]=r,e[3]=u,e[4]=d,e[5]=a):(d=e[4],a=e[5]),la(d,a);let p;e[6]!==s||e[7]!==r||e[8]!==n?(p=h=>{let{collectionSlug:g,doc:x}=h;s(),Fh({editor:r,relationTo:g,replaceNodeKey:n,value:x.id})},e[6]=s,e[7]=r,e[8]=n,e[9]=p):p=e[9];let m=p,f;return e[10]!==c||e[11]!==m?(f=vr(c,{onSelect:m}),e[10]=c,e[11]=m,e[12]=f):f=e[12],f},Bh=()=>{let t=oa(3),[e]=ra(),o,r;return t[0]!==e?(o=()=>e.registerCommand(Ke,Hh,na),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),la(o,r),null},ia=t=>vr(At,{...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"),sa=t=>{let e=jh(5),[o]=Gh(),{config:r}=Kh(),{collections:n}=r,l,i;e[0]!==o?(l=()=>{if(!o.hasNodes([Ie]))throw new Error("UploadPlugin: UploadNode not registered on editor");return Vh(o.registerCommand(Mr,c=>(o.update(()=>{let u=Xh()||Jh();if(Zh(u)){let d=Ge({data:{id:c.id,fields:c.fields,relationTo:c.relationTo,value:c.value}}),{focus:a}=u,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(ia,{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:[Ie],plugins:[{Component:sa,position:"normal"}],slashMenu:{groups:[ee([{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(Ke,{replace:!1})}}])]},toolbarFixed:{groups:[ke([{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(Ke,{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 aa={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:aa};function ca({config:t,featureClientImportMap:e,featureClientSchemaMap:o,field:r,schemaPath:n,unSanitizedEditorConfig:l}){for(let u of l.features)if(!u?.clientFeatureProps?.featureKey||u?.clientFeatureProps?.order===void 0||u?.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((u,d)=>u.clientFeatureProps.order-d.clientFeatureProps.order);let i=new Map;for(let u of l.features)i.set(u.clientFeatureProps.featureKey,u);let s=new Map,c=0;for(let u of l.features){let d=typeof u.feature=="function"?u.feature({config:t,featureClientImportMap:e,featureClientSchemaMap:o,featureProviderMap:i,field:r,resolvedFeatures:s,schemaPath:n,unSanitizedEditorConfig:l}):u.feature;d.key=u.clientFeatureProps.featureKey,d.order=c,s.set(u.clientFeatureProps.featureKey,d),c++}return s}import{deepMerge as rg}from"payload/shared";var ua=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:ua(t),lexical:e,resolvedFeatureMap:t}}var dg=sg(()=>import("./Field-6GAC5Y2D.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:c}=t,u;e[0]!==o?(u=o===void 0?{}:o,e[0]=o,e[1]=u):u=e[1];let d=u,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]!==c?(h=()=>{if(m)return;let S=[];for(let[_,b]of Object.entries(r))b.clientFeatureProvider&&S.push(b.clientFeatureProvider(b.clientFeatureProps));let D=a||go,k=ca({config:p,featureClientImportMap:n,featureClientSchemaMap:l,field:i,schemaPath:c??i.name,unSanitizedEditorConfig:{features:S,lexical:D}});f(Dr(k,D,d))},g=[a,d,m,r,n,l,i,p,c],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]=c,e[11]=h,e[12]=g):(h=e[11],g=e[12]),cg(h,g);let x;return e[13]!==m||e[14]!==t?(x=Ar(ag,{fallback:Ar(lg,{height:"35vh"}),children:m&&Ar(dg,{...t,editorConfig:m})}),e[13]=m,e[14]=t,e[15]=x):x=e[15],x};function pg(t){return t instanceof HTMLElement}function fg(...t){return t.filter(Boolean).join(" ")}var xo=new WeakMap;function da(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=da(i))},l=i=>{if(o===void 0)return;let{start:s}=o;if(s===null)return;let c=da(i);for(let u of r)c!==null&&u([c[0]-s[0],c[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}=Ce(),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}=Ce(),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}=Ce(),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}=Ce(),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}=Oe(),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}=Oe(),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}=Oe(),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 c=jg({depth:e??0,draft:o??!1,locale:r,select:s},{addQueryPrefix:!0});return await fetch(`${t}/${i}/${l}${c}`,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(d=>d.json())};export{Ct as $createAutoLinkNode,Wt as $createBlockNode,ko as $createInlineBlockNode,_e as $createLinkNode,je as $createRelationshipNode,Ge as $createUploadNode,we as $isAutoLinkNode,ft as $isBlockNode,_o as $isInlineBlockNode,Z as $isLinkNode,sr as $isRelationshipNode,Rr as $isUploadNode,Ea as AlignFeatureClient,Te as AutoLinkNode,Ag as BlockCollapsible,Fg as BlockEditButton,be as BlockNode,Hg as BlockRemoveButton,Ia as BlockquoteFeatureClient,Sc as BlocksFeatureClient,zc as BoldFeatureClient,ce as CAN_USE_DOM,zm as ChecklistFeatureClient,Bp as DETAIL_TYPE_TO_DETAIL,Op as DOUBLE_LINE_BREAK,Yp as DebugJsxConverterFeatureClient,jp as ELEMENT_FORMAT_TO_TYPE,Hp as ELEMENT_TYPE_TO_FORMAT,xa as ENABLE_SLASH_MENU_COMMAND,pa as EditorConfigProvider,st as FieldsDrawer,k0 as FixedToolbarFeatureClient,Uu as HeadingFeatureClient,ld as HorizontalRuleFeatureClient,Je as INSERT_BLOCK_COMMAND,Xe as INSERT_INLINE_BLOCK_COMMAND,Dp as IS_ALL_FORMATTING,_d as IndentFeatureClient,vg as InlineBlockContainer,Tg as InlineBlockEditButton,yg as InlineBlockLabel,bo as InlineBlockNode,Ng as InlineBlockRemoveButton,eu as InlineCodeFeatureClient,v0 as InlineToolbarFeatureClient,nu as ItalicFeatureClient,Fp as LTR_REGEX,xp as LexicalPluginToLexicalFeatureClient,Am as LinkFeatureClient,ie as LinkNode,Ap as NON_BREAKING_SPACE,A as NodeFormat,rp as OrderedListFeatureClient,Np as ParagraphFeatureClient,ha as Point,$p as RTL_REGEX,Ca as Rect,Pf as RelationshipFeatureClient,Ne as RelationshipNode,mg as RichTextField,wp as SlateToLexicalFeatureClient,cu as StrikethroughFeatureClient,pu as SubscriptFeatureClient,xu as SuperscriptFeatureClient,Up as TEXT_MODE_TO_TYPE,Pp as TEXT_TYPE_TO_FORMAT,Gp as TEXT_TYPE_TO_MODE,he as TOGGLE_LINK_COMMAND,Eh as TableFeatureClient,Hc as TestRecorderFeatureClient,Du as TextStateFeatureClient,It as ToolbarButton,Ue as ToolbarDropdown,Vc as TreeViewFeatureClient,Tu as UnderlineFeatureClient,dp as UnorderedListFeatureClient,og as UploadFeatureClient,Ie as UploadNode,bg as addSwipeDownListener,gg as addSwipeLeftListener,xg as addSwipeRightListener,Cg as addSwipeUpListener,Bo as createBlockNode,y as createClientFeature,qp as defaultColors,go as defaultEditorLexicalConfig,mr as getDOMRangeRect,ba as getEnabledNodes,Ug as getRestPopulateFn,ze as getSelectedNode,pg as isHTMLElement,ga as isPoint,fg as joinClasses,Dr as sanitizeClientEditorConfig,ua as sanitizeClientFeatures,lo as setFloatingElemPosition,Qt as setFloatingElemPositionForLinkEditor,ee as slashMenuBasicGroupWithItems,ke as toolbarAddDropdownGroupWithItems,jo as toolbarFeatureButtonsGroupWithItems,te as toolbarFormatGroupWithItems,le as toolbarTextDropdownGroupWithItems,Oe as useBlockComponentContext,j as useEditorConfigContext,Ce as useInlineBlockComponentContext,fa as useLexicalDocumentDrawer,xe as useLexicalDrawer,yt as useLexicalListDrawer};
|
|
41
41
|
//# sourceMappingURL=index.js.map
|