@payloadcms/richtext-lexical 3.22.0 → 3.23.0-canary.597254e
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-ZQTPXWY3.js +2 -0
- package/dist/exports/client/Field-ZQTPXWY3.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/{chunk-JKFXKPNG.js → chunk-CIY6PKN6.js} +2 -2
- package/dist/exports/client/chunk-CIY6PKN6.js.map +7 -0
- package/dist/exports/client/chunk-KEEUF5NK.js +2 -0
- package/dist/exports/client/chunk-KEEUF5NK.js.map +7 -0
- package/dist/exports/client/componentInline-UG3ZWWJY.js +2 -0
- package/dist/exports/client/index.js +10 -10
- package/dist/exports/client/index.js.map +3 -3
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +43 -22
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +28 -9
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +39 -31
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.js +35 -35
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
- package/dist/features/link/server/baseFields.d.ts.map +1 -1
- package/dist/features/link/server/baseFields.js +5 -8
- package/dist/features/link/server/baseFields.js.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/typesClient.d.ts +2 -1
- package/dist/features/typesClient.d.ts.map +1 -1
- package/dist/features/typesClient.js.map +1 -1
- package/dist/features/upload/server/feature.server.d.ts.map +1 -1
- package/dist/features/upload/server/feature.server.js +10 -8
- package/dist/features/upload/server/feature.server.js.map +1 -1
- package/dist/field/Field.d.ts +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +17 -7
- package/dist/field/Field.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +23 -18
- package/dist/field/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lexical/config/client/loader.d.ts +3 -2
- package/dist/lexical/config/client/loader.d.ts.map +1 -1
- package/dist/lexical/config/client/loader.js +2 -0
- package/dist/lexical/config/client/loader.js.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.d.ts +12 -0
- package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.js +198 -19
- package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +10 -4
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js +2 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
- package/dist/utilities/createClientFeature.d.ts +2 -1
- package/dist/utilities/createClientFeature.d.ts.map +1 -1
- package/dist/utilities/createClientFeature.js +2 -0
- package/dist/utilities/createClientFeature.js.map +1 -1
- package/package.json +7 -7
- package/dist/exports/client/Field-LOLYH42M.js +0 -2
- package/dist/exports/client/Field-LOLYH42M.js.map +0 -7
- package/dist/exports/client/chunk-JKFXKPNG.js.map +0 -7
- package/dist/exports/client/chunk-UJAPUXH4.js +0 -2
- package/dist/exports/client/chunk-UJAPUXH4.js.map +0 -7
- package/dist/exports/client/componentInline-KK5V376W.js +0 -2
- /package/dist/exports/client/{componentInline-KK5V376W.js.map → componentInline-UG3ZWWJY.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use client";import{a as ce,c as
|
|
1
|
+
"use client";import{a as ce,c as fo,d as ho,e as go}from"./chunk-KEEUF5NK.js";import{a as ze}from"./chunk-DBWINSQN.js";import{a as Ye,b as Rt,c as Pe}from"./chunk-PUXDVIHC.js";import{a as ae}from"./chunk-INBEEENE.js";import{a as vs}from"./chunk-F26IQ5RE.js";import{a as ys,b as Ir,d as yr,e as vr,f as Ms,g as Ds,h as As,j as Os,l as Fs,m as $s}from"./chunk-CIY6PKN6.js";import{a as Is,b as P}from"./chunk-3LGFOM34.js";function Y(t){return{items:t,key:"basic",label:({i18n:e})=>e.t("lexical:general:slashMenuBasicGroupLabel")}}import{$isElementNode as we,$isRangeSelection as It,FORMAT_ELEMENT_COMMAND as yt}from"lexical";import{jsx as Co,jsxs as Ps}from"react/jsx-runtime";import"react";var Mr=()=>Ps("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:[Co("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Co("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Co("path",{d:"M5 15H15",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as xo,jsxs as Bs}from"react/jsx-runtime";import"react";var Dr=()=>Bs("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:[xo("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),xo("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),xo("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as bo,jsxs as Hs}from"react/jsx-runtime";import"react";var St=()=>Hs("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:[bo("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),bo("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),bo("path",{d:"M2.5 15H12.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as _o,jsxs as js}from"react/jsx-runtime";import"react";var Ar=()=>js("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:[_o("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),_o("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),_o("path",{d:"M7.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});var v=t=>o=>{let r={clientFeatureProps:o};if(typeof t=="function")r.feature=({config:n,featureClientSchemaMap:i,featureProviderMap:l,field:s,resolvedFeatures:a,schemaPath:u,unSanitizedEditorConfig:c})=>{let d=t({config:n,featureClientSchemaMap:i,featureProviderMap:l,field:s,props:o,resolvedFeatures:a,schemaPath:u,unSanitizedEditorConfig:c});return d.sanitizedClientFeatureProps===null&&(d.sanitizedClientFeatureProps=o),d};else{let n={...t};n.sanitizedClientFeatureProps=o,r.feature=n}return r};var Or=t=>({type:"dropdown",ChildComponent:St,items:t,key:"align",order:30});var Fr=[Or([{ChildComponent:St,isActive:({selection:t})=>{if(!It(t))return!1;for(let e of t.getNodes()){if(we(e)&&e.getFormatType()==="left")continue;let o=e.getParent();if(!(we(o)&&o.getFormatType()==="left"))return!1}return!0},key:"alignLeft",label:({i18n:t})=>t.t("lexical:align:alignLeftLabel"),onSelect:({editor:t})=>{t.dispatchCommand(yt,"left")},order:1},{ChildComponent:Mr,isActive:({selection:t})=>{if(!It(t))return!1;for(let e of t.getNodes()){if(we(e)&&e.getFormatType()==="center")continue;let o=e.getParent();if(!(we(o)&&o.getFormatType()==="center"))return!1}return!0},key:"alignCenter",label:({i18n:t})=>t.t("lexical:align:alignCenterLabel"),onSelect:({editor:t})=>{t.dispatchCommand(yt,"center")},order:2},{ChildComponent:Ar,isActive:({selection:t})=>{if(!It(t))return!1;for(let e of t.getNodes()){if(we(e)&&e.getFormatType()==="right")continue;let o=e.getParent();if(!(we(o)&&o.getFormatType()==="right"))return!1}return!0},key:"alignRight",label:({i18n:t})=>t.t("lexical:align:alignRightLabel"),onSelect:({editor:t})=>{t.dispatchCommand(yt,"right")},order:3},{ChildComponent:Dr,isActive:({selection:t})=>{if(!It(t))return!1;for(let e of t.getNodes()){if(we(e)&&e.getFormatType()==="justify")continue;let o=e.getParent();if(!(we(o)&&o.getFormatType()==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:t})=>t.t("lexical:align:alignJustifyLabel"),onSelect:({editor:t})=>{t.dispatchCommand(yt,"justify")},order:4}])],Us=v({toolbarFixed:{groups:Fr},toolbarInline:{groups:Fr}});import{$createQuoteNode as Gr,$isQuoteNode as jr,QuoteNode as Ks}from"@lexical/rich-text";import{$setBlocksType as Wr}from"@lexical/selection";import{$getSelection as Vr,$isRangeSelection as Zs}from"lexical";import{jsx as $r}from"react/jsx-runtime";import"react";var To=()=>$r("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:$r("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 Pr}from"react/jsx-runtime";import"react";var Xe=()=>Pr("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:Pr("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 X=t=>({type:"dropdown",ChildComponent:Xe,items:t,key:"text",order:25});import{$createQuoteNode as Gs,$isQuoteNode as Br,QuoteNode as Ws}from"@lexical/rich-text";import{$createLineBreakNode as Vs}from"lexical";var Hr={type:"element",dependencies:[Ws],export:(t,e)=>{if(!Br(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 i=t.getPreviousSibling();if(Fr(i)){i.splice(i.getChildrenSize(),0,[js(),...e]),i.select(0,0),t.remove();return}}let n=Bs();n.append(...e),t.replace(n),n.select(0,0)}};var Br=[z([{ChildComponent:Co,isActive:({selection:t})=>{if(!Gs(t))return!1;for(let e of t.getNodes())if(!Pr(e)&&!Pr(e.getParent()))return!1;return!0},key:"blockquote",label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Ur();jr(e,()=>Hr())})},order:20}])],Ws=y({markdownTransformers:[$r],nodes:[Us],slashMenu:{groups:[V([{Icon:Co,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Ur();jr(e,()=>Hr())})}}])]},toolbarFixed:{groups:Br},toolbarInline:{groups:Br}});import{getTranslation as Ft}from"@payloadcms/translations";import{jsx as xo,jsxs as Vs}from"react/jsx-runtime";import"react";var yt=()=>Vs("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:[xo("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"8",y:"5"}),xo("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"5",y:"11"}),xo("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"11",y:"11"})]});import{jsx as Gr}from"react/jsx-runtime";import"react";var vt=()=>Gr("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:Gr("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 Ks}from"react/jsx-runtime";import"react";function Mt(t,e){return t?()=>Ks("img",{alt:e??"Block Image",className:"lexical-block-custom-image",src:t,style:{maxHeight:20,maxWidth:20}}):yt}import{jsx as Ea}from"react/jsx-runtime";import ka from"bson-objectid";import"react";import{DecoratorBlockNode as Zs}from"@lexical/react/LexicalDecoratorBlockNode.js";import Ys from"bson-objectid";var et=class extends Zs{__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=zs(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 zs(t){return new et({fields:{...t,id:t?.id||new Ys.default().toHexString()}})}import{jsx as G,jsxs as tt,Fragment as oa}from"react/jsx-runtime";import{Button as Zr,Collapsible as ra,Drawer as na,EditDepthProvider as ia,ErrorPill as la,Form as sa,formatDrawerSlug as aa,FormSubmit as ca,Pill as ua,RenderFields as da,SectionTitle as ma,useDocumentForm as pa,useDocumentInfo as Yr,useEditDepth as fa,useFormSubmitted as ha,useServerFunctions as ga,useTranslation as Ca}from"@payloadcms/ui";import{abortAndIgnore as bo}from"@payloadcms/ui/shared";import{deepCopyObjectSimpleWithoutReactComponents as _o,reduceFieldsToValues as xa}from"payload/shared";import ot,{useCallback as To,useEffect as wo,useMemo as rt,useRef as ba}from"react";import{useLexicalComposerContext as _a}from"@lexical/react/LexicalComposerContext";import{getTranslation as Ta}from"@payloadcms/translations";import{$getNodeByKey as Eo}from"lexical";import{v4 as wa}from"uuid";import{c as Xs}from"react/compiler-runtime";import{jsx as Dt,jsxs as Js}from"react/jsx-runtime";import{RenderFields as qs,useFormSubmitted as Qs}from"@payloadcms/ui";import ea,{createContext as ta}from"react";var Wr=ta({initialState:!1}),Re=()=>ea.useContext(Wr),Vr=t=>{let e=Xs(13),{BlockDrawer:o,Collapsible:r,CustomBlock:n,EditButton:i,errorCount:l,formSchema:s,initialState:a,nodeKey:u,RemoveButton:c}=t,m=Qs()&&l>0,p,f;e[0]!==r||e[1]!==l||e[2]!==m?(f=b=>Dt(r,{editButton:b.editButton,errorCount:l,fieldHasErrors:m,Label:b.Label,removeButton:b.removeButton,children:b.children}),e[0]=r,e[1]=l,e[2]=m,e[3]=f):f=e[3],p=f;let h=p,C;return e[4]!==o||e[5]!==h||e[6]!==n||e[7]!==i||e[8]!==c||e[9]!==s||e[10]!==a||e[11]!==u?(C=n?Js(Wr.Provider,{value:{BlockCollapsible:h,EditButton:i,initialState:a,nodeKey:u,RemoveButton:c},children:[n,Dt(o,{})]}):Dt(h,{children:Dt(qs,{fields:s,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0})}),e[4]=o,e[5]=h,e[6]=n,e[7]=i,e[8]=c,e[9]=s,e[10]=a,e[11]=u,e[12]=C):C=e[12],C};function Kr({fields:t}){for(let e in t){let o=t[e];Array.isArray(o?.rows)&&"value"in o&&(o.disableFormData=!0)}return t}var Q="lexical-block",zr=t=>{let{cacheBuster:e,formData:o,nodeKey:r}=t,n=ha(),{id:i,collectionSlug:l,globalSlug:s}=Yr(),{fieldProps:{featureClientSchemaMap:a,field:u,initialLexicalFormState:c,permissions:d,readOnly:m,schemaPath:p},uuid:f}=P(),{fields:h}=pa(),C=ba(new AbortController),b=fa(),[k,v]=ot.useState(0),x=aa({slug:`lexical-blocks-create-${f}-${o.id}`,depth:b}),{toggleDrawer:T}=ae(x),{getDocPreferences:g,setDocFieldPreferences:w}=Yr(),[N]=_a(),{getFormState:L}=ga(),S=`${p}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}.fields`,[I,E]=ot.useState(c?.[o.id]?.formState?{...c?.[o.id]?.formState,blockName:{initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName}}:!1);wo(()=>{E(!1)},[e]);let[_,R]=ot.useState(I?._components?.customComponents?.BlockLabel),[M,D]=ot.useState(I?._components?.customComponents?.Block);wo(()=>{let B=new AbortController;return o&&!I&&(async()=>{let{state:U}=await L({id:i,collectionSlug:l,data:o,docPermissions:{fields:!0},docPreferences:await g(),documentFormState:_o(h),globalSlug:s,initialBlockData:o,operation:"update",renderAllFields:!0,schemaPath:S,signal:B.signal});U&&(U.blockName={initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName},E(U),R(U._components?.customComponents?.BlockLabel),D(U._components?.customComponents?.Block))})(),()=>{bo(B)}},[L,S,i,o,I,l,s,g,h]);let[F,A]=ot.useState(c?.[o.id]?.collapsed??!1),H=`${p}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}`,oe=a.blocks?.[H]?.[0]?.blocks?.[0],{i18n:Ne,t:j}=Ca(),q=To(async({formState:B,submit:re})=>{bo(C.current);let U=new AbortController;C.current=U;let{state:Y}=await L({id:i,collectionSlug:l,docPermissions:{fields:!0},docPreferences:await g(),documentFormState:_o(h),formState:B,globalSlug:s,initialBlockFormState:B,operation:"update",renderAllFields:!!re,schemaPath:S,signal:U.signal});if(!Y)return B;B.blockName&&(Y.blockName=B.blockName);let J=xa(Kr({fields:_o(Y)}),!0);if(setTimeout(()=>{N.update(()=>{let se=Eo(r);if(se&&At(se)){let Be=J;Be.blockType=o.blockType,se.setFields(Be,!0)}})},0),re){R(Y._components?.customComponents?.BlockLabel),D(Y._components?.customComponents?.Block);let se=0;for(let Be of Object.values(Y))Be?.valid===!1&&se++;v(se)}return Y},[L,i,l,g,s,S,o.blockType,h,N,r]);wo(()=>()=>{bo(C.current)},[]);let ze=To(()=>{N.update(()=>{Eo(r)?.remove()})},[N,r]),_e=oe?.labels?.singular?Ta(oe.labels.singular,Ne):oe?.slug,Te=To(B=>{g().then(re=>{let Y=re?.fields?.[u.name]?.collapsed,J=Y&&Y?.length?Y:[];B?J.includes(o.id)||J.push(o.id):J.includes(o.id)&&J.splice(J.indexOf(o.id),1),w(u.name,{collapsed:J,hello:"hi"})})},[g,u.name,w,o.id]),Fe=rt(()=>()=>G(Zr,{buttonStyle:"icon-label",className:`${Q}__editButton`,disabled:m,el:"button",icon:"edit",onClick:B=>(B.preventDefault(),B.stopPropagation(),T(),!1),onMouseDown:B=>{B.preventDefault()},round:!0,size:"small",tooltip:j("lexical:blocks:inlineBlocks:edit",{label:_e})}),[_e,m,j,T]),$e=rt(()=>()=>G(Zr,{buttonStyle:"icon-label",className:`${Q}__removeButton`,disabled:u?.admin?.readOnly||!1,icon:"x",onClick:B=>{B.preventDefault(),ze()},round:!0,tooltip:"Remove Block"}),[u?.admin?.readOnly,ze]),Xe=rt(()=>({children:B,disableBlockName:re,editButton:U,errorCount:Y,fieldHasErrors:J,Label:se,removeButton:Be})=>G("div",{className:Q+" "+Q+"-"+o.blockType,children:G(ra,{className:[`${Q}__row`,J?`${Q}__row--has-errors`:`${Q}__row--no-errors`].join(" "),collapsibleStyle:J?"error":"default",header:tt("div",{className:`${Q}__block-header`,children:[se??_?se??_:tt("div",{children:[G(ua,{className:`${Q}__block-pill ${Q}__block-pill-${o?.blockType}`,pillStyle:"white",children:_e??o?.blockType}),!re&&G(ma,{path:"blockName",readOnly:u?.admin?.readOnly||!1}),J&&G(la,{count:Y??0,i18n:Ne,withMessage:!0})]}),tt("div",{children:[M&&U!==!1||!M&&U?G(Fe,{}):null,Be!==!1&&N.isEditable()?G($e,{}):null]})]}),isCollapsed:F,onToggle:Lr=>{Te(Lr),A(Lr)},children:B},0)}),[M,_,Fe,$e,_e,N,o.blockType,Ne,F,Te,u?.admin?.readOnly]),Pe=oe?.fields??[],kr=rt(()=>()=>G(ia,{children:G(na,{className:"",slug:x,title:j(`lexical:blocks:inlineBlocks:${o?.id?"edit":"create"}`,{label:_e??j("lexical:blocks:inlineBlocks:label")}),children:I?tt(oa,{children:[G(da,{fields:Pe,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:S,permissions:d,readOnly:!1}),G(ca,{programmaticSubmit:!0,children:j("fields:saveChanges")})]}):null})}),[I,x,_e,j,oe?.fields,S,d]),ks=rt(()=>I?G(sa,{beforeSubmit:[async({formState:B})=>await q({formState:B,submit:!0})],fields:Pe,initialState:I,onChange:[q],onSubmit:(B,re)=>{re.blockType=o.blockType,N.update(()=>{let U=Eo(r);U&&At(U)&&U.setFields(re,!0)}),T()},submitted:n,uuid:wa(),children:G(Vr,{baseClass:Q,BlockDrawer:kr,Collapsible:Xe,CustomBlock:M,EditButton:Fe,errorCount:k,formSchema:Pe,initialState:I,nodeKey:r,RemoveButton:$e})}):null,[Xe,kr,M,Pe,$e,Fe,N,k,T,oe?.fields,I,r,q,n]);return oe?ks:G(Xe,{disableBlockName:!0,fieldHasErrors:!0,children:tt("div",{className:"lexical-block-not-found",children:["Error: Block '",o.blockType,"' not found in the config but exists in the lexical data"]})})};var ue=class extends et{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=Ot(e.fields);return o.setFormat(e.format),o}decorate(e,o){return Ea(zr,{cacheBuster:this.getCacheBuster(),formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Ot(t){return new ue({fields:{...t,id:t?.id||new ka.default().toHexString()}})}function At(t){return t instanceof ue}import{createCommand as Xr}from"lexical";var nt=Xr("INSERT_BLOCK_COMMAND"),it=Xr("INSERT_INLINE_BLOCK_COMMAND");import{c as La}from"react/compiler-runtime";import{useLexicalComposerContext as Na}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Ra,$wrapNodeInElement as Sa,mergeRegister as Ia}from"@lexical/utils";import{formatDrawerSlug as ya,useEditDepth as va}from"@payloadcms/ui";import{$createParagraphNode as Ma,$getNodeByKey as Da,$getPreviousSelection as Aa,$getSelection as Oa,$insertNodes as Fa,$isParagraphNode as qr,$isRangeSelection as $a,$isRootOrShadowRoot as Pa,COMMAND_PRIORITY_EDITOR as Jr}from"lexical";import{useEffect as Ba,useState as Ha}from"react";var Qr=()=>{let t=La(12),[e]=Na(),[o,r]=Ha(null),{setCreatedInlineBlock:n,uuid:i}=P(),l=va(),s="lexical-inlineBlocks-create-"+i,a;t[0]!==l||t[1]!==s?(a=ya({slug:s,depth:l}),t[0]=l,t[1]=s,t[2]=a):a=t[2];let u=a,{toggleDrawer:c}=ae(u,!0),d;t[3]!==e||t[4]!==n||t[5]!==o?(d=()=>{if(!e.hasNodes([ue]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return Ia(e.registerCommand(nt,p=>(e.update(()=>{let f=Oa()||Aa();if($a(f)){let h=Ot(p);Ra(h);let{focus:C}=f,b=C.getNode();qr(b)&&b.getTextContentSize()===0&&b.getParentOrThrow().getChildren().filter(ja).length>1&&b.remove()}}),!0),Jr),e.registerCommand(it,p=>{if(o){let h=Da(o);return!h||!mo(h)?!1:(h.setFields(p),r(null),!0)}let f=uo(p);return n?.(f),Fa([f]),Pa(f.getParentOrThrow())&&Sa(f,Ma).selectEnd(),!0},Jr))},t[3]=e,t[4]=n,t[5]=o,t[6]=d):d=t[6];let m;return t[7]!==e||t[8]!==n||t[9]!==o||t[10]!==c?(m=[e,n,o,c],t[7]=e,t[8]=n,t[9]=o,t[10]=c,t[11]=m):m=t[11],Ba(d,m),null};function ja(t){return qr(t)}var Ua=y(({featureClientSchemaMap:t,props:e,schemaPath:o})=>{let r=`${o}.lexical_internal_feature.blocks.lexical_blocks`,n=`${o}.lexical_internal_feature.blocks.lexical_inline_blocks`,i=t.blocks;if(!i)return{};let l=Object.entries(i).filter(([c])=>c.startsWith(r+".")&&!c.replace(r+".","").includes(".")).map(([,c])=>c[0]),s=Object.entries(i).filter(([c])=>c.startsWith(n+".")&&!c.replace(n+".","").includes(".")).map(([,c])=>c[0]),a=l.map(c=>c.blocks[0]).filter(c=>c!==void 0),u=s.map(c=>c.blocks[0]).filter(c=>c!==void 0);return{nodes:[ue,co],plugins:[{Component:Qr,position:"normal"}],sanitizedClientFeatureProps:e,slashMenu:{groups:[a?.length?{items:a.map(c=>({Icon:Mt(c.imageURL,c.imageAltText),key:"block-"+c.slug,keywords:["block","blocks",c.slug],label:({i18n:d})=>c?.labels?.singular?Ft(c.labels.singular,d):c?.slug,onSelect:({editor:d})=>{d.dispatchCommand(nt,{blockName:"",blockType:c.slug})}})),key:"blocks",label:({i18n:c})=>c.t("lexical:blocks:label")}:null,u?.length?{items:u.map(c=>({Icon:vt,key:"inlineBlocks-"+c.slug,keywords:["inlineBlock","inline block",c.slug],label:({i18n:d})=>c?.labels?.singular?Ft(c.labels.singular,d):c?.slug,onSelect:({editor:d})=>{d.dispatchCommand(it,{blockName:"",blockType:c.slug})}})),key:"inlineBlocks",label:({i18n:c})=>c.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[a.length?{type:"dropdown",ChildComponent:yt,items:a.map((c,d)=>({ChildComponent:Mt(c.imageURL,c.imageAltText),isActive:void 0,key:"block-"+c.slug,label:({i18n:m})=>c?.labels?.singular?Ft(c.labels.singular,m):c?.slug,onSelect:({editor:m})=>{m.dispatchCommand(nt,{blockName:"",blockType:c.slug})},order:d})),key:"blocks",order:20}:null,u?.length?{type:"dropdown",ChildComponent:vt,items:u.map((c,d)=>({ChildComponent:c.imageURL?Mt(c.imageURL,c.imageAltText):vt,isActive:void 0,key:"inlineBlock-"+c.slug,label:({i18n:m})=>c?.labels?.singular?Ft(c.labels.singular,m):c?.slug,onSelect:({editor:m})=>{m.dispatchCommand(it,{blockName:"",blockType:c.slug})},order:d})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}});import{c as Ga}from"react/compiler-runtime";import{jsx as Ie,jsxs as Ro}from"react/jsx-runtime";import{useLexicalComposerContext as Wa}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as Va,$createTextNode as Ka,$getRoot as Za,getDOMSelection as ko}from"lexical";import*as rn from"react";import{useCallback as Se,useEffect as Lo,useLayoutEffect as en,useRef as No,useState as $t}from"react";var Ya=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)},za=(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)},Xa=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 i=t.getPreviousSibling();if(Br(i)){i.splice(i.getChildrenSize(),0,[Vs(),...e]),i.select(0,0),t.remove();return}}let n=Gs();n.append(...e),t.replace(n),n.select(0,0)}};var Ur=[X([{ChildComponent:To,isActive:({selection:t})=>{if(!Zs(t))return!1;for(let e of t.getNodes())if(!jr(e)&&!jr(e.getParent()))return!1;return!0},key:"blockquote",label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Vr();Wr(e,()=>Gr())})},order:20}])],Ys=v({markdownTransformers:[Hr],nodes:[Ks],slashMenu:{groups:[Y([{Icon:To,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Vr();Wr(e,()=>Gr())})}}])]},toolbarFixed:{groups:Ur},toolbarInline:{groups:Ur}});import{getTranslation as Pt}from"@payloadcms/translations";import{jsx as wo,jsxs as zs}from"react/jsx-runtime";import"react";var vt=()=>zs("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("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"8",y:"5"}),wo("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"5",y:"11"}),wo("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"11",y:"11"})]});import{jsx as Kr}from"react/jsx-runtime";import"react";var Mt=()=>Kr("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:Kr("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 Xs}from"react/jsx-runtime";import"react";function Dt(t,e){return t?()=>Xs("img",{alt:e??"Block Image",className:"lexical-block-custom-image",src:t,style:{maxHeight:20,maxWidth:20}}):vt}import{jsx as La}from"react/jsx-runtime";import Na from"bson-objectid";import"react";import{DecoratorBlockNode as Js}from"@lexical/react/LexicalDecoratorBlockNode.js";import qs from"bson-objectid";var Je=class extends Js{__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=Qs(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 Qs(t){return new Je({fields:{...t,id:t?.id||new qs.default().toHexString()}})}import{jsx as V,jsxs as qe,Fragment as la}from"react/jsx-runtime";import{Button as Xr,Collapsible as sa,Drawer as aa,EditDepthProvider as ca,ErrorPill as ua,Form as da,formatDrawerSlug as ma,FormSubmit as pa,Pill as fa,RenderFields as ha,SectionTitle as ga,useDocumentForm as Ca,useDocumentInfo as Jr,useEditDepth as xa,useFormSubmitted as ba,useServerFunctions as _a,useTranslation as Ta}from"@payloadcms/ui";import{abortAndIgnore as Eo}from"@payloadcms/ui/shared";import{deepCopyObjectSimpleWithoutReactComponents as Ot,reduceFieldsToValues as qr}from"payload/shared";import Qe,{useCallback as ko,useEffect as Lo,useMemo as et,useRef as No}from"react";import{useLexicalComposerContext as wa}from"@lexical/react/LexicalComposerContext";import{getTranslation as Ea}from"@payloadcms/translations";import{$getNodeByKey as Ft}from"lexical";import{v4 as ka}from"uuid";import{c as ea}from"react/compiler-runtime";import{jsx as At,jsxs as ta}from"react/jsx-runtime";import{RenderFields as oa,useFormSubmitted as ra}from"@payloadcms/ui";import na,{createContext as ia}from"react";var Zr=ia({initialState:!1}),Ne=()=>na.useContext(Zr),Yr=t=>{let e=ea(13),{BlockDrawer:o,Collapsible:r,CustomBlock:n,EditButton:i,errorCount:l,formSchema:s,initialState:a,nodeKey:u,RemoveButton:c}=t,m=ra()&&l>0,p,f;e[0]!==r||e[1]!==l||e[2]!==m?(f=b=>At(r,{editButton:b.editButton,errorCount:l,fieldHasErrors:m,Label:b.Label,removeButton:b.removeButton,children:b.children}),e[0]=r,e[1]=l,e[2]=m,e[3]=f):f=e[3],p=f;let h=p,g;return e[4]!==o||e[5]!==h||e[6]!==n||e[7]!==i||e[8]!==c||e[9]!==s||e[10]!==a||e[11]!==u?(g=n?ta(Zr.Provider,{value:{BlockCollapsible:h,EditButton:i,initialState:a,nodeKey:u,RemoveButton:c},children:[n,At(o,{})]}):At(h,{children:At(oa,{fields:s,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0})}),e[4]=o,e[5]=h,e[6]=n,e[7]=i,e[8]=c,e[9]=s,e[10]=a,e[11]=u,e[12]=g):g=e[12],g};function zr({fields:t}){for(let e in t){let o=t[e];Array.isArray(o?.rows)&&"value"in o&&(o.disableFormData=!0)}return t}var te="lexical-block",Qr=t=>{let{cacheBuster:e,formData:o,nodeKey:r}=t,n=ba(),{id:i,collectionSlug:l,globalSlug:s}=Jr(),{fieldProps:{featureClientSchemaMap:a,field:u,initialLexicalFormState:c,permissions:d,readOnly:m,schemaPath:p},uuid:f}=P(),{fields:h}=Ca(),g=No(new AbortController),b=xa(),[L,D]=Qe.useState(0),x=ma({slug:`lexical-blocks-create-${f}-${o.id}`,depth:b}),{toggleDrawer:_}=ae(x),{getDocPreferences:C,setDocFieldPreferences:w}=Jr(),[R]=wa(),{getFormState:N}=_a(),S=`${p}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}.fields`,[y,E]=Qe.useState(()=>c?.[o.id]?.formState?{...c?.[o.id]?.formState,blockName:{initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName}}:!1),T=No(!1),k=No(e);Lo(()=>{T.current?(k.current!==e&&E(!1),k.current=e):T.current=!0},[e]);let[I,M]=Qe.useState(y?._components?.customComponents?.BlockLabel),[O,A]=Qe.useState(y?._components?.customComponents?.Block);Lo(()=>{let B=new AbortController;return o&&!y&&(async()=>{let{state:G}=await N({id:i,collectionSlug:l,data:o,docPermissions:{fields:!0},docPreferences:await C(),documentFormState:Ot(h),globalSlug:s,initialBlockData:o,operation:"update",renderAllFields:!0,schemaPath:S,signal:B.signal});if(G){G.blockName={initialValue:o.blockName,passesCondition:!0,valid:!0,value:o.blockName};let Z=qr(Ot(G),!0);R.update(()=>{let W=Ft(r);if(W&&tt(W)){let q=Z;q.blockType=o.blockType,W.setFields(q,!0)}}),E(G),M(G._components?.customComponents?.BlockLabel),A(G._components?.customComponents?.Block)}})(),()=>{Eo(B)}},[N,S,i,o,R,r,y,l,s,C,h]);let[H,j]=Qe.useState(c?.[o.id]?.collapsed??!1),Q=`${p}.lexical_internal_feature.blocks.lexical_blocks.${o.blockType}`,U=a.blocks?.[Q]?.[0]?.blocks?.[0],{i18n:ee,t:se}=Ta(),Ze=ko(async({formState:B,submit:re})=>{Eo(g.current);let G=new AbortController;g.current=G;let{state:Z}=await N({id:i,collectionSlug:l,docPermissions:{fields:!0},docPreferences:await C(),documentFormState:Ot(h),formState:B,globalSlug:s,initialBlockFormState:B,operation:"update",renderAllFields:!!re,schemaPath:S,signal:G.signal});if(!Z)return B;B.blockName&&(Z.blockName=B.blockName);let W=qr(zr({fields:Ot(Z)}),!0);if(setTimeout(()=>{R.update(()=>{let q=Ft(r);if(q&&tt(q)){let $e=W;$e.blockType=o.blockType,q.setFields($e,!0)}})},0),re){M(Z._components?.customComponents?.BlockLabel),A(Z._components?.customComponents?.Block);let q=0;for(let $e of Object.values(Z))$e?.valid===!1&&q++;D(q)}return Z},[N,i,l,C,s,S,o.blockType,h,R,r]);Lo(()=>()=>{Eo(g.current)},[]);let _e=ko(()=>{R.update(()=>{Ft(r)?.remove()})},[R,r]),Te=U?.labels?.singular?Ea(U.labels.singular,ee):U?.slug,Lt=ko(B=>{C().then(re=>{let Z=re?.fields?.[u.name]?.collapsed,W=Z&&Z?.length?Z:[];B?W.includes(o.id)||W.push(o.id):W.includes(o.id)&&W.splice(W.indexOf(o.id),1),w(u.name,{collapsed:W,hello:"hi"})})},[C,u.name,w,o.id]),Oe=et(()=>()=>V(Xr,{buttonStyle:"icon-label",className:`${te}__editButton`,disabled:m,el:"button",icon:"edit",onClick:B=>(B.preventDefault(),B.stopPropagation(),_(),!1),onMouseDown:B=>{B.preventDefault()},round:!0,size:"small",tooltip:se("lexical:blocks:inlineBlocks:edit",{label:Te})}),[Te,m,se,_]),Fe=et(()=>()=>V(Xr,{buttonStyle:"icon-label",className:`${te}__removeButton`,disabled:u?.admin?.readOnly||!1,icon:"x",onClick:B=>{B.preventDefault(),_e()},round:!0,tooltip:"Remove Block"}),[u?.admin?.readOnly,_e]),po=et(()=>({children:B,disableBlockName:re,editButton:G,errorCount:Z,fieldHasErrors:W,Label:q,removeButton:$e})=>V("div",{className:te+" "+te+"-"+o.blockType,children:V(sa,{className:[`${te}__row`,W?`${te}__row--has-errors`:`${te}__row--no-errors`].join(" "),collapsibleStyle:W?"error":"default",header:qe("div",{className:`${te}__block-header`,children:[q??I?q??I:qe("div",{children:[V(fa,{className:`${te}__block-pill ${te}__block-pill-${o?.blockType}`,pillStyle:"white",children:Te??o?.blockType}),!re&&V(ga,{path:"blockName",readOnly:u?.admin?.readOnly||!1}),W&&V(ua,{count:Z??0,i18n:ee,withMessage:!0})]}),qe("div",{children:[O&&G!==!1||!O&&G?V(Oe,{}):null,$e!==!1&&R.isEditable()?V(Fe,{}):null]})]}),isCollapsed:H,onToggle:Sr=>{Lt(Sr),j(Sr)},children:B},0)}),[O,I,Oe,Fe,Te,R,o.blockType,ee,H,Lt,u?.admin?.readOnly]),Nt=U?.fields??[],Rr=et(()=>()=>V(ca,{children:V(aa,{className:"",slug:x,title:se(`lexical:blocks:inlineBlocks:${o?.id?"edit":"create"}`,{label:Te??se("lexical:blocks:inlineBlocks:label")}),children:y?qe(la,{children:[V(ha,{fields:Nt,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:S,permissions:d,readOnly:!1}),V(pa,{programmaticSubmit:!0,children:se("fields:saveChanges")})]}):null})}),[y,x,Te,se,U?.fields,S,d]),Ss=et(()=>y?V(da,{beforeSubmit:[async({formState:B})=>await Ze({formState:B,submit:!0})],fields:Nt,initialState:y,onChange:[Ze],onSubmit:(B,re)=>{re.blockType=o.blockType,R.update(()=>{let G=Ft(r);G&&tt(G)&&G.setFields(re,!0)}),_()},submitted:n,uuid:ka(),children:V(Yr,{baseClass:te,BlockDrawer:Rr,Collapsible:po,CustomBlock:O,EditButton:Oe,errorCount:L,formSchema:Nt,initialState:y,nodeKey:r,RemoveButton:Fe})}):null,[po,Rr,O,Nt,Fe,Oe,R,L,_,U?.fields,y,r,Ze,n]);return U?Ss:V(po,{disableBlockName:!0,fieldHasErrors:!0,children:qe("div",{className:"lexical-block-not-found",children:["Error: Block '",o.blockType,"' not found in the config but exists in the lexical data"]})})};var ue=class extends Je{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=$t(e.fields);return o.setFormat(e.format),o}decorate(e,o){return La(Qr,{cacheBuster:this.getCacheBuster(),formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function $t(t){return new ue({fields:{...t,id:t?.id||new Na.default().toHexString()}})}function tt(t){return t instanceof ue}import{createCommand as en}from"lexical";var ot=en("INSERT_BLOCK_COMMAND"),rt=en("INSERT_INLINE_BLOCK_COMMAND");import{c as Ra}from"react/compiler-runtime";import{useLexicalComposerContext as Sa}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Ia,$wrapNodeInElement as ya,mergeRegister as va}from"@lexical/utils";import{formatDrawerSlug as Ma,useEditDepth as Da}from"@payloadcms/ui";import{$createParagraphNode as Aa,$getNodeByKey as Oa,$getPreviousSelection as Fa,$getSelection as $a,$insertNodes as Pa,$isParagraphNode as on,$isRangeSelection as Ba,$isRootOrShadowRoot as Ha,COMMAND_PRIORITY_EDITOR as tn}from"lexical";import{useEffect as ja,useState as Ua}from"react";var rn=()=>{let t=Ra(12),[e]=Sa(),[o,r]=Ua(null),{setCreatedInlineBlock:n,uuid:i}=P(),l=Da(),s="lexical-inlineBlocks-create-"+i,a;t[0]!==l||t[1]!==s?(a=Ma({slug:s,depth:l}),t[0]=l,t[1]=s,t[2]=a):a=t[2];let u=a,{toggleDrawer:c}=ae(u,!0),d;t[3]!==e||t[4]!==n||t[5]!==o?(d=()=>{if(!e.hasNodes([ue]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return va(e.registerCommand(ot,p=>(e.update(()=>{let f=$a()||Fa();if(Ba(f)){let h=$t(p);Ia(h);let{focus:g}=f,b=g.getNode();on(b)&&b.getTextContentSize()===0&&b.getParentOrThrow().getChildren().filter(Ga).length>1&&b.remove()}}),!0),tn),e.registerCommand(rt,p=>{if(o){let h=Oa(o);return!h||!go(h)?!1:(h.setFields(p),r(null),!0)}let f=ho(p);return n?.(f),Pa([f]),Ha(f.getParentOrThrow())&&ya(f,Aa).selectEnd(),!0},tn))},t[3]=e,t[4]=n,t[5]=o,t[6]=d):d=t[6];let m;return t[7]!==e||t[8]!==n||t[9]!==o||t[10]!==c?(m=[e,n,o,c],t[7]=e,t[8]=n,t[9]=o,t[10]=c,t[11]=m):m=t[11],ja(d,m),null};function Ga(t){return on(t)}var Wa=v(({featureClientSchemaMap:t,props:e,schemaPath:o})=>{let r=`${o}.lexical_internal_feature.blocks.lexical_blocks`,n=`${o}.lexical_internal_feature.blocks.lexical_inline_blocks`,i=t.blocks;if(!i)return{};let l=Object.entries(i).filter(([c])=>c.startsWith(r+".")&&!c.replace(r+".","").includes(".")).map(([,c])=>c[0]),s=Object.entries(i).filter(([c])=>c.startsWith(n+".")&&!c.replace(n+".","").includes(".")).map(([,c])=>c[0]),a=l.map(c=>c.blocks[0]).filter(c=>c!==void 0),u=s.map(c=>c.blocks[0]).filter(c=>c!==void 0);return{nodes:[ue,fo],plugins:[{Component:rn,position:"normal"}],sanitizedClientFeatureProps:e,slashMenu:{groups:[a?.length?{items:a.map(c=>({Icon:Dt(c.imageURL,c.imageAltText),key:"block-"+c.slug,keywords:["block","blocks",c.slug],label:({i18n:d})=>c?.labels?.singular?Pt(c.labels.singular,d):c?.slug,onSelect:({editor:d})=>{d.dispatchCommand(ot,{blockName:"",blockType:c.slug})}})),key:"blocks",label:({i18n:c})=>c.t("lexical:blocks:label")}:null,u?.length?{items:u.map(c=>({Icon:Mt,key:"inlineBlocks-"+c.slug,keywords:["inlineBlock","inline block",c.slug],label:({i18n:d})=>c?.labels?.singular?Pt(c.labels.singular,d):c?.slug,onSelect:({editor:d})=>{d.dispatchCommand(rt,{blockName:"",blockType:c.slug})}})),key:"inlineBlocks",label:({i18n:c})=>c.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[a.length?{type:"dropdown",ChildComponent:vt,items:a.map((c,d)=>({ChildComponent:Dt(c.imageURL,c.imageAltText),isActive:void 0,key:"block-"+c.slug,label:({i18n:m})=>c?.labels?.singular?Pt(c.labels.singular,m):c?.slug,onSelect:({editor:m})=>{m.dispatchCommand(ot,{blockName:"",blockType:c.slug})},order:d})),key:"blocks",order:20}:null,u?.length?{type:"dropdown",ChildComponent:Mt,items:u.map((c,d)=>({ChildComponent:c.imageURL?Dt(c.imageURL,c.imageAltText):Mt,isActive:void 0,key:"inlineBlock-"+c.slug,label:({i18n:m})=>c?.labels?.singular?Pt(c.labels.singular,m):c?.slug,onSelect:({editor:m})=>{m.dispatchCommand(rt,{blockName:"",blockType:c.slug})},order:d})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}});import{c as Va}from"react/compiler-runtime";import{jsx as Se,jsxs as yo}from"react/jsx-runtime";import{useLexicalComposerContext as Ka}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as Za,$createTextNode as Ya,$getRoot as za,getDOMSelection as Ro}from"lexical";import*as an from"react";import{useCallback as Re,useEffect as So,useLayoutEffect as nn,useRef as Io,useState as Bt}from"react";var Xa=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)},Ja=(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)},qa=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 Qa(t){return t.key.toLowerCase()==="a"&&(Ir?t.metaKey:t.ctrlKey)}function ec(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 ln(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 sn=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Delete","Enter","Escape"]);function tc(t){let[e,o]=Bt([]),[r,n]=Bt(!1),[,i]=Bt(""),[l,s]=Bt(""),a=Io(null),u=Io(!1),c=Io(null),d=Re(()=>t,[t]),m=Re(()=>{let x=t.getRootElement(),_=Ro(t._window);return x==null||_==null||_.anchorNode==null||_.focusNode==null||!x.contains(_.anchorNode)||!x.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(qa).join(`
|
|
31
31
|
`)}
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
|
-
`},[t,e]),p=Se((x,T)=>{o(g=>{let w=e.length-1,N=e[w];if(N&&N.name===x){if(x==="type")return[...e.slice(0,w),{...N,value:N.value+T}];if(N.value===T)return[...e.slice(0,w),{...N,count:N.count+1}]}return[...g,{name:x,count:1,value:T}]})},[e,o]);en(()=>{let x=g=>{if(!r)return;let w=g.key;Ja(g)?p("selectAll",""):on.has(w)?p("press",g.key):[...w].length>1?p("keydown",g.key):p("type",g.key)},T=g=>{if(!r)return;let w=g.key;!on.has(w)&&[...w].length>1&&p("keyup",g.key)};return t.registerRootListener((g,w)=>{w!==null&&(w.removeEventListener("keydown",x),w.removeEventListener("keyup",T)),g!==null&&(g.addEventListener("keydown",x),g.addEventListener("keyup",T))})},[t,r,p]),en(()=>{c.current&&c.current.scrollTo(0,c.current.scrollHeight)},[m]),Lo(()=>{if(e){let x=m();x!==null&&s(x),c.current&&c.current.scrollTo(0,c.current.scrollHeight)}},[m,e]),Lo(()=>t.registerUpdateListener(({dirtyElements:T,dirtyLeaves:g,editorState:w})=>{if(!r)return;let N=w._selection,L=a.current,S=u.current;if(L!==N){if(g.size===0&&T.size===0&&!S){let E=ko(t._window);if(E&&(E.anchorNode==null||E.focusNode==null))return}a.current=N}u.current=!1;let I=m();I!==null&&s(I)}),[t,m,r,p]),Lo(()=>r?t.registerUpdateListener(()=>{let T=t.getRootElement();T!==null&&i(T?.innerHTML)}):void 0,[t,r]);let f=Se(x=>{r||(x.update(()=>{let T=Za();T.clear();let g=Ka();T.append(Va().append(g)),g.select()}),o([])),n(T=>!T)},[r]),h=Se(()=>{if(!r)return;let x=ko(t._window);if(x===null||x.anchorNode==null||x.focusNode==null)return;let{anchorNode:T,anchorOffset:g,focusNode:w,focusOffset:N}=qa(x),L=d().getRootElement(),S;T!==null&&(S=tn(T,L));let I;w!==null&&(I=tn(w,L)),p("snapshot",{anchorNode:T,anchorOffset:g,anchorPath:S,focusNode:w,focusOffset:N,focusPath:I})},[p,r,d]),C=Se(()=>{Ya(m())},[m]),b=Se(()=>{za("test.js",m())},[m]);return[Ie("button",{className:`editor-dev-button ${r?"active":""}`,id:"test-recorder-button",onClick:x=>{f(d()),x.preventDefault()},title:r?"Disable test recorder":"Enable test recorder",type:"button",children:r?"Disable test recorder":"Enable test recorder"}),r?Ro("div",{className:"test-recorder-output",children:[Ro("div",{className:"test-recorder-toolbar",children:[Ie("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:x=>{h(),x.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Ie("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:x=>{C(),x.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Ie("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:x=>{b(),x.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Ie("pre",{id:"test-recorder",ref:c,children:l})]}):null]}var nn=()=>{let t=Ga(3),[e]=Wa(),[o,r]=Qa(e),n;return t[0]!==o||t[1]!==r?(n=Ro(rn.Fragment,{children:[Ie("p",{children:"HI"}),o,r,Ie("p",{children:"DONE"})]}),t[0]=o,t[1]=r,t[2]=n):n=t[2],n};var ec=y({plugins:[{Component:nn,position:"bottom"}]});import{c as tc}from"react/compiler-runtime";import{jsx as oc}from"react/jsx-runtime";import{useLexicalComposerContext as rc}from"@lexical/react/LexicalComposerContext.js";import{TreeView as nc}from"@lexical/react/LexicalTreeView.js";import"react";var ln=()=>{let t=tc(2),[e]=rc(),o;return t[0]!==e?(o=oc(nc,{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 ic=y({plugins:[{Component:ln,position:"bottom"}]});import{$isTableSelection as lc}from"@lexical/table";import{$isRangeSelection as sc,FORMAT_TEXT_COMMAND as ac}from"lexical";import{jsx as sn}from"react/jsx-runtime";import"react";var an=()=>sn("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:sn("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 K=t=>({type:"buttons",items:t,key:"format",order:40});var cn={type:"text-format",format:["bold","italic"],tag:"***"},un={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},dn={type:"text-format",format:["bold"],tag:"**"},mn={type:"text-format",format:["bold"],intraword:!1,tag:"__"};var pn=[K([{ChildComponent:an,isActive:({selection:t})=>sc(t)||lc(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(ac,"bold")},order:1}])],cc=y(({featureProviderMap:t})=>{let e=[dn,mn];return t.get("italic")&&e.push(un,cn),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:pn},toolbarInline:{groups:pn}}});import{$isTableSelection as dc}from"@lexical/table";import{$isRangeSelection as mc,FORMAT_TEXT_COMMAND as pc}from"lexical";import{jsx as fn,jsxs as uc}from"react/jsx-runtime";import"react";var hn=()=>uc("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:[fn("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),fn("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]});var gn={type:"text-format",format:["code"],tag:"`"};var Cn=[K([{ChildComponent:hn,isActive:({selection:t})=>mc(t)||dc(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(pc,"code")},order:7}])],fc=y({enableFormats:["code"],markdownTransformers:[gn],toolbarFixed:{groups:Cn},toolbarInline:{groups:Cn}});import{$isTableSelection as hc}from"@lexical/table";import{$isRangeSelection as gc,FORMAT_TEXT_COMMAND as Cc}from"lexical";import{jsx as xn}from"react/jsx-runtime";import"react";var bn=()=>xn("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:xn("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:"*"},Tn={type:"text-format",format:["italic"],intraword:!1,tag:"_"};var wn=[K([{ChildComponent:bn,isActive:({selection:t})=>gc(t)||hc(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(Cc,"italic")},order:2}])],xc=y({enableFormats:["italic"],markdownTransformers:[_n,Tn],toolbarFixed:{groups:wn},toolbarInline:{groups:wn}});import{$isTableSelection as _c}from"@lexical/table";import{$isRangeSelection as Tc,FORMAT_TEXT_COMMAND as wc}from"lexical";import{jsx as En,jsxs as bc}from"react/jsx-runtime";import"react";var kn=()=>bc("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:[En("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"}),En("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]});var Ln={type:"text-format",format:["strikethrough"],tag:"~~"};var Nn=[K([{ChildComponent:kn,isActive:({selection:t})=>Tc(t)||_c(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(wc,"strikethrough")},order:4}])],Ec=y({enableFormats:["strikethrough"],markdownTransformers:[Ln],toolbarFixed:{groups:Nn},toolbarInline:{groups:Nn}});import{$isTableSelection as kc}from"@lexical/table";import{$isRangeSelection as Lc,FORMAT_TEXT_COMMAND as Nc}from"lexical";import{jsx as Rn}from"react/jsx-runtime";import"react";var Sn=()=>Rn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Rn("path",{d:"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 In=[K([{ChildComponent:Sn,isActive:({selection:t})=>Lc(t)||kc(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(Nc,"subscript")},order:5}])],Rc=y({enableFormats:["subscript"],toolbarFixed:{groups:In},toolbarInline:{groups:In}});import{$isTableSelection as Sc}from"@lexical/table";import{$isRangeSelection as Ic,FORMAT_TEXT_COMMAND as yc}from"lexical";import{jsx as yn}from"react/jsx-runtime";import"react";var vn=()=>yn("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:yn("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 Mn=[K([{ChildComponent:vn,isActive:({selection:t})=>Ic(t)||Sc(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(yc,"superscript")},order:6}])],vc=y({enableFormats:["superscript"],toolbarFixed:{groups:Mn},toolbarInline:{groups:Mn}});import{$isTableSelection as Dc}from"@lexical/table";import{$isRangeSelection as Ac,FORMAT_TEXT_COMMAND as Oc}from"lexical";import{jsx as Dn,jsxs as Mc}from"react/jsx-runtime";import"react";var An=()=>Mc("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:"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"}),Dn("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]});var On=[K([{ChildComponent:An,isActive:({selection:t})=>Ac(t)||Dc(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(Oc,"underline")},order:3}])],Fc=y({enableFormats:["underline"],toolbarFixed:{groups:On},toolbarInline:{groups:On}});import{$createHeadingNode as Hc,$isHeadingNode as zn,HeadingNode as jc}from"@lexical/rich-text";import{$setBlocksType as Uc}from"@lexical/selection";import{$getSelection as Gc,$isRangeSelection as Wc}from"lexical";import{jsx as Fn}from"react/jsx-runtime";import"react";var $n=()=>Fn("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:Fn("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 Pn}from"react/jsx-runtime";import"react";var Bn=()=>Pn("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:Pn("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 Hn}from"react/jsx-runtime";import"react";var jn=()=>Hn("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:Hn("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 Un}from"react/jsx-runtime";import"react";var Gn=()=>Un("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:Un("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 Wn}from"react/jsx-runtime";import"react";var Vn=()=>Wn("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:Wn("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 Kn}from"react/jsx-runtime";import"react";var Zn=()=>Kn("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:Kn("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 $c,$isHeadingNode as Pc,HeadingNode as Bc}from"@lexical/rich-text";var So=t=>(e,o,r)=>{let n=t(r);n&&(n.append(...o),e.replace(n),n.select(0,0))};var Yn=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`,r=new RegExp(o);return{type:"element",dependencies:[Bc],export:(n,i)=>{if(!Pc(n))return null;let l=Number(n.getTag().slice(1));return"#".repeat(l)+" "+i(n)},regExp:r,replace:So(n=>{let i="h"+n[1]?.length;return $c(i)})}};var Xn=t=>{let e=Gc();Uc(e,()=>Hc(t))},Jn={h1:$n,h2:Bn,h3:jn,h4:Gn,h5:Vn,h6:Zn},Vc=y(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[z(e.map((r,n)=>({ChildComponent:Jn[r],isActive:({selection:i})=>{if(!Wc(i))return!1;for(let l of i.getNodes()){if(zn(l)&&l.getTag()===r)continue;let s=l.getParent();if(!(zn(s)&&s.getTag()===r))return!1}return!0},key:r,label:({i18n:i})=>i.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:i})=>{i.update(()=>{Xn(r)})},order:n+2})))];return{markdownTransformers:[Yn(e)],nodes:[jc],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[V(e.map(r=>({Icon:Jn[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(()=>{Xn(r)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}});import{$isNodeSelection as su}from"lexical";import{jsx as qn}from"react/jsx-runtime";import"react";var Io=()=>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("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})});import{jsx as Qn,jsxs as Kc}from"react/jsx-runtime";import"react";var ei=()=>Kc("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Qn("path",{d:"M5 10h10",stroke:"currentColor"}),Qn("path",{d:"M10 15V5",stroke:"currentColor"})]});var de=t=>({type:"dropdown",ChildComponent:ei,items:t,key:"add",order:10});import{addClassNamesToElement as Zc}from"@lexical/utils";import{$applyNodeReplacement as Yc,createCommand as zc,DecoratorNode as Xc}from"lexical";var st=zc("INSERT_HORIZONTAL_RULE_COMMAND"),lt=class extends Xc{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:Jc,priority:0})}}static importJSON(e){return ti()}createDOM(e){let o=document.createElement("hr");return Zc(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 Jc(){return{node:ti()}}function ti(){return Yc(new lt)}import{$applyNodeReplacement as qc}from"lexical";import"react";var Ee=class extends lt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return at()}decorate(){return null}exportJSON(){return super.exportJSON()}};function at(){return qc(new Ee)}function Pt(t){return t instanceof Ee}var oi={type:"element",dependencies:[Ee],export:(t,e)=>Pt(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=at();e&&t.replace(e)}};import{c as Qc}from"react/compiler-runtime";import{useLexicalComposerContext as eu}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as tu}from"@lexical/utils";import{$getSelection as ou,$isRangeSelection as ru,COMMAND_PRIORITY_EDITOR as nu}from"lexical";import{useEffect as iu}from"react";var ri=()=>{let t=Qc(3),[e]=eu(),o,r;return t[0]!==e?(o=()=>e.registerCommand(st,lu,nu),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),iu(o,r),null};function lu(t){let e=ou();if(!ru(e))return!1;if(e.focus.getNode()!==null){let r=at();tu(r)}return!0}var au=y({markdownTransformers:[oi],nodes:[Ee],plugins:[{Component:ri,position:"normal"}],slashMenu:{groups:[V([{Icon:Io,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(st,void 0)}}])]},toolbarFixed:{groups:[de([{ChildComponent:Io,isActive:({selection:t})=>{if(!su(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Pt(e)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(st,void 0)}}])]}});import{TabIndentationPlugin as du}from"@lexical/react/LexicalTabIndentationPlugin";import{INDENT_CONTENT_COMMAND as mu,OUTDENT_CONTENT_COMMAND as pu}from"lexical";import{jsx as Bt,jsxs as cu}from"react/jsx-runtime";import"react";var ni=()=>cu("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:[Bt("path",{d:"M2.5 5H10.5",stroke:"currentColor",strokeWidth:"1.5"}),Bt("path",{d:"M2.5 10H10.5",stroke:"currentColor",strokeWidth:"1.5"}),Bt("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Bt("path",{d:"M12.25 7.25L17.25 3.75V10.75L12.25 7.25Z",fill:"currentColor"})]});import{jsx as Ht,jsxs as uu}from"react/jsx-runtime";import"react";var ii=()=>uu("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:[Ht("path",{d:"M17.5 5H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Ht("path",{d:"M17.5 10H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Ht("path",{d:"M17.5 15H2.5",stroke:"currentColor",strokeWidth:"1.5"}),Ht("path",{d:"M7.75 7.25L2.75 3.75V10.75L7.75 7.25Z",fill:"currentColor"})]});var li=t=>({type:"buttons",items:t,key:"indent",order:35});var si=[li([{ChildComponent:ni,isActive:()=>!1,isEnabled:({selection:t})=>{if(!t||!t?.getNodes()?.length)return!1;for(let e of t.getNodes()){let o=e.getParentOrThrow();if("__indent"in e&&e.__indent>0||"__indent"in o&&o.__indent>0)return!0}return!1},key:"indentDecrease",label:({i18n:t})=>t.t("lexical:indent:decreaseLabel"),onSelect:({editor:t})=>{t.dispatchCommand(pu,void 0)},order:1},{ChildComponent:ii,isActive:()=>!1,key:"indentIncrease",label:({i18n:t})=>t.t("lexical:indent:increaseLabel"),onSelect:({editor:t})=>{t.dispatchCommand(mu,void 0)},order:2}])],fu=y({plugins:[{Component:du,position:"normal"}],toolbarFixed:{groups:si},toolbarInline:{groups:si}});import{$findMatchingParent as Nd}from"@lexical/utils";import{$getSelection as Po,$isRangeSelection as Pi}from"lexical";import{jsx as ai}from"react/jsx-runtime";import"react";var ci=()=>ai("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:ai("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 ui}from"@lexical/selection";function je(t){let{anchor:e}=t,{focus:o}=t,r=t.anchor.getNode(),n=t.focus.getNode();return r===n?r:t.isBackward()?ui(o)?r:n:ui(e)?r:n}var yo=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as Lu}from"lexical";import{addClassNamesToElement as hu,isHTMLAnchorElement as gu}from"@lexical/utils";import Do from"bson-objectid";import{$applyNodeReplacement as Cu,$createTextNode as di,$getSelection as xu,$isElementNode as mi,$isRangeSelection as Mo,createCommand as bu,ElementNode as _u}from"lexical";var Tu=new Set(["http:","https:","mailto:","sms:","tel:"]),X=class t extends _u{__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:wu,priority:1})}}static importJSON(e){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 Do.default().toHexString(),e.version=3);let o=me({id:e.id,fields:e.fields});return o.setFormat(e.format),o.setIndent(e.indent),o.setDirection(e.direction),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=vo(o.rel,"add","noopener")),hu(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(!Mo(o))return!1;let n=o.anchor.getNode(),i=o.focus.getNode();return this.isParentOf(n)&&this.isParentOf(i)&&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(mi(r)){let n=me({fields:this.__fields});return r.append(n),n}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!Tu.has(o.protocol))return"about:blank"}catch{return"https://"}return e}setFields(e){let o=this.getWritable();o.__fields=e}updateDOM(e,o,r){let n=this.__fields?.url,i=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=""),i!==e.__fields?.newTab&&(i??!1?(o.target="_blank",this.__fields?.linkType==="custom"&&(o.rel=vo(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=vo(o.rel,"remove","noopener"))),!1}};function wu(t){let e=null;if(gu(t)){let o=t.textContent;o!==null&&o!==""&&(e=me({id:new Do.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function me({id:t,fields:e}){return Cu(new X({id:t??new Do.default().toHexString(),fields:e}))}function W(t){return t instanceof X}var ne=bu("TOGGLE_LINK_COMMAND");function Ao(t){let e=xu();if(!Mo(e)&&(t===null||!t.selectedNodes?.length))return;let o=Mo(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(i=>{let l=i.getParent();W(l)&&(l.getChildren().forEach(a=>{l.insertBefore(a)}),l.remove())});return}if(o?.length===1){let i=o[0],l=W(i)?i:Eu(i);if(l!==null){l.setFields(t.fields),t.text!=null&&t.text!==l.getTextContent()&&(l.append(di(t.text)),l.getChildren().forEach(s=>{s!==l.getLastChild()&&s.remove()}));return}}let r=null,n=null;o?.forEach(i=>{let l=i.getParent();if(!(l===n||l===null||mi(i)&&!i.isInline())){if(W(l)){n=l,l.setFields(t.fields),t.text!=null&&t.text!==l.getTextContent()&&(l.append(di(t.text)),l.getChildren().forEach(s=>{s!==l.getLastChild()&&s.remove()}));return}if(l.is(r)||(r=l,n=me({fields:t.fields}),W(l)?i.getPreviousSibling()===null?l.insertBefore(n):l.insertAfter(n):i.insertBefore(n)),W(i)){if(i.is(n))return;if(n!==null){let s=i.getChildren();n.append(...s)}i.remove();return}n!==null&&n.append(i)}})}function Eu(t){return ku(t,e=>W(e))}function ku(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function vo(t,e,o){let r,n=`${t}`;if(e==="add"){if(n.includes(o)){let i=new RegExp(o,"g");n=n.replace(i,"").trim()}n=n.trim(),r=n.length===0?`${o}`:`${n} ${o}`}else{let i=new RegExp(o,"g");r=n.replace(i,"").trim()}return r}var pi={type:"text-match",dependencies:[X],export:(t,e)=>{if(!W(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=me({fields:{doc:null,linkType:"custom",newTab:!1,url:r}}),i=Lu(o);return i.setFormat(t.getFormat()),n.append(i),t.replace(n),i},trigger:")"};import{$applyNodeReplacement as Nu,$isElementNode as Ru}from"lexical";var pe=class t extends X{static clone(e){return new t({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){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);let o=ct({fields:e.fields});return o.setFormat(e.format),o.setIndent(e.indent),o.setDirection(e.direction),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(Ru(r)){let n=ct({fields:this.__fields});return r.append(n),n}return null}};function ct({fields:t}){return Nu(new pe({id:"",fields:t}))}function fe(t){return t instanceof pe}import{c as Su}from"react/compiler-runtime";import{useLexicalComposerContext as Iu}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as yu}from"@lexical/utils";import{$createTextNode as fi,$getSelection as vu,$isElementNode as gi,$isLineBreakNode as Ci,$isNodeSelection as Mu,$isRangeSelection as Du,$isTextNode as ut,TextNode as Au}from"lexical";import{useEffect as Ou}from"react";function hi(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 xi(t,e){for(let o=0;o<e.length;o++){let r=e[o](t);if(r!=null)return r}return null}var Fu=/[.,;\s]/;function Ut(t){return Fu.test(t)}function bi(t){return Ut(t[t.length-1])}function Fo(t){return Ut(t[0])}function $u(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function _i(t){let e=t.getPreviousSibling();return gi(e)&&(e=e.getLastDescendant()),e===null||Ci(e)||ut(e)&&bi(e.getTextContent())}function Ti(t){let e=t.getNextSibling();return gi(e)&&(e=e.getFirstDescendant()),e===null||Ci(e)||ut(e)&&Fo(e.getTextContent())}function Pu(t,e,o,r){return(t>0?Ut(o[t-1]):_i(r[0]))?e<o.length?Ut(o[e]):Ti(r[r.length-1]):!1}function Bu(t,e,o){let r=[],n=[],i=[],l=0,s=0,a=[...t];for(;a.length>0;){let u=a[0],d=u.getTextContent().length,m=s;s+d<=e?(r.push(u),l+=d):m>=o?i.push(u):n.push(u),s+=d,a.shift()}return[l,r,n,i]}function Hu(t,e,o,r){let n={linkType:"custom",url:r.url,...r.fields},i=ct({fields:n});if(t.length===1){let l=t[0],s;e===0?[s,l]=l.splitText(o):[,s,l]=l.splitText(e,o);let a=fi(r.text);return a.setFormat(s.getFormat()),a.setDetail(s.getDetail()),a.setStyle(s.getStyle()),i.append(a),s.replace(i),l}else if(t.length>1){let l=t[0],s=l.getTextContent().length,a;e===0?a=l:[,a]=l.splitText(e);let u=[],c;for(let f=1;f<t.length;f++){let h=t[f],b=h.getTextContent().length,k=s,v=s+b;if(k<o)if(v<=o)u.push(h);else{let[x,T]=h.splitText(o-k);u.push(x),c=T}s+=b}let d=vu(),m=d?d.getNodes().find(ut):void 0,p=fi(a.getTextContent());return p.setFormat(a.getFormat()),p.setDetail(a.getDetail()),p.setStyle(a.getStyle()),i.append(p,...u),m&&m===a&&(Du(d)?p.select(d.anchor.offset,d.focus.offset):Mu(d)&&p.select(0,p.getTextContent().length)),a.replace(i),c}}function ju(t,e,o){let r=[...t],n=r.map(a=>a.getTextContent()).join(""),i=n,l,s=0;for(;(l=xi(i,e))!=null&&l!==null;){let a=l.index,u=l.length,c=a+u;if(Pu(s+a,s+c,n,r)){let[m,,p,f]=Bu(r,s+a,s+c),h=s+a-m,C=s+c-m,b=Hu(p,h,C,l);r=b?[b,...f]:f,o(l.url,null),s=0}else s+=c;i=i.substring(c)}}function Oo(t,e,o){let r=t.getChildren(),n=r.length;for(let a=0;a<n;a++){let u=r[a];if(!ut(u)||!u.isSimpleText()){jt(t),o(null,t.getFields()?.url??null);return}}let i=t.getTextContent(),l=xi(i,e);if(l===null||l.text!==i){jt(t),o(null,t.getFields()?.url??null);return}if(!_i(t)||!Ti(t)){jt(t),o(null,t.getFields()?.url??null);return}let s=t.getFields()?.url;if(s!==l?.url){let a=t.getFields();a.url=l?.url,t.setFields(a),o(l.url,s??null)}}function Uu(t,e,o){let r=t.getPreviousSibling(),n=t.getNextSibling(),i=t.getTextContent();if(fe(r)){let l=r.getFields()?.url?r.getFields()?.url?.startsWith("mailto:")??!1:!1;(!Fo(i)||$u(i,l))&&(r.append(t),Oo(r,e,o),o(null,r.getFields()?.url??null))}fe(n)&&!bi(i)&&(jt(n),Oo(n,e,o),o(null,n.getFields()?.url??null))}function jt(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 Gu(t){let e=[t],o=t.getNextSibling();for(;o!==null&&ut(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function Wu(t,e,o){let r=Su(5),n,i;r[0]!==t||r[1]!==e||r[2]!==o?(n=()=>{if(!t.hasNodes([pe]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let l=(s,a)=>{o?.(s,a)};return yu(t.registerNodeTransform(Au,s=>{let a=s.getParentOrThrow(),u=s.getPreviousSibling();if(fe(a))Oo(a,e,l);else if(!W(a)){if(s.isSimpleText()&&(Fo(s.getTextContent())||!fe(u))){let c=Gu(s);ju(c,e,l)}Uu(s,e,l)}}))},i=[t,e,o],r[0]=t,r[1]=e,r[2]=o,r[3]=n,r[4]=i):(n=r[3],i=r[4]),Ou(n,i)}var Vu=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,Ku=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,Zu=[hi(Vu,t=>t.startsWith("http")?t:`https://${t}`),hi(Ku,t=>`mailto:${t}`)],wi=()=>{let[t]=Iu();return Wu(t,Zu),null};import{jsx as Yu}from"react/jsx-runtime";import{ClickableLinkPlugin as zu}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var Ei=()=>Yu(zu,{});import{jsx as pd}from"react/jsx-runtime";import"react";import{createPortal as fd}from"react-dom";import{jsx as he,jsxs as dt,Fragment as Ju}from"react/jsx-runtime";import{useLexicalComposerContext as qu}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as ki,mergeRegister as Li}from"@lexical/utils";import{getTranslation as $o}from"@payloadcms/translations";import{CloseMenuIcon as Qu,EditIcon as ed,ExternalLinkIcon as Ni,formatDrawerSlug as td,useConfig as od,useEditDepth as rd,useLocale as nd,useTranslation as id}from"@payloadcms/ui";import{requests as ld}from"@payloadcms/ui/shared";import{$getSelection as Ri,$isLineBreakNode as sd,$isRangeSelection as Si,COMMAND_PRIORITY_HIGH as ad,COMMAND_PRIORITY_LOW as Ii,getDOMSelection as cd,KEY_ESCAPE_COMMAND as ud,SELECTION_CHANGE_COMMAND as dd}from"lexical";import yi,{useCallback as vi,useEffect as Vt,useRef as md,useState as ye}from"react";function Gt(t,e,o,r=10,n=5){let i=o.parentElement;if(t===null||i==null){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let l=e.getBoundingClientRect(),s=o.getBoundingClientRect(),a=i.getBoundingClientRect(),u=t.top-r,c=t.left-n;u<a.top&&(u+=l.height+t.height+r*2),c+l.width>a.right&&(c=a.right-l.width-n),u-=s.top,c-=s.left,e.style.opacity="1",e.style.transform=`translate(${c}px, ${u}px)`}import{createCommand as Xu}from"lexical";var Wt=Xu("TOGGLE_LINK_WITH_MODAL_COMMAND");function Mi(t){t.preventDefault()}function Di({anchorElem:t}){let[e]=qu(),[o,r]=ye(),n=md(null),[i,l]=ye(null),[s,a]=ye(null),{fieldProps:{schemaPath:u},uuid:c}=P(),{config:d,getEntityConfig:m}=od(),{i18n:p,t:f}=id(),[h,C]=ye(),b=rd(),[k,v]=ye(!1),[x,T]=ye([]),g=nd(),[w,N]=ye(!1),L=td({slug:"lexical-rich-text-link-"+c,depth:b}),{toggleDrawer:S}=ae(L),I=vi(()=>{v(!1),n&&n.current&&(n.current.style.opacity="0",n.current.style.transform="translate(-10000px, -10000px)"),N(!1),l(null),a(null),T([]),C(void 0)},[v,l,a,T]),E=vi(()=>{let _=Ri(),R;if(!Si(_)||!_){I();return}let M=je(_);R=e.getElementByKey(M.getKey())?.getBoundingClientRect();let D=ki(M,W),F=_.getNodes().filter(j=>!sd(j)).find(j=>{let q=ki(j,W);return D&&!D.is(q)||q&&!q.is(D)});if(D==null||F){I();return}r(D);let A=D.getFields(),H={...A,id:D.getID(),text:D.getTextContent()};if(A?.linkType==="custom")l(A?.url??null),a(null);else{l(`${d.routes.admin==="/"?"":d.routes.admin}/collections/${A?.doc?.relationTo}/${A?.doc?.value}`);let j=A?.doc?.relationTo?m({collectionSlug:A?.doc?.relationTo}):void 0;if(!j)a(A?.label?String(A?.label):null),l(A?.url?String(A?.url):null);else{let q=typeof A.doc?.value=="object"?A.doc.value.id:A.doc?.value,ze=A.doc?.relationTo;if(!q||!ze)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let _e=f("fields:linkedTo",{label:`${$o(j.labels.singular,p)} - ${f("lexical:link:loadingWithEllipsis",p)}`}).replace(/<[^>]*>?/g,"");a(_e),ld.get(`${d.serverURL}${d.routes.api}/${ze}/${q}`,{headers:{"Accept-Language":p.language},params:{depth:0,locale:g?.code}}).then(async Te=>{if(!Te.ok)throw new Error(`HTTP error! Status: ${Te.status}`);let Fe=await Te.json(),$e=j?.admin?.useAsTitle||"id",Xe=Fe[$e],Pe=f("fields:linkedTo",{label:`${$o(j.labels.singular,p)} - ${Xe}`}).replace(/<[^>]*>?/g,"");a(Pe)}).catch(()=>{let Te=f("fields:linkedTo",{label:`${$o(j.labels.singular,p)} - ${f("general:untitled",p)} - ID: ${q}`}).replace(/<[^>]*>?/g,"");a(Te)})}}C(H),v(!0),T(_?_?.getNodes():[]),fe(D)?N(!0):N(!1);let Z=n.current,te=cd(e._window),{activeElement:oe}=document;if(Z===null)return;let Ne=e.getRootElement();return te!==null&&Ne!==null&&Ne.contains(te.anchorNode)?(R||(R=te.getRangeAt(0).getBoundingClientRect()),R!=null&&(R.y+=40,Gt(R,Z,t))):(oe==null||oe.className!=="link-input")&&(Ne!==null&&Gt(null,Z,t),l(null),a(null)),!0},[e,I,d.routes.admin,d.routes.api,d.serverURL,m,f,p,g?.code,t]);return Vt(()=>Li(e.registerCommand(Wt,_=>(e.dispatchCommand(ne,_),E(),S(),!0),Ii)),[e,E,S,L]),Vt(()=>{let _=t.parentElement,R=()=>{e.getEditorState().read(()=>{E()})};return window.addEventListener("resize",R),_?.addEventListener("scroll",R),()=>{window.removeEventListener("resize",R),_?.removeEventListener("scroll",R)}},[t.parentElement,e,E]),Vt(()=>Li(e.registerUpdateListener(({editorState:_})=>{_.read(()=>{E()})}),e.registerCommand(dd,()=>(E(),!0),Ii),e.registerCommand(ud,()=>k?(I(),!0):!1,ad)),[e,E,k,I]),Vt(()=>{e.getEditorState().read(()=>{E()})},[e,E]),dt(yi.Fragment,{children:[he("div",{className:"link-editor",ref:n,children:dt("div",{className:"link-input",children:[i&&i.length>0?dt("a",{href:i,rel:"noopener noreferrer",target:"_blank",children:[o?.__fields.newTab?he(Ni,{}):null,s!=null&&s.length>0?s:i]}):s!=null&&s.length>0?dt(Ju,{children:[o?.__fields.newTab?he(Ni,{}):null,he("span",{className:"link-input__label-pure",children:s})]}):null,e.isEditable()&&dt(yi.Fragment,{children:[he("button",{"aria-label":"Edit link",className:"link-edit",onClick:_=>{_.preventDefault(),S()},onMouseDown:Mi,tabIndex:0,type:"button",children:he(ed,{})}),!w&&he("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(ne,null)},onMouseDown:Mi,tabIndex:0,type:"button",children:he(Qu,{})})]})]})}),he(Je,{className:"lexical-link-edit-drawer",data:h,drawerSlug:L,drawerTitle:f("fields:editLink"),featureKey:"link",handleDrawerSubmit:(_,R)=>{let M=R,D={...M};delete D.text,e.update(()=>{let F=Ri(),A=null;if(Si(F)?A=je(F).getParent():x.length&&(A=x[0]?.getParent()??null),A&&fe(A)){let H=me({fields:D});A.replace(H,!0)}}),e.dispatchCommand(ne,{fields:D,selectedNodes:x,text:M.text})},schemaPath:u,schemaPathSuffix:"fields"})]})}var Ai=t=>{let{anchorElem:e=document.body}=t;return fd(pd(Di,{anchorElem:e}),e)};import{c as Cd}from"react/compiler-runtime";import{useLexicalComposerContext as xd}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as bd}from"@lexical/utils";import{$getSelection as _d,$isElementNode as Td,$isRangeSelection as wd,COMMAND_PRIORITY_LOW as Fi,PASTE_COMMAND as Ed}from"lexical";import{useEffect as kd}from"react";var hd=/^(?:[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+)?$/,gd=/^(?:\/[\w\-./]*(?:#\w[\w-]*)?|#[\w\-]+)$/;function Oi(t){if(!t)return!1;if(t==="https://"||hd.test(t)||gd.test(t))return!0;try{return new URL(t),!0}catch{}return!1}var $i=t=>{let e=Cd(5),{clientProps:o}=t,[r]=xd(),n,i;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==r?(n=()=>{if(!r.hasNodes([X]))throw new Error("LinkPlugin: LinkNode not registered on editor");return bd(r.registerCommand(ne,l=>l===null?(Ao(null),!0):(l.fields?.linkType||(l.fields.linkType=o.defaultLinkType),l.fields?.url||(l.fields.url=o.defaultLinkURL),Ao(l),!0),Fi),r.registerCommand(Ed,l=>{let s=_d();if(!wd(s)||s.isCollapsed()||!(l instanceof ClipboardEvent)||l.clipboardData==null)return!1;let a=l.clipboardData.getData("text");if(!Oi(a))return!1;if(!s.getNodes().some(Ld)){let u={doc:null,linkType:"custom",newTab:!1,url:a};return r.dispatchCommand(ne,{fields:u,text:null}),l.preventDefault(),!0}return!1},Fi))},i=[o.defaultLinkType,o.defaultLinkURL,r],e[0]=o.defaultLinkType,e[1]=o.defaultLinkURL,e[2]=r,e[3]=n,e[4]=i):(n=e[3],i=e[4]),kd(n,i),null};function Ld(t){return Td(t)}var Bi=[yo([{ChildComponent:ci,isActive:({selection:t})=>{if(Pi(t)){let e=je(t);return Nd(e,W)!=null}return!1},isEnabled:({selection:t})=>!!(Pi(t)&&Po()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(ne,null);else{let o,r=[];if(t.getEditorState().read(()=>{o=Po()?.getTextContent(),r=Po()?.getNodes()??[]}),!o?.length)return;let n={doc:null,newTab:!1};t.dispatchCommand(Wt,{fields:n,selectedNodes:r,text:o})}},order:1}])],Rd=y({markdownTransformers:[pi],nodes:[X,pe],plugins:[{Component:$i,position:"normal"},{Component:wi,position:"normal"},{Component:Ei,position:"normal"},{Component:Ai,position:"floatingAnchorElem"}],toolbarFixed:{groups:Bi},toolbarInline:{groups:Bi}});import{$isListNode as jo,INSERT_CHECK_LIST_COMMAND as Vi,ListItemNode as Bd,ListNode as Hd}from"@lexical/list";import{$isRangeSelection as jd}from"lexical";import{jsx as Hi,jsxs as Sd}from"react/jsx-runtime";import"react";var Bo=()=>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:[Hi("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),Hi("path",{d:"M7 10L9 12.5L13 7.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Id}from"react/jsx-runtime";import{ListPlugin as yd}from"@lexical/react/LexicalListPlugin.js";import"react";var Ue=()=>Id(yd,{});function Ge(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{$isListNode as Ad,ListItemNode as Od,ListNode as Fd}from"@lexical/list";import{$createListItemNode as vd,$createListNode as Md,$isListItemNode as Dd,$isListNode as Ho}from"@lexical/list";var ji=4,We=t=>(e,o,r)=>{let n=e.getPreviousSibling(),i=e.getNextSibling(),l=vd(t==="check"?r[3]==="x":void 0);if(Ho(i)&&i.getListType()===t){let a=i.getFirstChild();a!==null?a.insertBefore(l):i.append(l),e.remove()}else if(Ho(n)&&n.getListType()===t)n.append(l),e.remove();else{let a=Md(t,t==="number"?Number(r[2]):void 0);a.append(l),e.replace(a)}l.append(...o),l.select(0,0);let s=Math.floor(r[1].length/ji);s&&l.setIndent(s)},ve=(t,e,o)=>{let r=[],n=t.getChildren(),i=0;for(let l of n)if(Dd(l)){if(l.getChildrenSize()===1){let c=l.getFirstChild();if(Ho(c)){r.push(ve(c,e,o+1));continue}}let s=" ".repeat(o*ji),a=t.getListType(),u=a==="number"?`${t.getStart()+i}. `:a==="check"?`- [${l.getChecked()?"x":" "}] `:"- ";r.push(s+u+e(l)),i++}return r.join(`
|
|
36
|
-
`)};var Ui={type:"element",dependencies:[Fd,Od],export:(t,e)=>Ad(t)?ve(t,e,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:We("check")};import{jsx as $d}from"react/jsx-runtime";import{CheckListPlugin as Pd}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var Gi=()=>$d(Pd,{});var Wi=[z([{ChildComponent:Bo,isActive:({selection:t})=>{if(!jd(t))return!1;for(let e of t.getNodes()){if(jo(e)&&e.getListType()==="check")continue;let o=e.getParent();if(jo(o)&&o.getListType()==="check")continue;let r=o?.getParent();if(!(jo(r)&&r.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:t})=>t.t("lexical:checklist:label"),onSelect:({editor:t})=>{t.dispatchCommand(Vi,void 0)},order:12}])],Ud=y(({featureProviderMap:t})=>{let e=[{Component:Gi,position:"normal"}];return!t.has("unorderedList")&&!t.has("orderedList")&&e.push({Component:Ue,position:"normal"}),{markdownTransformers:[Ui],nodes:t.has("unorderedList")||t.has("orderedList")?[]:[Hd,Bd],plugins:e,slashMenu:{groups:[Ge([{Icon:Bo,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:o})=>o.t("lexical:checklist:label"),onSelect:({editor:o})=>{o.dispatchCommand(Vi,void 0)}}])]},toolbarFixed:{groups:Wi},toolbarInline:{groups:Wi}}});import{$isListNode as Go,INSERT_ORDERED_LIST_COMMAND as Yi,ListItemNode as Zd,ListNode as Yd}from"@lexical/list";import{$isRangeSelection as zd}from"lexical";import{jsx as mt,jsxs as Gd}from"react/jsx-runtime";import"react";var Uo=()=>Gd("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:[mt("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"}),mt("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"}),mt("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),mt("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),mt("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as Wd,ListItemNode as Vd,ListNode as Kd}from"@lexical/list";var Ki={type:"element",dependencies:[Kd,Vd],export:(t,e)=>Wd(t)?ve(t,e,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:We("number")};var Zi=[z([{ChildComponent:Uo,isActive:({selection:t})=>{if(!zd(t))return!1;for(let e of t.getNodes()){if(Go(e)&&e.getListType()==="number")continue;let o=e.getParent();if(Go(o)&&o.getListType()==="number")continue;let r=o?.getParent();if(!(Go(r)&&r.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:t})=>t.t("lexical:orderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(Yi,void 0)},order:10}])],Xd=y(({featureProviderMap:t})=>({markdownTransformers:[Ki],nodes:t.has("orderedList")?[]:[Yd,Zd],plugins:t.has("orderedList")?[]:[{Component:Ue,position:"normal"}],slashMenu:{groups:[Ge([{Icon:Uo,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:e})=>e.t("lexical:orderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(Yi,void 0)}}])]},toolbarFixed:{groups:Zi},toolbarInline:{groups:Zi}}));import{$isListNode as Vo,INSERT_UNORDERED_LIST_COMMAND as Ji,ListItemNode as tm,ListNode as om}from"@lexical/list";import{$isRangeSelection as rm}from"lexical";import{jsx as Ve,jsxs as Jd}from"react/jsx-runtime";import"react";var Wo=()=>Jd("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:[Ve("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Ve("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Ve("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Ve("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),Ve("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),Ve("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as qd,ListItemNode as Qd,ListNode as em}from"@lexical/list";var zi={type:"element",dependencies:[em,Qd],export:(t,e)=>qd(t)?ve(t,e,0):null,regExp:/^(\s*)[-*+]\s/,replace:We("bullet")};var Xi=[z([{ChildComponent:Wo,isActive:({selection:t})=>{if(!rm(t))return!1;for(let e of t.getNodes()){if(Vo(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(Vo(o)&&o.getListType()==="bullet")continue;let r=o?.getParent();if(!(Vo(r)&&r.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ji,void 0)},order:11}])],nm=y({markdownTransformers:[zi],nodes:[om,tm],plugins:[{Component:Ue,position:"normal"}],slashMenu:{groups:[Ge([{Icon:Wo,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ji,void 0)}}])]},toolbarFixed:{groups:Xi},toolbarInline:{groups:Xi}});import{jsx as im}from"react/jsx-runtime";import{addClassNamesToElement as lm}from"@lexical/utils";import{DecoratorNode as sm}from"lexical";import*as qi from"react";var am=qi.lazy(()=>import("./Component-MBLHTKDK.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),pt=class t extends sm{__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 cm({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return lm(o,"unknownConverted"),o}decorate(){return im(am,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function cm({data:t}){return new pt({data:t})}var um=y(()=>({nodes:[pt]}));import{jsx as dm}from"react/jsx-runtime";import{addClassNamesToElement as mm}from"@lexical/utils";import{DecoratorNode as pm}from"lexical";import*as Qi from"react";var fm=Qi.lazy(()=>import("./Component-DOSSWC76.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),ft=class t extends pm{__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 hm({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return mm(o,"unknownConverted"),o}decorate(){return dm(fm,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function hm({data:t}){return new ft({data:t})}var gm=y(()=>({nodes:[ft]}));import{$setBlocksType as ol}from"@lexical/selection";import{$createParagraphNode as rl,$getSelection as nl,$isParagraphNode as el,$isRangeSelection as Cm}from"lexical";var tl=[z([{ChildComponent:Qe,isActive:({selection:t})=>{if(!Cm(t))return!1;for(let e of t.getNodes())if(!el(e)&&!el(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=nl();ol(e,()=>rl())})},order:1}])],xm=y({slashMenu:{groups:[V([{Icon:Qe,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=nl();ol(e,()=>rl())})}}])]},toolbarFixed:{groups:tl},toolbarInline:{groups:tl}});import{$isNodeSelection as op}from"lexical";import{jsx as ht,jsxs as bm}from"react/jsx-runtime";import"react";var Ko=()=>bm("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:[ht("g",{clipPath:"url(#clip0_4397_10817)",children:ht("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"})}),ht("defs",{children:ht("clipPath",{id:"clip0_4397_10817",children:ht("rect",{fill:"currentColor",height:"12",transform:"translate(4 4)",width:"12"})})})]});import{jsx as wm}from"react/jsx-runtime";import*as ll from"react";import{DecoratorBlockNode as _m}from"@lexical/react/LexicalDecoratorBlockNode.js";function Tm(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:il({relationTo:o,value:e})}:null}var gt=class extends _m{__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:Tm,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=il(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 il(t){return new gt({data:t})}var Em=ll.lazy(()=>import("./RelationshipComponent-JPESGV4Q.js").then(t=>({default:t.RelationshipComponent})));function km(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:Me({relationTo:o,value:e})}:null}var ge=class extends gt{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:km,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=Me(o);return r.setFormat(e.format),r}decorate(e,o){return wm(Em,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Me(t){return new ge({data:t})}function Zo(t){return t instanceof ge}import{c as Um}from"react/compiler-runtime";import{jsx as Gm}from"react/jsx-runtime";import{useLexicalComposerContext as Wm}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Vm}from"@lexical/utils";import{useConfig as Km}from"@payloadcms/ui";import{$getPreviousSelection as Zm,$getSelection as Ym,$isParagraphNode as ml,$isRangeSelection as zm,COMMAND_PRIORITY_EDITOR as Xm,createCommand as Jm}from"lexical";import{useEffect as qm}from"react";import{c as Fm}from"react/compiler-runtime";import{jsx as Kt}from"react/jsx-runtime";import{useLexicalComposerContext as $m}from"@lexical/react/LexicalComposerContext.js";import{$getNodeByKey as Pm,COMMAND_PRIORITY_EDITOR as Bm}from"lexical";import{useEffect as Hm,useState as cl}from"react";import{c as Lm}from"react/compiler-runtime";import{jsx as Nm}from"react/jsx-runtime";import{useLexicalComposerContext as Rm}from"@lexical/react/LexicalComposerContext";import{useListDrawer as Sm,useModal as Im}from"@payloadcms/ui";import{$getNodeByKey as sl,$getPreviousSelection as ym,$getRoot as vm,$getSelection as Mm,$isRangeSelection as Dm,$setSelection as Am}from"lexical";import{useEffect as Om,useState as al}from"react";var Ct=t=>{let e=Lm(23),[o]=Rm(),[r,n]=al(null),[i,l]=al(!1),[s,a,u]=Sm(t),{closeDrawer:c,drawerSlug:d,isDrawerOpen:m,openDrawer:p}=u,{modalState:f}=Im(),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{let S=Mm()??ym();n(S)},e[0]=h):h=e[0];let C=h,b;e[1]!==o||e[2]!==r?(b=()=>{r&&o.update(()=>{if(Dm(r)){let{anchor:S,focus:I}=r;sl(S.key)&&sl(I.key)&&Am(r.clone())}else vm().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=r,e[3]=b):b=e[3];let k=b,v;e[4]!==c?(v=()=>{c()},e[4]=c,e[5]=v):v=e[5];let x=v,T,g;e[6]!==d||e[7]!==f||e[8]!==k||e[9]!==i?(T=()=>{if(!i)return;let S=f[d];S&&!S?.isOpen&&(l(!1),setTimeout(()=>{k()},1))},g=[f,d,k,i],e[6]=d,e[7]=f,e[8]=k,e[9]=i,e[10]=T,e[11]=g):(T=e[10],g=e[11]),Om(T,g);let w;e[12]!==a?(w=S=>Nm(a,{...S,onClick:()=>{C()}}),e[12]=a,e[13]=w):w=e[13];let N;e[14]!==p?(N=()=>{C(),p(),l(!0)},e[14]=p,e[15]=N):N=e[15];let L;return e[16]!==s||e[17]!==x||e[18]!==m||e[19]!==d||e[20]!==w||e[21]!==N?(L={closeListDrawer:x,isListDrawerOpen:m,ListDrawer:s,listDrawerSlug:d,ListDrawerToggler:w,openListDrawer:N},e[16]=s,e[17]=x,e[18]=m,e[19]=d,e[20]=w,e[21]=N,e[22]=L):L=e[22],L};var jm=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=Pm(o);n&&n.replace(Me({relationTo:e,value:r}))}):t.dispatchCommand(Yo,{relationTo:e,value:r})},ul=t=>{let e=Fm(16),{enabledCollectionSlugs:o}=t,[r]=$m(),n;e[0]!==o?(n=()=>o?.[0],e[0]=o,e[1]=n):n=e[1];let[i]=cl(n),[l,s]=cl(null),a=o||void 0,u;e[2]!==i||e[3]!==a?(u={collectionSlugs:a,selectedCollection:i},e[2]=i,e[3]=a,e[4]=u):u=e[4];let{closeListDrawer:c,ListDrawer:d,openListDrawer:m}=Ct(u),p,f;e[5]!==r||e[6]!==m?(p=()=>r.registerCommand(qe,k=>(s(k?.replace?k?.replace.nodeKey:null),m(),!0),Bm),f=[r,m],e[5]=r,e[6]=m,e[7]=p,e[8]=f):(p=e[7],f=e[8]),Hm(p,f);let h;e[9]!==c||e[10]!==r||e[11]!==l?(h=k=>{let{collectionSlug:v,docID:x}=k;jm({editor:r,relationTo:v,replaceNodeKey:l,value:x}),c()},e[9]=c,e[10]=r,e[11]=l,e[12]=h):h=e[12];let C=h,b;return e[13]!==d||e[14]!==C?(b=Kt(d,{onSelect:C}),e[13]=d,e[14]=C,e[15]=b):b=e[15],b},dl=t=>(t?.enabledCollectionSlugs?.length??-1)>0?Kt(ul,{...t}):Kt(Nt,{...t,children:Kt(ul,{...t})});var Yo=Jm("INSERT_RELATIONSHIP_COMMAND"),pl=t=>{let e=Um(10),{clientProps:o}=t,[r]=Wm(),{config:n}=Km(),{collections:i}=n,l=null;if(o?.enabledCollections)l=o?.enabledCollections;else if(o?.disabledCollections){let c;if(e[0]!==o?.disabledCollections||e[1]!==i){let d;e[3]!==o?.disabledCollections?(d=m=>{let{slug:p}=m;return!o?.disabledCollections?.includes(p)},e[3]=o?.disabledCollections,e[4]=d):d=e[4],c=i.filter(d).map(Qm),e[0]=o?.disabledCollections,e[1]=i,e[2]=c}else c=e[2];l=c}let s,a;e[5]!==r?(s=()=>{if(!r.hasNodes([ge]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return r.registerCommand(Yo,tp,Xm)},a=[r],e[5]=r,e[6]=s,e[7]=a):(s=e[6],a=e[7]),qm(s,a);let u;return e[8]!==l?(u=Gm(dl,{enabledCollectionSlugs:l}),e[8]=l,e[9]=u):u=e[9],u};function Qm(t){let{slug:e}=t;return e}function ep(t){return ml(t)}function tp(t){let e=Ym()||Zm();if(zm(e)){let o=Me(t);Vm(o);let{focus:r}=e,n=r.getNode();ml(n)&&n.getTextContentSize()===0&&n.getParentOrThrow().getChildren().filter(ep).length>1&&n.remove()}return!0}var rp=y({nodes:[ge],plugins:[{Component:pl,position:"normal"}],slashMenu:{groups:[V([{Icon:Ko,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(qe,{replace:!1})}}])]},toolbarFixed:{groups:[de([{ChildComponent:Ko,isActive:({selection:t})=>{if(!op(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Zo(e)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(qe,{replace:!1})}}])]}});import{c as bl}from"react/compiler-runtime";import{jsx as ee,jsxs as Ep}from"react/jsx-runtime";import{useLexicalComposerContext as kp}from"@lexical/react/LexicalComposerContext.js";import{useScrollInfo as Lp,useThrottledEffect as Np,useTranslation as Rp}from"@payloadcms/ui";import*as Ce from"react";import{useMemo as Sp}from"react";import{c as np}from"react/compiler-runtime";import{jsx as ip}from"react/jsx-runtime";import{mergeRegister as lp}from"@lexical/utils";import{$addUpdateTag as sp,$getSelection as ap}from"lexical";import{useEffect as Zt,useState as zo}from"react";var Xo="toolbar-popup__button",xt=t=>{let e=np(34),{children:o,editor:r,item:n}=t,[i,l]=zo(!0),[s,a]=zo(!1),[u,c]=zo(Xo),d=P(),m;e[0]!==s||e[1]!==r||e[2]!==d||e[3]!==i||e[4]!==n?(m=()=>{r.getEditorState().read(()=>{let N=ap();if(N){if(n.isActive){let L=n.isActive({editor:r,editorConfigContext:d,selection:N});s!==L&&a(L)}if(n.isEnabled){let L=n.isEnabled({editor:r,editorConfigContext:d,selection:N});i!==L&&l(L)}}})},e[0]=s,e[1]=r,e[2]=d,e[3]=i,e[4]=n,e[5]=m):m=e[5];let p=m,f,h;e[6]!==p?(f=()=>{p()},h=[p],e[6]=p,e[7]=f,e[8]=h):(f=e[7],h=e[8]),Zt(f,h);let C,b;e[9]!==p?(C=()=>(document.addEventListener("mouseup",p),()=>{document.removeEventListener("mouseup",p)}),b=[p],e[9]=p,e[10]=C,e[11]=b):(C=e[10],b=e[11]),Zt(C,b);let k,v;e[12]!==r||e[13]!==p?(k=()=>lp(r.registerUpdateListener(()=>{p()})),v=[r,p],e[12]=r,e[13]=p,e[14]=k,e[15]=v):(k=e[14],v=e[15]),Zt(k,v);let x;e[16]!==s||e[17]!==i||e[18]!==n.key?(x=()=>{c([Xo,i===!1?"disabled":"",s?"active":"",n?.key?`${Xo}-`+n.key:""].filter(Boolean).join(" "))},e[16]=s,e[17]=i,e[18]=n.key,e[19]=x):x=e[19];let T;e[20]!==s||e[21]!==u||e[22]!==i||e[23]!==n.key?(T=[i,s,u,n.key],e[20]=s,e[21]=u,e[22]=i,e[23]=n.key,e[24]=T):T=e[24],Zt(x,T);let g;e[25]!==s||e[26]!==r||e[27]!==i||e[28]!==n?(g=()=>{if(i!==!1)return r.focus(()=>{r.update(cp),n.onSelect?.({editor:r,isActive:s})}),!0},e[25]=s,e[26]=r,e[27]=i,e[28]=n,e[29]=g):g=e[29];let w;return e[30]!==o||e[31]!==u||e[32]!==g?(w=ip("button",{className:u,onClick:g,onMouseDown:up,type:"button",children:o}),e[30]=o,e[31]=u,e[32]=g,e[33]=w):w=e[33],w};function cp(){sp("toolbar")}function up(t){t.preventDefault()}import{c as Cp}from"react/compiler-runtime";import{jsx as Ke}from"react/jsx-runtime";import Qo,{useCallback as xp,useEffect as xl}from"react";import{mergeRegister as bp}from"@lexical/utils";import{useTranslation as _p}from"@payloadcms/ui";import{$getSelection as Tp}from"lexical";import{jsx as ke,jsxs as fl}from"react/jsx-runtime";import{Button as dp}from"@payloadcms/ui";import{$addUpdateTag as mp}from"lexical";import Yt,{useCallback as pp,useEffect as bt,useMemo as fp,useRef as qo,useState as zt}from"react";import{createPortal as hp}from"react-dom";var Jo="toolbar-popup__dropdown-item",hl=Yt.createContext(null);function gl({active:t,children:e,editor:o,enabled:r,Icon:n,item:i,tooltip:l}){let[s,a]=zt(Jo);bt(()=>{a([Jo,r===!1?"disabled":"",t?"active":"",i?.key?`${Jo}-${i.key}`:""].filter(Boolean).join(" "))},[r,t,s,i.key]);let u=qo(null),c=Yt.useContext(hl);if(c===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:d}=c;return bt(()=>{u?.current!=null&&d(u)},[u,d]),ke(dp,{"aria-label":l,buttonStyle:"none",className:s,disabled:r===!1,icon:n,iconPosition:"left",iconStyle:"none",onClick:()=>{r!==!1&&o.focus(()=>{o.update(()=>{mp("toolbar")}),i.onSelect?.({editor:o,isActive:t})})},onMouseDown:m=>{m.preventDefault()},ref:u,tooltip:l,type:"button",children:e})}function gp({children:t,dropDownRef:e,itemsContainerClassNames:o,onClose:r}){let[n,i]=zt(),[l,s]=zt(),a=pp(d=>{i(m=>m!=null?[...m,d]:[d])},[i]),u=d=>{if(n==null)return;let{key:m}=d;["ArrowDown","ArrowUp","Escape","Tab"].includes(m)&&d.preventDefault(),m==="Escape"||m==="Tab"?r():m==="ArrowUp"?s(p=>{if(p==null)return n[0];let f=n.indexOf(p)-1;return n[f===-1?n.length-1:f]}):m==="ArrowDown"&&s(p=>p==null?n[0]:n[n.indexOf(p)+1])},c=fp(()=>({registerItem:a}),[a]);return bt(()=>{n!=null&&l==null&&s(n[0]),l!=null&&l?.current!=null&&l.current.focus()},[n,l]),ke(hl.Provider,{value:c,children:ke("div",{className:(o??["toolbar-popup__dropdown-items"]).join(" "),onKeyDown:u,ref:e,children:t})})}function Cl({buttonAriaLabel:t,buttonClassName:e,children:o,disabled:r=!1,Icon:n,itemsContainerClassNames:i,label:l,stopCloseOnClickSelf:s}){let a=qo(null),u=qo(null),[c,d]=zt(!1),m=()=>{d(!1),u?.current!=null&&u.current.focus()};bt(()=>{let f=u.current,h=a.current;if(c&&f!==null&&h!==null){let{left:C,top:b}=f.getBoundingClientRect(),k=window.scrollY||document.documentElement.scrollTop;h.style.top=`${b+k+f.offsetHeight+5}px`,h.style.left=`${Math.min(C-5,window.innerWidth-h.offsetWidth-20)}px`}},[a,u,c]),bt(()=>{let f=u.current;if(f!==null&&c){let h=C=>{let{target:b}=C;s!=null&&a.current!=null&&a.current.contains(b)||f.contains(b)||d(!1)};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[a,u,c,s]);let p=hp(ke(gp,{dropDownRef:a,itemsContainerClassNames:i,onClose:m,children:o}),document.body);return fl(Yt.Fragment,{children:[fl("button",{"aria-label":t,className:e+(c?" active":""),disabled:r,onClick:f=>{f.preventDefault(),d(!c)},onMouseDown:f=>{f.preventDefault()},ref:u,type:"button",children:[n&&ke(n,{}),l&&ke("span",{className:"toolbar-popup__dropdown-label",children:l}),ke("i",{className:"toolbar-popup__dropdown-caret"})]}),c&&ke(Yt.Fragment,{children:p})]})}var er="toolbar-popup__dropdown",wp=t=>{let e=Cp(18),{active:o,anchorElem:r,editor:n,enabled:i,item:l}=t,{i18n:s}=_p(),{fieldProps:a}=P(),{featureClientSchemaMap:u,schemaPath:c}=a;if(l.Component){let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==i||e[4]!==l?(f=l?.Component&&Ke(l.Component,{active:o,anchorElem:r,editor:n,enabled:i,item:l},l.key),e[0]=o,e[1]=r,e[2]=n,e[3]=i,e[4]=l,e[5]=f):f=e[5],f}let d=l.key,m;if(l.label){let f;e[6]!==u||e[7]!==s||e[8]!==l||e[9]!==c?(f=typeof l.label=="function"?l.label({featureClientSchemaMap:u,i18n:s,schemaPath:c}):l.label,e[6]=u,e[7]=s,e[8]=l,e[9]=c,e[10]=f):f=e[10],d=f}d.length>25?m=d.substring(0,25)+"...":m=d;let p;return e[11]!==o||e[12]!==m||e[13]!==n||e[14]!==i||e[15]!==l||e[16]!==d?(p=Ke(gl,{active:o,editor:n,enabled:i,Icon:l?.ChildComponent?Ke(l.ChildComponent,{}):void 0,item:l,tooltip:d,children:Ke("span",{className:"text",children:m})},l.key),e[11]=o,e[12]=m,e[13]=n,e[14]=i,e[15]=l,e[16]=d,e[17]=p):p=e[17],p},De=({anchorElem:t,classNames:e,editor:o,group:r,Icon:n,itemsContainerClassNames:i,label:l,maxActiveItems:s,onActiveChange:a})=>{let[u,c]=Qo.useState([]),[d,m]=Qo.useState([]),[p,f]=Qo.useState(!0),h=P(),{items:C,key:b}=r,k=xp(()=>{o.getEditorState().read(()=>{let v=Tp();if(!v)return;let x=[],T=[],g=[];for(let w of C)w.isActive&&(!s||x.length<s)&&w.isActive({editor:o,editorConfigContext:h,selection:v})&&(x.push(w.key),T.push(w)),w.isEnabled?w.isEnabled({editor:o,editorConfigContext:h,selection:v})&&g.push(w.key):g.push(w.key);r.isEnabled&&f(r.isEnabled({editor:o,editorConfigContext:h,selection:v})),c(x),m(g),a&&a({activeItems:T})})},[o,h,r,C,s,a]);return xl(()=>{k()},[k]),xl(()=>bp(o.registerUpdateListener(()=>{k()})),[o,k]),Ke(Cl,{buttonAriaLabel:`${b} dropdown`,buttonClassName:[er,`${er}-${b}`,...e||[]].filter(Boolean).join(" "),disabled:!p,Icon:n,itemsContainerClassNames:[`${er}-items`,...i||[]],label:l,children:C.length?C.map(v=>Ke(wp,{active:u.includes(v.key),anchorElem:t,editor:o,enabled:d.includes(v.key),item:v},v.key)):null},b)};function Ip({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&ee(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?ee(xt,{editor:e,item:o,children:ee(o.ChildComponent,{})},o.key):null}function yp(t){let e=bl(23),{anchorElem:o,editor:r,editorConfig:n,group:i,index:l}=t,{i18n:s}=Rp(),{fieldProps:a}=P(),{featureClientSchemaMap:u,schemaPath:c}=a,[d,m]=Ce.useState(void 0),[p,f]=Ce.useState(void 0),h;e[0]!==i.ChildComponent||e[1]!==i.items||e[2]!==i.type?(h=()=>{i?.type==="dropdown"&&i.items.length&&i.ChildComponent?f(()=>i.ChildComponent):f(void 0)},e[0]=i.ChildComponent,e[1]=i.items,e[2]=i.type,e[3]=h):h=e[3];let C;e[4]!==i?(C=[i],e[4]=i,e[5]=C):C=e[5],Ce.useEffect(h,C);let b;e[6]!==u||e[7]!==i.ChildComponent||e[8]!==i.items||e[9]!==i.type||e[10]!==s||e[11]!==c?(b=T=>{let{activeItems:g}=T;if(!g.length){i?.type==="dropdown"&&i.items.length&&i.ChildComponent?(f(()=>i.ChildComponent),m(void 0)):(f(void 0),m(void 0));return}let w=g[0],N=w.key;w.label&&(N=typeof w.label=="function"?w.label({featureClientSchemaMap:u,i18n:s,schemaPath:c}):w.label),N.length>25&&(N=N.substring(0,25)+"..."),g.length===1?(m(N),f(()=>w.ChildComponent)):(m(s.t("lexical:general:toolbarItemsActive",{count:g.length})),i?.type==="dropdown"&&i.items.length&&i.ChildComponent?f(()=>i.ChildComponent):f(void 0))},e[6]=u,e[7]=i.ChildComponent,e[8]=i.items,e[9]=i.type,e[10]=s,e[11]=c,e[12]=b):b=e[12];let k=b,v=`fixed-toolbar__group fixed-toolbar__group-${i.key}`,x;return e[13]!==p||e[14]!==o||e[15]!==d||e[16]!==r||e[17]!==n.features.toolbarFixed?.groups.length||e[18]!==i||e[19]!==l||e[20]!==k||e[21]!==v?(x=Ep("div",{className:v,children:[i.type==="dropdown"&&i.items.length?p?ee(De,{anchorElem:o,editor:r,group:i,Icon:p,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:d,maxActiveItems:i.maxActiveItems??1,onActiveChange:k}):ee(De,{anchorElem:o,editor:r,group:i,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:d,maxActiveItems:i.maxActiveItems??1,onActiveChange:k}):null,i.type==="buttons"&&i.items.length?i.items.map(T=>ee(Ip,{anchorElem:o,editor:r,item:T},T.key)):null,l<n.features.toolbarFixed?.groups.length-1&&ee("div",{className:"divider"})]},i.key),e[13]=p,e[14]=o,e[15]=d,e[16]=r,e[17]=n.features.toolbarFixed?.groups.length,e[18]=i,e[19]=l,e[20]=k,e[21]=v,e[22]=x):x=e[22],x}function vp({anchorElem:t,clientProps:e,editor:o,editorConfig:r,parentWithFixedToolbar:n}){let i=Ce.useRef(null),{y:l}=Lp(),s=Sp(()=>{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 Np(()=>{if(!s)return;let a=i.current;if(!a)return;let u=a.getBoundingClientRect(),c=s.getBoundingClientRect();if(!(u.bottom<c.top||u.top>c.bottom))a.classList.remove("fixed-toolbar"),a.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),s.classList.remove("fixed-toolbar"),s.classList.add("fixed-toolbar","fixed-toolbar--hide");else{if(!a.classList.contains("fixed-toolbar--overlapping"))return;a.classList.remove("fixed-toolbar--overlapping"),a.classList.add("fixed-toolbar"),s.classList.remove("fixed-toolbar--hide"),s.classList.add("fixed-toolbar")}},50,[i,s,l]),ee("div",{className:"fixed-toolbar",onFocus:a=>{a.stopPropagation()},ref:i,children:o.isEditable()&&ee(Ce.Fragment,{children:r?.features&&r.features?.toolbarFixed?.groups.map((a,u)=>ee(yp,{anchorElem:t,editor:o,editorConfig:r,group:a,index:u},a.key))})})}var _l=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return _l(t.parentEditor)}return!1},Tl=t=>{let e=bl(6),{clientProps:o}=t,[r]=kp(),n=P(),{editorConfig:i}=n,l=o.applyToFocusedEditor&&n.focusedEditor?.editor||r,s=o.applyToFocusedEditor&&n.focusedEditor?.editorConfig||i,a,u;if(e[0]!==o.disableIfParentHasFixedToolbar||e[1]!==l||e[2]!==s||e[3]!==n){u=Symbol.for("react.early_return_sentinel");e:{let c=_l(n);if(o?.disableIfParentHasFixedToolbar&&c){u=null;break e}if(!s?.features?.toolbarFixed?.groups?.length){u=null;break e}a=ee(vp,{anchorElem:document.body,editor:l,editorConfig:s,parentWithFixedToolbar:c})}e[0]=o.disableIfParentHasFixedToolbar,e[1]=l,e[2]=s,e[3]=n,e[4]=a,e[5]=u}else a=e[4],u=e[5];return u!==Symbol.for("react.early_return_sentinel")?u:a};var Mp=y({plugins:[{Component:Tl,position:"aboveContainer"}]});import{c as kl}from"react/compiler-runtime";import{jsx as ie,jsxs as Ll}from"react/jsx-runtime";import{useLexicalComposerContext as Dp}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Nl}from"@lexical/utils";import{$getSelection as Rl,$isRangeSelection as wl,$isTextNode as Ap,COMMAND_PRIORITY_LOW as Op,getDOMSelection as Sl,SELECTION_CHANGE_COMMAND as Fp}from"lexical";import{useCallback as Jt,useEffect as _t,useRef as El,useState as $p}from"react";import*as qt from"react";import{createPortal as Pp}from"react-dom";function tr(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 Xt(t){let{alwaysDisplayOnTop:e=!1,anchorElem:o,anchorFlippedOffset:r=0,floatingElem:n,horizontalOffset:i=32,horizontalPosition:l="left",specialHandlingForCaret:s=!1,targetRect:a,verticalGap:u=10}=t,c=o.parentElement;if(a===null||c==null){n.style.opacity="0",n.style.transform="translate(-10000px, -10000px)";return}let d=n.getBoundingClientRect(),m=o.getBoundingClientRect(),p=c.getBoundingClientRect(),f=a.top-d.height-u,h=a.left-i;l==="center"&&(h=a.left+a.width/2-d.width/2);let C=0;return!e&&f<p.top&&!s&&(C=d.height+a.height+u*2,f+=C),l==="center"?h+d.width>p.right?h=p.right-d.width-i:h<p.left&&(h=p.left+i):h+d.width>p.right&&(h=p.right-d.width-i),h-=m.left,n.style.opacity="1",s&&r!==0?(f-=m.bottom-r+d.height-3,n.style.transform=`translate(${h}px, ${f}px) rotate(180deg)`):(f-=m.top,n.style.transform=`translate(${h}px, ${f}px)`),C}function Bp({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&ie(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?ie(xt,{editor:e,item:o,children:ie(o.ChildComponent,{})},o.key):null}function Hp(t){let e=kl(19),{anchorElem:o,editor:r,group:n,index:i}=t,{editorConfig:l}=P(),[s,a]=qt.useState(),u;e[0]!==n.ChildComponent||e[1]!==n.items||e[2]!==n.type?(u=()=>{n?.type==="dropdown"&&n.items.length&&n.ChildComponent?a(()=>n.ChildComponent):a(void 0)},e[0]=n.ChildComponent,e[1]=n.items,e[2]=n.type,e[3]=u):u=e[3];let c;e[4]!==n?(c=[n],e[4]=n,e[5]=c):c=e[5],qt.useEffect(u,c);let d;e[6]!==n.ChildComponent||e[7]!==n.items||e[8]!==n.type?(d=h=>{let{activeItems:C}=h;if(!C.length){n?.type==="dropdown"&&n.items.length&&n.ChildComponent?a(()=>n.ChildComponent):a(void 0);return}let b=C[0];a(()=>b.ChildComponent)},e[6]=n.ChildComponent,e[7]=n.items,e[8]=n.type,e[9]=d):d=e[9];let m=d,p=`inline-toolbar-popup__group inline-toolbar-popup__group-${n.key}`,f;return e[10]!==s||e[11]!==o||e[12]!==r||e[13]!==l.features.toolbarInline?.groups.length||e[14]!==n||e[15]!==i||e[16]!==m||e[17]!==p?(f=Ll("div",{className:p,children:[n.type==="dropdown"&&n.items.length?s?ie(De,{anchorElem:o,editor:r,group:n,Icon:s,maxActiveItems:n.maxActiveItems??1,onActiveChange:m}):ie(De,{anchorElem:o,editor:r,group:n,maxActiveItems:n.maxActiveItems??1,onActiveChange:m}):null,n.type==="buttons"&&n.items.length?n.items.map(h=>ie(Bp,{anchorElem:o,editor:r,item:h},h.key)):null,i<l.features.toolbarInline?.groups.length-1&&ie("div",{className:"divider"})]},n.key),e[10]=s,e[11]=o,e[12]=r,e[13]=l.features.toolbarInline?.groups.length,e[14]=n,e[15]=i,e[16]=m,e[17]=p,e[18]=f):f=e[18],f}function jp({anchorElem:t,editor:e}){let o=El(null),r=El(null),{editorConfig:n}=P(),i=Jt(()=>{if(o?.current){let u=o.current.style.opacity==="0",c=o.current.style.pointerEvents==="none";u||(o.current.style.opacity="0"),c||(o.current.style.pointerEvents="none")}},[o]),l=Jt(u=>{if(o?.current&&(u.buttons===1||u.buttons===3)){let c=o.current.style.opacity==="0",d=o.current.style.pointerEvents==="none";if(!c||!d){let m=u.clientX,p=u.clientY,f=document.elementFromPoint(m,p);o.current.contains(f)||i()}}},[i]),s=Jt(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);_t(()=>(document.addEventListener("mousemove",l),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",s)}),[o,l,s]);let a=Jt(()=>{let u=Rl(),c=Sl(e._window);if(o.current===null)return;let d=t.querySelector(":scope > .link-editor"),m=d!==null&&"style"in d&&d?.style?.opacity==="1",p=e.getRootElement();if(u!==null&&c!==null&&!c.isCollapsed&&p!==null&&p.contains(c.anchorNode)){let f=tr(c,p),h=Xt({alwaysDisplayOnTop:m,anchorElem:t,floatingElem:o.current,horizontalPosition:"center",targetRect:f});r.current&&Xt({anchorElem:o.current,anchorFlippedOffset:h,floatingElem:r.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:f,verticalGap:8})}else i()},[e,i,t]);return _t(()=>{let u=t.parentElement,c=()=>{e.getEditorState().read(()=>{a()})};return window.addEventListener("resize",c),u&&u.addEventListener("scroll",c),()=>{window.removeEventListener("resize",c),u&&u.removeEventListener("scroll",c)}},[e,a,t]),_t(()=>(e.getEditorState().read(()=>{a()}),Nl(e.registerUpdateListener(({editorState:u})=>{u.read(()=>{a()})}),e.registerCommand(Fp,()=>(a(),!1),Op))),[e,a]),Ll("div",{className:"inline-toolbar-popup",ref:o,children:[ie("div",{className:"caret",ref:r}),n?.features&&n.features?.toolbarInline?.groups.map((u,c)=>ie(Hp,{anchorElem:t,editor:e,group:u,index:c},u.key))]})}function Up(t,e){let o=kl(12),[r,n]=$p(!1),i;o[0]!==t?(i=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let m=Rl(),p=Sl(t._window),f=t.getRootElement();if(p!==null&&(!wl(m)||f===null||!f.contains(p.anchorNode))){n(!1);return}if(!wl(m))return;if(m.getTextContent()!==""){let C=m.getNodes(),b=!1;for(let k of C)if(Ap(k)){n(!0),b=!0;break}b||n(!1)}else n(!1);let h=m.getTextContent().replace(/\n/g,"");if(!m.isCollapsed()&&h===""){n(!1);return}})},o[0]=t,o[1]=i):i=o[1];let l=i,s,a;o[2]!==l?(s=()=>(document.addEventListener("selectionchange",l),document.addEventListener("mouseup",l),()=>{document.removeEventListener("selectionchange",l),document.removeEventListener("mouseup",l)}),a=[l],o[2]=l,o[3]=s,o[4]=a):(s=o[3],a=o[4]),_t(s,a);let u,c;if(o[5]!==t||o[6]!==l?(u=()=>Nl(t.registerUpdateListener(()=>{l()}),t.registerRootListener(()=>{t.getRootElement()===null&&n(!1)})),c=[t,l],o[5]=t,o[6]=l,o[7]=u,o[8]=c):(u=o[7],c=o[8]),_t(u,c),!r||!t.isEditable())return null;let d;return o[9]!==e||o[10]!==t?(d=Pp(ie(jp,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=d):d=o[11],d}var Il=t=>{let{anchorElem:e}=t,[o]=Dp();return Up(o,e)};var Gp=y({plugins:[{Component:Il,position:"floatingAnchorElem"}]});import{TableCellNode as R1,TableNode as S1,TableRowNode as I1}from"@lexical/table";import{jsx as yl}from"react/jsx-runtime";import"react";var or=()=>yl("svg",{className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:yl("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 Wp,$createTableNode as Vp,$createTableRowNode as Kp,$isTableCellNode as vl,$isTableNode as rr,$isTableRowNode as nr,TableCellHeaderStates as Qt,TableCellNode as Zp,TableNode as Yp,TableRowNode as zp}from"@lexical/table";import{$isParagraphNode as Xp,$isTextNode as Jp}from"lexical";var Dl=/^\|(.+)\|\s?$/,qp=/^(\| ?:?-*:? ?)+\|\s?$/,Al=({allTransformers:t})=>({type:"element",dependencies:[Yp,zp,Zp],export:e=>{if(!rr(e))return null;let o=[];for(let r of e.getChildren()){let n=[];if(!nr(r))continue;let i=!1;for(let l of r.getChildren())vl(l)&&(n.push(Sr(t,l).replace(/\n/g,"\\n")),l.__headerState===Qt.ROW&&(i=!0));o.push(`| ${n.join(" | ")} |`),i&&o.push(`| ${n.map(l=>"---").join(" | ")} |`)}return o.join(`
|
|
37
|
-
`)},regExp
|
|
38
|
-
`);let o=Wp(Qt.NO_STATUS);return Rr(t,e,o),o},Ml=(t,e)=>{let o=t.match(Dl);return!o||!o[1]?null:o[1].split("|").map(r=>Ol(r,e))};import{c as tf}from"react/compiler-runtime";import{jsx as $,jsxs as xe}from"react/jsx-runtime";import{useLexicalComposerContext as Hl}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as of}from"@lexical/react/useLexicalEditable";import{$deleteTableColumn__EXPERIMENTAL as rf,$deleteTableRow__EXPERIMENTAL as nf,$getNodeTriplet as lf,$getTableCellNodeFromLexicalNode as $l,$getTableColumnIndexFromTableCellNode as sf,$getTableNodeFromLexicalNodeOrThrow as Ae,$getTableRowIndexFromTableCellNode as af,$insertTableColumn__EXPERIMENTAL as cf,$insertTableRow__EXPERIMENTAL as uf,$isTableCellNode as Tt,$isTableRowNode as Pl,$isTableSelection as wt,$unmergeCell as df,getTableElement as sr,getTableObserverFromTableElement as ar,TableCellHeaderStates as Le,TableCellNode as mf}from"@lexical/table";import{mergeRegister as pf}from"@lexical/utils";import{useScrollInfo as ff}from"@payloadcms/ui";import{$createParagraphNode as hf,$getRoot as gf,$getSelection as to,$isElementNode as Cf,$isParagraphNode as jl,$isRangeSelection as cr,$isTextNode as xf,COMMAND_PRIORITY_CRITICAL as bf,getDOMSelection as _f,SELECTION_CHANGE_COMMAND as Tf}from"lexical";import*as ur from"react";import{useCallback as le,useEffect as Ze,useRef as eo,useState as Ye}from"react";import{createPortal as Ul}from"react-dom";import{jsx as ir,jsxs as ef}from"react/jsx-runtime";import"react";var Fl=()=>ef("svg",{fill:"none",height:"18",viewBox:"0 0 20 20",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[ir("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"}),ir("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"}),ir("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 lr(t){let e=t.getShape();return{columns:e.toX-e.fromX+1,rows:e.toY-e.fromY+1}}function wf(){let t=to();if(cr(t)&&!t.isCollapsed()||wt(t)&&!t.anchor.is(t.focus)||!cr(t)&&!wt(t))return!1;let[e]=lf(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function Bl(t){if(t.getChildrenSize()!==1)return!1;let e=t.getFirstChildOrThrow();return!(!jl(e)||!e.isEmpty())}function Ef(t){let e=t.getLastDescendant();xf(e)?e.select():Cf(e)?e.selectEnd():e!==null&&e.selectNext()}function kf({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:r,tableCellNode:n}){let[i]=Hl(),l=eo(null),[s,a]=Ye(n),[u,c]=Ye({columns:1,rows:1}),[d,m]=Ye(!1),[p,f]=Ye(!1),{y:h}=ff();Ze(()=>i.registerMutationListener(mf,E=>{E.get(s.getKey())==="updated"&&i.getEditorState().read(()=>{a(s.getLatest())})},{skipInitialization:!0}),[i,s]),Ze(()=>{i.getEditorState().read(()=>{let E=to();if(wt(E)){let _=lr(E);c(lr(E)),m(_.columns>1||_.rows>1)}f(wf())})},[i]),Ze(()=>{let E=e.current,_=l.current,R=i.getRootElement();if(E!=null&&_!=null&&R!=null){let M=R.getBoundingClientRect(),D=E.getBoundingClientRect();_.style.opacity="1";let F=_.getBoundingClientRect(),A=5,H=D.right+A;if(H+F.width>window.innerWidth||H+F.width>M.right){let te=D.left-F.width-A;H=(te<0?A:te)+window.pageXOffset}_.style.left=`${H+window.pageXOffset}px`;let Z=D.top;if(Z+F.height>window.innerHeight){let te=D.bottom-F.height;Z=te<0?A:te}_.style.top=`${Z}px`}},[e,l,i,h]),Ze(()=>{function E(_){l.current!=null&&e.current!=null&&!l.current.contains(_.target)&&!e.current.contains(_.target)&&r(!1)}return window.addEventListener("click",E),()=>window.removeEventListener("click",E)},[r,e]);let C=le(()=>{i.update(()=>{if(s.isAttached()){let _=Ae(s),R=sr(_,i.getElementByKey(_.getKey()));if(R===null)throw new Error("Expected to find tableElement in DOM");let M=ar(R);M!==null&&M.$clearHighlight(),_.markDirty(),a(s.getLatest())}gf().selectStart()})},[i,s]),b=()=>{i.update(()=>{let E=to();if(wt(E)){let{columns:_,rows:R}=lr(E),M=E.getNodes(),D=null;for(let F=0;F<M.length;F++){let A=M[F];if(Tt(A))if(D===null){A.setColSpan(_).setRowSpan(R),D=A;let H=Bl(A),Z;H&&jl(Z=A.getFirstChild())&&Z.remove()}else Tt(D)&&(Bl(A)||D.append(...A.getChildren()),A.remove())}D!==null&&(D.getChildrenSize()===0&&D.append(hf()),Ef(D)),o()}})},k=()=>{i.update(()=>{df()})},v=le(E=>{i.update(()=>{uf(E),o()})},[i,o]),x=le(E=>{i.update(()=>{for(let _=0;_<u.columns;_++)cf(E);o()})},[i,o,u.columns]),T=le(()=>{i.update(()=>{nf(),o()})},[i,o]),g=le(()=>{i.update(()=>{Ae(s).remove(),C(),o()})},[i,s,C,o]),w=le(()=>{i.update(()=>{rf(),o()})},[i,o]),N=le(()=>{i.update(()=>{let E=Ae(s),_=af(s),R=E.getChildren();if(_>=R.length||_<0)throw new Error("Expected table cell to be inside of table row.");let M=R[_];if(!Pl(M))throw new Error("Expected table row");let D=s.getHeaderStyles()^Le.ROW;M.getChildren().forEach(F=>{if(!Tt(F))throw new Error("Expected table cell");F.setHeaderStyles(D,Le.ROW)}),C(),o()})},[i,s,C,o]),L=le(()=>{i.update(()=>{let E=Ae(s),_=sf(s),R=E.getChildren(),M=Math.max(...R.map(F=>F.getChildren().length));if(_>=M||_<0)throw new Error("Expected table cell to be inside of table row.");let D=s.getHeaderStyles()^Le.COLUMN;for(let F=0;F<R.length;F++){let A=R[F];if(!Pl(A))throw new Error("Expected table row");let H=A.getChildren();if(_>=H.length)continue;let Z=H[_];if(!Tt(Z))throw new Error("Expected table cell");Z.setHeaderStyles(D,Le.COLUMN)}C(),o()})},[i,s,C,o]),S=le(()=>{i.update(()=>{if(s.isAttached()){let E=Ae(s);E&&E.setRowStriping(!E.getRowStriping())}C(),o()})},[i,s,C,o]),I=null;return t&&(d?I=$("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>b(),type:"button",children:$("span",{className:"text",children:"Merge cells"})}):p&&(I=$("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>k(),type:"button",children:$("span",{className:"text",children:"Unmerge cells"})}))),Ul(xe("div",{className:"table-action-menu-dropdown",onClick:E=>{E.stopPropagation()},ref:l,children:[I?xe(ur.Fragment,{children:[I,$("hr",{})]}):null,$("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>S(),type:"button",children:$("span",{className:"text",children:"Toggle Row Striping"})}),$("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>v(!1),type:"button",children:xe("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," above"]})}),$("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>v(!0),type:"button",children:xe("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," below"]})}),$("hr",{}),$("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>x(!1),type:"button",children:xe("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","left"]})}),$("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>x(!0),type:"button",children:xe("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","right"]})}),$("hr",{}),$("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>w(),type:"button",children:$("span",{className:"text",children:"Delete column"})}),$("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>T(),type:"button",children:$("span",{className:"text",children:"Delete row"})}),$("button",{className:"item","data-test-id":"table-delete",onClick:()=>g(),type:"button",children:$("span",{className:"text",children:"Delete table"})}),$("hr",{}),$("button",{className:"item",onClick:()=>N(),type:"button",children:xe("span",{className:"text",children:[(s.__headerState&Le.ROW)===Le.ROW?"Remove":"Add"," ","row header"]})}),$("button",{className:"item","data-test-id":"table-column-header",onClick:()=>L(),type:"button",children:xe("span",{className:"text",children:[(s.__headerState&Le.COLUMN)===Le.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function Lf({anchorElem:t,cellMerge:e}){let[o]=Hl(),r=eo(null),n=eo(null),[i,l]=Ye(!1),[s,a]=Ye(null),u=le(()=>{let d=r.current,m=to(),p=_f(o._window),f=document.activeElement;function h(){d&&(d.classList.remove("table-cell-action-button-container--active"),d.classList.add("table-cell-action-button-container--inactive")),a(null)}if(m==null||d==null)return h();let C=o.getRootElement(),b=null,k=null;if(cr(m)&&C!==null&&p!==null&&C.contains(p.anchorNode)){let x=$l(m.anchor.getNode());if(x==null||(k=o.getElementByKey(x.getKey()),k==null||!x.isAttached()))return h();let T=Ae(x),g=sr(T,o.getElementByKey(T.getKey()));if(g===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");b=ar(g),a(x)}else if(wt(m)){let x=$l(m.anchor.getNode());if(!Tt(x))throw new Error("TableSelection anchorNode must be a TableCellNode");let T=Ae(x),g=sr(T,o.getElementByKey(T.getKey()));if(g===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");b=ar(g),k=o.getElementByKey(x.getKey())}else if(!f)return h();if(b===null||k===null)return h();let v=!b||!b.isSelecting;if(d.classList.toggle("table-cell-action-button-container--active",v),d.classList.toggle("table-cell-action-button-container--inactive",!v),v){let x=k.getBoundingClientRect(),T=t.getBoundingClientRect(),g=x.top-T.top,w=x.right-T.left;d.style.transform=`translate(${w}px, ${g}px)`}},[o,t]);Ze(()=>{let d,m=()=>{d=void 0,o.getEditorState().read(u)},p=()=>(d===void 0&&(d=setTimeout(m,0)),!1);return pf(o.registerUpdateListener(p),o.registerCommand(Tf,p,bf),o.registerRootListener((f,h)=>{h&&h.removeEventListener("mouseup",p),f&&(f.addEventListener("mouseup",p),p())}),()=>clearTimeout(d))});let c=eo(s);return Ze(()=>{c.current!==s&&l(!1),c.current=s},[c,s]),$("div",{className:"table-cell-action-button-container",ref:r,children:s!=null&&xe(ur.Fragment,{children:[$("button",{className:"table-cell-action-button",onClick:d=>{d.stopPropagation(),l(!i)},ref:n,type:"button",children:$(Fl,{})}),i&&$(kf,{cellMerge:e,contextRef:n,onClose:()=>l(!1),setIsMenuOpen:l,tableCellNode:s})]})})}var Gl=t=>{let e=tf(3),{anchorElem:o}=t,r=of(),n;return e[0]!==o||e[1]!==r?(n=Ul(r?$(Lf,{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 Nf}from"react/compiler-runtime";import{jsx as ro,jsxs as Rf}from"react/jsx-runtime";import{useLexicalComposerContext as Sf}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as If}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as yf,$getTableNodeFromLexicalNodeOrThrow as dr,$getTableRowIndexFromTableCellNode as vf,$isTableCellNode as Wl,$isTableRowNode as Mf,getDOMCellFromTarget as Df,getTableElement as Af,TableNode as Of}from"@lexical/table";import{calculateZoomLevel as Vl}from"@lexical/utils";import{$getNearestNodeFromDOMNode as mr}from"lexical";import*as Zl from"react";import{useCallback as Et,useEffect as pr,useRef as oo,useState as kt}from"react";import{createPortal as Ff}from"react-dom";var $f=33,Kl=92;function Pf({editor:t}){let e=oo(null),o=oo(null),r=oo(null),n=P(),i=oo(null),[l,s]=kt(null),[a,u]=kt(null),[c,d]=kt(!1),[m,p]=kt(null),f=Et(()=>{u(null),e.current=null,p(null),i.current=null,r.current=null},[]),h=L=>(L.buttons&1)===1;pr(()=>t.registerNodeTransform(Of,L=>{if(L.getColWidths())return L;let S=L.getColumnCount(),I=Kl;return L.setColWidths(Array(S).fill(I)),L}),[t]),pr(()=>{let L=_=>{let R=_.target;if(m){s({x:_.clientX,y:_.clientY});return}if(d(h(_)),!(o.current&&o.current.contains(R))&&e.current!==R){e.current=R;let M=Df(R);M&&a!==M?t.getEditorState().read(()=>{let D=mr(M.elem);if(!D)throw new Error("TableCellResizer: Table cell node not found.");let F=dr(D),A=Af(F,t.getElementByKey(F.getKey()));if(!A)throw new Error("TableCellResizer: Table element not found.");e.current=R,r.current=A.getBoundingClientRect(),u(M)},{editor:t}):M==null&&f()}},S=_=>{d(!0)},I=_=>{d(!1)},E=t.registerRootListener((_,R)=>{R?.removeEventListener("mousemove",L),R?.removeEventListener("mousedown",S),R?.removeEventListener("mouseup",I),_?.addEventListener("mousemove",L),_?.addEventListener("mousedown",S),_?.addEventListener("mouseup",I)});return()=>{E()}},[a,m,t,f]);let C=L=>L==="bottom",b=Et(L=>{if(!a)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let S=mr(a.elem);if(!Wl(S))throw new Error("TableCellResizer: Table cell node not found.");let I=dr(S),E=vf(S)+S.getRowSpan()-1,_=I.getChildren();if(E>=_.length||E<0)throw new Error("Expected table cell to be inside of table row.");let R=_[E];if(!Mf(R))throw new Error("Expected table row");let M=R.getHeight();if(M===void 0){let F=R.getChildren();M=Math.min(...F.map(A=>k(A,t)??1/0))}let D=Math.max(M+L,$f);R.setHeight(D)},{tag:"skip-scroll-into-view"})},[a,t]),k=(L,S)=>S.getElementByKey(L.getKey())?.clientHeight,v=(L,S)=>{let I;return S.forEach(E=>{E.forEach((_,R)=>{_.cell===L&&(I=R)})}),I},x=Et(L=>{if(!a)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let S=mr(a.elem);if(!Wl(S))throw new Error("TableCellResizer: Table cell node not found.");let I=dr(S),[E]=yf(I,null,null),_=v(S,E);if(_===void 0)throw new Error("TableCellResizer: Table column not found.");let R=I.getColWidths();if(!R)return;let M=R[_];if(M===void 0)return;let D=[...R],F=Math.max(M+L,Kl);D[_]=F,I.setColWidths(D)},{tag:"skip-scroll-into-view"})},[a,t]),T=Et(L=>{let S=I=>{if(I.preventDefault(),I.stopPropagation(),!a)throw new Error("TableCellResizer: Expected active cell.");if(i.current){let{x:E,y:_}=i.current;if(a===null)return;let R=Vl(I.target);if(C(L)){let M=(I.clientY-_)/R;b(M)}else{let M=(I.clientX-E)/R;x(M)}f(),document.removeEventListener("mouseup",S)}};return S},[a,f,x,b]),g=Et(L=>S=>{if(S.preventDefault(),S.stopPropagation(),!a)throw new Error("TableCellResizer: Expected active cell.");i.current={x:S.clientX,y:S.clientY},s(i.current),p(L),document.addEventListener("mouseup",T(L))},[a,T]),[w,N]=kt({bottom:null,left:null,right:null,top:null});return pr(()=>{if(a){let{height:L,left:S,top:I,width:E}=a.elem.getBoundingClientRect(),_=Vl(a.elem),R=10,M={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${R}px`,left:`${window.scrollX+S}px`,top:`${window.scrollY+I+L-R/2}px`,width:`${E}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${L}px`,left:`${window.scrollX+S+E-R/2}px`,top:`${window.scrollY+I}px`,width:`${R}px`}},D=r.current;m&&l&&D&&(C(m)?(M[m].left=`${window.scrollX+D.left}px`,M[m].top=`${window.scrollY+l.y/_}px`,M[m].height="3px",M[m].width=`${D.width}px`):(M[m].top=`${window.scrollY+D.top}px`,M[m].left=`${window.scrollX+l.x/_}px`,M[m].width="3px",M[m].height=`${D.height}px`),M[m].backgroundColor="#adf"),N(M)}else N({bottom:null,left:null,right:null,top:null})},[a,m,l]),ro("div",{ref:o,children:a!=null&&!c&&Rf(Zl.Fragment,{children:[ro("div",{className:`${n.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:g("right"),style:w.right||void 0}),ro("div",{className:`${n.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:g("bottom"),style:w.bottom||void 0})]})})}var Yl=()=>{let t=Nf(3),[e]=Sf(),o=If(),r,n;return t[0]!==e||t[1]!==o?(n=o?Ff(ro(Pf,{editor:e}),document.body):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],r=n,r};import{c as Kf}from"react/compiler-runtime";import{jsx as fr,jsxs as Zf,Fragment as Yf}from"react/jsx-runtime";import{useLexicalComposerContext as os}from"@lexical/react/LexicalComposerContext";import{$getTableAndElementByKey as zf,$getTableColumnIndexFromTableCellNode as Xf,$getTableRowIndexFromTableCellNode as Jf,$insertTableColumn__EXPERIMENTAL as qf,$insertTableRow__EXPERIMENTAL as Qf,$isTableCellNode as e1,$isTableNode as Jl,getTableElement as t1,TableNode as o1}from"@lexical/table";import{$findMatchingParent as r1,mergeRegister as n1}from"@lexical/utils";import{$getNearestNodeFromDOMNode as ql}from"lexical";import{useEffect as Ql,useMemo as i1,useRef as es,useState as no}from"react";import"react";import{createPortal as l1}from"react-dom";import{c as Gf}from"react/compiler-runtime";import{useEffect as Wf,useRef as Vf}from"react";var Bf="Expected a function",Hf=Math.max,jf=Math.min;function Uf(t,e,o){let r,n,i=0,l,s=!1,a=!1,u,c,d,m=!0;if(typeof t!="function")throw new TypeError(Bf);e=e||0,typeof o=="object"&&(s=!!o.leading,a="maxWait"in o,u=a?Hf(o.maxWait||0,e):u,m="trailing"in o?!!o.trailing:m);function p(g){let w=r,N=l;return r=l=void 0,i=g,c=t.apply(N,w),c}function f(g){return i=g,d=setTimeout(b,e),s?p(g):c}function h(g){let w=g-n,N=g-i,L=e-w;return a?jf(L,u-N):L}function C(g){let w=g-n,N=g-i;return n===void 0||w>=e||w<0||a&&N>=u}function b(){let g=Date.now();if(C(g))return k(g);d=setTimeout(b,h(g))}function k(g){return d=void 0,m&&r?p(g):(r=l=void 0,c)}function v(){d!==void 0&&clearTimeout(d),i=0,r=n=l=d=void 0}function x(){return d===void 0?c:k(Date.now())}function T(){let g=Date.now(),w=C(g);if(r=arguments,l=this,n=g,w){if(d===void 0)return f(n);if(a)return clearTimeout(d),d=setTimeout(b,e),p(n)}return d===void 0&&(d=setTimeout(b,e)),c}return T.cancel=v,T.flush=x,T}var zl=Uf;function Xl(t,e,o){let r=Gf(6),n=Vf(null),i,l;r[0]!==t||r[1]!==o||r[2]!==e?(i=()=>(n.current=zl(t,e,{maxWait:o}),()=>{n.current?.cancel()}),l=[t,e,o],r[0]=t,r[1]=o,r[2]=e,r[3]=i,r[4]=l):(i=r[3],l=r[4]),Wf(i,l);let s;return r[5]===Symbol.for("react.memo_cache_sentinel")?(s=(...u)=>{let c=u;n.current&&n.current(...c)},r[5]=s):s=r[5],s}var ts=20;function s1({anchorElem:t}){let[e]=os(),o=P(),[r,n]=no(!1),[i,l]=no(!1),[s,a]=no(!1),[u,c]=no({}),d=es(new Set),m=es(null),p=Xl(C=>{let{isOutside:b,tableDOMNode:k}=a1(C,o.editorConfig?.lexical);if(b){n(!1),l(!1);return}if(!k)return;m.current=k;let v=null,x=null,T=null;if(e.getEditorState().read(()=>{let g=ql(k);if(e1(g)){let w=r1(g,N=>Jl(N));if(!Jl(w))return;if(T=t1(w,e.getElementByKey(w.getKey())),T){let N=w.getChildrenSize(),L=w.getChildAtIndex(0)?.getChildrenSize(),S=Jf(g),I=Xf(g);S===N-1?v=g:I===L-1&&(x=g)}}},{editor:e}),T){let{bottom:g,height:w,left:N,right:L,width:S,y:I}=T.getBoundingClientRect(),{left:E,y:_}=t.getBoundingClientRect();v?(l(!1),n(!0),c({height:ts,left:N-E,top:g-_+5,width:S})):x&&(l(!0),n(!1),c({height:w,left:L-E+5,top:I-_,width:ts}))}},50,250),f=i1(()=>new ResizeObserver(()=>{n(!1),l(!1)}),[]);Ql(()=>{if(s)return document.addEventListener("mousemove",p),()=>{n(!1),l(!1),document.removeEventListener("mousemove",p)}},[s,p]),Ql(()=>n1(e.registerMutationListener(o1,C=>{e.getEditorState().read(()=>{let b=!1;for(let[k,v]of C)switch(v){case"created":{d.current.add(k),b=!0;break}case"destroyed":{d.current.delete(k),b=!0;break}default:break}if(b){f.disconnect();for(let k of d.current){let{tableElement:v}=zf(k);f.observe(v)}a(d.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let h=C=>{e.update(()=>{m.current&&(ql(m.current)?.selectEnd(),C?(Qf(),n(!1)):(qf(),l(!1)))})};return e?.isEditable()?Zf(Yf,{children:[r&&fr("button",{className:o.editorConfig.lexical.theme.tableAddRows,onClick:()=>h(!0),style:{...u},type:"button"}),i&&fr("button",{className:o.editorConfig.lexical.theme.tableAddColumns,onClick:()=>h(!1),style:{...u},type:"button"})]}):null}function a1(t,e){let o=t.target;if(o&&o instanceof HTMLElement){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 rs(t){let e=Kf(2),{anchorElem:o}=t,r=o===void 0?document.body:o,[n]=os();if(!n?.isEditable())return null;let i;return e[0]!==r?(i=l1(fr(s1,{anchorElem:r}),r),e[0]=r,e[1]=i):i=e[1],i}import{c as c1}from"react/compiler-runtime";import{jsx as hr,jsxs as u1}from"react/jsx-runtime";import{useLexicalComposerContext as d1}from"@lexical/react/LexicalComposerContext";import{TablePlugin as m1}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as p1,TableNode as f1}from"@lexical/table";import{mergeRegister as h1}from"@lexical/utils";import{formatDrawerSlug as g1,useEditDepth as C1}from"@payloadcms/ui";import{$getSelection as x1,$isRangeSelection as b1,COMMAND_PRIORITY_EDITOR as _1,createCommand as T1}from"lexical";import{createContext as w1,useContext as E1,useEffect as k1,useMemo as L1,useState as N1}from"react";import*as ns from"react";var io=T1("OPEN_EMBED_DRAWER_COMMAND"),is=w1({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function ls({children:t}){let[e,o]=N1({cellEditorConfig:null,cellEditorPlugins:null});return hr(is.Provider,{value:L1(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(r,n)=>{o({cellEditorConfig:r,cellEditorPlugins:n})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var ss=()=>{let t=c1(16),[e]=d1(),o=E1(is),r=C1(),{fieldProps:n,uuid:i}=P(),{schemaPath:l}=n,s="lexical-table-create-"+i,a;t[0]!==r||t[1]!==s?(a=g1({slug:s,depth:r}),t[0]=r,t[1]=s,t[2]=a):a=t[2];let u=a,{toggleDrawer:c}=ae(u,!0),d;t[3]!==e||t[4]!==c?(d=()=>{if(!e.hasNodes([f1]))throw new Error("TablePlugin: TableNode is not registered on editor");return h1(e.registerCommand(io,()=>{let h;return h=null,e.getEditorState().read(()=>{let C=x1();b1(C)&&(h=C)}),h&&c(),!0},_1))},t[3]=e,t[4]=c,t[5]=d):d=t[5];let m;t[6]!==o||t[7]!==e||t[8]!==c?(m=[o,e,c],t[6]=o,t[7]=e,t[8]=c,t[9]=m):m=t[9],k1(d,m);let p;t[10]!==e?(p=(h,C)=>{!C.columns||!C.rows||e.dispatchCommand(p1,{columns:String(C.columns),rows:String(C.rows)})},t[10]=e,t[11]=p):p=t[11];let f;return t[12]!==u||t[13]!==l||t[14]!==p?(f=u1(ns.Fragment,{children:[hr(Je,{drawerSlug:u,drawerTitle:"Create Table",featureKey:"experimental_table",handleDrawerSubmit:p,schemaPath:l,schemaPathSuffix:"fields"}),hr(m1,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]}),t[12]=u,t[13]=l,t[14]=p,t[15]=f):f=t[15],f};var y1=y({markdownTransformers:[Al],nodes:[S1,R1,I1],plugins:[{Component:ss,position:"normal"},{Component:Yl,position:"normal"},{Component:Gl,position:"floatingAnchorElem"},{Component:rs,position:"floatingAnchorElem"}],providers:[ls],slashMenu:{groups:[V([{Icon:or,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(io,{})}}])]},toolbarFixed:{groups:[de([{ChildComponent:or,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(io,{})}}])]}});import{$isNodeSelection as sh}from"lexical";import{jsx as gr,jsxs as v1}from"react/jsx-runtime";import"react";var Cr=()=>v1("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:[gr("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"}),gr("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"}),gr("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 F1}from"react/jsx-runtime";import us from"bson-objectid";import{$applyNodeReplacement as $1}from"lexical";import*as ds from"react";import{jsx as M1}from"react/jsx-runtime";import{DecoratorBlockNode as D1}from"@lexical/react/LexicalDecoratorBlockNode.js";import as from"bson-objectid";import{$applyNodeReplacement as A1}from"lexical";import"react";function xr(t){return t.parentElement!=null&&t.parentElement.tagName==="LI"&&t.previousSibling===null&&t.getAttribute("aria-roledescription")==="checkbox"}function O1(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:cs({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||xr(e),null}var Lt=class extends D1{__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:O1,priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new as.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value},r=cs({data:o});return r.setFormat(e.format),r}static isInline(){return!1}decorate(){return M1(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 cs({data:t}){return t?.id||(t.id=new as.default().toHexString()),A1(new Lt({data:t}))}var P1=ds.lazy(()=>import("./component-P5K7Z5NW.js").then(t=>({default:t.UploadComponent})));function B1(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:Oe({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||xr(e),null}var be=class extends Lt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:B1,priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new us.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value},r=Oe({data:o});return r.setFormat(e.format),r}decorate(){return F1(P1,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Oe({data:t}){return t?.id||(t.id=new us.default().toHexString()),$1(new be({data:t}))}function br(t){return t instanceof be}import{c as Z1}from"react/compiler-runtime";import{jsx as Y1}from"react/jsx-runtime";import{useLexicalComposerContext as z1}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as X1,mergeRegister as J1}from"@lexical/utils";import{useConfig as q1}from"@payloadcms/ui";import{$getPreviousSelection as Q1,$getSelection as eh,$isParagraphNode as th,$isRangeSelection as oh,COMMAND_PRIORITY_EDITOR as rh,createCommand as nh}from"lexical";import{useEffect as ih}from"react";import{c as ms}from"react/compiler-runtime";import{jsx as _r}from"react/jsx-runtime";import{useLexicalComposerContext as ps}from"@lexical/react/LexicalComposerContext.js";import{toast as H1}from"@payloadcms/ui";import{$getNodeByKey as j1,COMMAND_PRIORITY_EDITOR as fs}from"lexical";import{useEffect as hs,useState as U1}from"react";var G1=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=j1(o);n&&n.replace(Oe({data:{fields:null,relationTo:e,value:r}}))}):t.dispatchCommand(Tr,{fields:null,relationTo:e,value:r})},W1=t=>{let e=ms(13),{enabledCollectionSlugs:o}=t,[r]=ps(),[n,i]=U1(null),l;e[0]!==o?(l={collectionSlugs:o,uploads:!0},e[0]=o,e[1]=l):l=e[1];let{closeListDrawer:s,ListDrawer:a,openListDrawer:u}=Ct(l),c,d;e[2]!==r||e[3]!==u?(c=()=>r.registerCommand(He,h=>(i(h?.replace?h?.replace.nodeKey:null),u(),!0),fs),d=[r,u],e[2]=r,e[3]=u,e[4]=c,e[5]=d):(c=e[4],d=e[5]),hs(c,d);let m;e[6]!==s||e[7]!==r||e[8]!==n?(m=h=>{let{collectionSlug:C,docID:b}=h;s(),G1({editor:r,relationTo:C,replaceNodeKey:n,value:b})},e[6]=s,e[7]=r,e[8]=n,e[9]=m):m=e[9];let p=m,f;return e[10]!==a||e[11]!==p?(f=_r(a,{onSelect:p}),e[10]=a,e[11]=p,e[12]=f):f=e[12],f},V1=()=>{let t=ms(3),[e]=ps(),o,r;return t[0]!==e?(o=()=>e.registerCommand(He,K1,fs),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),hs(o,r),null},gs=t=>_r(Nt,{...t,FallbackComponent:V1,uploads:!0,children:_r(W1,{...t})});function K1(){return H1.error("No upload collections enabled"),!0}var Tr=nh("INSERT_UPLOAD_COMMAND"),Cs=t=>{let e=Z1(5),[o]=z1(),{config:r}=q1(),{collections:n}=r,i,l;e[0]!==o?(i=()=>{if(!o.hasNodes([be]))throw new Error("UploadPlugin: UploadNode not registered on editor");return J1(o.registerCommand(Tr,a=>(o.update(()=>{let u=eh()||Q1();if(oh(u)){let c=Oe({data:{id:a.id,fields:a.fields,relationTo:a.relationTo,value:a.value}});X1(c);let{focus:d}=u,m=d.getNode();th(m)&&!m.__first&&(m.__prev||m.__next)&&m.remove()}}),!0),rh))},l=[o],e[0]=o,e[1]=i,e[2]=l):(i=e[1],l=e[2]),ih(i,l);let s;return e[3]!==n?(s=Y1(gs,{enabledCollectionSlugs:n.map(lh)}),e[3]=n,e[4]=s):s=e[4],s};function lh(t){let{slug:e}=t;return e}var ah=y({nodes:[be],plugins:[{Component:Cs,position:"normal"}],slashMenu:{groups:[V([{Icon:Cr,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(He,{replace:!1})}}])]},toolbarFixed:{groups:[de([{ChildComponent:Cr,isActive:({selection:t})=>{if(!sh(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return br(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(He,{replace:!1})}}])]}});import{c as ch}from"react/compiler-runtime";import{jsx as Er}from"react/jsx-runtime";import{ShimmerEffect as uh}from"@payloadcms/ui";import{lazy as dh,Suspense as mh,useEffect as ph,useState as fh}from"react";var xs={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",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",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",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 lo={namespace:"lexical",theme:xs};function bs({featureClientSchemaMap:t,field:e,schemaPath:o,unSanitizedEditorConfig:r}){for(let s of r.features)if(!s?.clientFeatureProps?.featureKey||s?.clientFeatureProps?.order===void 0||s?.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.");r.features=r.features.sort((s,a)=>s.clientFeatureProps.order-a.clientFeatureProps.order);let n=new Map;for(let s of r.features)n.set(s.clientFeatureProps.featureKey,s);let i=new Map,l=0;for(let s of r.features){let a=typeof s.feature=="function"?s.feature({featureClientSchemaMap:t,featureProviderMap:n,field:e,resolvedFeatures:i,schemaPath:o,unSanitizedEditorConfig:r}):s.feature;a.key=s.clientFeatureProps.featureKey,a.order=l,i.set(s.clientFeatureProps.featureKey,a),l++}return i}var _s=t=>{let e={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}};if(!t?.size)return e;t.forEach(o=>{if(o.providers?.length&&(e.providers=e.providers.concat(o.providers)),o.enableFormats?.length&&e.enabledFormats.push(...o.enableFormats),o.nodes?.length)for(let r of o.nodes)e.nodes.push(r);if(o.plugins?.length&&o.plugins.forEach((r,n)=>{e.plugins?.push({clientProps:o.sanitizedClientFeatureProps,Component:r.Component,key:o.key+n,position:r.position})}),o.toolbarInline?.groups?.length)for(let r of o.toolbarInline.groups){let n=e.toolbarInline.groups.find(i=>i.key===r.key);n?e.toolbarInline.groups=e.toolbarInline.groups.filter(i=>i.key!==r.key):n={...r,items:[]},r?.items?.length&&(n.items=n.items.concat(r.items)),e.toolbarInline?.groups.push(n)}if(o.toolbarFixed?.groups?.length)for(let r of o.toolbarFixed.groups){let n=e.toolbarFixed.groups.find(i=>i.key===r.key);n?e.toolbarFixed.groups=e.toolbarFixed.groups.filter(i=>i.key!==r.key):n={...r,items:[]},r?.items?.length&&(n.items=n.items.concat(r.items)),e.toolbarFixed?.groups.push(n)}if(o.slashMenu?.groups){o.slashMenu.dynamicGroups?.length&&(e.slashMenu.dynamicGroups=e.slashMenu.dynamicGroups.concat(o.slashMenu.dynamicGroups));for(let r of o.slashMenu.groups){let n=e.slashMenu.groups.find(i=>i.key===r.key);n?e.slashMenu.groups=e.slashMenu.groups.filter(i=>i.key!==r.key):n={...r,items:[]},r?.items?.length&&(n.items=n.items.concat(r.items)),e.slashMenu.groups.push(n)}}if(o.markdownTransformers?.length)for(let r of o.markdownTransformers)typeof r=="function"?e.markdownTransformers.push(r({allNodes:e.nodes,allTransformers:e.markdownTransformers})):e.markdownTransformers.push(r);e.enabledFeatures.push(o.key)}),e.toolbarInline.groups.sort((o,r)=>o.order&&r.order?o.order-r.order:o.order?-1:r.order?1:0),e.toolbarFixed.groups.sort((o,r)=>o.order&&r.order?o.order-r.order:o.order?-1:r.order?1:0);for(let o of e.toolbarInline.groups)o.items.sort((r,n)=>r.order&&n.order?r.order-n.order:r.order?-1:n.order?1:0);for(let o of e.toolbarFixed.groups)o.items.sort((r,n)=>r.order&&n.order?r.order-n.order:r.order?-1:n.order?1:0);return e};function wr(t,e,o){return{admin:o,features:_s(t),lexical:e,resolvedFeatureMap:t}}var hh=dh(()=>import("./Field-LOLYH42M.js").then(t=>({default:t.RichText}))),gh=t=>{let e=ch(14),{admin:o,clientFeatures:r,featureClientSchemaMap:n,field:i,lexicalEditorConfig:l,schemaPath:s}=t,a;e[0]!==o?(a=o===void 0?{}:o,e[0]=o,e[1]=a):a=e[1];let u=a,c=l===void 0?lo:l,[d,m]=fh(null),p,f;e[2]!==u||e[3]!==r||e[4]!==n||e[5]!==i||e[6]!==d||e[7]!==c||e[8]!==s?(p=()=>{if(d)return;let C=[];for(let[v,x]of Object.entries(r))x.clientFeatureProvider&&C.push(x.clientFeatureProvider(x.clientFeatureProps));let b=c||lo,k=bs({featureClientSchemaMap:n,field:i,schemaPath:s??i.name,unSanitizedEditorConfig:{features:C,lexical:b}});m(wr(k,b,u))},f=[c,u,d,r,n,i,s],e[2]=u,e[3]=r,e[4]=n,e[5]=i,e[6]=d,e[7]=c,e[8]=s,e[9]=p,e[10]=f):(p=e[9],f=e[10]),ph(p,f);let h;return e[11]!==d||e[12]!==t?(h=Er(mh,{fallback:Er(uh,{height:"35vh"}),children:d&&Er(hh,{...t,editorConfig:d})}),e[11]=d,e[12]=t,e[13]=h):h=e[13],h};function Ch(...t){return t.filter(Boolean).join(" ")}var so=new WeakMap;function Ts(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function ao(t,e){let o=so.get(t);if(o===void 0){let r=new Set,n=l=>{o!==void 0&&(o.start=Ts(l))},i=l=>{if(o===void 0)return;let{start:s}=o;if(s===null)return;let a=Ts(l);for(let u of r)a!==null&&u([a[0]-s[0],a[1]-s[1]],l)};t.addEventListener("touchstart",n),t.addEventListener("touchend",i),o={handleTouchend:i,handleTouchstart:n,listeners:r,start:null},so.set(t,o)}return o.listeners.add(e),()=>{xh(t,e)}}function xh(t,e){let o=so.get(t);if(o===void 0)return;let{listeners:r}=o;r.delete(e),r.size===0&&(so.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function bh(t,e){return ao(t,(o,r)=>{let[n,i]=o;n<0&&-n>Math.abs(i)&&e(n,r)})}function _h(t,e){return ao(t,(o,r)=>{let[n,i]=o;n>0&&n>Math.abs(i)&&e(n,r)})}function Th(t,e){return ao(t,(o,r)=>{let[n,i]=o;i<0&&-i>Math.abs(n)&&e(n,r)})}function wh(t,e){return ao(t,(o,r)=>{let[n,i]=o;i>0&&i>Math.abs(n)&&e(n,r)})}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},Eh=O.IS_BOLD|O.IS_ITALIC|O.IS_STRIKETHROUGH|O.IS_UNDERLINE|O.IS_CODE|O.IS_SUBSCRIPT|O.IS_SUPERSCRIPT|O.IS_HIGHLIGHT,kh="\xA0",Lh=`
|
|
34
|
+
`},[t,e]),p=Re((x,_)=>{o(C=>{let w=e.length-1,R=e[w];if(R&&R.name===x){if(x==="type")return[...e.slice(0,w),{...R,value:R.value+_}];if(R.value===_)return[...e.slice(0,w),{...R,count:R.count+1}]}return[...C,{name:x,count:1,value:_}]})},[e,o]);nn(()=>{let x=C=>{if(!r)return;let w=C.key;Qa(C)?p("selectAll",""):sn.has(w)?p("press",C.key):[...w].length>1?p("keydown",C.key):p("type",C.key)},_=C=>{if(!r)return;let w=C.key;!sn.has(w)&&[...w].length>1&&p("keyup",C.key)};return t.registerRootListener((C,w)=>{w!==null&&(w.removeEventListener("keydown",x),w.removeEventListener("keyup",_)),C!==null&&(C.addEventListener("keydown",x),C.addEventListener("keyup",_))})},[t,r,p]),nn(()=>{c.current&&c.current.scrollTo(0,c.current.scrollHeight)},[m]),So(()=>{if(e){let x=m();x!==null&&s(x),c.current&&c.current.scrollTo(0,c.current.scrollHeight)}},[m,e]),So(()=>t.registerUpdateListener(({dirtyElements:_,dirtyLeaves:C,editorState:w})=>{if(!r)return;let R=w._selection,N=a.current,S=u.current;if(N!==R){if(C.size===0&&_.size===0&&!S){let E=Ro(t._window);if(E&&(E.anchorNode==null||E.focusNode==null))return}a.current=R}u.current=!1;let y=m();y!==null&&s(y)}),[t,m,r,p]),So(()=>r?t.registerUpdateListener(()=>{let _=t.getRootElement();_!==null&&i(_?.innerHTML)}):void 0,[t,r]);let f=Re(x=>{r||(x.update(()=>{let _=za();_.clear();let C=Ya();_.append(Za().append(C)),C.select()}),o([])),n(_=>!_)},[r]),h=Re(()=>{if(!r)return;let x=Ro(t._window);if(x===null||x.anchorNode==null||x.focusNode==null)return;let{anchorNode:_,anchorOffset:C,focusNode:w,focusOffset:R}=ec(x),N=d().getRootElement(),S;_!==null&&(S=ln(_,N));let y;w!==null&&(y=ln(w,N)),p("snapshot",{anchorNode:_,anchorOffset:C,anchorPath:S,focusNode:w,focusOffset:R,focusPath:y})},[p,r,d]),g=Re(()=>{Xa(m())},[m]),b=Re(()=>{Ja("test.js",m())},[m]);return[Se("button",{className:`editor-dev-button ${r?"active":""}`,id:"test-recorder-button",onClick:x=>{f(d()),x.preventDefault()},title:r?"Disable test recorder":"Enable test recorder",type:"button",children:r?"Disable test recorder":"Enable test recorder"}),r?yo("div",{className:"test-recorder-output",children:[yo("div",{className:"test-recorder-toolbar",children:[Se("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:x=>{h(),x.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Se("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:x=>{g(),x.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Se("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:x=>{b(),x.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Se("pre",{id:"test-recorder",ref:c,children:l})]}):null]}var cn=()=>{let t=Va(3),[e]=Ka(),[o,r]=tc(e),n;return t[0]!==o||t[1]!==r?(n=yo(an.Fragment,{children:[Se("p",{children:"HI"}),o,r,Se("p",{children:"DONE"})]}),t[0]=o,t[1]=r,t[2]=n):n=t[2],n};var oc=v({plugins:[{Component:cn,position:"bottom"}]});import{c as rc}from"react/compiler-runtime";import{jsx as nc}from"react/jsx-runtime";import{useLexicalComposerContext as ic}from"@lexical/react/LexicalComposerContext.js";import{TreeView as lc}from"@lexical/react/LexicalTreeView.js";import"react";var un=()=>{let t=rc(2),[e]=ic(),o;return t[0]!==e?(o=nc(lc,{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 sc=v({plugins:[{Component:un,position:"bottom"}]});import{$isTableSelection as ac}from"@lexical/table";import{$isRangeSelection as cc,FORMAT_TEXT_COMMAND as uc}from"lexical";import{jsx as dn}from"react/jsx-runtime";import"react";var mn=()=>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:"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 z=t=>({type:"buttons",items:t,key:"format",order:40});var pn={type:"text-format",format:["bold","italic"],tag:"***"},fn={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},hn={type:"text-format",format:["bold"],tag:"**"},gn={type:"text-format",format:["bold"],intraword:!1,tag:"__"};var Cn=[z([{ChildComponent:mn,isActive:({selection:t})=>cc(t)||ac(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(uc,"bold")},order:1}])],dc=v(({featureProviderMap:t})=>{let e=[hn,gn];return t.get("italic")&&e.push(fn,pn),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:Cn},toolbarInline:{groups:Cn}}});import{$isTableSelection as pc}from"@lexical/table";import{$isRangeSelection as fc,FORMAT_TEXT_COMMAND as hc}from"lexical";import{jsx as xn,jsxs as mc}from"react/jsx-runtime";import"react";var bn=()=>mc("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:[xn("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),xn("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]});var _n={type:"text-format",format:["code"],tag:"`"};var Tn=[z([{ChildComponent:bn,isActive:({selection:t})=>fc(t)||pc(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(hc,"code")},order:7}])],gc=v({enableFormats:["code"],markdownTransformers:[_n],toolbarFixed:{groups:Tn},toolbarInline:{groups:Tn}});import{$isTableSelection as Cc}from"@lexical/table";import{$isRangeSelection as xc,FORMAT_TEXT_COMMAND as bc}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:"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 kn={type:"text-format",format:["italic"],tag:"*"},Ln={type:"text-format",format:["italic"],intraword:!1,tag:"_"};var Nn=[z([{ChildComponent:En,isActive:({selection:t})=>xc(t)||Cc(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(bc,"italic")},order:2}])],_c=v({enableFormats:["italic"],markdownTransformers:[kn,Ln],toolbarFixed:{groups:Nn},toolbarInline:{groups:Nn}});import{$isTableSelection as wc}from"@lexical/table";import{$isRangeSelection as Ec,FORMAT_TEXT_COMMAND as kc}from"lexical";import{jsx as Rn,jsxs as Tc}from"react/jsx-runtime";import"react";var Sn=()=>Tc("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Rn("path",{d:"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"}),Rn("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]});var In={type:"text-format",format:["strikethrough"],tag:"~~"};var yn=[z([{ChildComponent:Sn,isActive:({selection:t})=>Ec(t)||wc(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(kc,"strikethrough")},order:4}])],Lc=v({enableFormats:["strikethrough"],markdownTransformers:[In],toolbarFixed:{groups:yn},toolbarInline:{groups:yn}});import{$isTableSelection as Nc}from"@lexical/table";import{$isRangeSelection as Rc,FORMAT_TEXT_COMMAND as Sc}from"lexical";import{jsx as vn}from"react/jsx-runtime";import"react";var Mn=()=>vn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:vn("path",{d:"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 Dn=[z([{ChildComponent:Mn,isActive:({selection:t})=>Rc(t)||Nc(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(Sc,"subscript")},order:5}])],Ic=v({enableFormats:["subscript"],toolbarFixed:{groups:Dn},toolbarInline:{groups:Dn}});import{$isTableSelection as yc}from"@lexical/table";import{$isRangeSelection as vc,FORMAT_TEXT_COMMAND as Mc}from"lexical";import{jsx as An}from"react/jsx-runtime";import"react";var On=()=>An("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:"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 Fn=[z([{ChildComponent:On,isActive:({selection:t})=>vc(t)||yc(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(Mc,"superscript")},order:6}])],Dc=v({enableFormats:["superscript"],toolbarFixed:{groups:Fn},toolbarInline:{groups:Fn}});import{$isTableSelection as Oc}from"@lexical/table";import{$isRangeSelection as Fc,FORMAT_TEXT_COMMAND as $c}from"lexical";import{jsx as $n,jsxs as Ac}from"react/jsx-runtime";import"react";var Pn=()=>Ac("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:[$n("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"}),$n("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]});var Bn=[z([{ChildComponent:Pn,isActive:({selection:t})=>Fc(t)||Oc(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand($c,"underline")},order:3}])],Pc=v({enableFormats:["underline"],toolbarFixed:{groups:Bn},toolbarInline:{groups:Bn}});import{$createHeadingNode as Uc,$isHeadingNode as Qn,HeadingNode as Gc}from"@lexical/rich-text";import{$setBlocksType as Wc}from"@lexical/selection";import{$getSelection as Vc,$isRangeSelection as Kc}from"lexical";import{jsx as Hn}from"react/jsx-runtime";import"react";var jn=()=>Hn("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:Hn("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 Un}from"react/jsx-runtime";import"react";var Gn=()=>Un("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:Un("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 Wn}from"react/jsx-runtime";import"react";var Vn=()=>Wn("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:Wn("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 Kn}from"react/jsx-runtime";import"react";var Zn=()=>Kn("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:Kn("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 Yn}from"react/jsx-runtime";import"react";var zn=()=>Yn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Yn("path",{d:"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 Xn}from"react/jsx-runtime";import"react";var Jn=()=>Xn("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:Xn("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 Bc,$isHeadingNode as Hc,HeadingNode as jc}from"@lexical/rich-text";var vo=t=>(e,o,r)=>{let n=t(r);n&&(n.append(...o),e.replace(n),n.select(0,0))};var qn=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`,r=new RegExp(o);return{type:"element",dependencies:[jc],export:(n,i)=>{if(!Hc(n))return null;let l=Number(n.getTag().slice(1));return"#".repeat(l)+" "+i(n)},regExp:r,replace:vo(n=>{let i="h"+n[1]?.length;return Bc(i)})}};var ei=t=>{let e=Vc();Wc(e,()=>Uc(t))},ti={h1:jn,h2:Gn,h3:Vn,h4:Zn,h5:zn,h6:Jn},Zc=v(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[X(e.map((r,n)=>({ChildComponent:ti[r],isActive:({selection:i})=>{if(!Kc(i))return!1;for(let l of i.getNodes()){if(Qn(l)&&l.getTag()===r)continue;let s=l.getParent();if(!(Qn(s)&&s.getTag()===r))return!1}return!0},key:r,label:({i18n:i})=>i.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:i})=>{i.update(()=>{ei(r)})},order:n+2})))];return{markdownTransformers:[qn(e)],nodes:[Gc],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[Y(e.map(r=>({Icon:ti[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(()=>{ei(r)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}});import{$isNodeSelection as cu}from"lexical";import{jsx as oi}from"react/jsx-runtime";import"react";var Mo=()=>oi("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:oi("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})});import{jsx as ri,jsxs as Yc}from"react/jsx-runtime";import"react";var ni=()=>Yc("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ri("path",{d:"M5 10h10",stroke:"currentColor"}),ri("path",{d:"M10 15V5",stroke:"currentColor"})]});var de=t=>({type:"dropdown",ChildComponent:ni,items:t,key:"add",order:10});import{addClassNamesToElement as zc}from"@lexical/utils";import{$applyNodeReplacement as Xc,createCommand as Jc,DecoratorNode as qc}from"lexical";var it=Jc("INSERT_HORIZONTAL_RULE_COMMAND"),nt=class extends qc{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:Qc,priority:0})}}static importJSON(e){return ii()}createDOM(e){let o=document.createElement("hr");return zc(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 Qc(){return{node:ii()}}function ii(){return Xc(new nt)}import{$applyNodeReplacement as eu}from"lexical";import"react";var Ee=class extends nt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return lt()}decorate(){return null}exportJSON(){return super.exportJSON()}};function lt(){return eu(new Ee)}function Ht(t){return t instanceof Ee}var li={type:"element",dependencies:[Ee],export:(t,e)=>Ht(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=lt();e&&t.replace(e)}};import{c as tu}from"react/compiler-runtime";import{useLexicalComposerContext as ou}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as ru}from"@lexical/utils";import{$getSelection as nu,$isRangeSelection as iu,COMMAND_PRIORITY_EDITOR as lu}from"lexical";import{useEffect as su}from"react";var si=()=>{let t=tu(3),[e]=ou(),o,r;return t[0]!==e?(o=()=>e.registerCommand(it,au,lu),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),su(o,r),null};function au(t){let e=nu();if(!iu(e))return!1;if(e.focus.getNode()!==null){let r=lt();ru(r)}return!0}var uu=v({markdownTransformers:[li],nodes:[Ee],plugins:[{Component:si,position:"normal"}],slashMenu:{groups:[Y([{Icon:Mo,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(it,void 0)}}])]},toolbarFixed:{groups:[de([{ChildComponent:Mo,isActive:({selection:t})=>{if(!cu(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Ht(e)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(it,void 0)}}])]}});import{TabIndentationPlugin as pu}from"@lexical/react/LexicalTabIndentationPlugin";import{INDENT_CONTENT_COMMAND as fu,OUTDENT_CONTENT_COMMAND as hu}from"lexical";import{jsx as jt,jsxs as du}from"react/jsx-runtime";import"react";var ai=()=>du("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:[jt("path",{d:"M2.5 5H10.5",stroke:"currentColor",strokeWidth:"1.5"}),jt("path",{d:"M2.5 10H10.5",stroke:"currentColor",strokeWidth:"1.5"}),jt("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"}),jt("path",{d:"M12.25 7.25L17.25 3.75V10.75L12.25 7.25Z",fill:"currentColor"})]});import{jsx as Ut,jsxs as mu}from"react/jsx-runtime";import"react";var ci=()=>mu("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:[Ut("path",{d:"M17.5 5H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Ut("path",{d:"M17.5 10H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Ut("path",{d:"M17.5 15H2.5",stroke:"currentColor",strokeWidth:"1.5"}),Ut("path",{d:"M7.75 7.25L2.75 3.75V10.75L7.75 7.25Z",fill:"currentColor"})]});var ui=t=>({type:"buttons",items:t,key:"indent",order:35});var di=[ui([{ChildComponent:ai,isActive:()=>!1,isEnabled:({selection:t})=>{if(!t||!t?.getNodes()?.length)return!1;for(let e of t.getNodes()){let o=e.getParentOrThrow();if("__indent"in e&&e.__indent>0||"__indent"in o&&o.__indent>0)return!0}return!1},key:"indentDecrease",label:({i18n:t})=>t.t("lexical:indent:decreaseLabel"),onSelect:({editor:t})=>{t.dispatchCommand(hu,void 0)},order:1},{ChildComponent:ci,isActive:()=>!1,key:"indentIncrease",label:({i18n:t})=>t.t("lexical:indent:increaseLabel"),onSelect:({editor:t})=>{t.dispatchCommand(fu,void 0)},order:2}])],gu=v({plugins:[{Component:pu,position:"normal"}],toolbarFixed:{groups:di},toolbarInline:{groups:di}});import{$findMatchingParent as Sd}from"@lexical/utils";import{$getSelection as jo,$isRangeSelection as Ui}from"lexical";import{jsx as mi}from"react/jsx-runtime";import"react";var pi=()=>mi("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:mi("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 fi}from"@lexical/selection";function Be(t){let{anchor:e}=t,{focus:o}=t,r=t.anchor.getNode(),n=t.focus.getNode();return r===n?r:t.isBackward()?fi(o)?r:n:fi(e)?r:n}var Do=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as Ru}from"lexical";import{addClassNamesToElement as Cu,isHTMLAnchorElement as xu}from"@lexical/utils";import Fo from"bson-objectid";import{$applyNodeReplacement as bu,$createTextNode as hi,$getSelection as _u,$isElementNode as gi,$isRangeSelection as Oo,createCommand as Tu,ElementNode as wu}from"lexical";var Eu=new Set(["http:","https:","mailto:","sms:","tel:"]),J=class t extends wu{__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:ku,priority:1})}}static importJSON(e){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 Fo.default().toHexString(),e.version=3);let o=me({id:e.id,fields:e.fields});return o.setFormat(e.format),o.setIndent(e.indent),o.setDirection(e.direction),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=Ao(o.rel,"add","noopener")),Cu(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(!Oo(o))return!1;let n=o.anchor.getNode(),i=o.focus.getNode();return this.isParentOf(n)&&this.isParentOf(i)&&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(gi(r)){let n=me({fields:this.__fields});return r.append(n),n}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!Eu.has(o.protocol))return"about:blank"}catch{return"https://"}return e}setFields(e){let o=this.getWritable();o.__fields=e}updateDOM(e,o,r){let n=this.__fields?.url,i=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=""),i!==e.__fields?.newTab&&(i??!1?(o.target="_blank",this.__fields?.linkType==="custom"&&(o.rel=Ao(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=Ao(o.rel,"remove","noopener"))),!1}};function ku(t){let e=null;if(xu(t)){let o=t.textContent;o!==null&&o!==""&&(e=me({id:new Fo.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function me({id:t,fields:e}){return bu(new J({id:t??new Fo.default().toHexString(),fields:e}))}function K(t){return t instanceof J}var ne=Tu("TOGGLE_LINK_COMMAND");function $o(t){let e=_u();if(!Oo(e)&&(t===null||!t.selectedNodes?.length))return;let o=Oo(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(i=>{let l=i.getParent();K(l)&&(l.getChildren().forEach(a=>{l.insertBefore(a)}),l.remove())});return}if(o?.length===1){let i=o[0],l=K(i)?i:Lu(i);if(l!==null){l.setFields(t.fields),t.text!=null&&t.text!==l.getTextContent()&&(l.append(hi(t.text)),l.getChildren().forEach(s=>{s!==l.getLastChild()&&s.remove()}));return}}let r=null,n=null;o?.forEach(i=>{let l=i.getParent();if(!(l===n||l===null||gi(i)&&!i.isInline())){if(K(l)){n=l,l.setFields(t.fields),t.text!=null&&t.text!==l.getTextContent()&&(l.append(hi(t.text)),l.getChildren().forEach(s=>{s!==l.getLastChild()&&s.remove()}));return}if(l.is(r)||(r=l,n=me({fields:t.fields}),K(l)?i.getPreviousSibling()===null?l.insertBefore(n):l.insertAfter(n):i.insertBefore(n)),K(i)){if(i.is(n))return;if(n!==null){let s=i.getChildren();n.append(...s)}i.remove();return}n!==null&&n.append(i)}})}function Lu(t){return Nu(t,e=>K(e))}function Nu(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function Ao(t,e,o){let r,n=`${t}`;if(e==="add"){if(n.includes(o)){let i=new RegExp(o,"g");n=n.replace(i,"").trim()}n=n.trim(),r=n.length===0?`${o}`:`${n} ${o}`}else{let i=new RegExp(o,"g");r=n.replace(i,"").trim()}return r}var Ci={type:"text-match",dependencies:[J],export:(t,e)=>{if(!K(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=me({fields:{doc:null,linkType:"custom",newTab:!1,url:r}}),i=Ru(o);return i.setFormat(t.getFormat()),n.append(i),t.replace(n),i},trigger:")"};import{$applyNodeReplacement as Su,$isElementNode as Iu}from"lexical";var pe=class t extends J{static clone(e){return new t({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){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);let o=st({fields:e.fields});return o.setFormat(e.format),o.setIndent(e.indent),o.setDirection(e.direction),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(Iu(r)){let n=st({fields:this.__fields});return r.append(n),n}return null}};function st({fields:t}){return Su(new pe({id:"",fields:t}))}function fe(t){return t instanceof pe}import{c as yu}from"react/compiler-runtime";import{useLexicalComposerContext as vu}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Mu}from"@lexical/utils";import{$createTextNode as xi,$getSelection as Du,$isElementNode as _i,$isLineBreakNode as Ti,$isNodeSelection as Au,$isRangeSelection as Ou,$isTextNode as at,TextNode as Fu}from"lexical";import{useEffect as $u}from"react";function bi(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 wi(t,e){for(let o of e){let r=o(t);if(r!=null)return r}return null}var Pu=/[.,;\s]/;function Wt(t){return t!==void 0&&Pu.test(t)}function Ei(t){return Wt(t[t.length-1])}function Bo(t){return Wt(t[0])}function Bu(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function ki(t){let e=t.getPreviousSibling();return _i(e)&&(e=e.getLastDescendant()),e===null||Ti(e)||at(e)&&Ei(e.getTextContent())}function Li(t){let e=t.getNextSibling();return _i(e)&&(e=e.getFirstDescendant()),e===null||Ti(e)||at(e)&&Bo(e.getTextContent())}function Hu(t,e,o,r){return(t>0?Wt(o[t-1]):ki(r[0]))?e<o.length?Wt(o[e]):Li(r[r.length-1]):!1}function ju(t,e,o){let r=[],n=[],i=[],l=0,s=0,a=[...t];for(;a.length>0;){let u=a[0],d=u.getTextContent().length,m=s;s+d<=e?(r.push(u),l+=d):m>=o?i.push(u):n.push(u),s+=d,a.shift()}return[l,r,n,i]}function Uu(t,e,o,r){let n={linkType:"custom",url:r.url,...r.fields},i=st({fields:n});if(t.length===1){let l=e===0?t[0]?.splitText(o):t[0]?.splitText(e,o),[s,a]=l;if(s){let u=xi(r.text);u.setFormat(s.getFormat()),u.setDetail(s.getDetail()),u.setStyle(s.getStyle()),i.append(u),s.replace(i)}return a}else if(t.length>1){let l=t[0],s=l.getTextContent().length,a;e===0?a=l:[,a]=l.splitText(e);let u=[],c;if(t.forEach(d=>{let p=d.getTextContent().length,f=s,h=s+p;if(f<o)if(h<=o)u.push(d);else{let[g,b]=d.splitText(o-f);g&&u.push(g),c=b}s+=p}),a){let d=Du(),m=d?d.getNodes().find(at):void 0,p=xi(a.getTextContent());return p.setFormat(a.getFormat()),p.setDetail(a.getDetail()),p.setStyle(a.getStyle()),i.append(p,...u),m&&m===a&&(Ou(d)?p.select(d.anchor.offset,d.focus.offset):Au(d)&&p.select(0,p.getTextContent().length)),a.replace(i),c}}}function Gu(t,e,o){let r=[...t],n=r.map(a=>a.getTextContent()).join(""),i=n,l,s=0;for(;(l=wi(i,e))!=null&&l!==null;){let a=l.index,u=l.length,c=a+u;if(Hu(s+a,s+c,n,r)){let[m,,p,f]=ju(r,s+a,s+c),h=s+a-m,g=s+c-m,b=Uu(p,h,g,l);r=b?[b,...f]:f,o(l.url,null),s=0}else s+=c;i=i.substring(c)}}function Po(t,e,o){let r=t.getChildren(),n=r.length;for(let a=0;a<n;a++){let u=r[a];if(!at(u)||!u.isSimpleText()){Gt(t),o(null,t.getFields()?.url??null);return}}let i=t.getTextContent(),l=wi(i,e);if(l===null||l.text!==i){Gt(t),o(null,t.getFields()?.url??null);return}if(!ki(t)||!Li(t)){Gt(t),o(null,t.getFields()?.url??null);return}let s=t.getFields()?.url;if(s!==l?.url){let a=t.getFields();a.url=l?.url,t.setFields(a),o(l.url,s??null)}}function Wu(t,e,o){let r=t.getPreviousSibling(),n=t.getNextSibling(),i=t.getTextContent();if(fe(r)){let l=r.getFields()?.url?r.getFields()?.url?.startsWith("mailto:")??!1:!1;(!Bo(i)||Bu(i,l))&&(r.append(t),Po(r,e,o),o(null,r.getFields()?.url??null))}fe(n)&&!Ei(i)&&(Gt(n),Po(n,e,o),o(null,n.getFields()?.url??null))}function Gt(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 Vu(t){let e=[t],o=t.getNextSibling();for(;o!==null&&at(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function Ku(t,e,o){let r=yu(5),n,i;r[0]!==t||r[1]!==e||r[2]!==o?(n=()=>{if(!t.hasNodes([pe]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let l=(s,a)=>{o?.(s,a)};return Mu(t.registerNodeTransform(Fu,s=>{let a=s.getParentOrThrow(),u=s.getPreviousSibling();if(fe(a))Po(a,e,l);else if(!K(a)){if(s.isSimpleText()&&(Bo(s.getTextContent())||!fe(u))){let c=Vu(s);Gu(c,e,l)}Wu(s,e,l)}}))},i=[t,e,o],r[0]=t,r[1]=e,r[2]=o,r[3]=n,r[4]=i):(n=r[3],i=r[4]),$u(n,i)}var Zu=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,Yu=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,zu=[bi(Zu,t=>t.startsWith("http")?t:`https://${t}`),bi(Yu,t=>`mailto:${t}`)],Ni=()=>{let[t]=vu();return Ku(t,zu),null};import{jsx as Xu}from"react/jsx-runtime";import{ClickableLinkPlugin as Ju}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var Ri=()=>Xu(Ju,{});import{jsx as hd}from"react/jsx-runtime";import"react";import{createPortal as gd}from"react-dom";import{jsx as he,jsxs as ct,Fragment as Qu}from"react/jsx-runtime";import{useLexicalComposerContext as ed}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as Si,mergeRegister as Ii}from"@lexical/utils";import{getTranslation as Ho}from"@payloadcms/translations";import{CloseMenuIcon as td,EditIcon as od,ExternalLinkIcon as yi,formatDrawerSlug as rd,useConfig as nd,useEditDepth as id,useLocale as ld,useTranslation as sd}from"@payloadcms/ui";import{requests as ad}from"@payloadcms/ui/shared";import{$getSelection as vi,$isLineBreakNode as cd,$isRangeSelection as Mi,COMMAND_PRIORITY_HIGH as ud,COMMAND_PRIORITY_LOW as Di,getDOMSelection as dd,KEY_ESCAPE_COMMAND as md,SELECTION_CHANGE_COMMAND as pd}from"lexical";import Ai,{useCallback as Oi,useEffect as Zt,useRef as fd,useState as Ie}from"react";function Vt(t,e,o,r=10,n=5){let i=o.parentElement;if(t===null||i==null){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let l=e.getBoundingClientRect(),s=o.getBoundingClientRect(),a=i.getBoundingClientRect(),u=t.top-r,c=t.left-n;u<a.top&&(u+=l.height+t.height+r*2),c+l.width>a.right&&(c=a.right-l.width-n),u-=s.top,c-=s.left,e.style.opacity="1",e.style.transform=`translate(${c}px, ${u}px)`}import{createCommand as qu}from"lexical";var Kt=qu("TOGGLE_LINK_WITH_MODAL_COMMAND");function Fi(t){t.preventDefault()}function $i({anchorElem:t}){let[e]=ed(),[o,r]=Ie(),n=fd(null),[i,l]=Ie(null),[s,a]=Ie(null),{fieldProps:{schemaPath:u},uuid:c}=P(),{config:d,getEntityConfig:m}=nd(),{i18n:p,t:f}=sd(),[h,g]=Ie(),b=id(),[L,D]=Ie(!1),[x,_]=Ie([]),C=ld(),[w,R]=Ie(!1),N=rd({slug:"lexical-rich-text-link-"+c,depth:b}),{toggleDrawer:S}=ae(N),y=Oi(()=>{D(!1),n&&n.current&&(n.current.style.opacity="0",n.current.style.transform="translate(-10000px, -10000px)"),R(!1),l(null),a(null),_([]),g(void 0)},[D,l,a,_]),E=Oi(()=>{let T=vi(),k;if(!Mi(T)||!T){y();return}let I=Be(T);k=e.getElementByKey(I.getKey())?.getBoundingClientRect();let M=Si(I,K),O=T.getNodes().filter(U=>!cd(U)).find(U=>{let ee=Si(U,K);return M&&!M.is(ee)||ee&&!ee.is(M)});if(M==null||O){y();return}r(M);let A=M.getFields(),H={...A,id:M.getID(),text:M.getTextContent()};if(A?.linkType==="custom")l(A?.url??null),a(null);else{l(`${d.routes.admin==="/"?"":d.routes.admin}/collections/${A?.doc?.relationTo}/${A?.doc?.value}`);let U=A?.doc?.relationTo?m({collectionSlug:A?.doc?.relationTo}):void 0;if(!U)a(A?.label?String(A?.label):null),l(A?.url?String(A?.url):null);else{let ee=typeof A.doc?.value=="object"?A.doc.value.id:A.doc?.value,se=A.doc?.relationTo;if(!ee||!se)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let Ze=f("fields:linkedTo",{label:`${Ho(U.labels.singular,p)} - ${f("lexical:link:loadingWithEllipsis",p)}`}).replace(/<[^>]*>?/g,"");a(Ze),ad.get(`${d.serverURL}${d.routes.api}/${se}/${ee}`,{headers:{"Accept-Language":p.language},params:{depth:0,locale:C?.code}}).then(async _e=>{if(!_e.ok)throw new Error(`HTTP error! Status: ${_e.status}`);let Te=await _e.json(),Lt=U?.admin?.useAsTitle||"id",Oe=Te[Lt],Fe=f("fields:linkedTo",{label:`${Ho(U.labels.singular,p)} - ${Oe}`}).replace(/<[^>]*>?/g,"");a(Fe)}).catch(()=>{let _e=f("fields:linkedTo",{label:`${Ho(U.labels.singular,p)} - ${f("general:untitled",p)} - ID: ${ee}`}).replace(/<[^>]*>?/g,"");a(_e)})}}g(H),D(!0),_(T?T?.getNodes():[]),fe(M)?R(!0):R(!1);let j=n.current,Q=dd(e._window),{activeElement:mo}=document;if(j===null)return;let kt=e.getRootElement();return Q!==null&&kt!==null&&kt.contains(Q.anchorNode)?(k||(k=Q.getRangeAt(0).getBoundingClientRect()),k!=null&&(k.y+=40,Vt(k,j,t))):(mo==null||mo.className!=="link-input")&&(kt!==null&&Vt(null,j,t),l(null),a(null)),!0},[e,y,d.routes.admin,d.routes.api,d.serverURL,m,f,p,C?.code,t]);return Zt(()=>Ii(e.registerCommand(Kt,T=>(e.dispatchCommand(ne,T),E(),S(),!0),Di)),[e,E,S,N]),Zt(()=>{let T=t.parentElement,k=()=>{e.getEditorState().read(()=>{E()})};return window.addEventListener("resize",k),T?.addEventListener("scroll",k),()=>{window.removeEventListener("resize",k),T?.removeEventListener("scroll",k)}},[t.parentElement,e,E]),Zt(()=>Ii(e.registerUpdateListener(({editorState:T})=>{T.read(()=>{E()})}),e.registerCommand(pd,()=>(E(),!0),Di),e.registerCommand(md,()=>L?(y(),!0):!1,ud)),[e,E,L,y]),Zt(()=>{e.getEditorState().read(()=>{E()})},[e,E]),ct(Ai.Fragment,{children:[he("div",{className:"link-editor",ref:n,children:ct("div",{className:"link-input",children:[i&&i.length>0?ct("a",{href:i,rel:"noopener noreferrer",target:"_blank",children:[o?.__fields.newTab?he(yi,{}):null,s!=null&&s.length>0?s:i]}):s!=null&&s.length>0?ct(Qu,{children:[o?.__fields.newTab?he(yi,{}):null,he("span",{className:"link-input__label-pure",children:s})]}):null,e.isEditable()&&ct(Ai.Fragment,{children:[he("button",{"aria-label":"Edit link",className:"link-edit",onClick:T=>{T.preventDefault(),S()},onMouseDown:Fi,tabIndex:0,type:"button",children:he(od,{})}),!w&&he("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(ne,null)},onMouseDown:Fi,tabIndex:0,type:"button",children:he(td,{})})]})]})}),he(Ye,{className:"lexical-link-edit-drawer",data:h,drawerSlug:N,drawerTitle:f("fields:editLink"),featureKey:"link",handleDrawerSubmit:(T,k)=>{let I=k,M={...I};delete M.text,e.update(()=>{let O=vi(),A=null;if(Mi(O)?A=Be(O).getParent():x.length&&(A=x[0]?.getParent()??null),A&&fe(A)){let H=me({fields:M});A.replace(H,!0)}}),e.dispatchCommand(ne,{fields:M,selectedNodes:x,text:I.text})},schemaPath:u,schemaPathSuffix:"fields"})]})}var Pi=t=>{let{anchorElem:e=document.body}=t;return gd(hd($i,{anchorElem:e}),e)};import{c as bd}from"react/compiler-runtime";import{useLexicalComposerContext as _d}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Td}from"@lexical/utils";import{$getSelection as wd,$isElementNode as Ed,$isRangeSelection as kd,COMMAND_PRIORITY_LOW as Hi,PASTE_COMMAND as Ld}from"lexical";import{useEffect as Nd}from"react";var Cd=/^(?:[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+)?$/,xd=/^(?:\/[\w\-./]*(?:#\w[\w-]*)?|#[\w\-]+)$/;function Bi(t){if(!t)return!1;if(t==="https://"||Cd.test(t)||xd.test(t))return!0;try{return new URL(t),!0}catch{}return!1}var ji=t=>{let e=bd(5),{clientProps:o}=t,[r]=_d(),n,i;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==r?(n=()=>{if(!r.hasNodes([J]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Td(r.registerCommand(ne,l=>l===null?($o(null),!0):(l.fields?.linkType||(l.fields.linkType=o.defaultLinkType),l.fields?.url||(l.fields.url=o.defaultLinkURL),$o(l),!0),Hi),r.registerCommand(Ld,l=>{let s=wd();if(!kd(s)||s.isCollapsed()||!(l instanceof ClipboardEvent)||l.clipboardData==null)return!1;let a=l.clipboardData.getData("text");if(!Bi(a))return!1;if(!s.getNodes().some(Rd)){let u={doc:null,linkType:"custom",newTab:!1,url:a};return r.dispatchCommand(ne,{fields:u,text:null}),l.preventDefault(),!0}return!1},Hi))},i=[o.defaultLinkType,o.defaultLinkURL,r],e[0]=o.defaultLinkType,e[1]=o.defaultLinkURL,e[2]=r,e[3]=n,e[4]=i):(n=e[3],i=e[4]),Nd(n,i),null};function Rd(t){return Ed(t)}var Gi=[Do([{ChildComponent:pi,isActive:({selection:t})=>{if(Ui(t)){let e=Be(t);return Sd(e,K)!=null}return!1},isEnabled:({selection:t})=>!!(Ui(t)&&jo()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(ne,null);else{let o,r=[];if(t.getEditorState().read(()=>{o=jo()?.getTextContent(),r=jo()?.getNodes()??[]}),!o?.length)return;let n={doc:null,newTab:!1};t.dispatchCommand(Kt,{fields:n,selectedNodes:r,text:o})}},order:1}])],Id=v({markdownTransformers:[Ci],nodes:[J,pe],plugins:[{Component:ji,position:"normal"},{Component:Ni,position:"normal"},{Component:Ri,position:"normal"},{Component:Pi,position:"floatingAnchorElem"}],toolbarFixed:{groups:Gi},toolbarInline:{groups:Gi}});import{$isListNode as Wo,INSERT_CHECK_LIST_COMMAND as zi,ListItemNode as jd,ListNode as Ud}from"@lexical/list";import{$isRangeSelection as Gd}from"lexical";import{jsx as Wi,jsxs as yd}from"react/jsx-runtime";import"react";var Uo=()=>yd("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:[Wi("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),Wi("path",{d:"M7 10L9 12.5L13 7.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as vd}from"react/jsx-runtime";import{ListPlugin as Md}from"@lexical/react/LexicalListPlugin.js";import"react";var He=()=>vd(Md,{});function je(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{$isListNode as Fd,ListItemNode as $d,ListNode as Pd}from"@lexical/list";import{$createListItemNode as Dd,$createListNode as Ad,$isListItemNode as Od,$isListNode as Go}from"@lexical/list";var Vi=4,Ue=t=>(e,o,r)=>{let n=e.getPreviousSibling(),i=e.getNextSibling(),l=Dd(t==="check"?r[3]==="x":void 0);if(Go(i)&&i.getListType()===t){let a=i.getFirstChild();a!==null?a.insertBefore(l):i.append(l),e.remove()}else if(Go(n)&&n.getListType()===t)n.append(l),e.remove();else{let a=Ad(t,t==="number"?Number(r[2]):void 0);a.append(l),e.replace(a)}l.append(...o),l.select(0,0);let s=Math.floor(r[1].length/Vi);s&&l.setIndent(s)},ye=(t,e,o)=>{let r=[],n=t.getChildren(),i=0;for(let l of n)if(Od(l)){if(l.getChildrenSize()===1){let c=l.getFirstChild();if(Go(c)){r.push(ye(c,e,o+1));continue}}let s=" ".repeat(o*Vi),a=t.getListType(),u=a==="number"?`${t.getStart()+i}. `:a==="check"?`- [${l.getChecked()?"x":" "}] `:"- ";r.push(s+u+e(l)),i++}return r.join(`
|
|
36
|
+
`)};var Ki={type:"element",dependencies:[Pd,$d],export:(t,e)=>Fd(t)?ye(t,e,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:Ue("check")};import{jsx as Bd}from"react/jsx-runtime";import{CheckListPlugin as Hd}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var Zi=()=>Bd(Hd,{});var Yi=[X([{ChildComponent:Uo,isActive:({selection:t})=>{if(!Gd(t))return!1;for(let e of t.getNodes()){if(Wo(e)&&e.getListType()==="check")continue;let o=e.getParent();if(Wo(o)&&o.getListType()==="check")continue;let r=o?.getParent();if(!(Wo(r)&&r.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:t})=>t.t("lexical:checklist:label"),onSelect:({editor:t})=>{t.dispatchCommand(zi,void 0)},order:12}])],Wd=v(({featureProviderMap:t})=>{let e=[{Component:Zi,position:"normal"}];return!t.has("unorderedList")&&!t.has("orderedList")&&e.push({Component:He,position:"normal"}),{markdownTransformers:[Ki],nodes:t.has("unorderedList")||t.has("orderedList")?[]:[Ud,jd],plugins:e,slashMenu:{groups:[je([{Icon:Uo,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:o})=>o.t("lexical:checklist:label"),onSelect:({editor:o})=>{o.dispatchCommand(zi,void 0)}}])]},toolbarFixed:{groups:Yi},toolbarInline:{groups:Yi}}});import{$isListNode as Ko,INSERT_ORDERED_LIST_COMMAND as qi,ListItemNode as zd,ListNode as Xd}from"@lexical/list";import{$isRangeSelection as Jd}from"lexical";import{jsx as ut,jsxs as Vd}from"react/jsx-runtime";import"react";var Vo=()=>Vd("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:[ut("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"}),ut("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"}),ut("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),ut("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),ut("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as Kd,ListItemNode as Zd,ListNode as Yd}from"@lexical/list";var Xi={type:"element",dependencies:[Yd,Zd],export:(t,e)=>Kd(t)?ye(t,e,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:Ue("number")};var Ji=[X([{ChildComponent:Vo,isActive:({selection:t})=>{if(!Jd(t))return!1;for(let e of t.getNodes()){if(Ko(e)&&e.getListType()==="number")continue;let o=e.getParent();if(Ko(o)&&o.getListType()==="number")continue;let r=o?.getParent();if(!(Ko(r)&&r.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:t})=>t.t("lexical:orderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(qi,void 0)},order:10}])],qd=v(({featureProviderMap:t})=>({markdownTransformers:[Xi],nodes:t.has("orderedList")?[]:[Xd,zd],plugins:t.has("orderedList")?[]:[{Component:He,position:"normal"}],slashMenu:{groups:[je([{Icon:Vo,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:e})=>e.t("lexical:orderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(qi,void 0)}}])]},toolbarFixed:{groups:Ji},toolbarInline:{groups:Ji}}));import{$isListNode as Yo,INSERT_UNORDERED_LIST_COMMAND as tl,ListItemNode as rm,ListNode as nm}from"@lexical/list";import{$isRangeSelection as im}from"lexical";import{jsx as Ge,jsxs as Qd}from"react/jsx-runtime";import"react";var Zo=()=>Qd("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:[Ge("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Ge("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Ge("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Ge("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),Ge("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),Ge("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as em,ListItemNode as tm,ListNode as om}from"@lexical/list";var Qi={type:"element",dependencies:[om,tm],export:(t,e)=>em(t)?ye(t,e,0):null,regExp:/^(\s*)[-*+]\s/,replace:Ue("bullet")};var el=[X([{ChildComponent:Zo,isActive:({selection:t})=>{if(!im(t))return!1;for(let e of t.getNodes()){if(Yo(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(Yo(o)&&o.getListType()==="bullet")continue;let r=o?.getParent();if(!(Yo(r)&&r.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(tl,void 0)},order:11}])],lm=v({markdownTransformers:[Qi],nodes:[nm,rm],plugins:[{Component:He,position:"normal"}],slashMenu:{groups:[je([{Icon:Zo,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(tl,void 0)}}])]},toolbarFixed:{groups:el},toolbarInline:{groups:el}});import{jsx as sm}from"react/jsx-runtime";import{addClassNamesToElement as am}from"@lexical/utils";import{DecoratorNode as cm}from"lexical";import*as ol from"react";var um=ol.lazy(()=>import("./Component-MBLHTKDK.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),dt=class t extends cm{__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 dm({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return am(o,"unknownConverted"),o}decorate(){return sm(um,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function dm({data:t}){return new dt({data:t})}var mm=v(()=>({nodes:[dt]}));import{jsx as pm}from"react/jsx-runtime";import{addClassNamesToElement as fm}from"@lexical/utils";import{DecoratorNode as hm}from"lexical";import*as rl from"react";var gm=rl.lazy(()=>import("./Component-DOSSWC76.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),mt=class t extends hm{__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 Cm({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return fm(o,"unknownConverted"),o}decorate(){return pm(gm,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function Cm({data:t}){return new mt({data:t})}var xm=v(()=>({nodes:[mt]}));import{$setBlocksType as ll}from"@lexical/selection";import{$createParagraphNode as sl,$getSelection as al,$isParagraphNode as nl,$isRangeSelection as bm}from"lexical";var il=[X([{ChildComponent:Xe,isActive:({selection:t})=>{if(!bm(t))return!1;for(let e of t.getNodes())if(!nl(e)&&!nl(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=al();ll(e,()=>sl())})},order:1}])],_m=v({slashMenu:{groups:[Y([{Icon:Xe,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=al();ll(e,()=>sl())})}}])]},toolbarFixed:{groups:il},toolbarInline:{groups:il}});import{$isNodeSelection as np}from"lexical";import{jsx as pt,jsxs as Tm}from"react/jsx-runtime";import"react";var zo=()=>Tm("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:[pt("g",{clipPath:"url(#clip0_4397_10817)",children:pt("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"})}),pt("defs",{children:pt("clipPath",{id:"clip0_4397_10817",children:pt("rect",{fill:"currentColor",height:"12",transform:"translate(4 4)",width:"12"})})})]});import{jsx as km}from"react/jsx-runtime";import*as ul from"react";import{DecoratorBlockNode as wm}from"@lexical/react/LexicalDecoratorBlockNode.js";function Em(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:cl({relationTo:o,value:e})}:null}var ft=class extends wm{__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:Em,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=cl(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 cl(t){return new ft({data:t})}var Lm=ul.lazy(()=>import("./RelationshipComponent-JPESGV4Q.js").then(t=>({default:t.RelationshipComponent})));function Nm(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:ve({relationTo:o,value:e})}:null}var ge=class extends ft{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:Nm,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=ve(o);return r.setFormat(e.format),r}decorate(e,o){return km(Lm,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function ve(t){return new ge({data:t})}function Xo(t){return t instanceof ge}import{c as Wm}from"react/compiler-runtime";import{jsx as Vm}from"react/jsx-runtime";import{useLexicalComposerContext as Km}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Zm}from"@lexical/utils";import{useConfig as Ym}from"@payloadcms/ui";import{$getPreviousSelection as zm,$getSelection as Xm,$isParagraphNode as gl,$isRangeSelection as Jm,COMMAND_PRIORITY_EDITOR as qm,createCommand as Qm}from"lexical";import{useEffect as ep}from"react";import{c as Pm}from"react/compiler-runtime";import{jsx as Yt}from"react/jsx-runtime";import{useLexicalComposerContext as Bm}from"@lexical/react/LexicalComposerContext.js";import{$getNodeByKey as Hm,COMMAND_PRIORITY_EDITOR as jm}from"lexical";import{useEffect as Um,useState as pl}from"react";import{c as Rm}from"react/compiler-runtime";import{jsx as Sm}from"react/jsx-runtime";import{useLexicalComposerContext as Im}from"@lexical/react/LexicalComposerContext";import{useListDrawer as ym,useModal as vm}from"@payloadcms/ui";import{$getNodeByKey as dl,$getPreviousSelection as Mm,$getRoot as Dm,$getSelection as Am,$isRangeSelection as Om,$setSelection as Fm}from"lexical";import{useEffect as $m,useState as ml}from"react";var ht=t=>{let e=Rm(23),[o]=Im(),[r,n]=ml(null),[i,l]=ml(!1),[s,a,u]=ym(t),{closeDrawer:c,drawerSlug:d,isDrawerOpen:m,openDrawer:p}=u,{modalState:f}=vm(),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{let S=Am()??Mm();n(S)},e[0]=h):h=e[0];let g=h,b;e[1]!==o||e[2]!==r?(b=()=>{r&&o.update(()=>{if(Om(r)){let{anchor:S,focus:y}=r;dl(S.key)&&dl(y.key)&&Fm(r.clone())}else Dm().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=r,e[3]=b):b=e[3];let L=b,D;e[4]!==c?(D=()=>{c()},e[4]=c,e[5]=D):D=e[5];let x=D,_,C;e[6]!==d||e[7]!==f||e[8]!==L||e[9]!==i?(_=()=>{if(!i)return;let S=f[d];S&&!S?.isOpen&&(l(!1),setTimeout(()=>{L()},1))},C=[f,d,L,i],e[6]=d,e[7]=f,e[8]=L,e[9]=i,e[10]=_,e[11]=C):(_=e[10],C=e[11]),$m(_,C);let w;e[12]!==a?(w=S=>Sm(a,{...S,onClick:()=>{g()}}),e[12]=a,e[13]=w):w=e[13];let R;e[14]!==p?(R=()=>{g(),p(),l(!0)},e[14]=p,e[15]=R):R=e[15];let N;return e[16]!==s||e[17]!==x||e[18]!==m||e[19]!==d||e[20]!==w||e[21]!==R?(N={closeListDrawer:x,isListDrawerOpen:m,ListDrawer:s,listDrawerSlug:d,ListDrawerToggler:w,openListDrawer:R},e[16]=s,e[17]=x,e[18]=m,e[19]=d,e[20]=w,e[21]=R,e[22]=N):N=e[22],N};var Gm=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=Hm(o);n&&n.replace(ve({relationTo:e,value:r}))}):t.dispatchCommand(Jo,{relationTo:e,value:r})},fl=t=>{let e=Pm(16),{enabledCollectionSlugs:o}=t,[r]=Bm(),n;e[0]!==o?(n=()=>o?.[0],e[0]=o,e[1]=n):n=e[1];let[i]=pl(n),[l,s]=pl(null),a=o||void 0,u;e[2]!==i||e[3]!==a?(u={collectionSlugs:a,selectedCollection:i},e[2]=i,e[3]=a,e[4]=u):u=e[4];let{closeListDrawer:c,ListDrawer:d,openListDrawer:m}=ht(u),p,f;e[5]!==r||e[6]!==m?(p=()=>r.registerCommand(ze,L=>(s(L?.replace?L?.replace.nodeKey:null),m(),!0),jm),f=[r,m],e[5]=r,e[6]=m,e[7]=p,e[8]=f):(p=e[7],f=e[8]),Um(p,f);let h;e[9]!==c||e[10]!==r||e[11]!==l?(h=L=>{let{collectionSlug:D,docID:x}=L;Gm({editor:r,relationTo:D,replaceNodeKey:l,value:x}),c()},e[9]=c,e[10]=r,e[11]=l,e[12]=h):h=e[12];let g=h,b;return e[13]!==d||e[14]!==g?(b=Yt(d,{onSelect:g}),e[13]=d,e[14]=g,e[15]=b):b=e[15],b},hl=t=>(t?.enabledCollectionSlugs?.length??-1)>0?Yt(fl,{...t}):Yt(Rt,{...t,children:Yt(fl,{...t})});var Jo=Qm("INSERT_RELATIONSHIP_COMMAND"),Cl=t=>{let e=Wm(10),{clientProps:o}=t,[r]=Km(),{config:n}=Ym(),{collections:i}=n,l=null;if(o?.enabledCollections)l=o?.enabledCollections;else if(o?.disabledCollections){let c;if(e[0]!==o?.disabledCollections||e[1]!==i){let d;e[3]!==o?.disabledCollections?(d=m=>{let{slug:p}=m;return!o?.disabledCollections?.includes(p)},e[3]=o?.disabledCollections,e[4]=d):d=e[4],c=i.filter(d).map(tp),e[0]=o?.disabledCollections,e[1]=i,e[2]=c}else c=e[2];l=c}let s,a;e[5]!==r?(s=()=>{if(!r.hasNodes([ge]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return r.registerCommand(Jo,rp,qm)},a=[r],e[5]=r,e[6]=s,e[7]=a):(s=e[6],a=e[7]),ep(s,a);let u;return e[8]!==l?(u=Vm(hl,{enabledCollectionSlugs:l}),e[8]=l,e[9]=u):u=e[9],u};function tp(t){let{slug:e}=t;return e}function op(t){return gl(t)}function rp(t){let e=Xm()||zm();if(Jm(e)){let o=ve(t);Zm(o);let{focus:r}=e,n=r.getNode();gl(n)&&n.getTextContentSize()===0&&n.getParentOrThrow().getChildren().filter(op).length>1&&n.remove()}return!0}var ip=v({nodes:[ge],plugins:[{Component:Cl,position:"normal"}],slashMenu:{groups:[Y([{Icon:zo,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(ze,{replace:!1})}}])]},toolbarFixed:{groups:[de([{ChildComponent:zo,isActive:({selection:t})=>{if(!np(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Xo(e)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(ze,{replace:!1})}}])]}});import{c as El}from"react/compiler-runtime";import{jsx as oe,jsxs as Lp}from"react/jsx-runtime";import{useLexicalComposerContext as Np}from"@lexical/react/LexicalComposerContext.js";import{useScrollInfo as Rp,useThrottledEffect as Sp,useTranslation as Ip}from"@payloadcms/ui";import*as Ce from"react";import{useMemo as yp}from"react";import{c as lp}from"react/compiler-runtime";import{jsx as sp}from"react/jsx-runtime";import{mergeRegister as ap}from"@lexical/utils";import{$addUpdateTag as cp,$getSelection as up}from"lexical";import{useEffect as zt,useState as qo}from"react";var Qo="toolbar-popup__button",gt=t=>{let e=lp(34),{children:o,editor:r,item:n}=t,[i,l]=qo(!0),[s,a]=qo(!1),[u,c]=qo(Qo),d=P(),m;e[0]!==s||e[1]!==r||e[2]!==d||e[3]!==i||e[4]!==n?(m=()=>{r.getEditorState().read(()=>{let R=up();if(R){if(n.isActive){let N=n.isActive({editor:r,editorConfigContext:d,selection:R});s!==N&&a(N)}if(n.isEnabled){let N=n.isEnabled({editor:r,editorConfigContext:d,selection:R});i!==N&&l(N)}}})},e[0]=s,e[1]=r,e[2]=d,e[3]=i,e[4]=n,e[5]=m):m=e[5];let p=m,f,h;e[6]!==p?(f=()=>{p()},h=[p],e[6]=p,e[7]=f,e[8]=h):(f=e[7],h=e[8]),zt(f,h);let g,b;e[9]!==p?(g=()=>(document.addEventListener("mouseup",p),()=>{document.removeEventListener("mouseup",p)}),b=[p],e[9]=p,e[10]=g,e[11]=b):(g=e[10],b=e[11]),zt(g,b);let L,D;e[12]!==r||e[13]!==p?(L=()=>ap(r.registerUpdateListener(()=>{p()})),D=[r,p],e[12]=r,e[13]=p,e[14]=L,e[15]=D):(L=e[14],D=e[15]),zt(L,D);let x;e[16]!==s||e[17]!==i||e[18]!==n.key?(x=()=>{c([Qo,i===!1?"disabled":"",s?"active":"",n?.key?`${Qo}-`+n.key:""].filter(Boolean).join(" "))},e[16]=s,e[17]=i,e[18]=n.key,e[19]=x):x=e[19];let _;e[20]!==s||e[21]!==u||e[22]!==i||e[23]!==n.key?(_=[i,s,u,n.key],e[20]=s,e[21]=u,e[22]=i,e[23]=n.key,e[24]=_):_=e[24],zt(x,_);let C;e[25]!==s||e[26]!==r||e[27]!==i||e[28]!==n?(C=()=>{if(i!==!1)return r.focus(()=>{r.update(dp),n.onSelect?.({editor:r,isActive:s})}),!0},e[25]=s,e[26]=r,e[27]=i,e[28]=n,e[29]=C):C=e[29];let w;return e[30]!==o||e[31]!==u||e[32]!==C?(w=sp("button",{className:u,onClick:C,onMouseDown:mp,type:"button",children:o}),e[30]=o,e[31]=u,e[32]=C,e[33]=w):w=e[33],w};function dp(){cp("toolbar")}function mp(t){t.preventDefault()}import{c as bp}from"react/compiler-runtime";import{jsx as We}from"react/jsx-runtime";import or,{useCallback as _p,useEffect as wl}from"react";import{mergeRegister as Tp}from"@lexical/utils";import{useTranslation as wp}from"@payloadcms/ui";import{$getSelection as Ep}from"lexical";import{jsx as ke,jsxs as xl}from"react/jsx-runtime";import{Button as pp}from"@payloadcms/ui";import{$addUpdateTag as fp}from"lexical";import Xt,{useCallback as hp,useEffect as Ct,useMemo as gp,useRef as tr,useState as Jt}from"react";import{createPortal as Cp}from"react-dom";var er="toolbar-popup__dropdown-item",bl=Xt.createContext(null);function _l({active:t,children:e,editor:o,enabled:r,Icon:n,item:i,tooltip:l}){let[s,a]=Jt(er);Ct(()=>{a([er,r===!1?"disabled":"",t?"active":"",i?.key?`${er}-${i.key}`:""].filter(Boolean).join(" "))},[r,t,s,i.key]);let u=tr(null),c=Xt.useContext(bl);if(c===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:d}=c;return Ct(()=>{u?.current!=null&&d(u)},[u,d]),ke(pp,{"aria-label":l,buttonStyle:"none",className:s,disabled:r===!1,icon:n,iconPosition:"left",iconStyle:"none",onClick:()=>{r!==!1&&o.focus(()=>{o.update(()=>{fp("toolbar")}),i.onSelect?.({editor:o,isActive:t})})},onMouseDown:m=>{m.preventDefault()},ref:u,tooltip:l,type:"button",children:e})}function xp({children:t,dropDownRef:e,itemsContainerClassNames:o,onClose:r}){let[n,i]=Jt(),[l,s]=Jt(),a=hp(d=>{i(m=>m!=null?[...m,d]:[d])},[i]),u=d=>{if(n==null)return;let{key:m}=d;["ArrowDown","ArrowUp","Escape","Tab"].includes(m)&&d.preventDefault(),m==="Escape"||m==="Tab"?r():m==="ArrowUp"?s(p=>{if(p==null)return n[0];let f=n.indexOf(p)-1;return n[f===-1?n.length-1:f]}):m==="ArrowDown"&&s(p=>p==null?n[0]:n[n.indexOf(p)+1])},c=gp(()=>({registerItem:a}),[a]);return Ct(()=>{n!=null&&l==null&&s(n[0]),l!=null&&l?.current!=null&&l.current.focus()},[n,l]),ke(bl.Provider,{value:c,children:ke("div",{className:(o??["toolbar-popup__dropdown-items"]).join(" "),onKeyDown:u,ref:e,children:t})})}function Tl({buttonAriaLabel:t,buttonClassName:e,children:o,disabled:r=!1,Icon:n,itemsContainerClassNames:i,label:l,stopCloseOnClickSelf:s}){let a=tr(null),u=tr(null),[c,d]=Jt(!1),m=()=>{d(!1),u?.current!=null&&u.current.focus()};Ct(()=>{let f=u.current,h=a.current;if(c&&f!==null&&h!==null){let{left:g,top:b}=f.getBoundingClientRect(),L=window.scrollY||document.documentElement.scrollTop;h.style.top=`${b+L+f.offsetHeight+5}px`,h.style.left=`${Math.min(g-5,window.innerWidth-h.offsetWidth-20)}px`}},[a,u,c]),Ct(()=>{let f=u.current;if(f!==null&&c){let h=g=>{let{target:b}=g;s!=null&&a.current!=null&&a.current.contains(b)||f.contains(b)||d(!1)};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[a,u,c,s]);let p=Cp(ke(xp,{dropDownRef:a,itemsContainerClassNames:i,onClose:m,children:o}),document.body);return xl(Xt.Fragment,{children:[xl("button",{"aria-label":t,className:e+(c?" active":""),disabled:r,onClick:f=>{f.preventDefault(),d(!c)},onMouseDown:f=>{f.preventDefault()},ref:u,type:"button",children:[n&&ke(n,{}),l&&ke("span",{className:"toolbar-popup__dropdown-label",children:l}),ke("i",{className:"toolbar-popup__dropdown-caret"})]}),c&&ke(Xt.Fragment,{children:p})]})}var rr="toolbar-popup__dropdown",kp=t=>{let e=bp(18),{active:o,anchorElem:r,editor:n,enabled:i,item:l}=t,{i18n:s}=wp(),{fieldProps:a}=P(),{featureClientSchemaMap:u,schemaPath:c}=a;if(l.Component){let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==i||e[4]!==l?(f=l?.Component&&We(l.Component,{active:o,anchorElem:r,editor:n,enabled:i,item:l},l.key),e[0]=o,e[1]=r,e[2]=n,e[3]=i,e[4]=l,e[5]=f):f=e[5],f}let d=l.key,m;if(l.label){let f;e[6]!==u||e[7]!==s||e[8]!==l||e[9]!==c?(f=typeof l.label=="function"?l.label({featureClientSchemaMap:u,i18n:s,schemaPath:c}):l.label,e[6]=u,e[7]=s,e[8]=l,e[9]=c,e[10]=f):f=e[10],d=f}d.length>25?m=d.substring(0,25)+"...":m=d;let p;return e[11]!==o||e[12]!==m||e[13]!==n||e[14]!==i||e[15]!==l||e[16]!==d?(p=We(_l,{active:o,editor:n,enabled:i,Icon:l?.ChildComponent?We(l.ChildComponent,{}):void 0,item:l,tooltip:d,children:We("span",{className:"text",children:m})},l.key),e[11]=o,e[12]=m,e[13]=n,e[14]=i,e[15]=l,e[16]=d,e[17]=p):p=e[17],p},Me=({anchorElem:t,classNames:e,editor:o,group:r,Icon:n,itemsContainerClassNames:i,label:l,maxActiveItems:s,onActiveChange:a})=>{let[u,c]=or.useState([]),[d,m]=or.useState([]),[p,f]=or.useState(!0),h=P(),{items:g,key:b}=r,L=_p(()=>{o.getEditorState().read(()=>{let D=Ep();if(!D)return;let x=[],_=[],C=[];for(let w of g)w.isActive&&(!s||x.length<s)&&w.isActive({editor:o,editorConfigContext:h,selection:D})&&(x.push(w.key),_.push(w)),w.isEnabled?w.isEnabled({editor:o,editorConfigContext:h,selection:D})&&C.push(w.key):C.push(w.key);r.isEnabled&&f(r.isEnabled({editor:o,editorConfigContext:h,selection:D})),c(x),m(C),a&&a({activeItems:_})})},[o,h,r,g,s,a]);return wl(()=>{L()},[L]),wl(()=>Tp(o.registerUpdateListener(()=>{L()})),[o,L]),We(Tl,{buttonAriaLabel:`${b} dropdown`,buttonClassName:[rr,`${rr}-${b}`,...e||[]].filter(Boolean).join(" "),disabled:!p,Icon:n,itemsContainerClassNames:[`${rr}-items`,...i||[]],label:l,children:g.length?g.map(D=>We(kp,{active:u.includes(D.key),anchorElem:t,editor:o,enabled:d.includes(D.key),item:D},D.key)):null},b)};function vp({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&oe(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?oe(gt,{editor:e,item:o,children:oe(o.ChildComponent,{})},o.key):null}function Mp(t){let e=El(23),{anchorElem:o,editor:r,editorConfig:n,group:i,index:l}=t,{i18n:s}=Ip(),{fieldProps:a}=P(),{featureClientSchemaMap:u,schemaPath:c}=a,[d,m]=Ce.useState(void 0),[p,f]=Ce.useState(void 0),h;e[0]!==i.ChildComponent||e[1]!==i.items||e[2]!==i.type?(h=()=>{i?.type==="dropdown"&&i.items.length&&i.ChildComponent?f(()=>i.ChildComponent):f(void 0)},e[0]=i.ChildComponent,e[1]=i.items,e[2]=i.type,e[3]=h):h=e[3];let g;e[4]!==i?(g=[i],e[4]=i,e[5]=g):g=e[5],Ce.useEffect(h,g);let b;e[6]!==u||e[7]!==i.ChildComponent||e[8]!==i.items||e[9]!==i.type||e[10]!==s||e[11]!==c?(b=_=>{let{activeItems:C}=_;if(!C.length){i?.type==="dropdown"&&i.items.length&&i.ChildComponent?(f(()=>i.ChildComponent),m(void 0)):(f(void 0),m(void 0));return}let w=C[0],R=w.key;w.label&&(R=typeof w.label=="function"?w.label({featureClientSchemaMap:u,i18n:s,schemaPath:c}):w.label),R.length>25&&(R=R.substring(0,25)+"..."),C.length===1?(m(R),f(()=>w.ChildComponent)):(m(s.t("lexical:general:toolbarItemsActive",{count:C.length})),i?.type==="dropdown"&&i.items.length&&i.ChildComponent?f(()=>i.ChildComponent):f(void 0))},e[6]=u,e[7]=i.ChildComponent,e[8]=i.items,e[9]=i.type,e[10]=s,e[11]=c,e[12]=b):b=e[12];let L=b,D=`fixed-toolbar__group fixed-toolbar__group-${i.key}`,x;return e[13]!==p||e[14]!==o||e[15]!==d||e[16]!==r||e[17]!==n.features.toolbarFixed?.groups.length||e[18]!==i||e[19]!==l||e[20]!==L||e[21]!==D?(x=Lp("div",{className:D,children:[i.type==="dropdown"&&i.items.length?p?oe(Me,{anchorElem:o,editor:r,group:i,Icon:p,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:d,maxActiveItems:i.maxActiveItems??1,onActiveChange:L}):oe(Me,{anchorElem:o,editor:r,group:i,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:d,maxActiveItems:i.maxActiveItems??1,onActiveChange:L}):null,i.type==="buttons"&&i.items.length?i.items.map(_=>oe(vp,{anchorElem:o,editor:r,item:_},_.key)):null,l<n.features.toolbarFixed?.groups.length-1&&oe("div",{className:"divider"})]},i.key),e[13]=p,e[14]=o,e[15]=d,e[16]=r,e[17]=n.features.toolbarFixed?.groups.length,e[18]=i,e[19]=l,e[20]=L,e[21]=D,e[22]=x):x=e[22],x}function Dp({anchorElem:t,clientProps:e,editor:o,editorConfig:r,parentWithFixedToolbar:n}){let i=Ce.useRef(null),{y:l}=Rp(),s=yp(()=>{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 Sp(()=>{if(!s)return;let a=i.current;if(!a)return;let u=a.getBoundingClientRect(),c=s.getBoundingClientRect();if(!(u.bottom<c.top||u.top>c.bottom))a.classList.remove("fixed-toolbar"),a.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),s.classList.remove("fixed-toolbar"),s.classList.add("fixed-toolbar","fixed-toolbar--hide");else{if(!a.classList.contains("fixed-toolbar--overlapping"))return;a.classList.remove("fixed-toolbar--overlapping"),a.classList.add("fixed-toolbar"),s.classList.remove("fixed-toolbar--hide"),s.classList.add("fixed-toolbar")}},50,[i,s,l]),oe("div",{className:"fixed-toolbar",onFocus:a=>{a.stopPropagation()},ref:i,children:o.isEditable()&&oe(Ce.Fragment,{children:r?.features&&r.features?.toolbarFixed?.groups.map((a,u)=>oe(Mp,{anchorElem:t,editor:o,editorConfig:r,group:a,index:u},a.key))})})}var kl=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return kl(t.parentEditor)}return!1},Ll=t=>{let e=El(6),{clientProps:o}=t,[r]=Np(),n=P(),{editorConfig:i}=n,l=o.applyToFocusedEditor&&n.focusedEditor?.editor||r,s=o.applyToFocusedEditor&&n.focusedEditor?.editorConfig||i,a,u;if(e[0]!==o.disableIfParentHasFixedToolbar||e[1]!==l||e[2]!==s||e[3]!==n){u=Symbol.for("react.early_return_sentinel");e:{let c=kl(n);if(o?.disableIfParentHasFixedToolbar&&c){u=null;break e}if(!s?.features?.toolbarFixed?.groups?.length){u=null;break e}a=oe(Dp,{anchorElem:document.body,editor:l,editorConfig:s,parentWithFixedToolbar:c})}e[0]=o.disableIfParentHasFixedToolbar,e[1]=l,e[2]=s,e[3]=n,e[4]=a,e[5]=u}else a=e[4],u=e[5];return u!==Symbol.for("react.early_return_sentinel")?u:a};var Ap=v({plugins:[{Component:Ll,position:"aboveContainer"}]});import{c as Sl}from"react/compiler-runtime";import{jsx as ie,jsxs as Il}from"react/jsx-runtime";import{useLexicalComposerContext as Op}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as yl}from"@lexical/utils";import{$getSelection as vl,$isRangeSelection as Nl,$isTextNode as Fp,COMMAND_PRIORITY_LOW as $p,getDOMSelection as Ml,SELECTION_CHANGE_COMMAND as Pp}from"lexical";import{useCallback as Qt,useEffect as xt,useRef as Rl,useState as Bp}from"react";import*as eo from"react";import{createPortal as Hp}from"react-dom";function nr(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 qt(t){let{alwaysDisplayOnTop:e=!1,anchorElem:o,anchorFlippedOffset:r=0,floatingElem:n,horizontalOffset:i=32,horizontalPosition:l="left",specialHandlingForCaret:s=!1,targetRect:a,verticalGap:u=10}=t,c=o.parentElement;if(a===null||c==null){n.style.opacity="0",n.style.transform="translate(-10000px, -10000px)";return}let d=n.getBoundingClientRect(),m=o.getBoundingClientRect(),p=c.getBoundingClientRect(),f=a.top-d.height-u,h=a.left-i;l==="center"&&(h=a.left+a.width/2-d.width/2);let g=0;return!e&&f<p.top&&!s&&(g=d.height+a.height+u*2,f+=g),l==="center"?h+d.width>p.right?h=p.right-d.width-i:h<p.left&&(h=p.left+i):h+d.width>p.right&&(h=p.right-d.width-i),h-=m.left,n.style.opacity="1",s&&r!==0?(f-=m.bottom-r+d.height-3,n.style.transform=`translate(${h}px, ${f}px) rotate(180deg)`):(f-=m.top,n.style.transform=`translate(${h}px, ${f}px)`),g}function jp({anchorElem:t,editor:e,item:o}){return o.Component?o?.Component&&ie(o.Component,{anchorElem:t,editor:e,item:o},o.key):o.ChildComponent?ie(gt,{editor:e,item:o,children:ie(o.ChildComponent,{})},o.key):null}function Up(t){let e=Sl(19),{anchorElem:o,editor:r,group:n,index:i}=t,{editorConfig:l}=P(),[s,a]=eo.useState(),u;e[0]!==n.ChildComponent||e[1]!==n.items||e[2]!==n.type?(u=()=>{n?.type==="dropdown"&&n.items.length&&n.ChildComponent?a(()=>n.ChildComponent):a(void 0)},e[0]=n.ChildComponent,e[1]=n.items,e[2]=n.type,e[3]=u):u=e[3];let c;e[4]!==n?(c=[n],e[4]=n,e[5]=c):c=e[5],eo.useEffect(u,c);let d;e[6]!==n.ChildComponent||e[7]!==n.items||e[8]!==n.type?(d=h=>{let{activeItems:g}=h;if(!g.length){n?.type==="dropdown"&&n.items.length&&n.ChildComponent?a(()=>n.ChildComponent):a(void 0);return}let b=g[0];a(()=>b?.ChildComponent)},e[6]=n.ChildComponent,e[7]=n.items,e[8]=n.type,e[9]=d):d=e[9];let m=d,p=`inline-toolbar-popup__group inline-toolbar-popup__group-${n.key}`,f;return e[10]!==s||e[11]!==o||e[12]!==r||e[13]!==l.features.toolbarInline?.groups.length||e[14]!==n||e[15]!==i||e[16]!==m||e[17]!==p?(f=Il("div",{className:p,children:[n.type==="dropdown"&&n.items.length?s?ie(Me,{anchorElem:o,editor:r,group:n,Icon:s,maxActiveItems:n.maxActiveItems??1,onActiveChange:m}):ie(Me,{anchorElem:o,editor:r,group:n,maxActiveItems:n.maxActiveItems??1,onActiveChange:m}):null,n.type==="buttons"&&n.items.length?n.items.map(h=>ie(jp,{anchorElem:o,editor:r,item:h},h.key)):null,i<l.features.toolbarInline?.groups.length-1&&ie("div",{className:"divider"})]},n.key),e[10]=s,e[11]=o,e[12]=r,e[13]=l.features.toolbarInline?.groups.length,e[14]=n,e[15]=i,e[16]=m,e[17]=p,e[18]=f):f=e[18],f}function Gp({anchorElem:t,editor:e}){let o=Rl(null),r=Rl(null),{editorConfig:n}=P(),i=Qt(()=>{if(o?.current){let u=o.current.style.opacity==="0",c=o.current.style.pointerEvents==="none";u||(o.current.style.opacity="0"),c||(o.current.style.pointerEvents="none")}},[o]),l=Qt(u=>{if(o?.current&&(u.buttons===1||u.buttons===3)){let c=o.current.style.opacity==="0",d=o.current.style.pointerEvents==="none";if(!c||!d){let m=u.clientX,p=u.clientY,f=document.elementFromPoint(m,p);o.current.contains(f)||i()}}},[i]),s=Qt(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);xt(()=>(document.addEventListener("mousemove",l),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",s)}),[o,l,s]);let a=Qt(()=>{let u=vl(),c=Ml(e._window);if(o.current===null)return;let d=t.querySelector(":scope > .link-editor"),m=d!==null&&"style"in d&&d?.style?.opacity==="1",p=e.getRootElement();if(u!==null&&c!==null&&!c.isCollapsed&&p!==null&&p.contains(c.anchorNode)){let f=nr(c,p),h=qt({alwaysDisplayOnTop:m,anchorElem:t,floatingElem:o.current,horizontalPosition:"center",targetRect:f});r.current&&qt({anchorElem:o.current,anchorFlippedOffset:h,floatingElem:r.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:f,verticalGap:8})}else i()},[e,i,t]);return xt(()=>{let u=t.parentElement,c=()=>{e.getEditorState().read(()=>{a()})};return window.addEventListener("resize",c),u&&u.addEventListener("scroll",c),()=>{window.removeEventListener("resize",c),u&&u.removeEventListener("scroll",c)}},[e,a,t]),xt(()=>(e.getEditorState().read(()=>{a()}),yl(e.registerUpdateListener(({editorState:u})=>{u.read(()=>{a()})}),e.registerCommand(Pp,()=>(a(),!1),$p))),[e,a]),Il("div",{className:"inline-toolbar-popup",ref:o,children:[ie("div",{className:"caret",ref:r}),n?.features&&n.features?.toolbarInline?.groups.map((u,c)=>ie(Up,{anchorElem:t,editor:e,group:u,index:c},u.key))]})}function Wp(t,e){let o=Sl(12),[r,n]=Bp(!1),i;o[0]!==t?(i=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let m=vl(),p=Ml(t._window),f=t.getRootElement();if(p!==null&&(!Nl(m)||f===null||!f.contains(p.anchorNode))){n(!1);return}if(!Nl(m))return;if(m.getTextContent()!==""){let g=m.getNodes(),b=!1;for(let L of g)if(Fp(L)){n(!0),b=!0;break}b||n(!1)}else n(!1);let h=m.getTextContent().replace(/\n/g,"");if(!m.isCollapsed()&&h===""){n(!1);return}})},o[0]=t,o[1]=i):i=o[1];let l=i,s,a;o[2]!==l?(s=()=>(document.addEventListener("selectionchange",l),document.addEventListener("mouseup",l),()=>{document.removeEventListener("selectionchange",l),document.removeEventListener("mouseup",l)}),a=[l],o[2]=l,o[3]=s,o[4]=a):(s=o[3],a=o[4]),xt(s,a);let u,c;if(o[5]!==t||o[6]!==l?(u=()=>yl(t.registerUpdateListener(()=>{l()}),t.registerRootListener(()=>{t.getRootElement()===null&&n(!1)})),c=[t,l],o[5]=t,o[6]=l,o[7]=u,o[8]=c):(u=o[7],c=o[8]),xt(u,c),!r||!t.isEditable())return null;let d;return o[9]!==e||o[10]!==t?(d=Hp(ie(Gp,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=d):d=o[11],d}var Dl=t=>{let{anchorElem:e}=t,[o]=Op();return Wp(o,e)};var Vp=v({plugins:[{Component:Dl,position:"floatingAnchorElem"}]});import{TableCellNode as I1,TableNode as y1,TableRowNode as v1}from"@lexical/table";import{jsx as Al}from"react/jsx-runtime";import"react";var ir=()=>Al("svg",{className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Al("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 Kp,$createTableNode as Zp,$createTableRowNode as Yp,$isTableCellNode as Ol,$isTableNode as lr,$isTableRowNode as sr,TableCellHeaderStates as to,TableCellNode as zp,TableNode as Xp,TableRowNode as Jp}from"@lexical/table";import{$isParagraphNode as qp,$isTextNode as Qp}from"lexical";var $l=/^\|(.+)\|\s?$/,ef=/^(\| ?:?-*:? ?)+\|\s?$/,Pl=({allTransformers:t})=>({type:"element",dependencies:[Xp,Jp,zp],export:e=>{if(!lr(e))return null;let o=[];for(let r of e.getChildren()){let n=[];if(!sr(r))continue;let i=!1;for(let l of r.getChildren())Ol(l)&&(n.push(vr(t,l).replace(/\n/g,"\\n")),l.__headerState===to.ROW&&(i=!0));o.push(`| ${n.join(" | ")} |`),i&&o.push(`| ${n.map(l=>"---").join(" | ")} |`)}return o.join(`
|
|
37
|
+
`)},regExp:$l,replace:(e,o,r)=>{let n=r[0];if(!n)return;if(ef.test(n)){let d=e.getPreviousSibling();if(!d||!lr(d))return;let m=d.getChildren(),p=m[m.length-1];if(!p||!sr(p))return;p.getChildren().forEach(f=>{Ol(f)&&f.setHeaderStyles(to.ROW,to.ROW)}),e.remove();return}let i=Fl(n,t);if(i==null)return;let l=[i],s=e.getPreviousSibling(),a=i.length;for(;s&&!(!qp(s)||s.getChildrenSize()!==1);){let d=s.getFirstChild();if(!Qp(d))break;let m=Fl(d.getTextContent(),t);if(m==null)break;a=Math.max(a,m.length),l.unshift(m);let p=s.getPreviousSibling();s.remove(),s=p}let u=Zp();for(let d of l){let m=Yp();u.append(m);for(let p=0;p<a;p++)m.append(p<d.length?d[p]:Bl("",t))}let c=e.getPreviousSibling();lr(c)&&tf(c)===a?(c.append(...u.getChildren()),e.remove()):e.replace(u),u.selectEnd()}});function tf(t){let e=t.getFirstChild();return sr(e)?e.getChildrenSize():0}var Bl=(t,e)=>{t=t.replace(/\\n/g,`
|
|
38
|
+
`);let o=Kp(to.NO_STATUS);return yr(t,e,o),o},Fl=(t,e)=>{let o=t.match($l);return!o||!o[1]?null:o[1].split("|").map(r=>Bl(r,e))};import{c as rf}from"react/compiler-runtime";import{jsx as $,jsxs as xe}from"react/jsx-runtime";import{useLexicalComposerContext as Wl}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as nf}from"@lexical/react/useLexicalEditable";import{$deleteTableColumn__EXPERIMENTAL as lf,$deleteTableRow__EXPERIMENTAL as sf,$getNodeTriplet as af,$getTableCellNodeFromLexicalNode as jl,$getTableColumnIndexFromTableCellNode as cf,$getTableNodeFromLexicalNodeOrThrow as De,$getTableRowIndexFromTableCellNode as uf,$insertTableColumn__EXPERIMENTAL as df,$insertTableRow__EXPERIMENTAL as mf,$isTableCellNode as bt,$isTableRowNode as Ul,$isTableSelection as _t,$unmergeCell as pf,getTableElement as ur,getTableObserverFromTableElement as dr,TableCellHeaderStates as Le,TableCellNode as ff}from"@lexical/table";import{mergeRegister as hf}from"@lexical/utils";import{useScrollInfo as gf}from"@payloadcms/ui";import{$createParagraphNode as Cf,$getRoot as xf,$getSelection as ro,$isElementNode as bf,$isParagraphNode as Vl,$isRangeSelection as mr,$isTextNode as _f,COMMAND_PRIORITY_CRITICAL as Tf,getDOMSelection as wf,SELECTION_CHANGE_COMMAND as Ef}from"lexical";import*as pr from"react";import{useCallback as le,useEffect as Ve,useRef as oo,useState as Ke}from"react";import{createPortal as Kl}from"react-dom";import{jsx as ar,jsxs as of}from"react/jsx-runtime";import"react";var Hl=()=>of("svg",{fill:"none",height:"18",viewBox:"0 0 20 20",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[ar("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"}),ar("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"}),ar("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 cr(t){let e=t.getShape();return{columns:e.toX-e.fromX+1,rows:e.toY-e.fromY+1}}function kf(){let t=ro();if(mr(t)&&!t.isCollapsed()||_t(t)&&!t.anchor.is(t.focus)||!mr(t)&&!_t(t))return!1;let[e]=af(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function Gl(t){if(t.getChildrenSize()!==1)return!1;let e=t.getFirstChildOrThrow();return!(!Vl(e)||!e.isEmpty())}function Lf(t){let e=t.getLastDescendant();_f(e)?e.select():bf(e)?e.selectEnd():e!==null&&e.selectNext()}function Nf({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:r,tableCellNode:n}){let[i]=Wl(),l=oo(null),[s,a]=Ke(n),[u,c]=Ke({columns:1,rows:1}),[d,m]=Ke(!1),[p,f]=Ke(!1),{y:h}=gf();Ve(()=>i.registerMutationListener(ff,E=>{E.get(s.getKey())==="updated"&&i.getEditorState().read(()=>{a(s.getLatest())})},{skipInitialization:!0}),[i,s]),Ve(()=>{i.getEditorState().read(()=>{let E=ro();if(_t(E)){let T=cr(E);c(cr(E)),m(T.columns>1||T.rows>1)}f(kf())})},[i]),Ve(()=>{let E=e.current,T=l.current,k=i.getRootElement();if(E!=null&&T!=null&&k!=null){let I=k.getBoundingClientRect(),M=E.getBoundingClientRect();T.style.opacity="1";let O=T.getBoundingClientRect(),A=5,H=M.right+A;if(H+O.width>window.innerWidth||H+O.width>I.right){let Q=M.left-O.width-A;H=(Q<0?A:Q)+window.pageXOffset}T.style.left=`${H+window.pageXOffset}px`;let j=M.top;if(j+O.height>window.innerHeight){let Q=M.bottom-O.height;j=Q<0?A:Q}T.style.top=`${j}px`}},[e,l,i,h]),Ve(()=>{function E(T){l.current!=null&&e.current!=null&&!l.current.contains(T.target)&&!e.current.contains(T.target)&&r(!1)}return window.addEventListener("click",E),()=>window.removeEventListener("click",E)},[r,e]);let g=le(()=>{i.update(()=>{if(s.isAttached()){let T=De(s),k=ur(T,i.getElementByKey(T.getKey()));if(k===null)throw new Error("Expected to find tableElement in DOM");let I=dr(k);I!==null&&I.$clearHighlight(),T.markDirty(),a(s.getLatest())}xf().selectStart()})},[i,s]),b=()=>{i.update(()=>{let E=ro();if(_t(E)){let{columns:T,rows:k}=cr(E),I=E.getNodes(),M=null;for(let O=0;O<I.length;O++){let A=I[O];if(bt(A))if(M===null){A.setColSpan(T).setRowSpan(k),M=A;let H=Gl(A),j;H&&Vl(j=A.getFirstChild())&&j.remove()}else bt(M)&&(Gl(A)||M.append(...A.getChildren()),A.remove())}M!==null&&(M.getChildrenSize()===0&&M.append(Cf()),Lf(M)),o()}})},L=()=>{i.update(()=>{pf()})},D=le(E=>{i.update(()=>{mf(E),o()})},[i,o]),x=le(E=>{i.update(()=>{for(let T=0;T<u.columns;T++)df(E);o()})},[i,o,u.columns]),_=le(()=>{i.update(()=>{sf(),o()})},[i,o]),C=le(()=>{i.update(()=>{De(s).remove(),g(),o()})},[i,s,g,o]),w=le(()=>{i.update(()=>{lf(),o()})},[i,o]),R=le(()=>{i.update(()=>{let E=De(s),T=uf(s),k=E.getChildren();if(T>=k.length||T<0)throw new Error("Expected table cell to be inside of table row.");let I=k[T];if(!Ul(I))throw new Error("Expected table row");let M=s.getHeaderStyles()^Le.ROW;I.getChildren().forEach(O=>{if(!bt(O))throw new Error("Expected table cell");O.setHeaderStyles(M,Le.ROW)}),g(),o()})},[i,s,g,o]),N=le(()=>{i.update(()=>{let E=De(s),T=cf(s),k=E.getChildren(),I=Math.max(...k.map(O=>O.getChildren().length));if(T>=I||T<0)throw new Error("Expected table cell to be inside of table row.");let M=s.getHeaderStyles()^Le.COLUMN;for(let O=0;O<k.length;O++){let A=k[O];if(!Ul(A))throw new Error("Expected table row");let H=A.getChildren();if(T>=H.length)continue;let j=H[T];if(!bt(j))throw new Error("Expected table cell");j.setHeaderStyles(M,Le.COLUMN)}g(),o()})},[i,s,g,o]),S=le(()=>{i.update(()=>{if(s.isAttached()){let E=De(s);E&&E.setRowStriping(!E.getRowStriping())}g(),o()})},[i,s,g,o]),y=null;return t&&(d?y=$("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>b(),type:"button",children:$("span",{className:"text",children:"Merge cells"})}):p&&(y=$("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>L(),type:"button",children:$("span",{className:"text",children:"Unmerge cells"})}))),Kl(xe("div",{className:"table-action-menu-dropdown",onClick:E=>{E.stopPropagation()},ref:l,children:[y?xe(pr.Fragment,{children:[y,$("hr",{})]}):null,$("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>S(),type:"button",children:$("span",{className:"text",children:"Toggle Row Striping"})}),$("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>D(!1),type:"button",children:xe("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," above"]})}),$("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>D(!0),type:"button",children:xe("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," below"]})}),$("hr",{}),$("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>x(!1),type:"button",children:xe("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","left"]})}),$("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>x(!0),type:"button",children:xe("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","right"]})}),$("hr",{}),$("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>w(),type:"button",children:$("span",{className:"text",children:"Delete column"})}),$("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>_(),type:"button",children:$("span",{className:"text",children:"Delete row"})}),$("button",{className:"item","data-test-id":"table-delete",onClick:()=>C(),type:"button",children:$("span",{className:"text",children:"Delete table"})}),$("hr",{}),$("button",{className:"item",onClick:()=>R(),type:"button",children:xe("span",{className:"text",children:[(s.__headerState&Le.ROW)===Le.ROW?"Remove":"Add"," ","row header"]})}),$("button",{className:"item","data-test-id":"table-column-header",onClick:()=>N(),type:"button",children:xe("span",{className:"text",children:[(s.__headerState&Le.COLUMN)===Le.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function Rf({anchorElem:t,cellMerge:e}){let[o]=Wl(),r=oo(null),n=oo(null),[i,l]=Ke(!1),[s,a]=Ke(null),u=le(()=>{let d=r.current,m=ro(),p=wf(o._window),f=document.activeElement;function h(){d&&(d.classList.remove("table-cell-action-button-container--active"),d.classList.add("table-cell-action-button-container--inactive")),a(null)}if(m==null||d==null)return h();let g=o.getRootElement(),b=null,L=null;if(mr(m)&&g!==null&&p!==null&&g.contains(p.anchorNode)){let x=jl(m.anchor.getNode());if(x==null||(L=o.getElementByKey(x.getKey()),L==null||!x.isAttached()))return h();let _=De(x),C=ur(_,o.getElementByKey(_.getKey()));if(C===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");b=dr(C),a(x)}else if(_t(m)){let x=jl(m.anchor.getNode());if(!bt(x))throw new Error("TableSelection anchorNode must be a TableCellNode");let _=De(x),C=ur(_,o.getElementByKey(_.getKey()));if(C===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");b=dr(C),L=o.getElementByKey(x.getKey())}else if(!f)return h();if(b===null||L===null)return h();let D=!b||!b.isSelecting;if(d.classList.toggle("table-cell-action-button-container--active",D),d.classList.toggle("table-cell-action-button-container--inactive",!D),D){let x=L.getBoundingClientRect(),_=t.getBoundingClientRect(),C=x.top-_.top,w=x.right-_.left;d.style.transform=`translate(${w}px, ${C}px)`}},[o,t]);Ve(()=>{let d,m=()=>{d=void 0,o.getEditorState().read(u)},p=()=>(d===void 0&&(d=setTimeout(m,0)),!1);return hf(o.registerUpdateListener(p),o.registerCommand(Ef,p,Tf),o.registerRootListener((f,h)=>{h&&h.removeEventListener("mouseup",p),f&&(f.addEventListener("mouseup",p),p())}),()=>clearTimeout(d))});let c=oo(s);return Ve(()=>{c.current!==s&&l(!1),c.current=s},[c,s]),$("div",{className:"table-cell-action-button-container",ref:r,children:s!=null&&xe(pr.Fragment,{children:[$("button",{className:"table-cell-action-button",onClick:d=>{d.stopPropagation(),l(!i)},ref:n,type:"button",children:$(Hl,{})}),i&&$(Nf,{cellMerge:e,contextRef:n,onClose:()=>l(!1),setIsMenuOpen:l,tableCellNode:s})]})})}var Zl=t=>{let e=rf(3),{anchorElem:o}=t,r=nf(),n;return e[0]!==o||e[1]!==r?(n=Kl(r?$(Rf,{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 Sf}from"react/compiler-runtime";import{jsx as io,jsxs as If}from"react/jsx-runtime";import{useLexicalComposerContext as yf}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as vf}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as Mf,$getTableNodeFromLexicalNodeOrThrow as fr,$getTableRowIndexFromTableCellNode as Df,$isTableCellNode as Yl,$isTableRowNode as Af,getDOMCellFromTarget as Of,getTableElement as Ff,TableNode as $f}from"@lexical/table";import{calculateZoomLevel as zl}from"@lexical/utils";import{$getNearestNodeFromDOMNode as hr}from"lexical";import*as Jl from"react";import{useCallback as Tt,useEffect as gr,useRef as no,useState as wt}from"react";import{createPortal as Pf}from"react-dom";var Bf=33,Xl=92;function Hf({editor:t}){let e=no(null),o=no(null),r=no(null),n=P(),i=no(null),[l,s]=wt(null),[a,u]=wt(null),[c,d]=wt(!1),[m,p]=wt(null),f=Tt(()=>{u(null),e.current=null,p(null),i.current=null,r.current=null},[]),h=N=>(N.buttons&1)===1;gr(()=>t.registerNodeTransform($f,N=>{if(N.getColWidths())return N;let S=N.getColumnCount(),y=Xl;return N.setColWidths(Array(S).fill(y)),N}),[t]),gr(()=>{let N=T=>{let k=T.target;if(m){s({x:T.clientX,y:T.clientY});return}if(d(h(T)),!(o.current&&o.current.contains(k))&&e.current!==k){e.current=k;let I=Of(k);I&&a!==I?t.getEditorState().read(()=>{let M=hr(I.elem);if(!M)throw new Error("TableCellResizer: Table cell node not found.");let O=fr(M),A=Ff(O,t.getElementByKey(O.getKey()));if(!A)throw new Error("TableCellResizer: Table element not found.");e.current=k,r.current=A.getBoundingClientRect(),u(I)},{editor:t}):I==null&&f()}},S=T=>{d(!0)},y=T=>{d(!1)},E=t.registerRootListener((T,k)=>{k?.removeEventListener("mousemove",N),k?.removeEventListener("mousedown",S),k?.removeEventListener("mouseup",y),T?.addEventListener("mousemove",N),T?.addEventListener("mousedown",S),T?.addEventListener("mouseup",y)});return()=>{E()}},[a,m,t,f]);let g=N=>N==="bottom",b=Tt(N=>{if(!a)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let S=hr(a.elem);if(!Yl(S))throw new Error("TableCellResizer: Table cell node not found.");let y=fr(S),E=Df(S)+S.getRowSpan()-1,T=y.getChildren();if(E>=T.length||E<0)throw new Error("Expected table cell to be inside of table row.");let k=T[E];if(!Af(k))throw new Error("Expected table row");let I=k.getHeight();if(I===void 0){let O=k.getChildren();I=Math.min(...O.map(A=>L(A,t)??1/0))}let M=Math.max(I+N,Bf);k.setHeight(M)},{tag:"skip-scroll-into-view"})},[a,t]),L=(N,S)=>S.getElementByKey(N.getKey())?.clientHeight,D=(N,S)=>{let y;return S.forEach(E=>{E.forEach((T,k)=>{T.cell===N&&(y=k)})}),y},x=Tt(N=>{if(!a)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let S=hr(a.elem);if(!Yl(S))throw new Error("TableCellResizer: Table cell node not found.");let y=fr(S),[E]=Mf(y,null,null),T=D(S,E);if(T===void 0)throw new Error("TableCellResizer: Table column not found.");let k=y.getColWidths();if(!k)return;let I=k[T];if(I===void 0)return;let M=[...k],O=Math.max(I+N,Xl);M[T]=O,y.setColWidths(M)},{tag:"skip-scroll-into-view"})},[a,t]),_=Tt(N=>{let S=y=>{if(y.preventDefault(),y.stopPropagation(),!a)throw new Error("TableCellResizer: Expected active cell.");if(i.current){let{x:E,y:T}=i.current;if(a===null)return;let k=zl(y.target);if(g(N)){let I=(y.clientY-T)/k;b(I)}else{let I=(y.clientX-E)/k;x(I)}f(),document.removeEventListener("mouseup",S)}};return S},[a,f,x,b]),C=Tt(N=>S=>{if(S.preventDefault(),S.stopPropagation(),!a)throw new Error("TableCellResizer: Expected active cell.");i.current={x:S.clientX,y:S.clientY},s(i.current),p(N),document.addEventListener("mouseup",_(N))},[a,_]),[w,R]=wt({bottom:null,left:null,right:null,top:null});return gr(()=>{if(a){let{height:N,left:S,top:y,width:E}=a.elem.getBoundingClientRect(),T=zl(a.elem),k=10,I={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${k}px`,left:`${window.scrollX+S}px`,top:`${window.scrollY+y+N-k/2}px`,width:`${E}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${N}px`,left:`${window.scrollX+S+E-k/2}px`,top:`${window.scrollY+y}px`,width:`${k}px`}},M=r.current;m&&l&&M&&(g(m)?(I[m].left=`${window.scrollX+M.left}px`,I[m].top=`${window.scrollY+l.y/T}px`,I[m].height="3px",I[m].width=`${M.width}px`):(I[m].top=`${window.scrollY+M.top}px`,I[m].left=`${window.scrollX+l.x/T}px`,I[m].width="3px",I[m].height=`${M.height}px`),I[m].backgroundColor="#adf"),R(I)}else R({bottom:null,left:null,right:null,top:null})},[a,m,l]),io("div",{ref:o,children:a!=null&&!c&&If(Jl.Fragment,{children:[io("div",{className:`${n.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:C("right"),style:w.right||void 0}),io("div",{className:`${n.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:C("bottom"),style:w.bottom||void 0})]})})}var ql=()=>{let t=Sf(3),[e]=yf(),o=vf(),r,n;return t[0]!==e||t[1]!==o?(n=o?Pf(io(Hf,{editor:e}),document.body):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],r=n,r};import{c as Yf}from"react/compiler-runtime";import{jsx as Cr,jsxs as zf,Fragment as Xf}from"react/jsx-runtime";import{useLexicalComposerContext as ls}from"@lexical/react/LexicalComposerContext";import{$getTableAndElementByKey as Jf,$getTableColumnIndexFromTableCellNode as qf,$getTableRowIndexFromTableCellNode as Qf,$insertTableColumn__EXPERIMENTAL as e1,$insertTableRow__EXPERIMENTAL as t1,$isTableCellNode as o1,$isTableNode as ts,getTableElement as r1,TableNode as n1}from"@lexical/table";import{$findMatchingParent as i1,mergeRegister as l1}from"@lexical/utils";import{$getNearestNodeFromDOMNode as os}from"lexical";import{useEffect as rs,useMemo as s1,useRef as ns,useState as lo}from"react";import"react";import{createPortal as a1}from"react-dom";import{c as Vf}from"react/compiler-runtime";import{useEffect as Kf,useRef as Zf}from"react";var jf="Expected a function",Uf=Math.max,Gf=Math.min;function Wf(t,e,o){let r,n,i=0,l,s=!1,a=!1,u,c,d,m=!0;if(typeof t!="function")throw new TypeError(jf);e=e||0,typeof o=="object"&&(s=!!o.leading,a="maxWait"in o,u=a?Uf(o.maxWait||0,e):u,m="trailing"in o?!!o.trailing:m);function p(C){let w=r,R=l;return r=l=void 0,i=C,c=t.apply(R,w),c}function f(C){return i=C,d=setTimeout(b,e),s?p(C):c}function h(C){let w=C-n,R=C-i,N=e-w;return a?Gf(N,u-R):N}function g(C){let w=C-n,R=C-i;return n===void 0||w>=e||w<0||a&&R>=u}function b(){let C=Date.now();if(g(C))return L(C);d=setTimeout(b,h(C))}function L(C){return d=void 0,m&&r?p(C):(r=l=void 0,c)}function D(){d!==void 0&&clearTimeout(d),i=0,r=n=l=d=void 0}function x(){return d===void 0?c:L(Date.now())}function _(){let C=Date.now(),w=g(C);if(r=arguments,l=this,n=C,w){if(d===void 0)return f(n);if(a)return clearTimeout(d),d=setTimeout(b,e),p(n)}return d===void 0&&(d=setTimeout(b,e)),c}return _.cancel=D,_.flush=x,_}var Ql=Wf;function es(t,e,o){let r=Vf(6),n=Zf(null),i,l;r[0]!==t||r[1]!==o||r[2]!==e?(i=()=>(n.current=Ql(t,e,{maxWait:o}),()=>{n.current?.cancel()}),l=[t,e,o],r[0]=t,r[1]=o,r[2]=e,r[3]=i,r[4]=l):(i=r[3],l=r[4]),Kf(i,l);let s;return r[5]===Symbol.for("react.memo_cache_sentinel")?(s=(...u)=>{let c=u;n.current&&n.current(...c)},r[5]=s):s=r[5],s}var is=20;function c1({anchorElem:t}){let[e]=ls(),o=P(),[r,n]=lo(!1),[i,l]=lo(!1),[s,a]=lo(!1),[u,c]=lo({}),d=ns(new Set),m=ns(null),p=es(g=>{let{isOutside:b,tableDOMNode:L}=u1(g,o.editorConfig?.lexical);if(b){n(!1),l(!1);return}if(!L)return;m.current=L;let D=null,x=null,_=null;if(e.getEditorState().read(()=>{let I=os(L);if(o1(I)){let M=i1(I,O=>ts(O));if(!ts(M))return;if(_=r1(M,e.getElementByKey(M.getKey())),_){let O=M.getChildrenSize(),A=M.getChildAtIndex(0)?.getChildrenSize(),H=Qf(I),j=qf(I);H===O-1?D=I:j===A-1&&(x=I)}}},{editor:e}),!_)return;let C=_.parentElement;if(!C)return;let{bottom:w,height:R,left:N,right:S,width:y,y:E}=C.getBoundingClientRect(),{left:T,y:k}=t.getBoundingClientRect();D?(l(!1),n(!0),c({height:is,left:N-T,top:w-k+5,width:y})):x&&(l(!0),n(!1),c({height:R,left:S-T+5,top:E-k,width:is}))},50,250),f=s1(()=>new ResizeObserver(()=>{n(!1),l(!1)}),[]);rs(()=>{if(s)return document.addEventListener("mousemove",p),()=>{n(!1),l(!1),document.removeEventListener("mousemove",p)}},[s,p]),rs(()=>l1(e.registerMutationListener(n1,g=>{e.getEditorState().read(()=>{let b=!1;for(let[L,D]of g)switch(D){case"created":{d.current.add(L),b=!0;break}case"destroyed":{d.current.delete(L),b=!0;break}default:break}if(b){f.disconnect();for(let L of d.current){let{tableElement:D}=Jf(L);f.observe(D)}a(d.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let h=g=>{e.update(()=>{m.current&&(os(m.current)?.selectEnd(),g?(t1(),n(!1)):(e1(),l(!1)))})};return e?.isEditable()?zf(Xf,{children:[r&&Cr("button",{"aria-label":"Add Row",className:o.editorConfig.lexical.theme.tableAddRows,onClick:()=>h(!0),style:{...u},type:"button"}),i&&Cr("button",{"aria-label":"Add Column",className:o.editorConfig.lexical.theme.tableAddColumns,onClick:()=>h(!1),style:{...u},type:"button"})]}):null}function u1(t,e){let o=t.target;if(o&&o instanceof HTMLElement){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 ss(t){let e=Yf(2),{anchorElem:o}=t,r=o===void 0?document.body:o,[n]=ls();if(!n?.isEditable())return null;let i;return e[0]!==r?(i=a1(Cr(c1,{anchorElem:r}),r),e[0]=r,e[1]=i):i=e[1],i}import{c as d1}from"react/compiler-runtime";import{jsx as xr,jsxs as m1}from"react/jsx-runtime";import{useLexicalComposerContext as p1}from"@lexical/react/LexicalComposerContext";import{TablePlugin as f1}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as h1,TableNode as g1}from"@lexical/table";import{mergeRegister as C1}from"@lexical/utils";import{formatDrawerSlug as x1,useEditDepth as b1}from"@payloadcms/ui";import{$getSelection as _1,$isRangeSelection as T1,COMMAND_PRIORITY_EDITOR as w1,createCommand as E1}from"lexical";import{createContext as k1,useContext as L1,useEffect as N1,useMemo as R1,useState as S1}from"react";import*as as from"react";var so=E1("OPEN_EMBED_DRAWER_COMMAND"),cs=k1({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function us({children:t}){let[e,o]=S1({cellEditorConfig:null,cellEditorPlugins:null});return xr(cs.Provider,{value:R1(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(r,n)=>{o({cellEditorConfig:r,cellEditorPlugins:n})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var ds=()=>{let t=d1(16),[e]=p1(),o=L1(cs),r=b1(),{fieldProps:n,uuid:i}=P(),{schemaPath:l}=n,s="lexical-table-create-"+i,a;t[0]!==r||t[1]!==s?(a=x1({slug:s,depth:r}),t[0]=r,t[1]=s,t[2]=a):a=t[2];let u=a,{toggleDrawer:c}=ae(u,!0),d;t[3]!==e||t[4]!==c?(d=()=>{if(!e.hasNodes([g1]))throw new Error("TablePlugin: TableNode is not registered on editor");return C1(e.registerCommand(so,()=>{let h;return h=null,e.getEditorState().read(()=>{let g=_1();T1(g)&&(h=g)}),h&&c(),!0},w1))},t[3]=e,t[4]=c,t[5]=d):d=t[5];let m;t[6]!==o||t[7]!==e||t[8]!==c?(m=[o,e,c],t[6]=o,t[7]=e,t[8]=c,t[9]=m):m=t[9],N1(d,m);let p;t[10]!==e?(p=(h,g)=>{!g.columns||!g.rows||e.dispatchCommand(h1,{columns:String(g.columns),rows:String(g.rows)})},t[10]=e,t[11]=p):p=t[11];let f;return t[12]!==u||t[13]!==l||t[14]!==p?(f=m1(as.Fragment,{children:[xr(Ye,{drawerSlug:u,drawerTitle:"Create Table",featureKey:"experimental_table",handleDrawerSubmit:p,schemaPath:l,schemaPathSuffix:"fields"}),xr(f1,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]}),t[12]=u,t[13]=l,t[14]=p,t[15]=f):f=t[15],f};var M1=v({markdownTransformers:[Pl],nodes:[y1,I1,v1],plugins:[{Component:ds,position:"normal"},{Component:ql,position:"normal"},{Component:Zl,position:"floatingAnchorElem"},{Component:ss,position:"floatingAnchorElem"}],providers:[us],slashMenu:{groups:[Y([{Icon:ir,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(so,{})}}])]},toolbarFixed:{groups:[de([{ChildComponent:ir,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(so,{})}}])]}});import{$isNodeSelection as ch}from"lexical";import{jsx as br,jsxs as D1}from"react/jsx-runtime";import"react";var _r=()=>D1("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:[br("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"}),br("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"}),br("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 P1}from"react/jsx-runtime";import fs from"bson-objectid";import{$applyNodeReplacement as B1}from"lexical";import*as hs from"react";import{jsx as A1}from"react/jsx-runtime";import{DecoratorBlockNode as O1}from"@lexical/react/LexicalDecoratorBlockNode.js";import ms from"bson-objectid";import{$applyNodeReplacement as F1}from"lexical";import"react";function Tr(t){return t.parentElement!=null&&t.parentElement.tagName==="LI"&&t.previousSibling===null&&t.getAttribute("aria-roledescription")==="checkbox"}function $1(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:ps({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||Tr(e),null}var Et=class extends O1{__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:$1,priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new ms.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value},r=ps({data:o});return r.setFormat(e.format),r}static isInline(){return!1}decorate(){return A1(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 ps({data:t}){return t?.id||(t.id=new ms.default().toHexString()),F1(new Et({data:t}))}var H1=hs.lazy(()=>import("./component-P5K7Z5NW.js").then(t=>({default:t.UploadComponent})));function j1(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:Ae({data:{fields:{},relationTo:r,value:o}})}}let e=t;return e.src.startsWith("file:///")||Tr(e),null}var be=class extends Et{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:j1,priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new fs.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value},r=Ae({data:o});return r.setFormat(e.format),r}decorate(){return P1(H1,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Ae({data:t}){return t?.id||(t.id=new fs.default().toHexString()),B1(new be({data:t}))}function wr(t){return t instanceof be}import{c as z1}from"react/compiler-runtime";import{jsx as X1}from"react/jsx-runtime";import{useLexicalComposerContext as J1}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as q1,mergeRegister as Q1}from"@lexical/utils";import{useConfig as eh}from"@payloadcms/ui";import{$getPreviousSelection as th,$getSelection as oh,$isParagraphNode as rh,$isRangeSelection as nh,COMMAND_PRIORITY_EDITOR as ih,createCommand as lh}from"lexical";import{useEffect as sh}from"react";import{c as gs}from"react/compiler-runtime";import{jsx as Er}from"react/jsx-runtime";import{useLexicalComposerContext as Cs}from"@lexical/react/LexicalComposerContext.js";import{toast as U1}from"@payloadcms/ui";import{$getNodeByKey as G1,COMMAND_PRIORITY_EDITOR as xs}from"lexical";import{useEffect as bs,useState as W1}from"react";var V1=({editor:t,relationTo:e,replaceNodeKey:o,value:r})=>{o?t.update(()=>{let n=G1(o);n&&n.replace(Ae({data:{fields:null,relationTo:e,value:r}}))}):t.dispatchCommand(kr,{fields:null,relationTo:e,value:r})},K1=t=>{let e=gs(13),{enabledCollectionSlugs:o}=t,[r]=Cs(),[n,i]=W1(null),l;e[0]!==o?(l={collectionSlugs:o,uploads:!0},e[0]=o,e[1]=l):l=e[1];let{closeListDrawer:s,ListDrawer:a,openListDrawer:u}=ht(l),c,d;e[2]!==r||e[3]!==u?(c=()=>r.registerCommand(Pe,h=>(i(h?.replace?h?.replace.nodeKey:null),u(),!0),xs),d=[r,u],e[2]=r,e[3]=u,e[4]=c,e[5]=d):(c=e[4],d=e[5]),bs(c,d);let m;e[6]!==s||e[7]!==r||e[8]!==n?(m=h=>{let{collectionSlug:g,docID:b}=h;s(),V1({editor:r,relationTo:g,replaceNodeKey:n,value:b})},e[6]=s,e[7]=r,e[8]=n,e[9]=m):m=e[9];let p=m,f;return e[10]!==a||e[11]!==p?(f=Er(a,{onSelect:p}),e[10]=a,e[11]=p,e[12]=f):f=e[12],f},Z1=()=>{let t=gs(3),[e]=Cs(),o,r;return t[0]!==e?(o=()=>e.registerCommand(Pe,Y1,xs),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),bs(o,r),null},_s=t=>Er(Rt,{...t,FallbackComponent:Z1,uploads:!0,children:Er(K1,{...t})});function Y1(){return U1.error("No upload collections enabled"),!0}var kr=lh("INSERT_UPLOAD_COMMAND"),Ts=t=>{let e=z1(5),[o]=J1(),{config:r}=eh(),{collections:n}=r,i,l;e[0]!==o?(i=()=>{if(!o.hasNodes([be]))throw new Error("UploadPlugin: UploadNode not registered on editor");return Q1(o.registerCommand(kr,a=>(o.update(()=>{let u=oh()||th();if(nh(u)){let c=Ae({data:{id:a.id,fields:a.fields,relationTo:a.relationTo,value:a.value}});q1(c);let{focus:d}=u,m=d.getNode();rh(m)&&!m.__first&&(m.__prev||m.__next)&&m.remove()}}),!0),ih))},l=[o],e[0]=o,e[1]=i,e[2]=l):(i=e[1],l=e[2]),sh(i,l);let s;return e[3]!==n?(s=X1(_s,{enabledCollectionSlugs:n.map(ah)}),e[3]=n,e[4]=s):s=e[4],s};function ah(t){let{slug:e}=t;return e}var uh=v({nodes:[be],plugins:[{Component:Ts,position:"normal"}],slashMenu:{groups:[Y([{Icon:_r,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Pe,{replace:!1})}}])]},toolbarFixed:{groups:[de([{ChildComponent:_r,isActive:({selection:t})=>{if(!ch(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return wr(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Pe,{replace:!1})}}])]}});import{c as dh}from"react/compiler-runtime";import{jsx as Nr}from"react/jsx-runtime";import{ShimmerEffect as mh,useConfig as ph}from"@payloadcms/ui";import{lazy as fh,Suspense as hh,useEffect as gh,useState as Ch}from"react";var ws={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",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",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",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 ao={namespace:"lexical",theme:ws};function Es({config:t,featureClientSchemaMap:e,field:o,schemaPath:r,unSanitizedEditorConfig:n}){for(let a of n.features)if(!a?.clientFeatureProps?.featureKey||a?.clientFeatureProps?.order===void 0||a?.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.");n.features=n.features.sort((a,u)=>a.clientFeatureProps.order-u.clientFeatureProps.order);let i=new Map;for(let a of n.features)i.set(a.clientFeatureProps.featureKey,a);let l=new Map,s=0;for(let a of n.features){let u=typeof a.feature=="function"?a.feature({config:t,featureClientSchemaMap:e,featureProviderMap:i,field:o,resolvedFeatures:l,schemaPath:r,unSanitizedEditorConfig:n}):a.feature;u.key=a.clientFeatureProps.featureKey,u.order=s,l.set(a.clientFeatureProps.featureKey,u),s++}return l}var ks=t=>{let e={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}};if(!t?.size)return e;t.forEach(o=>{if(o.providers?.length&&(e.providers=e.providers.concat(o.providers)),o.enableFormats?.length&&e.enabledFormats.push(...o.enableFormats),o.nodes?.length)for(let r of o.nodes)e.nodes.push(r);if(o.plugins?.length&&o.plugins.forEach((r,n)=>{e.plugins?.push({clientProps:o.sanitizedClientFeatureProps,Component:r.Component,key:o.key+n,position:r.position})}),o.toolbarInline?.groups?.length)for(let r of o.toolbarInline.groups){let n=e.toolbarInline.groups.find(i=>i.key===r.key);n?e.toolbarInline.groups=e.toolbarInline.groups.filter(i=>i.key!==r.key):n={...r,items:[]},r?.items?.length&&(n.items=n.items.concat(r.items)),e.toolbarInline?.groups.push(n)}if(o.toolbarFixed?.groups?.length)for(let r of o.toolbarFixed.groups){let n=e.toolbarFixed.groups.find(i=>i.key===r.key);n?e.toolbarFixed.groups=e.toolbarFixed.groups.filter(i=>i.key!==r.key):n={...r,items:[]},r?.items?.length&&(n.items=n.items.concat(r.items)),e.toolbarFixed?.groups.push(n)}if(o.slashMenu?.groups){o.slashMenu.dynamicGroups?.length&&(e.slashMenu.dynamicGroups=e.slashMenu.dynamicGroups.concat(o.slashMenu.dynamicGroups));for(let r of o.slashMenu.groups){let n=e.slashMenu.groups.find(i=>i.key===r.key);n?e.slashMenu.groups=e.slashMenu.groups.filter(i=>i.key!==r.key):n={...r,items:[]},r?.items?.length&&(n.items=n.items.concat(r.items)),e.slashMenu.groups.push(n)}}if(o.markdownTransformers?.length)for(let r of o.markdownTransformers)typeof r=="function"?e.markdownTransformers.push(r({allNodes:e.nodes,allTransformers:e.markdownTransformers})):e.markdownTransformers.push(r);e.enabledFeatures.push(o.key)}),e.toolbarInline.groups.sort((o,r)=>o.order&&r.order?o.order-r.order:o.order?-1:r.order?1:0),e.toolbarFixed.groups.sort((o,r)=>o.order&&r.order?o.order-r.order:o.order?-1:r.order?1:0);for(let o of e.toolbarInline.groups)o.items.sort((r,n)=>r.order&&n.order?r.order-n.order:r.order?-1:n.order?1:0);for(let o of e.toolbarFixed.groups)o.items.sort((r,n)=>r.order&&n.order?r.order-n.order:r.order?-1:n.order?1:0);return e};function Lr(t,e,o){return{admin:o,features:ks(t),lexical:e,resolvedFeatureMap:t}}var xh=fh(()=>import("./Field-ZQTPXWY3.js").then(t=>({default:t.RichText}))),bh=t=>{let e=dh(15),{admin:o,clientFeatures:r,featureClientSchemaMap:n,field:i,lexicalEditorConfig:l,schemaPath:s}=t,a;e[0]!==o?(a=o===void 0?{}:o,e[0]=o,e[1]=a):a=e[1];let u=a,c=l===void 0?ao:l,{config:d}=ph(),[m,p]=Ch(null),f,h;e[2]!==u||e[3]!==r||e[4]!==d||e[5]!==n||e[6]!==i||e[7]!==m||e[8]!==c||e[9]!==s?(f=()=>{if(m)return;let b=[];for(let[x,_]of Object.entries(r))_.clientFeatureProvider&&b.push(_.clientFeatureProvider(_.clientFeatureProps));let L=c||ao,D=Es({config:d,featureClientSchemaMap:n,field:i,schemaPath:s??i.name,unSanitizedEditorConfig:{features:b,lexical:L}});p(Lr(D,L,u))},h=[c,u,m,r,n,i,d,s],e[2]=u,e[3]=r,e[4]=d,e[5]=n,e[6]=i,e[7]=m,e[8]=c,e[9]=s,e[10]=f,e[11]=h):(f=e[10],h=e[11]),gh(f,h);let g;return e[12]!==m||e[13]!==t?(g=Nr(hh,{fallback:Nr(mh,{height:"35vh"}),children:m&&Nr(xh,{...t,editorConfig:m})}),e[12]=m,e[13]=t,e[14]=g):g=e[14],g};function _h(...t){return t.filter(Boolean).join(" ")}var co=new WeakMap;function Ls(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function uo(t,e){let o=co.get(t);if(o===void 0){let r=new Set,n=l=>{o!==void 0&&(o.start=Ls(l))},i=l=>{if(o===void 0)return;let{start:s}=o;if(s===null)return;let a=Ls(l);for(let u of r)a!==null&&u([a[0]-s[0],a[1]-s[1]],l)};t.addEventListener("touchstart",n),t.addEventListener("touchend",i),o={handleTouchend:i,handleTouchstart:n,listeners:r,start:null},co.set(t,o)}return o.listeners.add(e),()=>{Th(t,e)}}function Th(t,e){let o=co.get(t);if(o===void 0)return;let{listeners:r}=o;r.delete(e),r.size===0&&(co.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function wh(t,e){return uo(t,(o,r)=>{let[n,i]=o;n<0&&-n>Math.abs(i)&&e(n,r)})}function Eh(t,e){return uo(t,(o,r)=>{let[n,i]=o;n>0&&n>Math.abs(i)&&e(n,r)})}function kh(t,e){return uo(t,(o,r)=>{let[n,i]=o;i<0&&-i>Math.abs(n)&&e(n,r)})}function Lh(t,e){return uo(t,(o,r)=>{let[n,i]=o;i>0&&i>Math.abs(n)&&e(n,r)})}var F={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},Nh=F.IS_BOLD|F.IS_ITALIC|F.IS_STRIKETHROUGH|F.IS_UNDERLINE|F.IS_CODE|F.IS_SUBSCRIPT|F.IS_SUPERSCRIPT|F.IS_HIGHLIGHT,Rh="\xA0",Sh=`
|
|
39
39
|
|
|
40
|
-
`,
|
|
40
|
+
`,Ns="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Rs="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Ih=new RegExp("^[^"+Rs+"]*["+Ns+"]"),yh=new RegExp("^[^"+Ns+"]*["+Rs+"]"),vh={bold:F.IS_BOLD,code:F.IS_CODE,highlight:F.IS_HIGHLIGHT,italic:F.IS_ITALIC,strikethrough:F.IS_STRIKETHROUGH,subscript:F.IS_SUBSCRIPT,superscript:F.IS_SUPERSCRIPT,underline:F.IS_UNDERLINE},Mh={directionless:F.IS_DIRECTIONLESS,unmergeable:F.IS_UNMERGEABLE},Dh={center:F.IS_ALIGN_CENTER,end:F.IS_ALIGN_END,justify:F.IS_ALIGN_JUSTIFY,left:F.IS_ALIGN_LEFT,right:F.IS_ALIGN_RIGHT,start:F.IS_ALIGN_START},Ah={[F.IS_ALIGN_CENTER]:"center",[F.IS_ALIGN_END]:"end",[F.IS_ALIGN_JUSTIFY]:"justify",[F.IS_ALIGN_LEFT]:"left",[F.IS_ALIGN_RIGHT]:"right",[F.IS_ALIGN_START]:"start"},Oh={normal:F.IS_NORMAL,segmented:F.IS_SEGMENTED,token:F.IS_TOKEN},Fh={[F.IS_NORMAL]:"normal",[F.IS_SEGMENTED]:"segmented",[F.IS_TOKEN]:"token"};import{c as $h}from"react/compiler-runtime";import{jsx as Ph}from"react/jsx-runtime";import"react";var Bh=()=>{let t=$h(2),{EditButton:e}=ce(),o;return t[0]!==e?(o=e?Ph(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Hh}from"react/compiler-runtime";import{jsx as jh}from"react/jsx-runtime";import"react";var Uh=()=>{let t=Hh(2),{RemoveButton:e}=ce(),o;return t[0]!==e?(o=e?jh(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Gh}from"react/compiler-runtime";import{jsx as Wh}from"react/jsx-runtime";import"react";var Vh=()=>{let t=Gh(2),{Label:e}=ce(),o;return t[0]!==e?(o=e?Wh(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Kh}from"react/compiler-runtime";import{jsx as Zh}from"react/jsx-runtime";import"react";var Yh=t=>{let e=Kh(3),{children:o}=t,{InlineBlockContainer:r}=ce(),n;return e[0]!==r||e[1]!==o?(n=r?Zh(r,{children:o}):null,e[0]=r,e[1]=o,e[2]=n):n=e[2],n};import{c as zh}from"react/compiler-runtime";import{jsx as Xh}from"react/jsx-runtime";import"react";var Jh=t=>{let e=zh(6),{children:o,editButton:r,Label:n,removeButton:i}=t,{BlockCollapsible:l}=Ne(),s;return e[0]!==l||e[1]!==n||e[2]!==o||e[3]!==r||e[4]!==i?(s=l?Xh(l,{editButton:r,Label:n,removeButton:i,children:o}):null,e[0]=l,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s):s=e[5],s};import{c as qh}from"react/compiler-runtime";import{jsx as Qh}from"react/jsx-runtime";import"react";var eg=()=>{let t=qh(2),{EditButton:e}=Ne(),o;return t[0]!==e?(o=e?Qh(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as tg}from"react/compiler-runtime";import{jsx as og}from"react/jsx-runtime";import"react";var rg=()=>{let t=tg(2),{RemoveButton:e}=Ne(),o;return t[0]!==e?(o=e?og(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};export{st as $createAutoLinkNode,$t as $createBlockNode,ho as $createInlineBlockNode,me as $createLinkNode,ve as $createRelationshipNode,Ae as $createUploadNode,fe as $isAutoLinkNode,tt as $isBlockNode,go as $isInlineBlockNode,K as $isLinkNode,Xo as $isRelationshipNode,wr as $isUploadNode,Us as AlignFeatureClient,pe as AutoLinkNode,Jh as BlockCollapsible,eg as BlockEditButton,ue as BlockNode,rg as BlockRemoveButton,Ys as BlockquoteFeatureClient,Wa as BlocksFeatureClient,dc as BoldFeatureClient,ys as CAN_USE_DOM,Wd as ChecklistFeatureClient,Mh as DETAIL_TYPE_TO_DETAIL,Sh as DOUBLE_LINE_BREAK,Ah as ELEMENT_FORMAT_TO_TYPE,Dh as ELEMENT_TYPE_TO_FORMAT,Os as ENABLE_SLASH_MENU_COMMAND,Is as EditorConfigProvider,Ye as FieldsDrawer,Ap as FixedToolbarFeatureClient,Zc as HeadingFeatureClient,uu as HorizontalRuleFeatureClient,Nh as IS_ALL_FORMATTING,gu as IndentFeatureClient,Yh as InlineBlockContainer,Bh as InlineBlockEditButton,Vh as InlineBlockLabel,fo as InlineBlockNode,Uh as InlineBlockRemoveButton,gc as InlineCodeFeatureClient,Vp as InlineToolbarFeatureClient,_c as ItalicFeatureClient,yh as LTR_REGEX,mm as LexicalPluginToLexicalFeatureClient,Id as LinkFeatureClient,J as LinkNode,Rh as NON_BREAKING_SPACE,F as NodeFormat,qd as OrderedListFeatureClient,_m as ParagraphFeatureClient,Ds as Point,Ih as RTL_REGEX,Fs as Rect,ip as RelationshipFeatureClient,ge as RelationshipNode,bh as RichTextField,xm as SlateToLexicalFeatureClient,Lc as StrikethroughFeatureClient,Ic as SubscriptFeatureClient,Dc as SuperscriptFeatureClient,Oh as TEXT_MODE_TO_TYPE,vh as TEXT_TYPE_TO_FORMAT,Fh as TEXT_TYPE_TO_MODE,ne as TOGGLE_LINK_COMMAND,M1 as TableFeatureClient,oc as TestRecorderFeatureClient,gt as ToolbarButton,Me as ToolbarDropdown,sc as TreeViewFeatureClient,Pc as UnderlineFeatureClient,lm as UnorderedListFeatureClient,uh as UploadFeatureClient,be as UploadNode,Lh as addSwipeDownListener,wh as addSwipeLeftListener,Eh as addSwipeRightListener,kh as addSwipeUpListener,vo as createBlockNode,v as createClientFeature,ao as defaultEditorLexicalConfig,nr as getDOMRangeRect,$s as getEnabledNodes,Be as getSelectedNode,Ms as isHTMLElement,As as isPoint,_h as joinClasses,Lr as sanitizeClientEditorConfig,ks as sanitizeClientFeatures,qt as setFloatingElemPosition,Vt as setFloatingElemPositionForLinkEditor,Y as slashMenuBasicGroupWithItems,de as toolbarAddDropdownGroupWithItems,Do as toolbarFeatureButtonsGroupWithItems,z as toolbarFormatGroupWithItems,X as toolbarTextDropdownGroupWithItems,Ne as useBlockComponentContext,P as useEditorConfigContext,ce as useInlineBlockComponentContext,vs as useLexicalDocumentDrawer,ae as useLexicalDrawer,ht as useLexicalListDrawer};
|
|
41
41
|
//# sourceMappingURL=index.js.map
|