82 lines
368 KiB
JavaScript
82 lines
368 KiB
JavaScript
;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="4c18300e-a1a0-40f6-d39c-65c958064fd9")}catch(e){}}();
|
||
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,289839,e=>{"use strict";var t=e.i(638857),l=e.i(624503),n=e.i(830487);e.s(["Account",()=>t.Account,"ActionsProvider",()=>t.ActionsProvider,"AnimateHeight",()=>t.AnimateHeight,"AppHeader",()=>t.AppHeader,"ArrayField",()=>t.ArrayField,"AuthProvider",()=>t.AuthProvider,"Banner",()=>t.Banner,"BlockSelector",()=>t.BlockSelector,"BlocksDrawer",()=>t.BlocksDrawer,"BlocksField",()=>t.BlocksField,"BrowseByFolderButton",()=>t.BrowseByFolderButton,"BulkUploadDrawer",()=>t.BulkUploadDrawer,"BulkUploadProvider",()=>t.BulkUploadProvider,"Button",()=>t.Button,"CalendarIcon",()=>n.m,"Card",()=>t.Card,"CheckIcon",()=>t.CheckIcon,"CheckboxField",()=>t.CheckboxField,"CheckboxInput",()=>t.CheckboxInput,"ChevronIcon",()=>t.ChevronIcon,"ClientFunctionProvider",()=>t.ClientFunctionProvider,"CloseMenuIcon",()=>t.CloseMenuIcon,"CodeBlockIcon",()=>t.CodeBlockIcon,"CodeEditor",()=>l.l,"CodeEditorLazy",()=>t.CodeEditorLazy,"CodeField",()=>t.CodeField,"Collapsible",()=>t.Collapsible,"CollapsibleField",()=>t.CollapsibleField,"Combobox",()=>t.Combobox,"ConfigProvider",()=>l.b,"ConfirmPasswordField",()=>t.ConfirmPasswordField,"ConfirmationModal",()=>t.ConfirmationModal,"CopyIcon",()=>t.CopyIcon,"CopyLocaleData",()=>t.CopyLocaleData,"CopyToClipboard",()=>t.CopyToClipboard,"DateCell",()=>t.DateCell,"DateCondition",()=>t.DateCondition,"DatePicker",()=>n.n,"DateTimeField",()=>t.DateTimeField,"DefaultBlockImage",()=>t.DefaultBlockImage,"DefaultBrowseByFolderView",()=>t.DefaultBrowseByFolderView,"DefaultCell",()=>t.DefaultCell,"DefaultCollectionFolderView",()=>t.DefaultCollectionFolderView,"DefaultEditView",()=>t.DefaultEditView,"DefaultListView",()=>t.DefaultListView,"DeleteMany",()=>t.DeleteMany,"DocumentControls",()=>t.DocumentControls,"DocumentEventsProvider",()=>t.DocumentEventsProvider,"DocumentFields",()=>t.DocumentFields,"DocumentIcon",()=>t.DocumentIcon,"DocumentInfoProvider",()=>t.DocumentInfoProvider,"DocumentLocked",()=>t.DocumentLocked,"DocumentTakeOver",()=>t.DocumentTakeOver,"DragHandleIcon",()=>t.DragHandleIcon,"Drawer",()=>t.Drawer,"DrawerContentContainer",()=>t.DrawerContentContainer,"DrawerToggler",()=>t.DrawerToggler,"Dropzone",()=>t.Dropzone,"EditDepthProvider",()=>t.EditDepthProvider,"EditIcon",()=>t.EditIcon,"EditMany",()=>t.EditMany,"EditUpload",()=>t.EditUpload,"EmailAndUsernameFields",()=>t.EmailAndUsernameFields,"EmailField",()=>t.EmailField,"EntityVisibilityProvider",()=>t.EntityVisibilityProvider,"ErrorIcon",()=>t.ErrorIcon,"ErrorPill",()=>t.ErrorPill,"ExternalLinkIcon",()=>t.ExternalLinkIcon,"FieldContext",()=>t.FieldContext,"FieldDescription",()=>t.FieldDescription,"FieldDiffContainer",()=>t.FieldDiffContainer,"FieldDiffLabel",()=>t.FieldDiffLabel,"FieldError",()=>t.FieldError,"FieldLabel",()=>t.FieldLabel,"FieldPathContext",()=>t.FieldPathContext,"File",()=>t.File,"FileDetails",()=>t.FileDetails,"FolderFileTable",()=>t.FolderFileTable,"FolderIcon",()=>t.FolderIcon,"FolderProvider",()=>t.FolderProvider,"FolderTypeField",()=>t.FolderTypeField,"Form",()=>t.Form,"FormLoadingOverlayToggle",()=>t.FormLoadingOverlayToggle,"FormSubmit",()=>t.FormSubmit,"FullscreenModal",()=>t.FullscreenModal,"GearIcon",()=>t.GearIcon,"GenerateConfirmation",()=>t.GenerateConfirmation,"GridViewIcon",()=>t.GridViewIcon,"GroupByHeader",()=>t.GroupByHeader,"GroupByPageControls",()=>t.GroupByPageControls,"GroupField",()=>t.GroupField,"Gutter",()=>t.Gutter,"Hamburger",()=>t.Hamburger,"HiddenField",()=>t.HiddenField,"HydrateAuthProvider",()=>t.HydrateAuthProvider,"InfoIcon",()=>t.InfoIcon,"ItemCardGrid",()=>t.ItemCardGrid,"ItemsDrawer",()=>t.ItemsDrawer,"JSONField",()=>t.JSONField,"JoinField",()=>t.JoinField,"LeaveWithoutSaving",()=>t.LeaveWithoutSaving,"LineIcon",()=>t.LineIcon,"Link",()=>t.Link,"LinkIcon",()=>t.LinkIcon,"ListControls",()=>t.ListControls,"ListDrawerContextProvider",()=>t.ListDrawerContextProvider,"ListHeader",()=>t.ListHeader,"ListQueryProvider",()=>t.ListQueryProvider,"ListSelection",()=>t.ListSelection,"ListViewIcon",()=>t.ListViewIcon,"LivePreviewProvider",()=>t.LivePreviewProvider,"LivePreviewWindow",()=>t.LivePreviewWindow,"LoadingOverlay",()=>t.LoadingOverlay,"LoadingOverlayToggle",()=>t.LoadingOverlayToggle,"LocaleProvider",()=>t.LocaleProvider,"Locked",()=>t.Locked,"LogOutIcon",()=>t.LogOutIcon,"Logout",()=>t.Logout,"MenuIcon",()=>t.MenuIcon,"MinimizeMaximizeIcon",()=>t.MinimizeMaximizeIcon,"Modal",()=>t.Modal,"MoreIcon",()=>t.MoreIcon,"MoveDocToFolder",()=>t.MoveDocToFolder,"MoveDocToFolderButton",()=>t.MoveDocToFolderButton,"MoveFolderIcon",()=>t.MoveFolderIcon,"NavContext",()=>t.NavContext,"NavGroup",()=>t.NavGroup,"NavProvider",()=>t.NavProvider,"NavToggler",()=>t.NavToggler,"NullifyLocaleField",()=>t.NullifyLocaleField,"NumberCondition",()=>t.NumberCondition,"NumberField",()=>t.NumberField,"OperationProvider",()=>t.OperationProvider,"OrderableTable",()=>t.OrderableTable,"PageConfigProvider",()=>l.d,"PageControls",()=>t.PageControls,"PageControlsComponent",()=>t.PageControlsComponent,"Pagination",()=>t.Pagination,"ParamsProvider",()=>t.ParamsProvider,"PasswordField",()=>t.PasswordField,"PayloadIcon",()=>t.PayloadIcon,"PerPage",()=>t.PerPage,"Pill",()=>t.Pill,"PillSelector",()=>t.PillSelector,"PlusIcon",()=>t.PlusIcon,"PointField",()=>t.PointField,"Popup",()=>t.Popup,"PopupList",()=>t.PopupList,"PreferencesProvider",()=>t.PreferencesProvider,"PreviewButton",()=>t.PreviewButton,"PreviewSizes",()=>t.PreviewSizes,"ProgressBar",()=>t.ProgressBar,"PublishButton",()=>t.PublishButton,"PublishMany",()=>t.PublishMany,"QueryPresetsAccessCell",()=>t.QueryPresetsAccessCell,"QueryPresetsColumnField",()=>t.QueryPresetsColumnField,"QueryPresetsColumnsCell",()=>t.QueryPresetsColumnsCell,"QueryPresetsGroupByCell",()=>t.QueryPresetsGroupByCell,"QueryPresetsGroupByField",()=>t.QueryPresetsGroupByField,"QueryPresetsWhereCell",()=>t.QueryPresetsWhereCell,"QueryPresetsWhereField",()=>t.QueryPresetsWhereField,"RadioGroupField",()=>t.RadioGroupField,"ReactSelect",()=>t.ReactSelect,"RelationshipCondition",()=>t.RelationshipCondition,"RelationshipField",()=>t.RelationshipField,"RelationshipInput",()=>t.RelationshipInput,"RelationshipProvider",()=>t.RelationshipProvider,"RelationshipTable",()=>t.RelationshipTable,"RenderCustomComponent",()=>t.RenderCustomComponent,"RenderDefaultCell",()=>t.RenderDefaultCell,"RenderFields",()=>t.RenderFields,"RenderTitle",()=>t.RenderTitle,"RichTextField",()=>t.RichTextField,"RootProvider",()=>t.RootProvider,"RouteCacheProvider",()=>t.RouteCacheProvider,"RouteTransitionProvider",()=>t.RouteTransitionProvider,"RowField",()=>t.RowField,"RowLabel",()=>t.RowLabel,"RowLabelProvider",()=>t.RowLabelProvider,"SaveButton",()=>t.SaveButton,"SaveDraftButton",()=>t.SaveDraftButton,"ScrollInfoProvider",()=>t.ScrollInfoProvider,"SearchFilter",()=>t.SearchFilter,"SearchIcon",()=>t.SearchIcon,"SearchParamsProvider",()=>t.SearchParamsProvider,"SectionTitle",()=>t.SectionTitle,"Select",()=>t.Select,"SelectAll",()=>t.SelectAll,"SelectCondition",()=>t.SelectCondition,"SelectField",()=>t.SelectField,"SelectInput",()=>t.SelectInput,"SelectMany",()=>t.SelectMany,"SelectRow",()=>t.SelectRow,"SelectionProvider",()=>t.SelectionProvider,"ServerFunctionsContext",()=>t.ServerFunctionsContext,"ServerFunctionsProvider",()=>t.ServerFunctionsProvider,"SetDocumentStepNav",()=>t.SetDocumentStepNav,"SetDocumentTitle",()=>t.SetDocumentTitle,"SetStepNav",()=>t.SetStepNav,"ShimmerEffect",()=>l.f,"SlugField",()=>t.SlugField,"SortColumn",()=>t.SortColumn,"SortHeader",()=>t.SortHeader,"SortRow",()=>t.SortRow,"StaggeredShimmers",()=>l.g,"StickyToolbar",()=>t.StickyToolbar,"SuccessIcon",()=>t.SuccessIcon,"SwapIcon",()=>t.SwapIcon,"TabComponent",()=>t.TabComponent,"Table",()=>t.Table,"TableColumnsProvider",()=>t.TableColumnsProvider,"TabsField",()=>t.TabsField,"TabsProvider",()=>t.TabsProvider,"TextCondition",()=>t.TextCondition,"TextField",()=>t.TextField,"TextInput",()=>t.TextInput,"TextareaField",()=>t.TextareaField,"TextareaInput",()=>t.TextareaInput,"ThemeProvider",()=>l.i,"Thumbnail",()=>t.Thumbnail,"TimezonePicker",()=>t.TimezonePicker,"Tooltip",()=>t.Tooltip,"Translation",()=>t.Translation,"TranslationProvider",()=>n.c,"UIField",()=>t.UIField,"UnpublishButton",()=>t.UnpublishButton,"UnpublishMany",()=>t.UnpublishMany,"Upload",()=>t.Upload,"UploadEditsProvider",()=>t.UploadEditsProvider,"UploadField",()=>t.UploadField,"UploadHandlersProvider",()=>t.UploadHandlersProvider,"UploadInput",()=>t.UploadInput,"ViewDescription",()=>t.ViewDescription,"WarningIcon",()=>t.WarningIcon,"WatchChildErrors",()=>t.WatchChildErrors,"WatchCondition",()=>t.WatchCondition,"WindowInfoProvider",()=>t.WindowInfoProvider,"XIcon",()=>n.a,"allFieldComponents",()=>t.allFieldComponents,"defaultTheme",()=>l.h,"documentDrawerBaseClass",()=>t.documentDrawerBaseClass,"escapeDiffHTML",()=>t.escapeDiffHTML,"fieldBaseClass",()=>t.fieldBaseClass,"fieldComponents",()=>t.fieldComponents,"fieldReducer",()=>t.fieldReducer,"formatDrawerSlug",()=>t.formatDrawerSlug,"formatTimeToNow",()=>t.formatTimeToNow,"getHTMLDiffComponents",()=>t.getHTMLDiffComponents,"isFieldRTL",()=>t.isFieldRTL,"parseSearchParams",()=>t.parseSearchParams,"toast",()=>t.toast,"unescapeDiffHTML",()=>t.unescapeDiffHTML,"useActions",()=>t.useActions,"useAddClientFunction",()=>t.useAddClientFunction,"useAllFormFields",()=>t.useAllFormFields,"useAuth",()=>t.useAuth,"useBulkUpload",()=>t.useBulkUpload,"useBulkUploadDrawerSlug",()=>t.useBulkUploadDrawerSlug,"useCellProps",()=>t.useCellProps,"useClickOutside",()=>t.useClickOutside,"useClickOutsideContext",()=>t.useClickOutsideContext,"useClientFunctions",()=>t.useClientFunctions,"useCollapsible",()=>t.useCollapsible,"useConfig",()=>l.c,"useControllableState",()=>l.a,"useDebounce",()=>t.useDebounce,"useDebouncedCallback",()=>t.useDebouncedCallback,"useDebouncedEffect",()=>t.useDebouncedEffect,"useDelay",()=>l.e,"useDelayedRender",()=>t.useDelayedRender,"useDocumentDrawer",()=>t.useDocumentDrawer,"useDocumentDrawerContext",()=>t.useDocumentDrawerContext,"useDocumentEvents",()=>t.useDocumentEvents,"useDocumentForm",()=>t.useDocumentForm,"useDocumentInfo",()=>t.useDocumentInfo,"useDocumentTitle",()=>t.useDocumentTitle,"useDrawerSlug",()=>t.useDrawerSlug,"useEditDepth",()=>t.useEditDepth,"useEffectEvent",()=>t.useEffectEvent,"useEntityVisibility",()=>t.useEntityVisibility,"useField",()=>t.useField,"useFieldPath",()=>t.useFieldPath,"useFolder",()=>t.useFolder,"useForm",()=>t.useForm,"useFormBackgroundProcessing",()=>t.useFormBackgroundProcessing,"useFormFields",()=>t.useFormFields,"useFormInitializing",()=>t.useFormInitializing,"useFormModified",()=>t.useFormModified,"useFormProcessing",()=>t.useFormProcessing,"useFormSubmitted",()=>t.useFormSubmitted,"useHotkey",()=>t.useHotkey,"useIntersect",()=>t.useIntersect,"useListDrawer",()=>t.useListDrawer,"useListDrawerContext",()=>t.useListDrawerContext,"useListQuery",()=>t.useListQuery,"useListRelationships",()=>t.useListRelationships,"useLivePreviewContext",()=>t.useLivePreviewContext,"useLocale",()=>t.useLocale,"useModal",()=>t.useModal,"useNav",()=>t.useNav,"useOperation",()=>t.useOperation,"useParams",()=>t.useParams,"usePayloadAPI",()=>t.usePayloadAPI,"usePreferences",()=>t.usePreferences,"useQueue",()=>t.useQueue,"useResize",()=>t.useResize,"useRouteCache",()=>t.useRouteCache,"useRouteTransition",()=>t.useRouteTransition,"useRowLabel",()=>t.useRowLabel,"useScrollInfo",()=>t.useScrollInfo,"useSearchParams",()=>t.useSearchParams,"useSelection",()=>t.useSelection,"useServerFunctions",()=>t.useServerFunctions,"useStepNav",()=>t.useStepNav,"useTableColumns",()=>t.useTableColumns,"useTheme",()=>l.j,"useThrottledEffect",()=>t.useThrottledEffect,"useTranslation",()=>n.d,"useUploadControls",()=>t.useUploadControls,"useUploadEdits",()=>t.useUploadEdits,"useUploadHandlers",()=>t.useUploadHandlers,"useUseTitleField",()=>t.useUseTitleField,"useWatchForm",()=>t.useWatchForm,"useWindowInfo",()=>t.useWindowInfo,"withCondition",()=>t.withCondition])},274392,e=>{"use strict";var t=e.i(638857);e.s(["ShouldRenderTabs",0,e=>{let{children:l}=e,{id:n,collectionSlug:r,globalSlug:o}=(0,t.useDocumentInfo)();return r&&("create"!==n?n:null)||o?l:null}])},931611,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857),r=e.i(976819),o=e.i(713465);e.i(907358),e.s(["DocumentTabLink",0,e=>{let i,a,s=(0,t.c)(13),{adminRoute:c,ariaLabel:u,baseClass:d,children:f,href:h,isActive:p,newTab:g}=e,m=(0,r.usePathname)(),b=(0,r.useParams)(),C=(0,r.useSearchParams)().get("locale"),[x,y,v,_]=b.segments||[],S="collections"===x,N=`/${S?"collections":"globals"}/${y}`;s[0]!==c||s[1]!==N?(i=(0,o.formatAdminURL)({adminRoute:c,path:N}),s[0]=c,s[1]=N,s[2]=i):i=s[2];let w=i;S&&("trash"===v&&_?w+=`/trash/${_}`:v&&(w+=`/${v}`));let k=`${w}${h}`,T=`${k}${C?`?locale=${C}`:""}`;if(s[3]!==u||s[4]!==d||s[5]!==f||s[6]!==w||s[7]!==k||s[8]!==T||s[9]!==p||s[10]!==g||s[11]!==m){let e=k===w&&m===w||k!==w&&m.startsWith(k)||p;a=(0,l.jsx)(n.Button,{"aria-label":u,buttonStyle:"tab",className:[d,e&&`${d}--active`].filter(Boolean).join(" "),disabled:e,el:e&&k===m?"div":"link",margin:!1,newTab:g,size:"medium",to:e&&k===m?void 0:T,children:f}),s[3]=u,s[4]=d,s[5]=f,s[6]=w,s[7]=k,s[8]=T,s[9]=p,s[10]=g,s[11]=m,s[12]=a}else a=s[12];return a}])},57460,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857);e.i(907358),e.s(["VersionsPill",0,()=>{let e,r=(0,t.c)(2),{versionCount:o}=(0,n.useDocumentInfo)();return o?(r[0]!==o?(e=(0,l.jsx)("span",{className:"pill-version-count",children:o}),r[0]=o,r[1]=e):e=r[1],e):null}])},474016,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857);e.i(907358),e.s(["NavHamburger",0,e=>{let r,o,i=(0,t.c)(6),{baseClass:a}=e,{navOpen:s,setNavOpen:c}=(0,n.useNav)(),u=`${a}__mobile-close`;i[0]!==c?(r=()=>{c(!1)},i[0]=c,i[1]=r):r=i[1];let d=s?void 0:-1;return i[2]!==u||i[3]!==r||i[4]!==d?(o=(0,l.jsx)("button",{className:u,onClick:r,tabIndex:d,type:"button",children:(0,l.jsx)(n.Hamburger,{isActive:!0})}),i[2]=u,i[3]=r,i[4]=d,i[5]=o):o=i[5],o}])},980857,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857);e.i(907358),e.s(["NavWrapper",0,e=>{let r,o,i=(0,t.c)(11),{baseClass:a,children:s}=e,{hydrated:c,navOpen:u,navRef:d,shouldAnimate:f}=(0,n.useNav)(),h=u&&`${a}--nav-open`,p=f&&`${a}--nav-animate`,g=c&&`${a}--nav-hydrated`;i[0]!==a||i[1]!==h||i[2]!==p||i[3]!==g?(r=[a,h,p,g].filter(Boolean),i[0]=a,i[1]=h,i[2]=p,i[3]=g,i[4]=r):r=i[4];let m=r.join(" "),b=!u||void 0,C=`${a}__scroll`;return i[5]!==s||i[6]!==d||i[7]!==m||i[8]!==b||i[9]!==C?(o=(0,l.jsx)("aside",{className:m,inert:b,children:(0,l.jsx)("div",{className:C,ref:d,children:s})}),i[5]=s,i[6]=d,i[7]=m,i[8]=b,i[9]=C,i[10]=o):o=i[10],o}])},349847,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857),r=e.i(138452),o=e.i(907358);function i(e,t){return(0,l.jsx)(o.Fragment,{children:e},`settings-menu-item-${t}`)}e.s(["SettingsMenuButton",0,e=>{let o,a=(0,t.c)(3),{settingsMenu:s}=e,{t:c}=(0,r.useTranslation)();return s&&0!==s.length?(a[0]!==s||a[1]!==c?(o=(0,l.jsx)(n.Popup,{button:(0,l.jsx)(n.GearIcon,{ariaLabel:c("general:menu")}),className:"settings-menu-button",horizontalAlign:"left",id:"settings-menu",size:"small",verticalAlign:"bottom",children:s.map(i)}),a[0]=s,a[1]=c,a[2]=o):o=a[2],o):null}])},649983,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(704333),r=e.i(638857),o=e.i(55686),i=e.i(138452),a=e.i(226150),s=e.i(976819),c=e.i(713465),u=e.i(907358);e.s(["DefaultNavClient",0,e=>{let d,f=(0,t.c)(13),{groups:h,navPreferences:p}=e,g=(0,s.usePathname)(),{config:m}=(0,o.useConfig)(),{admin:b,folders:C,routes:x}=m,{routes:y}=b,{browseByFolder:v}=y,{admin:_}=x,{i18n:S}=(0,i.useTranslation)();if(f[0]!==_||f[1]!==C||f[2]!==v||f[3]!==h||f[4]!==S||f[5]!==p?.groups||f[6]!==g){let e,t=(0,c.formatAdminURL)({adminRoute:_,path:v}),o=g.startsWith(t);f[8]!==_||f[9]!==S||f[10]!==p?.groups||f[11]!==g?(e=(e,t)=>{let{entities:o,label:i}=e;return(0,l.jsx)(r.NavGroup,{isOpen:p?.groups?.[i]?.open,label:i,children:o.map((e,t)=>{let o,i,{slug:s,type:u,label:d}=e;u===a.EntityType.collection&&(o=(0,c.formatAdminURL)({adminRoute:_,path:`/collections/${s}`}),i=`nav-${s}`),u===a.EntityType.global&&(o=(0,c.formatAdminURL)({adminRoute:_,path:`/globals/${s}`}),i=`nav-global-${s}`);let f=g.startsWith(o)&&["/",void 0].includes(g[o.length]),h=(0,l.jsxs)(l.Fragment,{children:[f&&(0,l.jsx)("div",{className:"nav__link-indicator"}),(0,l.jsx)("span",{className:"nav__link-label",children:(0,n.getTranslation)(d,S)})]});return g===o?(0,l.jsx)("div",{className:"nav__link",id:i,children:h},t):(0,l.jsx)(r.Link,{className:"nav__link",href:o,id:i,prefetch:!1,children:h},t)})},t)},f[8]=_,f[9]=S,f[10]=p?.groups,f[11]=g,f[12]=e):e=f[12],d=(0,l.jsxs)(u.Fragment,{children:[C&&C.browseByFolder&&(0,l.jsx)(r.BrowseByFolderButton,{active:o}),h.map(e)]}),f[0]=_,f[1]=C,f[2]=v,f[3]=h,f[4]=S,f[5]=p?.groups,f[6]=g,f[7]=d}else d=f[7];return d}])},265296,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857);e.i(907358),e.s(["NavHamburger",0,()=>{let e,r=(0,t.c)(2),{navOpen:o}=(0,n.useNav)();return r[0]!==o?(e=(0,l.jsx)(n.Hamburger,{closeIcon:"collapse",isActive:o}),r[0]=o,r[1]=e):e=r[1],e}])},726511,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857);e.i(907358),e.s(["Wrapper",0,e=>{let r,o,i=(0,t.c)(9),{baseClass:a,children:s,className:c}=e,{hydrated:u,navOpen:d,shouldAnimate:f}=(0,n.useNav)(),h=d&&`${a}--nav-open`,p=f&&`${a}--nav-animate`,g=u&&`${a}--nav-hydrated`;i[0]!==a||i[1]!==c||i[2]!==h||i[3]!==p||i[4]!==g?(r=[a,c,h,p,g].filter(Boolean),i[0]=a,i[1]=c,i[2]=h,i[3]=p,i[4]=g,i[5]=r):r=i[5];let m=r.join(" ");return i[6]!==s||i[7]!==m?(o=(0,l.jsx)("div",{className:m,children:s}),i[6]=s,i[7]=m,i[8]=o):o=i[8],o}])},75701,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857),r=e.i(55686),o=e.i(138452),i=e.i(907358);let a="not-found";e.s(["NotFoundClient",0,e=>{let s,c,u,d,f=(0,t.c)(10),{marginTop:h}=e,p=void 0===h?"large":h,{setStepNav:g}=(0,n.useStepNav)(),{t:m}=(0,o.useTranslation)(),{config:b}=(0,r.useConfig)(),{routes:C}=b,{admin:x}=C;f[0]!==g||f[1]!==m?(s=()=>{g([{label:m("general:notFound")}])},c=[g,m],f[0]=g,f[1]=m,f[2]=s,f[3]=c):(s=f[2],c=f[3]),(0,i.useEffect)(s,c);let y=p&&`${a}--margin-top-${p}`;f[4]!==y?(u=[a,y].filter(Boolean),f[4]=y,f[5]=u):u=f[5];let v=u.join(" ");return f[6]!==x||f[7]!==m||f[8]!==v?(d=(0,l.jsx)("div",{className:v,children:(0,l.jsxs)(n.Gutter,{className:`${a}__wrap`,children:[(0,l.jsxs)("div",{className:`${a}__content`,children:[(0,l.jsx)("h1",{children:m("general:nothingFound")}),(0,l.jsx)("p",{children:m("general:sorryNotFound")})]}),(0,l.jsx)(n.Button,{className:`${a}__button`,el:"link",size:"large",to:x,children:m("general:backToDashboard")})]})}),f[6]=x,f[7]=m,f[8]=v,f[9]=d):d=f[9],d}])},816320,e=>{"use strict";var t=e.i(452797),l=e.i(638857),n=e.i(55686),r=e.i(138452),o=e.i(976819),i=e.i(713465),a=e.i(387880),s=e.i(907358),c=e.i(785316);let u=e=>{let n,o=(0,c.c)(6),{localeOptions:i,onChange:a}=e,{t:s}=(0,r.useTranslation)();if(o[0]!==i||o[1]!==a||o[2]!==s){let e;o[4]!==a?(e=e=>a(e),o[4]=a,o[5]=e):e=o[5],n=(0,t.jsx)(l.SelectField,{field:{name:"locale",label:s("general:locale"),options:i},onChange:e,path:"locale"}),o[0]=i,o[1]=a,o[2]=s,o[3]=n}else n=o[3];return n},d="query-inspector",f=({type:e,comma:l=!1,position:n})=>(0,t.jsxs)("span",{className:`${d}__bracket ${d}__bracket--position-${n}`,children:["end"===n?"object"===e?"}":"]":"object"===e?"{":"[","end"===n&&l?",":null]}),h=e=>{let n,r=(0,c.c)(2),{isEmpty:o,object:i,objectKey:a,parentType:u,trailingComma:p}=e,g=void 0!==o&&o,m=void 0===u?"object":u,b=void 0!==p&&p,C=i?Object.keys(i):[],x=C.length,[y,v]=s.useState(!0),_="object"===m||"array"===m;return r[0]!==y?(n=()=>v(!y),r[0]=y,r[1]=n):n=r[1],(0,t.jsxs)("li",{className:_?`${d}__row-line--nested`:"",children:[(0,t.jsxs)("button",{"aria-label":"toggle",className:`${d}__list-toggle ${g?`${d}__list-toggle--empty`:""}`,onClick:n,type:"button",children:[g?null:(0,t.jsx)(l.ChevronIcon,{className:`${d}__toggle-row-icon ${d}__toggle-row-icon--${y?"open":"closed"}`}),(0,t.jsxs)("span",{children:[a&&`"${a}": `,(0,t.jsx)(f,{position:"start",type:m}),g?(0,t.jsx)(f,{comma:b,position:"end",type:m}):null]})]}),(0,t.jsx)("ul",{className:`${d}__json-children ${_?`${d}__json-children--nested`:""}`,children:y&&C.map((e,l)=>{let n,r=i[e],o=l===x-1;if(null===r?n="null":r instanceof Date?(n="date",r=r.toISOString()):n=Array.isArray(r)?"array":"object"==typeof r?"object":"number"==typeof r?"number":"boolean"==typeof r?"boolean":"string","object"===n||"array"===n)return(0,t.jsx)(h,{isEmpty:0===r.length||0===Object.keys(r).length,object:r,objectKey:"object"===m?e:void 0,parentType:n,trailingComma:!o},`${e}-${l}`);if("date"===n||"string"===n||"null"===n||"number"===n||"boolean"===n){let i=!!("object"===m&&e),s=[`${d}__row-line`,`${d}__value-type--${n}`,`${d}__row-line--${a?"nested":"top"}`].filter(Boolean).join(" ");return(0,t.jsxs)("li",{className:s,children:[i?(0,t.jsx)("span",{children:`"${e}": `}):null,(0,t.jsx)("span",{className:`${d}__value`,children:JSON.stringify(r)}),o?"":","]},`${e}-${l}`)}})}),!g&&(0,t.jsx)("span",{className:_?`${d}__bracket--nested`:"",children:(0,t.jsx)(f,{comma:b,position:"end",type:m})})]})},p="query-inspector";e.s(["APIViewClient",0,()=>{let e,{id:c,collectionSlug:d,globalSlug:f,initialData:g,isTrashed:m}=(0,l.useDocumentInfo)(),b=(0,o.useSearchParams)(),{i18n:C,t:x}=(0,r.useTranslation)(),{code:y}=(0,l.useLocale)(),{config:{defaultDepth:v,localization:_,routes:{api:S},serverURL:N},getEntityConfig:w}=(0,n.useConfig)(),k=w({collectionSlug:d}),T=w({globalSlug:f}),E=_&&_.locales.map(e=>({label:e.label,value:e.code})),$=!1;k&&($=(0,a.hasDraftsEnabled)(k),e=`/${d}/${c}`),T&&($=(0,a.hasDraftsEnabled)(T),e=`/globals/${f}`);let[L,M]=s.useState(g),[R,j]=s.useState("true"===b.get("draft")),[I,F]=s.useState(b?.get("locale")||y),[O,D]=s.useState(b.get("depth")||v.toString()),[P,A]=s.useState(!0),[B,H]=s.useState(!1),[z,K]=s.useState(N||"");s.useEffect(()=>{N||K(window.location.origin)},[N]);let U="string"==typeof g?.deletedAt,V=new URLSearchParams({depth:O,draft:String(R),locale:I,trash:U?"true":"false"}).toString(),W=(0,i.formatAdminURL)({apiRoute:S,path:`${e}?${V}`,serverURL:z});return s.useEffect(()=>{(async()=>{try{let e=await fetch(W,{credentials:P?"include":"omit",headers:{"Accept-Language":C.language},method:"GET"});try{let t=await e.json();M(t)}catch(e){l.toast.error("Error parsing response"),console.error(e)}}catch(e){l.toast.error("Error making request"),console.error(e)}})()},[C.language,W,P]),(0,t.jsxs)(l.Gutter,{className:[p,B&&`${p}--fullscreen`].filter(Boolean).join(" "),right:!1,children:[(0,t.jsx)(l.SetDocumentStepNav,{collectionSlug:d,globalLabel:T?.label,globalSlug:f,id:c,isTrashed:m,pluralLabel:k?k?.labels?.plural:void 0,useAsTitle:k?k?.admin?.useAsTitle:void 0,view:"API"}),(0,t.jsxs)("div",{className:`${p}__configuration`,children:[(0,t.jsxs)("div",{className:`${p}__api-url`,children:[(0,t.jsxs)("span",{className:`${p}__label`,children:["API URL ",(0,t.jsx)(l.CopyToClipboard,{value:W})]}),(0,t.jsx)("a",{href:W,rel:"noopener noreferrer",target:"_blank",children:W})]}),(0,t.jsx)(l.Form,{initialState:{authenticated:{initialValue:P||!1,valid:!0,value:P||!1},depth:{initialValue:Number(O||0),valid:!0,value:Number(O||0)},draft:{initialValue:R||!1,valid:!0,value:R||!1},locale:{initialValue:I,valid:!0,value:I}},children:(0,t.jsxs)("div",{className:`${p}__form-fields`,children:[(0,t.jsxs)("div",{className:`${p}__filter-query-checkboxes`,children:[$&&(0,t.jsx)(l.CheckboxField,{field:{name:"draft",label:x("version:draft")},onChange:()=>j(!R),path:"draft"}),(0,t.jsx)(l.CheckboxField,{field:{name:"authenticated",label:x("authentication:authenticated")},onChange:()=>A(!P),path:"authenticated"})]}),E&&(0,t.jsx)(u,{localeOptions:E,onChange:F}),(0,t.jsx)(l.NumberField,{field:{name:"depth",admin:{step:1},label:x("general:depth"),max:10,min:0},onChange:e=>D(e?.toString()),path:"depth"})]})})]}),(0,t.jsxs)("div",{className:`${p}__results-wrapper`,children:[(0,t.jsx)("div",{className:`${p}__toggle-fullscreen-button-container`,children:(0,t.jsx)("button",{"aria-label":"toggle fullscreen",className:`${p}__toggle-fullscreen-button`,onClick:()=>H(!B),type:"button",children:(0,t.jsx)(l.MinimizeMaximizeIcon,{isMinimized:!B})})}),(0,t.jsx)("div",{className:`${p}__results`,children:(0,t.jsx)(h,{object:L})})]})]})}],816320)},269066,e=>{"use strict";var t=e.i(452797),l=e.i(638857);e.i(907358),e.s(["EditView",0,e=>(0,t.jsx)(l.DefaultEditView,{...e})])},720182,e=>{"use strict";var t=e.i(907358);let l=(0,t.createContext)({selectedLocales:[]});e.s(["SelectedLocalesContext",0,l,"useSelectedLocales",0,()=>(0,t.use)(l)])},234601,e=>{"use strict";var t=e.i(452797),l=e.i(638857),n=e.i(55686),r=e.i(138452),o=e.i(976819),i=e.i(907358),a=e.i(704333),s=e.i(226150),c=e.i(713465);let u="restore-version",d="restore-version",f=({className:e,collectionConfig:f,globalConfig:h,label:p,originalDocID:g,status:m,versionDateFormatted:b,versionID:C})=>{let{config:{routes:{admin:x,api:y}}}=(0,n.useConfig)(),{toggleModal:v}=(0,l.useModal)(),_=(0,o.useRouter)(),{i18n:S,t:N}=(0,r.useTranslation)(),[w,k]=(0,i.useState)(!1),{startRouteTransition:T}=(0,l.useRouteTransition)(),E=N(h?"version:aboutToRestoreGlobal":"version:aboutToRestore",{label:(0,a.getTranslation)(p,S),versionDate:b}),$="draft"!==m&&f?.versions?.drafts,L=(0,i.useCallback)(async()=>{let e,t=(0,c.formatAdminURL)({apiRoute:y,path:""});f&&(t=`${t}/${f.slug}/versions/${C}?draft=${w}`,e=(0,c.formatAdminURL)({adminRoute:x,path:`/collections/${f.slug}/${g}`})),h&&(t=`${t}/globals/${h.slug}/versions/${C}?draft=${w}`,e=(0,c.formatAdminURL)({adminRoute:x,path:`/globals/${h.slug}`}));let n=await s.requests.post(t,{headers:{"Accept-Language":S.language}});if(200===n.status){let t=await n.json();return l.toast.success(t.message),T(()=>_.push(e))}l.toast.error(N("version:problemRestoringVersion"))},[y,f,h,S.language,C,w,x,g,T,_,N]);return(0,t.jsxs)(i.Fragment,{children:[(0,t.jsx)("div",{className:[u,e].filter(Boolean).join(" "),children:(0,t.jsx)(l.Button,{buttonStyle:"primary",className:[$&&`${u}__restore-as-draft-button`].filter(Boolean).join(" "),onClick:()=>v(d),size:"xsmall",SubMenuPopupContent:$?()=>(0,t.jsx)(l.PopupList.ButtonGroup,{children:(0,t.jsx)(l.PopupList.Button,{onClick:()=>[k(!0),v(d)],children:N("version:restoreAsDraft")})}):null,children:N("version:restoreThisVersion")})}),(0,t.jsx)(l.ConfirmationModal,{body:E,confirmingLabel:N("version:restoring"),heading:N("version:confirmVersionRestoration"),modalSlug:d,onConfirm:L})]})};var h=e.i(785316);let p=e=>{let{collectionSlug:n,docID:a,drawerSlug:s,globalSlug:c}=e,{isTrashed:u}=(0,l.useDocumentInfo)(),{closeModal:d}=(0,l.useModal)(),f=(0,o.useSearchParams)(),h=(0,i.useRef)(f),{renderDocument:p}=(0,l.useServerFunctions)(),[g,m]=(0,i.useState)(void 0),[b,C]=(0,i.useState)(!0),x=(0,i.useRef)(!1),{t:y}=(0,r.useTranslation)(),v=(0,i.useCallback)(e=>{(async()=>{C(!0);try{let t=!!c,l=n??c,r=await p({collectionSlug:l,docID:e,drawerSlug:s,paramsOverride:{segments:[t?"globals":"collections",l,...u?["trash"]:[],t?void 0:String(e),"versions"].filter(Boolean)},redirectAfterDelete:!1,redirectAfterDuplicate:!1,searchParams:Object.fromEntries(f.entries()),versions:{disableGutter:!0,useVersionDrawerCreatedAtCell:!0}});r?.Document&&(m(r.Document),C(!1))}catch(e){l.toast.error(e?.message||y("error:unspecific")),d(s)}})()},[d,n,s,c,u,p,f,y]);return((0,i.useEffect)(()=>{x.current&&h.current===f||(h.current=f,v(a),x.current=!0)},[a,v,f]),b)?(0,t.jsx)(l.LoadingOverlay,{}):g},g=e=>{let n,o=(0,h.c)(6),{collectionSlug:i,docID:a,drawerSlug:s,globalSlug:c}=e,{t:u}=(0,r.useTranslation)();return o[0]!==i||o[1]!==a||o[2]!==s||o[3]!==c||o[4]!==u?(n=(0,t.jsx)(l.Drawer,{className:"version-drawer",gutter:!0,slug:s,title:u("version:selectVersionToCompare"),children:(0,t.jsx)(p,{collectionSlug:i,docID:a,drawerSlug:s,globalSlug:c})}),o[0]=i,o[1]=a,o[2]=s,o[3]=c,o[4]=u,o[5]=n):n=o[5],n},m="compare-version",b=(0,i.memo)(e=>{let{collectionSlug:n,docID:o,globalSlug:a,onChange:s,versionFromID:c,versionFromOptions:u}=e,{t:d}=(0,r.useTranslation)(),{Drawer:f,openDrawer:p}=(e=>{let n,r,o,a,s,c,u,d,f=(0,h.c)(29),{collectionSlug:p,docID:m,globalSlug:b}=e,C=(0,l.useEditDepth)(),x=(0,i.useId)(),{closeModal:y,modalState:v,openModal:_,toggleModal:S}=(0,l.useModal)(),[N,w]=(0,i.useState)(!1);f[0]!==C||f[1]!==x?(n=(({depth:e,uuid:t})=>`version-drawer_${e}_${t}`)({depth:C,uuid:x}),f[0]=C,f[1]=x,f[2]=n):n=f[2];let k=n;f[3]!==k||f[4]!==v?(r=()=>{w(!!v[k]?.isOpen)},o=[v,k],f[3]=k,f[4]=v,f[5]=r,f[6]=o):(r=f[5],o=f[6]),(0,i.useEffect)(r,o),f[7]!==k||f[8]!==S?(a=()=>{S(k)},f[7]=k,f[8]=S,f[9]=a):a=f[9];let T=a;f[10]!==y||f[11]!==k?(s=()=>{y(k)},f[10]=y,f[11]=k,f[12]=s):s=f[12];let E=s;f[13]!==k||f[14]!==_?(c=()=>{_(k)},f[13]=k,f[14]=_,f[15]=c):c=f[15];let $=c;f[16]!==p||f[17]!==m||f[18]!==k||f[19]!==b?(u=()=>(0,t.jsx)(g,{collectionSlug:p,docID:m,drawerSlug:k,globalSlug:b}),f[16]=p,f[17]=m,f[18]=k,f[19]=b,f[20]=u):u=f[20];let L=u;return f[21]!==L||f[22]!==E||f[23]!==C||f[24]!==k||f[25]!==N||f[26]!==$||f[27]!==T?(d={closeDrawer:E,Drawer:L,drawerDepth:C,drawerSlug:k,isDrawerOpen:N,openDrawer:$,toggleDrawer:T},f[21]=L,f[22]=E,f[23]=C,f[24]=k,f[25]=N,f[26]=$,f[27]=T,f[28]=d):d=f[28],d})({collectionSlug:n,docID:o,globalSlug:a}),b=(0,i.useMemo)(()=>[...u,{label:(0,t.jsx)("span",{className:`${m}-moreVersions`,children:d("version:moreVersions")}),value:"more"}],[d,u]),C=(0,i.useMemo)(()=>u.find(e=>e.value===c),[u,c]),x=(0,i.useCallback)(e=>{"more"===e.value?p():s(e)},[s,p]);return(0,t.jsxs)("div",{className:[l.fieldBaseClass,m].filter(Boolean).join(" "),children:[(0,t.jsx)(l.ReactSelect,{isClearable:!1,isSearchable:!1,onChange:x,options:b,placeholder:d("version:selectVersionToCompare"),value:C}),(0,t.jsx)(f,{})]})}),C="select-version-locales",x=({locales:e,localeSelectorOpen:n,onChange:r})=>(0,t.jsx)(l.AnimateHeight,{className:C,height:n?"auto":0,id:`${C}-locales`,children:(0,t.jsx)(l.PillSelector,{onClick:({pill:t})=>{r({locales:e.map(e=>e.name===t.name?{...e,selected:!t.selected}:e)})},pills:e})});var y=e.i(720182);let v=e=>{let t,o,s=(0,h.c)(24),{id:u,collectionConfig:d,globalConfig:f,isTrashed:p,versionToCreatedAtFormatted:g,versionToID:m}=e,{config:b}=(0,n.useConfig)(),{setStepNav:C}=(0,l.useStepNav)(),{i18n:x,t:y}=(0,r.useTranslation)(),v=(0,l.useLocale)(),{title:_}=(0,l.useDocumentTitle)();return s[0]!==d||s[1]!==b||s[2]!==f||s[3]!==x||s[4]!==u||s[5]!==p||s[6]!==C||s[7]!==y||s[8]!==_||s[9]!==g?(t=()=>{let{routes:e}=b,{admin:t}=e;if(d){let e=d.slug,l=d.labels?.plural,n=p?`/collections/${e}/trash/${u}`:`/collections/${e}/${u}`,r=[{label:(0,a.getTranslation)(l,x),url:(0,c.formatAdminURL)({adminRoute:t,path:`/collections/${e}`})}];p&&r.push({label:y("general:trash"),url:(0,c.formatAdminURL)({adminRoute:t,path:`/collections/${e}/trash`})}),r.push({label:_,url:(0,c.formatAdminURL)({adminRoute:t,path:n})},{label:y("version:versions"),url:(0,c.formatAdminURL)({adminRoute:t,path:`${n}/versions`})},{label:g,url:void 0}),C(r);return}if(f){let e=f.slug;C([{label:f.label,url:(0,c.formatAdminURL)({adminRoute:t,path:`/globals/${e}`})},{label:y("version:versions"),url:(0,c.formatAdminURL)({adminRoute:t,path:`/globals/${e}/versions`})},{label:g}])}},s[0]=d,s[1]=b,s[2]=f,s[3]=x,s[4]=u,s[5]=p,s[6]=C,s[7]=y,s[8]=_,s[9]=g,s[10]=t):t=s[10],s[11]!==d||s[12]!==b||s[13]!==f||s[14]!==x||s[15]!==u||s[16]!==p||s[17]!==v||s[18]!==C||s[19]!==y||s[20]!==_||s[21]!==g||s[22]!==m?(o=[b,C,u,p,v,y,x,d,f,_,g,m],s[11]=d,s[12]=b,s[13]=f,s[14]=x,s[15]=u,s[16]=p,s[17]=v,s[18]=C,s[19]=y,s[20]=_,s[21]=g,s[22]=m,s[23]=o):o=s[23],(0,i.useEffect)(t,o),null},_="view-version";e.s(["DefaultVersionView",0,({canUpdate:e,modifiedOnly:a,RenderedDiff:s,selectedLocales:c,versionFromCreatedAt:u,versionFromID:d,versionFromOptions:h,versionToCreatedAt:p,versionToCreatedAtFormatted:g,VersionToCreatedAtLabel:m,versionToID:C,versionToStatus:S})=>{let{config:N,getEntityConfig:w}=(0,n.useConfig)(),{code:k}=(0,l.useLocale)(),{i18n:T,t:E}=(0,r.useTranslation)(),[$,L]=(0,i.useState)([]),[M,R]=i.default.useState(!1);(0,i.useEffect)(()=>{N.localization&&L(N.localization.locales.map(e=>{let t=e.label;return"string"!=typeof e.label&&e.label[k]&&(t=e.label[k]),{name:e.code,Label:t,selected:c.includes(e.code)}}))},[k,N.localization,c]);let{id:j,collectionSlug:I,globalSlug:F,isTrashed:O}=(0,l.useDocumentInfo)(),{startRouteTransition:D}=(0,l.useRouteTransition)(),{collectionConfig:P,globalConfig:A}=(0,i.useMemo)(()=>({collectionConfig:w({collectionSlug:I}),globalConfig:w({globalSlug:F})}),[I,F,w]),B=(0,o.useRouter)(),H=(0,o.usePathname)(),z=(0,o.useSearchParams)(),[K,U]=(0,i.useState)(a),V=(0,i.useCallback)(e=>{let t=new URLSearchParams(Array.from(z.entries()));if(e?.versionFromID&&t.set("versionFrom",e?.versionFromID),e?.selectedLocales)if(e.selectedLocales.length){let l=[];for(let t of e.selectedLocales)t.selected&&l.push(t.name);t.set("localeCodes",JSON.stringify(l))}else t.delete("localeCodes");e?.modifiedOnly===!1?t.set("modifiedOnly","false"):e?.modifiedOnly===!0&&t.delete("modifiedOnly");let l=t.toString(),n=l?`?${l}`:"";D(()=>B.push(`${H}${n}`))},[H,B,z,D]),W=(0,i.useCallback)(e=>{let t=e.target.checked;U(t),V({modifiedOnly:t})},[V]),G=(0,i.useCallback)(({locales:e})=>{L(e),V({selectedLocales:e})},[V]),J=(0,i.useCallback)(e=>{V({versionFromID:e.value})},[V]),{localization:Y}=N,X=(0,i.useMemo)(()=>E("version:versionAgo",{distance:(0,l.formatTimeToNow)({date:p,i18n:T})}),[p,T,E]),Z=(0,i.useMemo)(()=>u?E("version:versionAgo",{distance:(0,l.formatTimeToNow)({date:u,i18n:T})}):void 0,[u,T,E]);return(0,t.jsxs)("main",{className:_,children:[(0,t.jsxs)(l.Gutter,{className:`${_}-controls-top`,children:[(0,t.jsxs)("div",{className:`${_}-controls-top__wrapper`,children:[(0,t.jsx)("h2",{children:T.t("version:compareVersions")}),(0,t.jsxs)("div",{className:`${_}-controls-top__wrapper-actions`,children:[(0,t.jsx)("span",{className:`${_}__modifiedCheckBox`,children:(0,t.jsx)(l.CheckboxInput,{checked:K,id:"modifiedOnly",label:T.t("version:modifiedOnly"),onToggle:W})}),Y&&(0,t.jsxs)(l.Pill,{"aria-controls":`${_}-locales`,"aria-expanded":M,className:`${_}__toggle-locales`,icon:(0,t.jsx)(l.ChevronIcon,{direction:M?"up":"down"}),onClick:()=>R(e=>!e),pillStyle:"light",size:"small",children:[(0,t.jsxs)("span",{className:`${_}__toggle-locales-label`,children:[E("general:locales"),":"," "]}),(0,t.jsx)("span",{className:`${_}__toggle-locales-list`,children:$.filter(e=>e.selected).map(e=>e.name).join(", ")})]})]})]}),Y&&(0,t.jsx)(x,{locales:$,localeSelectorOpen:M,onChange:G})]}),(0,t.jsx)(l.Gutter,{className:`${_}-controls-bottom`,children:(0,t.jsxs)("div",{className:`${_}-controls-bottom__wrapper`,children:[(0,t.jsxs)("div",{className:`${_}__version-from`,children:[(0,t.jsxs)("div",{className:`${_}__version-from-labels`,children:[(0,t.jsx)("span",{children:E("version:comparingAgainst")}),Z&&(0,t.jsx)("span",{className:`${_}__time-elapsed`,children:Z})]}),(0,t.jsx)(b,{collectionSlug:I,docID:j,globalSlug:F,onChange:J,versionFromID:d,versionFromOptions:h})]}),(0,t.jsxs)("div",{className:`${_}__version-to`,children:[(0,t.jsxs)("div",{className:`${_}__version-to-labels`,children:[(0,t.jsx)("span",{children:E("version:currentlyViewing")}),(0,t.jsx)("span",{className:`${_}__time-elapsed`,children:X})]}),(0,t.jsxs)("div",{className:`${_}__version-to-version`,children:[m,e&&!O&&(0,t.jsx)(f,{className:`${_}__restore`,collectionConfig:P,globalConfig:A,label:P?.labels.singular||A?.label,originalDocID:j,status:S,versionDateFormatted:g,versionID:C})]})]})]})}),(0,t.jsx)(v,{collectionConfig:P,globalConfig:A,id:j,isTrashed:O,versionToCreatedAtFormatted:g,versionToID:C}),(0,t.jsx)(l.Gutter,{className:`${_}__diff-wrap`,children:(0,t.jsx)(y.SelectedLocalesContext,{value:{selectedLocales:$.map(e=>e.name)},children:p&&s})})]})}],234601)},122464,665189,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857),r=e.i(55686),o=e.i(138452),i=e.i(866347),a=e.i(907358);function s(e,t){return JSON.stringify(e)!==JSON.stringify(t)}function c({baseVersionField:e,config:t,field:l,row:n,valueFromRow:r,valueToRow:o}){let i=[],a=[];if("array"===l.type&&"fields"in l)i=l.fields,a=e.rows?.length?e.rows[n]:e.fields;else if("blocks"===l.type)if(o?.blockType===r?.blockType)i=(t?.blocksMap?.[o?.blockType]??(("blocks"in l||"blockReferences"in l)&&(l.blockReferences??l.blocks)?.find(e=>"string"!=typeof e&&e.slug===o?.blockType)||{fields:[]})).fields,a=e.rows?.length?e.rows[n]:e.fields;else{let s=t?.blocksMap?.[o?.blockType]??(("blocks"in l||"blockReferences"in l)&&(l.blockReferences??l.blocks)?.find(e=>"string"!=typeof e&&e.slug===o?.blockType)||{fields:[]}),c=t?.blocksMap?.[r?.blockType]??(("blocks"in l||"blockReferences"in l)&&(l.blockReferences??l.blocks)?.find(e=>"string"!=typeof e&&e.slug===r?.blockType)||{fields:[]});i=[...new Map([...s.fields,...c.fields].map(e=>[e.name,e])).values()],a=e.rows?.length?e.rows[n]:e.fields}return{fields:i,versionFields:a}}function u({config:e,fields:t,locales:l,parentIsLocalized:n,valueFrom:r,valueTo:o}){let a=0;return t.forEach(t=>{if("name"in t&&"id"===t.name)return;let c=t.type;switch(c){case"array":case"blocks":if(l&&(0,i.fieldShouldBeLocalized)({field:t,parentIsLocalized:n}))l.forEach(i=>{let s=r?.[t.name]?.[i]??[],c=o?.[t.name]?.[i]??[];a+=d({config:e,field:t,locales:l,parentIsLocalized:n||t.localized,valueFromRows:s,valueToRows:c})});else{let i=r?.[t.name]??[],s=o?.[t.name]??[];a+=d({config:e,field:t,locales:l,parentIsLocalized:n||t.localized,valueFromRows:i,valueToRows:s})}break;case"checkbox":case"code":case"date":case"email":case"join":case"json":case"number":case"point":case"radio":case"relationship":case"richText":case"select":case"text":case"textarea":case"upload":l&&(0,i.fieldShouldBeLocalized)({field:t,parentIsLocalized:n})?l.forEach(e=>{s(o?.[t.name]?.[e],r?.[t.name]?.[e])&&a++}):s(o?.[t.name],r?.[t.name])&&a++;break;case"collapsible":case"row":a+=u({config:e,fields:t.fields,locales:l,parentIsLocalized:n||t.localized,valueFrom:r,valueTo:o});break;case"group":(0,i.groupHasName)(t)?l&&(0,i.fieldShouldBeLocalized)({field:t,parentIsLocalized:n})?l.forEach(i=>{a+=u({config:e,fields:t.fields,locales:l,parentIsLocalized:n||t.localized,valueFrom:r?.[t.name]?.[i],valueTo:o?.[t.name]?.[i]})}):a+=u({config:e,fields:t.fields,locales:l,parentIsLocalized:n||t.localized,valueFrom:r?.[t.name],valueTo:o?.[t.name]}):a+=u({config:e,fields:t.fields,locales:l,parentIsLocalized:n||t.localized,valueFrom:r,valueTo:o});break;case"tabs":t.tabs.forEach(t=>{"name"in t&&l&&t.localized?l.forEach(i=>{a+=u({config:e,fields:t.fields,locales:l,parentIsLocalized:n||t.localized,valueFrom:r?.[t.name]?.[i],valueTo:o?.[t.name]?.[i]})}):"name"in t?a+=u({config:e,fields:t.fields,locales:l,parentIsLocalized:n||t.localized,valueFrom:r?.[t.name],valueTo:o?.[t.name]}):a+=u({config:e,fields:t.fields,locales:l,parentIsLocalized:n||t.localized,valueFrom:r,valueTo:o})});break;case"ui":break;default:throw Error(`Unexpected field.type in countChangedFields : ${String(c)}`)}}),a}function d({config:e,field:t,locales:l,parentIsLocalized:n,valueFromRows:r=[],valueToRows:o=[]}){let i=0,a=0;for(;r[a]||o[a];){let s=r?.[a]||{},d=o?.[a]||{},{fields:f}=c({baseVersionField:{type:"text",fields:[],path:"",schemaPath:""},config:e,field:t,row:a,valueFromRow:s,valueToRow:d});i+=u({config:e,fields:f,locales:l,parentIsLocalized:n||t.localized,valueFrom:s,valueTo:d}),a++}return i}e.s(["getFieldsForRowComparison",()=>c],665189);let f="diff-collapser";e.s(["DiffCollapser",0,e=>{let s,c=(0,t.c)(19),{children:h,field:p,fields:g,hideGutter:m,initCollapsed:b,isIterable:C,Label:x,locales:y,parentIsLocalized:v,valueFrom:_,valueTo:S}=e,N=void 0!==m&&m,w=void 0!==C&&C,{t:k}=(0,o.useTranslation)(),[T,E]=(0,a.useState)(void 0!==b&&b),{config:$}=(0,r.useConfig)();if(c[0]!==x||c[1]!==h||c[2]!==$||c[3]!==p||c[4]!==g||c[5]!==N||c[6]!==T||c[7]!==w||c[8]!==y||c[9]!==v||c[10]!==k||c[11]!==_||c[12]!==S){let e,t,r;if(w){if(!(0,i.fieldIsArrayType)(p)&&!(0,i.fieldIsBlockType)(p))throw Error("DiffCollapser: field must be an array or blocks field when isIterable is true");let t=_??[],l=S??[];if(!Array.isArray(t)||!Array.isArray(l))throw Error("DiffCollapser: valueFrom and valueTro must be arrays when isIterable is true");e=d({config:$,field:p,locales:y,parentIsLocalized:v,valueFromRows:t,valueToRows:l})}else e=u({config:$,fields:g,locales:y,parentIsLocalized:v,valueFrom:_,valueTo:S});let o=T&&`${f}__content--is-collapsed`,a=N&&`${f}__content--hide-gutter`;c[14]!==o||c[15]!==a?(t=[`${f}__content`,o,a].filter(Boolean),c[14]=o,c[15]=a,c[16]=t):t=c[16];let m=t.join(" ");c[17]!==T?(r=()=>E(!T),c[17]=T,c[18]=r):r=c[18],s=(0,l.jsxs)("div",{className:f,children:[(0,l.jsxs)(n.FieldDiffLabel,{children:[(0,l.jsxs)("button",{"aria-label":T?"Expand":"Collapse",className:`${f}__toggle-button`,onClick:r,type:"button",children:[(0,l.jsx)("div",{className:`${f}__label`,children:x}),(0,l.jsx)(n.ChevronIcon,{direction:T?"right":"down",size:"small"})]}),e>0&&T&&(0,l.jsx)("span",{className:`${f}__field-change-count`,children:k("version:changedFieldsCount",{count:e})})]}),(0,l.jsx)("div",{className:m,children:h})]}),c[0]=x,c[1]=h,c[2]=$,c[3]=p,c[4]=g,c[5]=N,c[6]=T,c[7]=w,c[8]=y,c[9]=v,c[10]=k,c[11]=_,c[12]=S,c[13]=s}else s=c[13];return s}],122464)},769163,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(4497),r=e.i(907358);let o="render-field-diffs";function i(e,t){if(e.fieldByLocale){let n=[];for(let[r,i]of Object.entries(e.fieldByLocale))n.push((0,l.jsx)("div",{className:`${o}__locale`,"data-field-path":i.path,"data-locale":r,children:(0,l.jsx)("div",{className:`${o}__locale-value`,children:i.CustomComponent})},[r,t].join("-")));return(0,l.jsx)("div",{className:`${o}__field`,children:n},t)}return e.field?(0,l.jsx)("div",{className:`${o}__field field__${e.field.type}`,"data-field-path":e.field.path,children:e.field.CustomComponent},t):null}e.s(["RenderVersionFieldsToDiff",0,e=>{let a,s,c,u=(0,t.c)(6),{parent:d,versionFields:f}=e,[h,p]=r.default.useState(!1);u[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{p(!0)},s=[],u[0]=a,u[1]=s):(a=u[0],s=u[1]),(0,r.useEffect)(a,s);let g=`${o}${void 0!==d&&d?` ${o}--parent`:""}`;return u[2]!==h||u[3]!==g||u[4]!==f?(c=(0,l.jsx)("div",{className:g,children:h?f?.map(i):(0,l.jsx)(r.Fragment,{children:(0,l.jsx)(n.ShimmerEffect,{height:"8rem",width:"100%"})})}),u[2]=h,u[3]=g,u[4]=f,u[5]=c):c=u[5],c}])},185923,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(704333),r=e.i(138452);e.i(907358);var o=e.i(720182),i=e.i(122464),a=e.i(769163);e.s(["Collapsible",0,e=>{let s,c=(0,t.c)(8),{baseVersionField:u,comparisonValue:d,field:f,parentIsLocalized:h,versionValue:p}=e,{i18n:g}=(0,r.useTranslation)(),{selectedLocales:m}=(0,o.useSelectedLocales)();return u.fields?.length?(c[0]!==u.fields||c[1]!==f||c[2]!==g||c[3]!==h||c[4]!==m||c[5]!==d||c[6]!==p?(s=(0,l.jsx)("div",{className:"collapsible-diff",children:(0,l.jsx)(i.DiffCollapser,{fields:f.fields,Label:"label"in f&&f.label&&"function"!=typeof f.label&&(0,l.jsx)("span",{children:(0,n.getTranslation)(f.label,g)}),locales:m,parentIsLocalized:h||f.localized,valueFrom:d,valueTo:p,children:(0,l.jsx)(a.RenderVersionFieldsToDiff,{versionFields:u.fields})})}),c[0]=u.fields,c[1]=f,c[2]=g,c[3]=h,c[4]=m,c[5]=d,c[6]=p,c[7]=s):s=c[7],s):null}])},947171,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857),r=e.i(55686),o=e.i(138452),i=e.i(226150);e.i(907358);let a="date-diff";e.s(["DateDiffComponent",0,e=>{let s,c=(0,t.c)(7),{comparisonValue:u,field:d,locale:f,nestingLevel:h,versionValue:p}=e,{i18n:g}=(0,o.useTranslation)(),{config:m}=(0,r.useConfig)(),{admin:b}=m,{dateFormat:C}=b,x=u?(0,i.formatDate)({date:"string"==typeof u?new Date(u):u,i18n:g,pattern:C}):"",y=p?(0,i.formatDate)({date:"string"==typeof p?new Date(p):p,i18n:g,pattern:C}):"",v=(0,n.escapeDiffHTML)(x),_=(0,n.escapeDiffHTML)(y),S=`<div class="${a}" data-enable-match="true" data-date="${v}"><p>`+v+"</p></div>",N=`<div class="${a}" data-enable-match="true" data-date="${_}"><p>`+_+"</p></div>";if(c[0]!==d.label||c[1]!==g||c[2]!==f||c[3]!==h||c[4]!==S||c[5]!==N){let{From:e,To:t}=(0,n.getHTMLDiffComponents)({fromHTML:S,postProcess:n.unescapeDiffHTML,toHTML:N,tokenizeByCharacter:!1});s=(0,l.jsx)(n.FieldDiffContainer,{className:a,From:e,i18n:g,label:{label:d.label,locale:f},nestingLevel:h,To:t}),c[0]=d.label,c[1]=g,c[2]=f,c[3]=h,c[4]=S,c[5]=N,c[6]=s}else s=c[6];return s}])},800922,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(704333),r=e.i(138452);e.i(907358);var o=e.i(720182),i=e.i(122464),a=e.i(769163);let s="group-diff";e.s(["Group",0,e=>{let c,u=(0,t.c)(9),{baseVersionField:d,comparisonValue:f,field:h,locale:p,parentIsLocalized:g,versionValue:m}=e,{i18n:b}=(0,r.useTranslation)(),{selectedLocales:C}=(0,o.useSelectedLocales)();return u[0]!==d.fields||u[1]!==h||u[2]!==b||u[3]!==p||u[4]!==g||u[5]!==C||u[6]!==f||u[7]!==m?(c=(0,l.jsx)("div",{className:s,children:(0,l.jsx)(i.DiffCollapser,{fields:h.fields,Label:"label"in h&&h.label&&"function"!=typeof h.label?(0,l.jsxs)("span",{children:[p&&(0,l.jsx)("span",{className:`${s}__locale-label`,children:p}),(0,n.getTranslation)(h.label,b)]}):(0,l.jsxs)("span",{className:`${s}__locale-label ${s}__locale-label--no-label`,children:["<",b.t("version:noLabelGroup"),">"]}),locales:C,parentIsLocalized:g||h.localized,valueFrom:f,valueTo:m,children:(0,l.jsx)(a.RenderVersionFieldsToDiff,{versionFields:d.fields})})}),u[0]=d.fields,u[1]=h,u[2]=b,u[3]=p,u[4]=g,u[5]=C,u[6]=f,u[7]=m,u[8]=c):c=u[8],c}])},245815,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(704333),r=e.i(55686),o=e.i(138452),i=e.i(866347);e.i(907358);var a=e.i(720182),s=e.i(122464),c=e.i(769163),u=e.i(665189);let d="iterable-diff";e.s(["Iterable",0,e=>{let f,h=(0,t.c)(12),{baseVersionField:p,comparisonValue:g,field:m,locale:b,parentIsLocalized:C,versionValue:x}=e,{i18n:y,t:v}=(0,o.useTranslation)(),{selectedLocales:_}=(0,a.useSelectedLocales)(),{config:S}=(0,r.useConfig)();if(!(0,i.fieldIsArrayType)(m)&&!(0,i.fieldIsBlockType)(m))throw Error(`Expected field to be an array or blocks type but got: ${m.type}`);let N=Math.max(Array.isArray(x)?x.length:0,Array.isArray(g)?g.length:0);return h[0]!==p||h[1]!==S||h[2]!==m||h[3]!==y||h[4]!==b||h[5]!==N||h[6]!==C||h[7]!==_||h[8]!==v||h[9]!==g||h[10]!==x?(f=(0,l.jsx)("div",{className:d,children:(0,l.jsxs)(s.DiffCollapser,{field:m,isIterable:!0,Label:"label"in m&&m.label&&"function"!=typeof m.label&&(0,l.jsxs)("span",{children:[b&&(0,l.jsx)("span",{className:`${d}__locale-label`,children:b}),(0,n.getTranslation)(m.label,y)]}),locales:_,parentIsLocalized:C,valueFrom:g,valueTo:x,children:[N>0&&(0,l.jsx)("div",{className:`${d}__rows`,children:Array.from({length:N},(e,t)=>{let n=x?.[t]||{},r=g?.[t]||{},{fields:o,versionFields:a}=(0,u.getFieldsForRowComparison)({baseVersionField:p,config:S,field:m,row:t,valueFromRow:r,valueToRow:n});if(!a?.length)return null;let f=String(t+1).padStart(2,"0"),h=(0,i.fieldIsArrayType)(m)?`${v("general:item")} ${f}`:`${v("fields:block")} ${f}`;return(0,l.jsx)("div",{className:`${d}__row`,children:(0,l.jsx)(s.DiffCollapser,{fields:o,hideGutter:!0,Label:(0,l.jsxs)("div",{className:`${d}-label-container`,children:[(0,l.jsx)("div",{className:`${d}-label-prefix`}),(0,l.jsx)("span",{className:`${d}__label`,children:h})]}),locales:_,parentIsLocalized:C||m.localized,valueFrom:r,valueTo:n,children:(0,l.jsx)(c.RenderVersionFieldsToDiff,{versionFields:a})})},t)})}),0===N&&(0,l.jsx)("div",{className:`${d}__no-rows`,children:y.t("version:noRowsFound",{label:"labels"in m&&m.labels?.plural?(0,n.getTranslation)(m.labels.plural,y):y.t("general:rows")})})]})}),h[0]=p,h[1]=S,h[2]=m,h[3]=y,h[4]=b,h[5]=N,h[6]=C,h[7]=_,h[8]=v,h[9]=g,h[10]=x,h[11]=f):f=h[11],f}])},251063,e=>{"use strict";var t=e.i(452797);e.i(907358);var l=e.i(769163);e.s(["Row",0,({baseVersionField:e})=>(0,t.jsx)("div",{className:"row-diff",children:(0,t.jsx)(l.RenderVersionFieldsToDiff,{versionFields:e.fields})})])},419538,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(704333),r=e.i(638857),o=e.i(138452);e.i(907358);let i=(e,t,l)=>l&&Array.isArray(e)?e.map(e=>t.find(t=>("string"==typeof t?t:t.value)===e)||String(e)):t.find(t=>("string"==typeof t?t:t.value)===e)||String(e),a=(e,t)=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return e;let l=(0,n.getTranslation)(e.label,t);return"string"==typeof l?l:e.value}).join(", ");if("string"==typeof e)return e;let l=(0,n.getTranslation)(e.label,t);return"string"==typeof l?l:e.value};e.s(["Select",0,e=>{let n,s=(0,t.c)(7),{comparisonValue:c,field:u,locale:d,nestingLevel:f,versionValue:h}=e,{i18n:p}=(0,o.useTranslation)(),g="options"in u&&u.options,m=void 0!==c?a(i("string"==typeof c?c:JSON.stringify(c),g,u.hasMany),p):"",b=void 0!==h?a(i("string"==typeof h?h:JSON.stringify(h),g,u.hasMany),p):"",C="<p>"+(0,r.escapeDiffHTML)(m)+"</p>",x="<p>"+(0,r.escapeDiffHTML)(b)+"</p>";if(s[0]!==u.label||s[1]!==p||s[2]!==d||s[3]!==f||s[4]!==C||s[5]!==x){let{From:e,To:t}=(0,r.getHTMLDiffComponents)({fromHTML:C,postProcess:r.unescapeDiffHTML,toHTML:x,tokenizeByCharacter:!0});n=(0,l.jsx)(r.FieldDiffContainer,{className:"select-diff",From:e,i18n:p,label:{label:u.label,locale:d},nestingLevel:f,To:t}),s[0]=u.label,s[1]=p,s[2]=d,s[3]=f,s[4]=C,s[5]=x,s[6]=n}else n=s[6];return n}])},500430,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(704333),r=e.i(138452);e.i(907358);var o=e.i(720182),i=e.i(122464),a=e.i(769163);let s="tabs-diff",c=e=>{let c,u=(0,t.c)(10),{comparisonValue:d,fieldTab:f,locale:h,parentIsLocalized:p,tab:g,versionValue:m}=e,{i18n:b}=(0,r.useTranslation)(),{selectedLocales:C}=(0,o.useSelectedLocales)();return g.fields?.length?(u[0]!==f.fields||u[1]!==f.localized||u[2]!==b||u[3]!==h||u[4]!==p||u[5]!==C||u[6]!==g||u[7]!==d||u[8]!==m?(c=(0,l.jsx)(i.DiffCollapser,{fields:f.fields,Label:"label"in g&&g.label&&"function"!=typeof g.label&&(0,l.jsxs)("span",{children:[h&&(0,l.jsx)("span",{className:`${s}__locale-label`,children:h}),(0,n.getTranslation)(g.label,b)]}),locales:C,parentIsLocalized:p||f.localized,valueFrom:d,valueTo:m,children:(0,l.jsx)(a.RenderVersionFieldsToDiff,{versionFields:g.fields})}),u[0]=f.fields,u[1]=f.localized,u[2]=b,u[3]=h,u[4]=p,u[5]=C,u[6]=g,u[7]=d,u[8]=m,u[9]=c):c=u[9],c):null};e.s(["Tabs",0,e=>{let n,r=(0,t.c)(13),{baseVersionField:i,comparisonValue:a,field:u,versionValue:d}=e,{selectedLocales:f}=(0,o.useSelectedLocales)();if(r[0]!==i.tabs||r[1]!==u||r[2]!==e||r[3]!==f||r[4]!==a||r[5]!==d){let t;r[7]!==u||r[8]!==e||r[9]!==f||r[10]!==a||r[11]!==d?(t=(t,n)=>{if(!t?.fields?.length)return null;let r=u.tabs?.[n];return r?(0,l.jsx)("div",{className:`${s}__tab`,children:(()=>{if("name"in r&&f&&r.localized)return f.map((n,o)=>{let i={...e,comparisonValue:a?.[t.name]?.[n],fieldTab:r,locale:n,tab:t,versionValue:d?.[t.name]?.[n]};return(0,l.jsx)("div",{className:`${s}__tab-locale`,children:(0,l.jsx)("div",{className:`${s}__tab-locale-value`,children:(0,l.jsx)(c,{...i},n)})},[n,o].join("-"))});if(!("name"in t)||!t.name)return(0,l.jsx)(c,{fieldTab:r,...e,tab:t},n);{let o={...e,comparisonValue:a?.[t.name],fieldTab:r,tab:t,versionValue:d?.[t.name]};return(0,l.jsx)(c,{...o},n)}})()},n):null},r[7]=u,r[8]=e,r[9]=f,r[10]=a,r[11]=d,r[12]=t):t=r[12],n=(0,l.jsx)("div",{className:s,children:i.tabs.map(t)}),r[0]=i.tabs,r[1]=u,r[2]=e,r[3]=f,r[4]=a,r[5]=d,r[6]=n}else n=r[6];return n}])},315795,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857),r=e.i(138452);function o(e){return"string"==typeof e?{tokenizeByCharacter:!0,value:(0,n.escapeDiffHTML)(e)}:"number"==typeof e?{tokenizeByCharacter:!0,value:String(e)}:"boolean"==typeof e?{tokenizeByCharacter:!1,value:String(e)}:e&&"object"==typeof e?{tokenizeByCharacter:!1,value:`<pre>${(0,n.escapeDiffHTML)(JSON.stringify(e,null,2))}</pre>`}:{tokenizeByCharacter:!0,value:void 0}}e.i(907358),e.s(["Text",0,e=>{let i,a=(0,t.c)(8),{comparisonValue:s,field:c,locale:u,nestingLevel:d,versionValue:f}=e,{i18n:h}=(0,r.useTranslation)(),p="";if(f==s&&(p='<span class="html-diff-no-value"><span>'),a[0]!==c.label||a[1]!==h||a[2]!==u||a[3]!==d||a[4]!==p||a[5]!==s||a[6]!==f){let e=o(s),t=o(f),r=!0;e.value?.length?r=e.tokenizeByCharacter:t.value?.length&&(r=t.tokenizeByCharacter);let g=e.value??p,m=t.value??p,{From:b,To:C}=(0,n.getHTMLDiffComponents)({fromHTML:"<p>"+g+"</p>",postProcess:n.unescapeDiffHTML,toHTML:"<p>"+m+"</p>",tokenizeByCharacter:r});i=(0,l.jsx)(n.FieldDiffContainer,{className:"text-diff",From:b,i18n:h,label:{label:c.label,locale:u},nestingLevel:d,To:C}),a[0]=c.label,a[1]=h,a[2]=u,a[3]=d,a[4]=p,a[5]=s,a[6]=f,a[7]=i}else i=a[7];return i}])},27e4,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857),r=e.i(55686),o=e.i(138452),i=e.i(226150),a=e.i(907358);let s="version-pill-label",c=(e,t)=>(0,l.jsx)(n.Pill,{pillStyle:t,size:"small",children:e});e.s(["VersionPillLabel",0,e=>{let u,d=(0,t.c)(14),{currentlyPublishedVersion:f,disableDate:h,doc:p,labelFirst:g,labelOverride:m,labelStyle:b,labelSuffix:C,latestDraftVersion:x}=e,y=void 0!==h&&h,v=void 0!==g&&g,_=void 0===b?"pill":b,{config:S}=(0,r.useConfig)(),{admin:N,localization:w}=S,{dateFormat:k}=N,{i18n:T,t:E}=(0,o.useTranslation)(),{code:$}=(0,n.useLocale)();if(d[0]!==$||d[1]!==f||d[2]!==k||d[3]!==y||d[4]!==p||d[5]!==T||d[6]!==v||d[7]!==m||d[8]!==_||d[9]!==C||d[10]!==x||d[11]!==w||d[12]!==E){let{label:e,pillStyle:t}=function({currentLocale:e,currentlyPublishedVersion:t,latestDraftVersion:l,t:n,version:r}){let o=r.version._status;if("draft"===o){if(t?.updatedAt>l?.updatedAt)return{name:"draft",label:n("version:draft"),pillStyle:"light"};let e=r.id===l?.id;return{name:e?"currentDraft":"draft",label:n(e?"version:currentDraft":"version:draft"),pillStyle:"light"}}if("published"===o&&r.publishedLocale&&e!==r.publishedLocale)return{name:"currentDraft",label:n("version:currentDraft"),pillStyle:"light"};let i=t&&r.id===t.id;return{name:i?"currentlyPublished":"previouslyPublished",label:n(i?"version:currentlyPublished":"version:previouslyPublished"),pillStyle:i?"success":"light"}}({currentLocale:$,currentlyPublishedVersion:f,latestDraftVersion:x,t:E,version:p}),r=(0,l.jsxs)("span",{children:[m||e,C]}),o=!y&&p.updatedAt,h=o?(0,i.formatDate)({date:p.updatedAt,i18n:T,pattern:k}):null,g=Array.isArray(p.publishedLocale)?p.publishedLocale[0]:p.publishedLocale,b=w&&w?.locales?w.locales.find(e=>e.code===g):null,S=b?b?.label?.[T?.language]||b?.label:null;u=(0,l.jsxs)("div",{className:s,children:[v?(0,l.jsxs)(a.default.Fragment,{children:["pill"===_?c(r,t):(0,l.jsx)("span",{className:`${s}-text`,children:r}),o&&(0,l.jsx)("span",{className:`${s}-date`,children:h})]}):(0,l.jsxs)(a.default.Fragment,{children:[o&&(0,l.jsx)("span",{className:`${s}-date`,children:h}),"pill"===_?c(r,t):(0,l.jsx)("span",{className:`${s}-text`,children:r})]}),S&&(0,l.jsx)(n.Pill,{size:"small",children:S})]}),d[0]=$,d[1]=f,d[2]=k,d[3]=y,d[4]=p,d[5]=T,d[6]=v,d[7]=m,d[8]=_,d[9]=C,d[10]=x,d[11]=w,d[12]=E,d[13]=u}else u=d[13];return u}],27e4)},809915,e=>{"use strict";var t=e.i(452797),l=e.i(55686),n=e.i(638857),r=e.i(138452),o=e.i(226150),i=e.i(976819);e.s(["VersionDrawerCreatedAtCell",0,e=>{let{rowData:a}=e,{id:s,updatedAt:c}=void 0===a?{}:a,{config:u}=(0,l.useConfig)(),{admin:d}=u,{dateFormat:f}=d,{closeAllModals:h}=(0,n.useModal)(),p=(0,i.useRouter)(),g=(0,i.usePathname)(),m=(0,i.useSearchParams)(),{startRouteTransition:b}=(0,n.useRouteTransition)(),{i18n:C}=(0,r.useTranslation)();return(0,t.jsx)("button",{className:"created-at-cell",onClick:()=>{h();let e=new URLSearchParams(Array.from(m.entries()));s&&e.set("versionFrom",String(s));let t=e.toString(),l=t?`?${t}`:"";b(()=>p.push(`${g}${l}`))},type:"button",children:(0,o.formatDate)({date:c,i18n:C,pattern:f})})}])},529200,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857),r=e.i(138452);e.i(907358);var o=e.i(27e4);e.s(["AutosaveCell",0,e=>{let i,a=(0,t.c)(5),{currentlyPublishedVersion:s,latestDraftVersion:c,rowData:u}=e,{t:d}=(0,r.useTranslation)();return a[0]!==s||a[1]!==c||a[2]!==u||a[3]!==d?(i=(0,l.jsxs)("div",{className:"autosave-cell__items",children:[u?.autosave&&(0,l.jsx)(n.Pill,{size:"small",children:d("version:autosave")}),(0,l.jsx)(o.VersionPillLabel,{currentlyPublishedVersion:s,disableDate:!0,doc:u,labelFirst:!1,labelStyle:"pill",latestDraftVersion:c})]}),a[0]=s,a[1]=c,a[2]=u,a[3]=d,a[4]=i):i=a[4],i}])},864829,e=>{"use strict";var t=e.i(452797),l=e.i(638857),n=e.i(55686),r=e.i(138452),o=e.i(226150),i=e.i(713465);e.i(907358),e.s(["CreatedAtCell",0,e=>{let a,{collectionSlug:s,docID:c,globalSlug:u,isTrashed:d,rowData:f}=e,{id:h,updatedAt:p}=void 0===f?{}:f,{config:g}=(0,n.useConfig)(),{admin:m,routes:b}=g,{dateFormat:C}=m,{admin:x}=b,{i18n:y}=(0,r.useTranslation)();return s&&(a=(0,i.formatAdminURL)({adminRoute:x,path:`/collections/${s}/${d?"trash/":""}${c}/versions/${h}`})),u&&(a=(0,i.formatAdminURL)({adminRoute:x,path:`/globals/${u}/versions/${h}`})),(0,t.jsx)(l.Link,{href:a,prefetch:!1,children:(0,o.formatDate)({date:p,i18n:y,pattern:C})})}])},78212,e=>{"use strict";var t=e.i(452797),l=e.i(907358);function n({id:e}){return(0,t.jsx)(l.Fragment,{children:e})}e.s(["IDCell",()=>n])},485872,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(638857),r=e.i(138452),o=e.i(976819),i=e.i(907358);e.s(["VersionsViewClient",0,e=>{let a,s,c=(0,t.c)(13),{baseClass:u,columns:d,paginationLimits:f}=e,{data:h,handlePageChange:p,handlePerPageChange:g}=(0,n.useListQuery)(),m=(0,o.useSearchParams)();c[0]!==m?(a=m.get("limit"),c[0]=m,c[1]=a):a=c[1];let b=a,{i18n:C}=(0,r.useTranslation)(),x=h?.totalDocs||0,y=!h;return c[2]!==u||c[3]!==d||c[4]!==h||c[5]!==p||c[6]!==g||c[7]!==C||c[8]!==b||c[9]!==f||c[10]!==y||c[11]!==x?(s=(0,l.jsxs)(i.default.Fragment,{children:[(0,l.jsx)(n.LoadingOverlayToggle,{name:"versions",show:y}),0===x&&(0,l.jsx)("div",{className:`${u}__no-versions`,children:C.t("version:noFurtherVersionsFound")}),x>0&&(0,l.jsxs)(i.default.Fragment,{children:[(0,l.jsx)(n.Table,{columns:d,data:h?.docs}),(0,l.jsxs)("div",{className:`${u}__page-controls`,children:[(0,l.jsx)(n.Pagination,{hasNextPage:h.hasNextPage,hasPrevPage:h.hasPrevPage,limit:h.limit,nextPage:h.nextPage,numberOfNeighbors:1,onChange:p,page:h.page,prevPage:h.prevPage,totalPages:h.totalPages}),h?.totalDocs>0&&(0,l.jsxs)(i.default.Fragment,{children:[(0,l.jsxs)("div",{className:`${u}__page-info`,children:[h.page*h.limit-(h.limit-1),"-",h.totalPages>1&&h.totalPages!==h.page?h.limit*h.page:h.totalDocs," ",C.t("general:of")," ",h.totalDocs]}),(0,l.jsx)(n.PerPage,{handleChange:g,limit:b?Number(b):10,limits:f})]})]})]})]}),c[2]=u,c[3]=d,c[4]=h,c[5]=p,c[6]=g,c[7]=C,c[8]=b,c[9]=f,c[10]=y,c[11]=x,c[12]=s):s=c[12],s}])},604518,e=>{"use strict";var t=e.i(452797),l=e.i(184868),n=e.i(976819),r=e.i(907358);e.i(785316);let o=r.default.createContext({isTransitioning:!1,startRouteTransition:e=>{"function"==typeof e&&e()},transitionProgress:0}),i=/https?|ftp|gopher|file/;function a(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}let s="default"in l.default?l.default.default:l.default;e.s(["Link",0,({children:e,href:l,onClick:c,preventDefault:u=!0,ref:d,replace:f,scroll:h,...p})=>{let g=(0,n.useRouter)(),{startRouteTransition:m}=r.default.use(o);return(0,t.jsx)(s,{href:l,onClick:e=>{let t;if((t=e.currentTarget.getAttribute("target"))&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)return;c&&c(e),u&&e.preventDefault();let n="string"==typeof l?l:function(e){var t;let l,{auth:n}=e,{hostname:r}=e,o=e.protocol||"",s=e.pathname||"",c=e.hash||"",u=e.query||"",d=!1;n=n?encodeURIComponent(n).replace(/%3A/i,":")+"@":"",e.host?d=n+e.host:r&&(d=n+(~r.indexOf(":")?`[${r}]`:r),e.port&&(d+=":"+e.port)),u&&"object"==typeof u&&(u=String((t=u,l=new URLSearchParams,Object.entries(t).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>l.append(e,a(t))):l.set(e,a(t))}),l)));let f=e.search||u&&`?${u}`||"";return o&&!o.endsWith(":")&&(o+=":"),e.slashes||(!o||i.test(o))&&!1!==d?(d="//"+(d||""),s&&"/"!==s[0]&&(s="/"+s)):d||(d=""),c&&"#"!==c[0]&&(c="#"+c),f&&"?"!==f[0]&&(f="?"+f),s=s.replace(/[?#]/g,encodeURIComponent),f=f.replace("#","%23"),`${o}${d}${s}${f}${c}`}(l);m(()=>{f?g.replace(n,{scroll:h}):g.push(n,{scroll:h})})},ref:d,...p,children:e})}],604518)},911429,e=>{"use strict";var t=e.i(452797),l=e.i(907358),n=e.i(604518);let r="banner";e.s(["Banner",0,({type:e="default",alignIcon:o="right",children:i,className:a,icon:s,onClick:c,to:u})=>{let d=[r,`${r}--type-${e}`,a&&a,u&&`${r}--has-link`,(u||c)&&`${r}--has-action`,s&&`${r}--has-icon`,s&&`${r}--align-icon-${o}`].filter(Boolean).join(" "),f="div";return c&&!u&&(f="button"),u&&(f=n.Link),(0,t.jsxs)(f,{className:d,href:u||null,onClick:c,children:[s&&"left"===o&&(0,t.jsx)(l.default.Fragment,{children:s}),(0,t.jsx)("span",{className:`${r}__content`,children:i}),s&&"right"===o&&(0,t.jsx)(l.default.Fragment,{children:s})]})}])},126612,(e,t,l)=>{"use strict";var n=function(e){var t,l,n;return!!(t=e)&&"object"==typeof t&&(l=e,"[object RegExp]"!==(n=Object.prototype.toString.call(l))&&"[object Date]"!==n&&l.$$typeof!==r)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?c(Array.isArray(e)?[]:{},e,t):e}function i(e,t,l){return e.concat(t).map(function(e){return o(e,l)})}function a(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function s(e,t){try{return t in e}catch(e){return!1}}function c(e,t,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||n,l.cloneUnlessOtherwiseSpecified=o;var r,u,d=Array.isArray(t);return d!==Array.isArray(e)?o(t,l):d?l.arrayMerge(e,t,l):(u={},(r=l).isMergeableObject(e)&&a(e).forEach(function(t){u[t]=o(e[t],r)}),a(t).forEach(function(l){s(e,l)&&!(Object.hasOwnProperty.call(e,l)&&Object.propertyIsEnumerable.call(e,l))||(s(e,l)&&r.isMergeableObject(t[l])?u[l]=(function(e,t){if(!t.customMerge)return c;var l=t.customMerge(e);return"function"==typeof l?l:c})(l,r)(e[l],t[l],r):u[l]=o(t[l],r))}),u)}c.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,l){return c(e,l,t)},{})},t.exports=c},869291,e=>{"use strict";let t;var l=e.i(843461),n=e.i(289571),r=e.i(529173),o=e.i(200860),i=e.i(836566),a=e.i(178249),s=e.i(268576),c=e.i(785316),u=e.i(600745),d=e.i(703057);class f extends d.DecoratorNode{__format;constructor(e,t){super(t),this.__format=e||""}exportJSON(){return{...super.exportJSON(),format:this.__format||""}}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format||"")}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(e){let t=this.getWritable();return t.__format=e,t}isInline(){return!1}}function h(e){return e instanceof f}var p=d,g=e.i(907358),m=e.i(452797),b=e.i(20207),C=e.i(974725),x=e.i(704333);let y=JSON;if(void 0===v)var v={};let _=v||{};v.JSOX=_,_.version="1.2.121";let S="function"==typeof BigInt,N=["ab","u8","cu8","s8","u16","s16","u32","s32","u64","s64","f32","f64"],w=null,k=null,T=[ArrayBuffer,Uint8Array,Uint8ClampedArray,Int8Array,Uint16Array,Int16Array,Uint32Array,Int32Array,null,null,Float32Array,Float64Array],E={true:!0,false:!1,null:null,NaN:NaN,Infinity:1/0,undefined:void 0};class $ extends Date{constructor(e,t){super(e),this.ns=t||0}}_.DateNS=$;let L=[];function M(){let e=L.pop();return e||(e={context:0,current_proto:null,current_class:null,current_class_field:0,arrayType:-1,valueType:0,elements:null}),e}function R(e){L.push(e)}_.updateContext=function(){};let j=[];_.escape=function(e){let t,l="";if(!e)return e;for(t=0;t<e.length;t++)('"'==e[t]||"\\"==e[t]||"`"==e[t]||"'"==e[t])&&(l+="\\"),l+=e[t];return l};let I=new WeakMap,F=new Map,O=new Map,D=[];_.reset=function(){I=new WeakMap,F=new Map,O=new Map,D=[]},_.begin=function(e,t){let l,n={name:null,value_type:0,string:"",contains:null,className:null},r={line:1,col:1},o=0,i=new Map,a=0,s=!0,c=!1,u=!1,d=null,f=null,h,p={first:null,last:null,saved:null,push(e){let t=this.saved;t?(this.saved=t.next,t.node=e,t.next=null,t.prior=this.last):t={node:e,next:null,prior:this.last},this.last?this.last.next=t:this.first=t,this.last=t,this.length++},pop(){let e=this.last;return(this.last=e.prior)||(this.first=null),e.next=this.saved,this.last&&(this.last.next=null),e.next||(e.first=null),this.saved=e,this.length--,e.node},length:0},g=[],m={},b=null,C=null,x=0,y=-1,v=0,_=0,w=!1,k=!1,E=!1,L=!1,I=!1,F={first:null,last:null,saved:null,push(e){let t=this.saved;t?(this.saved=t.next,t.node=e,t.next=null,t.prior=this.last):t={node:e,next:null,prior:this.last},this.last?this.last.next=t:this.first=t,this.last=t},shift(){let e=this.first;return e?((this.first=e.next)||(this.last=null),e.next=this.saved,this.saved=e,e.node):null},unshift(e){let t=this.saved;this.saved=t.next,t.node=e,t.next=this.first,t.prior=null,this.first||(this.last=t),this.first=t}},D=null,P=!1,A=!1,B=!1,H=!1,z=!1,K=!1,V=!1,W=0,G=0,J=!1,Y=!1,X=!1;function Z(e){throw Error(`${e} at ${o} [${r.line}:${r.col}]`)}return{fromJSOX(e,t,l){if(i.get(e))throw Error("Existing fromJSOX has been registered for prototype");if(t||(t=function(){}),t&&!("constructor"in t))throw Error("Please pass a prototype like thing...");i.set(e,{protoCon:t.prototype.constructor,cb:l})},registerFromJSOX(e,t){throw Error("registerFromJSOX is deprecated, please update to use fromJSOX instead:"+e+t.toString())},finalError(){0!==_&&(1===_&&Z("Comment began at end of document"),3===_&&Z("Open comment '/*' is missing close at end of document"),4===_&&Z("Incomplete '/* *' close at end of document")),P&&Z("Incomplete string")},value(){this.finalError();let e=d;return d=void 0,e},reset(){a=0,s=!0,F.last&&(F.last.next=F.save),F.save=F.first,F.first=F.last=null,p.last&&(p.last.next=p.save),p.length=0,p.save=F.first,p.first=p.last=null,h=void 0,v=0,g=[],m={},b=null,C=null,x=0,n.value_type=0,n.name=null,n.string="",n.className=null,r.line=1,r.col=1,u=!1,_=0,J=!1,P=!1,B=!1,H=!1,Y=!1},usePrototype(e,t){m[e]=t},write(l){let n;if("string"!=typeof l&&void 0!==l&&(l=String(l)),!s)throw Error("Parser is still in an error state, please reset before resuming");for(n=this._write(l,!1);n>0&&("function"==typeof t&&function e(l,n){let r,o,i=l[n];if(i&&"object"==typeof i)for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(void 0!==(o=e(i,r))?i[r]=o:delete i[r]);return t.call(l,n,i)}({"":d},""),d=e(d),!(n<2));n=this._write());},parse(e,t){"string"!=typeof e&&(e=String(e)),this.reset();let l=this._write(e,!0);if(l>0){let e=this.value();if(void 0===e&&l>1)throw Error("Pending value could not complete");return"function"==typeof t?function e(l,n){let r,o,i=l[n];if(i&&"object"==typeof i)for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(void 0!==(o=e(i,r))?i[r]=o:delete i[r]);return t.call(l,n,i)}({"":e},""):e}this.finalError()},_write(e,t){let m,Z,q,Q=0;function ee(e,t){throw Error(`${e} '${String.fromCodePoint(t)}' unexpected at ${o} (near '${q.substr(o>4?o-4:0,o>4?3:o-1)}[${String.fromCodePoint(t)}]${q.substr(o,10)}') [${r.line}:${r.col}]`)}function et(){n.value_type=0,n.string="",n.contains=null}function el(){let e=null;switch(n.value_type){case 5:if(!(n.string.length>13)&&(13!=n.string.length||!(n[0]>"2"))||Y||I||L||k||(X=!0),X)if(S)return BigInt(n.string);else throw Error("no builtin BigInt()",0);if(Y){let e=n.string.match(/\.(\d\d\d\d*)/),t=e?e[1]:null;if(!t||t.length<4){let e=new Date(n.string);return isNaN(e.getTime())&&ee("Bad Date format",m),e}{let e=t.substr(3);for(;e.length<6;)e+="0";let l=new $(n.string,Number(e));return isNaN(l.getTime())&&ee("Bad DateNS format"+l+l.getTime(),m),l}}return(u?-1:1)*Number(n.string);case 4:if(n.className){if((e=i.get(n.className))||(e=O.get(n.className)),e&&e.cb)return n.className=null,e.cb.call(n.string);throw Error("Double string error, no constructor for: new "+n.className+"("+n.string+")")}return n.string;case 2:return!0;case 3:return!1;case 7:case 8:return NaN;case 9:return-1/0;case 10:return 1/0;case 1:return null;case -1:case 12:return;case 6:if(n.className&&((e=i.get(n.className))||(e=O.get(n.className)),n.className=null,e&&e.cb))return n.contains=e.cb.call(n.contains);return n.contains;case 13:if(y>=0){let e;if(e=n.contains.length?U(n.contains[0]):U(n.string),0===y)return y=-1,e;{let t=new T[y](e);return y=-1,t}}if(-2===y){let e,t=f,l=n.contains.length;for(e=0;e<l;e++){let r=n.contains[e],o=t[r];if(!o){let r=p.first,i=0;for(;r&&i<l&&i<p.length;){let l=n.contains[i];if(!r.next||l!==r.next.node.name)break;if(r.next)if("number"==typeof l){let e=r.next.node.elements;if(e&&l>=e.length)if(i===p.length-1){console.log("This is actually at the current object so use that",i,n.contains,h),o=h,i++,r=r.next;break}else{if(r.next.next&&l===e.length){o=r.next.next.node.elements,r=r.next,i++,t=o;continue}o=h,i++;break}}else if(l!==r.next.node.name){o=r.next.node.elements[l],e=i;break}else o=r.next.next?r.next.next.node.elements:h;else o=o[l];r=r.next,i++}e=i<l?i-1:i}if("object"==typeof o&&!o)throw Error("Path did not resolve properly:"+n.contains+" at "+r+"("+e+")");t=o}return y=-3,t}if(n.className&&((e=i.get(n.className))||(e=O.get(n.className)),n.className=null,e&&e.cb))return e.cb.call(n.contains);return n.contains;default:console.log("Unhandled value conversion.",n)}}function en(){if(-3==y){6===n.value_type&&h.push(n.contains),y=-1;return}12===n.value_type?(h.push(void 0),delete h[h.length-1]):h.push(el()),et()}function er(){if(-3===y&&13===n.value_type){et(),y=-1;return}if(12===n.value_type)return;!n.name&&C&&(n.name=C.fields[x++]);let e=el();b&&b.protoDef&&b.protoDef.cb?(e=b.protoDef.cb.call(h,n.name,e))&&(h[n.name]=e):h[n.name]=e,et()}function eo(e){if(0!==a){switch(u&&ee("Negative outside of quotes, being converted to a string (would lose count of leading '-' characters)",e),a){case 31:switch(n.value_type){case 2:n.string+="true";break;case 3:n.string+="false";break;case 1:n.string+="null";break;case 10:n.string+="Infinity";break;case 9:n.string+="-Infinity",ee("Negative outside of quotes, being converted to a string",e);break;case 8:n.string+="NaN";break;case 7:n.string+="-NaN",ee("Negative outside of quotes, being converted to a string",e);break;case -1:n.string+="undefined";break;case 4:case 0:break;default:console.log("Value of type "+n.value_type+" is not restored...")}break;case 1:n.string+="t";break;case 2:n.string+="tr";break;case 3:n.string+="tru";break;case 5:n.string+="f";break;case 6:n.string+="fa";break;case 7:n.string+="fal";break;case 8:n.string+="fals";break;case 9:n.string+="n";break;case 10:n.string+="nu";break;case 11:n.string+="nul";break;case 12:n.string+="u";break;case 13:n.string+="un";break;case 14:n.string+="und";break;case 15:n.string+="unde";break;case 16:n.string+="undef";break;case 17:n.string+="undefi";break;case 18:n.string+="undefin";break;case 19:n.string+="undefine";break;case 20:n.string+="N";break;case 21:n.string+="Na";break;case 22:n.string+="I";break;case 23:n.string+="In";break;case 24:n.string+="Inf";break;case 25:n.string+="Infi";break;case 26:n.string+="Infin";break;case 27:n.string+="Infini";break;case 28:n.string+="Infinit";break;case 0:case 29:case 30:break;case 32:ee("String-keyword recovery fail (after whitespace)",e)}n.value_type=4,a<29&&(a=31)}else a=31,n.value_type=4;if(123==e)es();else if(91==e)ec();else if(44==e);else{if(32==e||13==e||10==e||9==e||65279==e||8232==e||8233==e)return;44==e||125==e||93==e||58==e?ee("Invalid character near identifier",e):n.string+=l}}function ei(e){let t=0;for(;0==t&&o<q.length;){l=q.charAt(o);let i=q.codePointAt(o++);if(i>=65536&&(l+=q.charAt(o),o++),r.col++,i==e)B?(V?ee("Incomplete hexidecimal sequence",i):K?ee("Incomplete long unicode sequence",i):z&&ee("Incomplete unicode sequence",i),H?(H=!1,t=1):n.string+=l,B=!1):t=1;else if(B){if(z){if(125==i){n.string+=String.fromCodePoint(W),z=!1,K=!1,B=!1;continue}W*=16,i>=48&&i<=57?W+=i-48:i>=65&&i<=70?W+=i-65+10:i>=97&&i<=102?W+=i-97+10:(ee("(escaped character, parsing hex of \\u)",i),t=-1,z=!1,B=!1);continue}if(V||K){if(0===G&&123===i){z=!0;continue}if(G<2||K&&G<4){if(W*=16,i>=48&&i<=57)W+=i-48;else if(i>=65&&i<=70)W+=i-65+10;else if(i>=97&&i<=102)W+=i-97+10;else{ee(K?"(escaped character, parsing hex of \\u)":"(escaped character, parsing hex of \\x)",i),t=-1,V=!1,B=!1;continue}G++,K?4==G&&(n.string+=String.fromCodePoint(W),K=!1,B=!1):2==G&&(n.string+=String.fromCodePoint(W),V=!1,B=!1);continue}}switch(i){case 13:H=!0,r.col=1;continue;case 8232:case 8233:r.col=1;case 10:H?H=!1:r.col=1,r.line++;break;case 116:n.string+=" ";break;case 98:n.string+="\b";break;case 110:n.string+="\n";break;case 114:n.string+="\r";break;case 102:n.string+="\f";break;case 118:n.string+="\v";break;case 48:n.string+="\0";break;case 120:V=!0,G=0,W=0;continue;case 117:K=!0,G=0,W=0;continue;default:n.string+=l}B=!1}else 92===i?B?(n.string+="\\",B=!1):(B=!0,W=0,G=0):(H&&(H=!1,r.line++,r.col=2),n.string+=l)}return t}function ea(){let e;for(;(e=o)<q.length;){l=q.charAt(e);let i=q.codePointAt(o++);if(i>=256){r.col-=o-e,o=e;break}if(95!=i)if(r.col++,i>=48&&i<=57)E&&(I=!0),n.string+=l;else if(45==i||43==i)0!=n.string.length&&(!E||L||I)?(u&&(n.string="-"+n.string,u=!1),n.string+=l,Y=!0):(45!=i||E||(u=!u),n.string+=l,L=!0);else if(78==i){if(0==a){A=!1,a=20;return}ee("fault while parsing number;",i);break}else if(73==i){if(0==a){A=!1,a=22;return}ee("fault while parsing number;",i);break}else if(58==i&&Y)u&&(n.string="-"+n.string,u=!1),n.string+=l,Y=!0;else if(84==i&&Y)u&&(n.string="-"+n.string,u=!1),n.string+=l,Y=!0;else if(90==i&&Y)u&&(n.string="-"+n.string,u=!1),n.string+=l,Y=!0;else if(46==i)if(k||w||E){s=!1,ee("fault while parsing number;",i);break}else n.string+=l,k=!0;else if(110==i){X=!0;break}else if(w&&(i>=95&&i<=102||i>=65&&i<=70))n.string+=l;else if(120==i||98==i||111==i||88==i||66==i||79==i)if(w||"0"!=n.string){s=!1,ee("fault while parsing number;",i);break}else w=!0,n.string+=l;else if(101==i||69==i)if(E){s=!1,ee("fault while parsing number;",i);break}else n.string+=l,E=!0;else if(32==i||13==i||10==i||9==i||47==i||35==i||44==i||125==i||93==i||123==i||91==i||34==i||39==i||96==i||58==i){r.col-=o-e,o=e;break}else{t&&(s=!1,ee("fault while parsing number;",i));break}}t||o!=q.length?(A=!1,n.value_type=5,0==v&&(J=!0)):A=!0}function es(){let e,t=2,l=null,r={};if(a>0&&a<29&&eo(123),e=eu(),0==v)29==a||31==a&&(e||n.string.length)?(e&&e.protoDef&&e.protoDef.protoCon&&(r=new e.protoDef.protoCon),e&&(e.protoDef||!n.string)||((l=g.find(e=>e.name===n.string))?c?(l.fields.length=0,t=4):(r=new l.protoCon,t=5):(g.push(l={name:n.string,protoCon:e&&e.protoDef&&e.protoDef.protoCon||(function(){}).constructor,fields:[]}),t=4),c=!1),C=l,a=0):a=29;else if(29==a||1===v||3===v||5==v)if(0!=a||4==n.value_type){if(e&&e.protoDef)r=new e.protoDef.protoCon;else if(l=g.find(e=>e.name===n.string))t=5,r={};else{function o(){}i.set(n.string,{protoCon:o.prototype.constructor,cb:null}),r=new o}a=0}else a=0;else if(2==v&&0==a)return ee("fault while parsing; getting field name unexpected ",m),s=!1,!1;let u=M();return n.value_type=6,0===v?h=r:1==v?n.name=h.length:(3==v||5==v)&&(!n.name&&C&&(n.name=C.fields[x++]),h[n.name]=r),u.context=v,u.elements=h,u.name=n.name,u.current_proto=b,u.current_class=C,u.current_class_field=x,u.valueType=n.value_type,u.arrayType=y,u.className=n.className,n.className=null,n.name=null,b=e,C=l,x=0,h=r,f||(f=h),p.push(u),et(),v=t,!0}function ec(){if(a>0&&a<29&&eo(91),31==a&&n.string.length){let e=N.findIndex(e=>e===n.string);a=0,e>=0?(y=e,n.className=n.string,n.string=null):"ref"===n.string?(n.className=null,y=-2):i.get(n.string)||O.get(n.string)?n.className=n.string:ee(`Unknown type '${n.string}' specified for array`,m)}else if(2==v||29==a||30==a)return ee("Fault while parsing; while getting field name unexpected",m),s=!1,!1;{let e=M();n.value_type=13;let t=[];if(0==v)h=t;else if(1==v)-1==y&&h.push(t),n.name=h.length;else if(3==v)if(n.name||(console.log("This says it's resolved......."),y=-3),b&&b.protoDef)if(b.protoDef.cb){let e=b.protoDef.cb.call(h,n.name,t);void 0!==e&&(t=h[n.name]=e)}else h[n.name]=t;else h[n.name]=t;e.context=v,e.elements=h,e.name=n.name,e.current_proto=b,e.current_class=C,e.current_class_field=x,e.valueType=n.value_type,e.arrayType=-1==y?-3:y,e.className=n.className,y=-1,n.className=null,n.name=null,b=null,C=null,x=0,h=t,f||(f=t),p.push(e),et(),v=1}return!0}function eu(){let e={protoDef:null,cls:null};return(e.protoDef=i.get(n.string))?n.className||(n.className=n.string,n.string=null):(e.protoDef=O.get(n.string))&&!n.className&&(n.className=n.string,n.string=null),n.string&&(e.cls=g.find(e=>e.name===n.string),!e.protoDef&&!e.cls),e.protoDef||e.cls?e:null}if(!s)return -1;if(e&&e.length){let t;(t=j.pop())?t.n=0:t={buf:null,n:0},(Z=t).buf=e,F.push(Z)}else A&&(A=!1,n.value_type=5,0==v&&(J=!0),Q=1),0!==v&&ee("Unclosed object at end of stream.",m);for(;s&&(Z=F.shift());){if(o=Z.n,q=Z.buf,P){let e=ei(D);e<0?s=!1:e>0&&(P=!1,s&&(n.value_type=4))}for(A&&ea();!J&&s&&o<q.length;){if(l=q.charAt(o),(m=q.codePointAt(o++))>=65536&&(l+=q.charAt(o),o++),r.col++,_){if(1==_)if(42==m)_=3;else{if(47!=m)return ee("fault while parsing;",m);_=2}else 2==_?(10==m||13==m)&&(_=0):3==_?42==m&&(_=4):_=3*(47!=m);continue}switch(m){case 35:_=2;break;case 47:_=1;break;case 123:es();break;case 91:ec();break;case 58:if(5==v)a=0,n.name=n.string,n.string="",n.value_type=0;else if(2==v||4==v)if(4==v){if(!Object.keys(h).length){console.log("This is a full object, not a class def...",n.className);let e=()=>{};i.set(p.last.node.current_class.name,{protoCon:e.prototype.constructor,cb:null}),h=new e,v=3,n.name=n.string,a=0,n.string="",n.value_type=0,console.log("don't do default;s do a revive...")}}else 0!=a&&31!=a&&29!=a&&30!=a&&eo(32),a=0,n.name=n.string,n.string="",v=2===v?3:6,n.value_type=0;else 0==v?(console.log("Override colon found, allow class redefinition",v),c=!0):(1==v?ee("(in array, got colon out of string):parsing fault;",m):3==v?ee("String unexpected",m):ee("(outside any object, got colon out of string):parsing fault;",m),s=!1);break;case 125:if(31==a&&(a=0),4==v)if(C){n.string&&C.fields.push(n.string),et();let e=p.pop();v=0,a=0,n.name=e.name,h=e.elements,C=e.current_class,x=e.current_class_field,y=e.arrayType,n.value_type=e.valueType,n.className=e.className,f=null,R(e)}else ee("State error; gathering class fields, and lost the class",m);else if(2==v||5==v){0!=n.value_type&&(C&&(n.name=C.fields[x++]),er()),n.value_type=6,b&&b.protoDef&&(console.log("SOMETHING SHOULD AHVE BEEN REPLACED HERE??",b),console.log("The other version only revives on init"),h=new b.protoDef.cb(h,void 0,void 0)),n.contains=h,n.string="";let e=p.pop();v=e.context,n.name=e.name,h=e.elements,C=e.current_class,b=e.current_proto,x=e.current_class_field,y=e.arrayType,n.value_type=e.valueType,n.className=e.className,R(e),0==v&&(J=!0)}else if(3==v){0===n.value_type&&ee("Fault while parsing; unexpected",m),er(),n.value_type=6,n.contains=h,a=0;let e=p.pop();v=e.context,n.name=e.name,h=e.elements,b=e.current_proto,C=e.current_class,x=e.current_class_field,y=e.arrayType,n.value_type=e.valueType,n.className=e.className,R(e),0==v&&(J=!0)}else ee("Fault while parsing; unexpected",m),s=!1;u=!1;break;case 93:if(a>=30&&(a=0),1==v){0!=n.value_type&&en(),n.contains=h;{let e=p.pop();n.name=e.name,n.className=e.className,v=e.context,h=e.elements,b=e.current_proto,C=e.current_class,x=e.current_class_field,y=e.arrayType,n.value_type=e.valueType,R(e)}n.value_type=13,0==v&&(J=!0)}else ee(`bad context ${v}; fault while parsing`,m),s=!1;u=!1;break;case 44:a<30&&0!=a&&eo(m),(31==a||29==a)&&(a=0),4==v?C?(C.fields.push(n.string),n.string="",a=29):ee("State error; gathering class fields, and lost the class",m):2==v?C?(n.name=C.fields[x++],0!=n.value_type&&(er(),et())):(n.string||n.value_type)&&ee("State error; comma in field name and/or lost the class",m):5==v?(C?(-3==y||n.name||(n.name=C.fields[x++]),0!=n.value_type&&(-3!=y&&er(),et())):0!=n.value_type&&(er(),et()),n.name=null):1==v?(0==n.value_type&&(n.value_type=12),en(),et(),a=0):3==v&&0!=n.value_type?(v=2,0!=n.value_type&&(er(),et()),a=0):(s=!1,ee("bad context; excessive commas while parsing;",m)),u=!1;break;default:switch(m){default:if(0==v||3==v&&29==a||2==v||29==a||4==v)switch(m){case 96:case 34:case 39:0==a||29==a?(n.string.length&&(console.log("IN ARRAY AND FIXING?"),n.className=n.string,n.string=""),ei(m)?n.value_type=4:(D=m,P=!0)):ee("fault while parsing; quote not at start of field name",m);break;case 10:r.line++,r.col=1;case 13:case 32:case 8232:case 8233:case 9:case 65279:if(0===v&&31===a){a=0,0===v&&(J=!0);break}if(0===a||30===a)0==v&&n.value_type&&(J=!0);else if(29===a){if(0===v){a=0,J=!0;break}n.string.length&&console.log("STEP TO NEXT TOKEN."),a=30}else s=!1,ee("fault while parsing; whitepsace unexpected",m);break;default:if(0==a&&(m>=48&&m<=57||43==m||46==m||45==m)){w=!1,E=!1,Y=!1,X=!1,L=!1,I=!1,k=!1,n.string=l,Z.n=o,ea();break}if(30===a&&(s=!1,ee("fault while parsing; character unexpected",m)),0===a){a=29,n.value_type=4,n.string+=l;break}if(0==n.value_type)0!==a&&31!==a&&eo(m);else{if(31===a||29===a){n.string+=l;break}if(2==v){if(29==a){n.string+=l;break}ee("Multiple values found in field name",m)}3==v&&ee("String unexpected",m)}}else 0==a&&(m>=48&&m<=57||43==m||46==m||45==m)?(w=!1,E=!1,Y=!1,X=!1,L=!1,I=!1,k=!1,n.string=l,Z.n=o,ea()):0==n.value_type?0!=a?eo(m):(a=31,n.string+=l,n.value_type=4):2==v?ee("Multiple values found in field name",m):3==v?(4!=n.value_type&&((6==n.value_type||13==n.value_type)&&ee("String unexpected",m),eo(m)),30==a?eu()?n.string=l:ee("String unexpected",m):31==a?n.string+=l:ee("String unexpected",m)):1==v&&(30==a?(n.className||(n.className=n.string,n.string=""),n.string+=l):31==a&&(n.string+=l));break;case 96:case 34:case 39:n.string&&(n.className=n.string),n.string="",ei(m)?(n.value_type=4,a=31):(D=m,P=!0);break;case 10:r.line++,r.col=1;case 32:case 9:case 13:case 8232:case 8233:case 65279:if(31==a){if(0==v){a=0,J=!0;break}else if(3==v){a=32;break}else if(2==v){a=30;break}else if(1==v){a=30;break}}0==a||30==a||(29==a?n.string.length&&(a=30):a<31&&eo(m));break;case 116:0==a?a=1:27==a?a=28:eo(m);break;case 114:1==a?a=2:eo(m);break;case 117:2==a?a=3:9==a?a=10:0==a?a=12:eo(m);break;case 101:3==a?(n.value_type=2,a=31):8==a?(n.value_type=3,a=31):14==a?a=15:18==a?a=19:eo(m);break;case 110:0==a?a=9:12==a?a=13:17==a?a=18:22==a?a=23:25==a?a=26:eo(m);break;case 100:13==a?a=14:19==a?(n.value_type=-1,a=31):eo(m);break;case 105:16==a?a=17:24==a?a=25:26==a?a=27:eo(m);break;case 108:10==a?a=11:11==a?(n.value_type=1,a=31):6==a?a=7:eo(m);break;case 102:0==a?a=5:15==a?a=16:23==a?a=24:eo(m);break;case 97:5==a?a=6:20==a?a=21:eo(m);break;case 115:7==a?a=8:eo(m);break;case 73:0==a?a=22:eo(m);break;case 78:0==a?a=20:21==a?(n.value_type=u?7:8,u=!1,a=31):eo(m);break;case 121:28==a?(n.value_type=u?9:10,u=!1,a=31):eo(m);break;case 45:0==a?u=!u:eo(m);break;case 43:0!==a&&eo(m)}}if(J){31==a&&(a=0);break}}if(o==q.length){var ed;ed=Z,j.push(ed),P||A||2==v?Q=0:0==v&&(0!=n.value_type||d)&&(J=!0,Q=1)}else Z.n=o,F.unshift(Z),Q=2;if(J){f=null;break}}return s?(J&&0!=n.value_type&&(a=0,d=el(),u=!1,n.string="",n.value_type=0),J=!1,Q):-1}}};let P=[Object.freeze(_.begin())],A=0;function B(){return this&&this.valueOf()}_.parse=function(e,t){let l,n=A++;P.length<=n&&P.push(Object.freeze(_.begin())),l=P[n],"string"!=typeof e&&(e=String(e)),l.reset();let r=l._write(e,!0);if(r>0){let e=l.value();if(void 0===e&&r>1)throw Error("Pending value could not complete");return e="function"==typeof t?function e(l,n){let r,o,i=l[n];if(i&&"object"==typeof i)for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(void 0!==(o=e(i,r))?i[r]=o:delete i[r]);return t.call(l,n,i)}({"":e},""):e,A--,e}l.finalError()},_.defineClass=function(e,t){let l,n=Object.keys(t);for(let e=1;e<n.length;e++){let t,l;(t=n[e-1])>(l=n[e])&&(n[e-1]=l,n[e]=t,e?e-=2:e--)}D.push(l={name:e,tag:n.toString(),proto:Object.getPrototypeOf(t),fields:Object.keys(t)});for(let e=1;e<l.fields.length;e++)if(l.fields[e]<l.fields[e-1]){let t=l.fields[e-1];l.fields[e-1]=l.fields[e],l.fields[e]=t,e>1&&(e-=2)}l.proto===Object.getPrototypeOf({})&&(l.proto=null)},_.toJSOX=_.registerToJSOX=function(e,t,l){if(t.prototype&&t.prototype===Object.prototype){let n=Object.keys(t).toString();if(F.get(n))throw Error("Existing toJSOX has been registered for object type");F.set(n,{external:!0,name:e,cb:l})}else{if(I.get(t.prototype))throw Error("Existing toJSOX has been registered for prototype");I.set(t.prototype,{external:!0,name:e||l.constructor.name,cb:l})}},_.fromJSOX=function(e,t,l){if(t||(t=(function(){}).prototype),O.get(e))throw Error("Existing fromJSOX has been registered for prototype");if(t&&!("constructor"in t))throw Error("Please pass a prototype like thing...");O.set(e,{protoCon:t.prototype.constructor,cb:l})},_.registerFromJSOX=function(e,t){throw Error("deprecated; please adjust code to use fromJSOX:"+e+t.toString())},_.addType=function(e,t,l,n){_.toJSOX(e,t,l),_.fromJSOX(e,t,n)},_.registerToFrom=function(e,t){throw Error("registerToFrom deprecated; please use addType:"+e+t.toString())},_.stringifier=function(){let e=[],t='"',l=new WeakMap,n=[],r=[],o=new WeakMap,i=new Map,a=null,s=[],c=!1;function u(e){return"string"==typeof e&&""===e?'""':"number"!=typeof e||isNaN(e)?e.includes("\uFEFF")||e in E||/[0-9\-]/.test(e[0])||/[\n\r\t #\[\]{}()<>\~!+*/.:,\-"'`]/.test(e)?t+_.escape(e)+t:e:"'"+e.toString()+"'"}I.get(Object.prototype)||(I.set(Object.prototype,{external:!1,name:Object.prototype.constructor.name,cb:null}),I.set(Date.prototype,{external:!1,name:"Date",cb:function(){let e;if(-621672192e5===this.getTime())return"0000-01-01T00:00:00.000Z";let t=-this.getTimezoneOffset(),l=function(e){let t=Math.floor(Math.abs(e));return(t<10?"0":"")+t};return this.getFullYear()+"-"+l(this.getMonth()+1)+"-"+l(this.getDate())+"T"+l(this.getHours())+":"+l(this.getMinutes())+":"+l(this.getSeconds())+("."+((e=Math.floor(Math.abs(this.getMilliseconds())))<100?"0":"")+(e<10?"0":""))+e+(t>=0?"+":"-")+l(t/60)+":"+l(t%60)}}),I.set($.prototype,{external:!1,name:"DateNS",cb:function(){let e,t,l=-this.getTimezoneOffset(),n=function(e){let t=Math.floor(Math.abs(e));return(t<10?"0":"")+t};return this.getFullYear()+"-"+n(this.getMonth()+1)+"-"+n(this.getDate())+"T"+n(this.getHours())+":"+n(this.getMinutes())+":"+n(this.getSeconds())+("."+((e=Math.floor(Math.abs(this.getMilliseconds())))<100?"0":"")+(e<10?"0":"")+e+(((t=Math.floor(Math.abs(this.ns)))<1e5?"0":"")+(t<1e4?"0":"")+(t<1e3?"0":"")+(t<100?"0":""))+(t<10?"0":""))+t+(l>=0?"+":"-")+n(l/60)+":"+n(l%60)}}),I.set(Boolean.prototype,{external:!1,name:"Boolean",cb:B}),I.set(Number.prototype,{external:!1,name:"Number",cb:function(){return isNaN(this)?"NaN":isFinite(this)?String(this):this<0?"-Infinity":"Infinity"}}),I.set(String.prototype,{external:!1,name:"String",cb:function(){return'"'+_.escape(B.apply(this))+'"'}}),"function"==typeof BigInt&&I.set(BigInt.prototype,{external:!1,name:"BigInt",cb:function(){return this+"n"}}),I.set(ArrayBuffer.prototype,{external:!0,name:"ab",cb:function(){return"["+u(K(this))+"]"}}),I.set(Uint8Array.prototype,{external:!0,name:"u8",cb:function(){return"["+u(K(this.buffer))+"]"}}),I.set(Uint8ClampedArray.prototype,{external:!0,name:"uc8",cb:function(){return"["+u(K(this.buffer))+"]"}}),I.set(Int8Array.prototype,{external:!0,name:"s8",cb:function(){return"["+u(K(this.buffer))+"]"}}),I.set(Uint16Array.prototype,{external:!0,name:"u16",cb:function(){return"["+u(K(this.buffer))+"]"}}),I.set(Int16Array.prototype,{external:!0,name:"s16",cb:function(){return"["+u(K(this.buffer))+"]"}}),I.set(Uint32Array.prototype,{external:!0,name:"u32",cb:function(){return"["+u(K(this.buffer))+"]"}}),I.set(Int32Array.prototype,{external:!0,name:"s32",cb:function(){return"["+u(K(this.buffer))+"]"}}),I.set(Float32Array.prototype,{external:!0,name:"f32",cb:function(){return"["+u(K(this.buffer))+"]"}}),I.set(Float64Array.prototype,{external:!0,name:"f64",cb:function(){return"["+u(K(this.buffer))+"]"}}),I.set(Float64Array.prototype,{external:!0,name:"f64",cb:function(){return"["+u(K(this.buffer))+"]"}}),I.set(RegExp.prototype,k={external:!0,name:"regex",cb:function(e,t){return"'"+escape(this.source)+"'"}}),O.set("regex",{protoCon:RegExp,cb:function(e,t){return new RegExp(this)}}),I.set(Map.prototype,k={external:!0,name:"map",cb:null}),O.set("map",{protoCon:Map,cb:function(e,t){return e?void this.set(e,t):this}}),I.set(Array.prototype,w={external:!1,name:Array.prototype.constructor.name,cb:null}));let d={defineClass(t,l){let n,r=Object.keys(l);for(let e=1;e<r.length;e++){let t,l;(t=r[e-1])>(l=r[e])&&(r[e-1]=l,r[e]=t,e?e-=2:e--)}e.push(n={name:t,tag:r.toString(),proto:Object.getPrototypeOf(l),fields:Object.keys(l)});for(let e=1;e<n.fields.length;e++)if(n.fields[e]<n.fields[e-1]){let t=n.fields[e-1];n.fields[e-1]=n.fields[e],n.fields[e]=t,e>1&&(e-=2)}n.proto===Object.getPrototypeOf({})&&(n.proto=null)},setDefaultObjectToJSOX(e){a=e},isEncoding:e=>!!r.find((t,l)=>t===e&&l<r.length-1),encodeObject(e){return a?a.apply(e,[this]):e},stringify:(t,p,g)=>(function(t,p,g){let m,b,C;if(void 0===t)return"undefined";if(null===t)return;let x=typeof g,y=typeof p;if(m="",b="","number"===x)for(C=0;C<g;C+=1)b+=" ";else"string"===x&&(b=g);if(p&&"function"!==y&&("object"!==y||"number"!=typeof p.length))throw Error("JSOX.stringify");n.length=0,l=new WeakMap;let v=function t(l,g){var C=m;let x=w.cb,y=k.cb;w.cb=function(){let e=[],l=n.length;for(let r=0;r<this.length;r+=1)n[l]=r,e[r]=t(r,this)||"null";return n.length=l,r.length=l,0===e.length?"[]":m?"[\n"+m+e.join(",\n"+m)+"\n"+C+"]":"["+e.join(",")+"]"},k.cb=function(){let e={tmp:null},l="{",r=!0;for(let[o,i]of this){e.tmp=i;let a=n.length;n[a]=o,l+=(r?"":",")+u(o)+":"+t("tmp",e),n.length=a,r=!1}return l+"}"};let v=function(l,g){let x,y,v,_,S,N,w,k=n.length,T=!0,E=g[l],$="object"==typeof E;$&&null!==E&&a&&!s.find(e=>e===E)&&(s.push(E),r[k]=E,T=!1,$="object"==typeof(E=a.apply(E,[d])),s.pop(),r.length=k,$="object"==typeof E);let L=null!=E&&Object.getPrototypeOf(E),M=L&&(o.get(L)||I.get(L)||null),R=!M&&null!=E&&(i.get(Object.keys(E).toString())||F.get(Object.keys(E).toString())||null);"function"==typeof p&&(T=!1,E=p.call(g,l,E));let j=M&&M.cb||R&&R.cb;if(null!=E&&"object"==typeof E&&"function"==typeof j)if(s.find(e=>e===E))v=f(E);else{if("object"==typeof E&&(v=f(E)))return v;s.push(E),r[k]=E,E=j.call(E,d),T=!1,s.pop(),M&&M.name&&"string"==typeof E&&"-"!==E[0]&&(E[0]<"0"||E[0]>"9")&&'"'!==E[0]&&"'"!==E[0]&&"`"!==E[0]&&"["!==E[0]&&"{"!==E[0]&&(E=" "+E),r.length=k}else if("object"==typeof E&&(v=f(E)))return v;switch(typeof E){case"bigint":return E+"n";case"string":{E=T?u(E):E;let t="";if(""===l&&(t=e.map(e=>e.name+"{"+e.fields.join(",")+"}").join(m?"\n":"")+D.map(e=>e.name+"{"+e.fields.join(",")+"}").join(m?"\n":"")+(m?"\n":"")),M&&M.external)return t+M.name+E;if(R&&R.external)return t+R.name+E;return t+E}case"number":case"boolean":case"null":return String(E);case"object":if(v)return"ref"+v;if(!E)return"null";if(m+=b,S=null,N=[],p&&"object"==typeof p){for(x=0,_=p.length,S=h(E,p);x<_;x+=1)"string"==typeof p[x]&&(y=p[x],n[k]=y,void 0!==(v=t(y,E))&&(S?N.push(v):N.push(u(y)+(m?": ":":")+v)));n.splice(k,1)}else{S=h(E);let e=[];for(y in E)if((!c||Object.prototype.propertyIsEnumerable.call(E,y))&&Object.prototype.hasOwnProperty.call(E,y)){let t;for(t=0;t<e.length;t++)if(e[t]>y){e.splice(t,0,y);break}t==e.length&&e.push(y)}for(let l=0;l<e.length;l++)y=e[l],Object.prototype.hasOwnProperty.call(E,y)&&(n[k]=y,void 0!==(v=t(y,E))&&(S?N.push(v):N.push(u(y)+(m?": ":":")+v)));n.splice(k,1)}w=""===l?(e.map(e=>e.name+"{"+e.fields.join(",")+"}").join(m?"\n":"")||D.map(e=>e.name+"{"+e.fields.join(",")+"}").join(m?"\n":""))+(m?"\n":""):"",M&&M.external&&(w+=u(M.name));let O=null;return S&&(O=u(S.name)),v=w+(0===N.length?"{}":m?(S?O:"")+"{\n"+m+N.join(",\n"+m)+"\n"+C+"}":(S?O:"")+"{"+N.join(",")+"}"),m=C,v}}(l,g);return w.cb=x,k.cb=y,v}("",{"":t});return D.length=0,v})(t,p,g),setQuote(e){t=e},registerToJSOX(e,t,l){return this.toJSOX(e,t,l)},toJSOX(e,t,l){if(t.prototype&&t.prototype!==Object.prototype){if(o.get(t.prototype))throw Error("Existing toJSOX has been registered for prototype");o.set(t.prototype,{external:!0,name:e||l.constructor.name,cb:l})}else{let n=Object.keys(t).toString();if(i.get(n))throw Error("Existing toJSOX has been registered for object type");i.set(n,{external:!0,name:e,cb:l})}},get ignoreNonEnumerable(){return c},set ignoreNonEnumerable(val){c=val}};return d;function f(e){if(null===e)return;let t=l.get(e);return t?"ref"+t:void l.set(e,y.stringify(n))}function h(t,l){let n,r,o=Object.getPrototypeOf(t);if(r=e.find(e=>{if(e.proto&&e.proto===o)return!0}))return r;if(e.length||D.length){if(l)n=(l=l.map(e=>"string"==typeof e?e:void 0)).toString();else{let e=Object.keys(t);for(let t=1;t<e.length;t++){let l,n;(l=e[t-1])>(n=e[t])&&(e[t-1]=n,e[t]=l,t?t-=2:t--)}n=e.toString()}(r=e.find(e=>{if(e.tag===n)return!0}))||(r=D.find(e=>{if(e.tag===n)return!0}))}return r}};let H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789$_",z={"~":-1,"=":-1,$:62,_:63,"+":62,"-":62,".":62,"/":63,",":63};for(let e=0;e<H.length;e++)z[H[e]]=e;function K(e){let t,l,n,r,o,i="",a=new Uint8Array(e),s=a.byteLength,c=s%3,u=s-c;for(let e=0;e<u;e+=3)t=(0xfc0000&(o=a[e]<<16|a[e+1]<<8|a[e+2]))>>18,l=(258048&o)>>12,n=(4032&o)>>6,r=63&o,i+=H[t]+H[l]+H[n]+H[r];return 1==c?(t=(252&(o=a[u]))>>2,l=(3&o)<<4,i+=H[t]+H[l]+"=="):2==c&&(t=(64512&(o=a[u]<<8|a[u+1]))>>10,l=(1008&o)>>4,n=(15&o)<<2,i+=H[t]+H[l]+H[n]+"="),i}function U(e){let t,l=new ArrayBuffer(e.length%4==1?((e.length+3)/4|0)*3-3:e.length%4==2?((e.length+3)/4|0)*3-2:e.length%4==3?((e.length+3)/4|0)*3-1:-1==z[e[e.length-3]]?((e.length+3)/4|0)*3-3:-1==z[e[e.length-2]]?((e.length+3)/4|0)*3-2:-1==z[e[e.length-1]]?((e.length+3)/4|0)*3-1:((e.length+3)/4|0)*3),n=new Uint8Array(l),r=e.length+3>>2;for(t=0;t<r;t++){let l=z[e[4*t]],r=4*t+1<e.length?z[e[4*t+1]]:-1,o=r>=0&&4*t+2<e.length?z[e[4*t+2]]:-1,i=o>=0&&4*t+3<e.length?z[e[4*t+3]]:-1;r>=0&&(n[3*t+0]=l<<2|r>>4),o>=0&&(n[3*t+1]=r<<4|o>>2&15),i>=0&&(n[3*t+2]=o<<6|63&i)}return l}Object.freeze(z),_.stringify=function(e,t,l){return _.stringifier().stringify(e,t,l)},[[0,256,[0xffd9ff,0xff6aff,130048,3670016,0,0xfffff8,0xffffff,8388607]]].map(e=>({firstChar:e[0],lastChar:e[1],bits:e[2]}));var V=e.i(756961),W=e.i(678457),G=e.i(638857),J=e.i(55686),Y=e.i(138452),X=e.i(226150),Z=e.i(734789),q=e.i(817159),Q=e.i(503144);function ee(e){let t=(0,d.createEditor)(e);return t._headless=!0,["registerDecoratorListener","registerRootListener","registerMutationListener","getRootElement","setRootElement","getElementByKey","focus","blur"].forEach(e=>{t[e]=()=>{throw Error(`${e} is not supported in headless mode`)}}),t}var et=e.i(410911),el=e.i(800569),en=d,er=e.i(501522);let eo=new Set(["http:","https:","mailto:","sms:","tel:"]);class ei extends en.ElementNode{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new ei(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},l){super(l);const{target:n=null,rel:r=null,title:o=null}=t;this.__url=e,this.__target=n,this.__rel=r,this.__title=o}createDOM(e){let t=document.createElement("a");return this.updateLinkDOM(null,t,e),(0,en.addClassNamesToElement)(t,e.theme.link),t}updateLinkDOM(e,t,l){if((0,en.isHTMLAnchorElement)(t))for(let l of(e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url)),["target","rel","title"])){let n=`__${l}`,r=this[n];e&&e[n]===r||(r?t[l]=r:t.removeAttribute(l))}}updateDOM(e,t,l){return this.updateLinkDOM(e,t,l),!1}static importDOM(){return{a:e=>({conversion:eu,priority:1})}}static importJSON(e){return ed().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=ey(e);try{let t=new URL(ey(e));if(!eo.has(t.protocol))return"about:blank"}catch(e){}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let l=ed(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(l,t),l}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,l){if(!(0,en.$isRangeSelection)(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function ea(e){let t=(0,en.$caretFromPoint)(e,"next");return[t,t.getFlipped()]}function es(e,t){for(let l of t)if(l.origin.isAttached()){let t=(0,en.$normalizeCaret)(l);return void(0,en.$setPointFromCaret)(e,t)}}function ec(e){let t=(0,en.$getSelection)(),l=null,n=null;for(let r of((0,en.$isRangeSelection)(t)&&(l=ea(t.anchor),n=ea(t.focus)),(0,en.$getChildCaret)(e,"next"))){let t=r.origin;if((0,en.$isElementNode)(t)&&!t.isInline()){let l=t.getChildren();if(l.length>0){let n=(0,en.$copyNode)(e);n.append(...l),t.append(n)}(0,et.$insertNodeToNearestRootAtCaret)(t,(0,en.$rewindSiblingCaret)(r),{$shouldSplit:()=>!1})}}if(e.isEmpty()){let t=e.getParent();e.remove(),t&&t.isEmpty()&&t.remove()}(0,en.$isRangeSelection)(t)&&(es(t.anchor,l),es(t.focus,n),(0,en.$normalizeSelection__EXPERIMENTAL)(t))}function eu(e){let t=null;if((0,en.isHTMLAnchorElement)(e)){let l=e.textContent;(null!==l&&""!==l||e.children.length>0)&&(t=ed(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function ed(e="",t){return(0,en.$applyNodeReplacement)(new ei(e,t))}function ef(e){return e instanceof ei}class eh extends ei{__isUnlinked;constructor(e="",t={},l){super(e,t,l),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new eh(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,l){return super.updateDOM(e,t,l)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return ep().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let l=ep(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(l,t),l}}function ep(e="",t){return(0,en.$applyNodeReplacement)(new eh(e,t))}function eg(e){return e instanceof eh}let em=(0,en.createCommand)("TOGGLE_LINK_COMMAND");function eb(e,t){if("element"===e.type){let l=e.getNode();return(0,en.$isElementNode)(l)||function(e,...t){let l=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;for(let e of(n.append("code",252),t))n.append("v",e);throw l.search=n.toString(),Error(`Minified Lexical error #252; visit ${l.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(0),l.getChildren()[e.offset+t]||null}return null}function eC(e,t={}){let l;if(e&&"object"==typeof e){let{url:n,...r}=e;l=n,t={...r,...t}}else l=e;let{target:n,title:r}=t,o=void 0===t.rel?"noreferrer":t.rel,i=(0,en.$getSelection)();if(null===i||!(0,en.$isRangeSelection)(i)&&!(0,en.$isNodeSelection)(i))return;if((0,en.$isNodeSelection)(i)){let e=i.getNodes();if(0===e.length)return;return void e.forEach(e=>{if(null===l){let t=(0,en.$findMatchingParent)(e,e=>!eg(e)&&ef(e));t&&(t.insertBefore(e),0===t.getChildren().length&&t.remove())}else{let t=(0,en.$findMatchingParent)(e,e=>!eg(e)&&ef(e));if(t)t.setURL(l),void 0!==n&&t.setTarget(n),void 0!==o&&t.setRel(o);else{let t=ed(l,{rel:o,target:n});e.insertBefore(t),t.append(e)}}})}if(i.isCollapsed()&&null===l)for(let e of i.getNodes()){let t=(0,en.$findMatchingParent)(e,e=>!eg(e)&&ef(e));return void(null!==t&&(t.getChildren().forEach(e=>{t.insertBefore(e)}),t.remove()))}let a=i.extract();if(null===l){let e=new Set;return void a.forEach(t=>{let l=(0,en.$findMatchingParent)(t,e=>!eg(e)&&ef(e));if(null!==l){let t=l.getKey();if(e.has(t))return;!function(e,t){let l=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),n=e.getChildren(),r=n=>l.has(n.getKey())||(0,en.$isElementNode)(n)&&t.some(t=>e.isParentOf(t)&&n.isParentOf(t)),o=n.filter(r);if(o.length===n.length)return n.forEach(t=>e.insertBefore(t)),e.remove();let i=n.findIndex(r),a=n.findLastIndex(r),s=a===n.length-1;if(0===i)o.forEach(t=>e.insertBefore(t));else if(s)for(let t=o.length-1;t>=0;t--)e.insertAfter(o[t]);else{for(let t=o.length-1;t>=0;t--)e.insertAfter(o[t]);let t=n.slice(a+1);if(t.length>0){let l=ed(e.getURL(),{rel:e.getRel(),target:e.getTarget(),title:e.getTitle()});o[o.length-1].insertAfter(l),t.forEach(e=>l.append(e))}}}(l,a),e.add(t)}})}let s=new Set,c=e=>{s.has(e.getKey())||(s.add(e.getKey()),e.setURL(l),void 0!==n&&e.setTarget(n),void 0!==o&&e.setRel(o),void 0!==r&&e.setTitle(r))};if(1===a.length){let e=a[0],t=(0,en.$findMatchingParent)(e,ef);if(null!==t)return c(t)}!function(e){let t=(0,en.$getSelection)();if(!(0,en.$isRangeSelection)(t))return e();let l=(0,en.$normalizeSelection__EXPERIMENTAL)(t),n=l.isBackward(),r=eb(l.anchor,n?-1:0),o=eb(l.focus,n?0:-1);if(e(),r||o){let e=(0,en.$getSelection)();if((0,en.$isRangeSelection)(e)){let t=e.clone();if(r){let e=r.getParent();e&&t.anchor.set(e.getKey(),r.getIndexWithinParent()+ +!!n,"element")}if(o){let e=o.getParent();e&&t.focus.set(e.getKey(),o.getIndexWithinParent()+ +!n,"element")}(0,en.$setSelection)((0,en.$normalizeSelection__EXPERIMENTAL)(t))}}}(()=>{let e=null;for(let t of a){if(!t.isAttached())continue;let i=(0,en.$findMatchingParent)(t,ef);if(i){c(i);continue}if((0,en.$isElementNode)(t)){if(!t.isInline())continue;if(ef(t)){if(!(eg(t)||null!==e&&e.getParentOrThrow().isParentOf(t))){c(t),e=t;continue}for(let e of t.getChildren())t.insertBefore(e);t.remove();continue}}let a=t.getPreviousSibling();ef(a)&&a.is(e)?a.append(t):(e=ed(l,{rel:o,target:n,title:r}),t.insertAfter(e),e.append(t))}})}let ex=/^\+?[0-9\s()-]{5,}$/;function ey(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:ex.test(e)?`tel:${e}`:`https://${e}`}let ev=(0,en.defineExtension)({build:(e,t,l)=>(0,er.namedSignals)(t),config:{attributes:void 0,validateUrl:void 0},mergeConfig(e,t){let l=(0,en.shallowMergeConfig)(e,t);return e.attributes&&(l.attributes=(0,en.shallowMergeConfig)(e.attributes,l.attributes)),l},name:"@lexical/link/Link",nodes:()=>[ei],register:(e,t,l)=>{var n;return n=l.getOutput(),(0,en.mergeRegister)(e.registerNodeTransform(ei,ec),(0,er.effect)(()=>e.registerCommand(em,e=>{let t=n.validateUrl.peek(),l=n.attributes.peek();if(null===e)return eC(null),!0;if("string"==typeof e)return!(void 0!==t&&!t(e))&&(eC(e,l),!0);{let{url:t,target:n,rel:r,title:o}=e;return eC(t,{...l,rel:r,target:n,title:o}),!0}},en.COMMAND_PRIORITY_LOW)),(0,er.effect)(()=>{let t=n.validateUrl.value;if(!t)return;let l=n.attributes.value;return e.registerCommand(en.PASTE_COMMAND,n=>{let r=(0,en.$getSelection)();if(!(0,en.$isRangeSelection)(r)||r.isCollapsed()||!(0,et.objectKlassEquals)(n,ClipboardEvent)||null===n.clipboardData)return!1;let o=n.clipboardData.getData("text");return!!t(o)&&!r.getNodes().some(e=>(0,en.$isElementNode)(e))&&(e.dispatchCommand(em,{...l,url:o}),n.preventDefault(),!0)},en.COMMAND_PRIORITY_LOW)}))}});function e_(e,t,l={}){let n=l=>{let n=l.target;if(!(0,en.isDOMNode)(n))return;let r=(0,en.getNearestEditorFromDOMNode)(n);if(null===r)return;let o=null,i=null;if(r.update(()=>{let e=(0,en.$getNearestNodeFromDOMNode)(n);if(null!==e){let l=(0,en.$findMatchingParent)(e,en.$isElementNode);if(!t.disabled.peek())if(ef(l))o=l.sanitizeUrl(l.getURL()),i=l.getTarget();else{let e=function(e,t){let l=e;for(;null!=l;){if(t(l))return l;l=l.parentNode}return null}(n,en.isHTMLAnchorElement);null!==e&&(o=e.href,i=e.target)}}}),null===o||""===o)return;let a=e.getEditorState().read(en.$getSelection);if((0,en.$isRangeSelection)(a)&&!a.isCollapsed())return void l.preventDefault();let s="auxclick"===l.type&&1===l.button;window.open(o,t.newTab.peek()||s||l.metaKey||l.ctrlKey||"_blank"===i?"_blank":"_self"),l.preventDefault()},r=e=>{1===e.button&&n(e)};return e.registerRootListener((e,t)=>{null!==t&&(t.removeEventListener("click",n),t.removeEventListener("mouseup",r)),null!==e&&(e.addEventListener("click",n,l),e.addEventListener("mouseup",r,l))})}function eS(e,t){for(let l=0;l<t.length;l++){let n=t[l](e);if(n)return n}return null}(0,en.defineExtension)({build:(e,t,l)=>(0,er.namedSignals)(t),config:(0,en.safeCast)({disabled:!1,newTab:!1}),dependencies:[ev],name:"@lexical/link/ClickableLink",register:(e,t,l)=>e_(e,l.getOutput())});let eN=/[.,;\s]/;function ew(e){return eN.test(e)}function ek(e){return ew(e[e.length-1])}function eT(e){let t=e.getPreviousSibling();return(0,en.$isElementNode)(t)&&(t=t.getLastDescendant()),null===t||(0,en.$isLineBreakNode)(t)||(0,en.$isTextNode)(t)&&ek(t.getTextContent())}function eE(e){let t=e.getNextSibling();return(0,en.$isElementNode)(t)&&(t=t.getFirstDescendant()),null===t||(0,en.$isLineBreakNode)(t)||(0,en.$isTextNode)(t)&&ew(t.getTextContent()[0])}function e$(e,t,l){let n=e.getChildren(),r=n.length;for(let t=0;t<r;t++){let r=n[t];if(!(0,en.$isTextNode)(r)||!r.isSimpleText())return eL(e),void l(null,e.getURL())}let o=e.getTextContent(),i=eS(o,t);if(null===i||i.text!==o||!eT(e)||!eE(e))return eL(e),void l(null,e.getURL());let a=e.getURL();if(a!==i.url&&(e.setURL(i.url),l(i.url,a)),i.attributes){let t=e.getRel();t!==i.attributes.rel&&(e.setRel(i.attributes.rel||null),l(i.attributes.rel||null,t));let n=e.getTarget();n!==i.attributes.target&&(e.setTarget(i.attributes.target||null),l(i.attributes.target||null,n))}}function eL(e){let t=e.getChildren();for(let l=t.length-1;l>=0;l--)e.insertAfter(t[l]);return e.remove(),t.map(e=>e.getLatest())}let eM={changeHandlers:[],excludeParents:[],matchers:[]};(0,en.defineExtension)({config:eM,dependencies:[ev],mergeConfig(e,t){let l=(0,en.shallowMergeConfig)(e,t);for(let n of["matchers","changeHandlers","excludeParents"]){let r=t[n];Array.isArray(r)&&(l[n]=[...e[n],...r])}return l},name:"@lexical/link/AutoLink",nodes:[eh],register:function(e,t=eM){let{matchers:l,changeHandlers:n,excludeParents:r}=t,o=(e,t)=>{for(let l of n)l(e,t)};return(0,en.mergeRegister)(e.registerNodeTransform(en.TextNode,e=>{let t=e.getParentOrThrow(),n=e.getPreviousSibling();eg(t)&&!t.getIsUnlinked()?e$(t,l,o):ef(t)||r.some(e=>e(t))||(e.isSimpleText()&&(ew(e.getTextContent()[0])||!eg(n))&&function(e,t,l){for(let t of e){let e=t.getParent();if(eg(e)&&!e.getIsUnlinked())return}let n=[...e],r=n.map(e=>e.getTextContent()).join(""),o,i=r,a=0;for(;(o=eS(i,t))&&null!==o;){var s,c,u;let e=o.index,t=e+o.length;if(s=a+e,c=a+t,u=n,(s>0?ew(r[s-1]):eT(u[0]))&&(c<r.length?ew(r[c]):eE(u[u.length-1]))){let[r,,s,c]=function(e,t,l){let n=[],r=[],o=[],i=0,a=0,s=[...e];for(;s.length>0;){let e=s[0],c=e.getTextContent().length,u=a;a+c<=t?(n.push(e),i+=c):u>=l?o.push(e):r.push(e),a+=c,s.shift()}return[i,n,r,o]}(n,a+e,a+t),u=!1;for(let e of s){let t=e.getParent();if(eg(t)&&!t.getIsUnlinked()){u=!0;break}}if(u){a+=t,i=i.substring(t);continue}let d=function(e,t,l,n){let r=ep(n.url,n.attributes);if(1===e.length){let o,i=e[0];0===t?[o,i]=i.splitText(l):[,o,i]=i.splitText(t,l);let a=(0,en.$createTextNode)(n.text);return a.setFormat(o.getFormat()),a.setDetail(o.getDetail()),a.setStyle(o.getStyle()),r.append(a),o.replace(r),i}if(e.length>1){let n,o=e[0],i,a=o.getTextContent().length;0===t?i=o:[,i]=o.splitText(t);let s=[];for(let t=1;t<e.length;t++){let r=e[t],o=r.getTextContent().length,i=a;if(i<l)if(a+o<=l)s.push(r);else{let[e,t]=r.splitText(l-i);s.push(e),n=t}a+=o}let c=(0,en.$getSelection)(),u=c?c.getNodes().find(en.$isTextNode):void 0,d=(0,en.$createTextNode)(i.getTextContent());return d.setFormat(i.getFormat()),d.setDetail(i.getDetail()),d.setStyle(i.getStyle()),r.append(d,...s),u&&u===i&&((0,en.$isRangeSelection)(c)?d.select(c.anchor.offset,c.focus.offset):(0,en.$isNodeSelection)(c)&&d.select(0,d.getTextContent().length)),i.replace(r),n}}(s,a+e-r,a+t-r,o);n=d?[d,...c]:c,l(o.url,null),a=0}else a+=t;i=i.substring(t)}}(function(e){let t=[e],l=e.getNextSibling();for(;null!==l&&(0,en.$isTextNode)(l)&&l.isSimpleText()&&(t.push(l),!/[\s]/.test(l.getTextContent()));)l=l.getNextSibling();return t}(e),l,o),!function(e,t,l){let n=e.getParent(),r=e.getPreviousSibling(),o=e.getNextSibling(),i=e.getTextContent();if(!eg(n)||n.getIsUnlinked()){if(eg(r)&&!r.getIsUnlinked()&&r.is(e.getPreviousSibling())&&e.getParent()===r.getParent()){if(!ew(i[0]))return eL(r),l(null,r.getURL());if(r.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(i):/^\.[a-zA-Z0-9]{1,}/.test(i)){let n=r.getTextContent()+i,o=eS(n,t);null!==o&&o.text===n&&(r.append(e),e$(r,t,l),l(null,r.getURL()))}}!eg(o)||o.getIsUnlinked()||ek(i)||o.is(e.getNextSibling())&&e.getParent()===o.getParent()&&(eL(o),l(null,o.getURL()))}}(e,l,o))}),e.registerCommand(em,e=>{let t=(0,en.$getSelection)();return null===e&&!!(0,en.$isRangeSelection)(t)&&(t.extract().forEach(e=>{let t=e.getParent();eg(t)&&(t.setIsUnlinked(!t.getIsUnlinked()),t.markDirty())}),!1)},en.COMMAND_PRIORITY_LOW))}});var eR=d;let ej=[];class eI extends eR.ElementNode{__ids;static getType(){return"mark"}static clone(e){return new eI(e.__ids,e.__key)}static importDOM(){return null}static importJSON(e){return eF().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIDs(e.ids)}exportJSON(){return{...super.exportJSON(),ids:this.getIDs()}}constructor(e=ej,t){super(t),this.__ids=e}createDOM(e){let t=document.createElement("mark");return(0,eR.addClassNamesToElement)(t,e.theme.mark),this.__ids.length>1&&(0,eR.addClassNamesToElement)(t,e.theme.markOverlap),t}updateDOM(e,t,l){let n=e.__ids,r=this.__ids,o=n.length,i=r.length,a=l.theme.markOverlap;return o!==i&&(1===o?2===i&&(0,eR.addClassNamesToElement)(t,a):1===i&&(0,eR.removeClassNamesFromElement)(t,a)),!1}hasID(e){return this.getIDs().includes(e)}getIDs(){return Array.from(this.getLatest().__ids)}setIDs(e){let t=this.getWritable();return t.__ids=e,t}addID(e){let t=this.getWritable();return t.__ids.includes(e)?t:t.setIDs([...t.__ids,e])}deleteID(e){let t=this.getWritable(),l=t.__ids.indexOf(e);if(-1===l)return t;let n=Array.from(t.__ids);return n.splice(l,1),t.setIDs(n)}insertNewAfter(e,t=!0){let l=eF(this.__ids);return this.insertAfter(l,t),l}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,l){if(!(0,eR.$isRangeSelection)(t)||"html"===l)return!1;let n=t.anchor,r=t.focus,o=n.getNode(),i=r.getNode(),a=t.isBackward()?n.offset-r.offset:r.offset-n.offset;return this.isParentOf(o)&&this.isParentOf(i)&&this.getTextContent().length===a}excludeFromCopy(e){return"clone"!==e}}function eF(e=ej){return(0,eR.$applyNodeReplacement)(new eI(e))}(0,eR.defineExtension)({name:"@lexical/mark",nodes:()=>[eI]});var eO=d,eD=e.i(704338);let eP=/^(\d+(?:\.\d+)?)px$/;class eA extends eO.ElementNode{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(e){return new eA(e.__headerState,e.__colSpan,e.__width,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__rowSpan=e.__rowSpan,this.__backgroundColor=e.__backgroundColor,this.__verticalAlign=e.__verticalAlign}static importDOM(){return{td:e=>({conversion:eH,priority:0}),th:e=>({conversion:eH,priority:0})}}static importJSON(e){return ez().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan||1).setRowSpan(e.rowSpan||1).setWidth(e.width||void 0).setBackgroundColor(e.backgroundColor||null).setVerticalAlign(e.verticalAlign||void 0)}constructor(e=0,t=1,l,n){super(n),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=l,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=document.createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),null!==this.__backgroundColor&&(t.style.backgroundColor=this.__backgroundColor),eB(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),(0,eO.addClassNamesToElement)(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if((0,eO.isHTMLElement)(t.element)){let e=t.element;e.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),e.style.border="1px solid black",this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign=this.getVerticalAlign()||"top",e.style.textAlign="start",null===this.__backgroundColor&&this.hasHeader()&&(e.style.backgroundColor="#f2f3f5")}return t}exportJSON(){return{...super.exportJSON(),...eB(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,t=3){let l=this.getWritable();return l.__headerState=e&t|l.__headerState&~t,l}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState-=e:t.__headerState+=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return 0!==this.getLatest().__headerState}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function eB(e){return"middle"===e||"bottom"===e}function eH(e){let t,l=e.nodeName.toLowerCase();eP.test(e.style.width)&&(t=parseFloat(e.style.width));let n=0;"th"===l&&(n="col"===e.getAttribute("scope")?2:1);let r=ez(n,e.colSpan,t);r.__rowSpan=e.rowSpan;let o=e.style.backgroundColor;""!==o&&(r.__backgroundColor=o);let i=e.style.verticalAlign;eB(i)&&(r.__verticalAlign=i);let a=e.style,s=(a&&a.textDecoration||"").split(" "),c="700"===a.fontWeight||"bold"===a.fontWeight,u=s.includes("line-through"),d="italic"===a.fontStyle,f=s.includes("underline");return{after:e=>{let t=[],l=null,n=()=>{if(l){let e=l.getFirstChild();(0,eO.$isLineBreakNode)(e)&&1===l.getChildrenSize()&&e.remove()}};for(let r of e)(0,eO.$isInlineElementOrDecoratorNode)(r)||(0,eO.$isTextNode)(r)||(0,eO.$isLineBreakNode)(r)?((0,eO.$isTextNode)(r)&&(c&&r.toggleFormat("bold"),u&&r.toggleFormat("strikethrough"),d&&r.toggleFormat("italic"),f&&r.toggleFormat("underline")),l?l.append(r):(l=(0,eO.$createParagraphNode)().append(r),t.push(l))):(t.push(r),n(),l=null);return n(),0===t.length&&t.push((0,eO.$createParagraphNode)()),t},node:r}}function ez(e=0,t=1,l){return(0,eO.$applyNodeReplacement)(new eA(e,t,l))}function eK(e){return e instanceof eA}let eU=(0,eO.createCommand)("INSERT_TABLE_COMMAND");function eV(e,...t){let l=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;for(let l of(n.append("code",e),t))n.append("v",l);throw l.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${l.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class eW extends eO.ElementNode{__height;static getType(){return"tablerow"}static clone(e){return new eW(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:eG,priority:0})}}static importJSON(e){return eJ().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeight(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){let e=this.getHeight();return{...super.exportJSON(),...void 0===e?void 0:{height:e}}}createDOM(e){let t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),(0,eO.addClassNamesToElement)(t,e.theme.tableRow),t}extractWithChild(e,t,l){return"html"===l}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function eG(e){let t;return eP.test(e.style.height)&&(t=parseFloat(e.style.height)),{after:e=>(0,et.$descendantsMatching)(e,eK),node:eJ(t)}}function eJ(e){return(0,eO.$applyNodeReplacement)(new eW(e))}function eY(e){return e instanceof eW}let eX="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,eZ=eX&&"documentMode"in document?document.documentMode:null,eq=eX&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function eQ(e){let t=(0,eO.$findMatchingParent)(e,e=>eK(e));return eK(t)?t:null}function e0(e){let t=(0,eO.$findMatchingParent)(e,e=>eY(e));if(eY(t))return t;throw Error("Expected table cell to be inside of table row.")}function e1(e){let t=(0,eO.$findMatchingParent)(e,e=>tX(e));if(tX(t))return t;throw Error("Expected table cell to be inside of table.")}function e2(e){let t=e0(e);return e1(t).getChildren().findIndex(e=>e.is(t))}function e3(e){return e0(e).getChildren().findIndex(t=>t.is(e))}eX&&"InputEvent"in window&&!eZ&&new window.InputEvent("input");let e6=(e,t)=>3===e||e===t?t:0;function e5(e=!0){let t=(0,eO.$getSelection)();(0,eO.$isRangeSelection)(t)||tu(t)||eV(188);let l=t.anchor.getNode(),n=t.focus.getNode(),[r]=to(l),[o,,i]=to(n),[,a,s]=tn(i,o,r),{startRow:c}=s,{startRow:u}=a;return e?e4(c+r.__rowSpan>u+o.__rowSpan?r:o,!0):e4(u<c?o:r,!1)}function e4(e,t=!0){let[,,l]=to(e),[n,r]=tn(l,e,e),o=n[0].length,{startRow:i}=r,a=null;if(t){let t=i+e.__rowSpan-1,r=n[t],s=eJ();for(let e=0;e<o;e++){let{cell:l,startRow:n}=r[e];if(n+l.__rowSpan-1<=t){let t=e6(r[e].cell.__headerState,2);s.append(ez(t).append((0,eO.$createParagraphNode)()))}else l.setRowSpan(l.__rowSpan+1)}let c=l.getChildAtIndex(t);eY(c)||eV(256),c.insertAfter(s),a=s}else{let e=n[i],t=eJ();for(let l=0;l<o;l++){let{cell:n,startRow:r}=e[l];if(r===i){let n=e6(e[l].cell.__headerState,2);t.append(ez(n).append((0,eO.$createParagraphNode)()))}else n.setRowSpan(n.__rowSpan+1)}let r=l.getChildAtIndex(i);eY(r)||eV(257),r.insertBefore(t),a=t}return a}function e7(e=!0){let t=(0,eO.$getSelection)();(0,eO.$isRangeSelection)(t)||tu(t)||eV(188);let l=t.anchor.getNode(),n=t.focus.getNode(),[r]=to(l),[o,,i]=to(n),[,a,s]=tn(i,o,r),{startColumn:c}=s,{startColumn:u}=a;return e?e8(c+r.__colSpan>u+o.__colSpan?r:o,!0):e8(u<c?o:r,!1)}function e8(e,t=!0,l=!0){let[,,n]=to(e),[r,o]=tn(n,e,e),i=r.length,{startColumn:a}=o,s=t?a+e.__colSpan-1:a-1,c=n.getFirstChild();eY(c)||eV(120);let u=null;function d(e=0){let t=ez(e).append((0,eO.$createParagraphNode)());return null===u&&(u=t),t}let f=c;e:for(let e=0;e<i;e++){if(0!==e){let e=f.getNextSibling();eY(e)||eV(121),f=e}let t=r[e],l=e6(t[s<0?0:s].cell.__headerState,1);if(s<0){te(f,d(l));continue}let{cell:n,startColumn:o,startRow:i}=t[s];if(o+n.__colSpan-1<=s){let r=n,o=i,a=s;for(;o!==e&&r.__rowSpan>1;){if(!((a-=n.__colSpan)>=0)){f.append(d(l));continue e}{let{cell:e,startRow:l}=t[a];r=e,o=l}}r.insertAfter(d(l))}else n.setColSpan(n.__colSpan+1)}null!==u&&l&&e9(u);let h=n.getColWidths();if(h){let e=[...h],t=s<0?0:s,l=e[t];e.splice(t,0,l),n.setColWidths(e)}return u}function e9(e){let t=e.getFirstDescendant();null==t?e.selectStart():t.getParentOrThrow().selectStart()}function te(e,t){let l=e.getFirstChild();null!==l?l.insertBefore(t):e.append(t)}function tt(e){if(0===e.length)return null;let[t]=tr(e1(e[0]),null,null),l=1/0,n=-1/0,r=1/0,o=-1/0,i=new Set;for(let a of t)for(let t of a){if(!t||!t.cell)continue;let a=t.cell.getKey();if(!i.has(a)&&e.some(e=>e.is(t.cell))){i.add(a);let e=t.startRow,s=t.startColumn,c=t.cell.__rowSpan||1,u=t.cell.__colSpan||1;l=Math.min(l,e),n=Math.max(n,e+c-1),r=Math.min(r,s),o=Math.max(o,s+u-1)}}if(l===1/0||r===1/0)return null;let a=n-l+1,s=o-r+1,c=t[l][r];if(!c.cell)return null;let u=c.cell;u.setColSpan(s),u.setRowSpan(a);let d=new Set([u.getKey()]);for(let e=l;e<=n;e++)for(let l=r;l<=o;l++){let n=t[e][l];if(!n.cell)continue;let r=n.cell,o=r.getKey();d.has(o)||(d.add(o),function(e){if(1!==e.getChildrenSize())return!1;let t=e.getFirstChildOrThrow();return!(!(0,eO.$isParagraphNode)(t)||!t.isEmpty())}(r)||u.append(...r.getChildren()),r.remove())}return 0===u.getChildrenSize()&&u.append((0,eO.$createParagraphNode)()),u}function tl(e){let[t,l,n]=to(e),r=t.__colSpan,o=t.__rowSpan;if(1===r&&1===o)return;let[i,a]=tn(n,t,t),{startColumn:s,startRow:c}=a,u=2&t.__headerState,d=Array.from({length:r},(e,t)=>{let l=u;for(let e=0;0!==l&&e<i.length;e++)l&=i[e][t+s].cell.__headerState;return l}),f=1&t.__headerState,h=Array.from({length:o},(e,t)=>{let l=f;for(let e=0;0!==l&&e<i[0].length;e++)l&=i[t+c][e].cell.__headerState;return l});if(r>1){for(let e=1;e<r;e++)t.insertAfter(ez(d[e]|h[0]).append((0,eO.$createParagraphNode)()));t.setColSpan(1)}if(o>1){let e;for(let t=1;t<o;t++){let n=c+t,o=i[n];eY(e=(e||l).getNextSibling())||eV(125);let a=null;for(let e=0;e<s;e++){let t=o[e],l=t.cell;t.startRow===n&&(a=l),l.__colSpan>1&&(e+=l.__colSpan-1)}if(null===a)for(let l=r-1;l>=0;l--)te(e,ez(d[l]|h[t]).append((0,eO.$createParagraphNode)()));else for(let e=r-1;e>=0;e--)a.insertAfter(ez(d[e]|h[t]).append((0,eO.$createParagraphNode)()))}t.setRowSpan(1)}}function tn(e,t,l){let[n,r,o]=tr(e,t,l);return null===r&&eV(207),null===o&&eV(208),[n,r,o]}function tr(e,t,l){let n=[],r=null,o=null;function i(e){let t=n[e];return void 0===t&&(n[e]=t=[]),t}let a=e.getChildren();for(let e=0;e<a.length;e++){let n=a[e];eY(n)||eV(209);let s=i(e);for(let c=n.getFirstChild(),u=0;null!=c;c=c.getNextSibling()){for(eK(c)||eV(147);void 0!==s[u];)u++;let n={cell:c,startColumn:u,startRow:e},{__rowSpan:d,__colSpan:f}=c;for(let t=0;t<d&&!(e+t>=a.length);t++){let l=i(e+t);for(let e=0;e<f;e++)l[u+e]=n}null!==t&&null===r&&t.is(c)&&(r=n),null!==l&&null===o&&l.is(c)&&(o=n)}}return[n,r,o]}function to(e){let t;if(e instanceof eA)t=e;else if("__type"in e){let l=(0,eO.$findMatchingParent)(e,eK);eK(l)||eV(148),t=l}else{let l=(0,eO.$findMatchingParent)(e.getNode(),eK);eK(l)||eV(148),t=l}let l=t.getParent();eY(l)||eV(149);let n=l.getParent();return tX(n)||eV(210),[t,l,n]}function ti(e,t,l){let n,r=Math.min(t.startColumn,l.startColumn),o=Math.min(t.startRow,l.startRow),i=Math.max(t.startColumn+t.cell.__colSpan-1,l.startColumn+l.cell.__colSpan-1),a=Math.max(t.startRow+t.cell.__rowSpan-1,l.startRow+l.cell.__rowSpan-1);do{n=!1;for(let t=0;t<e.length;t++)for(let l=0;l<e[0].length;l++){let s=e[t][l];if(!s)continue;let c=s.startColumn+s.cell.__colSpan-1,u=s.startRow+s.cell.__rowSpan-1,d=s.startColumn<=i&&c>=r,f=s.startRow<=a&&u>=o;if(d&&f){let e=Math.min(r,s.startColumn),t=Math.max(i,c),l=Math.min(o,s.startRow),d=Math.max(a,u);e===r&&t===i&&l===o&&d===a||(r=e,i=t,o=l,a=d,n=!0)}}}while(n)return{maxColumn:i,maxRow:a,minColumn:r,minRow:o}}function ta(e){let[t,,l]=to(e),n=l.getChildren(),r=n.length,o=n[0].getChildren().length,i=Array(r);for(let e=0;e<r;e++)i[e]=Array(o);for(let e=0;e<r;e++){let l=n[e].getChildren(),r=0;for(let n=0;n<l.length;n++){for(;i[e][r];)r++;let o=l[n],a=o.__rowSpan||1,s=o.__colSpan||1;for(let t=0;t<a;t++)for(let l=0;l<s;l++)i[e+t][r+l]=o;if(t===o)return{colSpan:s,columnIndex:r,rowIndex:e,rowSpan:a};r+=s}}return null}function ts(e){let[[t,l,n,r],[o,i,a,s]]=["anchor","focus"].map(t=>{let l=e[t].getNode(),n=(0,eO.$findMatchingParent)(l,eK);eK(n)||eV(238,t,l.getKey(),l.getType());let r=n.getParent();eY(r)||eV(239,t);let o=r.getParent();return tX(o)||eV(240,t),[l,n,r,o]});return r.is(s)||eV(241),{anchorCell:l,anchorNode:t,anchorRow:n,anchorTable:r,focusCell:i,focusNode:o,focusRow:a,focusTable:s}}class tc{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,l){this.anchor=t,this.focus=l,t._selection=this,l._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if("root"===this.tableKey||"root"===this.anchor.key||"element"!==this.anchor.type||"root"===this.focus.key||"element"!==this.focus.type)return!1;let e=(0,eO.$getNodeByKey)(this.tableKey),t=(0,eO.$getNodeByKey)(this.anchor.key),l=(0,eO.$getNodeByKey)(this.focus.key);return null!==e&&null!==t&&null!==l}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return tu(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,l){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||l!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=l,this._cachedNodes=null}clone(){return new tc(this.tableKey,(0,eO.$createPoint)(this.anchor.key,this.anchor.offset,this.anchor.type),(0,eO.$createPoint)(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(eK).forEach(e=>{let l=e.getFirstChild();(0,eO.$isParagraphNode)(l)&&(t|=l.getTextFormat())});let l=eO.TEXT_TYPE_TO_FORMAT[e];return 0!=(t&l)}insertNodes(e){let t=this.focus.getNode();(0,eO.$isElementNode)(t)||eV(151),(0,eO.$normalizeSelection__EXPERIMENTAL)(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:t}=ts(this),l=ta(e);null===l&&eV(153);let n=ta(t);null===n&&eV(155);let r=Math.min(l.columnIndex,n.columnIndex),o=Math.max(l.columnIndex+l.colSpan-1,n.columnIndex+n.colSpan-1),i=Math.min(l.rowIndex,n.rowIndex),a=Math.max(l.rowIndex+l.rowSpan-1,n.rowIndex+n.rowSpan-1);return{fromX:Math.min(r,o),fromY:Math.min(i,a),toX:Math.max(r,o),toY:Math.max(i,a)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(null!==e)return e;let{anchorTable:t,anchorCell:l,focusCell:n}=ts(this),r=n.getParents()[1];if(r!==t){if(t.isParentOf(n)){let e=r.getParent();null==e&&eV(159),this.set(this.tableKey,n.getKey(),e.getKey())}else{let e=t.getParent();null==e&&eV(158),this.set(this.tableKey,e.getKey(),n.getKey())}return this.getNodes()}let[o,i,a]=tn(t,l,n),{minColumn:s,maxColumn:c,minRow:u,maxRow:d}=ti(o,i,a),f=new Map([[t.getKey(),t]]),h=null;for(let e=u;e<=d;e++)for(let t=s;t<=c;t++){let{cell:l}=o[e][t],n=l.getParent();eY(n)||eV(160),n!==h&&(f.set(n.getKey(),n),h=n),f.has(l.getKey())||function(e,t){let l=[[e]];for(let e=l.at(-1);void 0!==e&&l.length>0;e=l.at(-1)){let n=e.pop();void 0===n?l.pop():!1!==t(n)&&(0,eO.$isElementNode)(n)&&l.push(n.getChildren())}}(l,e=>{f.set(e.getKey(),e)})}let p=Array.from(f.values());return(0,eO.isCurrentlyReadOnlyMode)()||(this._cachedNodes=p),p}getTextContent(){let e=this.getNodes().filter(e=>eK(e)),t="";for(let l=0;l<e.length;l++){let n=e[l],r=n.__parent,o=(e[l+1]||{}).__parent;t+=n.getTextContent()+(o!==r?"\n":" ")}return t}}function tu(e){return e instanceof tc}function td(e,t,l){e.getKey(),t.getKey(),l.getKey();let n=(0,eO.$getSelection)(),r=tu(n)?n.clone():new tc("root",(0,eO.$createPoint)("root",0,"element"),(0,eO.$createPoint)("root",0,"element"));return r.set(e.getKey(),t.getKey(),l.getKey()),r}function tf(e,t=(0,eO.$getEditor)()){let l=(0,eO.$getNodeByKey)(e);tX(l)||eV(231,e);let n=tm(l,t.getElementByKey(e));return null===n&&eV(232,e),{tableElement:n,tableNode:l}}class th{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;shouldCheckSelection;abortController;listenerOptions;nextFocus;constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(e=>e()),this.listenersToRemove.clear()}$lookup(){return tf(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver(e=>{this.editor.getEditorState().read(()=>{let t=!1;for(let l=0;l<e.length;l++){let n=e[l].target.nodeName;if("TABLE"===n||"TBODY"===n||"THEAD"===n||"TR"===n){t=!0;break}}if(!t)return;let{tableNode:l,tableElement:n}=this.$lookup();this.table=tw(l,n)},{editor:this.editor})});this.editor.getEditorState().read(()=>{let{tableNode:t,tableElement:l}=this.$lookup();this.table=tw(t,l),e.observe(l,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){let e=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:t,tableElement:l}=this.$lookup();tk(e,tw(t,l),null),null!==(0,eO.$getSelection)()&&((0,eO.$setSelection)(null),e.dispatchCommand(eO.SELECTION_CHANGE_COMMAND,void 0))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();(0,eO.removeClassNamesFromElement)(t,e._config.theme.tableSelection),t.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();(0,eO.addClassNamesToElement)(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(null!==e){e.tableKey!==this.tableNodeKey&&eV(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),tk(t,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return null!==e&&(this.nextFocus=null),e}updateDOMSelection(){if(null!==this.anchorCell&&null!==this.focusCell){let e=(0,eO.getDOMSelection)(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let l=this.editor,{tableNode:n}=this.$lookup(),r=e.x,o=e.y;if(this.focusCell=e,!this.isHighlightingCells&&(t||this.anchorX!==r||this.anchorY!==o||null!=this.tableSelection&&null!=this.anchorCellNodeKey)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle()),-1!==this.focusX&&-1!==this.focusY&&r===this.focusX&&o===this.focusY)return!1;if(this.focusX=r,this.focusY=o,this.isHighlightingCells){let i=tz(n,e.elem);if(null!=this.tableSelection&&null!=this.anchorCellNodeKey){let e=i;if(null===e&&t&&(e=n.getCellNodeFromCords(r,o,this.table)),null!==e){let t=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=e.getKey(),this.tableSelection=td(n,t,e),(0,eO.$setSelection)(this.tableSelection),l.dispatchCommand(eO.SELECTION_CHANGE_COMMAND,void 0),tk(l,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?(0,eO.$getNodeByKey)(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return null===e&&eV(234),e}$getFocusTableCell(){return this.focusCellNodeKey?(0,eO.$getNodeByKey)(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return null===e&&eV(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:t}=this.$lookup(),l=tz(t,e.elem);if(null!==l){let e=l.getKey();null!=this.tableSelection?(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(t.getKey(),e,e)):this.tableSelection=td(t,l,l),this.anchorCellNodeKey=e}}$formatCells(e){let t=(0,eO.$getSelection)();tu(t)||eV(236);let l=(0,eO.$createRangeSelection)(),n=l.anchor,r=l.focus,o=t.getNodes().filter(eK);o.length>0||eV(237);let i=o[0].getFirstChild(),a=(0,eO.$isParagraphNode)(i)?i.getFormatFlags(e,null):null;o.forEach(t=>{n.set(t.getKey(),0,"element"),r.set(t.getKey(),t.getChildrenSize(),"element"),l.formatText(e,a)}),(0,eO.$setSelection)(t),this.editor.dispatchCommand(eO.SELECTION_CHANGE_COMMAND,void 0)}$clearText(){let{editor:e}=this,t=(0,eO.$getNodeByKey)(this.tableNodeKey);if(!tX(t))throw Error("Expected TableNode.");let l=(0,eO.$getSelection)();tu(l)||eV(253);let n=l.getNodes().filter(eK),r=t.getFirstChild(),o=t.getLastChild();if(n.length>0&&null!==r&&null!==o&&eY(r)&&eY(o)&&n[0]===r.getFirstChild()&&n[n.length-1]===o.getLastChild()){t.selectPrevious();let l=t.getParent();return t.remove(),void((0,eO.$isRootNode)(l)&&l.isEmpty()&&e.dispatchCommand(eO.INSERT_PARAGRAPH_COMMAND,void 0))}n.forEach(e=>{if((0,eO.$isElementNode)(e)){let t=(0,eO.$createParagraphNode)(),l=(0,eO.$createTextNode)();t.append(l),e.append(t),e.getChildren().forEach(e=>{e!==t&&e.remove()})}}),tk(e,this.table,null),(0,eO.$setSelection)(null),e.dispatchCommand(eO.SELECTION_CHANGE_COMMAND,void 0)}}let tp="__lexicalTableSelection";function tg(e){return(0,eO.isHTMLElement)(e)&&"TABLE"===e.nodeName}function tm(e,t){if(!t)return t;let l=tg(t)?t:e.getDOMSlot(t).element;return"TABLE"!==l.nodeName&&eV(245,t.nodeName),l}function tb(e){return e._window}function tC(e,t){for(let l=t,n=null;null!==l;l=l.getParent()){if(e.is(l))return n;eK(l)&&(n=l)}return null}let tx=[[eO.KEY_ARROW_DOWN_COMMAND,"down"],[eO.KEY_ARROW_UP_COMMAND,"up"],[eO.KEY_ARROW_LEFT_COMMAND,"backward"],[eO.KEY_ARROW_RIGHT_COMMAND,"forward"]],ty=[eO.DELETE_WORD_COMMAND,eO.DELETE_LINE_COMMAND,eO.DELETE_CHARACTER_COMMAND],tv=[eO.KEY_BACKSPACE_COMMAND,eO.KEY_DELETE_COMMAND];function t_(e){return e[tp]||null}function tS(e){let t=e;for(;null!=t;){let e=t.nodeName;if("TD"===e||"TH"===e){let e=t._cell;return void 0===e?null:e}t=t.parentNode}return null}function tN(e,t){if(!e.contains(t))return null;let l=null;for(let n=t;null!=n;n=n.parentNode){if(n===e)return l;let t=n.nodeName;"TD"!==t&&"TH"!==t||(l=n._cell||null)}return null}function tw(e,t){let l=[],n={columns:0,domRows:l,rows:0},r=tm(e,t).querySelector("tr"),o=0,i=0;for(l.length=0;null!=r;){let e=r.nodeName;if("TD"===e||"TH"===e){let e={elem:r,hasBackgroundColor:""!==r.style.backgroundColor,highlighted:!1,x:o,y:i};r._cell=e;let t=l[i];void 0===t&&(t=l[i]=[]),t[o]=e}else{let e=r.firstChild;if(null!=e){r=e;continue}}let t=r.nextSibling;if(null!=t){o++,r=t;continue}let n=r.parentNode;if(null!=n){let e=n.nextSibling;if(null==e)break;i++,o=0,r=e}}return n.columns=o+1,n.rows=i+1,n}function tk(e,t,l){let n=new Set(l?l.getNodes():[]);tT(t,(t,l)=>{let r=t.elem;n.has(l)?(t.highlighted=!0,tI(e,t)):(t.highlighted=!1,tF(e,t),r.getAttribute("style")||r.removeAttribute("style"))})}function tT(e,t){let{domRows:l}=e;for(let e=0;e<l.length;e++){let n=l[e];if(n)for(let l=0;l<n.length;l++){let r=n[l];if(!r)continue;let o=(0,eO.$getNearestNodeFromDOMNode)(r.elem);null!==o&&t(r,o,{x:l,y:e})}}}function tE(e,t){t.$disableHighlightStyle(),tT(t.table,t=>{t.highlighted=!0,tI(e,t)})}function t$(e,t){let l,n;if(t.startColumn===e.minColumn)l="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;l="maxColumn"}if(t.startRow===e.minRow)n="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;n="maxRow"}return[l,n]}function tL([e,t]){return["minColumn"===e?"maxColumn":"minColumn","minRow"===t?"maxRow":"minRow"]}function tM(e,t,[l,n]){let r=t[n],o=e[r];void 0===o&&eV(250,n,String(r));let i=t[l],a=o[i];return void 0===a&&eV(250,l,String(i)),a}function tR(e,t){if((0,eO.$isRangeSelection)(e)||tu(e)){let l=t.isParentOf(e.anchor.getNode()),n=t.isParentOf(e.focus.getNode());return l&&n}return!1}function tj(e,t){t?e.selectStart():e.selectEnd()}function tI(e,t){let l=t.elem,n=e._config.theme;eK((0,eO.$getNearestNodeFromDOMNode)(l))||eV(131),(0,eO.addClassNamesToElement)(l,n.tableCellSelected)}function tF(e,t){let l=t.elem;eK((0,eO.$getNearestNodeFromDOMNode)(l))||eV(131);let n=e._config.theme;(0,eO.removeClassNamesFromElement)(l,n.tableCellSelected)}function tO(e){let t=(0,eO.$findMatchingParent)(e,eK);return eK(t)?t:null}function tD(e){let t=(0,eO.$findMatchingParent)(e,tX);return tX(t)?t:null}function tP(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function tA(e,t,l){let n=(0,eO.$createParagraphNode)();"first"===e?t.insertBefore(n):t.insertAfter(n),n.append(...l||[]),n.selectEnd()}function tB(e,t,l){let n=l.getParent();if(!n)return;let r=(0,eO.getDOMSelection)(tb(e));if(!r)return;let o=r.anchorNode,i=e.getElementByKey(n.getKey()),a=tm(l,e.getElementByKey(l.getKey()));if(!o||!i||!a||!i.contains(o)||a.contains(o))return;let s=(0,eO.$findMatchingParent)(t.anchor.getNode(),e=>eK(e));if(!s)return;let c=(0,eO.$findMatchingParent)(s,e=>tX(e));if(!tX(c)||!c.is(l))return;let[u,d]=tn(l,s,s),f=u[0][0],h=u[u.length-1][u[0].length-1],{startRow:p,startColumn:g}=d,m=p===f.startRow&&g===f.startColumn,b=p===h.startRow&&g===h.startColumn;return m?"first":b?"last":void 0}function tH(e,t){let{tableNode:l}=e.$lookup(),n=l.getCordsFromCellNode(t,e.table);return l.getDOMCellFromCordsOrThrow(n.x,n.y,e.table)}function tz(e,t,l){return tC(e,(0,eO.$getNearestNodeFromDOMNode)(t,l))}function tK(e,t,l){if(!t.theme.tableAlignment)return;let n=[],r=[];for(let e of["center","right"]){let o=t.theme.tableAlignment[e];o&&(e===l?r:n).push(o)}(0,eO.removeClassNamesFromElement)(e,...n),(0,eO.addClassNamesToElement)(e,...r)}let tU=new WeakSet;function tV(e=(0,eO.$getEditor)()){return tU.has(e)}function tW(e,t){t?tU.add(e):tU.delete(e)}class tG extends eO.ElementNode{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}static clone(e){return new tG(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__colWidths=e.__colWidths,this.__rowStriping=e.__rowStriping,this.__frozenColumnCount=e.__frozenColumnCount,this.__frozenRowCount=e.__frozenRowCount}static importDOM(){return{table:e=>({conversion:tJ,priority:1})}}static importJSON(e){return tY().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setRowStriping(e.rowStriping||!1).setFrozenColumns(e.frozenColumnCount||0).setFrozenRows(e.frozenRowCount||0).setColWidths(e.colWidths)}constructor(e){super(e),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(e,t,l){return"html"===l}getDOMSlot(e){let t=tg(e)?e:e.querySelector("table");return tg(t)||eV(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"))}createDOM(e,t){let l=document.createElement("table");this.__style&&(l.style.cssText=this.__style);let n=document.createElement("colgroup");if(l.appendChild(n),(0,eO.setDOMUnmanaged)(n),(0,eO.addClassNamesToElement)(l,e.theme.table),this.updateTableElement(null,l,e),tV(t)){let t=document.createElement("div"),n=e.theme.tableScrollableWrapper;return n?(0,eO.addClassNamesToElement)(t,n):t.style.cssText="overflow-x: auto;",t.appendChild(l),this.updateTableWrapper(null,t,l,e),t}return l}updateTableWrapper(e,t,l,n){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&(this.__frozenColumnCount>0?((0,eO.addClassNamesToElement)(t,n.theme.tableFrozenColumn),l.setAttribute("data-lexical-frozen-column","true")):((0,eO.removeClassNamesFromElement)(t,n.theme.tableFrozenColumn),l.removeAttribute("data-lexical-frozen-column"))),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&(this.__frozenRowCount>0?((0,eO.addClassNamesToElement)(t,n.theme.tableFrozenRow),l.setAttribute("data-lexical-frozen-row","true")):((0,eO.removeClassNamesFromElement)(t,n.theme.tableFrozenRow),l.removeAttribute("data-lexical-frozen-row")))}updateTableElement(e,t,l){this.__style!==(e?e.__style:"")&&(t.style.cssText=this.__style),this.__rowStriping!==(!!e&&e.__rowStriping)&&(this.__rowStriping?((0,eO.addClassNamesToElement)(t,l.theme.tableRowStriping),t.setAttribute("data-lexical-row-striping","true")):((0,eO.removeClassNamesFromElement)(t,l.theme.tableRowStriping),t.removeAttribute("data-lexical-row-striping"))),function(e,t,l,n){let r=e.querySelector("colgroup");if(!r)return;let o=[];for(let e=0;e<l;e++){let t=document.createElement("col"),l=n&&n[e];l&&(t.style.width=`${l}px`),o.push(t)}r.replaceChildren(...o)}(t,0,this.getColumnCount(),this.getColWidths()),tK(t,l,this.getFormatType())}updateDOM(e,t,l){let n=this.getDOMSlot(t).element;return t===n===tV()||((0,eO.isHTMLElement)(t)&&"DIV"===t.nodeName&&this.updateTableWrapper(e,t,n,l),this.updateTableElement(e,n,l),!1)}exportDOM(e){let t=super.exportDOM(e),{element:l}=t;return{after:l=>{if(t.after&&(l=t.after(l)),!tg(l)&&(0,eO.isHTMLElement)(l)&&(l=l.querySelector("table")),!tg(l))return null;tK(l,e._config,this.getFormatType());let[n]=tr(this,null,null),r=new Map;for(let e of n)for(let t of e){let e=t.cell.getKey();r.has(e)||r.set(e,{colSpan:t.cell.getColSpan(),startColumn:t.startColumn})}let o=new Set;for(let e of l.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){let t=e.getAttribute("data-temporary-table-cell-lexical-key");if(t){let l=r.get(t);if(e.removeAttribute("data-temporary-table-cell-lexical-key"),l){r.delete(t);for(let e=0;e<l.colSpan;e++)o.add(e+l.startColumn)}}}let i=l.querySelector(":scope > colgroup");if(i){let e=Array.from(l.querySelectorAll(":scope > colgroup > col")).filter((e,t)=>o.has(t));i.replaceChildren(...e)}let a=l.querySelectorAll(":scope > tr");if(a.length>0){let e=document.createElement("tbody");for(let t of a)e.appendChild(t);l.append(e)}return l},element:!tg(l)&&(0,eO.isHTMLElement)(l)?l.querySelector("table"):l}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:l,domRows:n}=t;for(let t=0;t<l;t++){let l=n[t];if(null!=l)for(let n=0;n<l.length;n++){let r=l[n];if(null==r)continue;let{elem:o}=r,i=tz(this,o);if(null!==i&&e.is(i))return{x:n,y:t}}}throw Error("Cell not found in table.")}getDOMCellFromCords(e,t,l){let{domRows:n}=l,r=n[t];if(null==r)return null;let o=r[e<r.length?e:r.length-1];return null==o?null:o}getDOMCellFromCordsOrThrow(e,t,l){let n=this.getDOMCellFromCords(e,t,l);if(!n)throw Error("Cell not found at cords.");return n}getCellNodeFromCords(e,t,l){let n=this.getDOMCellFromCords(e,t,l);if(null==n)return null;let r=(0,eO.$getNearestNodeFromDOMNode)(n.elem);return eK(r)?r:null}getCellNodeFromCordsOrThrow(e,t,l){let n=this.getCellNodeFromCords(e,t,l);if(!n)throw Error("Node at cords not TableCellNode.");return n}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(e){let t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){let t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!e)return 0;let t=0;return e.getChildren().forEach(e=>{eK(e)&&(t+=e.getColSpan())}),t}}function tJ(e){let t=tY();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);let l=e.querySelector(":scope > colgroup");if(l){let e=[];for(let t of l.querySelectorAll(":scope > col")){let l=t.style.width||"";if(!eP.test(l)&&(l=t.getAttribute("width")||"",!/^\d+$/.test(l))){e=void 0;break}e.push(parseFloat(l))}e&&t.setColWidths(e)}return{after:e=>(0,et.$descendantsMatching)(e,eY),node:t}}function tY(){return(0,eO.$applyNodeReplacement)(new tG)}function tX(e){return e instanceof tG}function tZ(e){eY(e.getParent())?e.isEmpty()&&e.append((0,eO.$createParagraphNode)()):e.remove()}function tq(e){tX(e.getParent())?(0,et.$unwrapAndFilterDescendants)(e,eK):e.remove()}function tQ(e){(0,et.$unwrapAndFilterDescendants)(e,eY);let[t]=tr(e,null,null),l=t.reduce((e,t)=>Math.max(e,t.length),0),n=e.getChildren();for(let e=0;e<t.length;++e){let r=n[e];if(!r)continue;eY(r)||eV(254,r.constructor.name,r.getType());let o=t[e].reduce((e,t)=>t?1+e:e,0);if(o!==l)for(let e=o;e<l;++e){let e=ez();e.append((0,eO.$createParagraphNode)()),r.append(e)}}let r=e.getColWidths(),o=e.getColumnCount();if(r&&r.length!==o){let t;if(o<r.length)t=r.slice(0,o);else if(r.length>0){let e=r[r.length-1];t=[...r,...Array(o-r.length).fill(e)]}e.setColWidths(t)}}function t0(e){if(e.detail<3||!(0,eO.isDOMNode)(e.target))return!1;let t=(0,eO.$getNearestNodeFromDOMNode)(e.target);if(null===t)return!1;let l=(0,eO.$findMatchingParent)(t,e=>(0,eO.$isElementNode)(e)&&!e.isInline());return null!==l&&!!eK(l.getParent())&&(l.select(0),!0)}function t1(){let e=(0,eO.$getSelection)();if(!(0,eO.$isRangeSelection)(e))return!1;let t=tD(e.anchor.getNode());if(null===t)return!1;let l=(0,eO.$getRoot)();if(!l.is(t.getParent())||1!==l.getChildrenSize())return!1;let[n]=tr(t,null,null);if(0===n.length||0===n[0].length)return!1;let r=n[0][0];if(!r||!r.cell)return!1;let o=n[n.length-1],i=o[o.length-1];if(!i||!i.cell)return!1;let a=td(t,r.cell,i.cell);return(0,eO.$setSelection)(a),!0}function t2(e){return e.registerNodeTransform(eA,e=>{if(e.getColSpan()>1||e.getRowSpan()>1){let[,,t]=to(e),[l]=tn(t,e,e),n=l.length,r=l[0].length,o=t.getFirstChild();eY(o)||eV(175);let i=[];for(let e=0;e<n;e++){0!==e&&(eY(o=o.getNextSibling())||eV(175));let t=null;for(let n=0;n<r;n++){let r=l[e][n],a=r.cell;if(r.startRow===e&&r.startColumn===n)t=a,i.push(a);else if(a.getColSpan()>1||a.getRowSpan()>1){eK(a)||eV(176);let e=ez(a.__headerState);null!==t?t.insertAfter(e):(0,et.$insertFirst)(o,e)}}}for(let e of i)e.setColSpan(1),e.setRowSpan(1)}})}function t3(e,t=!0){let l=new Map,n=(n,r,o)=>{let i=tm(n,o),a=function(e,t,l,n){let r=l.getRootElement(),o=tb(l);null!==r&&null!==o||eV(246);let i=new th(l,e.getKey()),a=tm(e,t);null!==t_(a)&&eV(205),a[tp]=i,i.listenersToRemove.add(()=>{t_(a)===i&&delete a[tp]});let s=t=>{if(i.pointerType=t.pointerType,0!==t.button||!(0,eO.isDOMNode)(t.target)||!o)return;let n=tS(t.target);null!==n&&l.update(()=>{let l=(0,eO.$getPreviousSelection)();if(eq&&t.shiftKey&&tR(l,e)&&((0,eO.$isRangeSelection)(l)||tu(l))){let r=l.anchor.getNode(),o=tC(e,l.anchor.getNode());o?(i.$setAnchorCellForSelection(tH(i,o)),i.$setFocusCellForSelection(n),tP(t)):(e.isBefore(r)?e.selectStart():e.selectEnd()).anchor.set(l.anchor.key,l.anchor.offset,l.anchor.type)}else"touch"!==t.pointerType&&i.$setAnchorCellForSelection(n)}),(e=>{if(i.isSelecting)return;i.isSelecting=!0,null!==e&&null===i.anchorCell&&l.update(()=>{i.$setAnchorCellForSelection(e)});let t=()=>{i.isSelecting=!1,o.removeEventListener("pointerup",t),o.removeEventListener("pointermove",n)},n=e=>{if(1&~e.buttons&&i.isSelecting)return i.isSelecting=!1,o.removeEventListener("pointerup",t),void o.removeEventListener("pointermove",n);if(!(0,eO.isDOMNode)(e.target))return;let r=null,s=!(eq||a.contains(e.target));if(s)r=tN(a,e.target);else for(let t of document.elementsFromPoint(e.clientX,e.clientY))if(r=tN(a,t))break;if(r){let e=r;null===i.anchorCell&&l.update(()=>{i.$setAnchorCellForSelection(e)}),null!==i.focusCell&&r.elem===i.focusCell.elem||(i.setNextFocus({focusCell:r,override:s}),l.dispatchCommand(eO.SELECTION_CHANGE_COMMAND,void 0))}};o.addEventListener("pointerup",t,i.listenerOptions),o.addEventListener("pointermove",n,i.listenerOptions)})(n)};a.addEventListener("pointerdown",s,i.listenerOptions),i.listenersToRemove.add(()=>{a.removeEventListener("pointerdown",s)});let c=e=>{e.detail>=3&&(0,eO.isDOMNode)(e.target)&&null!==tS(e.target)&&e.preventDefault()};a.addEventListener("mousedown",c,i.listenerOptions),i.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});let u=e=>{let t=e.target;0===e.button&&(0,eO.isDOMNode)(t)&&l.update(()=>{let e=(0,eO.$getSelection)();tu(e)&&e.tableKey===i.tableNodeKey&&r.contains(t)&&i.$clearHighlight()})};for(let[t,n]of(o.addEventListener("pointerdown",u,i.listenerOptions),i.listenersToRemove.add(()=>{o.removeEventListener("pointerdown",u)}),tx))i.listenersToRemove.add(l.registerCommand(t,t=>(function e(t,l,n,r,o){let i;if(("up"===n||"down"===n)&&(i=t.getRootElement())&&i.hasAttribute("aria-controls")&&"typeahead-menu"===i.getAttribute("aria-controls"))return!1;let a=(0,eO.$getSelection)();if(!tR(a,r)){if((0,eO.$isRangeSelection)(a)){if("backward"===n){if(a.focus.offset>0)return!1;let e=function(e){for(let t=e,l=e;null!==l;t=l,l=l.getParent())if((0,eO.$isElementNode)(l)){if(l!==t&&l.getFirstChild()!==t)return null;if(!l.isInline())return l}return null}(a.focus.getNode());if(!e)return!1;let t=e.getPreviousSibling();return!!tX(t)&&(tP(l),l.shiftKey?a.focus.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent(),"element"):t.selectEnd(),!0)}if(l.shiftKey&&("up"===n||"down"===n)){let e=a.focus.getNode();if(!a.isCollapsed()&&("up"===n&&!a.isBackward()||"down"===n&&a.isBackward())){let t=(0,eO.$findMatchingParent)(e,e=>tX(e));if(eK(t)&&(t=(0,eO.$findMatchingParent)(t,tX)),t!==r||!t)return!1;let o="down"===n?t.getNextSibling():t.getPreviousSibling();if(!o)return!1;let i=0;"up"===n&&(0,eO.$isElementNode)(o)&&(i=o.getChildrenSize());let s=o;"up"===n&&(0,eO.$isElementNode)(o)&&(s=o.getLastChild()||o,i=(0,eO.$isTextNode)(s)?s.getTextContentSize():0);let c=a.clone();return c.focus.set(s.getKey(),i,(0,eO.$isTextNode)(s)?"text":"element"),(0,eO.$setSelection)(c),tP(l),!0}if((0,eO.$isRootOrShadowRoot)(e)){let e="up"===n?a.getNodes()[a.getNodes().length-1]:a.getNodes()[0];if(e&&null!==tC(r,e)){let e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;let[l]=to(e),[n]=to(t),i=r.getCordsFromCellNode(l,o.table),a=r.getCordsFromCellNode(n,o.table),s=r.getDOMCellFromCordsOrThrow(i.x,i.y,o.table),c=r.getDOMCellFromCordsOrThrow(a.x,a.y,o.table);return o.$setAnchorCellForSelection(s),o.$setFocusCellForSelection(c,!0),!0}return!1}{let t=(0,eO.$findMatchingParent)(e,e=>(0,eO.$isElementNode)(e)&&!e.isInline());if(eK(t)&&(t=(0,eO.$findMatchingParent)(t,tX)),!t)return!1;let r="down"===n?t.getNextSibling():t.getPreviousSibling();if(tX(r)&&o.tableNodeKey===r.getKey()){let e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;let[o]=to(e),[i]=to(t),s=a.clone();return s.focus.set(("up"===n?o:i).getKey(),"up"===n?0:i.getChildrenSize(),"element"),tP(l),(0,eO.$setSelection)(s),!0}}}}return"down"===n&&tV(t)&&o.setShouldCheckSelection(),!1}if((0,eO.$isRangeSelection)(a)){if("backward"===n||"forward"===n)return function(e,t,l,n,r,o,i){let a=(0,eO.$caretFromPoint)(l.focus,r?"previous":"next");if((0,eO.$isExtendableTextPointCaret)(a))return!1;let s=a;for(let e of(0,eO.$extendCaretToRange)(a).iterNodeCarets("shadowRoot")){if(!(0,eO.$isSiblingCaret)(e)||!(0,eO.$isElementNode)(e.origin))return!1;s=e}let c=s.getParentAtCaret();if(!eK(c))return!1;let u=function(e){for(let t of(0,eO.$extendCaretToRange)(e).iterNodeCarets("root")){let{origin:l}=t;if(eK(l)){if((0,eO.$isChildCaret)(t))return(0,eO.$getChildCaret)(l,e.direction)}else if(!eY(l))break}return null}((0,eO.$getSiblingCaret)(c,s.direction)),d=(0,eO.$findMatchingParent)(c,tX);if(!d||!d.is(o))return!1;let f=e.getElementByKey(c.getKey()),h=tS(f);if(!f||!h)return!1;if(i.table=function(e,t){let l=e.getElementByKey(t.getKey());return null===l&&eV(230),tw(t,l)}(e,d),u)if("extend"===n){let t=tS(e.getElementByKey(u.origin.getKey()));if(!t)return!1;i.$setAnchorCellForSelection(h),i.$setFocusCellForSelection(t,!0)}else{let e=(0,eO.$normalizeCaret)(u);(0,eO.$setPointFromCaret)(l.anchor,e),(0,eO.$setPointFromCaret)(l.focus,e)}else if("extend"===n)i.$setAnchorCellForSelection(h),i.$setFocusCellForSelection(h,!0);else{var p;let e,t=(p=(0,eO.$getSiblingCaret)(d,a.direction),e=(0,eO.$getAdjacentChildCaret)(p),(0,eO.$isChildCaret)(e)?(0,eO.$normalizeCaret)(e):p);(0,eO.$setPointFromCaret)(l.anchor,t),(0,eO.$setPointFromCaret)(l.focus,t)}return tP(t),!0}(t,l,a,l.shiftKey?"extend":"move","backward"===n,r,o);if(a.isCollapsed()){let i,{anchor:s,focus:c}=a,u=(0,eO.$findMatchingParent)(s.getNode(),eK),d=(0,eO.$findMatchingParent)(c.getNode(),eK);if(!eK(u)||!u.is(d))return!1;let f=tD(u);if(f!==r&&null!=f){let r=tm(f,t.getElementByKey(f.getKey()));if(null!=r)return o.table=tw(f,r),e(t,l,n,f,o)}let h=t.getElementByKey(u.__key),p=t.getElementByKey(s.key);if(null==p||null==h)return!1;if("element"===s.type)i=p.getBoundingClientRect();else{let e=(0,eO.getDOMSelection)(tb(t));if(null===e||0===e.rangeCount)return!1;i=e.getRangeAt(0).getBoundingClientRect()}let g="up"===n?u.getFirstChild():u.getLastChild();if(null==g)return!1;let m=t.getElementByKey(g.__key);if(null==m)return!1;let b=m.getBoundingClientRect();if("up"===n?b.top>i.top-i.height:i.bottom+i.height>b.bottom){tP(l);let e=r.getCordsFromCellNode(u,o.table);if(!l.shiftKey)return((e,t,l,n,r)=>{let o="forward"===r;switch(r){case"backward":case"forward":return l!==(o?e.table.columns-1:0)?tj(t.getCellNodeFromCordsOrThrow(l+(o?1:-1),n,e.table),o):n!==(o?e.table.rows-1:0)?tj(t.getCellNodeFromCordsOrThrow(o?0:e.table.columns-1,n+(o?1:-1),e.table),o):o?t.selectNext():t.selectPrevious(),!0;case"up":return 0!==n?tj(t.getCellNodeFromCordsOrThrow(l,n-1,e.table),!1):t.selectPrevious(),!0;case"down":return n!==e.table.rows-1?tj(t.getCellNodeFromCordsOrThrow(l,n+1,e.table),!0):t.selectNext(),!0;default:return!1}})(o,r,e.x,e.y,n);{let t=r.getDOMCellFromCordsOrThrow(e.x,e.y,o.table);o.$setAnchorCellForSelection(t),o.$setFocusCellForSelection(t,!0)}return!0}}}else if(tu(a)){let{anchor:e,focus:i}=a,s=(0,eO.$findMatchingParent)(e.getNode(),eK),c=(0,eO.$findMatchingParent)(i.getNode(),eK),[u]=a.getNodes();tX(u)||eV(251);let d=tm(u,t.getElementByKey(u.getKey()));if(!eK(s)||!eK(c)||!tX(u)||null==d)return!1;o.$updateTableTableSelection(a);let f=tw(u,d),h=r.getCordsFromCellNode(s,f),p=r.getDOMCellFromCordsOrThrow(h.x,h.y,f);if(o.$setAnchorCellForSelection(p),tP(l),l.shiftKey){let[e,t,l]=tn(r,s,c);return function(e,t,l,n,r){let o,i=ti(t,l,n),{topSpan:a,leftSpan:s,bottomSpan:c,rightSpan:u}=function(e,t){let{minColumn:l,maxColumn:n,minRow:r,maxRow:o}=t,i=1,a=1,s=1,c=1,u=e[r],d=e[o];for(let e=l;e<=n;e++)i=Math.max(i,u[e].cell.__rowSpan),c=Math.max(c,d[e].cell.__rowSpan);for(let t=r;t<=o;t++)a=Math.max(a,e[t][l].cell.__colSpan),s=Math.max(s,e[t][n].cell.__colSpan);return{bottomSpan:c,leftSpan:a,rightSpan:s,topSpan:i}}(t,i),[d,f]=tL((null===(o=t$(i,l))&&eV(249,l.cell.getKey()),o)),h=i[d],p=i[f];"forward"===r?h+="maxColumn"===d?1:s:"backward"===r?h-="minColumn"===d?1:u:"down"===r?p+="maxRow"===f?1:a:"up"===r&&(p-="minRow"===f?1:c);let g=t[p];if(void 0===g)return!1;let m=g[h];if(void 0===m)return!1;let[b,C]=function(e,t,l){let n=ti(e,t,l),r=t$(n,t);if(r)return[tM(e,n,r),tM(e,n,tL(r))];let o=t$(n,l);if(o)return[tM(e,n,tL(o)),tM(e,n,o)];let i=["minColumn","minRow"];return[tM(e,n,i),tM(e,n,tL(i))]}(t,l,m),x=tH(e,b.cell),y=tH(e,C.cell);return e.$setAnchorCellForSelection(x),e.$setFocusCellForSelection(y,!0),!0}(o,e,t,l,n)}return c.selectEnd(),!0}return!1})(l,t,n,e,i),eO.COMMAND_PRIORITY_HIGH));i.listenersToRemove.add(l.registerCommand(eO.KEY_ESCAPE_COMMAND,t=>{let l=(0,eO.$getSelection)();if(tu(l)){let n=tC(e,l.focus.getNode());if(null!==n)return tP(t),n.selectEnd(),!0}return!1},eO.COMMAND_PRIORITY_HIGH));let d=t=>()=>{let l=(0,eO.$getSelection)();if(!tR(l,e))return!1;if(tu(l))return i.$clearText(),!0;if((0,eO.$isRangeSelection)(l)){if(!eK(tC(e,l.anchor.getNode())))return!1;let n=l.anchor.getNode(),r=l.focus.getNode(),o=e.isParentOf(n),a=e.isParentOf(r);if(o&&!a||a&&!o)return i.$clearText(),!0;let s=(0,eO.$findMatchingParent)(l.anchor.getNode(),e=>(0,eO.$isElementNode)(e)),c=s&&(0,eO.$findMatchingParent)(s,e=>(0,eO.$isElementNode)(e)&&eK(e.getParent()));if(!(0,eO.$isElementNode)(c)||!(0,eO.$isElementNode)(s))return!1;if(t===eO.DELETE_LINE_COMMAND&&null===c.getPreviousSibling())return!0}return!1};for(let e of ty)i.listenersToRemove.add(l.registerCommand(e,d(e),eO.COMMAND_PRIORITY_HIGH));let f=t=>{let l=(0,eO.$getSelection)();if(!tu(l)&&!(0,eO.$isRangeSelection)(l))return!1;let n=e.isParentOf(l.anchor.getNode());if(n!==e.isParentOf(l.focus.getNode())){let t=n?"focus":"anchor",{key:r,offset:o,type:i}=l[t];return e[l[n?"anchor":"focus"].isBefore(l[t])?"selectPrevious":"selectNext"]()[t].set(r,o,i),!1}return!!tR(l,e)&&!!tu(l)&&(t&&(t.preventDefault(),t.stopPropagation()),i.$clearText(),!0)};for(let e of tv)i.listenersToRemove.add(l.registerCommand(e,f,eO.COMMAND_PRIORITY_HIGH));return i.listenersToRemove.add(l.registerCommand(eO.CUT_COMMAND,e=>{let t=(0,eO.$getSelection)();if(t){if(!tu(t)&&!(0,eO.$isRangeSelection)(t))return!1;(0,eD.copyToClipboard)(l,(0,et.objectKlassEquals)(e,ClipboardEvent)?e:null,(0,eD.$getClipboardDataFromSelection)(t));let n=f(e);return(0,eO.$isRangeSelection)(t)?(t.removeText(),!0):n}return!1},eO.COMMAND_PRIORITY_HIGH)),i.listenersToRemove.add(l.registerCommand(eO.FORMAT_TEXT_COMMAND,t=>{let l=(0,eO.$getSelection)();if(!tR(l,e))return!1;if(tu(l))return i.$formatCells(t),!0;if((0,eO.$isRangeSelection)(l)){let e=(0,eO.$findMatchingParent)(l.anchor.getNode(),e=>eK(e));eK(e)}return!1},eO.COMMAND_PRIORITY_HIGH)),i.listenersToRemove.add(l.registerCommand(eO.FORMAT_ELEMENT_COMMAND,t=>{let l=(0,eO.$getSelection)();if(!tu(l)||!tR(l,e))return!1;let n=l.anchor.getNode(),r=l.focus.getNode();if(!eK(n)||!eK(r))return!1;if(function(e,t){if(tu(e)){let l=e.anchor.getNode(),n=e.focus.getNode();if(t&&l&&n){let[e]=tn(t,l,n);return l.getKey()===e[0][0].cell.getKey()&&n.getKey()===e[e.length-1].at(-1).cell.getKey()}}return!1}(l,e))return e.setFormat(t),!0;let[o,i,a]=tn(e,n,r),s=Math.max(i.startRow+i.cell.__rowSpan-1,a.startRow+a.cell.__rowSpan-1),c=Math.max(i.startColumn+i.cell.__colSpan-1,a.startColumn+a.cell.__colSpan-1),u=Math.min(i.startRow,a.startRow),d=Math.min(i.startColumn,a.startColumn),f=new Set;for(let e=u;e<=s;e++)for(let l=d;l<=c;l++){let n=o[e][l].cell;if(f.has(n))continue;f.add(n),n.setFormat(t);let r=n.getChildren();for(let e=0;e<r.length;e++){let l=r[e];(0,eO.$isElementNode)(l)&&!l.isInline()&&l.setFormat(t)}}return!0},eO.COMMAND_PRIORITY_HIGH)),i.listenersToRemove.add(l.registerCommand(eO.CONTROLLED_TEXT_INSERTION_COMMAND,t=>{let n=(0,eO.$getSelection)();if(!tR(n,e))return!1;if(tu(n))return i.$clearHighlight(),!1;if((0,eO.$isRangeSelection)(n)){let r=(0,eO.$findMatchingParent)(n.anchor.getNode(),e=>eK(e));if(!eK(r))return!1;if("string"==typeof t){let r=tB(l,n,e);if(r)return tA(r,e,[(0,eO.$createTextNode)(t)]),!0}}return!1},eO.COMMAND_PRIORITY_HIGH)),n&&i.listenersToRemove.add(l.registerCommand(eO.KEY_TAB_COMMAND,t=>{let l=(0,eO.$getSelection)();if(!(0,eO.$isRangeSelection)(l)||!l.isCollapsed()||!tR(l,e))return!1;let n=tO(l.anchor.getNode());return!(null===n||!e.is(tD(n)))&&(tP(t),function(e,t){let l="next"===t?"getNextSibling":"getPreviousSibling",n="next"===t?"getFirstChild":"getLastChild",r=e[l]();if((0,eO.$isElementNode)(r))return r.selectEnd();let o=(0,eO.$findMatchingParent)(e,eY);null===o&&eV(247);for(let e=o[l]();eY(e);e=e[l]()){let t=e[n]();if((0,eO.$isElementNode)(t))return t.selectEnd()}let i=(0,eO.$findMatchingParent)(o,tX);null===i&&eV(248),"next"===t?i.selectNext():i.selectPrevious()}(n,t.shiftKey?"previous":"next"),!0)},eO.COMMAND_PRIORITY_HIGH)),i.listenersToRemove.add(l.registerCommand(eO.FOCUS_COMMAND,t=>e.isSelected(),eO.COMMAND_PRIORITY_HIGH)),i.listenersToRemove.add(l.registerCommand(eO.SELECTION_CHANGE_COMMAND,()=>{let t=(0,eO.$getSelection)(),n=(0,eO.$getPreviousSelection)(),r=i.getAndClearNextFocus();if(null!==r){let{focusCell:e}=r;if(tu(t)&&t.tableKey===i.tableNodeKey)return(e.x!==i.focusX||e.y!==i.focusY)&&(i.$setFocusCellForSelection(e),!0);if(e!==i.anchorCell&&null!==i.anchorCell&&null!==i.anchorCellNodeKey&&null!==i.tableSelection)return i.$setFocusCellForSelection(e,!0),!0}if(i.getAndClearShouldCheckSelection()&&(0,eO.$isRangeSelection)(n)&&(0,eO.$isRangeSelection)(t)&&t.isCollapsed()){let l=t.anchor.getNode(),n=e.getFirstChild(),r=tO(l);if(null!==r&&eY(n)){let t=n.getFirstChild();if(eK(t)&&e.is((0,eO.$findMatchingParent)(r,l=>l.is(e)||l.is(t))))return t.selectStart(),!0}}if((0,eO.$isRangeSelection)(t)){let{anchor:r,focus:o}=t,a=r.getNode(),s=o.getNode(),c=tO(a),u=tO(s),d=!(!c||!e.is(tD(c))),f=!(!u||!e.is(tD(u))),h=t.isBackward();if(d!==f){let n=t.clone();if(f){let[t]=tn(e,u,u),l=t[0][0].cell,r=t[t.length-1].at(-1).cell;n.focus.set(h?l.getKey():r.getKey(),h?0:r.getChildrenSize(),"element")}else if(d){let[t]=tn(e,c,c),l=t[0][0].cell,r=t[t.length-1].at(-1).cell;n.anchor.set(h?r.getKey():l.getKey(),h?r.getChildrenSize():0,"element")}(0,eO.$setSelection)(n),tE(l,i)}else if(d&&f&&(c.is(u)||(i.$setAnchorCellForSelection(tH(i,c)),i.$setFocusCellForSelection(tH(i,u),!0)),"touch"===i.pointerType&&i.isSelecting&&t.isCollapsed()&&(0,eO.$isRangeSelection)(n)&&n.isCollapsed())){let e=tO(n.anchor.getNode());e&&!e.is(u)&&(i.$setAnchorCellForSelection(tH(i,e)),i.$setFocusCellForSelection(tH(i,u),!0),i.pointerType=null)}}else if(t&&tu(t)&&t.is(n)&&t.tableKey===e.getKey()){let n=(0,eO.getDOMSelection)(o);if(n&&n.anchorNode&&n.focusNode){let r=(0,eO.$getNearestNodeFromDOMNode)(n.focusNode),o=r&&!e.isParentOf(r),i=(0,eO.$getNearestNodeFromDOMNode)(n.anchorNode),a=i&&e.isParentOf(i);if(o&&a&&n.rangeCount>0){let r=(0,eO.$createRangeSelectionFromDom)(n,l);r&&(r.anchor.set(e.getKey(),t.isBackward()?e.getChildrenSize():0,"element"),n.removeAllRanges(),(0,eO.$setSelection)(r))}}}return t&&!t.is(n)&&(tu(t)||tu(n))&&i.tableSelection&&!i.tableSelection.is(n)?tu(t)&&t.tableKey===i.tableNodeKey?i.$updateTableTableSelection(t):!tu(t)&&tu(n)&&n.tableKey===i.tableNodeKey&&i.$updateTableTableSelection(null):i.hasHijackedSelectionStyles&&!e.isSelected()?(i.$enableHighlightStyle(),tT(i.table,e=>{let t=e.elem;e.highlighted=!1,tF(l,e),t.getAttribute("style")||t.removeAttribute("style")})):!i.hasHijackedSelectionStyles&&e.isSelected()&&tE(l,i),!1},eO.COMMAND_PRIORITY_HIGH)),i.listenersToRemove.add(l.registerCommand(eO.INSERT_PARAGRAPH_COMMAND,()=>{let t=(0,eO.$getSelection)();if(!(0,eO.$isRangeSelection)(t)||!t.isCollapsed()||!tR(t,e))return!1;let n=tB(l,t,e);return!!n&&(tA(n,e),!0)},eO.COMMAND_PRIORITY_HIGH)),i}(n,i,e,t);l.set(r,[a,i])},r=e.registerMutationListener(tG,t=>{e.getEditorState().read(()=>{for(let[e,r]of t){let t=l.get(e);if("created"===r||"updated"===r){let{tableNode:r,tableElement:o}=tf(e);void 0===t?n(r,e,o):o!==t[1]&&(t[0].removeListeners(),l.delete(e),n(r,e,o))}else"destroyed"===r&&void 0!==t&&(t[0].removeListeners(),l.delete(e))}},{editor:e})},{skipInitialization:!1});return()=>{for(let[,[e]]of(r(),l))e.removeListeners()}}function t6(e,t){e.hasNodes([tG])||eV(255);let{hasNestedTables:l=(0,er.signal)(!1),hasFitNestedTables:n=(0,er.signal)(!1)}=t??{};return(0,eO.mergeRegister)(e.registerCommand(eU,e=>(function({rows:e,columns:t,includeHeaders:l},n){let r=(0,eO.$getSelection)()||(0,eO.$getPreviousSelection)();if(!r||!(0,eO.$isRangeSelection)(r)||!n&&tD(r.anchor.getNode()))return!1;let o=function(e,t,l=!0){let n=tY();for(let r=0;r<e;r++){let e=eJ();for(let n=0;n<t;n++){let t=0;"object"==typeof l?(0===r&&l.rows&&(t|=1),0===n&&l.columns&&(t|=2)):l&&(0===r&&(t|=1),0===n&&(t|=2));let o=ez(t),i=(0,eO.$createParagraphNode)();i.append((0,eO.$createTextNode)()),o.append(i),e.append(o)}n.append(e)}return n}(Number(e),Number(t),l);(0,et.$insertNodeToNearestRoot)(o);let i=o.getFirstDescendant();return(0,eO.$isTextNode)(i)&&i.select(),!0})(e,l.peek()),eO.COMMAND_PRIORITY_EDITOR),e.registerCommand(eO.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,(t,r)=>e===r&&function(e,t,l){let{nodes:n,selection:r}=e;if(!n.some(e=>tX(e)||(0,et.$dfs)(e).some(e=>tX(e.node))))return!1;let o=tu(r),i=(0,eO.$isRangeSelection)(r);return!!(i&&null!==(0,eO.$findMatchingParent)(r.anchor.getNode(),e=>eK(e))&&null!==(0,eO.$findMatchingParent)(r.focus.getNode(),e=>eK(e))||o)&&(1===n.length&&tX(n[0])?function(e,t){let l=t.getStartEndPoints(),n=tu(t);if(null===l)return!1;let[r,o]=l,[i,a,s]=to(r),c=(0,eO.$findMatchingParent)(o.getNode(),e=>eK(e));if(!(eK(i)&&eK(c)&&eY(a)&&tX(s)))return!1;let[u,d,f]=tn(s,i,c),[h]=tr(e,null,null),p=u.length,g=p>0?u[0].length:0,m=d.startRow,b=d.startColumn,C=h.length,x=C>0?h[0].length:0;if(n){let e=ti(u,d,f),t=e.maxRow-e.minRow+1,l=e.maxColumn-e.minColumn+1;m=e.minRow,b=e.minColumn,C=Math.min(C,t),x=Math.min(x,l)}let y=!1,v=Math.min(p,m+C)-1,_=Math.min(g,b+x)-1,S=new Set;for(let e=m;e<=v;e++)for(let t=b;t<=_;t++){let l=u[e][t];S.has(l.cell.getKey())||1===l.cell.__rowSpan&&1===l.cell.__colSpan||(tl(l.cell),S.add(l.cell.getKey()),y=!0)}let[N]=tr(s.getWritable(),null,null),w=C-p+m;for(let e=0;e<w;e++)e4(N[p-1][0].cell);let k=x-g+b;for(let e=0;e<k;e++)e8(N[0][g-1].cell,!0,!1);[N]=tr(s.getWritable(),null,null);for(let e=m;e<m+C;e++)for(let t=b;t<b+x;t++){let l=e-m,n=t-b,r=h[l][n];if(r.startRow!==l||r.startColumn!==n)continue;let o=r.cell;if(1!==o.__rowSpan||1!==o.__colSpan){let l=[],n=Math.min(e+o.__rowSpan,m+C)-1,r=Math.min(t+o.__colSpan,b+x)-1;for(let o=e;o<=n;o++)for(let e=t;e<=r;e++){let t=N[o][e];l.push(t.cell)}tt(l),y=!0}let{cell:i}=N[e][t],a=o.getBackgroundColor();null!=a&&i.setBackgroundColor(a);let s=i.getChildren();o.getChildren().forEach(e=>{(0,eO.$isTextNode)(e)&&(0,eO.$createParagraphNode)().append(e),i.append(e)}),s.forEach(e=>e.remove())}if(n&&y){let[e]=tr(s.getWritable(),null,null);e[d.startRow][d.startColumn].cell.selectEnd()}return!0}(n[0],r):!(i&&t.peek())||function(e,t,l){let n=tu(t)&&!t.focus.getNode().is(t.anchor.getNode()),r=(0,eO.$isRangeSelection)(t)&&eK(t.anchor.getNode())&&!t.anchor.getNode().is(t.focus.getNode());if(n||r)return!0;if(!l)return!1;let o=t.focus.getNode(),i=(0,eO.$findMatchingParent)(o,eK);if(!i)return!1;let a=t5(i);if(void 0===a)return!1;let s=function(e){let t=(0,eO.$getEditor)().getElementByKey(e.getKey());if(null===t)return 0;let l=window.getComputedStyle(t),n=l.getPropertyValue("padding-left")||"0px",r=l.getPropertyValue("padding-right")||"0px",o=l.getPropertyValue("border-left-width")||"0px",i=l.getPropertyValue("padding-right-width")||"0px";return eP.test(n)&&eP.test(r)&&eP.test(o)&&eP.test(i)?parseFloat(n)+parseFloat(r)+parseFloat(o)+parseFloat(i):0}(i);for(let t of e.filter(tX))!function e(t,l,n){let r=t.getColWidths();if(!r)return t;let o=l-n,i=r.reduce((e,t)=>e+t,0);if(i<=o)return t;let a=o/i;for(let l of(t.setColWidths(r.map(e=>e*a)),t.getChildren().filter(eY)))for(let t of l.getChildren().filter(eK)){let l=t5(t);if(void 0!==l)for(let r of t.getChildren().filter(tX))e(r,l,n)}}(t,a,s);return!1}(n,r,l.peek()))}(t,l,n),eO.COMMAND_PRIORITY_EDITOR),e.registerCommand(eO.SELECT_ALL_COMMAND,t1,eO.COMMAND_PRIORITY_LOW),e.registerCommand(eO.CLICK_COMMAND,t0,eO.COMMAND_PRIORITY_EDITOR),e.registerNodeTransform(tG,tQ),e.registerNodeTransform(eW,tq),e.registerNodeTransform(eA,tZ))}function t5(e){let t=e1(e),l=ta(e),n=t.getColWidths();if(!l||!n)return;let{columnIndex:r,colSpan:o}=l,i=0;for(let e=r;e<r+o;e++)i+=n[e];return i}(0,eO.defineExtension)({build:(e,t,l)=>(0,er.namedSignals)(t),config:(0,eO.safeCast)({hasCellBackgroundColor:!0,hasCellMerge:!0,hasFitNestedTables:!1,hasHorizontalScroll:!0,hasNestedTables:!1,hasTabHandler:!0}),name:"@lexical/table/Table",nodes:()=>[tG,eW,eA],register(e,t,l){let n=l.getOutput();return(0,eO.mergeRegister)((0,er.effect)(()=>{let t=n.hasHorizontalScroll.value;tV(e)!==t&&(tW(e,t),e.registerNodeTransform(tG,()=>{})())}),t6(e,n),(0,er.effect)(()=>t3(e,n.hasTabHandler.value)),(0,er.effect)(()=>n.hasCellMerge.value?void 0:t2(e)),(0,er.effect)(()=>n.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(eA,e=>{null!==e.getBackgroundColor()&&e.setBackgroundColor(null)})))}});let t4=Object.freeze({" ":"\\t","\n":"\\n"}),t7=RegExp(Object.keys(t4).join("|"),"g"),t8=Object.freeze({ancestorHasNextSibling:"|",ancestorIsLastChild:" ",hasNextSibling:"├",isLastChild:"└",selectedChar:"^",selectedLine:">"}),t9=[e=>e.hasFormat("bold")&&"Bold",e=>e.hasFormat("code")&&"Code",e=>e.hasFormat("italic")&&"Italic",e=>e.hasFormat("strikethrough")&&"Strikethrough",e=>e.hasFormat("subscript")&&"Subscript",e=>e.hasFormat("superscript")&&"Superscript",e=>e.hasFormat("underline")&&"Underline",e=>e.hasFormat("highlight")&&"Highlight"],le=[e=>e.hasTextFormat("bold")&&"Bold",e=>e.hasTextFormat("code")&&"Code",e=>e.hasTextFormat("italic")&&"Italic",e=>e.hasTextFormat("strikethrough")&&"Strikethrough",e=>e.hasTextFormat("subscript")&&"Subscript",e=>e.hasTextFormat("superscript")&&"Superscript",e=>e.hasTextFormat("underline")&&"Underline",e=>e.hasTextFormat("highlight")&&"Highlight"],lt=[e=>e.isDirectionless()&&"Directionless",e=>e.isUnmergeable()&&"Unmergeable"],ll=[e=>e.isToken()&&"Token",e=>e.isSegmented()&&"Segmented"];function ln(e,t=!1){let l=Object.entries(t4).reduce((e,[t,l])=>e.replace(RegExp(t,"g"),String(l)),e);return t?l.replace(/[^\s]/g,"*"):l}function lr(e){let t=t9.map(t=>t(e)).filter(Boolean).join(", ").toLocaleLowerCase();return""!==t&&(t="format: "+t),t}function lo(e){if(!e.__state)return!1;let t=[];for(let[l,n]of e.__state.knownState.entries()){if(l.isEqual(n,l.defaultValue))continue;let e=JSON.stringify(l.unparse(n));t.push(`[${l.key}: ${e}]`)}let l=t.join(",");return""!==l&&(l="state: "+l),l}let li=(0,g.forwardRef)(function({treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:l,timeTravelPanelButtonClassName:n,viewClassName:r,timeTravelPanelClassName:o,editorState:i,setEditorState:a,setEditorReadOnly:s,generateContent:c,commandsLog:u=[]},d){let[f,h]=(0,g.useState)([]),[p,b]=(0,g.useState)(""),[C,x]=(0,g.useState)(!1),[y,v]=(0,g.useState)(!1),_=(0,g.useRef)(0),S=(0,g.useRef)(null),[N,w]=(0,g.useState)(!1),[k,T]=(0,g.useState)(!1),[E,$]=(0,g.useState)(!1),L=(0,g.useRef)(null),M=(0,g.useRef)([]),R=(0,g.useRef)(0),j=(0,g.useCallback)(e=>{let t=++R.current;c(e).then(e=>{t===R.current&&b(e)}).catch(e=>{t===R.current&&b(`Error rendering tree: ${e.message}
|
||
|
||
Stack:
|
||
${e.stack}`)})},[c]);(0,g.useEffect)(()=>{if((E||!(i._nodeMap.size>1e3)||(T(!0),E))&&(L.current!==i||M.current!==u)){let e=L.current!==i;L.current=i,M.current=u,j(y),!C&&e&&h(e=>[...e,[Date.now(),i]])}},[i,j,y,E,C,u]);let I=f.length;return(0,g.useEffect)(()=>{if(N){let e,t=()=>{let l=_.current;if(l===I-1)return void w(!1);let n=f[l][0];e=setTimeout(()=>{_.current++;let e=_.current,l=S.current;null!==l&&(l.value=String(e)),a(f[e][1]),t()},f[l+1][0]-n)};return t(),()=>{clearTimeout(e)}}},[f,N,I,a]),(0,m.jsxs)("div",{className:r,children:[!E&&k?(0,m.jsxs)("div",{style:{padding:20},children:[(0,m.jsx)("span",{style:{marginRight:20},children:"Detected large EditorState, this can impact debugging performance."}),(0,m.jsx)("button",{onClick:()=>{$(!0)},style:{background:"transparent",border:"1px solid white",color:"white",cursor:"pointer",padding:5},children:"Show full tree"})]}):null,E?null:(0,m.jsx)("button",{onClick:()=>(j(!y),void v(!y)),className:e,type:"button",children:y?"Tree":"Export DOM"}),!C&&(E||!k)&&I>2&&(0,m.jsx)("button",{onClick:()=>{s(!0),_.current=I-1,x(!0)},className:t,type:"button",children:"Time Travel"}),(E||!k)&&(0,m.jsx)("pre",{ref:d,children:p}),C&&(E||!k)&&(0,m.jsxs)("div",{className:o,children:[(0,m.jsx)("button",{className:n,onClick:()=>{_.current===I-1&&(_.current=1),w(!N)},type:"button",children:N?"Pause":"Play"}),(0,m.jsx)("input",{className:l,ref:S,onChange:e=>{let t=Number(e.target.value),l=f[t];l&&(_.current=t,a(l[1]))},type:"range",min:"1",max:I-1}),(0,m.jsx)("button",{className:n,onClick:()=>{s(!1);let e=f.length-1;a(f[e][1]);let t=S.current;null!==t&&(t.value=String(e)),x(!1),w(!1)},type:"button",children:"Exit"})]})]})});function la({treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:l,timeTravelPanelButtonClassName:n,timeTravelPanelClassName:r,viewClassName:o,editor:i,customPrintNode:a}){let s=g.createRef(),[c,u]=(0,g.useState)(i.getEditorState()),f=function(e){let[t,l]=(0,g.useState)([]);return(0,g.useEffect)(()=>(function(e,t){let l=new Set,n=0;for(let[r]of e._commands)l.add(e.registerCommand(r,e=>(t(t=>{let l=[...t];return l.push({index:n+=1,payload:e,type:r.type?r.type:"UNKNOWN"}),l.length>10&&l.shift(),l}),!1),d.COMMAND_PRIORITY_CRITICAL));return()=>l.forEach(e=>e())})(e,l),[e]),(0,g.useMemo)(()=>t,[t])}(i);return(0,g.useEffect)(()=>(0,d.mergeRegister)(i.registerUpdateListener(({editorState:e})=>{u(e)}),i.registerEditableListener(()=>{u(i.getEditorState())})),[i]),(0,g.useEffect)(()=>{let e=s.current;if(null!==e)return e.__lexicalEditor=i,()=>{e.__lexicalEditor=null}},[i,s]),(0,m.jsx)(li,{treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:l,timeTravelPanelButtonClassName:n,viewClassName:o,timeTravelPanelClassName:r,setEditorReadOnly:e=>{let t=i.getRootElement();null!=t&&(t.contentEditable=e?"false":"true")},editorState:c,setEditorState:e=>i.setEditorState(e),generateContent:async function(e){return function(e,t,l,n,r=!1){let o=e.getEditorState(),i=e._config,a=e._compositionKey,s=e._editable;if(l){let t="";return o.read(()=>{var l;let n;l=(0,el.$generateHtmlFromNodes)(e),(n=document.createElement("div")).innerHTML=l.trim(),t=function e(t,l){let n,r=Array(1+l++).join(" "),o=Array(l-1).join(" ");for(let i=0;i<t.children.length;i++)n=document.createTextNode("\n"+r),t.insertBefore(n,t.children[i]),e(t.children[i],l),t.lastElementChild===t.children[i]&&(n=document.createTextNode("\n"+o),t.appendChild(n));return t}(n,0).innerHTML}),t}let c=" root\n",u=o.read(()=>{let e,t,l,o,i,a,s=(0,d.$getSelection)();return function e(t,l,n=[]){let r=t.getChildren(),o=r.length;r.forEach((t,r)=>{l(t,n.concat(r===o-1?t8.isLastChild:t8.hasNextSibling)),(0,d.$isElementNode)(t)&&e(t,l,n.concat(r===o-1?t8.ancestorIsLastChild:t8.ancestorHasNextSibling))})}((0,d.$getRoot)(),(e,t)=>{let l=`(${e.getKey()})`,o=e.getType()||"",i=e.isSelected();c+=`${i?t8.selectedLine:" "} ${t.join(" ")} ${l} ${o} ${function(e,t,l=!1){let n=t?t(e,l):void 0;if(void 0!==n&&n.length>0)return n;if((0,d.$isTextNode)(e)){var r,o;let t,n,i=e.getTextContent(),a=0===i.length?"(empty)":`"${ln(i,l)}"`,s=[lr(e),(r=e,""!==(t=lt.map(e=>e(r)).filter(Boolean).join(", ").toLocaleLowerCase())&&(t="detail: "+t),t),(o=e,""!==(n=ll.map(e=>e(o)).filter(Boolean).join(", ").toLocaleLowerCase())&&(n="mode: "+n),n),lo(e)].filter(Boolean).join(", ");return[a,0!==s.length?`{ ${s} }`:null].filter(Boolean).join(" ").trim()}if(ef(e)){let t,n,r,o=e.getURL(),i=0===o.length?"(empty)":`"${ln(o,l)}"`,a=[(null!=(t=e.getTarget())&&(t="target: "+t),t),(null!=(n=e.getRel())&&(n="rel: "+n),n),(null!=(r=e.getTitle())&&(r="title: "+r),r),lo(e)].filter(Boolean).join(", ");return[i,0!==a.length?`{ ${a} }`:null].filter(Boolean).join(" ").trim()}if(e instanceof eI)return`ids: [ ${e.getIDs().join(", ")} ]`;if((0,d.$isParagraphNode)(e)){let t,l=(""!==(t=le.map(t=>t(e)).filter(Boolean).join(", ").toLocaleLowerCase())&&(t="format: "+t),t);return(""!==l?`{ ${l} }`:"")+(e.__style?`(${e.__style})`:"")}return""}(e,n,r)}
|
||
`,c+=function({indent:e,isSelected:t,node:l,nodeKeyDisplay:n,selection:r,typeDisplay:o}){if(!(0,d.$isTextNode)(l)||!(0,d.$isRangeSelection)(r)||!t||(0,d.$isElementNode)(l))return"";let i=r.anchor,a=r.focus;if(""===l.getTextContent()||i.getNode()===r.focus.getNode()&&i.offset===a.offset)return"";let[s,c]=function(e,t){let l=t.getStartEndPoints();if((0,d.$isNodeSelection)(t)||null===l)return[-1,-1];let[n,r]=l,o=e.getTextContent(),i=o.length,a=-1,s=-1;if("text"===n.type&&"text"===r.type){let t=n.getNode(),l=r.getNode();t===l&&e===t&&n.offset!==r.offset?[a,s]=n.offset<r.offset?[n.offset,r.offset]:[r.offset,n.offset]:[a,s]=e===t?t.isBefore(l)?[n.offset,i]:[0,n.offset]:e===l?l.isBefore(t)?[r.offset,i]:[0,r.offset]:[0,i]}let c=(o.slice(0,a).match(t7)||[]).length,u=(o.slice(a,s).match(t7)||[]).length;return[a+c,s+c+u]}(l,r);if(s===c)return"";let u=e[e.length-1]===t8.hasNextSibling?t8.ancestorHasNextSibling:t8.ancestorIsLastChild,f=[...e.slice(0,e.length-1),u],h=Array(s+1).fill(" "),p=Array(c-s).fill(t8.selectedChar),g=o.length+2,m=Array(n.length+g).fill(" ");return[t8.selectedLine,f.join(" "),[...m,...h,...p].join("")].join(" ")+"\n"}({indent:t,isSelected:i,node:e,nodeKeyDisplay:l,selection:s,typeDisplay:o})}),null===s?": null":(0,d.$isRangeSelection)(s)?(e="",t=lr(s),e+=`: range ${""!==t?`{ ${t} }`:""} ${""!==s.style?`{ style: ${s.style} } `:""}`,l=s.anchor,o=s.focus,i=l.offset,a=o.offset,e+`
|
||
├ anchor { key: ${l.key}, offset: ${null===i?"null":i}, type: ${l.type} }
|
||
└ focus { key: ${o.key}, offset: ${null===a?"null":a}, type: ${o.type} }`):tu(s)?`: table
|
||
└ { table: ${s.tableKey}, anchorCell: ${s.anchor.key}, focusCell: ${s.focus.key} }`:(0,d.$isNodeSelection)(s)?`: node
|
||
└ [${Array.from(s._nodes).join(", ")}]`:""});if(c+="\n selection"+u,c+="\n\n commands:",t.length)for(let{index:e,type:l,payload:n}of t)c+=`
|
||
└ ${e}. { type: ${l}, payload: ${n instanceof Event?n.constructor.name:n} }`;else c+="\n └ None dispatched.";let{version:f}=e.constructor;return c+=`
|
||
|
||
editor${f?` (v${f})`:""}:`,c+=`
|
||
└ namespace ${i.namespace}`,null!==a&&(c+=`
|
||
└ compositionKey ${a}`),c+=`
|
||
└ editable ${String(s)}`}(i,f,e,a)},ref:s,commandsLog:f})}function ls({maxIndent:e,$canIndent:t}){let[l]=(0,u.useLexicalComposerContext)();return(0,g.useEffect)(()=>(0,er.registerTabIndentation)(l,e,t),[l,e,t]),null}function lc({newTab:e=!0,disabled:t=!1}){let[l]=(0,u.useLexicalComposerContext)();return(0,g.useEffect)(()=>e_(l,(0,er.namedSignals)({disabled:t,newTab:e})),[l,e,t]),null}var lu=e.i(910353),ld=e.i(713465),lf=e.i(397910);function lh({hasStrictIndent:e=!1,shouldPreserveNumbering:t=!1}){let[l]=(0,u.useLexicalComposerContext)();return(0,g.useEffect)(()=>{if(!l.hasNodes([lf.ListNode,lf.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[l]),(0,g.useEffect)(()=>(0,d.mergeRegister)((0,lf.registerList)(l,{restoreNumbering:t}),e?(0,lf.registerListStrictIndentTransform)(l):()=>{}),[l,e,t]),(0,g.useEffect)(()=>(0,lf.registerList)(l),[l]),null}function lp({disableTakeFocusOnClick:e=!1}){let[t]=(0,u.useLexicalComposerContext)();return(0,g.useEffect)(()=>(0,lf.registerCheckList)(t,{disableTakeFocusOnClick:e}),[t,e]),null}function lg({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:l=!0,hasHorizontalScroll:n=!1,hasNestedTables:r=!1,hasFitNestedTables:o=!1}){let[i]=(0,u.useLexicalComposerContext)();(0,g.useEffect)(()=>{tV(i)!==n&&(tW(i,n),i.registerNodeTransform(tG,()=>{})())},[i,n]);let a=lm(r),s=lm(o);return(0,g.useEffect)(()=>t6(i,{hasFitNestedTables:s,hasNestedTables:a}),[i,a,s]),(0,g.useEffect)(()=>t3(i,l),[i,l]),(0,g.useEffect)(()=>{if(!e)return t2(i)},[i,e]),(0,g.useEffect)(()=>{if(!t)return i.registerNodeTransform(eA,e=>{null!==e.getBackgroundColor()&&e.setBackgroundColor(null)})},[i,t,e]),null}function lm(e){let[t]=(0,g.useState)(()=>(0,er.signal)(e));return t.peek()!==e&&(t.value=e),t}var lb=e.i(4497),lC=e.i(126612),lC=lC,lx=e.i(559626);function ly(e){return{items:e,key:"basic",label:({i18n:e})=>e.t("lexical:general:slashMenuBasicGroupLabel")}}var lv=()=>(0,m.jsxs)("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:[(0,m.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M2.5 15H12.5",stroke:"currentColor",strokeWidth:"1.5"})]}),l_=e=>t=>{let l={clientFeatureProps:t};if("function"==typeof e)l.feature=({config:l,featureClientImportMap:n,featureClientSchemaMap:r,featureProviderMap:o,field:i,resolvedFeatures:a,schemaPath:s,unSanitizedEditorConfig:c})=>{let u=e({config:l,featureClientImportMap:n,featureClientSchemaMap:r,featureProviderMap:o,field:i,props:t,resolvedFeatures:a,schemaPath:s,unSanitizedEditorConfig:c});return null===u.sanitizedClientFeatureProps&&(u.sanitizedClientFeatureProps=t),u};else{let n={...e};n.sanitizedClientFeatureProps=t,l.feature=n}return l},lS=e=>(0,p.$isElementNode)(e)?e.getFormatType():e.__format,lN=[(t=[{ChildComponent:lv,isActive:({selection:e})=>{if(!(0,p.$isRangeSelection)(e))return!1;for(let t of e.getNodes()){if(((0,p.$isElementNode)(t)||h(t))&&"left"===lS(t))continue;let e=t.getParent();if(!(((0,p.$isElementNode)(e)||h(e))&&"left"===lS(e)))return!1}return!0},key:"alignLeft",label:({i18n:e})=>e.t("lexical:align:alignLeftLabel"),onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_ELEMENT_COMMAND,"left")},order:1},{ChildComponent:()=>(0,m.jsxs)("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:[(0,m.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M5 15H15",stroke:"currentColor",strokeWidth:"1.5"})]}),isActive:({selection:e})=>{if(!(0,p.$isRangeSelection)(e))return!1;for(let t of e.getNodes()){if(((0,p.$isElementNode)(t)||h(t))&&"center"===lS(t))continue;let e=t.getParent();if(!(((0,p.$isElementNode)(e)||h(e))&&"center"===lS(e)))return!1}return!0},key:"alignCenter",label:({i18n:e})=>e.t("lexical:align:alignCenterLabel"),onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_ELEMENT_COMMAND,"center")},order:2},{ChildComponent:()=>(0,m.jsxs)("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:[(0,m.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M7.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]}),isActive:({selection:e})=>{if(!(0,p.$isRangeSelection)(e))return!1;for(let t of e.getNodes()){if(((0,p.$isElementNode)(t)||h(t))&&"right"===lS(t))continue;let e=t.getParent();if(!(((0,p.$isElementNode)(e)||h(e))&&"right"===lS(e)))return!1}return!0},key:"alignRight",label:({i18n:e})=>e.t("lexical:align:alignRightLabel"),onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_ELEMENT_COMMAND,"right")},order:3},{ChildComponent:()=>(0,m.jsxs)("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:[(0,m.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]}),isActive:({selection:e})=>{if(!(0,p.$isRangeSelection)(e))return!1;for(let t of e.getNodes()){if(((0,p.$isElementNode)(t)||h(t))&&"justify"===lS(t))continue;let e=t.getParent();if(!(((0,p.$isElementNode)(e)||h(e))&&"justify"===lS(e)))return!1}return!0},key:"alignJustify",label:({i18n:e})=>e.t("lexical:align:alignJustifyLabel"),onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_ELEMENT_COMMAND,"justify")},order:4}],{type:"dropdown",ChildComponent:lv,items:t,key:"align",order:30})],lw=l_({plugins:[{Component:()=>{let e=(0,c.c)(3),[t]=(0,u.useLexicalComposerContext)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(p.FORMAT_ELEMENT_COMMAND,lT,p.COMMAND_PRIORITY_LOW),n=[t],e[0]=t,e[1]=l,e[2]=n):(l=e[1],n=e[2]),(0,g.useEffect)(l,n),null},position:"normal"}],toolbarFixed:{groups:lN},toolbarInline:{groups:lN}});function lk(e){return((0,p.$isElementNode)(e)||h(e))&&!e.isInline()}function lT(e){let t=(0,p.$getSelection)();if(!(0,p.$isRangeSelection)(t)&&!(0,p.$isNodeSelection)(t))return!1;for(let l of t.getNodes()){let t=(0,p.$findMatchingParent)(l,lk);null!==t&&t.setFormat(e)}return!0}var lE=()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),l$=()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),lL=e=>({type:"dropdown",ChildComponent:l$,items:e,key:"text",order:25}),lM={type:"element",dependencies:[b.QuoteNode],export:(e,t)=>{if(!(0,b.$isQuoteNode)(e))return null;let l=t(e).split(`
|
||
`),n=[];for(let e of l)n.push("> "+e);return n.join(`
|
||
`)},regExp:/^>\s/,replace:(e,t,l,n)=>{if(n){let l=e.getPreviousSibling();if((0,b.$isQuoteNode)(l)){l.splice(l.getChildrenSize(),0,[...t]),l.select(0,0),e.remove();return}}let r=(0,b.$createQuoteNode)();r.append(...t),e.replace(r),r.select(0,0)}},lR=[lL([{ChildComponent:lE,isActive:({selection:e})=>{if(!(0,p.$isRangeSelection)(e))return!1;for(let t of e.getNodes())if(!(0,b.$isQuoteNode)(t)&&!(0,b.$isQuoteNode)(t.getParent()))return!1;return!0},key:"blockquote",label:({i18n:e})=>e.t("lexical:blockquote:label"),onSelect:({editor:e})=>{e.update(()=>{let e=(0,p.$getSelection)();(0,C.$setBlocksType)(e,()=>(0,b.$createQuoteNode)())})},order:20}])],lj=l_({markdownTransformers:[lM],nodes:[b.QuoteNode],slashMenu:{groups:[ly([{Icon:lE,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:e})=>e.t("lexical:blockquote:label"),onSelect:({editor:e})=>{e.update(()=>{let e=(0,p.$getSelection)();(0,C.$setBlocksType)(e,()=>(0,b.$createQuoteNode)())})}}])]},toolbarFixed:{groups:lR},toolbarInline:{groups:lR}}),lI=()=>(0,m.jsxs)("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:[(0,m.jsx)("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"8",y:"5"}),(0,m.jsx)("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"5",y:"11"}),(0,m.jsx)("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"11",y:"11"})]}),lF=()=>(0,m.jsx)("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:(0,m.jsx)("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"})});function lO(e,t){let{admin:l,imageAltText:n,imageURL:r}=e,o=l?.images,i,a;if(o?.icon?(i="string"==typeof o.icon?o.icon:o.icon.url,a="string"==typeof o.icon?void 0:o.icon.alt):o?.thumbnail?(i="string"==typeof o.thumbnail?o.thumbnail:o.thumbnail.url,a="string"==typeof o.thumbnail?void 0:o.thumbnail.alt):(i=r,a=n),!i)return t;let s=a??"Block Image";return()=>(0,m.jsx)("img",{alt:s,className:"lexical-block-custom-image",src:i,style:{maxHeight:20,maxWidth:20}})}function lD({propsString:e}){let t={},l="",n=!0;for(let r=0;r<e.length;r++){let o=e[r];if(n)"="===o||" "===o?l&&(" "===o?(t[l]=!0,l=""):n=!1):l+=o;else{let o=function(e,t){let l=e[t];return'"'===l?lP(e,t):"'"===l?lP(e,t,!0):"{"===l?function(e,t){var l;let n=1,r="",o=t+1;for(;o<e.length&&n>0;)"{"===e[o]?n++:"}"===e[o]&&n--,n>0&&(r+=e[o]),o++;return{newIndex:o,value:"{"!==(l=r)[0]?_.parse(l):_.parse(l.replace(/(\w+):/g,'"$1":'))}}(e,t):"["===l?function(e,t){let l=1,n="",r=t+1;for(;r<e.length&&l>0;)"["===e[r]?l++:"]"===e[r]&&l--,l>0&&(n+=e[r]),r++;return{newIndex:r,value:_.parse(`[${n}]`)}}(e,t):function(e,t){let l="",n=t;for(;n<e.length&&" "!==e[n];)l+=e[n],n++;return{newIndex:n-1,value:l}}(e,t)}(e,r);t[l]=o.value,r=o.newIndex,l="",n=!0}}return l&&(t[l]=!0),t}function lP(e,t,l=!1){let n="",r=t+1;for(;r<e.length&&(e[r]!==(l?"'":'"')||"\\"===e[r-1]);)n+=e[r],r++;return{newIndex:r,value:n}}function lA({props:e}){let t=[];for(let[l,n]of Object.entries(e))"string"==typeof n?t.push(`${l}="${n.replace(/"/g,""")}"`):"number"==typeof n?t.push(`${l}={${n}}`):"boolean"==typeof n?n&&t.push(`${l}`):null!==n&&"object"==typeof n&&(Array.isArray(n)?t.push(`${l}={[${n.map(e=>JSON.stringify(e,lB)).join(", ")}]}`):t.push(`${l}={${JSON.stringify(n,lB)}}`));return t.join(" ")}function lB(e,t){return"string"==typeof t?t.replace(/'/g,"\\'"):t}function lH({isEndOptional:e,lines:t,regexpEndRegex:l,startLineIndex:n,startMatch:r,trimChildren:o}){let i="",a="",s=t.slice(n),c=!1,u=0,d=0,f=null,h=!1,p=0,g=s[0].slice(0,r.index),m=0,b=n;e:for(let[n,g]of s.entries()){let C=o?g.trim():g,x=0;if(o)for(let e=0;e<g.length&&" "===g[e];e++)x++;let y=0;for(0===n&&(y=(r.index??0)+r[0].length-x);y<C.length;){let e=C[y],t=C[y+1];if(c){if("`"===e&&p++,p%2==0)if("<"===e&&"/"===t){if(--u<0){a[a.length-1]===`
|
||
`&&(a=a.slice(0,-1)),b=n;for(let e=y;e<C.length;e++)if(">"===C[e]){m=e+1;break}break e}}else if("/"===e&&">"===t){if(--u<0){a[a.length-1]===`
|
||
`&&(a=a.slice(0,-1)),b=n,m=y+2;break e}}else"<"===e&&"/"!==t&&u++;a+=e}else{if("{"!==e||f?"}"!==e||f?'"'!==e&&"'"!==e||f?e===f&&(f=null):f=e:d--:d++,"/"!==e||">"!==t||0!==d||f){if(">"===e&&0===d&&!f){c=!0,y++;continue}}else{h=!0,b=n,m=y+2;break e}i+=e}y++}if(c?a?.length>0&&n>0&&(a+=`
|
||
`):i+=`
|
||
`,l&&u<0){let e=C.match(l);if(e?.index!==void 0){b=n,m=e.index+e[0].length-1;break}}if(n===s.length-1&&!e&&!h)throw Error("End match not found for lines "+t.join(`
|
||
`)+`
|
||
|
||
. Start match: `+JSON.stringify(r))}return{afterEndLine:s[b].trim().slice(m),beforeStartLine:g,content:a,endLineIndex:n+b,endlineLastCharIndex:m,propsString:i}}var lz=class extends f{__cacheBuster;__fields;constructor({cacheBuster:e,fields:t,format:l,key:n}){super(l,n),this.__fields=t,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){var t;1===e.version&&(e={...e,fields:{...e.fields.data},version:2});let l=(t=e.fields,(0,p.$applyNodeReplacement)(new lz({fields:{...t,id:t?.id||new V.default.default().toHexString()}})));return l.setFormat(e.format),l}static isInline(){return!1}createDOM(e){let t=document.createElement("div");return(0,p.addClassNamesToElement)(t,e?.theme?.block),t}decorate(e,t){return null}exportDOM(){let e=document.createElement("div"),t=document.createTextNode(this.getTextContent());return e.append(t),{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,t){let l=this.getWritable();l.__fields=e,t||l.__cacheBuster++}},lK=(0,g.createContext)({baseClass:"LexicalEditorTheme__block",BlockCollapsible:()=>null,BlockDrawer:()=>null,CustomBlock:null,EditButton:()=>null,errorCount:0,formSchema:[],initialState:!1,nodeKey:"",RemoveButton:()=>null}),lU=()=>g.default.use(lK),lV=e=>{let t=(0,c.c)(4),{Collapsible:l,...n}=e,{BlockDrawer:r,CustomBlock:o,errorCount:i,formSchema:a}=n,s=(0,G.useFormSubmitted)()&&i>0,u=(0,W.useLexicalEditable)(),d;t[0]!==l||t[1]!==i||t[2]!==s?(d=e=>{let{children:t,...n}=e;return(0,m.jsx)(l,{errorCount:i,fieldHasErrors:s,...n,children:t})},t[0]=l,t[1]=i,t[2]=s,t[3]=d):d=t[3];let f=d;return o?(0,m.jsxs)(lK,{value:{...n,BlockCollapsible:f},children:[o,(0,m.jsx)(r,{})]}):(0,m.jsx)(f,{children:(0,m.jsx)(G.RenderFields,{fields:a,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!u})})},lW=e=>{let{cacheBuster:t,className:l,formData:n,nodeKey:r}=e,i=(0,G.useFormSubmitted)(),{id:a,collectionSlug:c,globalSlug:d}=(0,G.useDocumentInfo)(),{fieldProps:{featureClientSchemaMap:f,field:h,initialLexicalFormState:b,schemaPath:C},uuid:y}=(0,s.b)(),{fields:v}=(0,G.useDocumentForm)(),_=(0,g.useRef)(new AbortController),S=(0,G.useEditDepth)(),[N,w]=g.default.useState(0),{config:k}=(0,J.useConfig)(),T=(0,G.formatDrawerSlug)({slug:`lexical-blocks-create-${y}-${n.id}`,depth:S}),{toggleDrawer:E}=(0,o.a)(T),{getDocPreferences:$,setDocFieldPreferences:L}=(0,G.useDocumentInfo)(),[M]=(0,u.useLexicalComposerContext)(),R=(0,W.useLexicalEditable)(),j=n.blockType,{getFormState:I}=(0,G.useServerFunctions)(),F=`${C}.lexical_internal_feature.blocks.lexical_blocks.${j}.fields`,[O,D]=g.default.useState(()=>{let e=b?.[n.id]?.formState;if(!e)return!1;let t=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,e in n?{...t,initialValue:n[e],value:n[e]}:t]));return t.blockName={initialValue:n.blockName,passesCondition:!0,valid:!0,value:n.blockName},t}),P=(0,g.useRef)(!1),A=(0,g.useRef)(t);(0,g.useEffect)(()=>{P.current?(A.current!==t&&D(!1),A.current=t):P.current=!0},[t]);let[B,H]=g.default.useState(O?._components?.customComponents?.BlockLabel??void 0),[z,K]=g.default.useState(O?._components?.customComponents?.Block??void 0);(0,g.useEffect)(()=>{let e=new AbortController;return n&&!O&&(async()=>{let{state:t}=await I({id:a,collectionSlug:c,data:n,docPermissions:{fields:!0},docPreferences:await $(),documentFormState:(0,Z.deepCopyObjectSimpleWithoutReactComponents)(v,{excludeFiles:!0}),globalSlug:d,initialBlockData:n,operation:"update",readOnly:!R,renderAllFields:!0,schemaPath:F,signal:e.signal});if(t){t.blockName={initialValue:n.blockName,passesCondition:!0,valid:!0,value:n.blockName};let e=(0,q.reduceFieldsToValues)((0,Z.deepCopyObjectSimpleWithoutReactComponents)(t,{excludeFiles:!0}),!0);M.update(()=>{let t=(0,p.$getNodeByKey)(r);t&&lY(t)&&(e.blockType=j,t.setFields(e,!0))}),D(t),H(t._components?.customComponents?.BlockLabel??void 0),K(t._components?.customComponents?.Block??void 0)}})(),()=>{(0,X.abortAndIgnore)(e)}},[I,F,R,a,n,M,r,O,c,d,$,v,j]);let[U,V]=g.default.useState(b?.[n.id]?.collapsed??!1),ee=`${C}.lexical_internal_feature.blocks.lexical_blocks.${j}`,et=f.blocks?.[ee]?.[0],el=et.blockReferences?"string"==typeof et?.blockReferences?.[0]?k.blocksMap[et?.blockReferences?.[0]]:et?.blockReferences?.[0]:et?.blocks?.[0],{i18n:en,t:er}=(0,Y.useTranslation)(),eo=(0,g.useCallback)(async({formState:e,submit:t})=>{(0,X.abortAndIgnore)(_.current);let l=new AbortController;_.current=l;let{state:n}=await I({id:a,collectionSlug:c,docPermissions:{fields:!0},docPreferences:await $(),documentFormState:(0,Z.deepCopyObjectSimpleWithoutReactComponents)(v,{excludeFiles:!0}),formState:e,globalSlug:d,initialBlockFormState:e,operation:"update",readOnly:!R,renderAllFields:!!t,schemaPath:F,signal:l.signal});if(!n)return e;e.blockName&&(n.blockName=e.blockName);let o=(0,q.reduceFieldsToValues)(function({fields:e}){for(let t in e){let l=e[t];Array.isArray(l?.rows)&&"value"in l&&(l.disableFormData=!0)}return e}({fields:(0,Z.deepCopyObjectSimpleWithoutReactComponents)(n,{excludeFiles:!0})}),!0);if(setTimeout(()=>{M.update(()=>{let e=(0,p.$getNodeByKey)(r);e&&lY(e)&&(o.blockType=j,e.setFields(o,!0))})},0),t){H(n._components?.customComponents?.BlockLabel??void 0),K(n._components?.customComponents?.Block??void 0);let e=0;for(let t of Object.values(n))t?.valid===!1&&e++;w(e)}return n},[I,a,c,$,d,F,j,v,R,M,r]);(0,g.useEffect)(()=>()=>{(0,X.abortAndIgnore)(_.current)},[]);let ei=(0,g.useCallback)(()=>{M.update(()=>{(0,p.$getNodeByKey)(r)?.remove()})},[M,r]),ea=el?.labels?.singular?(0,x.getTranslation)(el.labels.singular,en):el?.slug,es=(0,g.useCallback)(e=>{$().then(t=>{let l=t?.fields?.[h.name]?.collapsed,r=l&&l?.length?l:[];e?r.includes(n.id)||r.push(n.id):r.includes(n.id)&&r.splice(r.indexOf(n.id),1),L(h.name,{collapsed:r,hello:"hi"})})},[$,h.name,L,n.id]),ec=(0,g.useMemo)(()=>()=>(0,m.jsx)(G.Button,{buttonStyle:"icon-label",className:`${l}__editButton`,disabled:!R,el:"button",icon:"edit",onClick:e=>(e.preventDefault(),e.stopPropagation(),E(),!1),onMouseDown:e=>{e.preventDefault()},round:!0,size:"small",tooltip:er("lexical:blocks:inlineBlocks:edit",{label:ea})}),[l,R,er,ea,E]),eu=(0,g.useMemo)(()=>()=>(0,m.jsx)(G.Button,{buttonStyle:"icon-label",className:`${l}__removeButton`,disabled:!R,icon:"x",onClick:e=>{e.preventDefault(),ei()},round:!0,tooltip:"Remove Block"}),[l,R,ei]),ed=(0,g.useMemo)(()=>({Actions:e,children:t,className:n,collapsibleProps:r,disableBlockName:o,editButton:i,errorCount:a,fieldHasErrors:s,Label:c,Pill:u,removeButton:d})=>(0,m.jsx)("div",{className:`${l}__container ${l}-${j}`,children:(0,m.jsx)(G.Collapsible,{className:[`${l}__row`,s?`${l}__row--has-errors`:`${l}__row--no-errors`,n].filter(Boolean).join(" "),collapsibleStyle:s?"error":"default",header:(0,m.jsxs)("div",{className:`${l}__block-header`,children:["u">typeof c?c:"u">typeof B?B:(0,m.jsxs)("div",{className:`${l}__block-label`,children:["u">typeof u?u:(0,m.jsx)(G.Pill,{className:`${l}__block-pill ${l}__block-pill-${j}`,pillStyle:"white",size:"small",children:ea??j}),!o&&!el?.admin?.disableBlockName&&(0,m.jsx)(G.SectionTitle,{path:"blockName",readOnly:!R}),s&&(0,m.jsx)(G.ErrorPill,{count:a??0,i18n:en,withMessage:!0})]}),(0,m.jsx)("div",{className:`${l}__block-actions`,children:"u">typeof e?e:(0,m.jsxs)(m.Fragment,{children:[z&&!1!==i||!z&&i?(0,m.jsx)(ec,{}):null,!1!==d&&R?(0,m.jsx)(eu,{}):null]})})]}),isCollapsed:U,onToggle:e=>{es(e),V(e)},...r||{},children:t},0)}),[z,B,ec,eu,ea,l,el?.admin?.disableBlockName,j,en,U,es,R]),ef=n?.id,eh=(0,g.useMemo)(()=>()=>(0,m.jsx)(G.EditDepthProvider,{children:(0,m.jsx)(G.Drawer,{className:"",slug:T,title:er(`lexical:blocks:inlineBlocks:${ef?"edit":"create"}`,{label:ea??er("lexical:blocks:inlineBlocks:label")}),children:O?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(G.RenderFields,{fields:el?.fields??[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:F,permissions:!0,readOnly:!R}),(0,m.jsx)(G.FormSubmit,{programmaticSubmit:!0,children:er("fields:saveChanges")})]}):null})}),[O,T,ef,ea,er,R,el?.fields,F]),ep=(0,g.useMemo)(()=>O?(0,m.jsx)(G.Form,{beforeSubmit:[async({formState:e})=>await eo({formState:e,submit:!0})],el:"div",fields:el?.fields??[],initialState:O,onChange:[eo],onSubmit:(e,t)=>{t.blockType=j,M.update(()=>{let e=(0,p.$getNodeByKey)(r);e&&lY(e)&&e.setFields(t,!0)}),E()},submitted:i,uuid:(0,Q.v4)(),children:(0,m.jsx)(lV,{baseClass:l,BlockDrawer:eh,Collapsible:ed,CustomBlock:z,EditButton:ec,errorCount:N,formSchema:el?.fields??[],initialState:O,nodeKey:r,RemoveButton:eu})}):null,[ed,eh,z,j,eu,ec,l,M,N,E,el?.fields,O,r,eo,i]);return el?ep:(0,m.jsx)(ed,{disableBlockName:!0,fieldHasErrors:!0,children:(0,m.jsxs)("div",{className:`${l}-not-found`,children:["Error: Block '",j,"' not found in the config but exists in the lexical data"]})})},lG=class extends lz{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){1===e.version&&(e={...e,fields:{...e.fields.data},version:2});let t=lJ(e.fields);return t.setFormat(e.format),t}decorate(e,t){return(0,m.jsx)(lW,{cacheBuster:this.getCacheBuster(),className:t.theme.block??"LexicalEditorTheme__block",formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function lJ(e){return(0,p.$applyNodeReplacement)(new lG({fields:{...e,id:e?.id||new V.default.default().toHexString()}}))}function lY(e){return e instanceof lG}function lX(e,t){return({editorState:l})=>{let n=ee({nodes:e});try{n.setEditorState(n.parseEditorState(l))}catch(e){console.error("getLexicalToMarkdown: ERROR parsing editor state",e)}let r="";return n.getEditorState().read(()=>{r=(0,a.c)(t)}),r}}function lZ(e,t){return({markdown:l})=>{let n=ee({nodes:e});return n.update(()=>{(0,a.b)(l,t)},{discrete:!0}),n.getEditorState().toJSON()}}function lq(e,t){let n;if(!e.jsx)return null;let r=(n=e.slug.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),{regExpEnd:RegExp(`</(${n})\\s*>|<${n}[^>]*?/>`,"i"),regExpStart:RegExp(`<(${n})([^>]*?)\\s*(/?)>`,"i")}),o=[];return t?o.push(({allNodes:t,allTransformers:n})=>({type:"text-match",dependencies:[l.c],export:r=>{if(!(0,l.e)(r)||r.getFields()?.blockType?.toLowerCase()!==e.slug.toLowerCase())return null;let o=r.getFields(),i=lX(t,n),a=e.jsx.export({fields:o,lexicalToMarkdown:i});if(!1===a)return null;if("string"==typeof a)return a;let s=a.props&&Object.keys(a.props)?.length>0,c=a.props??{};return a?.children?.length?`<${o.blockType}${s?" "+lA({props:c}):""}>${a.children}</${o.blockType}>`:`<${o.blockType}${s?" "+lA({props:c}):""}/>`},getEndIndex:(e,t)=>{let{endlineLastCharIndex:l}=lH({isEndOptional:!1,lines:[e.getTextContent()],regexpEndRegex:r.regExpEnd,startLineIndex:0,startMatch:t,trimChildren:!1});return l},importRegExp:e.jsx?.customStartRegex??r.regExpStart,regExp:/___ignoreignoreignore___/g,replace(o,i){let{content:a,propsString:s}=lH({isEndOptional:!1,lines:[o.getTextContent()],regexpEndRegex:r.regExpEnd,startLineIndex:0,startMatch:{...i,index:0},trimChildren:!1});if(!e?.jsx?.import)return;let c=lZ(t,n),u=e.jsx.import({children:a,closeMatch:null,htmlToLexical:null,markdownToLexical:c,openMatch:i,props:s?lD({propsString:s}):{}});if(!1===u)return;let d=(0,l.d)({blockType:e.slug,...u});o.replace(d)}})):o.push(({allNodes:t,allTransformers:l})=>({dependencies:[lG],export:n=>{if(!lY(n)||n.getFields()?.blockType?.toLowerCase()!==e.slug.toLowerCase())return null;let r=n.getFields(),o=lX(t,l),i=e.jsx.export({fields:r,lexicalToMarkdown:o});if(!1===i)return null;if("string"==typeof i)return i;let a=i.props&&Object.keys(i.props)?.length>0,s=i.props??{};if(i?.children?.length){let t=i.children,l="";if(t.includes(`
|
||
`))for(let n of t.split(`
|
||
`)){let t="";e?.jsx?.doNotTrimChildren||""===n||(t=" "),t+=n+`
|
||
`,l+=t}else l=(e?.jsx?.doNotTrimChildren?"":" ")+t+`
|
||
`;return`<${r.blockType}${a?" "+lA({props:s}):""}>
|
||
${l}</${r.blockType}>`}return`<${r.blockType}${a?" "+lA({props:s}):""}/>`},handleImportAfterStartMatch:e.jsx?.customEndRegex?void 0:({lines:n,rootNode:r,startLineIndex:o,startMatch:i,transformer:a})=>{let s="object"==typeof a.regExpEnd&&"regExp"in a.regExpEnd?a.regExpEnd.regExp:a.regExpEnd,{afterEndLine:c,beforeStartLine:u,content:d,endLineIndex:f,propsString:h}=lH({isEndOptional:a.regExpEnd&&"object"==typeof a.regExpEnd&&"optional"in a.regExpEnd?a.regExpEnd.optional:!a.regExpEnd,lines:n,regexpEndRegex:s,startLineIndex:o,startMatch:i,trimChildren:!1}),g="";if(e?.jsx?.doNotTrimChildren)g=d.endsWith(`
|
||
`)?d.slice(0,-1):d;else if(d.includes(`
|
||
`)){let e=d.split(`
|
||
`),t=0;for(let l of e){if(t++,l.startsWith(" "))g+=l.slice(2);else if(""===l)g+=l;else{g=d.endsWith(`
|
||
`)?d.slice(0,-1):d;break}g+=t===e.length?"":`
|
||
`}}else g=(d.startsWith(" ")?d.slice(2):d)+`
|
||
`;if(!e?.jsx?.import)return[!1,o];let m=lZ(t,l),b=e.jsx.import({children:g,closeMatch:null,htmlToLexical:null,markdownToLexical:m,openMatch:i,props:h?lD({propsString:h}):{}});if(!1===b)return[!1,o];let C=lJ({blockType:e.slug,...b});if(C){let e=null,t=null;if(u?.length){e=m({markdown:u})?.root?.children??[];let t=e?.[0];t&&r.append((0,p.$parseSerializedNode)(t))}if(r.append(C),c?.length){t=m({markdown:c})?.root?.children;let e=r.getChildren()[r.getChildren().length-1],l=(0,p.$parseSerializedNode)(t[0])?.getChildren();if(l?.length)for(let t of l)e.append(t)}}return[!0,f]},regExpEnd:e.jsx?.customEndRegex??r.regExpEnd,regExpStart:e.jsx?.customStartRegex??r.regExpStart,type:"multiline-element",replace:(n,r,o,i,a)=>{if(e?.jsx?.import){if(!a){let e="";if(r)for(let t of r)e+=t.getTextContent();a=[e]}let s="";s=e?.jsx?.doNotTrimChildren?a.join(`
|
||
`):a.join(`
|
||
`).trim();let c=o[1]?.trim(),u=lZ(t,l),d=e.jsx.import({children:s,closeMatch:i,htmlToLexical:null,markdownToLexical:u,openMatch:o,props:c?lD({propsString:c}):{}});if(!1===d)return!1;let f=lJ({blockType:e.slug,...d});return void(f&&n.append(f))}return!1}})),o}var lQ=(0,p.createCommand)("INSERT_BLOCK_COMMAND"),l0=(0,p.createCommand)("INSERT_INLINE_BLOCK_COMMAND"),l1=()=>{let e,t=(0,c.c)(12),[n]=(0,u.useLexicalComposerContext)(),[r,i]=(0,g.useState)(null),{setCreatedInlineBlock:a,uuid:d}=(0,s.b)(),f=(0,G.useEditDepth)(),h="lexical-inlineBlocks-create-"+d,m;t[0]!==f||t[1]!==h?(m=(0,G.formatDrawerSlug)({slug:h,depth:f}),t[0]=f,t[1]=h,t[2]=m):m=t[2];let b=m,{toggleDrawer:C}=(0,o.a)(b,!0),x;return t[3]!==n||t[4]!==a||t[5]!==r?(x=()=>{if(!n.hasNodes([lG]))throw Error("BlocksPlugin: BlocksNode not registered on editor");return(0,p.mergeRegister)(n.registerCommand(lQ,e=>(n.update(()=>{let t=(0,p.$getSelection)()||(0,p.$getPreviousSelection)();if((0,p.$isRangeSelection)(t)){let l=lJ(e),{focus:n}=t,r=n.getNode();(0,et.$insertNodeToNearestRoot)(l),(0,p.$isParagraphNode)(r)&&!r.__first&&r.remove()}}),!0),p.COMMAND_PRIORITY_EDITOR),n.registerCommand(l0,e=>{if(r){let t=(0,p.$getNodeByKey)(r);return!!t&&!!(0,l.e)(t)&&(t.setFields(e),i(null),!0)}let t=(0,l.d)(e);return a?.(t),(0,p.$insertNodes)([t]),(0,p.$isRootOrShadowRoot)(t.getParentOrThrow())&&(0,et.$wrapNodeInElement)(t,p.$createParagraphNode).selectEnd(),!0},p.COMMAND_PRIORITY_EDITOR))},t[3]=n,t[4]=a,t[5]=r,t[6]=x):x=t[6],t[7]!==n||t[8]!==a||t[9]!==r||t[10]!==C?(e=[n,a,r,C],t[7]=n,t[8]=a,t[9]=r,t[10]=C,t[11]=e):e=t[11],(0,g.useEffect)(x,e),null},l2=l_(({config:e,featureClientSchemaMap:t,props:n,schemaPath:r})=>{let o=`${r}.lexical_internal_feature.blocks.lexical_blocks`,i=`${r}.lexical_internal_feature.blocks.lexical_inline_blocks`,a=t.blocks;if(!a)return{};let s=Object.entries(a).filter(([e])=>e.startsWith(o+".")&&!e.replace(o+".","").includes(".")).map(([,e])=>e[0]),c=Object.entries(a).filter(([e])=>e.startsWith(i+".")&&!e.replace(i+".","").includes(".")).map(([,e])=>e[0]),u=s.map(t=>t.blockReferences?"string"==typeof t.blockReferences[0]?e.blocksMap[t.blockReferences[0]]:t.blockReferences[0]:t.blocks[0]).filter(e=>void 0!==e),d=c.map(t=>t.blockReferences?"string"==typeof t.blockReferences[0]?e.blocksMap[t.blockReferences[0]]:t.blockReferences[0]:t.blocks[0]).filter(e=>void 0!==e);return{markdownTransformers:(({blocks:e,inlineBlocks:t})=>{if(!e?.length&&!t?.length)return[];let l=[];if(e?.length)for(let t of e){let e=lq(t,!1);e&&(l=l.concat(e))}if(t?.length)for(let e of t){let t=lq(e,!0);t&&(l=l.concat(t))}return l})({blocks:u,inlineBlocks:d}),nodes:[lG,l.c],plugins:[{Component:l1,position:"normal"}],sanitizedClientFeatureProps:n,slashMenu:{groups:[u?.length?{items:u.map(e=>({Icon:lO(e,lI),key:"block-"+e.slug,keywords:["block","blocks",e.slug],label:({i18n:t})=>e?.labels?.singular?(0,x.getTranslation)(e.labels.singular,t):e?.slug,onSelect:({editor:t})=>{t.dispatchCommand(lQ,{blockName:"",blockType:e.slug})}})),key:"blocks",label:({i18n:e})=>e.t("lexical:blocks:label")}:null,d?.length?{items:d.map(e=>({Icon:lF,key:"inlineBlocks-"+e.slug,keywords:["inlineBlock","inline block",e.slug],label:({i18n:t})=>e?.labels?.singular?(0,x.getTranslation)(e.labels.singular,t):e?.slug,onSelect:({editor:t})=>{t.dispatchCommand(l0,{blockName:"",blockType:e.slug})}})),key:"inlineBlocks",label:({i18n:e})=>e.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[u.length?{type:"dropdown",ChildComponent:lI,items:u.map((e,t)=>({ChildComponent:lO(e,lI),isActive:void 0,key:"block-"+e.slug,label:({i18n:t})=>e?.labels?.singular?(0,x.getTranslation)(e.labels.singular,t):e?.slug,onSelect:({editor:t})=>{t.dispatchCommand(lQ,{blockName:"",blockType:e.slug})},order:t})),key:"blocks",order:20}:null,d?.length?{type:"dropdown",ChildComponent:lF,items:d.map((e,t)=>({ChildComponent:lO(e,lF),isActive:void 0,key:"inlineBlock-"+e.slug,label:({i18n:t})=>e?.labels?.singular?(0,x.getTranslation)(e.labels.singular,t):e?.slug,onSelect:({editor:t})=>{t.dispatchCommand(l0,{blockName:"",blockType:e.slug})},order:t})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}}),l3=a.d&&"documentMode"in document?document.documentMode:null,l6=a.d&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);a.d&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),a.d&&"InputEvent"in window&&!l3&&new window.InputEvent("input"),a.d&&/Version\/[\d.].*Safari/.test(navigator.userAgent),a.d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,a.d&&/Android/.test(navigator.userAgent),a.d&&/Win/.test(navigator.platform),a.d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),a.d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);var l5=e=>{let t=((e,t)=>{switch(e){case"click":return` await page.mouse.click(${t.x}, ${t.y});`;case"keydown":return` await page.keyboard.keydown('${t}');`;case"keyup":return` await page.keyboard.keyup('${t}');`;case"press":return` await page.keyboard.press('${t}');`;case"selectAll":return" await selectAll(page);";case"snapshot":return` await assertHTMLSnapshot(page);
|
||
await assertSelection(page, {
|
||
anchorPath: [${t.anchorPath.toString()}],
|
||
anchorOffset: ${t.anchorOffset},
|
||
focusPath: [${t.focusPath.toString()}],
|
||
focusOffset: ${t.focusOffset},
|
||
});
|
||
`;case"type":return` await page.keyboard.type('${t}');`;default:return""}})(e.name,e.value);switch(e.count){case 1:return t;case 2:return[t,t].join(`
|
||
`);default:return` await repeat(${e.count}, async () => {
|
||
${t}
|
||
);`}};function l4(e,t){let l=e,n=[];for(;l!==t;)null!=l&&n.unshift(Array.from(l?.parentNode?.childNodes??[]).indexOf(l)),l=l?.parentNode;return n}var l7=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Delete","Enter","Escape"]),l8=l_({plugins:[{Component:()=>{let e=(0,c.c)(3),[t]=(0,u.useLexicalComposerContext)(),[l,n]=function(e){let[t,l]=(0,g.useState)([]),[n,r]=(0,g.useState)(!1),[,o]=(0,g.useState)(""),[i,a]=(0,g.useState)(""),s=(0,g.useRef)(null),c=(0,g.useRef)(!1),u=(0,g.useRef)(null),d=(0,g.useCallback)(()=>e,[e]),f=(0,g.useCallback)(()=>{let l=e.getRootElement(),n=(0,p.getDOMSelection)(e._window);return null!=l&&null!=n&&null!=n.anchorNode&&null!=n.focusNode&&l.contains(n.anchorNode)&&l.contains(n.focusNode)?`
|
||
import {
|
||
initializeE2E,
|
||
assertHTMLSnapshot,
|
||
assertSelection,
|
||
repeat,
|
||
} from '../utils';
|
||
import {selectAll} from '../keyboardShortcuts';
|
||
import { RangeSelection } from 'lexical';
|
||
import { NodeSelection } from 'lexical';
|
||
|
||
describe('Test case', () => {
|
||
initializeE2E((e2e) => {
|
||
it('Should pass this test', async () => {
|
||
const {page} = e2e;
|
||
|
||
await page.focus('div[contenteditable="true"]');
|
||
${t.map(l5).join(`
|
||
`)}
|
||
});
|
||
});
|
||
`:null},[e,t]),h=(0,g.useCallback)((e,n)=>{l(l=>{let r=t.length-1,o=t[r];if(o&&o.name===e){if("type"===e)return[...t.slice(0,r),{...o,value:o.value+n}];if(o.value===n)return[...t.slice(0,r),{...o,count:o.count+1}]}return[...l,{name:e,count:1,value:n}]})},[t,l]);(0,g.useLayoutEffect)(()=>{let t=e=>{if(!n)return;let t=e.key;"a"===e.key.toLowerCase()&&(l6?e.metaKey:e.ctrlKey)?h("selectAll",""):l7.has(t)?h("press",e.key):[...t].length>1?h("keydown",e.key):h("type",e.key)},l=e=>{if(!n)return;let t=e.key;!l7.has(t)&&[...t].length>1&&h("keyup",e.key)};return e.registerRootListener((e,n)=>{null!==n&&(n.removeEventListener("keydown",t),n.removeEventListener("keyup",l)),null!==e&&(e.addEventListener("keydown",t),e.addEventListener("keyup",l))})},[e,n,h]),(0,g.useLayoutEffect)(()=>{u.current&&u.current.scrollTo(0,u.current.scrollHeight)},[f]),(0,g.useEffect)(()=>{if(t){let e=f();null!==e&&a(e),u.current&&u.current.scrollTo(0,u.current.scrollHeight)}},[f,t]),(0,g.useEffect)(()=>e.registerUpdateListener(({dirtyElements:t,dirtyLeaves:l,editorState:r})=>{if(!n)return;let o=r._selection,i=s.current,u=c.current;if(i!==o){if(0===l.size&&0===t.size&&!u){let t=(0,p.getDOMSelection)(e._window);if(t&&(null==t.anchorNode||null==t.focusNode))return}s.current=o}c.current=!1;let d=f();null!==d&&a(d)}),[e,f,n,h]),(0,g.useEffect)(()=>n?e.registerUpdateListener(()=>{let t=e.getRootElement();null!==t&&o(t?.innerHTML)}):void 0,[e,n]);let b=(0,g.useCallback)(e=>{n||(e.update(()=>{let e=(0,p.$getRoot)();e.clear();let t=(0,p.$createTextNode)();e.append((0,p.$createParagraphNode)().append(t)),t.select()}),l([])),r(e=>!e)},[n]),C=(0,g.useCallback)(()=>{let t;if(!n)return;let l=(0,p.getDOMSelection)(e._window);if(null===l||null==l.anchorNode||null==l.focusNode)return;let{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:a}=function(e){let{anchorNode:t,focusNode:l}=e,{anchorOffset:n,focusOffset:r}=e;return 0!==n&&n--,0!==r&&r--,{anchorNode:t,anchorOffset:n,focusNode:l,focusOffset:r}}(l),s=d().getRootElement(),c;null!==r&&(c=l4(r,s)),null!==i&&(t=l4(i,s)),h("snapshot",{anchorNode:r,anchorOffset:o,anchorPath:c,focusNode:i,focusOffset:a,focusPath:t})},[h,n,d]),x=(0,g.useCallback)(()=>{var e=f();let t=document.createElement("textarea");t.value=e||"",t.style.position="absolute",t.style.opacity="0",document.body?.appendChild(t),t.focus(),t.select();try{let e=document.execCommand("copy");console.log(e)}catch(e){console.error(e)}document.body?.removeChild(t)},[f]),y=(0,g.useCallback)(()=>{var e;let t;e=f(),(t=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e||"")),t.setAttribute("download","test.js"),t.style.display="none",document.body?.appendChild(t),t.click(),document.body?.removeChild(t)},[f]);return[(0,m.jsx)("button",{className:`editor-dev-button ${n?"active":""}`,id:"test-recorder-button",onClick:e=>{b(d()),e.preventDefault()},title:n?"Disable test recorder":"Enable test recorder",type:"button",children:n?"Disable test recorder":"Enable test recorder"}),n?(0,m.jsxs)("div",{className:"test-recorder-output",children:[(0,m.jsxs)("div",{className:"test-recorder-toolbar",children:[(0,m.jsx)("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:e=>{C(),e.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),(0,m.jsx)("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:e=>{x(),e.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),(0,m.jsx)("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:e=>{y(),e.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),(0,m.jsx)("pre",{id:"test-recorder",ref:u,children:i})]}):null]}(t),r;return e[0]!==l||e[1]!==n?(r=(0,m.jsxs)(g.Fragment,{children:[(0,m.jsx)("p",{children:"HI"}),l,n,(0,m.jsx)("p",{children:"DONE"})]}),e[0]=l,e[1]=n,e[2]=r):r=e[2],r},position:"bottom"}]}),l9=l_({plugins:[{Component:()=>{let e=(0,c.c)(2),[t]=(0,u.useLexicalComposerContext)(),l;return e[0]!==t?(l=(0,m.jsx)(la,{editor:t,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"}),e[0]=t,e[1]=l):l=e[1],l},position:"bottom"}]}),ne=e=>({type:"buttons",items:e,key:"format",order:40}),nt={type:"text-format",format:["bold","italic"],tag:"***"},nl={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},nn={type:"text-format",format:["bold"],tag:"**"},nr={type:"text-format",format:["bold"],intraword:!1,tag:"__"},no=[ne([{ChildComponent:()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),isActive:({selection:e})=>!!((0,p.$isRangeSelection)(e)||tu(e))&&e.hasFormat("bold"),key:"bold",onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_TEXT_COMMAND,"bold")},order:1}])],ni=l_(({featureProviderMap:e})=>{let t=[nn,nr];return e.get("italic")&&t.push(nl,nt),{enableFormats:["bold"],markdownTransformers:t,toolbarFixed:{groups:no},toolbarInline:{groups:no}}}),na=[ne([{ChildComponent:()=>(0,m.jsxs)("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:[(0,m.jsx)("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),(0,m.jsx)("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]}),isActive:({selection:e})=>!!((0,p.$isRangeSelection)(e)||tu(e))&&e.hasFormat("code"),key:"inlineCode",onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_TEXT_COMMAND,"code")},order:7}])],ns=l_({enableFormats:["code"],markdownTransformers:[{type:"text-format",format:["code"],tag:"`"}],toolbarFixed:{groups:na},toolbarInline:{groups:na}}),nc=[ne([{ChildComponent:()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),isActive:({selection:e})=>!!((0,p.$isRangeSelection)(e)||tu(e))&&e.hasFormat("italic"),key:"italic",onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_TEXT_COMMAND,"italic")},order:2}])],nu=l_({enableFormats:["italic"],markdownTransformers:[{type:"text-format",format:["italic"],tag:"*"},{type:"text-format",format:["italic"],intraword:!1,tag:"_"}],toolbarFixed:{groups:nc},toolbarInline:{groups:nc}}),nd=[ne([{ChildComponent:()=>(0,m.jsxs)("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:[(0,m.jsx)("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"}),(0,m.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),isActive:({selection:e})=>!!((0,p.$isRangeSelection)(e)||tu(e))&&e.hasFormat("strikethrough"),key:"strikethrough",onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_TEXT_COMMAND,"strikethrough")},order:4}])],nf=l_({enableFormats:["strikethrough"],markdownTransformers:[{type:"text-format",format:["strikethrough"],tag:"~~"}],toolbarFixed:{groups:nd},toolbarInline:{groups:nd}}),nh=[ne([{ChildComponent:()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),isActive:({selection:e})=>!!((0,p.$isRangeSelection)(e)||tu(e))&&e.hasFormat("subscript"),key:"subscript",onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_TEXT_COMMAND,"subscript")},order:5}])],np=l_({enableFormats:["subscript"],toolbarFixed:{groups:nh},toolbarInline:{groups:nh}}),ng=[ne([{ChildComponent:()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),isActive:({selection:e})=>!!((0,p.$isRangeSelection)(e)||tu(e))&&e.hasFormat("superscript"),key:"superscript",onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_TEXT_COMMAND,"superscript")},order:6}])],nm=l_({enableFormats:["superscript"],toolbarFixed:{groups:ng},toolbarInline:{groups:ng}}),nb=[ne([{ChildComponent:()=>(0,m.jsxs)("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:[(0,m.jsx)("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"}),(0,m.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),isActive:({selection:e})=>!!((0,p.$isRangeSelection)(e)||tu(e))&&e.hasFormat("underline"),key:"underline",onSelect:({editor:e})=>{e.dispatchCommand(p.FORMAT_TEXT_COMMAND,"underline")},order:3}])],nC=l_({enableFormats:["underline"],toolbarFixed:{groups:nb},toolbarInline:{groups:nb}}),nx=({css:e})=>{let t=e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),t])):{};return(0,m.jsx)("span",{style:{...t,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};function ny(e,t,l,n){e.update(()=>{(0,C.$forEachSelectedTextNode)(e=>{let r=t.get(l);if(!r)throw Error(`State config for ${l} not found`);(0,p.$setState)(e,r.stateConfig,n)})})}var nv=(e,t)=>{let l=[];for(let n in e.state){let r=e.state[n];for(let e in r){let o=r[e];l.push({ChildComponent:()=>(0,m.jsx)(nx,{css:o.css}),key:e,label:o.label,onSelect:({editor:l})=>{ny(l,t,n,e)}})}}return[{type:"dropdown",ChildComponent:()=>(0,m.jsx)(nx,{css:{color:"var(--theme-elevation-600)"}}),items:[{ChildComponent:()=>(0,m.jsx)(nx,{}),key:"clear-style",label:({i18n:e})=>e.t("lexical:textState:defaultStyle"),onSelect:({editor:l})=>{for(let n in e.state)ny(l,t,n,void 0)},order:1},...l],key:"textState",order:30}]},n_=l_(({props:e})=>{let t=function(e){let t=new Map;for(let l in e){let n=e[l],r=(0,p.createState)(l,{parse:e=>"string"==typeof e&&Object.keys(n).includes(e)?e:void 0});t.set(l,{stateConfig:r,stateValues:n})}return t}(e.state);return{plugins:[{Component:()=>(function({stateMap:e}){let[t]=(0,u.useLexicalComposerContext)();return(0,g.useEffect)(()=>t.registerMutationListener(p.TextNode,l=>{t.getEditorState().read(()=>{for(let[n,r]of l){if("destroyed"===r)continue;let l=(0,p.$getNodeByKey)(n),o=t.getElementByKey(n);if(!l||!o)continue;let i=Object.create(null);e.forEach((e,t)=>{let n=(0,p.$getState)(l,e.stateConfig);if(!n)return void delete o.dataset[t];o.dataset[t]=n;let r=e.stateValues[n]?.css;r&&Object.assign(i,r)}),o.style.cssText="",Object.assign(o.style,i)}})}),[t]),null})({stateMap:t}),position:"normal"}],toolbarFixed:{groups:nv(e,t)},toolbarInline:{groups:nv(e,t)}}}),nS=e=>(t,l,n)=>{let r=e(n);r&&(r.append(...l),t.replace(r),r.select(0,0))},nN=e=>{let t=(0,p.$getSelection)();(0,C.$setBlocksType)(t,()=>(0,b.$createHeadingNode)(e))},nw={h1:()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),h2:()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),h3:()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),h4:()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),h5:()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),h6:()=>(0,m.jsx)("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:(0,m.jsx)("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"})})},nk=l_(({props:e})=>{let t,{enabledHeadingSizes:l=["h1","h2","h3","h4","h5","h6"]}=e,n=[lL(l.map((e,t)=>({ChildComponent:nw[e],isActive:({selection:t})=>{if(!(0,p.$isRangeSelection)(t))return!1;for(let l of t.getNodes()){if((0,b.$isHeadingNode)(l)&&l.getTag()===e)continue;let t=l.getParent();if(!((0,b.$isHeadingNode)(t)&&t.getTag()===e))return!1}return!0},key:e,label:({i18n:t})=>t.t("lexical:heading:label",{headingLevel:e.charAt(1)}),onSelect:({editor:t})=>{t.update(()=>{nN(e)})},order:t+2})))];return{markdownTransformers:[(t=RegExp(`^(${l.map(e=>Number(e.slice(1))).map(e=>`#{${e}}`).join("|")})\\s`),{type:"element",dependencies:[b.HeadingNode],export:(e,t)=>{if(!(0,b.$isHeadingNode)(e))return null;let l=Number(e.getTag().slice(1));return"#".repeat(l)+" "+t(e)},regExp:t,replace:nS(e=>{let t="h"+e[1]?.length;return(0,b.$createHeadingNode)(t)})})],nodes:[b.HeadingNode],plugins:[{Component:nT,position:"normal"}],sanitizedClientFeatureProps:e,slashMenu:{groups:l?.length?[ly(l.map(e=>({Icon:nw[e],key:`heading-${e.charAt(1)}`,keywords:["heading",e],label:({i18n:t})=>t.t("lexical:heading:label",{headingLevel:e.charAt(1)}),onSelect:({editor:t})=>{t.update(()=>{nN(e)})}})))]:[]},toolbarFixed:{groups:l?.length?n:[]},toolbarInline:{groups:l?.length?n:[]}}}),nT=e=>{let t=(0,c.c)(9),{clientProps:l}=e,{enabledHeadingSizes:n}=l,r;t[0]!==n?(r=void 0===n?["h1","h2","h3","h4","h5","h6"]:n,t[0]=n,t[1]=r):r=t[1];let o=r,i;t[2]!==o?(i=o.at(-1),t[2]=o,t[3]=i):i=t[3];let a=i,[s]=(0,u.useLexicalComposerContext)(),d,f;return t[4]!==s||t[5]!==o||t[6]!==a?(d=()=>{if(!(!a||6===o.length))return s.registerNodeTransform(b.HeadingNode,e=>{o.includes(e.getTag())||e.setTag(a)})},f=[s,o,a],t[4]=s,t[5]=o,t[6]=a,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,g.useEffect)(d,f),null},nE=()=>(0,m.jsx)("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:(0,m.jsx)("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})}),n$=()=>(0,m.jsxs)("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,m.jsx)("path",{d:"M5 10h10",stroke:"currentColor"}),(0,m.jsx)("path",{d:"M10 15V5",stroke:"currentColor"})]}),nL=e=>({type:"dropdown",ChildComponent:n$,items:e,key:"add",order:10}),nM=(0,p.createCommand)("INSERT_HORIZONTAL_RULE_COMMAND"),nR=class extends p.DecoratorNode{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:nj,priority:0})}}static importJSON(e){return nI()}createDOM(e){let t=document.createElement("hr");return(0,p.addClassNamesToElement)(t,e.theme.hr),t}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return`
|
||
`}isInline(){return!1}updateDOM(){return!1}};function nj(){return{node:nI()}}function nI(){return(0,p.$applyNodeReplacement)(new nR)}var nF=class extends nR{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return nO()}decorate(){return null}exportJSON(){return super.exportJSON()}};function nO(){return(0,p.$applyNodeReplacement)(new nF)}function nD(e){return e instanceof nF}function nP(e){let t=(0,p.$getSelection)();if(!(0,p.$isRangeSelection)(t))return!1;if(null!==t.focus.getNode()){let e=nO();(0,et.$insertNodeToNearestRoot)(e)}return!0}var nA=l_({markdownTransformers:[{type:"element",dependencies:[nF],export:(e,t)=>nD(e)?"---":null,regExp:/^---\s*$/,replace:e=>{let t=nO();t&&e.replace(t)}}],nodes:[nF],plugins:[{Component:()=>{let e=(0,c.c)(3),[t]=(0,u.useLexicalComposerContext)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(nM,nP,p.COMMAND_PRIORITY_EDITOR),n=[t],e[0]=t,e[1]=l,e[2]=n):(l=e[1],n=e[2]),(0,g.useEffect)(l,n),null},position:"normal"}],slashMenu:{groups:[ly([{Icon:nE,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:e})=>e.t("lexical:horizontalRule:label"),onSelect:({editor:e})=>{e.dispatchCommand(nM,void 0)}}])]},toolbarFixed:{groups:[nL([{ChildComponent:nE,isActive:({selection:e})=>!!(0,p.$isNodeSelection)(e)&&!!e.getNodes().length&&nD(e.getNodes()[0]),key:"horizontalRule",label:({i18n:e})=>e.t("lexical:horizontalRule:label"),onSelect:({editor:e})=>{e.dispatchCommand(nM,void 0)}}])]}}),nB=()=>(0,m.jsxs)("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:[(0,m.jsx)("path",{d:"M2.5 5H10.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M2.5 10H10.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M12.25 7.25L17.25 3.75V10.75L12.25 7.25Z",fill:"currentColor"})]}),nH=()=>(0,m.jsxs)("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:[(0,m.jsx)("path",{d:"M17.5 5H9.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M17.5 10H9.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M17.5 15H2.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M7.75 7.25L2.75 3.75V10.75L7.75 7.25Z",fill:"currentColor"})]}),nz=({clientProps:e})=>{let[t]=(0,u.useLexicalComposerContext)(),{disabledNodes:l,disableTabNode:n}=e;return(0,g.useEffect)(()=>{if(!(!t||!l?.length))return(0,p.mergeRegister)(t.registerCommand(p.INDENT_CONTENT_COMMAND,()=>(function(e){let t=(0,p.$getSelection)();if(!(0,p.$isRangeSelection)(t))return!1;let l=new Set,n=t.getNodes();for(let t=0;t<n.length;t++){let r=n[t],o=r.getKey();if(l.has(o))continue;let i=(0,p.$findMatchingParent)(r,e=>(0,p.$isElementNode)(e)&&!e.isInline());if(null===i)continue;let a=i.getKey();i.canIndent()&&!l.has(a)&&(l.add(a),e(i))}return l.size>0})(e=>{if(!l.includes(e.getType())){let t=e.getIndent();e.setIndent(t+1)}}),p.COMMAND_PRIORITY_LOW),t.registerUpdateListener(({dirtyElements:e,editorState:n})=>{t.update(()=>{for(let[t]of e){let e=n._nodeMap.get(t);(0,p.$isElementNode)(e)&&l.includes(e.getType())&&e.getIndent()>0&&e.setIndent(0)}})}))},[t,l]),(0,g.useEffect)(()=>{if(!(!t||!n))return(0,p.mergeRegister)(t.registerCommand(p.KEY_TAB_COMMAND,e=>(e.preventDefault(),t.dispatchCommand(e.shiftKey?p.OUTDENT_CONTENT_COMMAND:p.INDENT_CONTENT_COMMAND,void 0)),p.COMMAND_PRIORITY_LOW),t.registerNodeTransform(p.TabNode,e=>{e.remove()}))},[t,n]),(0,m.jsx)(ls,{})},nK=({disabledNodes:e})=>[{type:"buttons",items:[{ChildComponent:nB,isActive:()=>!1,isEnabled:({selection:e})=>{let t=e?.getNodes()??[],l=e=>nV(e)&&e.getIndent()>0;return t.some(e=>l(e)||!!(0,p.$findMatchingParent)(e,l))},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(p.OUTDENT_CONTENT_COMMAND,void 0)},order:1},{ChildComponent:nH,isActive:()=>!1,isEnabled:({selection:t})=>{let l=t?.getNodes()??[],n=t=>nV(t)&&!(e??[]).includes(t.getType());return l.some(e=>n(e)||!!(0,p.$findMatchingParent)(e,n))},key:"indentIncrease",label:({i18n:e})=>e.t("lexical:indent:increaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(p.INDENT_CONTENT_COMMAND,void 0)},order:2}],key:"indent",order:35}],nU=l_(({props:e})=>{let t=e.disabledNodes??[];return{plugins:[{Component:nz,position:"normal"}],sanitizedClientFeatureProps:e,toolbarFixed:{groups:nK({disabledNodes:t})},toolbarInline:{groups:nK({disabledNodes:t})}}}),nV=e=>(0,p.$isElementNode)(e)&&e.canIndent();function nW(e){let{anchor:t}=e,{focus:l}=e,n=e.anchor.getNode(),r=e.focus.getNode();return n===r?n:e.isBackward()?(0,C.$isAtNodeEnd)(l)?n:r:(0,C.$isAtNodeEnd)(t)?n:r}var nG=e=>({type:"buttons",items:e,key:"features",order:50}),nJ=new Set(["http:","https:","mailto:","sms:","tel:"]),nY=class extends p.ElementNode{__fields;__id;constructor({id:e,fields:t={linkType:"custom",newTab:!1},key:l}){super(l),this.__fields=t,this.__id=e}static clone(e){return new this({id:e.__id,fields:e.__fields,key:e.__key})}static getType(){return"link"}static importDOM(){return{a:e=>({conversion:nX,priority:1})}}static importJSON(e){let t=nZ({}).updateFromJSON(e);return 1===e.version&&"object"==typeof e.fields?.doc?.value&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),2!==e.version||e.id||(e.id=new V.default.default().toHexString(),e.version=3),t}canBeEmpty(){return!1}canInsertTextAfter(){return!1}canInsertTextBefore(){return!1}createDOM(e){let t=document.createElement("a");return this.__fields?.linkType==="custom"&&(t.href=this.sanitizeUrl(this.__fields.url??"")),this.__fields?.newTab&&(t.target="_blank"),this.__fields?.newTab===!0&&this.__fields?.linkType==="custom"&&(t.rel=n1(t.rel,"add","noopener")),(0,p.addClassNamesToElement)(t,e.theme.link),t}exportJSON(){let e=this.getFields();e?.linkType==="internal"?delete e.url:e?.linkType==="custom"&&delete e.doc;let t={...super.exportJSON(),type:"link",fields:e,version:3},l=this.getID();return l&&(t.id=l),t}extractWithChild(e,t,l){if(!(0,p.$isRangeSelection)(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&t.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(e,t=!0){let l=this.getParentOrThrow().insertNewAfter(e,t);if((0,p.$isElementNode)(l)){let e=nZ({fields:this.__fields});return l.append(e),e}return null}isInline(){return!0}sanitizeUrl(e){try{let t=new URL(e);if(!nJ.has(t.protocol))return"about:blank"}catch{return"https://"}return e}setFields(e){let t=this.getWritable();return t.__fields=e,t}setID(e){let t=this.getWritable();return t.__id=e,t}updateDOM(e,t,l){let n=this.__fields?.url,r=this.__fields?.newTab;return null!=n&&n!==e.__fields?.url&&this.__fields?.linkType==="custom"&&(t.href=n),this.__fields?.linkType==="internal"&&e.__fields?.linkType==="custom"&&t.removeAttribute("href"),null==t.rel&&(t.rel=""),r!==e.__fields?.newTab&&(r?(t.target="_blank",this.__fields?.linkType==="custom"&&(t.rel=n1(t.rel,"add","noopener"))):(t.removeAttribute("target"),t.rel=n1(t.rel,"remove","noopener"))),!1}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields).setID(e.id)}};function nX(e){let t=null;if((0,p.isHTMLAnchorElement)(e)){let l=e.textContent;null!==l&&""!==l&&(t=nZ({id:new V.default.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:"_blank"===e.getAttribute("target"),url:e.getAttribute("href")??""}}))}return{node:t}}function nZ({id:e,fields:t}){return(0,p.$applyNodeReplacement)(new nY({id:e??new V.default.default().toHexString(),fields:t}))}function nq(e){return e instanceof nY}var nQ=(0,p.createCommand)("TOGGLE_LINK_COMMAND");function n0(e){let t=(0,p.$getSelection)();if(!(0,p.$isRangeSelection)(t)&&(null===e||!e.selectedNodes?.length))return;let l=(0,p.$isRangeSelection)(t)?t.extract():null===e?[]:e.selectedNodes;if(null===e)return void l?.forEach(e=>{let t=e.getParent();nq(t)&&(t.getChildren().forEach(e=>{t.insertBefore(e)}),t.remove())});if(l?.length===1){let t=l[0],n=nq(t)?t:function(e){var t=e;let l=t;for(;null!==l&&!(null===(l=l.getParent())||(e=>nq(e))(l)););return l}(t);if(null!==n){n.setFields(e.fields),null!=e.text&&e.text!==n.getTextContent()&&(n.append((0,p.$createTextNode)(e.text)),n.getChildren().forEach(e=>{e!==n.getLastChild()&&e.remove()}));return}}let n=null,r=null;l?.forEach(t=>{let l=t.getParent();if(!(l===r||null===l||(0,p.$isElementNode)(t)&&!t.isInline())){if(nq(l)){r=l,l.setFields(e.fields),null!=e.text&&e.text!==l.getTextContent()&&(l.append((0,p.$createTextNode)(e.text)),l.getChildren().forEach(e=>{e!==l.getLastChild()&&e.remove()}));return}if(l.is(n)||(n=l,r=nZ({fields:e.fields}),nq(l)?null===t.getPreviousSibling()?l.insertBefore(r):l.insertAfter(r):t.insertBefore(r)),nq(t)){if(t.is(r))return;if(null!==r){let e=t.getChildren();r.append(...e)}t.remove();return}null!==r&&r.append(t)}})}function n1(e,t,l){let n,r=`${e}`;if("add"===t){if(r.includes(l)){let e=RegExp(l,"g");r=r.replace(e,"").trim()}n=0===(r=r.trim()).length?`${l}`:`${r} ${l}`}else{let e=RegExp(l,"g");n=r.replace(e,"").trim()}return n}var n2={type:"text-match",dependencies:[nY],export:(e,t)=>{if(!nq(e))return null;let{url:l}=e.getFields();return`[${t(e)}](${l})`},importRegExp:RegExp('(?<!!)\\[([^[]+)\\]\\(([^()\\s]+)(?:\\s"((?:[^"]*\\\\")*[^"]*)"\\s*)?\\)'),regExp:RegExp('(?<!!)\\[([^[]+)\\]\\(([^()\\s]+)(?:\\s"((?:[^"]*\\\\")*[^"]*)"\\s*)?\\)$'),replace:(e,t)=>{let[,l,n]=t,r=nZ({fields:{doc:null,linkType:"custom",newTab:!1,url:n}}),o=(0,p.$createTextNode)(l);return o.setFormat(e.getFormat()),r.append(o),e.replace(r),o},trigger:")"},n3=class extends nY{static clone(e){return new this({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){let t=n6({}).updateFromJSON(e);return 1===e.version&&"object"==typeof e.fields?.doc?.value&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),t}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,t=!0){let l=this.getParentOrThrow().insertNewAfter(e,t);if((0,p.$isElementNode)(l)){let e=n6({fields:this.__fields});return l.append(e),e}return null}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields)}};function n6({fields:e}){return(0,p.$applyNodeReplacement)(new n3({id:"",fields:e}))}function n5(e){return e instanceof n3}function n4(e,t=e=>e){return l=>{let n=e.exec(l);return null===n?null:{index:n.index,length:n[0].length,text:n[0],url:t(n[0])}}}function n7(e,t){for(let l of t){let t=l(e);if(null!=t)return t}return null}var n8=/[.,;\s]/;function n9(e){return void 0!==e&&n8.test(e)}function re(e){return n9(e[e.length-1])}function rt(e){let t=e.getPreviousSibling();return(0,p.$isElementNode)(t)&&(t=t.getLastDescendant()),null===t||(0,p.$isLineBreakNode)(t)||(0,p.$isTextNode)(t)&&re(t.getTextContent())}function rl(e){let t=e.getNextSibling();return(0,p.$isElementNode)(t)&&(t=t.getFirstDescendant()),null===t||(0,p.$isLineBreakNode)(t)||(0,p.$isTextNode)(t)&&n9(t.getTextContent()[0])}function rn(e,t,l){let n=e.getChildren(),r=n.length;for(let t=0;t<r;t++){let r=n[t];if(!(0,p.$isTextNode)(r)||!r.isSimpleText()){rr(e),l(null,e.getFields()?.url??null);return}}let o=e.getTextContent(),i=n7(o,t);if(null===i||i.text!==o||!rt(e)||!rl(e)){rr(e),l(null,e.getFields()?.url??null);return}let a=e.getFields()?.url;if(a!==i?.url){let t=e.getFields();t.url=i?.url,e.setFields(t),l(i.url,a??null)}}function rr(e){let t=e.getChildren(),l=t.length;for(let n=l-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map(e=>e.getLatest())}var ro=[n4(RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-\\w@:%.+~#=]{1,256}\\.[a-zA-Z\\d()]{1,6}\\b([-\\w()@:%+.~#?&/=]*)(?<![-.+():%])"),e=>e.startsWith("http")?e:`https://${e}`),n4(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,e=>`mailto:${e}`)],ri=()=>{let e,t,l,[n]=(0,u.useLexicalComposerContext)();return(e=(0,c.c)(5))[0]!==n||e[1]!==ro||void 0!==e[2]?(t=()=>{if(!n.hasNodes([n3]))throw Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let e=(e,t)=>{};return(0,p.mergeRegister)(n.registerNodeTransform(p.TextNode,t=>{let l=t.getParentOrThrow(),n=t.getPreviousSibling();n5(l)?rn(l,ro,e):nq(l)||(t.isSimpleText()&&(n9(t.getTextContent()[0])||!n5(n))&&function(e,t,l){let n=[...e],r=n.map(e=>e.getTextContent()).join(""),o=r,i,a=0;for(;null!=(i=n7(o,t))&&null!==i;){var s,c,u;let e=i.index,t=e+i.length;if(s=a+e,c=a+t,u=n,(s>0?!!n9(r[s-1]):!!rt(u[0]))&&(c<r.length?n9(r[c]):rl(u[u.length-1]))){let[r,,o,s]=function(e,t,l){let n=[],r=[],o=[],i=0,a=0,s=[...e];for(;s.length>0;){let e=s[0],c=e.getTextContent().length,u=a;a+c<=t?(n.push(e),i+=c):u>=l?o.push(e):r.push(e),a+=c,s.shift()}return[i,n,r,o]}(n,a+e,a+t),c=function(e,t,l,n){let r=n6({fields:{linkType:"custom",url:n.url,...n.fields}});if(1===e.length){let o=e[0],i;if(0===t?[i]=o.splitText(l):[,i]=o.splitText(t,l),i){let e=(0,p.$createTextNode)(n.text);e.setFormat(i.getFormat()),e.setDetail(i.getDetail()),e.setStyle(i.getStyle()),r.append(e),i.replace(r)}return o}if(e.length>1){let n=e[0],o=n.getTextContent().length,i;0===t?i=n:[,i]=n.splitText(t);let a=[],s;if(e.forEach(e=>{let t=e.getTextContent().length,n=o,r=o+t;if(n<l)if(r<=l)a.push(e);else{let[t,r]=e.splitText(l-n);t&&a.push(t),s=r}o+=t}),i){let e=(0,p.$getSelection)(),t=e?e.getNodes().find(p.$isTextNode):void 0,l=(0,p.$createTextNode)(i.getTextContent());return l.setFormat(i.getFormat()),l.setDetail(i.getDetail()),l.setStyle(i.getStyle()),r.append(l,...a),t&&t===i&&((0,p.$isRangeSelection)(e)?l.select(e.anchor.offset,e.focus.offset):(0,p.$isNodeSelection)(e)&&l.select(0,l.getTextContent().length)),i.replace(r),s}}}(o,a+e-r,a+t-r,i);n=c?[c,...s]:s,l(i.url,null),a=0}else a+=t;o=o.substring(t)}}(function(e){let t=[e],l=e.getNextSibling();for(;null!==l&&(0,p.$isTextNode)(l)&&l.isSimpleText()&&(t.push(l),!/\s/.test(l.getTextContent()));)l=l.getNextSibling();return t}(t),ro,e),!function(e,t,l){let n=e.getPreviousSibling(),r=e.getNextSibling(),o=e.getTextContent();if(n5(n)){let r=!!n.getFields()?.url&&(n.getFields()?.url?.startsWith("mailto:")??!1);(!n9(o[0])||(r?/^\.[a-z]{2,}/i.test(o):/^\.[a-z0-9]+/i.test(o)))&&(n.append(e),rn(n,t,l),l(null,n.getFields()?.url??null))}n5(r)&&!re(o)&&(rr(r),rn(r,t,l),l(null,r.getFields()?.url??null))}(t,ro,e))}))},l=[n,ro,void 0],e[0]=n,e[1]=ro,e[2]=void 0,e[3]=t,e[4]=l):(t=e[3],l=e[4]),(0,g.useEffect)(t,l),null},ra=()=>(0,m.jsx)(lc,{});function rs(e,t,l,n=10,r=5){let o=l.parentElement;if(null===e||null==o){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}let i=l.getBoundingClientRect(),a=o.getBoundingClientRect(),s=e.top-n,c=e.left-r;t.style.width="max-content",t.style.maxWidth="none";let u=t.scrollWidth,d=a.right-c,f=c-a.left,h;if(u<=d)h=t.getBoundingClientRect();else{let l=f+e.width,n=f>d,r=Math.min(u,n?l:d);r<u&&(t.style.width=`${r}px`,t.style.maxWidth=`${r}px`,t.offsetHeight),n&&(c=e.right-r),h=t.getBoundingClientRect()}s<a.top&&(s+=h.height+e.height+2*n),c+h.width>a.right&&(c=a.right-h.width-r),s-=i.top,c-=i.left,t.style.opacity="1",t.style.transform=`translate(${c}px, ${s}px)`}var rc=(0,p.createCommand)("TOGGLE_LINK_WITH_MODAL_COMMAND");function ru(e){e.preventDefault()}function rd({anchorElem:e}){let[t]=(0,u.useLexicalComposerContext)(),[l,n]=(0,g.useState)(),i=(0,g.useRef)(null),a=(0,g.useRef)(null),[c,d]=(0,g.useState)(null),[f,h]=(0,g.useState)(null),{fieldProps:{schemaPath:b},uuid:C}=(0,s.b)(),y=(0,W.useLexicalEditable)(),{config:v,getEntityConfig:_}=(0,J.useConfig)(),{i18n:S,t:N}=(0,Y.useTranslation)(),[w,k]=(0,g.useState)(),T=(0,G.useEditDepth)(),[E,$]=(0,g.useState)(!1),[L,M]=(0,g.useState)([]),R=(0,G.useLocale)(),[j,I]=(0,g.useState)(!1),F=(0,G.formatDrawerSlug)({slug:"lexical-rich-text-link-"+C,depth:T}),{toggleDrawer:O}=(0,o.a)(F),D=(0,g.useCallback)(()=>{$(!1),i&&i.current&&(i.current.style.opacity="0",i.current.style.transform="translate(-10000px, -10000px)"),I(!1),d(null),h(null),M([]),k(void 0)},[$,d,h,M]),P=(0,g.useCallback)(()=>{let l=(0,p.$getSelection)(),r;if(!(0,p.$isRangeSelection)(l)||!l)return void D();let o=nW(l);r=t.getElementByKey(o.getKey())?.getBoundingClientRect();let s=(0,p.$findMatchingParent)(o,nq),c=l.getNodes().filter(e=>!(0,p.$isLineBreakNode)(e)).find(e=>{let t=(0,p.$findMatchingParent)(e,nq);return s&&!s.is(t)||t&&!t.is(s)});if(null==s||c)return void D();n(s);let u=s.getFields(),f={...u,id:s.getID(),text:s.getTextContent()};if(u?.linkType==="custom")d(u?.url??null),h(null);else{d(`${"/"===v.routes.admin?"":v.routes.admin}/collections/${u?.doc?.relationTo}/${u?.doc?.value}`);let e=u?.doc?.relationTo?_({collectionSlug:u?.doc?.relationTo}):void 0;if(e){let t="object"==typeof u.doc?.value?u.doc.value.id:u.doc?.value,l=u.doc?.relationTo;if(!t||!l)throw Error("Focus link parent is missing doc.value or doc.relationTo");h(N("fields:linkedTo",{label:`${(0,x.getTranslation)(e.labels.singular,S)} - ${N("lexical:link:loadingWithEllipsis",S)}`}).replace(/<[^>]*>?/g,"")),X.requests.get((0,ld.formatAdminURL)({apiRoute:v.routes.api,path:`/${l}/${t}`,serverURL:v.serverURL}),{headers:{"Accept-Language":S.language},params:{depth:0,locale:R?.code}}).then(async t=>{if(!t.ok)throw Error(`HTTP error! Status: ${t.status}`);let l=(await t.json())[e?.admin?.useAsTitle||"id"];h(N("fields:linkedTo",{label:`${(0,x.getTranslation)(e.labels.singular,S)} - ${l}`}).replace(/<[^>]*>?/g,""))}).catch(()=>{h(N("fields:linkedTo",{label:`${(0,x.getTranslation)(e.labels.singular,S)} - ${N("general:untitled",S)} - ID: ${t}`}).replace(/<[^>]*>?/g,""))})}else h(u?.label?String(u?.label):null),d(u?.url?String(u?.url):null)}k(f),$(!0),M(l?l?.getNodes():[]),n5(s)?I(!0):I(!1);let g=i.current,m=(0,p.getDOMSelection)(t._window),{activeElement:b}=document;if(null===g)return;let C=t.getRootElement();return null!==m&&null!==C&&C.contains(m.anchorNode)?(r||(r=m.getRangeAt(0).getBoundingClientRect()),null!=r&&(r.y+=40,a.current=r)):(null==b||"link-input"!==b.className)&&(null!==C&&rs(null,g,e),d(null),h(null)),!0},[t,D,v.routes.admin,v.routes.api,v.serverURL,_,N,S,R?.code,e]);return(0,g.useEffect)(()=>(0,p.mergeRegister)(t.registerCommand(rc,e=>(t.dispatchCommand(nQ,e),P(),O(),!0),p.COMMAND_PRIORITY_LOW)),[t,P,O,F]),(0,g.useEffect)(()=>{let l=e.parentElement,n=()=>{t.getEditorState().read(()=>{P()})};return window.addEventListener("resize",n),l?.addEventListener("scroll",n),()=>{window.removeEventListener("resize",n),l?.removeEventListener("scroll",n)}},[e.parentElement,t,P]),(0,g.useEffect)(()=>(0,p.mergeRegister)(t.registerUpdateListener(({editorState:e})=>{e.read(()=>{P()})}),t.registerCommand(p.SELECTION_CHANGE_COMMAND,()=>(P(),!0),p.COMMAND_PRIORITY_LOW),t.registerCommand(p.KEY_ESCAPE_COMMAND,()=>!!E&&(D(),!0),p.COMMAND_PRIORITY_HIGH)),[t,P,E,D]),(0,g.useEffect)(()=>{t.getEditorState().read(()=>{P()})},[t,P]),(0,g.useLayoutEffect)(()=>{E&&i.current&&e&&a.current&&rs(a.current,i.current,e)},[c,f,E,e,l]),(0,m.jsxs)(g.default.Fragment,{children:[(0,m.jsx)("div",{className:"link-editor",ref:i,children:(0,m.jsxs)("div",{className:"link-input",children:[c&&c.length>0?(0,m.jsxs)("a",{href:c,rel:"noopener noreferrer",target:"_blank",children:[l?.__fields.newTab?(0,m.jsx)(G.ExternalLinkIcon,{}):null,null!=f&&f.length>0?f:c]}):null!=f&&f.length>0?(0,m.jsxs)(m.Fragment,{children:[l?.__fields.newTab?(0,m.jsx)(G.ExternalLinkIcon,{}):null,(0,m.jsx)("span",{className:"link-input__label-pure",children:f})]}):null,y&&(0,m.jsxs)(g.default.Fragment,{children:[(0,m.jsx)("button",{"aria-label":"Edit link",className:"link-edit",onClick:e=>{e.preventDefault(),O()},onMouseDown:ru,tabIndex:0,type:"button",children:(0,m.jsx)(G.EditIcon,{})}),!j&&(0,m.jsx)("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{t.dispatchCommand(nQ,null)},onMouseDown:ru,tabIndex:0,type:"button",children:(0,m.jsx)(G.CloseMenuIcon,{})})]})]})}),(0,m.jsx)(r.a,{className:"lexical-link-edit-drawer",data:w,drawerSlug:F,drawerTitle:N("fields:editLink"),featureKey:"link",handleDrawerSubmit:(e,l)=>{let n={...l};delete n.text,t.update(()=>{let e=(0,p.$getSelection)(),t=null;if((0,p.$isRangeSelection)(e)?t=nW(e).getParent():L.length&&(t=L[0]?.getParent()??null),t&&n5(t)){let e=nZ({fields:n});t.replace(e,!0)}}),t.dispatchCommand(nQ,{fields:n,selectedNodes:L,text:l.text})},schemaPath:b,schemaPathSuffix:"fields"})]})}var rf=e=>{let{anchorElem:t=document.body}=e;return(0,lu.createPortal)((0,m.jsx)(rd,{anchorElem:t}),t)},rh=/^(?:[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+)?$/,rp=/^(?:\/[\w\-./]*(?:\?[-;&=%\w]*)?(?:#[\w-]+)?|#[\w\-]+)$/,rg=e=>{let t=(0,c.c)(5),{clientProps:l}=e,[n]=(0,u.useLexicalComposerContext)(),r,o;return t[0]!==l.defaultLinkType||t[1]!==l.defaultLinkURL||t[2]!==n?(r=()=>{if(!n.hasNodes([nY]))throw Error("LinkPlugin: LinkNode not registered on editor");return(0,p.mergeRegister)(n.registerCommand(nQ,e=>(null===e?n0(null):(e.fields?.linkType||(e.fields.linkType=l.defaultLinkType),e.fields?.url||(e.fields.url=l.defaultLinkURL),n0(e)),!0),p.COMMAND_PRIORITY_LOW),n.registerCommand(p.PASTE_COMMAND,e=>{let t=(0,p.$getSelection)();if(!(0,p.$isRangeSelection)(t)||t.isCollapsed()||!(e instanceof ClipboardEvent)||null==e.clipboardData)return!1;let l=e.clipboardData.getData("text");return!!function(e){if(!e||e.includes(" ")||/^[a-z][a-z\d+.-]*:\/[^/]/i.test(e))return!1;if("https://"===e||rh.test(e)||rp.test(e))return!0;try{let t=new URL(e);return!(["ftp:","http:","https:"].includes(t.protocol)&&!t.hostname.includes("."))}catch{}return!1}(l)&&!t.getNodes().some(rm)&&(n.dispatchCommand(nQ,{fields:{doc:null,linkType:"custom",newTab:!1,url:l},text:null}),e.preventDefault(),!0)},p.COMMAND_PRIORITY_LOW))},o=[l.defaultLinkType,l.defaultLinkURL,n],t[0]=l.defaultLinkType,t[1]=l.defaultLinkURL,t[2]=n,t[3]=r,t[4]=o):(r=t[3],o=t[4]),(0,g.useEffect)(r,o),null};function rm(e){return(0,p.$isElementNode)(e)}var rb=[nG([{ChildComponent:()=>(0,m.jsx)("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:(0,m.jsx)("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"})}),isActive:({selection:e})=>{if((0,p.$isRangeSelection)(e)){let t=nW(e);return null!=(0,p.$findMatchingParent)(t,nq)}return!1},isEnabled:({selection:e})=>!!((0,p.$isRangeSelection)(e)&&(0,p.$getSelection)()?.getTextContent()?.length),key:"link",label:({i18n:e})=>e.t("lexical:link:label"),onSelect:({editor:e,isActive:t})=>{if(t)e.dispatchCommand(nQ,null);else{let t,l=[];if(e.getEditorState().read(()=>{t=(0,p.$getSelection)()?.getTextContent(),l=(0,p.$getSelection)()?.getNodes()??[]}),!t?.length)return;e.dispatchCommand(rc,{fields:{doc:null},selectedNodes:l,text:t})}},order:1}])],rC=l_(({props:e})=>({markdownTransformers:[n2],nodes:[nY,e?.disableAutoLinks===!0?null:n3].filter(Boolean),plugins:[{Component:rg,position:"normal"},e?.disableAutoLinks===!0||e?.disableAutoLinks==="creationOnly"?null:{Component:ri,position:"normal"},{Component:ra,position:"normal"},{Component:rf,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:e,toolbarFixed:{groups:rb},toolbarInline:{groups:rb}})),rx=()=>(0,m.jsxs)("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:[(0,m.jsx)("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),(0,m.jsx)("path",{d:"M7 10L9 12.5L13 7.5",stroke:"currentColor",strokeWidth:"1.5"})]}),ry=()=>(0,m.jsx)(lh,{});function rv(e,t){return"ordered"===e?!t.has("unorderedList"):"checklist"===e&&!t.has("unorderedList")&&!t.has("orderedList")}function r_(e){return{items:e,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}var rS=e=>(t,l,n)=>{let r=t.getPreviousSibling(),o=t.getNextSibling(),i=(0,lf.$createListItemNode)("check"===e?"x"===n[3]:void 0);if((0,lf.$isListNode)(o)&&o.getListType()===e){let e=o.getFirstChild();null!==e?e.insertBefore(i):o.append(i),t.remove()}else if((0,lf.$isListNode)(r)&&r.getListType()===e)r.append(i),t.remove();else{let l=(0,lf.$createListNode)(e,"number"===e?Number(n[2]):void 0);l.append(i),t.replace(l)}i.append(...l),i.select(0,0);let a=Math.floor(n[1].length/4);a&&i.setIndent(a)},rN=(e,t,l)=>{let n=[],r=e.getChildren(),o=0;for(let i of r)if((0,lf.$isListItemNode)(i)){if(1===i.getChildrenSize()){let e=i.getFirstChild();if((0,lf.$isListNode)(e)){n.push(rN(e,t,l+1));continue}}let r=" ".repeat(4*l),a=e.getListType(),s="number"===a?`${e.getStart()+o}. `:"check"===a?`- [${i.getChecked()?"x":" "}] `:"- ";n.push(r+s+t(i)),o++}return n.join(`
|
||
`)},rw={type:"element",dependencies:[lf.ListNode,lf.ListItemNode],export:(e,t)=>(0,lf.$isListNode)(e)?rN(e,t,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:rS("check")},rk=()=>(0,m.jsx)(lp,{}),rT=[lL([{ChildComponent:rx,isActive:({selection:e})=>{if(!(0,p.$isRangeSelection)(e))return!1;for(let t of e.getNodes()){if((0,lf.$isListNode)(t)&&"check"===t.getListType())continue;let e=t.getParent();if((0,lf.$isListNode)(e)&&"check"===e.getListType())continue;let l=e?.getParent();if(!((0,lf.$isListNode)(l)&&"check"===l.getListType()))return!1}return!0},key:"checklist",label:({i18n:e})=>e.t("lexical:checklist:label"),onSelect:({editor:e})=>{e.dispatchCommand(lf.INSERT_CHECK_LIST_COMMAND,void 0)},order:12}])],rE=l_(({featureProviderMap:e})=>{let t=[{Component:rk,position:"normal"}],l=rv("checklist",e);return l&&t.push({Component:ry,position:"normal"}),{markdownTransformers:[rw],nodes:l?[lf.ListNode,lf.ListItemNode]:[],plugins:t,slashMenu:{groups:[r_([{Icon:rx,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:e})=>e.t("lexical:checklist:label"),onSelect:({editor:e})=>{e.dispatchCommand(lf.INSERT_CHECK_LIST_COMMAND,void 0)}}])]},toolbarFixed:{groups:rT},toolbarInline:{groups:rT}}}),r$=()=>(0,m.jsxs)("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:[(0,m.jsx)("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"}),(0,m.jsx)("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"}),(0,m.jsx)("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]}),rL={type:"element",dependencies:[lf.ListNode,lf.ListItemNode],export:(e,t)=>(0,lf.$isListNode)(e)?rN(e,t,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:rS("number")},rM=[lL([{ChildComponent:r$,isActive:({selection:e})=>{if(!(0,p.$isRangeSelection)(e))return!1;for(let t of e.getNodes()){if((0,lf.$isListNode)(t)&&"number"===t.getListType())continue;let e=t.getParent();if((0,lf.$isListNode)(e)&&"number"===e.getListType())continue;let l=e?.getParent();if(!((0,lf.$isListNode)(l)&&"number"===l.getListType()))return!1}return!0},key:"orderedList",label:({i18n:e})=>e.t("lexical:orderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(lf.INSERT_ORDERED_LIST_COMMAND,void 0)},order:10}])],rR=l_(({featureProviderMap:e})=>{let t=rv("ordered",e);return{markdownTransformers:[rL],nodes:t?[lf.ListNode,lf.ListItemNode]:[],plugins:t?[{Component:ry,position:"normal"}]:[],slashMenu:{groups:[r_([{Icon:r$,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:e})=>e.t("lexical:orderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(lf.INSERT_ORDERED_LIST_COMMAND,void 0)}}])]},toolbarFixed:{groups:rM},toolbarInline:{groups:rM}}}),rj=()=>(0,m.jsxs)("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:[(0,m.jsx)("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),(0,m.jsx)("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),(0,m.jsx)("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),(0,m.jsx)("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]}),rI={type:"element",dependencies:[lf.ListNode,lf.ListItemNode],export:(e,t)=>(0,lf.$isListNode)(e)?rN(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:rS("bullet")},rF=[lL([{ChildComponent:rj,isActive:({selection:e})=>{if(!(0,p.$isRangeSelection)(e))return!1;for(let t of e.getNodes()){if((0,lf.$isListNode)(t)&&"bullet"===t.getListType())continue;let e=t.getParent();if((0,lf.$isListNode)(e)&&"bullet"===e.getListType())continue;let l=e?.getParent();if(!((0,lf.$isListNode)(l)&&"bullet"===l.getListType()))return!1}return!0},key:"unorderedList",label:({i18n:e})=>e.t("lexical:unorderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(lf.INSERT_UNORDERED_LIST_COMMAND,void 0)},order:11}])],rO=l_({markdownTransformers:[rI],nodes:[lf.ListNode,lf.ListItemNode],plugins:[{Component:ry,position:"normal"}],slashMenu:{groups:[r_([{Icon:rj,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:e})=>e.t("lexical:unorderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(lf.INSERT_UNORDERED_LIST_COMMAND,void 0)}}])]},toolbarFixed:{groups:rF},toolbarInline:{groups:rF}}),rD=g.lazy(()=>e.A(381014).then(e=>({default:e.UnknownConvertedNodeComponent}))),rP=class extends p.DecoratorNode{__data;constructor({data:e,key:t}){super(t),this.__data=e}static clone(e){return new this({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return function({data:e}){return(0,p.$applyNodeReplacement)(new rP({data:e}))}({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let t=document.createElement("span");return(0,p.addClassNamesToElement)(t,"unknownConverted"),t}decorate(){return(0,m.jsx)(rD,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,t){return!1}},rA=l_(()=>({nodes:[rP]})),rB=g.lazy(()=>e.A(836789).then(e=>({default:e.UnknownConvertedNodeComponent}))),rH=class extends p.DecoratorNode{__data;constructor({data:e,key:t}){super(t),this.__data=e}static clone(e){return new this({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return function({data:e}){return(0,p.$applyNodeReplacement)(new rH({data:e}))}({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let t=document.createElement("span");return(0,p.addClassNamesToElement)(t,"unknownConverted"),t}decorate(){return(0,m.jsx)(rB,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,t){return!1}},rz=l_(()=>({nodes:[rH]})),rK=[lL([{ChildComponent:l$,isActive:({selection:e})=>{if(!(0,p.$isRangeSelection)(e))return!1;for(let t of e.getNodes())if(!(0,p.$isParagraphNode)(t)&&!(0,p.$isParagraphNode)(t.getParent()))return!1;return!0},key:"paragraph",label:({i18n:e})=>e.t("lexical:paragraph:label2"),onSelect:({editor:e})=>{e.update(()=>{let e=(0,p.$getSelection)();(0,C.$setBlocksType)(e,()=>(0,p.$createParagraphNode)())})},order:1}])],rU=l_({slashMenu:{groups:[ly([{Icon:l$,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:e})=>e.t("lexical:paragraph:label"),onSelect:({editor:e})=>{e.update(()=>{let e=(0,p.$getSelection)();(0,C.$setBlocksType)(e,()=>(0,p.$createParagraphNode)())})}}])]},toolbarFixed:{groups:rK},toolbarInline:{groups:rK}}),rV={horizontalrule:(0,m.jsx)("hr",{})},rW={linebreak:(0,m.jsx)("br",{})},rG={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},rJ=rG.IS_BOLD|rG.IS_ITALIC|rG.IS_STRIKETHROUGH|rG.IS_UNDERLINE|rG.IS_CODE|rG.IS_SUBSCRIPT|rG.IS_SUPERSCRIPT|rG.IS_HIGHLIGHT,rY=`
|
||
|
||
`,rX="֑-߿יִ-﷽ﹰ-ﻼ",rZ="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",rq=RegExp("^[^"+rZ+"]*["+rX+"]"),rQ=RegExp("^[^"+rX+"]*["+rZ+"]"),r0={bold:rG.IS_BOLD,code:rG.IS_CODE,highlight:rG.IS_HIGHLIGHT,italic:rG.IS_ITALIC,strikethrough:rG.IS_STRIKETHROUGH,subscript:rG.IS_SUBSCRIPT,superscript:rG.IS_SUPERSCRIPT,underline:rG.IS_UNDERLINE},r1={directionless:rG.IS_DIRECTIONLESS,unmergeable:rG.IS_UNMERGEABLE},r2={center:rG.IS_ALIGN_CENTER,end:rG.IS_ALIGN_END,justify:rG.IS_ALIGN_JUSTIFY,left:rG.IS_ALIGN_LEFT,right:rG.IS_ALIGN_RIGHT,start:rG.IS_ALIGN_START},r3={[rG.IS_ALIGN_CENTER]:"center",[rG.IS_ALIGN_END]:"end",[rG.IS_ALIGN_JUSTIFY]:"justify",[rG.IS_ALIGN_LEFT]:"left",[rG.IS_ALIGN_RIGHT]:"right",[rG.IS_ALIGN_START]:"start"},r6={normal:rG.IS_NORMAL,segmented:rG.IS_SEGMENTED,token:rG.IS_TOKEN},r5={[rG.IS_NORMAL]:"normal",[rG.IS_SEGMENTED]:"segmented",[rG.IS_TOKEN]:"token"},r4={paragraph:({node:e,nodesToJSX:t})=>{let l=t({nodes:e.children});return l?.length?(0,m.jsx)("p",{children:l}):(0,m.jsx)("p",{children:(0,m.jsx)("br",{})})},text:({node:e})=>{let t=e.text;return e.format&rG.IS_BOLD&&(t=(0,m.jsx)("strong",{children:t})),e.format&rG.IS_ITALIC&&(t=(0,m.jsx)("em",{children:t})),e.format&rG.IS_STRIKETHROUGH&&(t=(0,m.jsx)("span",{style:{textDecoration:"line-through"},children:t})),e.format&rG.IS_UNDERLINE&&(t=(0,m.jsx)("span",{style:{textDecoration:"underline"},children:t})),e.format&rG.IS_CODE&&(t=(0,m.jsx)("code",{children:t})),e.format&rG.IS_SUBSCRIPT&&(t=(0,m.jsx)("sub",{children:t})),e.format&rG.IS_SUPERSCRIPT&&(t=(0,m.jsx)("sup",{children:t})),t},...rW,quote:({node:e,nodesToJSX:t})=>{let l=t({nodes:e.children});return(0,m.jsx)("blockquote",{children:l})},table:({node:e,nodesToJSX:t})=>{let l=t({nodes:e.children});return(0,m.jsx)("div",{className:"lexical-table-container",children:(0,m.jsx)("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:(0,m.jsx)("tbody",{children:l})})})},tablecell:({node:e,nodesToJSX:t})=>{let l=t({nodes:e.children}),n=e.headerState>0?"th":"td",r=`lexical-table-cell-header-${e.headerState}`,o={backgroundColor:e.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},i=e.colSpan&&e.colSpan>1?e.colSpan:void 0,a=e.rowSpan&&e.rowSpan>1?e.rowSpan:void 0;return(0,m.jsx)(n,{className:`lexical-table-cell ${r}`,colSpan:i,rowSpan:a,style:o,children:l})},tablerow:({node:e,nodesToJSX:t})=>{let l=t({nodes:e.children});return(0,m.jsx)("tr",{className:"lexical-table-row",children:l})},heading:({node:e,nodesToJSX:t})=>{let l=t({nodes:e.children}),n=e.tag;return(0,m.jsx)(n,{children:l})},...rV,list:({node:e,nodesToJSX:t})=>{let l=t({nodes:e.children}),n=e.tag;return(0,m.jsx)(n,{className:`list-${e?.listType}`,children:l})},listitem:({node:e,nodesToJSX:t,parent:l})=>{let n=e.children.some(e=>"list"===e.type),r=t({nodes:e.children});if(!("listType"in l)||l?.listType!=="check")return(0,m.jsx)("li",{className:`${n?"nestedListItem":""}`,style:n?{listStyleType:"none"}:void 0,value:e?.value,children:r});{let t=(0,Q.v4)();return(0,m.jsx)("li",{"aria-checked":e.checked?"true":"false",className:`list-item-checkbox${e.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked"}${n?" nestedListItem":""}`,role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:e?.value,children:n?r:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("input",{checked:e.checked,id:t,readOnly:!0,type:"checkbox"}),(0,m.jsx)("label",{htmlFor:t,children:r}),(0,m.jsx)("br",{})]})})}},...(({internalDocToHref:e})=>({autolink:({node:e,nodesToJSX:t})=>{let l=t({nodes:e.children}),n=e.fields.newTab?"noopener noreferrer":void 0,r=e.fields.newTab?"_blank":void 0;return(0,m.jsx)("a",{href:e.fields.url,rel:n,target:r,children:l})},link:({node:t,nodesToJSX:l})=>{let n=l({nodes:t.children}),r=t.fields.newTab?"noopener noreferrer":void 0,o=t.fields.newTab?"_blank":void 0,i=t.fields.url??"";return"internal"===t.fields.linkType&&(e?i=e({linkNode:t}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),i="#")),(0,m.jsx)("a",{href:i,rel:r,target:o,children:n})}}))({}),upload:({node:e})=>{if("object"!=typeof e.value)return null;let t=e.value,l=e.fields?.alt||t?.alt||"",n=t.url;if(!t.mimeType.startsWith("image"))return(0,m.jsx)("a",{href:n,rel:"noopener noreferrer",children:t.filename});if(!t.sizes||!Object.keys(t.sizes).length)return(0,m.jsx)("img",{alt:l,height:t.height,src:n,width:t.width});let r=[];for(let e in t.sizes){let l=t.sizes[e];if(!l||!l.width||!l.height||!l.mimeType||!l.filesize||!l.filename||!l.url)continue;let n=l?.url;r.push((0,m.jsx)("source",{media:`(max-width: ${l.width}px)`,srcSet:n,type:l.mimeType},e))}return r.push((0,m.jsx)("img",{alt:l,height:t?.height,src:n,width:t?.width},"image")),(0,m.jsx)("picture",{children:r})},tab:" "},r7=({className:e,converters:t,data:l,disableContainer:n,disableIndent:r,disableTextAlign:o})=>{if(!l)return null;let i={};i=t?"function"==typeof t?t({defaultConverters:r4}):t:r4;let a=l&&!Array.isArray(l)&&"object"==typeof l&&"root"in l&&function({converters:e,data:t,disableIndent:l,disableTextAlign:n}){return!function(e){let t=!!e?.root?.children?.length,l=!1;if(e?.root?.children?.length===1&&e?.root?.children[0]?.type==="paragraph"){let t=e?.root?.children[0];if(t?.children&&t?.children?.length!==0){if(t?.children?.length===1){let e=t?.children[0];e?.type==="text"&&(e?.text?.length||(l=!0))}}else l=!0}return!(!t||l)}(t)?(0,m.jsx)(m.Fragment,{}):function e({converters:t,disableIndent:l,disableTextAlign:n,nodes:r,parent:o}){let i=t.unknown;return r.map((r,a)=>{let s;"block"===r.type?(s=t?.blocks?.[r?.fields?.blockType])||i||console.error(`Lexical => JSX converter: Blocks converter: found ${r?.fields?.blockType} block, but no converter is provided`):"inlineBlock"===r.type?(s=t?.inlineBlocks?.[r?.fields?.blockType])||i||console.error(`Lexical => JSX converter: Inline Blocks converter: found ${r?.fields?.blockType} inline block, but no converter is provided`):s=t[r.type];try{let c;!s&&i&&(s=i),c=s?"function"==typeof s?s({childIndex:a,converters:t,node:r,nodesToJSX:i=>e({converters:i.converters??t,disableIndent:i.disableIndent??l,disableTextAlign:i.disableTextAlign??n,nodes:i.nodes,parent:i.parent??{...r,parent:o}}),parent:o}):s:(0,m.jsx)("span",{children:"unknown node"},a);let u={};if(!n&&(!Array.isArray(n)||!n?.includes(r.type))&&"format"in r&&r.format)switch(r.format){case"center":u.textAlign="center";break;case"end":case"right":u.textAlign="right";break;case"justify":u.textAlign="justify";break;case"left":break;case"start":u.textAlign="left"}if(!l&&(!Array.isArray(l)||!l?.includes(r.type))&&"indent"in r&&r.indent&&"listitem"!==r.type&&(u.paddingInlineStart=`${40*Number(r.indent)}px`),g.default.isValidElement(c)){if(u.textAlign||u.paddingInlineStart){let e={...u,...c?.props?.style??{}};return g.default.cloneElement(c,{key:a,style:e})}return g.default.cloneElement(c,{key:a})}return c}catch(e){return console.error("Error converting lexical node to JSX:",e,"node:",r),null}}).filter(Boolean)}({converters:e,disableIndent:l,disableTextAlign:n,nodes:t?.root?.children,parent:t?.root})}({converters:i,data:l,disableIndent:r,disableTextAlign:o});return n?(0,m.jsx)(m.Fragment,{children:a}):(0,m.jsx)("div",{className:e??"payload-richtext",children:a})},r8=l_({plugins:[{Component:function(){let e,t=(0,c.c)(7),[l]=(0,u.useLexicalComposerContext)(),n;t[0]!==l?(n=l.getEditorState().toJSON(),t[0]=l,t[1]=n):n=t[1];let[r,o]=(0,g.useState)(n),i,a;return t[2]!==l?(i=()=>l.registerUpdateListener(e=>{let{editorState:t}=e;o(t.toJSON())}),a=[l],t[2]=l,t[3]=i,t[4]=a):(i=t[3],a=t[4]),(0,g.useEffect)(i,a),t[5]!==r?(e=(0,m.jsx)("div",{className:"debug-jsx-converter",children:(0,m.jsx)(r7,{converters:r4,data:r})}),t[5]=r,t[6]=e):e=t[6],e},position:"bottom"}]}),r9={50:"oklch(0.97 0.014 254.604)",100:"oklch(0.932 0.032 255.585)",200:"oklch(0.882 0.059 254.128)",300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)",800:"oklch(0.424 0.199 265.638)",900:"oklch(0.379 0.146 265.522)",950:"oklch(0.282 0.091 267.935)"},oe={50:"oklch(0.982 0.018 155.826)",100:"oklch(0.962 0.044 156.743)",200:"oklch(0.925 0.084 155.995)",300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)",800:"oklch(0.448 0.119 151.328)",900:"oklch(0.393 0.095 152.535)",950:"oklch(0.266 0.065 152.934)"},ot={50:"oklch(0.98 0.016 73.684)",100:"oklch(0.954 0.038 75.164)",200:"oklch(0.901 0.076 70.697)",300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)",800:"oklch(0.47 0.157 37.304)",900:"oklch(0.408 0.123 38.172)",950:"oklch(0.266 0.079 36.259)"},ol={50:"oklch(0.971 0.014 343.198)",100:"oklch(0.948 0.028 342.258)",200:"oklch(0.899 0.061 343.231)",300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)",800:"oklch(0.459 0.187 3.815)",900:"oklch(0.408 0.153 2.432)",950:"oklch(0.284 0.109 3.907)"},on={50:"oklch(0.977 0.014 308.299)",100:"oklch(0.946 0.033 307.174)",200:"oklch(0.902 0.063 306.703)",300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)",800:"oklch(0.438 0.218 303.724)",900:"oklch(0.381 0.176 304.987)",950:"oklch(0.291 0.149 302.717)"},or={50:"oklch(0.971 0.013 17.38)",100:"oklch(0.936 0.032 17.717)",200:"oklch(0.885 0.062 18.334)",300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)",800:"oklch(0.444 0.177 26.899)",900:"oklch(0.396 0.141 25.723)",950:"oklch(0.258 0.092 26.042)"},oo={50:"oklch(0.987 0.026 102.212)",100:"oklch(0.973 0.071 103.193)",200:"oklch(0.945 0.129 101.54)",300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",800:"oklch(0.476 0.114 61.907)",900:"oklch(0.421 0.095 57.708)",950:"oklch(0.286 0.066 53.813)"},oi={text:{"text-red":{css:{color:`light-dark(${or[600]}, ${or[400]})`},label:"Red"},"text-orange":{css:{color:`light-dark(${ot[600]}, ${ot[400]})`},label:"Orange"},"text-yellow":{css:{color:`light-dark(${oo[700]}, ${oo[300]})`},label:"Yellow"},"text-green":{css:{color:`light-dark(${oe[700]}, ${oe[400]})`},label:"Green"},"text-blue":{css:{color:`light-dark(${r9[600]}, ${r9[400]})`},label:"Blue"},"text-purple":{css:{color:`light-dark(${on[600]}, ${on[400]})`},label:"Purple"},"text-pink":{css:{color:`light-dark(${ol[600]}, ${ol[400]})`},label:"Pink"}},background:{"bg-red":{css:{"background-color":`light-dark(${or[400]}, ${or[600]})`},label:"Red"},"bg-orange":{css:{"background-color":`light-dark(${ot[400]}, ${ot[600]})`},label:"Orange"},"bg-yellow":{css:{"background-color":`light-dark(${oo[300]}, ${oo[700]})`},label:"Yellow"},"bg-green":{css:{"background-color":`light-dark(${oe[400]}, ${oe[700]})`},label:"Green"},"bg-blue":{css:{"background-color":`light-dark(${r9[400]}, ${r9[600]})`},label:"Blue"},"bg-purple":{css:{"background-color":`light-dark(${on[400]}, ${on[600]})`},label:"Purple"},"bg-pink":{css:{"background-color":`light-dark(${ol[400]}, ${ol[600]})`},label:"Pink"}}},oa=()=>(0,m.jsxs)("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:[(0,m.jsx)("g",{clipPath:"url(#clip0_4397_10817)",children:(0,m.jsx)("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"})}),(0,m.jsx)("defs",{children:(0,m.jsx)("clipPath",{id:"clip0_4397_10817",children:(0,m.jsx)("rect",{fill:"currentColor",height:"12",transform:"translate(4 4)",width:"12"})})})]});function os(e){let t=e.getAttribute("data-lexical-relationship-id"),l=e.getAttribute("data-lexical-relationship-relationTo");return null!=t&&null!=l?{node:ou({relationTo:l,value:t})}:null}var oc=class extends f{__data;constructor({data:e,format:t,key:l}){super(t,l),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")?{conversion:os,priority:2}:null}}static importJSON(e){1===e.version&&e?.value?.id&&(e.value=e.value.id);let t=ou({relationTo:e.relationTo,value:e.value});return t.setFormat(e.format),t}static isInline(){return!1}createDOM(e){let t=document.createElement("div");return(0,p.addClassNamesToElement)(t,e?.theme?.relationship),t}decorate(e,t){return null}exportDOM(){let e=document.createElement("div");e.setAttribute("data-lexical-relationship-id",String("object"==typeof this.__data?.value?this.__data?.value?.id:this.__data?.value)),e.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship",version:2}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${"object"==typeof this.__data?.value?this.__data?.value?.id:this.__data?.value}`}setData(e){this.getWritable().__data=e}};function ou(e){return(0,p.$applyNodeReplacement)(new oc({data:e}))}var od=g.lazy(()=>e.A(854335).then(e=>({default:e.RelationshipComponent})));function of(e){let t=e.getAttribute("data-lexical-relationship-id"),l=e.getAttribute("data-lexical-relationship-relationTo");return null!=t&&null!=l?{node:op({relationTo:l,value:t})}:null}var oh=class extends oc{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")?{conversion:of,priority:2}:null}}static importJSON(e){1===e.version&&e?.value?.id&&(e.value=e.value.id);let t=op({relationTo:e.relationTo,value:e.value});return t.setFormat(e.format),t}decorate(e,t){return(0,m.jsx)(od,{className:t.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function op(e){return(0,p.$applyNodeReplacement)(new oh({data:e}))}function og(e){return e instanceof oh}var om=e=>{let t,l,n,r=(0,c.c)(23),[o]=(0,u.useLexicalComposerContext)(),[i,a]=(0,g.useState)(null),[s,d]=(0,g.useState)(!1),[f,h,b]=(0,G.useListDrawer)(e),{closeDrawer:C,drawerSlug:x,isDrawerOpen:y,openDrawer:v}=b,{modalState:_}=(0,G.useModal)(),S;r[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{a((0,p.$getSelection)()??(0,p.$getPreviousSelection)())},r[0]=S):S=r[0];let N=S,w;r[1]!==o||r[2]!==i?(w=()=>{i&&o.update(()=>{if((0,p.$isRangeSelection)(i)){let{anchor:e,focus:t}=i;(0,p.$getNodeByKey)(e.key)&&(0,p.$getNodeByKey)(t.key)&&(0,p.$setSelection)(i.clone())}else(0,p.$getRoot)().selectEnd()},{discrete:!0,skipTransforms:!0})},r[1]=o,r[2]=i,r[3]=w):w=r[3];let k=w,T;r[4]!==C?(T=()=>{C()},r[4]=C,r[5]=T):T=r[5];let E=T,$,L;return r[6]!==x||r[7]!==_||r[8]!==k||r[9]!==s?($=()=>{if(!s)return;let e=_[x];e&&!e?.isOpen&&(d(!1),setTimeout(()=>{k()},1))},L=[_,x,k,s],r[6]=x,r[7]=_,r[8]=k,r[9]=s,r[10]=$,r[11]=L):($=r[10],L=r[11]),(0,g.useEffect)($,L),r[12]!==h?(t=e=>(0,m.jsx)(h,{...e,onClick:()=>{N()}}),r[12]=h,r[13]=t):t=r[13],r[14]!==v?(l=()=>{N(),v(),d(!0)},r[14]=v,r[15]=l):l=r[15],r[16]!==f||r[17]!==E||r[18]!==y||r[19]!==x||r[20]!==t||r[21]!==l?(n={closeListDrawer:E,isListDrawerOpen:y,ListDrawer:f,listDrawerSlug:x,ListDrawerToggler:t,openListDrawer:l},r[16]=f,r[17]=E,r[18]=y,r[19]=x,r[20]=t,r[21]=l,r[22]=n):n=r[22],n},ob=e=>{let t,l=(0,c.c)(14),{enabledCollectionSlugs:r}=e,[o]=(0,u.useLexicalComposerContext)(),[i,a]=(0,g.useState)(null),s=r?.[0],d;l[0]!==r||l[1]!==s?(d={collectionSlugs:r,selectedCollection:s},l[0]=r,l[1]=s,l[2]=d):d=l[2];let{closeListDrawer:f,ListDrawer:h,openListDrawer:b}=om(d),C,x;l[3]!==o||l[4]!==b?(C=()=>o.registerCommand(n.a,e=>(a(e?.replace?e?.replace.nodeKey:null),b(),!0),p.COMMAND_PRIORITY_EDITOR),x=[o,b],l[3]=o,l[4]=b,l[5]=C,l[6]=x):(C=l[5],x=l[6]),(0,g.useEffect)(C,x),l[7]!==f||l[8]!==o||l[9]!==i?(t=e=>{let{collectionSlug:t,doc:l}=e;(({editor:e,relationTo:t,replaceNodeKey:l,value:n})=>{l?e.update(()=>{let e=(0,p.$getNodeByKey)(l);e&&e.replace(op({relationTo:t,value:n}))}):e.dispatchCommand(o_,{relationTo:t,value:n})})({editor:o,relationTo:t,replaceNodeKey:i,value:l.id}),f()},l[7]=f,l[8]=o,l[9]=i,l[10]=t):t=l[10];let y=t,v;return l[11]!==h||l[12]!==y?(v=(0,m.jsx)(h,{onSelect:y}),l[11]=h,l[12]=y,l[13]=v):v=l[13],v},oC=()=>{let e=(0,c.c)(3),[t]=(0,u.useLexicalComposerContext)(),l,r;return e[0]!==t?(l=()=>t.registerCommand(n.a,oy,p.COMMAND_PRIORITY_EDITOR),r=[t],e[0]=t,e[1]=l,e[2]=r):(l=e[1],r=e[2]),(0,g.useEffect)(l,r),null},ox=({enabledCollectionSlugs:e})=>e?.length?(0,m.jsx)(ob,{enabledCollectionSlugs:e}):(0,m.jsx)(oC,{});function oy(){return G.toast.error("No relationship collections enabled"),!0}var ov=e=>{let{collectionSlugsBlacklist:t,collectionSlugsWhitelist:l,uploads:n=!1}=e||{},{config:{collections:r}}=(0,J.useConfig)(),{visibleEntities:o}=(0,G.useEntityVisibility)();return g.useMemo(()=>{let e=[],i=[],a=l?new Set(l):null,s=t?new Set(t):null;for(let t of r){let{slug:l,admin:{enableRichTextRelationship:r},upload:c}=t;if(o?.collections.includes(l)){if(n){if(!r||!c)continue}else if(c||!r)continue;a&&!a.has(l)||s&&s.has(l)||(e.push(l),i.push(t))}}return{enabledCollections:i,enabledCollectionSlugs:e}},[r,o,n,l,t])},o_=(0,p.createCommand)("INSERT_RELATIONSHIP_COMMAND");function oS(e){let t=(0,p.$getSelection)()||(0,p.$getPreviousSelection)();if((0,p.$isRangeSelection)(t)){let l=op(e),{focus:n}=t,r=n.getNode();(0,et.$insertNodeToNearestRoot)(l),(0,p.$isParagraphNode)(r)&&!r.__first&&r.remove()}return!0}var oN=l_({nodes:[oh],plugins:[{Component:e=>{let t,l=(0,c.c)(8),{clientProps:n}=e,[r]=(0,u.useLexicalComposerContext)(),o=n?.disabledCollections,i=n?.enabledCollections,a;l[0]!==o||l[1]!==i?(a={collectionSlugsBlacklist:o,collectionSlugsWhitelist:i},l[0]=o,l[1]=i,l[2]=a):a=l[2];let{enabledCollectionSlugs:s}=ov(a),d,f;return l[3]!==r?(d=()=>{if(!r.hasNodes([oh]))throw Error("RelationshipPlugin: RelationshipNode not registered on editor");return r.registerCommand(o_,oS,p.COMMAND_PRIORITY_EDITOR)},f=[r],l[3]=r,l[4]=d,l[5]=f):(d=l[4],f=l[5]),(0,g.useEffect)(d,f),l[6]!==s?(t=(0,m.jsx)(ox,{enabledCollectionSlugs:s}),l[6]=s,l[7]=t):t=l[7],t},position:"normal"}],slashMenu:{groups:[ly([{Icon:oa,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:e})=>e.t("lexical:relationship:label"),onSelect:({editor:e})=>{e.dispatchCommand(n.a,{replace:!1})}}])]},toolbarFixed:{groups:[nL([{ChildComponent:oa,isActive:({selection:e})=>!!(0,p.$isNodeSelection)(e)&&!!e.getNodes().length&&og(e.getNodes()[0]),key:"relationship",label:({i18n:e})=>e.t("lexical:relationship:label"),onSelect:({editor:e})=>{e.dispatchCommand(n.a,{replace:!1})}}])]}}),ow="toolbar-popup__button",ok=e=>{let t=(0,c.c)(14),{active:l,children:n,editor:r,enabled:o,item:i}=e,a=void 0!==l&&l,s=void 0===o||o,u=s?"":"disabled",d=a?"active":"",f=i.key?`${ow}-${i.key}`:"",h;t[0]!==u||t[1]!==d||t[2]!==f?(h=[ow,u,d,f].filter(Boolean),t[0]=u,t[1]=d,t[2]=f,t[3]=h):h=t[3];let p=h.join(" "),g;t[4]!==a||t[5]!==r||t[6]!==s||t[7]!==i?(g=()=>{s&&r.focus(()=>{r.update(oT),i.onSelect?.({editor:r,isActive:a})})},t[4]=a,t[5]=r,t[6]=s,t[7]=i,t[8]=g):g=t[8];let b=g,C;return t[9]!==n||t[10]!==p||t[11]!==b||t[12]!==i.key?(C=(0,m.jsx)("button",{className:p,"data-button-key":i.key,onClick:b,onMouseDown:oE,type:"button",children:n}),t[9]=n,t[10]=p,t[11]=b,t[12]=i.key,t[13]=C):C=t[13],C};function oT(){(0,p.$addUpdateTag)("toolbar")}function oE(e){e.preventDefault()}var o$="toolbar-popup__dropdown-item",oL=g.default.createContext(null);function oM({active:e,children:t,editor:l,enabled:n,Icon:r,item:o,itemKey:i,tooltip:a}){let s=(0,g.useMemo)(()=>[o$,!1===n?"disabled":"",e?"active":"",o?.key?`${o$}-${o.key}`:""].filter(Boolean).join(" "),[n,e,o.key]),c=(0,g.useRef)(null),u=g.default.use(oL);if(null===u)throw Error("DropDownItem must be used within a DropDown");let{registerItem:d}=u;return(0,g.useEffect)(()=>{c?.current!=null&&d(c)},[c,d]),(0,m.jsx)(G.Button,{"aria-label":a,buttonStyle:"none",className:s,disabled:!1===n,extraButtonProps:{"data-item-key":i},icon:r,iconPosition:"left",iconStyle:"none",onClick:()=>{!1!==n&&l.focus(()=>{l.update(()=>{(0,p.$addUpdateTag)("toolbar")}),o.onSelect?.({editor:l,isActive:e})})},onMouseDown:e=>{e.preventDefault()},ref:c,tooltip:a,type:"button",children:t})}function oR({children:e,dropDownRef:t,itemsContainerClassNames:l,onClose:n}){let[r,o]=(0,g.useState)(),[i,a]=(0,g.useState)(),s=(0,g.useCallback)(e=>{o(t=>null!=t?[...t,e]:[e])},[o]),c=(0,g.useMemo)(()=>({registerItem:s}),[s]);return(0,g.useEffect)(()=>{null!=r&&null==i&&a(r[0]),null!=i&&i?.current!=null&&i.current.focus()},[r,i]),(0,m.jsx)(oL,{value:c,children:(0,m.jsx)("div",{className:(l??["toolbar-popup__dropdown-items"]).join(" "),onKeyDown:e=>{if(null==r)return;let{key:t}=e;["ArrowDown","ArrowUp","Escape","Tab"].includes(t)&&e.preventDefault(),"Escape"===t||"Tab"===t?n():"ArrowUp"===t?a(e=>{if(null==e)return r[0];let t=r.indexOf(e)-1;return r[-1===t?r.length-1:t]}):"ArrowDown"===t&&a(e=>null==e?r[0]:r[r.indexOf(e)+1])},ref:t,children:e})})}function oj({buttonAriaLabel:e,buttonClassName:t,children:l,disabled:n=!1,dropdownKey:r,Icon:o,itemsContainerClassNames:i,label:a,stopCloseOnClickSelf:s}){let c=(0,g.useRef)(null),u=(0,g.useRef)(null),[d,f]=(0,g.useState)(!1);(0,g.useEffect)(()=>{let e=u.current,t=c.current;if(d&&null!==e&&null!==t){let{left:l,top:n}=e.getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop;t.style.top=`${n+r+e.offsetHeight+5}px`,t.style.left=`${Math.min(l-5,window.innerWidth-t.offsetWidth-20)}px`}},[c,u,d]),(0,g.useEffect)(()=>{let e=u.current;if(null!==e&&d){let t=t=>{let l=t.target;(0,p.isDOMNode)(l)&&(s&&c.current&&c.current.contains(l)||e.contains(l)||f(!1))};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}}},[c,u,d,s]);let h=(0,lu.createPortal)((0,m.jsx)(oR,{dropDownRef:c,itemsContainerClassNames:i,onClose:()=>{f(!1),u?.current!=null&&u.current.focus()},children:l}),document.body);return(0,m.jsxs)(g.default.Fragment,{children:[(0,m.jsxs)("button",{"aria-label":e,className:t+(d?" active":""),"data-dropdown-key":r,disabled:n,onClick:e=>{e.preventDefault(),f(!d)},onMouseDown:e=>{e.preventDefault()},ref:u,type:"button",children:[o&&(0,m.jsx)(o,{}),a&&(0,m.jsx)("span",{className:"toolbar-popup__dropdown-label",children:a}),(0,m.jsx)("i",{className:"toolbar-popup__dropdown-caret"})]}),d&&(0,m.jsx)(g.default.Fragment,{children:h})]})}var oI="toolbar-popup__dropdown",oF=g.default.memo(e=>{let t,l=(0,c.c)(14),{active:n,anchorElem:r,editor:o,enabled:i,item:a}=e,{i18n:u}=(0,Y.useTranslation)(),{fieldProps:d}=(0,s.b)(),{featureClientSchemaMap:f,schemaPath:h}=d;if(a.Component){let e;return l[0]!==n||l[1]!==r||l[2]!==o||l[3]!==i||l[4]!==a?(e=a?.Component&&(0,m.jsx)(a.Component,{active:n,anchorElem:r,editor:o,enabled:i,item:a},a.key),l[0]=n,l[1]=r,l[2]=o,l[3]=i,l[4]=a,l[5]=e):e=l[5],e}if(l[6]!==n||l[7]!==o||l[8]!==i||l[9]!==f||l[10]!==u||l[11]!==a||l[12]!==h){let e=a.key,r;a.label&&(e="function"==typeof a.label?a.label({featureClientSchemaMap:f,i18n:u,schemaPath:h}):a.label),r=e.length>25?e.substring(0,25)+"...":e,t=(0,m.jsx)(oM,{active:n,editor:o,enabled:i,Icon:a?.ChildComponent?(0,m.jsx)(a.ChildComponent,{}):void 0,item:a,itemKey:a.key,tooltip:e,children:(0,m.jsx)("span",{className:"text",children:r})},a.key),l[6]=n,l[7]=o,l[8]=i,l[9]=f,l[10]=u,l[11]=a,l[12]=h,l[13]=t}else t=l[13];return t}),oO=({anchorElem:e,classNames:t,editor:l,group:n,groupState:r,Icon:o,itemsContainerClassNames:i,label:a})=>{let{items:s,key:c}=n,u=(0,g.useMemo)(()=>s?.length?s.map(t=>(0,m.jsx)(oF,{active:r.activeItemKeys.includes(t.key),anchorElem:e,editor:l,enabled:r.enabledItemKeys.includes(t.key),item:t},t.key)):null,[s,r.activeItemKeys,r.enabledItemKeys,e,l]);return(0,m.jsx)(oj,{buttonAriaLabel:`${c} dropdown`,buttonClassName:[oI,`${oI}-${c}`,...t||[]].filter(Boolean).join(" "),disabled:!r.enabledGroup,dropdownKey:c,Icon:o,itemsContainerClassNames:[`${oI}-items`,...i||[]],label:a,children:u},c)};function oD(e,t){let[l,n]=(0,g.useState)(()=>(function(e){let t=new Map,l=new Map;if(!e?.length)return{groupStates:l,itemStates:t};for(let n of e){let e=[];for(let l of n.items)t.set(l.key,{active:!1,enabled:!0}),e.push(l.key);l.set(n.key,{activeItemKeys:[],activeItems:[],enabledGroup:!0,enabledItemKeys:e})}return{groupStates:l,itemStates:t}})(t)),r=(0,g.useDeferredValue)(l),o=(0,s.b)(),i=(0,g.useRef)(o);i.current=o;let c=(0,g.useRef)(t);c.current=t;let u=(0,a.e)(),d=(0,g.useCallback)(()=>{e.getEditorState().read(()=>{let t=(0,p.$getSelection)();if(!t)return;let l=c.current;if(!l?.length)return;let r=i.current,o=new Map,a=new Map;for(let n of l){let l=[],i=[],s=[],c="dropdown"===n.type?n.maxActiveItems??1:void 0;for(let a of n.items){let n=!!a.isActive&&(!c||l.length<c)&&a.isActive({editor:e,editorConfigContext:r,selection:t}),u=!a.isEnabled||a.isEnabled({editor:e,editorConfigContext:r,selection:t});n&&(l.push(a.key),i.push(a)),u&&s.push(a.key),o.set(a.key,{active:n,enabled:u})}let u="dropdown"!==n.type||!n.isEnabled||n.isEnabled({editor:e,editorConfigContext:r,selection:t});a.set(n.key,{activeItemKeys:l,activeItems:i,enabledGroup:u,enabledItemKeys:s})}n({groupStates:a,itemStates:o})})},[e]);return(0,g.useEffect)(()=>{u(d);let t=()=>u(d),l=(0,p.mergeRegister)(e.registerUpdateListener(t));return document.addEventListener("mouseup",t),()=>{l(),document.removeEventListener("mouseup",t)}},[e,u,d]),r}function oP({active:e,anchorElem:t,editor:l,enabled:n,item:r}){return r.Component?r?.Component&&(0,m.jsx)(r.Component,{anchorElem:t,editor:l,item:r},r.key):r.ChildComponent?(0,m.jsx)(ok,{active:e,editor:l,enabled:n,item:r,children:(0,m.jsx)(r.ChildComponent,{})},r.key):null}function oA({anchorElem:e,editor:t,editorConfig:l,group:n,index:r,toolbarStates:o}){let{i18n:i}=(0,Y.useTranslation)(),{fieldProps:{featureClientSchemaMap:a,schemaPath:c}}=(0,s.b)(),u=o.groupStates.get(n.key),d=(0,g.useMemo)(()=>{if("dropdown"!==n.type)return;let e=u?.activeItems?.[0];return e?e.ChildComponent:n.ChildComponent},[n,u?.activeItems]),f=(0,g.useMemo)(()=>{if("dropdown"!==n.type)return;let e=u?.activeItems;if(!e?.length)return;if(e.length>1)return i.t("lexical:general:toolbarItemsActive",{count:e.length});let t=e[0],l=t.key;return t.label&&(l="function"==typeof t.label?t.label({featureClientSchemaMap:a,i18n:i,schemaPath:c}):t.label),l.length>25&&(l=l.substring(0,25)+"..."),l},[n,u?.activeItems,i,a,c]);return(0,m.jsxs)("div",{className:`fixed-toolbar__group fixed-toolbar__group-${n.key}`,"data-toolbar-group-key":n.key,children:["dropdown"===n.type&&n.items.length&&u?(0,m.jsx)(oO,{anchorElem:e,editor:t,group:n,groupState:u,Icon:d,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:f}):null,"buttons"===n.type&&n.items.length?n.items.map(l=>{let n=o.itemStates.get(l.key);return(0,m.jsx)(oP,{active:n?.active??!1,anchorElem:e,editor:t,enabled:n?.enabled??!0,item:l},l.key)}):null,r<l.features.toolbarFixed?.groups.length-1&&(0,m.jsx)("div",{className:"divider"})]},n.key)}function oB({anchorElem:e,clientProps:t,editor:l,editorConfig:n,parentWithFixedToolbar:r}){let o=g.useRef(null),i=(0,W.useLexicalEditable)(),{y:a}=(0,G.useScrollInfo)(),s=oD(l,n?.features?.toolbarFixed?.groups),c=(0,g.useMemo)(()=>{if(!r||t?.disableIfParentHasFixedToolbar)return null;let e=r.editorContainerRef.current.previousElementSibling;for(;e;){if(e.classList.contains("fixed-toolbar"))return e;e=e.previousElementSibling}return null},[t?.disableIfParentHasFixedToolbar,r]);return(0,G.useThrottledEffect)(()=>{if(!c)return;let e=o.current;if(!e)return;let t=e.getBoundingClientRect(),l=c.getBoundingClientRect();if(t.bottom<l.top||t.top>l.bottom){if(!e.classList.contains("fixed-toolbar--overlapping"))return;e.classList.remove("fixed-toolbar--overlapping"),e.classList.add("fixed-toolbar"),c.classList.remove("fixed-toolbar--hide"),c.classList.add("fixed-toolbar")}else e.classList.remove("fixed-toolbar"),e.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),c.classList.remove("fixed-toolbar"),c.classList.add("fixed-toolbar","fixed-toolbar--hide")},50,[o,c,a]),(0,m.jsx)("div",{className:"fixed-toolbar",onFocus:e=>{e.stopPropagation()},ref:o,children:i&&(0,m.jsx)(g.Fragment,{children:n?.features&&n.features?.toolbarFixed?.groups.map((t,r)=>(0,m.jsx)(oA,{anchorElem:e,editor:l,editorConfig:n,group:t,index:r,toolbarStates:s},t.key))})})}var oH=e=>{if(e.parentEditor?.editorConfig){if(e.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return e.parentEditor;if(e.parentEditor)return oH(e.parentEditor)}return!1},oz=l_({plugins:[{Component:e=>{let t=(0,c.c)(6),{clientProps:l}=e,[n]=(0,u.useLexicalComposerContext)(),r=(0,s.b)();if(!(0,W.useLexicalEditable)())return null;let{editorConfig:o}=r,i=l.applyToFocusedEditor&&r.focusedEditor?.editor||n,a=l.applyToFocusedEditor&&r.focusedEditor?.editorConfig||o,d,f;if(t[0]!==l||t[1]!==i||t[2]!==a||t[3]!==r){f=Symbol.for("react.early_return_sentinel");e:{let e=oH(r);if(l?.disableIfParentHasFixedToolbar&&e||!a?.features?.toolbarFixed?.groups?.length){f=null;break e}d=(0,m.jsx)(oB,{anchorElem:document.body,clientProps:l,editor:i,editorConfig:a,parentWithFixedToolbar:e})}t[0]=l,t[1]=i,t[2]=a,t[3]=r,t[4]=d,t[5]=f}else d=t[4],f=t[5];return f!==Symbol.for("react.early_return_sentinel")?f:d},position:"aboveContainer"}]});function oK(e,t){let l=e.getRangeAt(0),n;if(e.anchorNode===t){let e=t;for(;null!=e.firstElementChild;)e=e.firstElementChild;n=e.getBoundingClientRect()}else n=l.getBoundingClientRect();return n}function oU(e){let{alwaysDisplayOnTop:t=!1,anchorElem:l,anchorFlippedOffset:n=0,floatingElem:r,horizontalOffset:o=32,horizontalPosition:i="left",specialHandlingForCaret:a=!1,targetRect:s,verticalGap:c=10}=e,u=l.parentElement;if(null===s||null==u){r.style.opacity="0",r.style.transform="translate(-10000px, -10000px)";return}let d=r.getBoundingClientRect(),f=l.getBoundingClientRect(),h=u.getBoundingClientRect(),p=s.top-d.height-c,g=s.left-o;"center"===i&&(g=s.left+s.width/2-d.width/2);let m=0;return t||!(p<h.top)||a||(p+=m=d.height+s.height+2*c),"center"===i?g+d.width>h.right?g=h.right-d.width-o:g<h.left&&(g=h.left+o):g+d.width>h.right&&(g=h.right-d.width-o),g-=f.left,r.style.opacity="1",a&&0!==n?(p-=f.bottom-n+d.height-3,r.style.transform=`translate(${g}px, ${p}px) rotate(180deg)`):(p-=f.top,r.style.transform=`translate(${g}px, ${p}px)`),m}function oV({active:e,anchorElem:t,editor:l,enabled:n,item:r}){return r.Component?r?.Component&&(0,m.jsx)(r.Component,{anchorElem:t,editor:l,item:r},r.key):r.ChildComponent?(0,m.jsx)(ok,{active:e,editor:l,enabled:n,item:r,children:(0,m.jsx)(r.ChildComponent,{})},r.key):null}function oW({anchorElem:e,editor:t,group:l,index:n,toolbarStates:r}){let{editorConfig:o}=(0,s.b)(),i=r.groupStates.get(l.key),a=(0,g.useMemo)(()=>"dropdown"!==l.type?void 0:i?.activeItems?.[0]?.ChildComponent??l.ChildComponent,[l,i?.activeItems]);return(0,m.jsxs)("div",{className:`inline-toolbar-popup__group inline-toolbar-popup__group-${l.key}`,"data-toolbar-group-key":l.key,children:["dropdown"===l.type&&l.items.length&&i?(0,m.jsx)(oO,{anchorElem:e,editor:t,group:l,groupState:i,Icon:a}):null,"buttons"===l.type&&l.items.length?l.items.map(l=>{let n=r.itemStates.get(l.key);return(0,m.jsx)(oV,{active:n?.active??!1,anchorElem:e,editor:t,enabled:n?.enabled??!0,item:l},l.key)}):null,n<o.features.toolbarInline?.groups.length-1&&(0,m.jsx)("div",{className:"divider"})]},l.key)}function oG({anchorElem:e,editor:t}){let l=(0,g.useRef)(null),n=(0,g.useRef)(null),{editorConfig:r}=(0,s.b)(),o=oD(t,r?.features?.toolbarInline?.groups),i=(0,g.useCallback)(()=>{if(l?.current){let e="0"===l.current.style.opacity,t="none"===l.current.style.pointerEvents;e||(l.current.style.opacity="0"),t||(l.current.style.pointerEvents="none")}},[l]),a=(0,g.useCallback)(e=>{if(l?.current&&(1===e.buttons||3===e.buttons)){let t="0"===l.current.style.opacity,n="none"===l.current.style.pointerEvents;if(!t||!n){let t=e.clientX,n=e.clientY,r=document.elementFromPoint(t,n);l.current.contains(r)||i()}}},[i]),c=(0,g.useCallback)(()=>{l?.current&&("1"!==l.current.style.opacity&&(l.current.style.opacity="1"),"auto"!==l.current.style.pointerEvents&&(l.current.style.pointerEvents="auto"))},[]);(0,g.useEffect)(()=>(document.addEventListener("mousemove",a),document.addEventListener("mouseup",c),()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",c)}),[l,a,c]);let u=(0,g.useCallback)(()=>{let r=(0,p.$getSelection)(),o=(0,p.getDOMSelection)(t._window);if(null===l.current)return;let a=e.querySelector(":scope > .link-editor"),s=null!==a&&"style"in a&&a?.style?.opacity==="1",c=t.getRootElement();if(null!==r&&null!==o&&!o.isCollapsed&&null!==c&&c.contains(o.anchorNode)){let t=oK(o,c),r=oU({alwaysDisplayOnTop:s,anchorElem:e,floatingElem:l.current,horizontalPosition:"center",targetRect:t});n.current&&oU({anchorElem:l.current,anchorFlippedOffset:r,floatingElem:n.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:t,verticalGap:8})}else i()},[t,i,e]);return(0,g.useEffect)(()=>{let l=e.parentElement,n=()=>{t.getEditorState().read(()=>{u()})};return window.addEventListener("resize",n),l&&l.addEventListener("scroll",n),()=>{window.removeEventListener("resize",n),l&&l.removeEventListener("scroll",n)}},[t,u,e]),(0,g.useEffect)(()=>(t.getEditorState().read(()=>{u()}),(0,p.mergeRegister)(t.registerUpdateListener(({editorState:e})=>{e.read(()=>{u()})}),t.registerCommand(p.SELECTION_CHANGE_COMMAND,()=>(u(),!1),p.COMMAND_PRIORITY_LOW))),[t,u]),(0,m.jsxs)("div",{className:"inline-toolbar-popup",ref:l,children:[(0,m.jsx)("div",{className:"caret",ref:n}),r?.features&&r.features?.toolbarInline?.groups.map((l,n)=>(0,m.jsx)(oW,{anchorElem:e,editor:t,group:l,index:n,toolbarStates:o},l.key))]})}var oJ=l_({plugins:[{Component:e=>{let{anchorElem:t}=e,[l]=(0,u.useLexicalComposerContext)();return function(e,t){let l,n,r,o=(0,c.c)(12),[i,a]=(0,g.useState)(!1),s=(0,W.useLexicalEditable)(),u;o[0]!==e?(u=()=>{e.getEditorState().read(()=>{if(e.isComposing())return;let t=(0,p.$getSelection)(),l=(0,p.getDOMSelection)(e._window),n=e.getRootElement();if(null!==l&&(!(0,p.$isRangeSelection)(t)||null===n||!n.contains(l.anchorNode)))return void a(!1);if(!(0,p.$isRangeSelection)(t))return;if(""!==t.getTextContent()){let e=t.getNodes(),l=!1;for(let t of e)if((0,p.$isTextNode)(t)){a(!0),l=!0;break}l||a(!1)}else a(!1);let r=t.getTextContent().replace(/\n/g,"");if(!t.isCollapsed()&&""===r)return void a(!1)})},o[0]=e,o[1]=u):u=o[1];let d=u,f,h;return(o[2]!==d?(f=()=>(document.addEventListener("selectionchange",d),document.addEventListener("mouseup",d),()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("mouseup",d)}),h=[d],o[2]=d,o[3]=f,o[4]=h):(f=o[3],h=o[4]),(0,g.useEffect)(f,h),o[5]!==e||o[6]!==d?(l=()=>(0,p.mergeRegister)(e.registerUpdateListener(()=>{d()}),e.registerRootListener(()=>{null===e.getRootElement()&&a(!1)})),n=[e,d],o[5]=e,o[6]=d,o[7]=l,o[8]=n):(l=o[7],n=o[8]),(0,g.useEffect)(l,n),i&&s)?(o[9]!==t||o[10]!==e?(r=(0,lu.createPortal)((0,m.jsx)(oG,{anchorElem:t,editor:e}),t),o[9]=t,o[10]=e,o[11]=r):r=o[11],r):null}(l,t)},position:"floatingAnchorElem"}]}),oY=()=>(0,m.jsx)("svg",{className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,m.jsx)("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"})}),oX=/^\|(.+)\|\s?$/,oZ=/^(\| ?:?-*:? ?)+\|\s?$/,oq=(e,t)=>{e=e.replace(/\\n/g,`
|
||
`);let l=ez(0);return(0,a.b)(e,t,l),l},oQ=(e,t)=>{let l=e.match(oX);return l&&l[1]?l[1].split("|").map(e=>oq(e,t)):null},o0=()=>(0,m.jsxs)("svg",{fill:"none",height:"18",viewBox:"0 0 20 20",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[(0,m.jsx)("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"}),(0,m.jsx)("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"}),(0,m.jsx)("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 o1(e){let t=e.getShape();return{columns:t.toX-t.fromX+1,rows:t.toY-t.fromY+1}}function o2({cellMerge:e,contextRef:t,onClose:l,setIsMenuOpen:n,tableCellNode:r}){let[o]=(0,u.useLexicalComposerContext)(),i=(0,g.useRef)(null),[a,s]=(0,g.useState)(r),[c,d]=(0,g.useState)({columns:1,rows:1}),[f,h]=(0,g.useState)(!1),[b,C]=(0,g.useState)(!1),{y:x}=(0,G.useScrollInfo)();(0,g.useEffect)(()=>o.registerMutationListener(eA,e=>{"updated"===e.get(a.getKey())&&o.getEditorState().read(()=>{s(a.getLatest())})},{skipInitialization:!0}),[o,a]),(0,g.useEffect)(()=>{o.getEditorState().read(()=>{let e=(0,p.$getSelection)();if(tu(e)){let t=o1(e);d(o1(e)),h(t.columns>1||t.rows>1)}C(function(){let e=(0,p.$getSelection)();if((0,p.$isRangeSelection)(e)&&!e.isCollapsed()||tu(e)&&!e.anchor.is(e.focus)||!(0,p.$isRangeSelection)(e)&&!tu(e))return!1;let[t]=to(e.anchor);return t.__colSpan>1||t.__rowSpan>1}())})},[o]),(0,g.useEffect)(()=>{let e=t.current,l=i.current,n=o.getRootElement();if(null!=e&&null!=l&&null!=n){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect();l.style.opacity="1";let o=l.getBoundingClientRect(),i=r.right+5;if(i+o.width>window.innerWidth||i+o.width>t.right){let e=r.left-o.width-5;i=(e<0?5:e)+window.pageXOffset}l.style.left=`${i+window.pageXOffset}px`;let a=r.top;if(a+o.height>window.innerHeight){let e=r.bottom-o.height;a=e<0?5:e}l.style.top=`${a}px`}},[t,i,o,x]),(0,g.useEffect)(()=>{function e(e){null!=i.current&&null!=t.current&&(0,p.isDOMNode)(e.target)&&!i.current.contains(e.target)&&!t.current.contains(e.target)&&n(!1)}return window.addEventListener("click",e),()=>window.removeEventListener("click",e)},[n,t]);let y=(0,g.useCallback)(()=>{o.update(()=>{if(a.isAttached()){let e=e1(a),t=tm(e,o.getElementByKey(e.getKey()));if(null===t)throw Error("Expected to find tableElement in DOM");let l=t_(t);null!==l&&l.$clearHighlight(),e.markDirty(),s(a.getLatest())}(0,p.$setSelection)(null)})},[o,a]),v=(0,g.useCallback)(e=>{o.update(()=>{for(let t=0;t<c.rows;t++)e5(e);l()})},[o,l,c.rows]),_=(0,g.useCallback)(e=>{o.update(()=>{for(let t=0;t<c.columns;t++)e7(e);l()})},[o,l,c.columns]),S=(0,g.useCallback)(()=>{o.update(()=>{(function(){let e=(0,eO.$getSelection)();(0,eO.$isRangeSelection)(e)||tu(e)||eV(188);let[t,l]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[n,,r]=to(t),[o]=to(l),[i,a,s]=tn(r,n,o),{startRow:c}=a,{startRow:u}=s,d=u+o.__rowSpan-1;if(i.length===d-c+1)return r.remove();let f=i[0].length,h=i[d+1],p=r.getChildAtIndex(d+1);for(let e=d;e>=c;e--){for(let t=f-1;t>=0;t--){let{cell:l,startRow:n,startColumn:r}=i[e][t];if(r===t){if(n<c||n+l.__rowSpan-1>d){let e=Math.max(n,c),t=Math.min(l.__rowSpan+n-1,d),r=e<=t?t-e+1:0;l.setRowSpan(l.__rowSpan-r)}if(n>=c&&n+l.__rowSpan-1>d&&e===d){null===p&&eV(122);let n=null;for(let l=0;l<t;l++){let t=h[l],r=t.cell;t.startRow===e+1&&(n=r),r.__colSpan>1&&(l+=r.__colSpan-1)}null===n?te(p,l):n.insertAfter(l)}}}let t=r.getChildAtIndex(e);eY(t)||eV(206,String(e)),t.remove()}if(void 0!==h){let{cell:e}=h[0];e9(e)}else{let{cell:e}=i[c-1][0];e9(e)}})(),l()})},[o,l]),N=(0,g.useCallback)(()=>{o.update(()=>{e1(a).remove(),y(),l()})},[o,a,y,l]),w=(0,g.useCallback)(()=>{o.update(()=>{(function(){let e=(0,eO.$getSelection)();(0,eO.$isRangeSelection)(e)||tu(e)||eV(188);let t=e.anchor.getNode(),l=e.focus.getNode(),[n,,r]=to(t),[o]=to(l),[i,a,s]=tn(r,n,o),{startColumn:c}=a,{startRow:u,startColumn:d}=s,f=Math.min(c,d),h=Math.max(c+n.__colSpan-1,d+o.__colSpan-1),p=h-f+1;if(i[0].length===h-f+1)return r.selectPrevious(),r.remove();let g=i.length;for(let e=0;e<g;e++)for(let t=f;t<=h;t++){let{cell:l,startColumn:n}=i[e][t];if(n<f){if(t===f){let e=f-n;l.setColSpan(l.__colSpan-Math.min(p,l.__colSpan-e))}}else if(n+l.__colSpan-1>h){if(t===h){let e=h-n+1;l.setColSpan(l.__colSpan-e)}}else l.remove()}let m=i[u],b=c>d?m[c+n.__colSpan]:m[d+o.__colSpan];if(void 0!==b){let{cell:e}=b;e9(e)}else{let{cell:e}=d<c?m[d-1]:m[c-1];e9(e)}let C=r.getColWidths();if(C){let e=[...C];e.splice(f,p),r.setColWidths(e)}})(),l()})},[o,l]),k=(0,g.useCallback)(()=>{o.update(()=>{let e=e1(a),t=e2(a),[n]=tr(e,null,null),r=new Set,o=1^a.getHeaderStyles();if(n[t])for(let e=0;e<n[t].length;e++){let l=n[t][e];l?.cell&&(r.has(l.cell)||(r.add(l.cell),l.cell.setHeaderStyles(o,1)))}y(),l()})},[o,a,y,l]),T=(0,g.useCallback)(()=>{o.update(()=>{let e=e1(a),t=e3(a),[n]=tr(e,null,null),r=new Set,o=2^a.getHeaderStyles();if(n)for(let e=0;e<n.length;e++){let l=n?.[e]?.[t];l?.cell&&(r.has(l.cell)||(r.add(l.cell),l.cell.setHeaderStyles(o,2)))}y(),l()})},[o,a,y,l]),E=(0,g.useCallback)(()=>{o.update(()=>{if(a.isAttached()){let e=e1(a);e&&e.setRowStriping(!e.getRowStriping())}y(),l()})},[o,a,y,l]),$=(0,g.useCallback)(()=>{o.update(()=>{if(a.isAttached()){let e=e1(a);e&&e.setFrozenColumns(+(0===e.getFrozenColumns()))}y(),l()})},[o,a,y,l]),L=null;return e&&(f?L=(0,m.jsx)("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>void o.update(()=>{let e,t=(0,p.$getSelection)();if(!tu(t))return;let n=tt(t.getNodes().filter(eK));n&&(e=n.getLastDescendant(),(0,p.$isTextNode)(e)?e.select():(0,p.$isElementNode)(e)?e.selectEnd():null!==e&&e.selectNext(),l())}),type:"button",children:(0,m.jsx)("span",{className:"text",children:"Merge cells"})}):b&&(L=(0,m.jsx)("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>void o.update(()=>{let e,t,l;e=(0,eO.$getSelection)(),(0,eO.$isRangeSelection)(e)||tu(e)||eV(188),t=e.anchor.getNode(),l=(0,eO.$findMatchingParent)(t,eK),eK(l)||eV(148),tl(l)}),type:"button",children:(0,m.jsx)("span",{className:"text",children:"Unmerge cells"})}))),(0,lu.createPortal)((0,m.jsxs)("div",{className:"table-action-menu-dropdown",onClick:e=>{e.stopPropagation()},ref:i,children:[L?(0,m.jsxs)(g.Fragment,{children:[L,(0,m.jsx)("hr",{})]}):null,(0,m.jsx)("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>E(),type:"button",children:(0,m.jsx)("span",{className:"text",children:"Toggle Row Striping"})}),(0,m.jsx)("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>$(),type:"button",children:(0,m.jsx)("span",{className:"text",children:"Toggle First Column Freeze"})}),(0,m.jsx)("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>v(!1),type:"button",children:(0,m.jsxs)("span",{className:"text",children:["Insert ",1===c.rows?"row":`${c.rows} rows`," above"]})}),(0,m.jsx)("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>v(!0),type:"button",children:(0,m.jsxs)("span",{className:"text",children:["Insert ",1===c.rows?"row":`${c.rows} rows`," below"]})}),(0,m.jsx)("hr",{}),(0,m.jsx)("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>_(!1),type:"button",children:(0,m.jsxs)("span",{className:"text",children:["Insert ",1===c.columns?"column":`${c.columns} columns`," ","left"]})}),(0,m.jsx)("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>_(!0),type:"button",children:(0,m.jsxs)("span",{className:"text",children:["Insert ",1===c.columns?"column":`${c.columns} columns`," ","right"]})}),(0,m.jsx)("hr",{}),(0,m.jsx)("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>w(),type:"button",children:(0,m.jsx)("span",{className:"text",children:"Delete column"})}),(0,m.jsx)("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>S(),type:"button",children:(0,m.jsx)("span",{className:"text",children:"Delete row"})}),(0,m.jsx)("button",{className:"item","data-test-id":"table-delete",onClick:()=>N(),type:"button",children:(0,m.jsx)("span",{className:"text",children:"Delete table"})}),(0,m.jsx)("hr",{}),(0,m.jsx)("button",{className:"item","data-test-id":"table-row-header",onClick:()=>k(),type:"button",children:(0,m.jsxs)("span",{className:"text",children:[(1&a.__headerState)==1?"Remove":"Add"," ","row header"]})}),(0,m.jsx)("button",{className:"item","data-test-id":"table-column-header",onClick:()=>T(),type:"button",children:(0,m.jsxs)("span",{className:"text",children:[(2&a.__headerState)==2?"Remove":"Add"," ","column header"]})})]}),document.body)}function o3({anchorElem:e,cellMerge:t}){let[l]=(0,u.useLexicalComposerContext)(),n=(0,g.useRef)(null),r=(0,g.useRef)(null),[o,i]=(0,g.useState)(!1),[a,s]=(0,g.useState)(null),c=(0,g.useCallback)(()=>{let t=n.current,r=(0,p.$getSelection)(),o=(0,p.getDOMSelection)(l._window),i=document.activeElement;function a(){t&&(t.classList.remove("table-cell-action-button-container--active"),t.classList.add("table-cell-action-button-container--inactive")),s(null)}if(null==r||null==t)return a();let c=l.getRootElement(),u=null,d=null;if((0,p.$isRangeSelection)(r)&&null!==c&&null!==o&&c.contains(o.anchorNode)){let e=eQ(r.anchor.getNode());if(null==e||null==(d=l.getElementByKey(e.getKey()))||!e.isAttached())return a();let t=e1(e),n=tm(t,l.getElementByKey(t.getKey()));if(null===n)throw Error("TableActionMenu: Expected to find tableElement in DOM");u=t_(n),s(e)}else if(tu(r)){let e=eQ(r.anchor.getNode());if(!eK(e))throw Error("TableSelection anchorNode must be a TableCellNode");let t=e1(e),n=tm(t,l.getElementByKey(t.getKey()));if(null===n)throw Error("TableActionMenu: Expected to find tableElement in DOM");u=t_(n),d=l.getElementByKey(e.getKey())}else if(!i)return a();if(null===u||null===d)return a();let f=!u||!u.isSelecting;if(t.classList.toggle("table-cell-action-button-container--active",f),t.classList.toggle("table-cell-action-button-container--inactive",!f),f){let l=d.getBoundingClientRect(),n=e.getBoundingClientRect(),r=l.top-n.top,o=l.right-n.left;t.style.transform=`translate(${o}px, ${r}px)`}},[l,e]);(0,g.useEffect)(()=>{let e,t=()=>{e=void 0,l.getEditorState().read(c)},n=()=>(void 0===e&&(e=setTimeout(t,0)),!1);return(0,p.mergeRegister)(l.registerUpdateListener(n),l.registerCommand(p.SELECTION_CHANGE_COMMAND,n,p.COMMAND_PRIORITY_CRITICAL),l.registerRootListener((e,t)=>{t&&t.removeEventListener("pointerup",n),e&&(e.addEventListener("pointerup",n),n())}),()=>clearTimeout(e))});let d=(0,g.useRef)(a);return(0,g.useEffect)(()=>{d.current!==a&&i(!1),d.current=a},[d,a]),(0,m.jsx)("div",{className:"table-cell-action-button-container",ref:n,children:null!=a&&(0,m.jsxs)(g.Fragment,{children:[(0,m.jsx)("button",{className:"table-cell-action-button",onClick:e=>{e.stopPropagation(),i(!o)},ref:r,type:"button",children:(0,m.jsx)(o0,{})}),o&&(0,m.jsx)(o2,{cellMerge:t,contextRef:r,onClose:()=>i(!1),setIsMenuOpen:i,tableCellNode:a})]})})}function o6({editor:e}){let t=(0,g.useRef)(null),l=(0,g.useRef)(null),n=(0,g.useRef)(null),[r,o]=(0,g.useState)(!1),i=(0,s.b)(),a=(0,g.useRef)(null),[c,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(null),[h,b]=(0,g.useState)(!1),[C,x]=(0,g.useState)(null),y=(0,g.useCallback)(()=>{f(null),t.current=null,x(null),a.current=null,n.current=null},[]);(0,g.useEffect)(()=>{let t=new Set;return(0,p.mergeRegister)(e.registerMutationListener(tG,e=>{for(let[l,n]of e)"destroyed"===n?t.delete(l):t.add(l);o(t.size>0)}),e.registerNodeTransform(tG,e=>{if(e.getColWidths())return e;let t=e.getColumnCount();return e.setColWidths(Array(t).fill(92)),e}))},[e]),(0,g.useEffect)(()=>{if(!r)return;let o=r=>{let o=r.target;if((0,p.isHTMLElement)(o)){if(C)return void u({x:r.clientX,y:r.clientY});if(b((1&r.buttons)==1),!(l.current&&l.current.contains(o))&&t.current!==o){t.current=o;let l=tS(o);l&&d!==l?e.getEditorState().read(()=>{let r=(0,p.$getNearestNodeFromDOMNode)(l.elem);if(!r)throw Error("TableCellResizer: Table cell node not found.");let i=e1(r),a=tm(i,e.getElementByKey(i.getKey()));if(!a)throw Error("TableCellResizer: Table element not found.");t.current=o,n.current=a.getBoundingClientRect(),f(l)},{editor:e}):null==l&&y()}}},i=e=>{b(!0)},a=e=>{b(!1)},s=e.registerRootListener((e,t)=>{t?.removeEventListener("mousemove",o),t?.removeEventListener("mousedown",i),t?.removeEventListener("mouseup",a),e?.addEventListener("mousemove",o),e?.addEventListener("mousedown",i),e?.addEventListener("mouseup",a)});return()=>{s()}},[d,C,e,r,y]);let v=(0,g.useCallback)(t=>{if(!d)throw Error("TableCellResizer: Expected active cell.");e.update(()=>{let l=(0,p.$getNearestNodeFromDOMNode)(d.elem);if(!eK(l))throw Error("TableCellResizer: Table cell node not found.");let n=e1(l),r=e2(l),o=n.getChildren(),i=l.getColSpan()===n.getColumnCount()?r:r+l.getRowSpan()-1;if(i>=o.length||i<0)throw Error("Expected table cell to be inside of table row.");let a=o[i];if(!eY(a))throw Error("Expected table row");let s=a.getHeight();void 0===s&&(s=Math.min(...a.getChildren().map(t=>_(t,e)??1/0)));let c=Math.max(s+t,33);a.setHeight(c)},{tag:p.SKIP_SCROLL_INTO_VIEW_TAG})},[d,e]),_=(e,t)=>t.getElementByKey(e.getKey())?.clientHeight,S=(0,g.useCallback)(t=>{if(!d)throw Error("TableCellResizer: Expected active cell.");e.update(()=>{let e,l=(0,p.$getNearestNodeFromDOMNode)(d.elem);if(!eK(l))throw Error("TableCellResizer: Table cell node not found.");let n=e1(l),[r]=tr(n,null,null),o=(r.forEach(t=>{t.forEach((t,n)=>{t.cell===l&&(e=n)})}),e);if(void 0===o)throw Error("TableCellResizer: Table column not found.");let i=n.getColWidths();if(!i)return;let a=i[o];if(void 0===a)return;let s=[...i],c=Math.max(a+t,92);s[o]=c,n.setColWidths(s)},{tag:p.SKIP_SCROLL_INTO_VIEW_TAG})},[d,e]),N=(0,g.useCallback)(e=>{let t=l=>{if(l.preventDefault(),l.stopPropagation(),!d)throw Error("TableCellResizer: Expected active cell.");if(a.current){let{x:n,y:r}=a.current;if(null===d)return;let o=(0,et.calculateZoomLevel)(l.target);"bottom"===e?v((l.clientY-r)/o):S((l.clientX-n)/o),y(),document.removeEventListener("mouseup",t)}};return t},[d,y,S,v]),w=(0,g.useCallback)(e=>t=>{if(t.preventDefault(),t.stopPropagation(),!d)throw Error("TableCellResizer: Expected active cell.");a.current={x:t.clientX,y:t.clientY},u(a.current),x(e),document.addEventListener("mouseup",N(e))},[d,N]),[k,T]=(0,g.useState)({bottom:null,left:null,right:null,top:null});return(0,g.useEffect)(()=>{if(d){let{height:e,left:t,top:l,width:r}=d.elem.getBoundingClientRect(),o=(0,et.calculateZoomLevel)(d.elem),i={bottom:{backgroundColor:"none",cursor:"row-resize",height:"10px",left:`${window.scrollX+t}px`,top:`${window.scrollY+l+e-5}px`,width:`${r}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${e}px`,left:`${window.scrollX+t+r-5}px`,top:`${window.scrollY+l}px`,width:"10px"}},a=n.current;C&&c&&a&&("bottom"===C?(i[C].left=`${window.scrollX+a.left}px`,i[C].top=`${window.scrollY+c.y/o}px`,i[C].height="3px",i[C].width=`${a.width}px`):(i[C].top=`${window.scrollY+a.top}px`,i[C].left=`${window.scrollX+c.x/o}px`,i[C].width="3px",i[C].height=`${a.height}px`),i[C].backgroundColor="#adf"),T(i)}else T({bottom:null,left:null,right:null,top:null})},[d,C,c]),(0,m.jsx)("div",{ref:l,children:null!=d&&!h&&(0,m.jsxs)(g.Fragment,{children:[(0,m.jsx)("div",{className:`${i.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:w("right"),style:k.right||void 0}),(0,m.jsx)("div",{className:`${i.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:w("bottom"),style:k.bottom||void 0})]})})}var o5=Math.max,o4=Math.min,o7=function(e,t,l){let n,r,o=0,i,a=!1,s=!1,c,u,d,f=!0;if("function"!=typeof e)throw TypeError("Expected a function");function h(t){let l=n,r=i;return n=i=void 0,o=t,u=e.apply(r,l)}function p(e){let l=e-r,n=e-o;return void 0===r||l>=t||l<0||s&&n>=c}function g(){let e,l,n,i=Date.now();if(p(i))return m(i);d=setTimeout(g,(e=i-r,l=i-o,n=t-e,s?o4(n,c-l):n))}function m(e){return d=void 0,f&&n?h(e):(n=i=void 0,u)}function b(){let e=Date.now(),l=p(e);if(n=arguments,i=this,r=e,l){if(void 0===d){var c;return o=c=r,d=setTimeout(g,t),a?h(c):u}if(s)return clearTimeout(d),d=setTimeout(g,t),h(r)}return void 0===d&&(d=setTimeout(g,t)),u}return t=t||0,"object"==typeof l&&(a=!!l.leading,c=(s="maxWait"in l)?o5(l.maxWait||0,t):c,f="trailing"in l?!!l.trailing:f),b.cancel=function(){void 0!==d&&clearTimeout(d),o=0,n=r=i=d=void 0},b.flush=function(){return void 0===d?u:m(Date.now())},b};function o8({anchorElem:e}){var t;let l,n,r,o,i,[a]=(0,u.useLexicalComposerContext)(),d=(0,W.useLexicalEditable)(),f=(0,s.b)(),[h,b]=(0,g.useState)(!1),[C,x]=(0,g.useState)(!1),[y,v]=(0,g.useState)(!1),[_,S]=(0,g.useState)({}),N=(0,g.useRef)(new Set),w=(0,g.useRef)(null),k=(t=t=>{let{isOutside:l,tableDOMNode:n}=function(e,t){let l=e.target;if(!(0,p.isHTMLElement)(l))return{isOutside:!0,tableDOMNode:null};{let e=l.closest(`td.${t.theme.tableCell}, th.${t.theme.tableCell}`);return{isOutside:!(e||l.closest(`button.${t.theme.tableAddRows}`)||l.closest(`button.${t.theme.tableAddColumns}`)||l.closest(`div.${t.theme.tableCellResizer}`)),tableDOMNode:e}}}(t,f.editorConfig?.lexical);if(l){b(!1),x(!1);return}if(!n)return;w.current=n;let r=null,o=null,i=null;if(a.getEditorState().read(()=>{let e=(0,p.$getNearestNodeFromDOMNode)(n);if(eK(e)){let t=(0,p.$findMatchingParent)(e,e=>tX(e));if(!tX(t))return;if(i=tm(t,a.getElementByKey(t.getKey()))){let l=t.getChildrenSize(),n=t.getChildAtIndex(0)?.getChildrenSize(),i=e2(e),a=e3(e);i===l-1?r=e:a===n-1&&(o=e)}}},{editor:a}),!i)return;let s=i.parentElement;if(!s)return;let{bottom:c,height:u,left:d,right:h,width:g,y:m}=i.getBoundingClientRect(),C=!1;s&&s.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(C=s.scrollWidth>s.clientWidth);let{left:y,y:v}=e.getBoundingClientRect();r?(x(!1),b(!0),S({height:20,left:C&&s?s.offsetLeft:d-y,top:c-v+5,width:C&&s?s.offsetWidth:g})):o&&(x(!0),b(!1),S({height:u,left:h-y+5,top:m-v,width:20}))},n=(0,c.c)(6),r=(0,g.useRef)(null),n[0]!==t||250!==n[1]||50!==n[2]?(o=()=>(r.current=o7(t,50,{maxWait:250}),()=>{r.current?.cancel()}),i=[t,50,250],n[0]=t,n[1]=250,n[2]=50,n[3]=o,n[4]=i):(o=n[3],i=n[4]),(0,g.useEffect)(o,i),n[5]===Symbol.for("react.memo_cache_sentinel")?(l=(...e)=>{r.current&&r.current(...e)},n[5]=l):l=n[5],l),T=(0,g.useMemo)(()=>new ResizeObserver(()=>{b(!1),x(!1)}),[]);(0,g.useEffect)(()=>{if(y)return document.addEventListener("mousemove",k),()=>{b(!1),x(!1),document.removeEventListener("mousemove",k)}},[y,k]),(0,g.useEffect)(()=>(0,p.mergeRegister)(a.registerMutationListener(tG,e=>{a.getEditorState().read(()=>{let t=!1;for(let[l,n]of e)switch(n){case"created":N.current.add(l),t=!0;break;case"destroyed":N.current.delete(l),t=!0}if(t){for(let e of(T.disconnect(),N.current)){let{tableElement:t}=tf(e);T.observe(t)}v(N.current.size>0)}},{editor:a})},{skipInitialization:!1})),[a,T]);let E=e=>{a.update(()=>{w.current&&((0,p.$getNearestNodeFromDOMNode)(w.current)?.selectEnd(),e?(e5(),b(!1)):(e7(),x(!1)))})};return d?(0,m.jsxs)(m.Fragment,{children:[h&&(0,m.jsx)("button",{"aria-label":"Add Row",className:f.editorConfig.lexical.theme.tableAddRows,onClick:()=>E(!0),style:{..._},type:"button"}),C&&(0,m.jsx)("button",{"aria-label":"Add Column",className:f.editorConfig.lexical.theme.tableAddColumns,onClick:()=>E(!1),style:{..._},type:"button"})]}):null}var o9=(0,p.createCommand)("OPEN_EMBED_DRAWER_COMMAND"),ie=(0,g.createContext)({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}}),it=l_({markdownTransformers:[({allTransformers:e})=>({type:"element",dependencies:[tG,eW,eA],export:t=>{if(!tX(t))return null;let l=[];for(let n of t.getChildren()){let t=[];if(!eY(n))continue;let r=!1;for(let l of n.getChildren())eK(l)&&(t.push((0,a.c)(e,l).replace(/\n/g,"\\n").trim()),1===l.__headerState&&(r=!0));l.push(`| ${t.join(" | ")} |`),r&&l.push(`| ${t.map(e=>"---").join(" | ")} |`)}return l.join(`
|
||
`)},regExp:oX,replace:(t,l,n)=>{let r,o=n[0];if(!o)return;if(oZ.test(o)){let e=t.getPreviousSibling();if(!e||!tX(e))return;let l=e.getChildren(),n=l[l.length-1];if(!n||!eY(n))return;n.getChildren().forEach(e=>{eK(e)&&e.setHeaderStyles(1,1)}),t.remove();return}let i=oQ(o,e);if(null==i)return;let a=[i],s=t.getPreviousSibling(),c=i.length;for(;s&&!(!(0,p.$isParagraphNode)(s)||1!==s.getChildrenSize());){let t=s.getFirstChild();if(!(0,p.$isTextNode)(t))break;let l=oQ(t.getTextContent(),e);if(null==l)break;c=Math.max(c,l.length),a.unshift(l);let n=s.getPreviousSibling();s.remove(),s=n}let u=tY();for(let t of a){let l=eJ();u.append(l);for(let n=0;n<c;n++)l.append(n<t.length?t[n]:oq("",e))}let d=t.getPreviousSibling();tX(d)&&(eY(r=d.getFirstChild())?r.getChildrenSize():0)===c?(d.append(...u.getChildren()),t.remove()):t.replace(u),u.selectEnd()}})],nodes:[tG,eA,eW],plugins:[{Component:()=>{let e,t,l,n=(0,c.c)(16),[i]=(0,u.useLexicalComposerContext)(),a=(0,g.use)(ie),d=(0,G.useEditDepth)(),{fieldProps:f,uuid:h}=(0,s.b)(),{schemaPath:b}=f,C="lexical-table-create-"+h,x;n[0]!==d||n[1]!==C?(x=(0,G.formatDrawerSlug)({slug:C,depth:d}),n[0]=d,n[1]=C,n[2]=x):x=n[2];let y=x,{toggleDrawer:v}=(0,o.a)(y,!0),_;return n[3]!==i||n[4]!==v?(_=()=>{if(!i.hasNodes([tG,eW,eA]))throw Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return(0,p.mergeRegister)(i.registerCommand(o9,()=>{let e=null;return i.getEditorState().read(()=>{let t=(0,p.$getSelection)();(0,p.$isRangeSelection)(t)&&(e=t)}),e&&v(),!0},p.COMMAND_PRIORITY_EDITOR))},n[3]=i,n[4]=v,n[5]=_):_=n[5],n[6]!==a||n[7]!==i||n[8]!==v?(e=[a,i,v],n[6]=a,n[7]=i,n[8]=v,n[9]=e):e=n[9],(0,g.useEffect)(_,e),n[10]!==i?(t=(e,t)=>{t.columns&&t.rows&&i.dispatchCommand(eU,{columns:String(t.columns),rows:String(t.rows)})},n[10]=i,n[11]=t):t=n[11],n[12]!==y||n[13]!==b||n[14]!==t?(l=(0,m.jsxs)(g.Fragment,{children:[(0,m.jsx)(r.a,{drawerSlug:y,drawerTitle:"Create Table",featureKey:"experimental_table",handleDrawerSubmit:t,schemaPath:b,schemaPathSuffix:"fields"}),(0,m.jsx)(lg,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]}),n[12]=y,n[13]=b,n[14]=t,n[15]=l):l=n[15],l},position:"normal"},{Component:()=>{let e=(0,c.c)(3),[t]=(0,u.useLexicalComposerContext)(),l=(0,W.useLexicalEditable)(),n;return e[0]!==t||e[1]!==l?(n=l?(0,lu.createPortal)((0,m.jsx)(o6,{editor:t}),document.body):null,e[0]=t,e[1]=l,e[2]=n):n=e[2],n},position:"normal"},{Component:e=>{let t=(0,c.c)(3),{anchorElem:l}=e,n=(0,W.useLexicalEditable)(),r;return t[0]!==l||t[1]!==n?(r=(0,lu.createPortal)(n?(0,m.jsx)(o3,{anchorElem:l??document.body,cellMerge:!0}):null,l??document.body),t[0]=l,t[1]=n,t[2]=r):r=t[2],r},position:"floatingAnchorElem"},{Component:function(e){let t,l=(0,c.c)(2),{anchorElem:n}=e,r=void 0===n?document.body:n;return(0,W.useLexicalEditable)()?(l[0]!==r?(t=(0,lu.createPortal)((0,m.jsx)(o8,{anchorElem:r}),r),l[0]=r,l[1]=t):t=l[1],t):null},position:"floatingAnchorElem"}],providers:[function({children:e}){let[t,l]=(0,g.useState)({cellEditorConfig:null,cellEditorPlugins:null});return(0,m.jsx)(ie,{value:(0,g.useMemo)(()=>({cellEditorConfig:t.cellEditorConfig,cellEditorPlugins:t.cellEditorPlugins,set:(e,t)=>{l({cellEditorConfig:e,cellEditorPlugins:t})}}),[t.cellEditorConfig,t.cellEditorPlugins]),children:e})}],slashMenu:{groups:[ly([{Icon:oY,key:"table",keywords:["table"],label:"Table",onSelect:({editor:e})=>{e.dispatchCommand(o9,{})}}])]},toolbarFixed:{groups:[nL([{ChildComponent:oY,key:"table",label:"Table",onSelect:({editor:e})=>{e.dispatchCommand(o9,{})}}])]}}),il=()=>(0,m.jsxs)("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:[(0,m.jsx)("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"}),(0,m.jsx)("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"}),(0,m.jsx)("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"})]});function ir(e,t){if(e.hasAttribute("data-lexical-pending-upload-form-id")){let l=e.getAttribute("data-lexical-pending-upload-form-id");if(null!=l)return{node:t({data:{pending:{formID:l,src:e.getAttribute("src")||""}}})}}if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let l=e.getAttribute("data-lexical-upload-id"),n=e.getAttribute("data-lexical-upload-relation-to");if(null!=l&&null!=n)return{node:t({data:{fields:{},relationTo:n,value:l}})}}return{node:t({data:{pending:{formID:new V.default.default().toHexString(),src:e.getAttribute("src")||""}}})}}var io=class extends f{__data;constructor({data:e,format:t,key:l}){super(t,l),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:e=>ir(e,ii),priority:0})}}static importJSON(e){1===e.version&&e?.value?.id&&(e.value=e.value.id),2!==e.version||e?.id||(e.id=new V.default.default().toHexString(),e.version=3);let t=ii({data:{id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value}});return t.setFormat(e.format),t}static isInline(){return!1}createDOM(e){let t=document.createElement("div");return(0,p.addClassNamesToElement)(t,e?.theme?.upload),t}decorate(){return null}exportDOM(){let e=document.createElement("img"),t=this.__data;return t.pending?(e.setAttribute("data-lexical-pending-upload-form-id",String(t?.pending?.formID)),e.setAttribute("src",t?.pending?.src||"")):(e.setAttribute("data-lexical-upload-id",String(t?.value)),e.setAttribute("data-lexical-upload-relation-to",t?.relationTo)),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(e){this.getWritable().__data=e}updateDOM(){return!1}};function ii({data:e}){return e?.id||(e.id=new V.default.default().toHexString()),(0,p.$applyNodeReplacement)(new io({data:e}))}var ia=()=>(0,m.jsx)("div",{className:"lexical-upload",children:(0,m.jsx)(lb.ShimmerEffect,{height:"95px",width:"203px"})}),is=g.lazy(()=>e.A(809010).then(e=>({default:e.UploadComponent}))),ic=class extends io{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:e=>ir(e,iu),priority:0})}}static importJSON(e){1===e.version&&e?.value?.id&&(e.value=e.value.id),2!==e.version||e?.id||(e.id=new V.default.default().toHexString(),e.version=3);let t=iu({data:{id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value}});return t.setFormat(e.format),t}decorate(e,t){return this.__data.pending?(0,m.jsx)(ia,{}):(0,m.jsx)(is,{className:t?.theme?.upload??"LexicalEditorTheme__upload",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function iu({data:e}){return e?.id||(e.id=new V.default.default().toHexString()),(0,p.$applyNodeReplacement)(new ic({data:e}))}function id(e){return e instanceof ic}var ih=e=>{let t,l=(0,c.c)(13),{enabledCollectionSlugs:n}=e,[o]=(0,u.useLexicalComposerContext)(),[i,a]=(0,g.useState)(null),s;l[0]!==n?(s={collectionSlugs:n,uploads:!0},l[0]=n,l[1]=s):s=l[1];let{closeListDrawer:d,ListDrawer:f,openListDrawer:h}=om(s),b,C;l[2]!==o||l[3]!==h?(b=()=>o.registerCommand(r.b,e=>(a(e?.replace?e?.replace.nodeKey:null),h(),!0),p.COMMAND_PRIORITY_EDITOR),C=[o,h],l[2]=o,l[3]=h,l[4]=b,l[5]=C):(b=l[4],C=l[5]),(0,g.useEffect)(b,C),l[6]!==d||l[7]!==o||l[8]!==i?(t=e=>{let{collectionSlug:t,doc:l}=e;d(),(({editor:e,relationTo:t,replaceNodeKey:l,value:n})=>{l?e.update(()=>{let e=(0,p.$getNodeByKey)(l);e&&e.replace(iu({data:{fields:null,relationTo:t,value:n}}))}):e.dispatchCommand(ib,{fields:null,relationTo:t,value:n})})({editor:o,relationTo:t,replaceNodeKey:i,value:l.id})},l[6]=d,l[7]=o,l[8]=i,l[9]=t):t=l[9];let x=t,y;return l[10]!==f||l[11]!==x?(y=(0,m.jsx)(f,{onSelect:x}),l[10]=f,l[11]=x,l[12]=y):y=l[12],y},ip=()=>{let e=(0,c.c)(3),[t]=(0,u.useLexicalComposerContext)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(r.b,im,p.COMMAND_PRIORITY_EDITOR),n=[t],e[0]=t,e[1]=l,e[2]=n):(l=e[1],n=e[2]),(0,g.useEffect)(l,n),null},ig=({enabledCollectionSlugs:e})=>e?.length?(0,m.jsx)(ih,{enabledCollectionSlugs:e}):(0,m.jsx)(ip,{});function im(){return G.toast.error("No upload collections enabled"),!0}var ib=(0,p.createCommand)("INSERT_UPLOAD_COMMAND");function iC(e){return{file:e.file,formID:e.formID}}function ix(){for(let e of(0,et.$dfsIterator)()){let t=e.node;id(t)&&t.getData()?.pending&&t.remove()}}function iy(e){return[e.formID,e]}var iv=l_({nodes:[ic],plugins:[{Component:e=>{let t,l,n=(0,c.c)(21),{clientProps:r}=e,[o]=(0,u.useLexicalComposerContext)(),i=r?.disabledCollections,a=r?.enabledCollections,s;n[0]!==i||n[1]!==a?(s={collectionSlugsBlacklist:i,collectionSlugsWhitelist:a,uploads:!0},n[0]=i,n[1]=a,n[2]=s):s=n[2];let{enabledCollectionSlugs:d}=ov(s),{drawerSlug:f,setCollectionSlug:h,setInitialForms:b,setOnCancel:C,setOnSuccess:x,setSelectableCollections:y}=(0,G.useBulkUpload)(),{isModalOpen:v,openModal:_}=(0,G.useModal)(),S;n[3]!==f||n[4]!==o||n[5]!==d||n[6]!==v||n[7]!==_||n[8]!==h||n[9]!==b||n[10]!==C||n[11]!==x||n[12]!==y?(S=e=>{let{files:t}=e;if(t?.length!==0&&(b(e=>[...e??[],...t.map(iC)]),!v(f))){if(!d.length||!d[0])return;h(d[0]),y(d),C(()=>{o.update(ix)}),x(e=>{let t=new Map(e.map(iy));o.update(()=>{for(let e of(0,et.$dfsIterator)()){let l=e.node;if(id(l)){let e=l.getData();if(e?.pending){let n=t.get(e.pending?.formID);n&&l.replace(iu({data:{id:new V.default.default().toHexString(),fields:{},relationTo:n.collectionSlug,value:n.doc.id}}))}}}})}),_(f)}},n[3]=f,n[4]=o,n[5]=d,n[6]=v,n[7]=_,n[8]=h,n[9]=b,n[10]=C,n[11]=x,n[12]=y,n[13]=S):S=n[13];let N=(0,G.useEffectEvent)(S),w;return n[14]!==o||n[15]!==N?(w=()=>{if(!o.hasNodes([ic]))throw Error("UploadPlugin: UploadNode not registered on editor");return(0,p.mergeRegister)(o.registerNodeTransform(ic,e=>{let t=e.getData();t?.pending&&async function(){let e=null,l=t?.pending?.src,n=t?.pending?.formID;if(l?.startsWith("data:")){let t=l.match(/data:(image\/[a-zA-Z]+);base64,/),r=t?t[1]:"image/png",o=atob(l.replace(/^data:image\/[a-zA-Z]+;base64,/,"")),i=Array(o.length);for(let e=0;e<o.length;e++)i[e]=o.charCodeAt(e);e={alt:void 0,file:new File([new Uint8Array(i)],"pasted-image."+r?.split("/",2)[1],{type:r}),formID:n}}else if(l?.startsWith("http")||l?.startsWith("https")){let t=await (await fetch(l)).blob(),r=l.split("/").pop()||"pasted-image"+t.type.split("/",2)[1];e={alt:void 0,file:new File([t],r,{type:t.type}),formID:n}}e&&N({files:[e]})}()}),o.registerCommand(ib,e=>(o.update(()=>{let t=(0,p.$getSelection)()||(0,p.$getPreviousSelection)();if((0,p.$isRangeSelection)(t)){let l=iu({data:{id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value}}),{focus:n}=t,r=n.getNode();(0,et.$insertNodeToNearestRoot)(l),(0,p.$isParagraphNode)(r)&&!r.__first&&r.remove()}}),!0),p.COMMAND_PRIORITY_EDITOR),o.registerCommand(p.PASTE_COMMAND,e=>{if(!(e instanceof ClipboardEvent))return!1;let t=e.clipboardData;if(!t?.types?.length||t?.types?.includes("text/html"))return!1;let l=[];return t?.files?.length&&Array.from(t.files).forEach(e=>{l.push({alt:"",file:e,formID:new V.default.default().toHexString()})}),!!l.length&&(o.update(()=>{let e=(0,p.$getSelection)()||(0,p.$getPreviousSelection)();if((0,p.$isRangeSelection)(e))for(let t of l){let l=iu({data:{pending:{formID:t.formID,src:URL.createObjectURL(t.file)}}}),{focus:n}=e,r=n.getNode();(0,et.$insertNodeToNearestRoot)(l),(0,p.$isParagraphNode)(r)&&!r.__first&&r.remove()}}),N({files:l}),!0)},p.COMMAND_PRIORITY_LOW),o.registerCommand(p.DROP_COMMAND,e=>{if(!(e instanceof DragEvent))return!1;let t=e.dataTransfer;if(!t?.types?.length)return!1;let l=[];return t?.files?.length&&Array.from(t.files).forEach(e=>{l.push({alt:"",file:e,formID:new V.default.default().toHexString()})}),!!l.length&&(e.preventDefault(),e.stopPropagation(),o.update(()=>{let t;if(t=e.target,(0,p.isHTMLElement)(t)&&!t.closest("code, span.editor-image")&&(0,p.isHTMLElement)(t.parentElement)&&t.parentElement.closest("div.ContentEditable__root")){let t=function(e){let t,l=(0,p.getDOMSelectionFromTarget)(e.target);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&null!==l)l.collapse(e.rangeParent,e.rangeOffset||0),t=l.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}(e),n=(0,p.$createRangeSelection)();for(let e of(null!=t&&n.applyDOMRange(t),(0,p.$setSelection)(n),l)){let t=iu({data:{pending:{formID:e.formID,src:URL.createObjectURL(e.file)}}}),{focus:l}=n,r=l.getNode();(0,et.$insertNodeToNearestRoot)(t),(0,p.$isParagraphNode)(r)&&!r.__first&&r.remove()}}}),N({files:l}),!0)},p.COMMAND_PRIORITY_LOW))},n[14]=o,n[15]=N,n[16]=w):w=n[16],n[17]!==o?(t=[o],n[17]=o,n[18]=t):t=n[18],(0,g.useEffect)(w,t),n[19]!==d?(l=(0,m.jsx)(ig,{enabledCollectionSlugs:d}),n[19]=d,n[20]=l):l=n[20],l},position:"normal"}],slashMenu:{groups:[ly([{Icon:il,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:e})=>e.t("lexical:upload:label"),onSelect:({editor:e})=>{e.dispatchCommand(r.b,{replace:!1})}}])]},toolbarFixed:{groups:[nL([{ChildComponent:il,isActive:({selection:e})=>!!(0,p.$isNodeSelection)(e)&&!!e.getNodes().length&&id(e.getNodes()[0]),key:"upload",label:({i18n:e})=>e.t("lexical:upload:label"),onSelect:({editor:e})=>{e.dispatchCommand(r.b,{replace:!1})}}])]}}),i_={namespace:"lexical",theme:{block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",inlineBlock:"LexicalEditorTheme__inlineBlock",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",hrSelected:"LexicalEditorTheme__hrSelected",indent:"LexicalEditorTheme__indent",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",placeholder:"LexicalEditorTheme__placeholder",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",rtl:"LexicalEditorTheme__rtl",tab:"LexicalEditorTheme__tabNode",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableAlignment:{center:"LexicalEditorTheme__tableAlignmentCenter",right:"LexicalEditorTheme__tableAlignmentRight"},tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableFrozenColumn:"LexicalEditorTheme__tableFrozenColumn",tableRowStriping:"LexicalEditorTheme__tableRowStriping",tableScrollableWrapper:"LexicalEditorTheme__tableScrollableWrapper",tableSelected:"LexicalEditorTheme__tableSelected",tableSelection:"LexicalEditorTheme__tableSelection",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"LexicalEditorTheme__upload"}},iS=e=>{let t={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},l={};if(e.forEach(e=>{"toolbarFixed"===e.key&&e.sanitizedClientFeatureProps?.customGroups&&(l={...l,...e.sanitizedClientFeatureProps.customGroups})}),!e?.size)return t;for(let n of(e.forEach(e=>{if(e.providers?.length&&(t.providers=t.providers.concat(e.providers)),e.enableFormats?.length&&t.enabledFormats.push(...e.enableFormats),e.nodes?.length)for(let l of e.nodes)t.nodes.push(l);if(e.plugins?.length&&e.plugins.forEach((l,n)=>{t.plugins?.push({clientProps:e.sanitizedClientFeatureProps,Component:l.Component,key:e.key+n,position:l.position})}),e.toolbarInline?.groups?.length)for(let l of e.toolbarInline.groups){let e=t.toolbarInline.groups.find(e=>e.key===l.key);e?t.toolbarInline.groups=t.toolbarInline.groups.filter(e=>e.key!==l.key):e={...l,items:[]},l?.items?.length&&(e.items=e.items.concat(l.items)),t.toolbarInline?.groups.push(e)}if(e.toolbarFixed?.groups?.length)for(let l of e.toolbarFixed.groups){let e=t.toolbarFixed.groups.find(e=>e.key===l.key);e?t.toolbarFixed.groups=t.toolbarFixed.groups.filter(e=>e.key!==l.key):e={...l,items:[]},l?.items?.length&&(e.items=e.items.concat(l.items)),t.toolbarFixed?.groups.push(e)}if(e.slashMenu?.groups)for(let l of(e.slashMenu.dynamicGroups?.length&&(t.slashMenu.dynamicGroups=t.slashMenu.dynamicGroups.concat(e.slashMenu.dynamicGroups)),e.slashMenu.groups)){let e=t.slashMenu.groups.find(e=>e.key===l.key);e?t.slashMenu.groups=t.slashMenu.groups.filter(e=>e.key!==l.key):e={...l,items:[]},l?.items?.length&&(e.items=e.items.concat(l.items)),t.slashMenu.groups.push(e)}if(e.markdownTransformers?.length)for(let l of e.markdownTransformers)"function"==typeof l?t.markdownTransformers.push(l({allNodes:t.nodes,allTransformers:t.markdownTransformers})):t.markdownTransformers.push(l);t.enabledFeatures.push(e.key)}),Object.keys(l).length>0&&(t.toolbarFixed.groups=t.toolbarFixed.groups.map(e=>{let t=l[e.key];return t?(0,lC.default)(e,t):e})),t.toolbarInline.groups.sort((e,t)=>e.order&&t.order?e.order-t.order:e.order?-1:+!!t.order),t.toolbarFixed.groups.sort((e,t)=>e.order&&t.order?e.order-t.order:e.order?-1:+!!t.order),t.toolbarInline.groups))n.items.sort((e,t)=>e.order&&t.order?e.order-t.order:e.order?-1:+!!t.order);for(let e of t.toolbarFixed.groups)e.items.sort((e,t)=>e.order&&t.order?e.order-t.order:e.order?-1:+!!t.order);return t};function iN(e,t,l){return{admin:l,features:iS(e),lexical:t,resolvedFeatureMap:e}}var iw=(0,g.lazy)(()=>e.A(50611).then(e=>({default:e.RichText}))),ik=e=>{let t,l=(0,c.c)(18),{admin:n,clientFeatures:r,featureClientImportMap:o,featureClientSchemaMap:i,field:a,lexicalEditorConfig:s,schemaPath:u}=e,d;l[0]!==n?(d=void 0===n?{}:n,l[0]=n,l[1]=d):d=l[1];let f=d,h;l[2]!==o?(h=void 0===o?{}:o,l[2]=o,l[3]=h):h=l[3];let p=h,b=void 0===s?i_:s,{config:C}=(0,J.useConfig)(),[x,y]=(0,g.useState)(null),v,_;return l[4]!==f||l[5]!==r||l[6]!==C||l[7]!==p||l[8]!==i||l[9]!==a||l[10]!==x||l[11]!==b||l[12]!==u?(v=()=>{if(x)return;let e=[];for(let t of Object.values(r))t.clientFeatureProvider&&e.push(t.clientFeatureProvider(t.clientFeatureProps));y(iN(function({config:e,featureClientImportMap:t,featureClientSchemaMap:l,field:n,schemaPath:r,unSanitizedEditorConfig:o}){let i=new Map;for(let e of o.features){if(!e?.clientFeatureProps?.featureKey||e?.clientFeatureProps?.order===void 0||e?.clientFeatureProps?.order===null)throw 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.");i.set(e.clientFeatureProps.featureKey,e)}o.features=o.features.sort((e,t)=>e.clientFeatureProps.order-t.clientFeatureProps.order);let a=new Map,s=0;for(let c of o.features){let u="function"==typeof c.feature?c.feature({config:e,featureClientImportMap:t,featureClientSchemaMap:l,featureProviderMap:i,field:n,resolvedFeatures:a,schemaPath:r,unSanitizedEditorConfig:o}):c.feature;u.key=c.clientFeatureProps.featureKey,u.order=s,a.set(c.clientFeatureProps.featureKey,u),s++}return a}({config:C,featureClientImportMap:p,featureClientSchemaMap:i,field:a,schemaPath:u??a.name,unSanitizedEditorConfig:{features:e,lexical:b}}),b,f))},_=[f,r,C,p,i,a,x,b,u],l[4]=f,l[5]=r,l[6]=C,l[7]=p,l[8]=i,l[9]=a,l[10]=x,l[11]=b,l[12]=u,l[13]=v,l[14]=_):(v=l[13],_=l[14]),(0,g.useEffect)(v,_),l[15]!==x||l[16]!==e?(t=(0,m.jsx)(g.Suspense,{fallback:(0,m.jsx)(lb.ShimmerEffect,{height:"35vh"}),children:x&&(0,m.jsx)(iw,{...e,editorConfig:x})}),l[15]=x,l[16]=e,l[17]=t):t=l[17],t};function iT(e){return e instanceof HTMLElement}function iE(...e){return e.filter(Boolean).join(" ")}var i$=new WeakMap;function iL(e){let t=e.changedTouches[0];return void 0===t?null:[t.clientX,t.clientY]}function iM(e,t){let l=i$.get(e);if(void 0===l){let t=new Set,n=e=>{void 0!==l&&(l.start=iL(e))},r=e=>{if(void 0===l)return;let{start:n}=l;if(null===n)return;let r=iL(e);for(let l of t)null!==r&&l([r[0]-n[0],r[1]-n[1]],e)};e.addEventListener("touchstart",n),e.addEventListener("touchend",r),l={handleTouchend:r,handleTouchstart:n,listeners:t,start:null},i$.set(e,l)}return l.listeners.add(t),()=>{!function(e,t){let l=i$.get(e);if(void 0===l)return;let{listeners:n}=l;n.delete(t),0===n.size&&(i$.delete(e),e.removeEventListener("touchstart",l.handleTouchstart),e.removeEventListener("touchend",l.handleTouchend))}(e,t)}}function iR(e,t){return iM(e,(e,l)=>{let[n,r]=e;n<0&&-n>Math.abs(r)&&t(n,l)})}function ij(e,t){return iM(e,(e,l)=>{let[n,r]=e;n>0&&n>Math.abs(r)&&t(n,l)})}function iI(e,t){return iM(e,(e,l)=>{let[n,r]=e;r<0&&-r>Math.abs(n)&&t(n,l)})}function iF(e,t){return iM(e,(e,l)=>{let[n,r]=e;r>0&&r>Math.abs(n)&&t(n,l)})}var iO=()=>{let e=(0,c.c)(2),{EditButton:t}=(0,l.a)(),n;return e[0]!==t?(n=t?(0,m.jsx)(t,{}):null,e[0]=t,e[1]=n):n=e[1],n},iD=()=>{let e=(0,c.c)(2),{RemoveButton:t}=(0,l.a)(),n;return e[0]!==t?(n=t?(0,m.jsx)(t,{}):null,e[0]=t,e[1]=n):n=e[1],n},iP=()=>{let e=(0,c.c)(2),{Label:t}=(0,l.a)(),n;return e[0]!==t?(n=t?(0,m.jsx)(t,{}):null,e[0]=t,e[1]=n):n=e[1],n},iA=e=>{let t=(0,c.c)(3),{children:n}=e,{InlineBlockContainer:r}=(0,l.a)(),o;return t[0]!==r||t[1]!==n?(o=r?(0,m.jsx)(r,{children:n}):null,t[0]=r,t[1]=n,t[2]=o):o=t[2],o},iB=e=>{let{children:t,...l}=e,{BlockCollapsible:n}=lU();return n?(0,m.jsx)(n,{...l,children:t}):null},iH=()=>{let e=(0,c.c)(2),{EditButton:t}=lU(),l;return e[0]!==t?(l=t?(0,m.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},iz=()=>{let e=(0,c.c)(2),{RemoveButton:t}=lU(),l;return e[0]!==t?(l=t?(0,m.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},iK=({apiURL:e,depth:t,draft:l,locale:n})=>async({id:r,collectionSlug:o,select:i})=>{let a=(0,lx.stringify)({depth:t??0,draft:l??!1,locale:n,select:i},{addQueryPrefix:!0});return await fetch(`${e}/${o}/${r}${a}`,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(e=>e.json())},iU={customEndRegex:{optional:!0,regExp:/[ \t]*```$/},customStartRegex:/^[ \t]*```(\w+)?/,doNotTrimChildren:!0,export:({fields:e})=>e.code.includes(`
|
||
`)||e.language?.length?"```"+(e.language||"")+(e.code?`
|
||
`+e.code:"")+"\n```":"```"+e.code+"```",import:({children:e,closeMatch:t,openMatch:l})=>{let n=l?.[1];return e.startsWith(`
|
||
`)&&(e=e.slice(1)),e.endsWith(`
|
||
`)&&(e=e.slice(0,-1)),t&&!e.includes(`
|
||
`)&&l?.input?.trim()!=="```"+n?{code:n+(e?.length?e:""),language:""}:{code:e,language:n}}},iV={abap:"ABAP",apex:"Apex",azcli:"Azure CLI",bat:"Batch",bicep:"Bicep",cameligo:"CameLIGO",clojure:"Clojure",coffee:"CoffeeScript",cpp:"C++",csharp:"C#",csp:"CSP",css:"CSS",cypher:"Cypher",dart:"Dart",dockerfile:"Dockerfile",ecl:"ECL",elixir:"Elixir",flow9:"Flow9",freemarker2:"FreeMarker 2",fsharp:"F#",go:"Go",graphql:"GraphQL",handlebars:"Handlebars",hcl:"HCL",html:"HTML",ini:"INI",java:"Java",javascript:"JavaScript",julia:"Julia",kotlin:"Kotlin",less:"Less",lexon:"Lexon",liquid:"Liquid",lua:"Lua",m3:"M3",markdown:"Markdown",mdx:"MDX",mips:"MIPS",msdax:"DAX",mysql:"MySQL","objective-c":"Objective-C",pascal:"Pascal",pascaligo:"PascaLIGO",perl:"Perl",pgsql:"PostgreSQL",php:"PHP",pla:"PLA",plaintext:"Plain Text",postiats:"Postiats",powerquery:"Power Query",powershell:"PowerShell",protobuf:"Protobuf",pug:"Pug",python:"Python",qsharp:"Q#",r:"R",razor:"Razor",redis:"Redis",redshift:"Amazon Redshift",restructuredtext:"reStructuredText",ruby:"Ruby",rust:"Rust",sb:"Small Basic",scala:"Scala",scheme:"Scheme",scss:"SCSS",shell:"Shell",solidity:"Solidity",sophia:"Sophia",sparql:"SPARQL",sql:"SQL",st:"Structured Text",swift:"Swift",systemverilog:"SystemVerilog",tcl:"Tcl",twig:"Twig",typescript:"TypeScript",typespec:"TypeSpec",vb:"Visual Basic",wgsl:"WGSL",xml:"XML",yaml:"YAML"},iW=({autoComplete:e,field:t,forceRender:l,languages:n=iV,path:r,permissions:o,readOnly:i,renderedBlocks:a,schemaPath:s,typescript:c,validate:u})=>{let d=(0,G.useFormFields)(([e])=>e.language),f=d?.value||d?.initialValue||"typescript",h=(0,g.useId)(),p=n[f],b=(0,g.useMemo)(()=>({...t,type:"code",admin:{...t.admin,editorOptions:{},editorProps:{defaultPath:"ts"===f?`file-${t.name}-${h}.tsx`:void 0},language:f}}),[t,f,h]),C=`${t.name}-${f}-${p}`;return b&&(0,m.jsx)(G.CodeField,{autoComplete:e,field:b,forceRender:l,onMount:(e,t)=>{t.editor.defineTheme("vs-dark",{base:"vs-dark",colors:{"editor.background":"#222222"},inherit:!0,rules:[]}),t.editor.defineTheme("vs",{base:"vs",colors:{"editor.background":"#f5f5f5"},inherit:!0,rules:[]}),t.languages.typescript.typescriptDefaults.setCompilerOptions({allowNonTsExtensions:!0,allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,jsx:t.languages.typescript.JsxEmit.React,moduleResolution:t.languages.typescript.ModuleResolutionKind.NodeJs,noEmit:!0,paths:c?.paths,reactNamespace:"React",target:t.languages.typescript.ScriptTarget[c?.target??"ESNext"],typeRoots:c?.typeRoots??["node_modules/@types"]}),t.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!c?.enableSemanticValidation,noSyntaxValidation:!1}),(async()=>c?.fetchTypes&&Array.isArray(c.fetchTypes)&&c.fetchTypes.length>0&&await Promise.all(c.fetchTypes.map(async e=>{let l=await (await fetch(e.url)).text();t.languages.typescript.typescriptDefaults.addExtraLib(l,e.filePath)})))()},path:r,permissions:o,readOnly:i,renderedBlocks:a,schemaPath:s,validate:u},C)},iG=()=>(0,m.jsx)("svg",{fill:"none",height:"12",viewBox:"0 0 15 12",width:"15",xmlns:"http://www.w3.org/2000/svg",children:(0,m.jsx)("path",{d:"M11.3738 8.62598L14.0404 5.95931L11.3738 3.29264M3.37376 3.29264L0.707092 5.95931L3.37376 8.62598M9.04043 0.625977L5.70709 11.2926",stroke:"currentColor",strokeLinecap:"square"})}),iJ=()=>(0,m.jsx)("svg",{fill:"none",height:"15",viewBox:"0 0 15 15",width:"15",xmlns:"http://www.w3.org/2000/svg",children:(0,m.jsx)("path",{d:"M7.16667 13.8333V9.83333M7.16667 9.83333L9.16667 11.8333M7.16667 9.83333L5.16667 11.8333M7.16667 4.5V0.5M7.16667 4.5L9.16667 2.5M7.16667 4.5L5.16667 2.5M1.83333 7.16667H0.5M5.83333 7.16667H4.5M9.83333 7.16667H8.5M13.8333 7.16667H12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),iY=()=>{let{toggle:e}=(0,G.useCollapsible)();return(0,m.jsx)("button",{className:"code-block-collapse-button",onClick:e,type:"button",children:(0,m.jsx)(iJ,{})})},iX=()=>{let{isCollapsed:e,toggle:t}=(0,G.useCollapsible)(),{t:l}=(0,Y.useTranslation)();return e?(0,m.jsxs)("button",{className:"code-block-floating-collapse-button",onClick:t,type:"button",children:[(0,m.jsx)("span",{children:l("general:collapse")}),(0,m.jsx)(iJ,{})]}):null},iZ="payload-richtext-code-block",iq=e=>{let{languages:t}=e,l=t||iV,{BlockCollapsible:n,formSchema:r,RemoveButton:o}=lU(),{setModified:i}=(0,G.useForm)(),{t:a}=(0,Y.useTranslation)(),{codeField:s}=(0,G.useFormFields)(([e])=>({codeField:e?.code})),{selectedLanguageField:c,setSelectedLanguage:u}=(0,G.useFormFields)(([e,t])=>({selectedLanguageField:e?.language,setSelectedLanguage:e=>{t({type:"UPDATE",path:"language",value:e}),i(!0)}})),d=l[c?.value],f=(0,W.useLexicalEditable)(),h=g.default.useMemo(()=>Object.entries(l).map(([e,t])=>({name:`${e} ${t}`,Component:(0,m.jsx)(G.PopupList.Button,{active:!1,disabled:!1,onClick:()=>{u(e)},children:(0,m.jsx)("span",{className:`${iZ}__language-code`,"data-language":e,children:t})})})),[l,u]);return(0,m.jsx)(n,{Actions:(0,m.jsxs)("div",{className:`${iZ}__actions`,children:[(0,m.jsx)(G.Combobox,{button:(0,m.jsxs)("div",{className:`${iZ}__language-selector-button`,"data-selected-language":c?.value,children:[(0,m.jsx)("span",{children:d}),(0,m.jsx)(G.ChevronIcon,{className:`${iZ}__chevron`})]}),buttonType:"custom",className:`${iZ}__language-selector`,disabled:!f,entries:h,horizontalAlign:"right",minEntriesForSearch:8,searchPlaceholder:a("fields:searchForLanguage"),showScrollbar:!0,size:"large"}),(0,m.jsx)(G.CopyToClipboard,{value:s?.value??""}),(0,m.jsx)(iY,{}),f&&(0,m.jsx)(o,{})]}),className:iZ,collapsibleProps:{AfterCollapsible:(0,m.jsx)(iX,{}),disableHeaderToggle:!0,disableToggleIndicator:!0},Pill:(0,m.jsx)("div",{className:`${iZ}__pill`,children:(0,m.jsx)(iG,{})}),children:(0,m.jsx)(G.RenderFields,{fields:r,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!f})})},iQ=e=>{let t=(0,c.c)(9),{field:l,initialValue:n,Loading:r,path:o,schemaPath:i,setValue:a,value:s}=e,[u,d]=g.default.useState(null),f=(0,G.useServerFunctions)(),{_internal_renderField:h}=f,[p,b]=i.split(".",2),C=o??(l&&"name"in l?l?.name:"")??"",x;t[0]!==h||t[1]!==l||t[2]!==n||t[3]!==o||t[4]!==i?(x=()=>{!async function(){let{Field:e}=await h({field:{...l||{},type:"richText",admin:{...l?.admin||{},hidden:!1}},initialValue:n??void 0,path:o,schemaPath:i});d(e)}()},t[0]=h,t[1]=l,t[2]=n,t[3]=o,t[4]=i,t[5]=x):x=t[5];let y=x,v=(0,g.useRef)(!1),_,S;if(t[6]!==y?(_=()=>{v.current||(v.current=!0,y())},S=[y],t[6]=y,t[7]=_,t[8]=S):(_=t[7],S=t[8]),(0,g.useEffect)(_,S),!u)return"u">typeof r?r:(0,m.jsx)(lb.ShimmerEffect,{});let N={...f,getFormState:async e=>f.getFormState({...e,collectionSlug:"collection"===p?b:void 0,globalSlug:"global"===p?b:void 0})};return typeof s>"u"&&!a?(0,m.jsx)(G.ServerFunctionsContext,{value:{...N},children:(0,m.jsx)(G.FieldPathContext,{value:C,children:u},C)}):(0,m.jsx)(G.ServerFunctionsContext,{value:{...N},children:(0,m.jsx)(G.FieldPathContext,{value:C,children:(0,m.jsx)(G.FieldContext,{value:{disabled:!1,formInitializing:!1,formProcessing:!1,formSubmitted:!1,initialValue:s,path:C,setValue:a??i0,showError:!1,value:s},children:u})},C)})};function i0(){}function i1({nodes:e,text:t}){let l={root:{type:"root",children:[],direction:"ltr",format:"",indent:0,version:1}};return t&&l.root.children.push({type:"paragraph",children:[{type:"text",detail:0,format:0,mode:"normal",style:"",text:t,version:1}],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),e?.length&&l.root.children.push(...e),l}e.s(["$createAutoLinkNode",()=>n6,"$createBlockNode",()=>lJ,"$createHorizontalRuleNode",()=>nO,"$createLinkNode",()=>nZ,"$createRelationshipNode",()=>op,"$createUploadNode",()=>iu,"$isAutoLinkNode",()=>n5,"$isBlockNode",()=>lY,"$isHorizontalRuleNode",()=>nD,"$isLinkNode",()=>nq,"$isRelationshipNode",()=>og,"$isUploadNode",()=>id,"AlignFeatureClient",()=>lw,"AutoLinkNode",()=>n3,"BlockCollapsible",()=>iB,"BlockEditButton",()=>iH,"BlockNode",()=>lG,"BlockRemoveButton",()=>iz,"BlockquoteFeatureClient",()=>lj,"BlocksFeatureClient",()=>l2,"BoldFeatureClient",()=>ni,"ChecklistFeatureClient",()=>rE,"CodeBlockBlockComponent",()=>iq,"CodeComponent",()=>iW,"DETAIL_TYPE_TO_DETAIL",()=>r1,"DOUBLE_LINE_BREAK",()=>rY,"DebugJsxConverterFeatureClient",()=>r8,"ELEMENT_FORMAT_TO_TYPE",()=>r3,"ELEMENT_TYPE_TO_FORMAT",()=>r2,"FixedToolbarFeatureClient",()=>oz,"HeadingFeatureClient",()=>nk,"HorizontalRuleFeatureClient",()=>nA,"HorizontalRuleNode",()=>nF,"INSERT_BLOCK_COMMAND",()=>lQ,"INSERT_INLINE_BLOCK_COMMAND",()=>l0,"IS_ALL_FORMATTING",()=>rJ,"IndentFeatureClient",()=>nU,"InlineBlockContainer",()=>iA,"InlineBlockEditButton",()=>iO,"InlineBlockLabel",()=>iP,"InlineBlockRemoveButton",()=>iD,"InlineCodeFeatureClient",()=>ns,"InlineToolbarFeatureClient",()=>oJ,"ItalicFeatureClient",()=>nu,"LTR_REGEX",()=>rQ,"LexicalPluginToLexicalFeatureClient",()=>rA,"LinkFeatureClient",()=>rC,"LinkNode",()=>nY,"NON_BREAKING_SPACE",()=>" ","NodeFormat",()=>rG,"OrderedListFeatureClient",()=>rR,"ParagraphFeatureClient",()=>rU,"RTL_REGEX",()=>rq,"RelationshipFeatureClient",()=>oN,"RelationshipNode",()=>oh,"RenderLexical",()=>iQ,"RichTextField",()=>ik,"SlateToLexicalFeatureClient",()=>rz,"StrikethroughFeatureClient",()=>nf,"SubscriptFeatureClient",()=>np,"SuperscriptFeatureClient",()=>nm,"TEXT_MODE_TO_TYPE",()=>r6,"TEXT_TYPE_TO_FORMAT",()=>r0,"TEXT_TYPE_TO_MODE",()=>r5,"TOGGLE_LINK_COMMAND",()=>nQ,"TableFeatureClient",()=>it,"TestRecorderFeatureClient",()=>l8,"TextStateFeatureClient",()=>n_,"ToolbarButton",()=>ok,"ToolbarDropdown",()=>oO,"TreeViewFeatureClient",()=>l9,"UnderlineFeatureClient",()=>nC,"UnorderedListFeatureClient",()=>rO,"UploadFeatureClient",()=>iv,"UploadNode",()=>ic,"addSwipeDownListener",()=>iF,"addSwipeLeftListener",()=>iR,"addSwipeRightListener",()=>ij,"addSwipeUpListener",()=>iI,"buildDefaultEditorState",()=>i1,"buildEditorState",()=>i1,"codeConverterClient",()=>iU,"createBlockNode",()=>nS,"createClientFeature",()=>l_,"defaultColors",()=>oi,"defaultEditorLexicalConfig",()=>i_,"getDOMRangeRect",()=>oK,"getRestPopulateFn",()=>iK,"getSelectedNode",()=>nW,"isHTMLElement",()=>iT,"joinClasses",()=>iE,"sanitizeClientEditorConfig",()=>iN,"sanitizeClientFeatures",()=>iS,"setFloatingElemPosition",()=>oU,"setFloatingElemPositionForLinkEditor",()=>rs,"slashMenuBasicGroupWithItems",()=>ly,"toolbarAddDropdownGroupWithItems",()=>nL,"toolbarFeatureButtonsGroupWithItems",()=>nG,"toolbarFormatGroupWithItems",()=>ne,"toolbarTextDropdownGroupWithItems",()=>lL,"useBlockComponentContext",()=>lU,"useLexicalListDrawer",()=>om],444685),e.i(444685),e.s(["$createAutoLinkNode",()=>n6,"$createBlockNode",()=>lJ,"$createHorizontalRuleNode",()=>nO,"$createInlineBlockNode",()=>l.d,"$createLinkNode",()=>nZ,"$createRelationshipNode",()=>op,"$createUploadNode",()=>iu,"$isAutoLinkNode",()=>n5,"$isBlockNode",()=>lY,"$isHorizontalRuleNode",()=>nD,"$isInlineBlockNode",()=>l.e,"$isLinkNode",()=>nq,"$isRelationshipNode",()=>og,"$isUploadNode",()=>id,"AlignFeatureClient",()=>lw,"AutoLinkNode",()=>n3,"BlockCollapsible",()=>iB,"BlockEditButton",()=>iH,"BlockNode",()=>lG,"BlockRemoveButton",()=>iz,"BlockquoteFeatureClient",()=>lj,"BlocksFeatureClient",()=>l2,"BoldFeatureClient",()=>ni,"CAN_USE_DOM",()=>a.d,"ChecklistFeatureClient",()=>rE,"CodeBlockBlockComponent",()=>iq,"CodeComponent",()=>iW,"DETAIL_TYPE_TO_DETAIL",()=>r1,"DOUBLE_LINE_BREAK",()=>rY,"DebugJsxConverterFeatureClient",()=>r8,"ELEMENT_FORMAT_TO_TYPE",()=>r3,"ELEMENT_TYPE_TO_FORMAT",()=>r2,"ENABLE_SLASH_MENU_COMMAND",()=>a.i,"EditorConfigProvider",()=>s.a,"FieldsDrawer",()=>r.a,"FixedToolbarFeatureClient",()=>oz,"HeadingFeatureClient",()=>nk,"HorizontalRuleFeatureClient",()=>nA,"HorizontalRuleNode",()=>nF,"INSERT_BLOCK_COMMAND",()=>lQ,"INSERT_INLINE_BLOCK_COMMAND",()=>l0,"IS_ALL_FORMATTING",()=>rJ,"IndentFeatureClient",()=>nU,"InlineBlockContainer",()=>iA,"InlineBlockEditButton",()=>iO,"InlineBlockLabel",()=>iP,"InlineBlockNode",()=>l.c,"InlineBlockRemoveButton",()=>iD,"InlineCodeFeatureClient",()=>ns,"InlineToolbarFeatureClient",()=>oJ,"ItalicFeatureClient",()=>nu,"LTR_REGEX",()=>rQ,"LexicalPluginToLexicalFeatureClient",()=>rA,"LinkFeatureClient",()=>rC,"LinkNode",()=>nY,"NON_BREAKING_SPACE",()=>" ","NodeFormat",()=>rG,"OrderedListFeatureClient",()=>rR,"ParagraphFeatureClient",()=>rU,"Point",()=>a.f,"RTL_REGEX",()=>rq,"Rect",()=>a.k,"RelationshipFeatureClient",()=>oN,"RelationshipNode",()=>oh,"RenderLexical",()=>iQ,"RichTextField",()=>ik,"SlateToLexicalFeatureClient",()=>rz,"StrikethroughFeatureClient",()=>nf,"SubscriptFeatureClient",()=>np,"SuperscriptFeatureClient",()=>nm,"TEXT_MODE_TO_TYPE",()=>r6,"TEXT_TYPE_TO_FORMAT",()=>r0,"TEXT_TYPE_TO_MODE",()=>r5,"TOGGLE_LINK_COMMAND",()=>nQ,"TableFeatureClient",()=>it,"TestRecorderFeatureClient",()=>l8,"TextStateFeatureClient",()=>n_,"ToolbarButton",()=>ok,"ToolbarDropdown",()=>oO,"TreeViewFeatureClient",()=>l9,"UnderlineFeatureClient",()=>nC,"UnorderedListFeatureClient",()=>rO,"UploadFeatureClient",()=>iv,"UploadNode",()=>ic,"addSwipeDownListener",()=>iF,"addSwipeLeftListener",()=>iR,"addSwipeRightListener",()=>ij,"addSwipeUpListener",()=>iI,"buildDefaultEditorState",()=>i1,"buildEditorState",()=>i1,"codeConverterClient",()=>iU,"createBlockNode",()=>nS,"createClientFeature",()=>l_,"defaultColors",()=>oi,"defaultEditorLexicalConfig",()=>i_,"getDOMRangeRect",()=>oK,"getEnabledNodes",()=>a.l,"getRestPopulateFn",()=>iK,"getSelectedNode",()=>nW,"isHTMLElement",()=>iT,"isPoint",()=>a.g,"joinClasses",()=>iE,"sanitizeClientEditorConfig",()=>iN,"sanitizeClientFeatures",()=>iS,"setFloatingElemPosition",()=>oU,"setFloatingElemPositionForLinkEditor",()=>rs,"slashMenuBasicGroupWithItems",()=>ly,"toolbarAddDropdownGroupWithItems",()=>nL,"toolbarFeatureButtonsGroupWithItems",()=>nG,"toolbarFormatGroupWithItems",()=>ne,"toolbarTextDropdownGroupWithItems",()=>lL,"useBlockComponentContext",()=>lU,"useEditorConfigContext",()=>s.b,"useInlineBlockComponentContext",()=>l.a,"useLexicalDocumentDrawer",()=>i.a,"useLexicalDrawer",()=>o.a,"useLexicalListDrawer",()=>om],869291)},999882,e=>{"use strict";var t=e.i(452797),l=e.i(907358),n=e.i(785316);e.s(["Tooltip",0,e=>{let{alignCaret:r="center",boundingRef:o,children:i,className:a,delay:s=350,position:c,show:u=!0,staticPositioning:d=!1}=e,[f,h]=l.default.useState(u),[p,g]=l.default.useState("top"),[m,b]=((e,t)=>{let r,o,i,a=(0,n.c)(8),{root:s,rootMargin:c,threshold:u}=void 0===e?{}:e,[d,f]=(0,l.useState)(),[h,p]=(0,l.useState)(null),g=(0,l.useRef)("u">typeof window&&"IntersectionObserver"in window&&!t?new window.IntersectionObserver(e=>{let[t]=e;return f(t)},{root:void 0===s?null:s,rootMargin:void 0===c?"0px":c,threshold:void 0===u?0:u}):null);return a[0]!==t||a[1]!==h?(r=()=>{if(t)return;let{current:e}=g;return e.disconnect(),h&&e.observe(h),()=>e.disconnect()},o=[h,t],a[0]=t,a[1]=h,a[2]=r,a[3]=o):(r=a[2],o=a[3]),(0,l.useEffect)(r,o),a[4]!==d||a[5]!==h||a[6]!==p?(i=[p,d,h],a[4]=d,a[5]=h,a[6]=p,a[7]=i):i=a[7],i})({root:o?.current||null,rootMargin:"-145px 0px 0px 100px",threshold:0},d);return(0,l.useEffect)(()=>{let e;return s&&u?e=setTimeout(()=>{h(u)},s):h(u),()=>{e&&clearTimeout(e)}},[u,s]),(0,l.useEffect)(()=>{d||g(b?.isIntersecting?"top":"bottom")},[b,d]),(0,t.jsxs)(l.default.Fragment,{children:[!d&&(0,t.jsx)("aside",{"aria-hidden":"true",className:["tooltip",a,`tooltip--caret-${r}`,"tooltip--position-top"].filter(Boolean).join(" "),ref:m,style:{opacity:"0"},children:(0,t.jsx)("div",{className:"tooltip-content",children:i})}),(0,t.jsx)("aside",{className:["tooltip",a,f&&"tooltip--show",`tooltip--caret-${r}`,`tooltip--position-${c||p}`].filter(Boolean).join(" "),title:"string"==typeof i?i:"",children:(0,t.jsx)("div",{className:"tooltip-content",children:i})})]})}],999882)},936969,e=>{"use strict";var t=e.i(452797),l=e.i(907358);let n=({ariaLabel:e,className:l,direction:n,size:r})=>(0,t.jsx)("svg",{"aria-label":e,className:["icon icon--chevron",l,r&&`icon--size-${r}`].filter(Boolean).join(" "),height:"100%",style:{transform:"left"===n?"rotate(90deg)":"right"===n?"rotate(-90deg)":"up"===n?"rotate(180deg)":void 0},viewBox:"0 0 20 20",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{className:"stroke",d:"M14 8L10 12L6 8",strokeLinecap:"square"})});var r=e.i(604518),o=e.i(910353);let i="useEffectEvent"in l.default&&"function"==typeof l.default.useEffectEvent?l.default.useEffectEvent:e=>{let t=(0,l.useRef)(e);return(0,l.useInsertionEffect)(()=>{t.current=e},[e]),(0,l.useCallback)((...e)=>(0,t.current)(...e),[])},a="popup-button",s=e=>{let{active:l,button:n,buttonType:r,className:o,disabled:i,noBackground:s,setActive:c,size:u}=e,d=[a,o,`${a}--${r}`,!s&&`${a}--background`,u&&`${a}--size-${u}`,i&&`${a}--disabled`].filter(Boolean).join(" "),f=()=>{c(!l,!1)},h=e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c(!l,!0))};return"none"===r?null:"custom"===r?(0,t.jsx)("div",{className:d,onClick:f,onKeyDown:h,role:"button",tabIndex:0,children:n}):(0,t.jsx)("button",{className:d,disabled:i,onClick:f,onKeyDown:h,tabIndex:0,type:"button",children:n})},c="popup",u=["a[href]","button:not(:disabled)",'input:not(:disabled):not([type="hidden"])',"select:not(:disabled)","textarea:not(:disabled)","[tabindex]",'[contenteditable]:not([contenteditable="false"])',"audio[controls]","video[controls]","summary"].map(e=>`${e}:not([tabindex="-1"])`).join(", "),d=e=>{let{id:n,button:r,buttonClassName:a,buttonSize:d,buttonType:f="default",caret:h=!0,children:p,className:g,disabled:m,forceOpen:b,horizontalAlign:C="left",initActive:x=!1,noBackground:y,onToggleClose:v,onToggleOpen:_,portalClassName:S,render:N,showOnHover:w=!1,showScrollbar:k=!1,size:T="medium",verticalAlign:E="bottom"}=e,$=(0,l.useRef)(null),L=(0,l.useRef)(null),M=(0,l.useRef)(!1),[R,j]=(0,l.useState)(!1),[I,F]=(0,l.useState)(x),[O,D]=(0,l.useState)("top"===E);(0,l.useEffect)(()=>{j(!0)},[]);let P=(0,l.useCallback)((e,t=!1)=>{e?(M.current=t,_?.(!0)):v?.(),F(e)},[v,_]),A=i(()=>{let e,t=L.current,l=$.current;if(!t||!l)return;let n=t.getBoundingClientRect(),r=l.getBoundingClientRect(),o="top"===E;"bottom"===E?(e=n.bottom+window.scrollY+10,n.bottom+r.height+10>window.innerHeight&&(e=n.top+window.scrollY-r.height-10,o=!0)):(e=n.top+window.scrollY-r.height-10,n.top-r.height-10<0&&(e=n.bottom+window.scrollY+10,o=!1)),D(o);let i="right"===C?n.right-r.width:"center"===C?n.left+n.width/2-r.width/2:n.left;i=Math.max(10,Math.min(i,window.innerWidth-r.width-10));let a=Math.max(12,Math.min(n.left+n.width/2-i,r.width-12)),s=`${Math.round(e)}px`,c=`${Math.round(i+window.scrollX)}px`,u=`${Math.round(a)}px`;l.style.top!==s&&(l.style.top=s),l.style.left!==c&&(l.style.left=c),l.style.getPropertyValue("--caret-left")!==u&&l.style.setProperty("--caret-left",u)}),B=i(e=>{let t=!$.current?.contains(e.target),l=!L.current?.contains(e.target);t&&l&&P(!1)}),H=i(e=>{let t=$.current;if(t&&I){if("Escape"===e.key){e.preventDefault(),P(!1),L.current?.querySelector('button, [tabindex="0"]')?.focus();return}if("Tab"===e.key||"ArrowDown"===e.key||"ArrowUp"===e.key){let l,n=Array.from(t.querySelectorAll(u));if(0===n.length)return;e.preventDefault();let r=n.findIndex(e=>e===document.activeElement),o="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey;l=-1===r?o?n.length-1:0:o?0===r?n.length-1:r-1:r===n.length-1?0:r+1,n[l].focus()}}}),z=i(e=>{let t=e.target;if(t.closest("[data-popup-prevent-close]"))return;let l=t.closest('button, a[href], [role="button"], [role="menuitem"]');l&&$.current?.contains(l)&&P(!1)});(0,l.useEffect)(()=>{if(!I)return;let e=$.current;if(e)return A(),M.current&&requestAnimationFrame(()=>{let t=e.querySelector(u);t?.focus()}),window.addEventListener("resize",A),window.addEventListener("scroll",A,{capture:!0,passive:!0}),document.addEventListener("mousedown",B),document.addEventListener("keydown",H),e.addEventListener("click",z),()=>{window.removeEventListener("resize",A),window.removeEventListener("scroll",A,{capture:!0}),document.removeEventListener("mousedown",B),document.removeEventListener("keydown",H),e.removeEventListener("click",z)}},[I]),(0,l.useEffect)(()=>{void 0!==b&&P(b)},[b,P]);let K=(0,t.jsx)(s,{active:I,button:r,buttonType:f,className:a,disabled:m,noBackground:y,setActive:P,size:d});return(0,t.jsxs)("div",{className:[c,g].filter(Boolean).join(" "),id:n,children:[(0,t.jsx)("div",{className:`${c}__trigger-wrap`,ref:L,children:w?(0,t.jsx)("div",{className:`${c}__on-hover-watch`,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),role:"button",tabIndex:0,children:K}):K}),R?(0,o.createPortal)((0,t.jsxs)("div",{className:I?[`${c}__content`,`${c}--size-${T}`,O?`${c}--v-top`:`${c}--v-bottom`,S].filter(Boolean).join(" "):`${c}__hidden-content`,"data-popup-id":n||void 0,ref:$,children:[(0,t.jsxs)("div",{className:`${c}__scroll-container${k?` ${c}__scroll-container--show-scrollbar`:""}`,children:[N?.({close:()=>P(!1)}),p]}),h&&(0,t.jsx)("div",{className:`${c}__caret`})]}),document.body):null]})};var f=e.i(999882);let h={chevron:n,edit:({className:e})=>(0,t.jsx)("svg",{className:[e,"icon icon--edit"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{className:"stroke",d:"M9.68531 4.62938H5.2634C4.92833 4.62938 4.60698 4.76248 4.37004 4.99942C4.13311 5.23635 4 5.5577 4 5.89278V14.7366C4 15.0717 4.13311 15.393 4.37004 15.63C4.60698 15.8669 4.92833 16 5.2634 16H14.1072C14.4423 16 14.7636 15.8669 15.0006 15.63C15.2375 15.393 15.3706 15.0717 15.3706 14.7366V10.3147M13.7124 4.39249C13.9637 4.14118 14.3046 4 14.66 4C15.0154 4 15.3562 4.14118 15.6075 4.39249C15.8588 4.6438 16 4.98464 16 5.34004C16 5.69544 15.8588 6.03629 15.6075 6.28759L9.91399 11.9817C9.76399 12.1316 9.57868 12.2413 9.37515 12.3008L7.56027 12.8314C7.50591 12.8472 7.44829 12.8482 7.39344 12.8341C7.33859 12.8201 7.28853 12.7915 7.24849 12.7515C7.20845 12.7115 7.17991 12.6614 7.16586 12.6066C7.15181 12.5517 7.15276 12.4941 7.16861 12.4397L7.69924 10.6249C7.75896 10.4215 7.86888 10.2364 8.01888 10.0866L13.7124 4.39249Z",strokeLinecap:"square"})}),link:()=>(0,t.jsx)("svg",{"aria-hidden":"true",className:"graphic link icon icon--link",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{className:"stroke",d:"M7.99999 13.3333H6.66666C5.78261 13.3333 4.93476 12.9821 4.30964 12.357C3.68452 11.7319 3.33333 10.884 3.33333 9.99999C3.33333 9.11593 3.68452 8.26809 4.30964 7.64297C4.93476 7.01785 5.78261 6.66666 6.66666 6.66666H7.99999M12 6.66666H13.3333C14.2174 6.66666 15.0652 7.01785 15.6904 7.64297C16.3155 8.26809 16.6667 9.11593 16.6667 9.99999C16.6667 10.884 16.3155 11.7319 15.6904 12.357C15.0652 12.9821 14.2174 13.3333 13.3333 13.3333H12M7.33333 9.99999H12.6667",strokeLinecap:"square"})}),plus:()=>(0,t.jsx)("svg",{className:"icon icon--plus",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{className:"stroke",d:"M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",strokeLinecap:"square"})}),swap:()=>(0,t.jsx)("svg",{className:"icon icon--swap",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{className:"stroke",d:"M7.33334 4L4.66667 6.66667M4.66667 6.66667L7.33334 9.33333M4.66667 6.66667H15.3333M12.6667 16L15.3333 13.3333M15.3333 13.3333L12.6667 10.6667M15.3333 13.3333H4.66667",strokeLinecap:"square"})}),x:({className:e})=>(0,t.jsx)("svg",{className:[e,"icon icon--x"].filter(Boolean).join(" "),height:20,viewBox:"0 0 20 20",width:20,xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{className:"stroke",d:"M14 6L6 14M6 6L14 14",strokeLinecap:"square"})})},p=({children:e,icon:n,showTooltip:r,tooltip:o})=>{let i=h[n];return(0,t.jsxs)(l.Fragment,{children:[o&&(0,t.jsx)(f.Tooltip,{className:"btn__tooltip",show:r,children:o}),(0,t.jsxs)("span",{className:"btn__content",children:[e&&(0,t.jsx)("span",{className:"btn__label",children:e}),n&&(0,t.jsxs)("span",{className:"btn__icon",children:[(0,l.isValidElement)(n)&&n,i&&(0,t.jsx)(i,{})]})]})]})};e.s(["Button",0,e=>{let o,{id:i,type:a="button","aria-label":s,buttonStyle:c="primary",children:u,className:f,disabled:h,el:g="button",enableSubMenu:m,extraButtonProps:b={},icon:C,iconPosition:x="right",iconStyle:y="without-border",margin:v=!0,newTab:_,onClick:S,onMouseDown:N,ref:w,round:k,size:T="medium",SubMenuPopupContent:E,to:$,tooltip:L,url:M}=e,[R,j]=l.default.useState(!1),I=["btn",f&&f,C&&"btn--icon",y&&`btn--icon-style-${y}`,C&&!u&&"btn--icon-only",T&&`btn--size-${T}`,C&&x&&`btn--icon-position-${x}`,L&&"btn--has-tooltip",!E&&"btn--withoutPopup",!v&&"btn--no-margin"].filter(Boolean).join(" "),F=[c&&`btn--style-${c}`,h&&"btn--disabled",k&&"btn--round",E?"btn--withPopup":"btn--withoutPopup"].filter(Boolean).join(" "),O={id:i,type:a,"aria-disabled":h,"aria-label":s,className:E?I:[I,F].join(" "),disabled:h,onClick:h?void 0:function(e){j(!1),"submit"!==a&&S&&e.preventDefault(),S&&S(e)},onMouseDown:h?void 0:N,onPointerEnter:L?()=>j(!0):void 0,onPointerLeave:L?()=>j(!1):void 0,rel:_?"noopener noreferrer":void 0,target:_?"_blank":void 0,title:s,...b};switch(g){case"anchor":o=(0,t.jsx)("a",{...O,href:h?void 0:M,ref:w,children:(0,t.jsx)(p,{icon:C,showTooltip:R,tooltip:L,children:u})});break;case"link":h&&(o=(0,t.jsx)("div",{...O,children:(0,t.jsx)(p,{icon:C,showTooltip:R,tooltip:L,children:u})})),o=(0,t.jsx)(r.Link,{...O,href:$||M,prefetch:!1,children:(0,t.jsx)(p,{icon:C,showTooltip:R,tooltip:L,children:u})});break;default:o=(0,t.jsx)(g,{ref:w,...O,children:(0,t.jsx)(p,{icon:C,showTooltip:R,tooltip:L,children:u})})}return E?(0,t.jsxs)("div",{className:F,children:[o,(0,t.jsx)(d,{button:(0,t.jsx)(n,{}),buttonSize:T,className:h&&!m?"btn--popup-disabled":"",disabled:h&&!m,horizontalAlign:"right",id:`${i}-popup`,noBackground:!0,render:({close:e})=>E({close:()=>e()}),size:"large",verticalAlign:"bottom"})]}):o},"ButtonContents",0,p],936969)},529027,e=>{"use strict";var t=e.i(452797);e.i(907358);var l=e.i(936969);let n="card";e.s(["Card",0,e=>{let{id:r,actions:o,buttonAriaLabel:i,href:a,onClick:s,title:c,titleAs:u}=e,d=[n,r,(s||a)&&`${n}--has-onclick`].filter(Boolean).join(" ");return(0,t.jsxs)("div",{className:d,id:r,children:[(0,t.jsx)(u??"div",{className:`${n}__title`,children:c}),o&&(0,t.jsx)("div",{className:`${n}__actions`,children:o}),(s||a)&&(0,t.jsx)(l.Button,{"aria-label":i,buttonStyle:"none",className:`${n}__click`,el:"link",onClick:s,to:a})]})}])},125096,e=>{"use strict";var t=e.i(785316),l=e.i(452797),n=e.i(907358);let r=({className:e})=>(0,l.jsxs)("svg",{className:["icon icon--lock",e].filter(Boolean).join(" "),fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{className:"stroke",d:"M7.5 9.5V7.5C7.5 6.83696 7.76339 6.20107 8.23223 5.73223C8.70107 5.26339 9.33696 5 10 5C10.663 5 11.2989 5.26339 11.7678 5.73223C12.2366 6.20107 12.5 6.83696 12.5 7.5V9.5",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:"1"}),(0,l.jsx)("path",{className:"stroke",d:"M13.5 9.5H6.5C5.94772 9.5 5.5 9.94772 5.5 10.5V14C5.5 14.5523 5.94772 15 6.5 15H13.5C14.0523 15 14.5 14.5523 14.5 14V10.5C14.5 9.94772 14.0523 9.5 13.5 9.5Z",stopOpacity:"1",strokeLinecap:"round",strokeLinejoin:"round"})]});e.i(748475),e.i(253520);var o=e.i(244874);e.i(976819);let i=(0,n.createContext)({i18n:{dateFNS:o.enUS,dateFNSKey:"en-US",fallbackLanguage:"en",language:"en",t:e=>e,translations:{}},languageOptions:void 0,switchLanguage:void 0,t:e=>void 0});var a=e.i(999882);let s="locked";e.s(["Locked",0,e=>{let o,c,u,d,f=(0,t.c)(8),{className:h,user:p}=e,[g,m]=(0,n.useState)(!1),{t:b}=(0,n.use)(i),C=p&&"object"==typeof p?p.email??p.id:b("general:anotherUser");f[0]!==h?(o=[s,h].filter(Boolean),f[0]=h,f[1]=o):o=f[1];let x=o.join(" ");f[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>m(!0),u=()=>m(!1),f[2]=c,f[3]=u):(c=f[2],u=f[3]);let y=`${C} ${b("general:isEditing")}`;return f[4]!==g||f[5]!==x||f[6]!==y?(d=(0,l.jsxs)("div",{className:x,onMouseEnter:c,onMouseLeave:u,role:"button",tabIndex:0,children:[(0,l.jsx)(a.Tooltip,{alignCaret:"left",className:`${s}__tooltip`,position:"top",show:g,children:y}),(0,l.jsx)(r,{})]}),f[4]=g,f[5]=x,f[6]=y,f[7]=d):d=f[7],d}],125096)}]);
|
||
|
||
//# debugId=4c18300e-a1a0-40f6-d39c-65c958064fd9
|