1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9683],{14270:(e,t,l)=>{let n;l.r(t),l.d(t,{$createAutoLinkNode:()=>tL,$createBlockNode:()=>ex,$createHorizontalRuleNode:()=>ti,$createInlineBlockNode:()=>r.d,$createLinkNode:()=>tk,$createRelationshipNode:()=>lV,$createUploadNode:()=>nD,$isAutoLinkNode:()=>tN,$isBlockNode:()=>eb,$isHorizontalRuleNode:()=>ta,$isInlineBlockNode:()=>r.e,$isLinkNode:()=>ty,$isRelationshipNode:()=>lW,$isUploadNode:()=>nH,AlignFeatureClient:()=>q,AutoLinkNode:()=>tT,BlockCollapsible:()=>rl,BlockEditButton:()=>rn,BlockNode:()=>ev,BlockRemoveButton:()=>rr,BlockquoteFeatureClient:()=>en,BlocksFeatureClient:()=>e_,BoldFeatureClient:()=>eO,CAN_USE_DOM:()=>d.d,ChecklistFeatureClient:()=>t8,CodeBlockBlockComponent:()=>rf,CodeComponent:()=>rs,DETAIL_TYPE_TO_DETAIL:()=>l_,DOUBLE_LINE_BREAK:()=>lC,DebugJsxConverterFeatureClient:()=>lF,ELEMENT_FORMAT_TO_TYPE:()=>lL,ELEMENT_TYPE_TO_FORMAT:()=>lT,ENABLE_SLASH_MENU_COMMAND:()=>d.i,EditorConfigProvider:()=>u.a,FieldsDrawer:()=>i.a,FixedToolbarFeatureClient:()=>ni,HeadingFeatureClient:()=>e4,HorizontalRuleFeatureClient:()=>td,HorizontalRuleNode:()=>to,INSERT_BLOCK_COMMAND:()=>ew,INSERT_INLINE_BLOCK_COMMAND:()=>eS,IS_ALL_FORMATTING:()=>lx,IndentFeatureClient:()=>tf,InlineBlockContainer:()=>rt,InlineBlockEditButton:()=>n8,InlineBlockLabel:()=>re,InlineBlockNode:()=>r.c,InlineBlockRemoveButton:()=>n9,InlineCodeFeatureClient:()=>ez,InlineToolbarFeatureClient:()=>np,ItalicFeatureClient:()=>eW,LTR_REGEX:()=>lS,LexicalPluginToLexicalFeatureClient:()=>ld,LinkFeatureClient:()=>t$,LinkNode:()=>tb,NON_BREAKING_SPACE:()=>lb,NodeFormat:()=>lv,OrderedListFeatureClient:()=>ll,ParagraphFeatureClient:()=>lf,Point:()=>d.f,RTL_REGEX:()=>lw,Rect:()=>d.k,RelationshipFeatureClient:()=>lQ,RelationshipNode:()=>lz,RenderLexical:()=>rm,RichTextField:()=>n$,SlateToLexicalFeatureClient:()=>lp,StrikethroughFeatureClient:()=>eZ,SubscriptFeatureClient:()=>eG,SuperscriptFeatureClient:()=>eY,TEXT_MODE_TO_TYPE:()=>lN,TEXT_TYPE_TO_FORMAT:()=>lE,TEXT_TYPE_TO_MODE:()=>lj,TOGGLE_LINK_COMMAND:()=>tw,TableFeatureClient:()=>nN,TestRecorderFeatureClient:()=>eM,TextStateFeatureClient:()=>e2,ToolbarButton:()=>l1,ToolbarDropdown:()=>nt,TreeViewFeatureClient:()=>eF,UnderlineFeatureClient:()=>e$,UnorderedListFeatureClient:()=>li,UploadFeatureClient:()=>nK,UploadNode:()=>nP,addSwipeDownListener:()=>n7,addSwipeLeftListener:()=>n5,addSwipeRightListener:()=>n3,addSwipeUpListener:()=>n4,buildDefaultEditorState:()=>rx,buildEditorState:()=>rv,codeConverterClient:()=>ri,createBlockNode:()=>e6,createClientFeature:()=>Z,defaultColors:()=>lR,defaultEditorLexicalConfig:()=>nG,getDOMRangeRect:()=>na,getEnabledNodes:()=>d.l,getRestPopulateFn:()=>ro,getSelectedNode:()=>tg,isHTMLElement:()=>nQ,isPoint:()=>
1d.g,joinClasses:()=>n0,sanitizeClientEditorConfig:()=>nY,sanitizeClientFeatures:()=>nq,setFloatingElemPosition:()=>ns,setFloatingElemPositionForLinkEditor:()=>tz,slashMenuBasicGroupWithItems:()=>W,toolbarAddDropdownGroupWithItems:()=>te,toolbarFeatureButtonsGroupWithItems:()=>tv,toolbarFormatGroupWithItems:()=>eA,toolbarTextDropdownGroupWithItems:()=>ee,useBlockComponentContext:()=>ef,useEditorConfigContext:()=>u.b,useInlineBlockComponentContext:()=>r.a,useLexicalDocumentDrawer:()=>s.a,useLexicalDrawer:()=>a.a,useLexicalListDrawer:()=>lU});var r=l(86479),o=l(79244),i=l(48177),a=l(72271),s=l(74100),d=l(31851),u=l(88632),c=l(19106),p=l(24364),h=l(56709),f=l(22669),m=l(76588),g=l(78466),v=l(27306),x=l(30379),b=l(21416),C=l(75275),k=l(71252),y=l(10662),w=l(37120),S=l(56691),E=l(20576),_=l(53265),T=l(64296),L=l(22453),N=l(52621),j=l(50772),I=l(1951),M=l(25870),F=l(76386),A=l(26178),R=l(39478),P=l(54719),D=l(11246),H=l(8896),B=l(86256),O=l(214),J=l(8342),z=l(68895),V=l(25292);function W(e){return{items:e,key:"basic",label:e=>{let{i18n:t}=e;return t.t("lexical:general:slashMenuBasicGroupLabel")}}}var U=()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M2.5 15H12.5",stroke:"currentColor",strokeWidth:"1.5"})]}),Z=e=>t=>{let l={clientFeatureProps:t};if("function"==typeof e)l.feature=l=>{let{config:n,featureClientImportMap:r,featureClientSchemaMap:o,featureProviderMap:i,field:a,resolvedFeatures:s,schemaPath:d,unSanitizedEditorConfig:u}=l,c=e({config:n,featureClientImportMap:r,featureClientSchemaMap:o,featureProviderMap:i,field:a,props:t,resolvedFeatures:s,schemaPath:d,unSanitizedEditorConfig:u});return null===c.sanitizedClientFeatureProps&&(c.sanitizedClientFeatureProps=t),c};else{let n={...e};n.sanitizedClientFeatureProps=t,l.feature=n}return l},K=e=>(0,m.ff4)(e)?e.getFormatType():e.__format,G=[(n=[{ChildComponent:U,isActive:e=>{let{selection:t}=e;if(!(0,m.I2P)(t))return!1;for(let e of t.getNodes()){if(((0,m.ff4)(e)||(0,h.D)(e))&&"left"===K(e))continue;let t=e.getParent();if(!(((0,m.ff4)(t)||(0,h.D)(t))&&"left"===K(t)))return!1}return!0},key:"alignLeft",label:e=>{let{i18n:t}=e;return t.t("lexical:align:alignLeftLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.fUS,"left")},order:1},{ChildComponent:()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M5 15H15",stroke:"currentColor",strokeWidth:"1.5"})]}),isActive:e=>{let{selection:t}=e;if(!(0,m.I2P)(t))return!1;for(let e of t.getNodes()){if(((0,m.ff4)(e)||(0,h.D)(e))&&"center"===K(e))continue;let t=e.getParent();if(!(((0,m.ff4)(t)||(0,h.D)(t))&&"center"===K(t)))return!1}return!0},key:"alignCenter",label:e=>{let{i18n:t}=e;return t.t("lexical:align:alignCenterLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.fUS,"center")},order:2},{ChildComponent:()=>(0,v.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,v.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M7.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]}),isActive:e=>{let{selection:t}=e;if(!(0,m.I2P)(t))return!1;for(let e of t.getNodes()){if(((0,m.ff4)(e)||(0,h.D)(e))&&"right"===K(e))continue;let t=e.getParent();if(!(((0,m.ff4)(t)||(0,h.D)(t))&&"right"===K(t)))return!1}return!0},key:"alignRight",label:e=>{let{i18n:t}=e;return t.t("lexical:align:alignRightLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.fUS,"right")},order:3},{ChildComponent:()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]}),isActive:e=>{let{selection:t}=e;if(!(0,m.I2P)(t))return!1;for(let e of t.getNodes()){if(((0,m.ff4)(e)||(0,h.D)(e))&&"justify"===K(e))continue;let t=e.getParent();if(!(((0,m.ff4)(t)||(0,h.D)(t))&&"justify"===K(t)))return!1}return!0},key:"alignJustify",label:e=>{let{i18n:t}=e;return t.t("lexical:align:alignJustifyLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.fUS,"justify")},order:4}],{type:"dropdown",ChildComponent:U,items:n,key:"align",order:30})],q=Z({plugins:[{Component:()=>{let e=(0,c.c)(3),[t]=(0,p.DF)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(m.fUS,X,m.AcJ),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:G},toolbarInline:{groups:G}});function Y(e){return((0,m.ff4)(e)||(0,h.D)(e))&&!e.isInline()}function X(e){let t=(0,m.vJq)();if(!(0,m.I2P)(t)&&!(0,m.RTZ)(t))return!1;for(let l of t.getNodes()){let t=(0,f.Bt)(l,Y);null!==t&&t.setFormat(e)}return!0}var $=()=>(0,v.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,v.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"})}),Q=()=>(0,v.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,v.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"})}),ee=e=>({type:"dropdown",ChildComponent:Q,items:e,key:"text",order:25}),et={type:"element",dependencies:[x.dJ],export:(e,t)=>{if(!(0,x.jd)(e))return null;let l=t(e).split("\n"),n=[];for(let e of l)n.push("> "+e);return n.join("\n")},regExp:/^>\s/,replace:(e,t,l,n)=>{if(n){let l=e.getPreviousSibling();if((0,x.jd)(l)){l.splice(l.getChildrenSize(),0,[...t]),l.select(0,0),e.remove();return}}let r=(0,x.xi)();r.append(...t),e.replace(r),r.select(0,0)}},el=[ee([{ChildComponent:$,isActive:e=>{let{selection:t}=e;if(!(0,m.I2P)(t))return!1;for(let e of t.getNodes())if(!(0,x.jd)(e)&&!(0,x.jd)(e.getParent()))return!1;return!0},key:"blockquote",label:e=>{let{i18n:t}=e;return t.t("lexical:blockquote:label")},onSelect:e=>{let{editor:t}=e;t.update(()=>{let e=(0,m.vJq)();(0,b.zI)(e,()=>(0,x.xi)())})},order:20}])],en=Z({markdownTransformers:[et],nodes:[x.dJ],slashMenu:{groups:[W([{Icon:$,key:"blockquote",keywords:["quote","blockquote"],label:e=>{let{i18n:t}=e;return t.t("lexical:blockquote:label")},onSelect:e=>{let{editor:t}=e;t.update(()=>{let e=(0,m.vJq)();(0,b.zI)(e,()=>(0,x.xi)())})}}])]},toolbarFixed:{groups:el},toolbarInline:{groups:el}}),er=()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"8",y:"5"}),(0,v.jsx)("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"5",y:"11"}),(0,v.jsx)("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"11",y:"11"})]}),eo=()=>(0,v.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,v.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 ei(e,t){return e?()=>(0,v.jsx)("img",{alt:null!=t?t:"Block Image",className:"lexical-block-custom-image",src:e,style:{maxHeight:20,maxWidth:20}}):er}function ea(e){let{propsString:t}=e,l={},n="",r=!0;for(let e=0;e<t.length;e++){let o=t[e];if(r)"="===o||" "===o?n&&(" "===o?(l[n]=!0,n=""):r=!1):n+=o;else{let o=function(e,t){let l=e[t];return'"'===l?es(e,t):"'"===l?es(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]?k.Z.parse(l):k.Z.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:k.Z.parse("[".concat(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)}(t,e);l[n]=o.value,e=o.newIndex,n="",r=!0}}return n&&(l[n]=!0),l}function es(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n="",r=t+1;for(;r<e.length&&(e[r]!==(l?"'":'"')||"\\"===e[r-1]);)n+=e[r],r++;return{newIndex:r,value:n}}function ed(e){let{props:t}=e,l=[];for(let[e,n]of Object.entries(t))"string"==typeof n?l.push("".concat(e,'="').concat(n.replace(/"/g,"""),'"')):"number"==typeof n?l.push("".concat(e,"={").concat(n,"}")):"boolean"==typeof n?n&&l.push("".concat(e)):null!==n&&"object"==typeof n&&(Array.isArray(n)?l.push("".concat(e,"={[").concat(n.map(e=>JSON.stringify(e,eu)).join(", "),"]}")):l.push("".concat(e,"={").concat(JSON.stringify(n,eu),"}")));return l.join(" ")}function eu(e,t){return"string"==typeof t?t.replace(/'/g,"\\'"):t}function ec(e){let{isEndOptional:t,lines:l,regexpEndRegex:n,startLineIndex:r,startMatch:o,trimChildren:i}=e,a="",s="",d=l.slice(r),u=!1,c=0,p=0,h=null,f=!1,m=0,g=d[0].slice(0,o.index),v=0,x=r;e:for(let[e,r]of d.entries()){var b;let g=i?r.trim():r,C=0;if(i)for(let e=0;e<r.length&&" "===r[e];e++)C++;let k=0;for(0===e&&(k=(null!=(b=o.index)?b:0)+o[0].length-C);k<g.length;){let t=g[k],l=g[k+1];if(u){if("`"===t&&m++,m%2==0)if("<"===t&&"/"===l){if(--c<0){"\n"===s[s.length-1]&&(s=s.slice(0,-1)),x=e;for(let e=k;e<g.length;e++)if(">"===g[e]){v=e+1;break}break e}}else if("/"===t&&">"===l){if(--c<0){"\n"===s[s.length-1]&&(s=s.slice(0,-1)),x=e,v=k+2;break e}}else"<"===t&&"/"!==l&&c++;s+=t}else{if("{"!==t||h?"}"!==t||h?'"'!==t&&"'"!==t||h?t===h&&(h=null):h=t:p--:p++,"/"!==t||">"!==l||0!==p||h){if(">"===t&&0===p&&!h){u=!0,k++;continue}}else{f=!0,x=e,v=k+2;break e}a+=t}k++}if(u?(null==s?void 0:s.length)>0&&e>0&&(s+="\n"):a+="\n",n&&c<0){let t=g.match(n);if((null==t?void 0:t.index)!==void 0){x=e,v=t.index+t[0].length-1;break}}if(e===d.length-1&&!t&&!f)throw Error("End match not found for lines "+l.join("\n")+"\n\n. Start match: "+JSON.stringify(o))}return{afterEndLine:d[x].trim().slice(v),beforeStartLine:g,content:s,endLineIndex:r+x,endlineLastCharIndex:v,propsString:a}}var ep=class extends h.d{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,m.pTq)(new ep({fields:{...t,id:(null==t?void 0:t.id)||new y.default().toHexString()}})));return l.setFormat(e.format),l}static isInline(){return!1}createDOM(e){var t;let l=document.createElement("div");return(0,f.ZB)(l,null==e||null==(t=e.theme)?void 0:t.block),l}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++}constructor({cacheBuster:e,fields:t,format:l,key:n}){super(l,n),this.__fields=t,this.__cacheBuster=e||0}},eh=(0,g.createContext)({baseClass:"LexicalEditorTheme__block",BlockCollapsible:()=>null,BlockDrawer:()=>null,CustomBlock:null,EditButton:()=>null,errorCount:0,formSchema:[],initialState:!1,nodeKey:"",RemoveButton:()=>null}),ef=()=>g.use(eh),em=e=>{let t=(0,c.c)(4),{Collapsible:l,...n}=e,{BlockDrawer:r,CustomBlock:o,errorCount:i,formSchema:a}=n,s=(0,S.useFormSubmitted)()&&i>0,d=(0,w.a)(),u;t[0]!==l||t[1]!==i||t[2]!==s?(u=e=>{let{children:t,...n}=e;return(0,v.jsx)(l,{errorCount:i,fieldHasErrors:s,...n,children:t})},t[0]=l,t[1]=i,t[2]=s,t[3]=u):u=t[3];let p=u;return o?(0,v.jsxs)(eh,{value:{...n,BlockCollapsible:p},children:[o,(0,v.jsx)(r,{})]}):(0,v.jsx)(p,{children:(0,v.jsx)(S.RenderFields,{fields:a,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!d})})},eg=e=>{var t,l,n,r,o,i,s,d,c,h,f,x,b,k,y,I;let{cacheBuster:M,className:F,formData:A,nodeKey:R}=e,P=(0,S.useFormSubmitted)(),{id:D,collectionSlug:H,globalSlug:B}=(0,S.useDocumentInfo)(),{fieldProps:{featureClientSchemaMap:O,field:J,initialLexicalFormState:z,schemaPath:V},uuid:W}=(0,u.b)(),{fields:U}=(0,S.useDocumentForm)(),Z=(0,g.useRef)(new AbortController),K=(0,S.useEditDepth)(),[G,q]=g.useState(0),{config:Y}=(0,E.c)(),X=(0,S.formatDrawerSlug)({slug:"lexical-blocks-create-".concat(W,"-").concat(A.id),depth:K}
1),{toggleDrawer:$}=(0,a.a)(X),{getDocPreferences:Q,setDocFieldPreferences:ee}=(0,S.useDocumentInfo)(),[et]=(0,p.DF)(),el=(0,w.a)(),en=A.blockType,{getFormState:er}=(0,S.useServerFunctions)(),eo="".concat(V,".lexical_internal_feature.blocks.lexical_blocks.").concat(en,".fields"),[ei,ea]=g.useState(()=>{var e;let t=null==z||null==(e=z[A.id])?void 0:e.formState;if(!t)return!1;let l=Object.fromEntries(Object.entries(t).map(e=>{let[t,l]=e;return[t,t in A?{...l,initialValue:A[t],value:A[t]}:l]}));return l.blockName={initialValue:A.blockName,passesCondition:!0,valid:!0,value:A.blockName},l}),es=(0,g.useRef)(!1),ed=(0,g.useRef)(M);(0,g.useEffect)(()=>{es.current?(ed.current!==M&&ea(!1),ed.current=M):es.current=!0},[M]);let[eu,ec]=g.useState(null!=(k=null==ei||null==(l=ei._components)||null==(t=l.customComponents)?void 0:t.BlockLabel)?k:void 0),[ep,eh]=g.useState(null!=(y=null==ei||null==(r=ei._components)||null==(n=r.customComponents)?void 0:n.Block)?y:void 0);(0,g.useEffect)(()=>{let e=new AbortController;return A&&!ei&&(async()=>{let{state:t}=await er({id:D,collectionSlug:H,data:A,docPermissions:{fields:!0},docPreferences:await Q(),documentFormState:(0,L.KS)(U,{excludeFiles:!0}),globalSlug:B,initialBlockData:A,operation:"update",readOnly:!el,renderAllFields:!0,schemaPath:eo,signal:e.signal});if(t){var l,n,r,o,i,a;t.blockName={initialValue:A.blockName,passesCondition:!0,valid:!0,value:A.blockName};let e=(0,N.r)((0,L.KS)(t,{excludeFiles:!0}),!0);et.update(()=>{let t=(0,m.nsf)(R);t&&eb(t)&&(e.blockType=en,t.setFields(e,!0))}),ea(t),ec(null!=(i=null==(n=t._components)||null==(l=n.customComponents)?void 0:l.BlockLabel)?i:void 0),eh(null!=(a=null==(o=t._components)||null==(r=o.customComponents)?void 0:r.Block)?a:void 0)}})(),()=>{(0,T.eS)(e)}},[er,eo,el,D,A,et,R,ei,H,B,Q,U,en]);let[ef,eg]=g.useState(null!=(I=null==z||null==(o=z[A.id])?void 0:o.collapsed)&&I),ev="".concat(V,".lexical_internal_feature.blocks.lexical_blocks.").concat(en),ex=null==(s=O.blocks)||null==(i=s[ev])?void 0:i[0],eC=ex.blockReferences?"string"==typeof(null==ex||null==(d=ex.blockReferences)?void 0:d[0])?Y.blocksMap[null==ex||null==(c=ex.blockReferences)?void 0:c[0]]:null==ex||null==(h=ex.blockReferences)?void 0:h[0]:null==ex||null==(f=ex.blocks)?void 0:f[0],{i18n:ek,t:ey}=(0,_.d)(),ew=(0,g.useCallback)(async e=>{let{formState:t,submit:l}=e;(0,T.eS)(Z.current);let n=new AbortController;Z.current=n;let{state:r}=await er({id:D,collectionSlug:H,docPermissions:{fields:!0},docPreferences:await Q(),documentFormState:(0,L.KS)(U,{excludeFiles:!0}),formState:t,globalSlug:B,initialBlockFormState:t,operation:"update",readOnly:!el,renderAllFields:!!l,schemaPath:eo,signal:n.signal});if(!r)return t;t.blockName&&(r.blockName=t.blockName);let o=(0,N.r)(function(e){let{fields:t}=e;for(let e in t){let l=t[e];Array.isArray(null==l?void 0:l.rows)&&"value"in l&&(l.disableFormData=!0)}return t}({fields:(0,L.KS)(r,{excludeFiles:!0})}),!0);if(setTimeout(()=>{et.update(()=>{let e=(0,m.nsf)(R);e&&eb(e)&&(o.blockType=en,e.setFields(o,!0))})},0),l){var i,a,s,d,u,c;ec(null!=(u=null==(a=r._components)||null==(i=a.customComponents)?void 0:i.BlockLabel)?u:void 0),eh(null!=(c=null==(d=r._components)||null==(s=d.customComponents)?void 0:s.Block)?c:void 0);let e=0;for(let t of Object.values(r))(null==t?void 0:t.valid)===!1&&e++;q(e)}return r},[er,D,H,Q,B,eo,en,U,el,et,R]);(0,g.useEffect)(()=>()=>{(0,T.eS)(Z.current)},[]);let eS=(0,g.useCallback)(()=>{et.update(()=>{var e;null==(e=(0,m.nsf)(R))||e.remove()})},[et,R]),eE=(null==eC||null==(x=eC.labels)?void 0:x.singular)?(0,C.s)(eC.labels.singular,ek):null==eC?void 0:eC.slug,e_=(0,g.useCallback)(e=>{Q().then(t=>{var l,n;let r=null==t||null==(n=t.fields)||null==(l=n[J.name])?void 0:l.collapsed,o=r&&(null==r?void 0:r.length)?r:[];e?o.includes(A.id)||o.push(A.id):o.includes(A.id)&&o.splice(o.indexOf(A.id),1),ee(J.name,{collapsed:o,hello:"hi"})})},[Q,J.name,ee,A.id]),eT=(0,g.useMemo)(()=>()=>(0,v.jsx)(S.Button,{buttonStyle:"icon-label",className:"".concat(F,"__editButton"),disabled:!el,el:"button",icon:"edit",onClick:e=>(e.preventDefault(),e.stopPropagation(),$(),!1),onMouseDown:e=>{e.preventDefault()},round:!0,size:"small",tooltip:ey("lexical:blocks:inlineBlocks:edit",{label:eE})}),[F,el,ey,eE,$]),eL=(0,g.useMemo)(()=>()=>(0,v.jsx)(S.Button,{buttonStyle:"icon-label",className:"".concat(F,"__removeButton"),disabled:!el,icon:"x",onClick:e=>{e.preventDefault(),eS()},round:!0,tooltip:"Remove Block"}),[F,el,eS]),eN=(0,g.useMemo)(()=>e=>{var t;let{Actions:l,children:n,className:r,collapsibleProps:o,disableBlockName:i,editButton:a,errorCount:s,fieldHasErrors:d,Label:u,Pill:c,removeButton:p}=e;return(0,v.jsx)("div",{className:"".concat(F,"__container ").concat(F,"-").concat(en),children:(0,v.jsx)(S.Collapsible,{className:["".concat(F,"__row"),d?"".concat(F,"__row--has-errors"):"".concat(F,"__row--no-errors"),r].filter(
1Boolean).join(" "),collapsibleStyle:d?"error":"default",header:(0,v.jsxs)("div",{className:"".concat(F,"__block-header"),children:["u">typeof u?u:"u">typeof eu?eu:(0,v.jsxs)("div",{className:"".concat(F,"__block-label"),children:["u">typeof c?c:(0,v.jsx)(S.Pill,{className:"".concat(F,"__block-pill ").concat(F,"__block-pill-").concat(en),pillStyle:"white",size:"small",children:null!=eE?eE:en}),!i&&!(null==eC||null==(t=eC.admin)?void 0:t.disableBlockName)&&(0,v.jsx)(S.SectionTitle,{path:"blockName",readOnly:!el}),d&&(0,v.jsx)(S.ErrorPill,{count:null!=s?s:0,i18n:ek,withMessage:!0})]}),(0,v.jsx)("div",{className:"".concat(F,"__block-actions"),children:"u">typeof l?l:(0,v.jsxs)(v.Fragment,{children:[ep&&!1!==a||!ep&&a?(0,v.jsx)(eT,{}):null,!1!==p&&el?(0,v.jsx)(eL,{}):null]})})]}),isCollapsed:ef,onToggle:e=>{e_(e),eg(e)},...o||{},children:n},0)})},[ep,eu,eT,eL,eE,F,null==eC||null==(b=eC.admin)?void 0:b.disableBlockName,en,ek,ef,e_,el]),ej=null==A?void 0:A.id,eI=(0,g.useMemo)(()=>()=>{var e;return(0,v.jsx)(S.EditDepthProvider,{children:(0,v.jsx)(S.Drawer,{className:"",slug:X,title:ey("lexical:blocks:inlineBlocks:".concat(ej?"edit":"create"),{label:null!=eE?eE:ey("lexical:blocks:inlineBlocks:label")}),children:ei?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(S.RenderFields,{fields:null!=(e=null==eC?void 0:eC.fields)?e:[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:eo,permissions:!0,readOnly:!el}),(0,v.jsx)(S.FormSubmit,{programmaticSubmit:!0,children:ey("fields:saveChanges")})]}):null})})},[ei,X,ej,eE,ey,el,null==eC?void 0:eC.fields,eo]),eM=(0,g.useMemo)(()=>{var e,t;return ei?(0,v.jsx)(S.Form,{beforeSubmit:[async e=>{let{formState:t}=e;return await ew({formState:t,submit:!0})}],el:"div",fields:null!=(e=null==eC?void 0:eC.fields)?e:[],initialState:ei,onChange:[ew],onSubmit:(e,t)=>{t.blockType=en,et.update(()=>{let e=(0,m.nsf)(R);e&&eb(e)&&e.setFields(t,!0)}),$()},submitted:P,uuid:(0,j.A)(),children:(0,v.jsx)(em,{baseClass:F,BlockDrawer:eI,Collapsible:eN,CustomBlock:ep,EditButton:eT,errorCount:G,formSchema:null!=(t=null==eC?void 0:eC.fields)?t:[],initialState:ei,nodeKey:R,RemoveButton:eL})}):null},[eN,eI,ep,en,eL,eT,F,et,G,$,null==eC?void 0:eC.fields,ei,R,ew,P]);return eC?eM:(0,v.jsx)(eN,{disableBlockName:!0,fieldHasErrors:!0,children:(0,v.jsxs)("div",{className:"".concat(F,"-not-found"),children:["Error: Block '",en,"' not found in the config but exists in the lexical data"]})})},ev=class extends ep{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=ex(e.fields);return t.setFormat(e.format),t}decorate(e,t){var l;return(0,v.jsx)(eg,{cacheBuster:this.getCacheBuster(),className:null!=(l=t.theme.block)?l:"LexicalEditorTheme__block",formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function ex(e){return(0,m.pTq)(new ev({fields:{...e,id:(null==e?void 0:e.id)||new y.default().toHexString()}}))}function eb(e){return e instanceof ev}function eC(e,t){return l=>{let{editorState:n}=l,r=(0,I.D)({nodes:e});try{r.setEditorState(r.parseEditorState(n))}catch(e){console.error("getLexicalToMarkdown: ERROR parsing editor state",e)}let o="";return r.getEditorState().read(()=>{o=(0,d.c)(t)}),o}}function ek(e,t){return l=>{let{markdown:n}=l,r=(0,I.D)({nodes:e});return r.update(()=>{(0,d.b)(n,t)},{discrete:!0}),r.getEditorState().toJSON()}}function ey(e,t){let l;if(!e.jsx)return null;let n=(l=e.slug.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),{regExpEnd:RegExp("</(".concat(l,")\\s*>|<").concat(l,"[^>]*?/>"),"i"),regExpStart:RegExp("<(".concat(l,")([^>]*?)\\s*(/?)>"),"i")}),o=[];return t?o.push(t=>{var l,o;let{allNodes:i,allTransformers:a}=t;return{type:"text-match",dependencies:[r.c],export:t=>{var l,n,o,s,d;if(!(0,r.e)(t)||(null==(n=t.getFields())||null==(l=n.blockType)?void 0:l.toLowerCase())!==e.slug.toLowerCase())return null;let u=t.getFields(),c=eC(i,a),p=e.jsx.export({fields:u,lexicalToMarkdown:c});if(!1===p)return null;if("string"==typeof p)return p;let h=p.props&&(null==(o=Object.keys(p.props))?void 0:o.length)>0,f=null!=(d=p.props)?d:{};return(null==p||null==(s=p.children)?void 0:s.length)?"<".concat(u.blockType).concat(h?" "+ed({props:f}):"",">").concat(p.children,"</").concat(u.blockType,">"):"<".concat(u.blockType).concat(h?" "+ed({props:f}):"","/>")},getEndIndex:(e,t)=>{let{endlineLastCharIndex:l}=ec({isEndOptional:!1,lines:[e.getTextContent()],regexpEndRegex:n.regExpEnd,startLineIndex:0,startMatch:t,trimChildren:!1});return l},importRegExp:null!=(o=null==(l=e.jsx)?void 0:l.customStartRegex)?o:n.regExpStart,regExp:/___ignoreignoreignore___/g,replace(t,l){var o;let{content:s,propsString:d}=ec({isEndOptional:!1,lines:[t.getTextContent()],regexpEndRegex:n.regExpEnd,startLineIndex:0,startMatch:{...l,index:0},trimChildren:!1});if(!(null==e||null==(o=e.jsx)?void 0:o.import))return;let u=ek(i,a),c=e.jsx.import({children:s,closeMatch:null,htmlToLexical:null,markdownToLexical:u,openMatch:l,props:d?ea({propsString:d}):{}});if(!1===c)return;let p=(0,r.d)({blockType:e.slug,...c});t.replace(p)}}}):o.push(t=>{var l,r,o,i,a;let{allNodes:s,allTransformers:d}=t;return{dependencies:[ev],export:t=>{var l,n,r,o,i,a,u;if(!eb(t)||(null==(n=t.getFields())||null==(l=n.blockType)?void 0:l.toLowerCase())!==e.slug.toLowerCase())return null;
1let c=t.getFields(),p=eC(s,d),h=e.jsx.export({fields:c,lexicalToMarkdown:p});if(!1===h)return null;if("string"==typeof h)return h;let f=h.props&&(null==(r=Object.keys(h.props))?void 0:r.length)>0,m=null!=(i=h.props)?i:{};if(null==h||null==(o=h.children)?void 0:o.length){let t=h.children,l="";if(t.includes("\n"))for(let n of t.split("\n")){let t="";(null==e||null==(u=e.jsx)?void 0:u.doNotTrimChildren)||""===n||(t=" "),t+=n+"\n",l+=t}else l=((null==e||null==(a=e.jsx)?void 0:a.doNotTrimChildren)?"":" ")+t+"\n";return"<".concat(c.blockType).concat(f?" "+ed({props:m}):"",">\n").concat(l,"</").concat(c.blockType,">")}return"<".concat(c.blockType).concat(f?" "+ed({props:m}):"","/>")},handleImportAfterStartMatch:(null==(l=e.jsx)?void 0:l.customEndRegex)?void 0:t=>{var l,n,r,o,i,a,u,c;let{lines:p,rootNode:h,startLineIndex:f,startMatch:g,transformer:v}=t,x="object"==typeof v.regExpEnd&&"regExp"in v.regExpEnd?v.regExpEnd.regExp:v.regExpEnd,{afterEndLine:b,beforeStartLine:C,content:k,endLineIndex:y,propsString:w}=ec({isEndOptional:v.regExpEnd&&"object"==typeof v.regExpEnd&&"optional"in v.regExpEnd?v.regExpEnd.optional:!v.regExpEnd,lines:p,regexpEndRegex:x,startLineIndex:f,startMatch:g,trimChildren:!1}),S="";if(null==e||null==(l=e.jsx)?void 0:l.doNotTrimChildren)S=k.endsWith("\n")?k.slice(0,-1):k;else if(k.includes("\n")){let e=k.split("\n"),t=0;for(let l of e){if(t++,l.startsWith(" "))S+=l.slice(2);else if(""===l)S+=l;else{S=k.endsWith("\n")?k.slice(0,-1):k;break}S+=t===e.length?"":"\n"}}else S=(k.startsWith(" ")?k.slice(2):k)+"\n";if(!(null==e||null==(n=e.jsx)?void 0:n.import))return[!1,f];let E=ek(s,d),_=e.jsx.import({children:S,closeMatch:null,htmlToLexical:null,markdownToLexical:E,openMatch:g,props:w?ea({propsString:w}):{}});if(!1===_)return[!1,f];let T=ex({blockType:e.slug,..._});if(T){let e=null,t=null;if(null==C?void 0:C.length){let t=null==(e=null!=(i=null==(o=E({markdown:C}))||null==(r=o.root)?void 0:r.children)?i:[])?void 0:e[0];t&&h.append((0,m.GMe)(t))}if(h.append(T),null==b?void 0:b.length){t=null==(u=E({markdown:b}))||null==(a=u.root)?void 0:a.children;let e=h.getChildren()[h.getChildren().length-1],l=null==(c=(0,m.GMe)(t[0]))?void 0:c.getChildren();if(null==l?void 0:l.length)for(let t of l)e.append(t)}}return[!0,y]},regExpEnd:null!=(i=null==(r=e.jsx)?void 0:r.customEndRegex)?i:n.regExpEnd,regExpStart:null!=(a=null==(o=e.jsx)?void 0:o.customStartRegex)?a:n.regExpStart,type:"multiline-element",replace:(t,l,n,r,o)=>{var i,a,u;if(null==e||null==(i=e.jsx)?void 0:i.import){if(!o){let e="";if(l)for(let t of l)e+=t.getTextContent();o=[e]}let i="";i=(null==e||null==(a=e.jsx)?void 0:a.doNotTrimChildren)?o.join("\n"):o.join("\n").trim();let c=null==(u=n[1])?void 0:u.trim(),p=ek(s,d),h=e.jsx.import({children:i,closeMatch:r,htmlToLexical:null,markdownToLexical:p,openMatch:n,props:c?ea({propsString:c}):{}});if(!1===h)return!1;let f=ex({blockType:e.slug,...h});return void(f&&t.append(f))}return!1}}}),o}var ew=(0,m.guI)("INSERT_BLOCK_COMMAND"),eS=(0,m.guI)("INSERT_INLINE_BLOCK_COMMAND"),eE=()=>{let e,t=(0,c.c)(12),[l]=(0,p.DF)(),[n,o]=(0,g.useState)(null),{setCreatedInlineBlock:i,uuid:s}=(0,u.b)(),d=(0,S.useEditDepth)(),h="lexical-inlineBlocks-create-"+s,v;t[0]!==d||t[1]!==h?(v=(0,S.formatDrawerSlug)({slug:h,depth:d}),t[0]=d,t[1]=h,t[2]=v):v=t[2];let x=v,{toggleDrawer:b}=(0,a.a)(x,!0),C;return t[3]!==l||t[4]!==i||t[5]!==n?(C=()=>{if(!l.hasNodes([ev]))throw Error("BlocksPlugin: BlocksNode not registered on editor");return(0,f.Sd)(l.registerCommand(ew,e=>(l.update(()=>{let t=(0,m.vJq)()||(0,m.S1w)();if((0,m.I2P)(t)){let l=ex(e),{focus:n}=t,r=n.getNode();(0,f.Pe)(l),(0,m.bSg)(r)&&!r.__first&&r.remove()}}),!0),m.jZM),l.registerCommand(eS,e=>{if(n){let t=(0,m.nsf)(n);return!!t&&!!(0,r.e)(t)&&(t.setFields(e),o(null),!0)}let t=(0,r.d)(e);return null==i||i(t),(0,m.H2A)([t]),(0,m.IqF)(t.getParentOrThrow())&&(0,f.cj)(t,m.lJ7).selectEnd(),!0},m.jZM))},t[3]=l,t[4]=i,t[5]=n,t[6]=C):C=t[6],t[7]!==l||t[8]!==i||t[9]!==n||t[10]!==b?(e=[l,i,n,b],t[7]=l,t[8]=i,t[9]=n,t[10]=b,t[11]=e):e=t[11],(0,g.useEffect)(C,e),null},e_=Z(e=>{let{config:t,featureClientSchemaMap:l,props:n,schemaPath:o}=e,i="".concat(o,".lexical_internal_feature.blocks.lexical_blocks"),a="".concat(o,".lexical_internal_feature.blocks.lexical_inl
1ine_blocks"),s=l.blocks;if(!s)return{};let d=Object.entries(s).filter(e=>{let[t]=e;return t.startsWith(i+".")&&!t.replace(i+".","").includes(".")}).map(e=>{let[,t]=e;return t[0]}),u=Object.entries(s).filter(e=>{let[t]=e;return t.startsWith(a+".")&&!t.replace(a+".","").includes(".")}).map(e=>{let[,t]=e;return t[0]}),c=d.map(e=>e.blockReferences?"string"==typeof e.blockReferences[0]?t.blocksMap[e.blockReferences[0]]:e.blockReferences[0]:e.blocks[0]).filter(e=>void 0!==e),p=u.map(e=>e.blockReferences?"string"==typeof e.blockReferences[0]?t.blocksMap[e.blockReferences[0]]:e.blockReferences[0]:e.blocks[0]).filter(e=>void 0!==e);return{markdownTransformers:(e=>{let{blocks:t,inlineBlocks:l}=e;if(!(null==t?void 0:t.length)&&!(null==l?void 0:l.length))return[];let n=[];if(null==t?void 0:t.length)for(let e of t){let t=ey(e,!1);t&&(n=n.concat(t))}if(null==l?void 0:l.length)for(let e of l){let t=ey(e,!0);t&&(n=n.concat(t))}return n})({blocks:c,inlineBlocks:p}),nodes:[ev,r.c],plugins:[{Component:eE,position:"normal"}],sanitizedClientFeatureProps:n,slashMenu:{groups:[(null==c?void 0:c.length)?{items:c.map(e=>({Icon:ei(e.imageURL,e.imageAltText),key:"block-"+e.slug,keywords:["block","blocks",e.slug],label:t=>{var l;let{i18n:n}=t;return(null==e||null==(l=e.labels)?void 0:l.singular)?(0,C.s)(e.labels.singular,n):null==e?void 0:e.slug},onSelect:t=>{let{editor:l}=t;l.dispatchCommand(ew,{blockName:"",blockType:e.slug})}})),key:"blocks",label:e=>{let{i18n:t}=e;return t.t("lexical:blocks:label")}}:null,(null==p?void 0:p.length)?{items:p.map(e=>({Icon:eo,key:"inlineBlocks-"+e.slug,keywords:["inlineBlock","inline block",e.slug],label:t=>{var l;let{i18n:n}=t;return(null==e||null==(l=e.labels)?void 0:l.singular)?(0,C.s)(e.labels.singular,n):null==e?void 0:e.slug},onSelect:t=>{let{editor:l}=t;l.dispatchCommand(eS,{blockName:"",blockType:e.slug})}})),key:"inlineBlocks",label:e=>{let{i18n:t}=e;return t.t("lexical:blocks:inlineBlocks:label")}}:null].filter(Boolean)},toolbarFixed:{groups:[c.length?{type:"dropdown",ChildComponent:er,items:c.map((e,t)=>({ChildComponent:ei(e.imageURL,e.imageAltText),isActive:void 0,key:"block-"+e.slug,label:t=>{var l;let{i18n:n}=t;return(null==e||null==(l=e.labels)?void 0:l.singular)?(0,C.s)(e.labels.singular,n):null==e?void 0:e.slug},onSelect:t=>{let{editor:l}=t;l.dispatchCommand(ew,{blockName:"",blockType:e.slug})},order:t})),key:"blocks",order:20}:null,(null==p?void 0:p.length)?{type:"dropdown",ChildComponent:eo,items:p.map((e,t)=>({ChildComponent:e.imageURL?ei(e.imageURL,e.imageAltText):eo,isActive:void 0,key:"inlineBlock-"+e.slug,label:t=>{var l;let{i18n:n}=t;return(null==e||null==(l=e.labels)?void 0:l.singular)?(0,C.s)(e.labels.singular,n):null==e?void 0:e.slug},onSelect:t=>{let{editor:l}=t;l.dispatchCommand(eS,{blockName:"",blockType:e.slug})},order:t})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}}),eT=d.d&&"documentMode"in document?document.documentMode:null,eL=d.d&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);d.d&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),d.d&&"InputEvent"in window&&!eT&&new window.InputEvent("input"),d.d&&/Version\/[\d.].*Safari/.test(navigator.userAgent),d.d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,d.d&&/Android/.test(navigator.userAgent),d.d&&/Win/.test(navigator.platform),d.d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),d.d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);var eN=e=>{let t=((e,t)=>{switch(e){case"click":return" await page.mouse.click(".concat(t.x,", ").concat(t.y,");");case"keydown":return" await page.keyboard.keydown('".concat(t,"');");case"keyup":return" await page.keyboard.keyup('".concat(t,"');");case"press":return" await page.keyboard.press('".concat(t,"');");case"selectAll":return" await selectAll(page);";case"snapshot":return" await assertHTMLSnapshot(page);\n await assertSelection(page, {\n anchorPath: [".concat(t.anchorPath.toString(),"],\n anchorOffset: ").concat(t.anchorOffset,",\n focusPath: [").concat(t.focusPath.toString(),"],\n focusOffset: ").concat(t.focusOffset,",\n });\n");case"type":return" await page.keyboard.type('".concat(t,"');");default:return""}})(e.name,e.value);switch(e.count){case 1:return t;case 2:return[t,t].join("\n");default:return" await repeat(".concat(e.count,", async () => {\n ").concat(t,"\n );")}};function ej(e,t){var l,n;let r=e,o=[];for(;r!==t;)null!=r&&o.unshift(Array.from(null!=(n=null==r||null==(l=r.parentNode)?void 0:l.childNodes)?n:[]).indexOf(r)),r=null==r?void 0:r.parentNode;return o}var eI=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Delete","Enter","Escape"]),eM=Z({plugins:[{Component:()=>
1{let e=(0,c.c)(3),[t]=(0,p.DF)(),[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),d=(0,g.useRef)(!1),u=(0,g.useRef)(null),c=(0,g.useCallback)(()=>e,[e]),p=(0,g.useCallback)(()=>{let l=e.getRootElement(),n=(0,m.peL)(e._window);return null!=l&&null!=n&&null!=n.anchorNode&&null!=n.focusNode&&l.contains(n.anchorNode)&&l.contains(n.focusNode)?"\nimport {\n initializeE2E,\n assertHTMLSnapshot,\n assertSelection,\n repeat,\n} from '../utils';\nimport {selectAll} from '../keyboardShortcuts';\nimport { RangeSelection } from 'lexical';\nimport { NodeSelection } from 'lexical';\n\ndescribe('Test case', () => {\n initializeE2E((e2e) => {\n it('Should pass this test', async () => {\n const {page} = e2e;\n\n await page.focus('div[contenteditable=\"true\"]');\n".concat(t.map(eN).join("\n"),"\n });\n});\n "):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()&&(eL?e.metaKey:e.ctrlKey)?h("selectAll",""):eI.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;!eI.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)},[p]),(0,g.useEffect)(()=>{if(t){let e=p();null!==e&&a(e),u.current&&u.current.scrollTo(0,u.current.scrollHeight)}},[p,t]),(0,g.useEffect)(()=>e.registerUpdateListener(t=>{let{dirtyElements:l,dirtyLeaves:r,editorState:o}=t;if(!n)return;let i=o._selection,u=s.current,c=d.current;if(u!==i){if(0===r.size&&0===l.size&&!c){let t=(0,m.peL)(e._window);if(t&&(null==t.anchorNode||null==t.focusNode))return}s.current=i}d.current=!1;let h=p();null!==h&&a(h)}),[e,p,n,h]),(0,g.useEffect)(()=>n?e.registerUpdateListener(()=>{let t=e.getRootElement();null!==t&&o(null==t?void 0:t.innerHTML)}):void 0,[e,n]);let f=(0,g.useCallback)(e=>{n||(e.update(()=>{let e=(0,m.NiT)();e.clear();let t=(0,m.sTu)();e.append((0,m.lJ7)().append(t)),t.select()}),l([])),r(e=>!e)},[n]),x=(0,g.useCallback)(()=>{let t;if(!n)return;let l=(0,m.peL)(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=c().getRootElement(),d;null!==r&&(d=ej(r,s)),null!==i&&(t=ej(i,s)),h("snapshot",{anchorNode:r,anchorOffset:o,anchorPath:d,focusNode:i,focusOffset:a,focusPath:t})},[h,n,c]),b=(0,g.useCallback)(()=>{(e=>{var t,l;let n=document.createElement("textarea");n.value=e||"",n.style.position="absolute",n.style.opacity="0",null==(t=document.body)||t.appendChild(n),n.focus(),n.select();try{let e=document.execCommand("copy");console.log(e)}catch(e){console.error(e)}null==(l=document.body)||l.removeChild(n)})(p())},[p]),C=(0,g.useCallback)(()=>{var e,t,l;let n;e=p(),(n=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e||"")),n.setAttribute("download","test.js"),n.style.display="none",null==(t=document.body)||t.appendChild(n),n.click(),null==(l=document.body)||l.removeChild(n)},[p]);return[(0,v.jsx)("button",{className:"editor-dev-button ".concat(n?"active":""),id:"test-recorder-button",onClick:e=>{f(c()),e.preventDefault()},title:n?"Disable test recorder":"Enable test recorder",type:"button",children:n?"Disable test recorder":"Enable test recorder"}),n?(0,v.jsxs)("div",{className:"test-recorder-output",children:[(0,v.jsxs)("div",{className:"test-recorder-toolbar",children:[(0,v.jsx)("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:e=>{x(),e.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),(0,v.jsx)("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:e=>{b(),e.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),(0,v.jsx)("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:e=>{C(),e.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),(0,v.jsx)("pre",{id:"test-recorder",ref:u,children:i})]}):null]}(t),r;return e[0]!==l||e[1]!==n?(r=(0,v.jsxs)(g.Fragment,{children:[(0,v.jsx)("p",{children:"HI"}),l,n,(0,v.jsx)("p",{children:"DONE"})]}),e[0]=l,e[1]=n,e[2]=r):r=e[2],r},position:"bottom"}]}),eF=Z({plugins:[{Component:()=>
1{let e=(0,c.c)(2),[t]=(0,p.DF)(),l;return e[0]!==t?(l=(0,v.jsx)(M.G,{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"}]}),eA=e=>({type:"buttons",items:e,key:"format",order:40}),eR={type:"text-format",format:["bold","italic"],tag:"***"},eP={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},eD={type:"text-format",format:["bold"],tag:"**"},eH={type:"text-format",format:["bold"],intraword:!1,tag:"__"},eB=[eA([{ChildComponent:()=>(0,v.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,v.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:e=>{let{selection:t}=e;return!!((0,m.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("bold")},key:"bold",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.mB,"bold")},order:1}])],eO=Z(e=>{let{featureProviderMap:t}=e,l=[eD,eH];return t.get("italic")&&l.push(eP,eR),{enableFormats:["bold"],markdownTransformers:l,toolbarFixed:{groups:eB},toolbarInline:{groups:eB}}}),eJ=[eA([{ChildComponent:()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),(0,v.jsx)("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]}),isActive:e=>{let{selection:t}=e;return!!((0,m.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("code")},key:"inlineCode",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.mB,"code")},order:7}])],ez=Z({enableFormats:["code"],markdownTransformers:[{type:"text-format",format:["code"],tag:"`"}],toolbarFixed:{groups:eJ},toolbarInline:{groups:eJ}}),eV=[eA([{ChildComponent:()=>(0,v.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,v.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:e=>{let{selection:t}=e;return!!((0,m.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("italic")},key:"italic",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.mB,"italic")},order:2}])],eW=Z({enableFormats:["italic"],markdownTransformers:[{type:"text-format",format:["italic"],tag:"*"},{type:"text-format",format:["italic"],intraword:!1,tag:"_"}],toolbarFixed:{groups:eV},toolbarInline:{groups:eV}}),eU=[eA([{ChildComponent:()=>(0,v.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,v.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.
118C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,v.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),isActive:e=>{let{selection:t}=e;return!!((0,m.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("strikethrough")},key:"strikethrough",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.mB,"strikethrough")},order:4}])],eZ=Z({enableFormats:["strikethrough"],markdownTransformers:[{type:"text-format",format:["strikethrough"],tag:"~~"}],toolbarFixed:{groups:eU},toolbarInline:{groups:eU}}),eK=[eA([{ChildComponent:()=>(0,v.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,v.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:e=>{let{selection:t}=e;return!!((0,m.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("subscript")},key:"subscript",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.mB,"subscript")},order:5}])],eG=Z({enableFormats:["subscript"],toolbarFixed:{groups:eK},toolbarInline:{groups:eK}}),eq=[eA([{ChildComponent:()=>(0,v.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,v.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:e=>{let{selection:t}=e;return!!((0,m.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("superscript")},key:"superscript",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.mB,"superscript")},order:6}])],eY=Z({enableFormats:["superscript"],toolbarFixed:{groups:eq},toolbarInline:{groups:eq}}),eX=[eA([{ChildComponent:()=>(0,v.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,v.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,v.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),isActive:e=>{let{selection:t}=e;return!!((0,m.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("underline")},key:"underline",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.mB,"underline")},order:3}])],e$=Z({enableFormats:["underline"],toolbarFixed:{groups:eX},toolbarInline:{groups:eX}}),eQ=e=>{let{css:t}=e,l=t?Object.fromEntries(Object.entries(t).map(e=>{let[t,l]=e;return[t.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),l]})):{};return(0,v.jsx)("span",{style:{...l,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};function e0(e,t,l,n){e.update(()=>{(0,b.Vs)(e=>{let r=t.get(l);if(!r)throw Error("State config for ".concat(l," not found"));(0,m.Chh)(e,r.stateConfig,n)})})}var e1=(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,v.jsx)(eQ,{css:o.css}),key:e,label:o.label,onSelect:l=>{let{editor:r}=l;e0(r,t,n,e)}})}}return[{type:"dropdown",ChildComponent:()=>(0,v.jsx)(eQ,{css:{color:"var(--theme-elevation-600)"}}),items:[{ChildComponent:()=>(0,v.jsx)(eQ,{}),key:"clear-style",label:e=>{let{i18n:t}=e;return t.t("lexical:textState:defaultStyle")},onSelect:l=>{let{editor:n}=l;
1for(let l in e.state)e0(n,t,l,void 0)},order:1},...l],key:"textState",order:30}]},e2=Z(e=>{let{props:t}=e,l=function(e){let t=new Map;for(let l in e){let n=e[l],r=(0,m.urt)(l,{parse:e=>"string"==typeof e&&Object.keys(n).includes(e)?e:void 0});t.set(l,{stateConfig:r,stateValues:n})}return t}(t.state);return{plugins:[{Component:()=>(function(e){let{stateMap:t}=e,[l]=(0,p.DF)();return(0,g.useEffect)(()=>l.registerMutationListener(m.Ey8,e=>{l.getEditorState().read(()=>{for(let[n,r]of e){if("destroyed"===r)continue;let e=(0,m.nsf)(n),o=l.getElementByKey(n);if(!e||!o)continue;let i=Object.create(null);t.forEach((t,l)=>{var n;let r=(0,m.I8X)(e,t.stateConfig);if(!r)return void delete o.dataset[l];o.dataset[l]=r;let a=null==(n=t.stateValues[r])?void 0:n.css;a&&Object.assign(i,a)}),o.style.cssText="",Object.assign(o.style,i)}})}),[l]),null})({stateMap:l}),position:"normal"}],toolbarFixed:{groups:e1(t,l)},toolbarInline:{groups:e1(t,l)}}}),e6=e=>(t,l,n)=>{let r=e(n);r&&(r.append(...l),t.replace(r),r.select(0,0))},e5=e=>{let t=(0,m.vJq)();(0,b.zI)(t,()=>(0,x.fi)(e))},e3={h1:()=>(0,v.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,v.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,v.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,v.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,v.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,v.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,v.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,v.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,v.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,v.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,v.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,v.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"})})},e4=Z(e=>{let{props:t}=e,{enabledHeadingSizes:l=["h1","h2","h3","h4","h5","h6"]}=t,n=[ee(l.map((e,t)=>({ChildComponent:e3[e],isActive:t=>{let{selection:l}=t;if(!(0,m.I2P)(l))return!1;for(let t of l.getNodes()){if((0,x.Pi)(t)&&t.getTag()===e)continue;let l=t.getParent();if(!((0,x.Pi)(l)&&l.getTag()===e))return!1}return!0},key:e,label:t=>{let{i18n:l}=t;return l.t("lexical:heading:label",{headingLevel:e.charAt(1)})},onSelect:t=>{let{editor:l}=t;l.update(()=>{e5(e)})},order:t+2})))];return{markdownTransformers:[(e=>{let t=new RegExp("^(".concat(e.map(e=>Number(e.slice(1))).map(e=>"#{".concat(e,"}")).join("|"),")\\s"));return{type:"element",dependencies:[x.jL],export:(e,t)=>{if(!(0,x.Pi)(e))return null;let l=Number(e.getTag().slice(1));return"#".repeat(l)+" "+t(e)},regExp:t,replace:e6(e=>{var t;let l="h"+(null==(t=e[1])?void 0:t.length);return(0,x.fi)(l)})}})(l)],nodes:[x.jL],plugins:[{Component:e7,position:"normal"}],sanitizedClientFeatureProps:t,slashMenu:{groups:(null==l?void 0:l.length)?[W(l.map(e=>({Icon:e3[e],key:"heading-".concat(e.charAt(1)),keywords:["heading",e],label:t=>{let{i18n:l}=t;return l.t("lexical:heading:label",{headingLevel:e.charAt(1)})},onSelect:t=>{let{editor:l}=t;l.update(()=>{e5(e)})}})))]:[]},toolbarFixed:{groups:(null==l?void 0:l.length)?n:[]},toolbarInline:{groups:(null==l?void 0:l.length)?n:[]}}}),e7=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,p.DF)(),d,u;return t[4]!==s||t[5]!==o||t[6]!==a?(d=()=>{if(!(!a||6===o.length))return s.registerNodeTransform(x.jL,e=>{o.includes(e.getTag())||e.setTag(a)})},u=[s,o,a],t[4]=s,t[5]=o,t[6]=a,t[7]=d,t[8]=u):(d=t[7],u=t[8]),(0,g.useEffect)(d,u),null},e8=()=>(0,v.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,v.jsx)("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})}),e9=()=>(0,v.jsxs)("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("path",{d:"M5 10h10",stroke:"currentColor"}),(0,v.jsx)("path",{d:"M10 15V5",stroke:"currentColor"})]}),te=e=>({type:"dropdown",ChildComponent:e9,items:e,key:"add",order:10}),tt=(0,m.guI)("INSERT_HORIZONTAL_RULE_COMMAND"),tl=class extends m.Kp7{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:tn,priority:0})}}static importJSON(e){return tr()}createDOM(e){let t=document.createElement("hr");return(0,f.ZB)(t,e.theme.hr),t}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}};function tn(){return{node:tr()}}function tr(){return(0,m.pTq)(new tl)}var to=class extends tl{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return ti()}decorate(){return null}exportJSON(){return super.exportJSON()}};function ti(){return(0,m.pTq)(new to)}function ta(e){return e instanceof to}function ts(e){let t=(0,m.vJq)();if(!(0,m.I2P)(t))return!1;if(null!==t.focus.getNode()){let e=ti();(0,f.Pe)(e)}return!0}var td=Z({markdownTransformers:[{type:"element",dependencies:[to],export:(e,t)=>ta(e)?"---":null,regExp:/^---\s*$/,replace:e=>{let t=ti();t&&e.replace(t)}}],nodes:[to],plugins:[{Component:()=>{let e=(0,c.c)(3),[t]=(0,p.DF)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(tt,ts,m.jZM),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:[W([{Icon:e8,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:e=>{let{i18n:t}=e;return t.t("lexical:horizontalRule:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(tt,void 0)}}])]},toolbarFixed:{groups:[te([{ChildComponent:e8,isActive:e=>{let{selection:t}=e;return!!(0,m.RTZ)(t)&&!!t.getNodes().length&&ta(t.getNodes()[0])},key:"horizontalRule",label:e=>{let{i18n:t}=e;return t.t("lexical:horizontalRule:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(tt,void 0)}}])]}}),tu=()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("path",{d:"M2.5 5H10.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M2.5 10H10.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M12.25 7.25L17.25 3.75V10.75L12.25 7.25Z",fill:"currentColor"})]}),tc=()=>(0,v.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,v.jsx)("path",{d:"M17.5 5H9.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M17.5 10H9.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M17.5 15H2.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M7.75 7.25L2.75 3.75V10.75L7.75 7.25Z",fill:"currentColor"})]}),tp=e=>{let{clientProps:t}=e,[l]=(0,p.DF)(),{disabledNodes:n,disableTabNode:r}=t;return(0,g.useEffect)(()=>{if(!(!l||!(null==n?void 0:n.length)))return(0,f.Sd)(l.registerCommand(m.PiT,()=>(function(e){let t=(0,m.vJq)();if(!(0,m.I2P)(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,f.Bt)(r,e=>(0,m.ff4)(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(!n.includes(e.getType())){let t=e.getIndent();e.setIndent(t+1)}}),m.AcJ),l.registerUpdateListener(e=>{let{dirtyElements:t,editorState:r}=e;l.update(()=>{for(let[e]of t){let t=r._nodeMap.get(e);(0,m.ff4)(t)&&n.includes(t.getType())&&t.getIndent()>0&&t.setIndent(0)}})}))},[l,n]),(0,g.useEffect)(()=>{if(!(!l||!r))return(0,f.Sd)(l.registerCommand(m.OXk,e=>(e.preventDefault(),l.dispatchCommand(e.shiftKey?m.sik:m.PiT,void 0)),m.AcJ),l.registerNodeTransform(m.MZu,e=>{e.remove()}))},[l,r]),(0,v.jsx)(A.m,{})},th=e=>{let{disabledNodes:t}=e;return[{type:"buttons",items:[{ChildComponent:tu,isActive:()=>!1,isEnabled:e=>{var t;let{selection:l}=e,n=null!=(t=null==l?void 0:l.getNodes())?t:[],r=e=>tm(e)&&e.getIndent()>0;return n.some(e=>r(e)||!!(0,f.Bt)(e,r))},key:"indentDecrease",label:e=>{let{i18n:t}=e;return t.t("lexical:indent:decreaseLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.sik,void 0)},order:1},{ChildComponent:tc,isActive:()=>!1,isEnabled:e=>{var l;let{selection:n}=e,r=null!=(l=null==n?void 0:n.getNodes())?l:[],o=e=>tm(e)&&!(null!=t?t:[]).includes(e.getType());return r.some(e=>o(e)||!!(0,f.Bt)(e,o))},key:"indentIncrease",label:e=>{let{i18n:t}=e;return t.t("lexical:indent:increaseLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(m.PiT,void 0)},order:2}],key:"indent",order:35}]},tf=Z(e=>{var t;let{props:l}=e,n=null!=(t=l.disabledNodes)?t:[];return{plugins:[{Component:tp,position:"normal"}],sanitizedClientFeatureProps:l,toolbarFixed:{groups:th({disabledNodes:n})},toolbarInline:{groups:th({disabledNodes:n})}}}),tm=e=>(0,m.ff4)(e)&&e.canIndent();function tg(e){let{anchor:t}=e,{focus:l}=e,n=e.anchor.getNode(),r=e.focus.getNode();return n===r?n:e.isBackward()?(0,b.Nx)(l)?n:r:(0,b.Nx)(t)?n:r}var tv=e=>({type:"buttons",items:e,key:"features",order:50}),tx=new Set(["http:","https:","mailto:","sms:","tel:"]),tb=class extends m.fGB{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:tC,priority:1})}}static importJSON(e){var t,l,n,r,o;let i=tk({}).updateFromJSON(e);return 1===e.version&&"object"==typeof(null==(l=e.fields)||null==(t=l.doc)?void 0:t.value)&&(null==(o=e.fields)||null==(r=o.doc)||null==(n=r.value)?void 0:n.id)&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),2!==e.version||e.id||(e.id=new y.default().toHexString(),e.version=3),i}canBeEmpty(){return!1}canInsertTextAfter(){return!1}canInsertTextBefore(){return!1}createDOM(e){var t,l,n,r,o,i;let a=document.createElement("a");return(null==(t=this.__fields)?void 0:t.linkType)==="custom"&&(a.href=this.sanitizeUrl(null!=(o=this.__fields.url)?o:"")),null!=(i=null==(l=this.__fields)?void 0:l.newTab)&&i&&(a.target="_blank"),(null==(n=this.__fields)?void 0:n.newTab)===!0&&(null==(r=this.__fields)?void 0:r.linkType)==="custom"&&(a.rel=tE(a.rel,"add","noopener")),(0,f.ZB)(a,e.theme.link),a}exportJSON(){let e=this.getFields();(null==e?void 0:e.linkType)==="internal"?delete e.url:(null==e?void 0: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,m.I2P)(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){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],l=this.getParentOrThrow().insertNewAfter(e,t);if((0,m.ff4)(l)){let e=tk({fields:this.__fields});return l.append(e),e}return null}isInline(){return!0}sanitizeUrl(e){try{let t=new URL(e);if(!tx.has(t.protocol))return"about:blank"}catch(e){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){var n,r,o,i,a,s,d,u;let c=null==(n=this.__fields)?void 0:n.url,p=null==(r=this.__fields)?void 0:r.newTab;return null!=c&&c!==(null==(o=e.__fields)?void 0:o.url)&&(null==(i=this.__fields)?void 0:i.linkType)==="custom"&&(t.href=c),(null==(a=this.__fields)?void 0:a.linkType)==="internal"&&(null==(s=e.__fields)?void 0:s.linkType)==="custom"&&t.removeAttribute("href"),null==t.rel&&(t.rel=""),p!==(null==(d=e.__fields)?void 0:d.newTab)&&(null!=p&&p?(t.target="_blank",(null==(u=this.__fields)?void 0:u.linkType)==="custom"&&(t.rel=tE(t.rel,"add","noopener"))):(t.removeAttribute("target"),t.rel=tE(t.rel,"remove","noopener"))),!1}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields).setID(e.id)}constructor({id:e,fields:t={linkType:"custom",newTab:!1},key:l}){super(l),this.__fields=t,this.__id=e}};function tC(e){let t=null;if((0,m.nYP)(e)){var l;let n=e.textContent;null!==n&&""!==n&&(t=tk({id:new y.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:"_blank"===e.getAttribute("target"),url:null!=(l=e.getAttribute("href"))?l:""}}))}return{node:t}}function tk(e){let{id:t,fields:l}=e;return(0,m.pTq)(new tb({id:null!=t?t:new y.default().toHexString(),fields:l}))}function ty(e){return e instanceof tb}var tw=(0,m.guI)("TOGGLE_LINK_COMMAND");function tS(e){var t;let l=(0,m.vJq)();if(!(0,m.I2P)(l)&&(null===e||!(null==(t=e.selectedNodes)?void 0:t.length)))return;let n=(0,m.I2P)(l)?l.extract():null===e?[]:e.selectedNodes;
1if(null===e){null==n||n.forEach(e=>{let t=e.getParent();ty(t)&&(t.getChildren().forEach(e=>{t.insertBefore(e)}),t.remove())});return}if((null==n?void 0:n.length)===1){let t=n[0],l=ty(t)?t:function(e){var t=e,l=e=>ty(e);let n=t;for(;null!==n&&!(null===(n=n.getParent())||l(n)););return n}(t);if(null!==l){l.setFields(e.fields),null!=e.text&&e.text!==l.getTextContent()&&(l.append((0,m.sTu)(e.text)),l.getChildren().forEach(e=>{e!==l.getLastChild()&&e.remove()}));return}}let r=null,o=null;null==n||n.forEach(t=>{let l=t.getParent();if(!(l===o||null===l||(0,m.ff4)(t)&&!t.isInline())){if(ty(l)){o=l,l.setFields(e.fields),null!=e.text&&e.text!==l.getTextContent()&&(l.append((0,m.sTu)(e.text)),l.getChildren().forEach(e=>{e!==l.getLastChild()&&e.remove()}));return}if(l.is(r)||(r=l,o=tk({fields:e.fields}),ty(l)?null===t.getPreviousSibling()?l.insertBefore(o):l.insertAfter(o):t.insertBefore(o)),ty(t)){if(t.is(o))return;if(null!==o){let e=t.getChildren();o.append(...e)}t.remove();return}null!==o&&o.append(t)}})}function tE(e,t,l){let n,r="".concat(e);if("add"===t){if(r.includes(l)){let e=RegExp(l,"g");r=r.replace(e,"").trim()}n=0===(r=r.trim()).length?"".concat(l):"".concat(r," ").concat(l)}else{let e=RegExp(l,"g");n=r.replace(e,"").trim()}return n}var t_={type:"text-match",dependencies:[tb],export:(e,t)=>{if(!ty(e))return null;let{url:l}=e.getFields();return"[".concat(t(e),"](").concat(l,")")},importRegExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,regExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,replace:(e,t)=>{let[,l,n]=t,r=tk({fields:{doc:null,linkType:"custom",newTab:!1,url:n}}),o=(0,m.sTu)(l);return o.setFormat(e.getFormat()),r.append(o),e.replace(r),o},trigger:")"},tT=class extends tb{static clone(e){return new this({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){var t,l,n,r,o;let i=tL({}).updateFromJSON(e);return 1===e.version&&"object"==typeof(null==(l=e.fields)||null==(t=l.doc)?void 0:t.value)&&(null==(o=e.fields)||null==(r=o.doc)||null==(n=r.value)?void 0:n.id)&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),i}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){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],l=this.getParentOrThrow().insertNewAfter(e,t);if((0,m.ff4)(l)){let e=tL({fields:this.__fields});return l.append(e),e}return null}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields)}};function tL(e){let{fields:t}=e;return(0,m.pTq)(new tT({id:"",fields:t}))}function tN(e){return e instanceof tT}function tj(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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 tI(e,t){for(let l of t){let t=l(e);if(null!=t)return t}return null}var tM=/[.,;\s]/;function tF(e){return void 0!==e&&tM.test(e)}function tA(e){return tF(e[e.length-1])}function tR(e){let t=e.getPreviousSibling();return(0,m.ff4)(t)&&(t=t.getLastDescendant()),null===t||(0,m.wH$)(t)||(0,m.kFe)(t)&&tA(t.getTextContent())}function tP(e){let t=e.getNextSibling();return(0,m.ff4)(t)&&(t=t.getFirstDescendant()),null===t||(0,m.wH$)(t)||(0,m.kFe)(t)&&tF(t.getTextContent()[0])}function tD(e,t,l){var n,r,o,i,a,s,d;let u=e.getChildren(),c=u.length;for(let t=0;t<c;t++){let n=u[t];if(!(0,m.kFe)(n)||!n.isSimpleText()){tH(e),l(null,null!=(o=null==(r=e.getFields())?void 0:r.url)?o:null);return}}let p=e.getTextContent(),h=tI(p,t);if(null===h||h.text!==p){tH(e),l(null,null!=(a=null==(i=e.getFields())?void 0:i.url)?a:null);return}if(!tR(e)||!tP(e)){tH(e),l(null,null!=(d=null==(s=e.getFields())?void 0:s.url)?d:null);return}let f=null==(n=e.getFields())?void 0:n.url;if(f!==(null==h?void 0:h.url)){let t=e.getFields();t.url=null==h?void 0:h.url,e.setFields(t),l(h.url,null!=f?f:null)}}function tH(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 tB=[tj(RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-\\w@:%.+~#=]{1,256}\\.[a-zA-Z\\d()]{1,6}\\b([-\\w()@:%+.~#?&/=]*)(?<![-.+():%])"),e=>e.startsWith("http")?e:"https://".concat(e)),tj(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,e=>"mailto:".concat(e))],tO=()=>{let[e]=(0,p.DF)();return function(e,t,l){let n=(0,c.c)(5),r,o;n[0]!==e||n[1]!==t||void 0!==n[2]?(r=()=>{if(!e.hasNodes([tT]))throw Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let l=(e,t)=>
1{};return(0,f.Sd)(e.registerNodeTransform(m.Ey8,e=>{let n=e.getParentOrThrow(),r=e.getPreviousSibling();tN(n)?tD(n,t,l):ty(n)||(e.isSimpleText()&&(tF(e.getTextContent()[0])||!tN(r))&&function(e,t,l){let n=[...e],r=n.map(e=>e.getTextContent()).join(""),o=r,i,a=0;for(;null!=(i=tI(o,t))&&null!==i;){var s,d,u;let e=i.index,t=e+i.length;if(s=a+e,d=a+t,u=n,(s>0?!!tF(r[s-1]):!!tR(u[0]))&&(d<r.length?tF(r[d]):tP(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],d=e.getTextContent().length,u=a;a+d<=t?(n.push(e),i+=d):u>=l?o.push(e):r.push(e),a+=d,s.shift()}return[i,n,r,o]}(n,a+e,a+t),d=function(e,t,l,n){let r=tL({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,m.sTu)(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,m.vJq)(),t=e?e.getNodes().find(m.kFe):void 0,l=(0,m.sTu)(i.getTextContent());return l.setFormat(i.getFormat()),l.setDetail(i.getDetail()),l.setStyle(i.getStyle()),r.append(l,...a),t&&t===i&&((0,m.I2P)(e)?l.select(e.anchor.offset,e.focus.offset):(0,m.RTZ)(e)&&l.select(0,l.getTextContent().length)),i.replace(r),s}}}(o,a+e-r,a+t-r,i);n=d?[d,...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,m.kFe)(l)&&l.isSimpleText()&&(t.push(l),!/\s/.test(l.getTextContent()));)l=l.getNextSibling();return t}(e),t,l),!function(e,t,l){var n,r,o,i,a,s,d,u;let c=e.getPreviousSibling(),p=e.getNextSibling(),h=e.getTextContent();if(tN(c)){let n=null!=(r=c.getFields())&&!!r.url&&null!=(s=null==(i=c.getFields())||null==(o=i.url)?void 0:o.startsWith("mailto:"))&&s;(!tF(h[0])||(n?/^\.[a-z]{2,}/i.test(h):/^\.[a-z0-9]+/i.test(h)))&&(c.append(e),tD(c,t,l),l(null,null!=(d=null==(a=c.getFields())?void 0:a.url)?d:null))}tN(p)&&!tA(h)&&(tH(p),tD(p,t,l),l(null,null!=(u=null==(n=p.getFields())?void 0:n.url)?u:null))}(e,t,l))}))},o=[e,t,l],n[0]=e,n[1]=t,n[2]=l,n[3]=r,n[4]=o):(r=n[3],o=n[4]),(0,g.useEffect)(r,o)}(e,tB),null},tJ=()=>(0,v.jsx)(R.g,{});function tz(e,t,l){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5,o=l.parentElement;if(null===e||null==o){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}let i=t.getBoundingClientRect(),a=l.getBoundingClientRect(),s=o.getBoundingClientRect(),d=e.top-n,u=e.left-r;d<s.top&&(d+=i.height+e.height+2*n),u+i.width>s.right&&(u=s.right-i.width-r),d-=a.top,u-=a.left,t.style.opacity="1",t.style.transform="translate(".concat(u,"px, ").concat(d,"px)")}var tV=(0,m.guI)("TOGGLE_LINK_WITH_MODAL_COMMAND");function tW(e){e.preventDefault()}function tU(e){let{anchorElem:t}=e,[l]=(0,p.DF)(),[n,r]=(0,g.useState)(),o=(0,g.useRef)(null),[s,d]=(0,g.useState)(null),[c,h]=(0,g.useState)(null),{fieldProps:{schemaPath:x},uuid:b}=(0,u.b)(),k=(0,w.a)(),{config:y,getEntityConfig:L}=(0,E.c)(),{i18n:N,t:j}=(0,_.d)(),[I,M]=(0,g.useState)(),F=(0,S.useEditDepth)(),[A,R]=(0,g.useState)(!1),[P,H]=(0,g.useState)([]),B=(0,S.useLocale)(),[O,J]=(0,g.useState)(!1),z=(0,S.formatDrawerSlug)({slug:"lexical-rich-text-link-"+b,depth:F}),{toggleDrawer:V}=(0,a.a)(z),W=(0,g.useCallback)(()=>{R(!1),o&&o.current&&(o.current.style.opacity="0",o.current.style.transform="translate(-10000px, -10000px)"),J(!1),d(null),h(null),H([]),M(void 0)},[R,d,h,H]),U=(0,g.useCallback)(()=>{var e,n,i,a,s,u,c,p,g;let v=(0,m.vJq)(),x;if(!(0,m.I2P)(v)||!v)return void W();let b=tg(v);x=null==(e=l.getElementByKey(b.getKey()))?void 0:e.getBoundingClientRect();let k=(0,f.Bt)(b,ty),w=v.getNodes().filter(e=>!(0,m.wH$)(e)).find(e=>{let t=(0,f.Bt)(e,ty);return k&&!k.is(t)||t&&!t.is(k)});if(null==k||w)return void W();r(k);let S=k.getFields(),E={...S,id:k.getID(),text:k.getTextContent()};if((null==S?void 0:S.linkType)==="custom")d(null!=(n=null==S?void 0:S.url)?n:null),h(null);else{d("".concat("/"===y.routes.admin?"":y.routes.admin,"/collections/").concat(null==S||null==(i=S.doc)?void 0:i.relationTo,"/").concat(null==S||null==(a=S.doc)?void 0:a.value));let e=(null==S||null==(s=S.doc)?void 0:s.relationTo)?L({collectionSlug:null==S||null==(u=S.doc)?void 0:u.relationTo}):void 0;if(e){let t="object"==typeof(null==(c=S.doc)?void 0:c.value)?S.doc.value.id:null==(p=S.doc)?void 0:p.value,l=null==(g=S.doc)?void 0:g.relationTo;if(!t||!l)throw Error("Focus link parent is missing doc.value or doc.relationTo");h(j("fields:linkedTo",{label:"".concat((0,C.s)(e.labels.singular,N
1)," - ").concat(j("lexical:link:loadingWithEllipsis",N))}).replace(/<[^>]*>?/g,"")),T.zG.get((0,D.Q)({apiRoute:y.routes.api,path:"/".concat(l,"/").concat(t),serverURL:y.serverURL}),{headers:{"Accept-Language":N.language},params:{depth:0,locale:null==B?void 0:B.code}}).then(async t=>{var l;if(!t.ok)throw Error("HTTP error! Status: ".concat(t.status));let n=(await t.json())[(null==e||null==(l=e.admin)?void 0:l.useAsTitle)||"id"];h(j("fields:linkedTo",{label:"".concat((0,C.s)(e.labels.singular,N)," - ").concat(n)}).replace(/<[^>]*>?/g,""))}).catch(()=>{h(j("fields:linkedTo",{label:"".concat((0,C.s)(e.labels.singular,N)," - ").concat(j("general:untitled",N)," - ID: ").concat(t)}).replace(/<[^>]*>?/g,""))})}else h((null==S?void 0:S.label)?String(null==S?void 0:S.label):null),d((null==S?void 0:S.url)?String(null==S?void 0:S.url):null)}M(E),R(!0),H(v?null==v?void 0:v.getNodes():[]),tN(k)?J(!0):J(!1);let _=o.current,I=(0,m.peL)(l._window),{activeElement:F}=document;if(null===_)return;let A=l.getRootElement();return null!==I&&null!==A&&A.contains(I.anchorNode)?(x||(x=I.getRangeAt(0).getBoundingClientRect()),null!=x&&(x.y+=40,tz(x,_,t))):(null==F||"link-input"!==F.className)&&(null!==A&&tz(null,_,t),d(null),h(null)),!0},[l,W,y.routes.admin,y.routes.api,y.serverURL,L,j,N,null==B?void 0:B.code,t]);return(0,g.useEffect)(()=>(0,f.Sd)(l.registerCommand(tV,e=>(l.dispatchCommand(tw,e),U(),V(),!0),m.AcJ)),[l,U,V,z]),(0,g.useEffect)(()=>{let e=t.parentElement,n=()=>{l.getEditorState().read(()=>{U()})};return window.addEventListener("resize",n),null==e||e.addEventListener("scroll",n),()=>{window.removeEventListener("resize",n),null==e||e.removeEventListener("scroll",n)}},[t.parentElement,l,U]),(0,g.useEffect)(()=>(0,f.Sd)(l.registerUpdateListener(e=>{let{editorState:t}=e;t.read(()=>{U()})}),l.registerCommand(m.MvL,()=>(U(),!0),m.AcJ),l.registerCommand(m.Q$N,()=>!!A&&(W(),!0),m.WgU)),[l,U,A,W]),(0,g.useEffect)(()=>{l.getEditorState().read(()=>{U()})},[l,U]),(0,v.jsxs)(g.Fragment,{children:[(0,v.jsx)("div",{className:"link-editor",ref:o,children:(0,v.jsxs)("div",{className:"link-input",children:[s&&s.length>0?(0,v.jsxs)("a",{href:s,rel:"noopener noreferrer",target:"_blank",children:[(null==n?void 0:n.__fields.newTab)?(0,v.jsx)(S.ExternalLinkIcon,{}):null,null!=c&&c.length>0?c:s]}):null!=c&&c.length>0?(0,v.jsxs)(v.Fragment,{children:[(null==n?void 0:n.__fields.newTab)?(0,v.jsx)(S.ExternalLinkIcon,{}):null,(0,v.jsx)("span",{className:"link-input__label-pure",children:c})]}):null,k&&(0,v.jsxs)(g.Fragment,{children:[(0,v.jsx)("button",{"aria-label":"Edit link",className:"link-edit",onClick:e=>{e.preventDefault(),V()},onMouseDown:tW,tabIndex:0,type:"button",children:(0,v.jsx)(S.EditIcon,{})}),!O&&(0,v.jsx)("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{l.dispatchCommand(tw,null)},onMouseDown:tW,tabIndex:0,type:"button",children:(0,v.jsx)(S.CloseMenuIcon,{})})]})]})}),(0,v.jsx)(i.a,{className:"lexical-link-edit-drawer",data:I,drawerSlug:z,drawerTitle:j("fields:editLink"),featureKey:"link",handleDrawerSubmit:(e,t)=>{let n={...t};delete n.text,l.update(()=>{var e,t;let l=(0,m.vJq)(),r=null;if((0,m.I2P)(l)?r=tg(l).getParent():P.length&&(r=null!=(t=null==(e=P[0])?void 0:e.getParent())?t:null),r&&tN(r)){let e=tk({fields:n});r.replace(e,!0)}}),l.dispatchCommand(tw,{fields:n,selectedNodes:P,text:t.text})},schemaPath:x,schemaPathSuffix:"fields"})]})}var tZ=e=>{let{anchorElem:t=document.body}=e;return(0,P.createPortal)((0,v.jsx)(tU,{anchorElem:t}),t)},tK=/^(?:[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+)?$/,tG=/^(?:\/[\w\-./]*(?:\?[-;&=%\w]*)?(?:#[\w-]+)?|#[\w\-]+)$/,tq=e=>{let t=(0,c.c)(5),{clientProps:l}=e,[n]=(0,p.DF)(),r,o;return t[0]!==l.defaultLinkType||t[1]!==l.defaultLinkURL||t[2]!==n?(r=()=>{if(!n.hasNodes([tb]))throw Error("LinkPlugin: LinkNode not registered on editor");return(0,f.Sd)(n.registerCommand(tw,e=>{var t,n;return null===e?tS(null):((null==(t=e.fields)?void 0:t.linkType)||(e.fields.linkType=l.defaultLinkType),(null==(n=e.fields)?void 0:n.url)||(e.fields.url=l.defaultLinkURL),tS(e)),!0}
1,m.AcJ),n.registerCommand(m.waI,e=>{let t=(0,m.vJq)();if(!(0,m.I2P)(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||tK.test(e)||tG.test(e))return!0;try{let t=new URL(e);return!(["ftp:","http:","https:"].includes(t.protocol)&&!t.hostname.includes("."))}catch(e){}return!1}(l)&&!t.getNodes().some(tY)&&(n.dispatchCommand(tw,{fields:{doc:null,linkType:"custom",newTab:!1,url:l},text:null}),e.preventDefault(),!0)},m.AcJ))},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 tY(e){return(0,m.ff4)(e)}var tX=[tv([{ChildComponent:()=>(0,v.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,v.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:e=>{let{selection:t}=e;if((0,m.I2P)(t)){let e=tg(t);return null!=(0,f.Bt)(e,ty)}return!1},isEnabled:e=>{var t,l;let{selection:n}=e;return!!((0,m.I2P)(n)&&(null==(l=(0,m.vJq)())||null==(t=l.getTextContent())?void 0:t.length))},key:"link",label:e=>{let{i18n:t}=e;return t.t("lexical:link:label")},onSelect:e=>{let{editor:t,isActive:l}=e;if(l)t.dispatchCommand(tw,null);else{let e,l=[];if(t.getEditorState().read(()=>{var t,n,r;e=null==(t=(0,m.vJq)())?void 0:t.getTextContent(),l=null!=(r=null==(n=(0,m.vJq)())?void 0:n.getNodes())?r:[]}),!(null==e?void 0:e.length))return;t.dispatchCommand(tV,{fields:{doc:null},selectedNodes:l,text:e})}},order:1}])],t$=Z(e=>{let{props:t}=e;return{markdownTransformers:[t_],nodes:[tb,(null==t?void 0:t.disableAutoLinks)===!0?null:tT].filter(Boolean),plugins:[{Component:tq,position:"normal"},(null==t?void 0:t.disableAutoLinks)===!0||(null==t?void 0:t.disableAutoLinks)==="creationOnly"?null:{Component:tO,position:"normal"},{Component:tJ,position:"normal"},{Component:tZ,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:tX},toolbarInline:{groups:tX}}}),tQ=()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),(0,v.jsx)("path",{d:"M7 10L9 12.5L13 7.5",stroke:"currentColor",strokeWidth:"1.5"})]}),t0=()=>(0,v.jsx)(B.Q,{});function t1(e,t){return"ordered"===e?!t.has("unorderedList"):"checklist"===e&&!t.has("unorderedList")&&!t.has("orderedList")}function t2(e){return{items:e,key:"lists",label:e=>{let{i18n:t}=e;return t.t("lexical:general:slashMenuListGroupLabel")}}}var t6=e=>(t,l,n)=>{let r=t.getPreviousSibling(),o=t.getNextSibling(),i=(0,H.i)("check"===e?"x"===n[3]:void 0);if((0,H.HY)(o)&&o.getListType()===e){let e=o.getFirstChild();null!==e?e.insertBefore(i):o.append(i),t.remove()}else if((0,H.HY)(r)&&r.getListType()===e)r.append(i),t.remove();else{let l=(0,H.DE)(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)},t5=(e,t,l)=>{let n=[],r=e.getChildren(),o=0;for(let i of r)if((0,H.Mz)(i)){if(1===i.getChildrenSize()){let e=i.getFirstChild();if((0,H.HY)(e)){n.push(t5(e,t,l+1));continue}}let r=" ".repeat(4*l),a=e.getListType(),s="number"===a?"".concat(e.getStart()+o,". "):"check"===a?"- [".concat(i.getChecked()?"x":" ","] "):"- ";n.push(r+s+t(i)),o++}return n.join("\n")},t3={type:"element",dependencies:[H.v5,H.YW],export:(e,t)=>(0,H.HY)(e)?t5(e,t,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:t6("check")},t4=()=>(0,v.jsx)(O.A,{}),t7=[ee([{ChildComponent:tQ,isActive:e=>{let{selection:t}=e;if(!(0,m.I2P)(t))return!1;for(let e of t.getNodes()){if((0,H.HY)(e)&&"check"===e.getListType())continue;let t=e.getParent();if((0,H.HY)(t)&&"check"===t.getListType())continue;let l=null==t?void 0:t.getParent();if(!((0,H.HY)(l)&&"check"===l.getListType()))return!1}return!0},key:"checklist",label:e=>{let{i18n:t}=e;return t.t("lexical:checklist:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(H.mJ,void 0)},order:12}])],t8=Z(e=>{let{featureProviderMap:t}=e,l=[{Component:t4,position:"normal"}],n=t1("checklist",t);return n&&l.push({Component:t0,position:"normal"}),{markdownTransformers:[t3],nodes:n?[H.v5,H.YW]:[],plugins:l,slashMenu:{groups:[t2([{Icon:tQ,key:"checklist",keywords:["check list","check","checklist","cl"],label:e=>{let{i18n:t}=e;return t.t("lexical:checklist:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(H.mJ,void 0)}}])]},toolbarFixed:{groups:t7},toolbarInline:{groups:t7}}}),t9=()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.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,v.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,v.jsx)("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]}),le={type:"element",dependencies:[H.v5,H.YW],export:(e,t)=>(0,H.HY)(e)?t5(e,t,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:t6("number")},lt=[ee([{ChildComponent:t9,isActive:e=>{let{selection:t}=e;if(!(0,m.I2P)(t))return!1;for(let e of t.getNodes()){if((0,H.HY)(e)&&"number"===e.getListType())continue;let t=e.getParent();if((0,H.HY)(t)&&"number"===t.getListType())continue;let l=null==t?void 0:t.getParent();if(!((0,H.HY)(l)&&"number"===l.getListType()))return!1}return!0},key:"orderedList",label:e=>{let{i18n:t}=e;return t.t("lexical:orderedList:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(H.x,void 0)},order:10}])],ll=Z(e=>{let{featureProviderMap:t}=e,l=t1("ordered",t);return{markdownTransformers:[le],nodes:l?[H.v5,H.YW]:[],plugins:l?[{Component:t0,position:"normal"}]:[],slashMenu:{groups:[t2([{Icon:t9,key:"orderedList",keywords:["ordered list","ol"],label:e=>{let{i18n:t}=e;return t.t("lexical:orderedList:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(H.x,void 0)}}])]},toolbarFixed:{groups:lt},toolbarInline:{groups:lt}}}),ln=()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),(0,v.jsx)("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),(0,v.jsx)("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),(0,v.jsx)("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),(0,v.jsx)("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]}),lr={type:"element",dependencies:[H.v5,H.YW],export:(e,t)=>(0,H.HY)(e)?t5(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:t6("bullet")},lo=[ee([{ChildComponent:ln,isActive:e=>{let{selection:t}=e;if(!(0,m.I2P)(t))return!1;for(let e of t.getNodes()){if((0,H.HY)(e)&&"bullet"===e.getListType())continue;let t=e.getParent();if((0,H.HY)(t)&&"bullet"===t.getListType())continue;let l=null==t?void 0:t.getParent();if(!((0,H.HY)(l)&&"bullet"===l.getListType()))return!1}return!0},key:"unorderedList",label:e=>{let{i18n:t}=e;return t.t("lexical:unorderedList:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(H.q7,void 0)},order:11}])],li=Z({markdownTransformers:[lr],nodes:[H.v5,H.YW],plugins:[{Component:t0,position:"normal"}],slashMenu:{groups:[t2([{Icon:ln,key:"unorderedList",keywords:["unordered list","ul"],label:e=>{let{i18n:t}=e;return t.t("lexical:unorderedList:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(H.q7,void 0)}}])]},toolbarFixed:{groups:lo},toolbarInline:{groups:lo}}),la=g.lazy(()=>l.e(1115).then(l.bind(l,11115)).then(e=>({default:e.UnknownConvertedNodeComponent}))),ls=class extends m.Kp7{static clone(e){return new this({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return function(e){let{data:t}=e;return(0,m.pTq)(new ls({data:t}))}({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let t=document.createElement("span");return(0,f.ZB)(t,"unknownConverted"),t}decorate(){return(0,v.jsx)(la,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,t){return!1}constructor({data:e,key:t}){super(t),this.__data=e}},ld=Z(()=>({nodes:[ls]})),lu=g.lazy(()=>l.e(7308).then(l.bind(l,57308)).then(e=>({default:e.UnknownConvertedNodeComponent}))),lc=class extends m.Kp7{static clone(e){return new this({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return function(e){let{data:t}=e;return(0,m.pTq)(new lc({data:t}))}({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let t=document.createElement("span");return(0,f.ZB)(t,"unknownConverted"),t}decorate(){return(0,v.jsx)(lu,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,t){return!1}constructor({data:e,key:t}){super(t),this.__data=e}},lp=Z(()=>({nodes:[lc]})),lh=[ee([{ChildComponent:Q,isActive:e=>{let{selection:t}=e;if(!(0,m.I2P)(t))return!1;for(let e of t.getNodes())if(!(0,m.bSg)(e)&&!(0,m.bSg)(e.getParent()))return!1;return!0},key:"paragraph",label:e=>{let{i18n:t}=e;return t.t("lexical:paragraph:label2")},onSelect:e=>{let{editor:t}=e;t.update(()=>{let e=(0,m.vJq)();(0,b.zI)(e,()=>(0,m.lJ7)())})},order:1}])],lf=Z({slashMenu:{groups:[W([{Icon:Q,key:"paragraph",keywords:["normal","paragraph","p","text"],label:e=>{let{i18n:t}=e;return t.t("lexical:paragraph:label")},onSelect:e=>{let{editor:t}=e;t.update(()=>{let e=(0,m.vJq)();(0,b.zI)(e,()=>(0,m.lJ7)())})}}])]},toolbarFixed:{groups:lh},toolbarInline:{groups:lh}}),lm={horizontalrule:(0,v.jsx)("hr",{})},lg={linebreak:(0,v.jsx)("br",{})},lv={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},lx=lv.IS_BOLD|lv.IS_ITALIC|lv.IS_STRIKETHROUGH|lv.IS_UNDERLINE|lv.IS_CODE|lv.IS_SUBSCRIPT|lv.IS_SUPERSCRIPT|lv.IS_HIGHLIGHT,lb="\xa0",lC="\n\n",lk="Ö-ß¿ï¬-﷽ﹰ-ﻼ",ly="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-ʸÌ-Öà -á¿¿ââ°-ï¬ï¸-﹯﻽-ï¿¿",lw=RegExp("^[^"+ly+"]*["+lk+"]"),lS=RegExp("^[^"+lk+"]*["+ly+"]"),lE={bold:lv.IS_BOLD,code:lv.IS_CODE,highlight:lv.IS_HIGHLIGHT,italic:lv.IS_ITALIC,strikethrough:lv.IS_STRIKETHROUGH,subscript:lv.IS_SUBSCRIPT,superscript:lv.IS_SUPERSCRIPT,underline:lv.IS_UNDERLINE},l_={directionless:lv.IS_DIRECTIONLESS,unmergeable:lv.IS_UNMERGEABLE},lT={center:lv.IS_ALIGN_CENTER,end:lv.IS_ALIGN_END,justify:lv.IS_ALIGN_JUSTIFY,left:lv.IS_ALIGN_LEFT,right:lv.IS_ALIGN_RIGHT,start:lv.IS_ALIGN_START},lL={[lv.IS_ALIGN_CENTER]:"center",[lv.IS_ALIGN_END]:"end",[lv.IS_ALIGN_JUSTIFY]:"justify",[lv.IS_ALIGN_LEFT]:"left",[lv.IS_ALIGN_RIGHT]:"right",[lv.IS_ALIGN_START]:"start"},lN={normal:lv.IS_NORMAL,segmented:lv.IS_SEGMENTED,token:lv.IS_TOKEN},lj={[lv.IS_NORMAL]:"normal",[lv.IS_SEGMENTED]:"segmented",[lv.IS_TOKEN]:"token"},lI={paragraph:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children});return(null==n?void 0:n.length)?(0,v.jsx)("p",{children:n}):(0,v.jsx)("p",{children:(0,v.jsx)("br",{})})},text:e=>{let{node:t}=e,l=t.text;return t.format&lv.IS_BOLD&&(l=(0,v.jsx)("strong",{children:l})),t.format&lv.IS_ITALIC&&(l=(0,v.jsx)("em",{children:l})),t.format&lv.IS_STRIKETHROUGH&&(l=(0,v.jsx)("span",{style:{textDecoration:"line-through"},children:l})),t.format&lv.IS_UNDERLINE&&(l=(0,v.jsx)("span",{style:{textDecoration:"underline"},children:l})),t.format&lv.IS_CODE&&(l=(0,v.jsx)("code",{children:l})),t.format&lv.IS_SUBSCRIPT&&(l=(0,v.jsx)("sub",{children:l})),t.format&lv.IS_SUPERSCRIPT&&(l=(0,v.jsx)("sup",{children:l})),l},...lg,quote:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children});return(0,v.jsx)("blockquote",{children:n})},table:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children});return(0,v.jsx)("div",{className:"lexical-table-container",children:(0,v.jsx)("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:(0,v.jsx)("tbody",{children:n})})})},tablecell:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children}
1),r=t.headerState>0?"th":"td",o="lexical-table-cell-header-".concat(t.headerState),i={backgroundColor:t.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},a=t.colSpan&&t.colSpan>1?t.colSpan:void 0,s=t.rowSpan&&t.rowSpan>1?t.rowSpan:void 0;return(0,v.jsx)(r,{className:"lexical-table-cell ".concat(o),colSpan:a,rowSpan:s,style:i,children:n})},tablerow:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children});return(0,v.jsx)("tr",{className:"lexical-table-row",children:n})},heading:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children}),r=t.tag;return(0,v.jsx)(r,{children:n})},...lm,list:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children}),r=t.tag;return(0,v.jsx)(r,{className:"list-".concat(null==t?void 0:t.listType),children:n})},listitem:e=>{let{node:t,nodesToJSX:l,parent:n}=e,r=t.children.some(e=>"list"===e.type),o=l({nodes:t.children});if(!("listType"in n)||(null==n?void 0:n.listType)!=="check")return(0,v.jsx)("li",{className:"".concat(r?"nestedListItem":""),style:r?{listStyleType:"none"}:void 0,value:null==t?void 0:t.value,children:o});{let e=(0,j.A)();return(0,v.jsx)("li",{"aria-checked":t.checked?"true":"false",className:"list-item-checkbox".concat(t.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked").concat(r?" nestedListItem":""),role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:null==t?void 0:t.value,children:r?o:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("input",{checked:t.checked,id:e,readOnly:!0,type:"checkbox"}),(0,v.jsx)("label",{htmlFor:e,children:o}),(0,v.jsx)("br",{})]})})}},...(e=>{let{internalDocToHref:t}=e;return{autolink:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children}),r=t.fields.newTab?"noopener noreferrer":void 0,o=t.fields.newTab?"_blank":void 0;return(0,v.jsx)("a",{href:t.fields.url,rel:r,target:o,children:n})},link:e=>{var l;let{node:n,nodesToJSX:r}=e,o=r({nodes:n.children}),i=n.fields.newTab?"noopener noreferrer":void 0,a=n.fields.newTab?"_blank":void 0,s=null!=(l=n.fields.url)?l:"";return"internal"===n.fields.linkType&&(t?s=t({linkNode:n}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),s="#")),(0,v.jsx)("a",{href:s,rel:i,target:a,children:o})}}})({}),upload:e=>{var t;let{node:l}=e;if("object"!=typeof l.value)return null;let n=l.value,r=(null==(t=l.fields)?void 0:t.alt)||(null==n?void 0:n.alt)||"",o=n.url;if(!n.mimeType.startsWith("image"))return(0,v.jsx)("a",{href:o,rel:"noopener noreferrer",children:n.filename});if(!n.sizes||!Object.keys(n.sizes).length)return(0,v.jsx)("img",{alt:r,height:n.height,src:o,width:n.width});let i=[];for(let e in n.sizes){let t=n.sizes[e];if(!t||!t.width||!t.height||!t.mimeType||!t.filesize||!t.filename||!t.url)continue;let l=null==t?void 0:t.url;i.push((0,v.jsx)("source",{media:"(max-width: ".concat(t.width,"px)"),srcSet:l,type:t.mimeType},e))}return i.push((0,v.jsx)("img",{alt:r,height:null==n?void 0:n.height,src:o,width:null==n?void 0:n.width},"image")),(0,v.jsx)("picture",{children:i})},tab:" "},lM=e=>{let{className:t,converters:l,data:n,disableContainer:r,disableIndent:o,disableTextAlign:i}=e;if(!n)return null;let a={};a=l?"function"==typeof l?l({defaultConverters:lI}):l:lI;let s=n&&!Array.isArray(n)&&"object"==typeof n&&"root"in n&&function(e){var t;let{converters:l,data:n,disableIndent:r,disableTextAlign:o}=e;return!function(e){var t,l,n,r,o,i,a,s,d,u;let c=!!(null==e||null==(l=e.root)||null==(t=l.children)?void 0:t.length),p=!1;if((null==e||null==(r=e.root)||null==(n=r.children)?void 0:n.length)===1&&(null==e||null==(i=e.root)||null==(o=i.children[0])?void 0:o.type)==="paragraph"){let t=null==e||null==(a=e.root)?void 0:a.children[0];if((null==t?void 0:t.children)&&(null==t||null==(s=t.children)?void 0:s.length)!==0){if((null==t||null==(d=t.children)?void 0:d.length)===1){let e=null==t?void 0:t.children[0];(null==e?void 0:e.type)==="text"&&((null==e||null==(u=e.text)?void 0:u.length)||(p=!0))}}else p=!0}return!(!c||p)}(n)?(0,v.jsx)(v.Fragment,{}):function e(t){let{converters:l,disableIndent:n,disableTextAlign:r,nodes:o,parent:i}=t,a=l.unknown;return o.map((t,o)=>{var s,d,u,c,p,h,f,m;let x;"block"===t.type?(x=null==l||null==(d=l.blocks)?void 0:d[null==t||null==(s=t.fields)?void 0:s.blockType])||a||console.error("Lexical => JSX converter: Blocks converter: found ".concat(null==t||null==(u=t.fields)?void 0:u.blockType," block, but no converter is provided")):"inlineBlock"===t.type?(x=null==l||null==(p=l.inlineBlocks)?void 0:p[null==t||null==(c=t.fields)?void 0:c.blockType])||a||console.error("Lexical => JSX converter: Inline Blocks converter: found ".concat(null==t||null==(h=t.fields)?void 0:h.blockType," inline block, but no converter is provided")):x=l[t.type];try{let s;!x&&a&&(x=a),s=x?"function"==typeof x?x({childIndex:o,converters:l,node:t,nodesToJSX:o=>{var a,s,d,u;return e({converters:null!=(a=o.converters)?a:l,disableIndent:null!=(s=o.disableIndent)?s:n,disableTextAlign:null!=(d=o.disableTextAlign)?d:r,nodes:o.nodes,parent:null!=(u=o.parent)?u:{...t,parent:i}})},parent:i}):x:(0,v.jsx)("span",{children:"unknown node"},o);let d={};if(!r&&(!Array.isArray(r)||!(null==r?void 0:r.includes(t.type)))&&"format"in t&&t.format)switch(t.format){case"center":d.textAlign="center";break;case"end":case"right":d.textAlign="right";break;case"justify":d.textAlign="justify";break;case"left":break;case"start":d.textAlign="left"}
1if(!n&&(!Array.isArray(n)||!(null==n?void 0:n.includes(t.type)))&&"indent"in t&&t.indent&&"listitem"!==t.type&&(d.paddingInlineStart="".concat(40*Number(t.indent),"px")),g.isValidElement(s)){if(d.textAlign||d.paddingInlineStart){let e={...d,...null!=(m=null==s||null==(f=s.props)?void 0:f.style)?m:{}};return g.cloneElement(s,{key:o,style:e})}return g.cloneElement(s,{key:o})}return s}catch(e){return console.error("Error converting lexical node to JSX:",e,"node:",t),null}}).filter(Boolean)}({converters:l,disableIndent:r,disableTextAlign:o,nodes:null==n||null==(t=n.root)?void 0:t.children,parent:null==n?void 0:n.root})}({converters:a,data:n,disableIndent:o,disableTextAlign:i});return r?(0,v.jsx)(v.Fragment,{children:s}):(0,v.jsx)("div",{className:null!=t?t:"payload-richtext",children:s})},lF=Z({plugins:[{Component:function(){let e,t=(0,c.c)(7),[l]=(0,p.DF)(),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,v.jsx)("div",{className:"debug-jsx-converter",children:(0,v.jsx)(lM,{converters:lI,data:r})}),t[5]=r,t[6]=e):e=t[6],e},position:"bottom"}]}),lA={blue:{50:"oklch(0.97 0.014 254.604)",100:"oklch(0.932 0.032 255.585)",200:"oklch(0.882 0.059 254.128)",300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)",800:"oklch(0.424 0.199 265.638)",900:"oklch(0.379 0.146 265.522)",950:"oklch(0.282 0.091 267.935)"},green:{50:"oklch(0.982 0.018 155.826)",100:"oklch(0.962 0.044 156.743)",200:"oklch(0.925 0.084 155.995)",300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)",800:"oklch(0.448 0.119 151.328)",900:"oklch(0.393 0.095 152.535)",950:"oklch(0.266 0.065 152.934)"},orange:{50:"oklch(0.98 0.016 73.684)",100:"oklch(0.954 0.038 75.164)",200:"oklch(0.901 0.076 70.697)",300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)",800:"oklch(0.47 0.157 37.304)",900:"oklch(0.408 0.123 38.172)",950:"oklch(0.266 0.079 36.259)"},pink:{50:"oklch(0.971 0.014 343.198)",100:"oklch(0.948 0.028 342.258)",200:"oklch(0.899 0.061 343.231)",300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)",800:"oklch(0.459 0.187 3.815)",900:"oklch(0.408 0.153 2.432)",950:"oklch(0.284 0.109 3.907)"},purple:{50:"oklch(0.977 0.014 308.299)",100:"oklch(0.946 0.033 307.174)",200:"oklch(0.902 0.063 306.703)",300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)",800:"oklch(0.438 0.218 303.724)",900:"oklch(0.381 0.176 304.987)",950:"oklch(0.291 0.149 302.717)"},red:{50:"oklch(0.971 0.013 17.38)",100:"oklch(0.936 0.032 17.717)",200:"oklch(0.885 0.062 18.334)",300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)",800:"oklch(0.444 0.177 26.899)",900:"oklch(0.396 0.141 25.723)",950:"oklch(0.258 0.092 26.042)"},yellow:{50:"oklch(0.987 0.026 102.212)",100:"oklch(0.973 0.071 103.193)",200:"oklch(0.945 0.129 101.54)",300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",800:"oklch(0.476 0.114 61.907)",900:"oklch(0.421 0.095 57.708)",950:"oklch(0.286 0.066 53.813)"}},lR={text:{"text-red":{css:{color:"light-dark(".concat(lA.red[600],", ").concat(lA.red[400],")")},label:"Red"},"text-orange":{css:{color:"light-dark(".concat(lA.orange[600],", ").concat(lA.orange[400],")")},label:"Orange"},"text-yellow":{css:{color:"light-dark(".concat(lA.yellow[700],", ").concat(lA.yellow[300],")")},label:"Yellow"},"text-green":{css:{color:"light-dark(".concat(lA.green[700],", ").concat(lA.green[400],")")},label:"Green"},"text-blue":{css:{color:"light-dark(".concat(lA.blue[600],", ").concat(lA.blue[400],")")},label:"Blue"},"text-purple":{css:{color:"light-dark(".concat(lA.purple[600],", ").concat(lA.purple[400],")")},label:"Purple"},"text-pink":{css:{color:"light-dark(".concat(lA.pink[600],", ").concat(lA.pink[400],")")},label:"Pink"}},background:{"bg-red":{css:{"background-color":"light-dark(".concat(lA.red[400],", ").concat(lA.red[600],")")},label:"Red"},"bg-orange":{css:{"background-color":"light-dark(".concat(lA.orange[400],", ").concat(lA.orange[600],")")},label:"Orange"},"bg-yellow":{css:{"background-color":"light-dark(".concat(lA.yellow[300],", ").concat(lA.yellow[700],")")},label:"Yellow"},"bg-green":{css:{"background-color":"light-dark(".concat(lA.green[400],", ").concat(lA.green[700],")")},label:"Green"},"bg-blue":{css:{"background-color":"light-dark(".concat(lA.blue[400],", ").concat(lA.blue[600],")")},label:"Blue"},"bg-purple":{css:{"background-color":"light-dark(".concat(lA.purple[400],", ").concat(lA.purple[600],")")},label:"Purple"},"bg-pink":{css:{"background-color":"light-dark(".concat(lA.pink[400],", ").concat(lA.pink[600],")")},label:"Pink"}}},lP=()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("g",{clipPath:"url(#clip0_4397_10817)",children:(0,v.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,v.jsx)("defs",{children:(0,v.jsx)("clipPath",{id:"clip0_4397_10817",children:(0,v.jsx)("rect",{fill:"currentColor",height:"12",transform:"translate(4 4)",width:"12"})})})]});function lD(e){let t=e.getAttribute("data-lexical-relationship-id"),l=e.getAttribute("data-lexical-relationship-relationTo");return null!=t&&null!=l?{node:lB({relationTo:l,value:t})}:null}var lH=class extends h.d{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:lD,priority:2}:null}}static importJSON(e){var t;1===e.version&&(null==e||null==(t=e.value)?void 0:t.id)&&(e.value=e.value.id);let l=lB({relationTo:e.relationTo,value:e.value});return l.setFormat(e.format),l}static isInline(){return!1}createDOM(e){var t;let l=document.createElement("div");return(0,f.ZB)(l,null==e||null==(t=e.theme)?void 0:t.relationship),l}decorate(e,t){return null}exportDOM(){var e,t,l,n,r;let o=document.createElement("div");o.setAttribute("data-lexical-relationship-id",String("object"==typeof(null==(e=this.__data)?void 0:e.value)?null==(l=this.__data)||null==(t=l.value)?void 0:t.id:null==(n=this.__data)?void 0:n.value)),o.setAttribute("data-lexical-relationship-relationTo",null==(r=this.__data)?void 0:r.relationTo);let i=document.createTextNode(this.getTextContent());return o.append(i),{element:o}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship",version:2}}getData(){return this.getLatest().__data}getTextContent(){var e,t,l,n,r;return"".concat(null==(e=this.__data)?void 0:e.relationTo," relation to ").concat("object"==typeof(null==(t=this.__data)?void 0:t.value)?null==(n=this.__data)||null==(l=n.value)?void 0:l.id:null==(r=this.__data)?void 0:r.value)}setData(e){this.getWritable().__data=e}constructor({data:e,format:t,key:l}){super(t,l),this.__data=e}};function lB(e){return(0,m.pTq)(new lH({data:e}))}var lO=g.lazy(()=>l.e(7695).then(l.bind(l,97695)).then(e=>({default:e.RelationshipComponent})));function lJ(e){let t=e.getAttribute("data-lexical-relationship-id"),l=e.getAttribute("data-lexical-relationship-relationTo");return null!=t&&null!=l?{node:lV({relationTo:l,value:t})}:null}var lz=class extends lH{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:lJ,priority:2}:null}}static importJSON(e){var t;1===e.version&&(null==e||null==(t=e.value)?void 0:t.id)&&(e.value=e.value.id);let l=lV({relationTo:e.relationTo,value:e.value});return l.setFormat(e.format),l}decorate(e,t){var l;return(0,v.jsx)(lO,{className:null!=(l=t.theme.relationship)?l:"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function lV(e){return(0,m.pTq)(new lz({data:e}))}function lW(e){return e instanceof lz}var lU=e=>{let t,l,n,r=(0,c.c)(23),[o]=(0,p.DF)(),[i,a]=(0,g.useState)(null),[s,d]=(0,g.useState)(!1),[u,h,f]=(0,S.useListDrawer)(e),{closeDrawer:x,drawerSlug:b,isDrawerOpen:C,openDrawer:k}=f,{modalState:y}=(0,S.useModal)(),w;r[0]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{var e;a(null!=(e=(0,m.vJq)())?e:(0,m.S1w)())},r[0]=w):w=r[0];let E=w,_;r[1]!==o||r[2]!==i?(_=()=>{i&&o.update(()=>{if((0,m.I2P)(i)){let{anchor:e,focus:t}=i;(0,m.nsf)(e.key)&&(0,m.nsf)(t.key)&&(0,m.n1P)(i.clone())}else(0,m.NiT)().selectEnd()},{discrete:!0,skipTransforms:!0})},r[1]=o,r[2]=i,r[3]=_):_=r[3];let T=_,L;r[4]!==x?(L=()=>{x()},r[4]=x,r[5]=L):L=r[5];let N=L,j,I;return r[6]!==b||r[7]!==y||r[8]!==T||r[9]!==s?(j=()=>
1{if(!s)return;let e=y[b];!e||(null==e?void 0:e.isOpen)||(d(!1),setTimeout(()=>{T()},1))},I=[y,b,T,s],r[6]=b,r[7]=y,r[8]=T,r[9]=s,r[10]=j,r[11]=I):(j=r[10],I=r[11]),(0,g.useEffect)(j,I),r[12]!==h?(t=e=>(0,v.jsx)(h,{...e,onClick:()=>{E()}}),r[12]=h,r[13]=t):t=r[13],r[14]!==k?(l=()=>{E(),k(),d(!0)},r[14]=k,r[15]=l):l=r[15],r[16]!==u||r[17]!==N||r[18]!==C||r[19]!==b||r[20]!==t||r[21]!==l?(n={closeListDrawer:N,isListDrawerOpen:C,ListDrawer:u,listDrawerSlug:b,ListDrawerToggler:t,openListDrawer:l},r[16]=u,r[17]=N,r[18]=C,r[19]=b,r[20]=t,r[21]=l,r[22]=n):n=r[22],n},lZ=e=>{let t,l=(0,c.c)(14),{enabledCollectionSlugs:n}=e,[r]=(0,p.DF)(),[i,a]=(0,g.useState)(null),s=null==n?void 0:n[0],d;l[0]!==n||l[1]!==s?(d={collectionSlugs:n,selectedCollection:s},l[0]=n,l[1]=s,l[2]=d):d=l[2];let{closeListDrawer:u,ListDrawer:h,openListDrawer:f}=lU(d),x,b;l[3]!==r||l[4]!==f?(x=()=>r.registerCommand(o.a,e=>(a((null==e?void 0:e.replace)?null==e?void 0:e.replace.nodeKey:null),f(),!0),m.jZM),b=[r,f],l[3]=r,l[4]=f,l[5]=x,l[6]=b):(x=l[5],b=l[6]),(0,g.useEffect)(x,b),l[7]!==u||l[8]!==r||l[9]!==i?(t=e=>{let{collectionSlug:t,doc:l}=e;(e=>{let{editor:t,relationTo:l,replaceNodeKey:n,value:r}=e;n?t.update(()=>{let e=(0,m.nsf)(n);e&&e.replace(lV({relationTo:l,value:r}))}):t.dispatchCommand(lX,{relationTo:l,value:r})})({editor:r,relationTo:t,replaceNodeKey:i,value:l.id}),u()},l[7]=u,l[8]=r,l[9]=i,l[10]=t):t=l[10];let C=t,k;return l[11]!==h||l[12]!==C?(k=(0,v.jsx)(h,{onSelect:C}),l[11]=h,l[12]=C,l[13]=k):k=l[13],k},lK=()=>{let e=(0,c.c)(3),[t]=(0,p.DF)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(o.a,lq,m.jZM),n=[t],e[0]=t,e[1]=l,e[2]=n):(l=e[1],n=e[2]),(0,g.useEffect)(l,n),null},lG=e=>{let{enabledCollectionSlugs:t}=e;return(null==t?void 0:t.length)?(0,v.jsx)(lZ,{enabledCollectionSlugs:t}):(0,v.jsx)(lK,{})};function lq(){return S.toast.error("No relationship collections enabled"),!0}var lY=e=>{let{collectionSlugsBlacklist:t,collectionSlugsWhitelist:l,uploads:n=!1}=e||{},{config:{collections:r}}=(0,E.c)(),{visibleEntities:o}=(0,S.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:d}=t;if(null==o?void 0:o.collections.includes(l)){if(n){if(!r||!d)continue}else if(d||!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])},lX=(0,m.guI)("INSERT_RELATIONSHIP_COMMAND");function l$(e){let t=(0,m.vJq)()||(0,m.S1w)();if((0,m.I2P)(t)){let l=lV(e),{focus:n}=t,r=n.getNode();(0,f.Pe)(l),(0,m.bSg)(r)&&!r.__first&&r.remove()}return!0}var lQ=Z({nodes:[lz],plugins:[{Component:e=>{let t,l=(0,c.c)(8),{clientProps:n}=e,[r]=(0,p.DF)(),o=null==n?void 0:n.disabledCollections,i=null==n?void 0: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}=lY(a),d,u;return l[3]!==r?(d=()=>{if(!r.hasNodes([lz]))throw Error("RelationshipPlugin: RelationshipNode not registered on editor");return r.registerCommand(lX,l$,m.jZM)},u=[r],l[3]=r,l[4]=d,l[5]=u):(d=l[4],u=l[5]),(0,g.useEffect)(d,u),l[6]!==s?(t=(0,v.jsx)(lG,{enabledCollectionSlugs:s}),l[6]=s,l[7]=t):t=l[7],t},position:"normal"}],slashMenu:{groups:[W([{Icon:lP,key:"relationship",keywords:["relationship","relation","rel"],label:e=>{let{i18n:t}=e;return t.t("lexical:relationship:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(o.a,{replace:!1})}}])]},toolbarFixed:{groups:[te([{ChildComponent:lP,isActive:e=>{let{selection:t}=e;return!!(0,m.RTZ)(t)&&!!t.getNodes().length&&lW(t.getNodes()[0])},key:"relationship",label:e=>{let{i18n:t}=e;return t.t("lexical:relationship:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(o.a,{replace:!1})}}])]}}),l0="toolbar-popup__button",l1=e=>{let t,l=(0,c.c)(23),{children:n,editor:r,item:o}=e,i;l[0]===Symbol.for("react.memo_cache_sentinel")?(i={active:!1,enabled:!0},l[0]=i):i=l[0];let[a,s]=(0,g.useState)(i),p=(0,g.useDeferredValue)(a),h=(0,u.b)(),x=p.enabled?"":"disabled",b=p.active?"active":"",C=o.key?"".concat(l0,"-").concat(o.key):"",k;
1l[1]!==x||l[2]!==b||l[3]!==C?(k=[l0,x,b,C].filter(Boolean),l[1]=x,l[2]=b,l[3]=C,l[4]=k):k=l[4];let y=k.join(" "),w;l[5]!==r||l[6]!==h||l[7]!==o?(w=()=>{r.getEditorState().read(()=>{let e=(0,m.vJq)();if(!e)return;let t=!!o.isActive&&o.isActive({editor:r,editorConfigContext:h,selection:e}),l=!o.isEnabled||o.isEnabled({editor:r,editorConfigContext:h,selection:e});s(e=>e.active===t&&e.enabled===l?e:{active:t,enabled:l})})},l[5]=r,l[6]=h,l[7]=o,l[8]=w):w=l[8];let S=w,E=(0,d.e)(),_,T;l[9]!==r||l[10]!==E||l[11]!==S?(_=()=>{E(S);let e=()=>E(S),t=(0,f.Sd)(r.registerUpdateListener(e));return document.addEventListener("mouseup",e),()=>{t(),document.removeEventListener("mouseup",e)}},T=[r,E,S],l[9]=r,l[10]=E,l[11]=S,l[12]=_,l[13]=T):(_=l[12],T=l[13]),(0,g.useEffect)(_,T),l[14]!==a||l[15]!==r||l[16]!==o?(t=()=>{a.enabled&&r.focus(()=>{var e;r.update(l2),null==(e=o.onSelect)||e.call(o,{editor:r,isActive:a.active})})},l[14]=a,l[15]=r,l[16]=o,l[17]=t):t=l[17];let L=t,N;return l[18]!==n||l[19]!==y||l[20]!==L||l[21]!==o.key?(N=(0,v.jsx)("button",{className:y,"data-button-key":o.key,onClick:L,onMouseDown:l6,type:"button",children:n}),l[18]=n,l[19]=y,l[20]=L,l[21]=o.key,l[22]=N):N=l[22],N};function l2(){(0,m.JAT)("toolbar")}function l6(e){e.preventDefault()}var l5="toolbar-popup__dropdown-item",l3=g.createContext(null);function l4(e){let{active:t,children:l,editor:n,enabled:r,Icon:o,item:i,itemKey:a,tooltip:s}=e,d=(0,g.useMemo)(()=>[l5,!1===r?"disabled":"",t?"active":"",(null==i?void 0:i.key)?"".concat(l5,"-").concat(i.key):""].filter(Boolean).join(" "),[r,t,i.key]),u=(0,g.useRef)(null),c=g.use(l3);if(null===c)throw Error("DropDownItem must be used within a DropDown");let{registerItem:p}=c;return(0,g.useEffect)(()=>{(null==u?void 0:u.current)!=null&&p(u)},[u,p]),(0,v.jsx)(S.Button,{"aria-label":s,buttonStyle:"none",className:d,disabled:!1===r,extraButtonProps:{"data-item-key":a},icon:o,iconPosition:"left",iconStyle:"none",onClick:()=>{!1!==r&&n.focus(()=>{var e;n.update(()=>{(0,m.JAT)("toolbar")}),null==(e=i.onSelect)||e.call(i,{editor:n,isActive:t})})},onMouseDown:e=>{e.preventDefault()},ref:u,tooltip:s,type:"button",children:l})}function l7(e){let{children:t,dropDownRef:l,itemsContainerClassNames:n,onClose:r}=e,[o,i]=(0,g.useState)(),[a,s]=(0,g.useState)(),d=(0,g.useCallback)(e=>{i(t=>null!=t?[...t,e]:[e])},[i]),u=(0,g.useMemo)(()=>({registerItem:d}),[d]);return(0,g.useEffect)(()=>{null!=o&&null==a&&s(o[0]),null!=a&&(null==a?void 0:a.current)!=null&&a.current.focus()},[o,a]),(0,v.jsx)(l3,{value:u,children:(0,v.jsx)("div",{className:(null!=n?n:["toolbar-popup__dropdown-items"]).join(" "),onKeyDown:e=>{if(null==o)return;let{key:t}=e;["ArrowDown","ArrowUp","Escape","Tab"].includes(t)&&e.preventDefault(),"Escape"===t||"Tab"===t?r():"ArrowUp"===t?s(e=>{if(null==e)return o[0];let t=o.indexOf(e)-1;return o[-1===t?o.length-1:t]}):"ArrowDown"===t&&s(e=>null==e?o[0]:o[o.indexOf(e)+1])},ref:l,children:t})})}function l8(e){let{buttonAriaLabel:t,buttonClassName:l,children:n,disabled:r=!1,dropdownKey:o,Icon:i,itemsContainerClassNames:a,label:s,stopCloseOnClickSelf:d}=e,u=(0,g.useRef)(null),c=(0,g.useRef)(null),[p,h]=(0,g.useState)(!1);(0,g.useEffect)(()=>{let e=c.current,t=u.current;if(p&&null!==e&&null!==t){let{left:l,top:n}=e.getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop;t.style.top="".concat(n+r+e.offsetHeight+5,"px"),t.style.left="".concat(Math.min(l-5,window.innerWidth-t.offsetWidth-20),"px")}},[u,c,p]),(0,g.useEffect)(()=>{let e=c.current;if(null!==e&&p){let t=t=>{let l=t.target;(0,m.vAA)(l)&&(d&&u.current&&u.current.contains(l)||e.contains(l)||h(!1))};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}}},[u,c,p,d]);let f=(0,P.createPortal)((0,v.jsx)(l7,{dropDownRef:u,itemsContainerClassNames:a,onClose:()=>{h(!1),(null==c?void 0:c.current)!=null&&c.current.focus()},children:n}),document.body);return(0,v.jsxs)(g.Fragment,{children:[(0,v.jsxs)("button",{"aria-label":t,className:l+(p?" active":""),"data-dropdown-key":o,disabled:r,onClick:e=>{e.preventDefault(),h(!p)},onMouseDown:e=>{e.preventDefault()},ref:c,type:"button",children:[i&&(0,v.jsx)(i,{}),s&&(0,v.jsx)("span",{className:"toolbar-popup__dropdown-label",children:s}),(0,v.jsx)("i",{className:"toolbar-popup__dropdown-caret"})]}),p&&(0,v.jsx)(g.Fragment,{children:f})]})}var l9="toolbar-popup__dropdown",ne=g.memo(e=>
1{let t,l=(0,c.c)(14),{active:n,anchorElem:r,editor:o,enabled:i,item:a}=e,{i18n:s}=(0,_.d)(),{fieldProps:d}=(0,u.b)(),{featureClientSchemaMap:p,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=(null==a?void 0:a.Component)&&(0,v.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]!==p||l[10]!==s||l[11]!==a||l[12]!==h){let e=a.key,r;a.label&&(e="function"==typeof a.label?a.label({featureClientSchemaMap:p,i18n:s,schemaPath:h}):a.label),r=e.length>25?e.substring(0,25)+"...":e,t=(0,v.jsx)(l4,{active:n,editor:o,enabled:i,Icon:(null==a?void 0:a.ChildComponent)?(0,v.jsx)(a.ChildComponent,{}):void 0,item:a,itemKey:a.key,tooltip:e,children:(0,v.jsx)("span",{className:"text",children:r})},a.key),l[6]=n,l[7]=o,l[8]=i,l[9]=p,l[10]=s,l[11]=a,l[12]=h,l[13]=t}else t=l[13];return t}),nt=e=>{let{anchorElem:t,classNames:l,editor:n,group:r,Icon:o,itemsContainerClassNames:i,label:a,maxActiveItems:s,onActiveChange:c}=e,[p,h]=g.useState({activeItemKeys:[],enabledGroup:!0,enabledItemKeys:[]}),x=(0,g.useDeferredValue)(p),b=(0,u.b)(),{items:C,key:k}=r,y=(0,d.e)(),w=(0,g.useCallback)(()=>{n.getEditorState().read(()=>{let e=(0,m.vJq)();if(!e)return;let t=[],l=[],o=[];for(let r of C)r.isActive&&(!s||t.length<s)&&r.isActive({editor:n,editorConfigContext:b,selection:e})&&(t.push(r.key),l.push(r)),r.isEnabled?r.isEnabled({editor:n,editorConfigContext:b,selection:e})&&o.push(r.key):o.push(r.key);h({activeItemKeys:t,enabledGroup:!r.isEnabled||r.isEnabled({editor:n,editorConfigContext:b,selection:e}),enabledItemKeys:o}),c&&c({activeItems:l})})},[n,b,r,C,s,c]);(0,g.useEffect)(()=>(y(w),(0,f.Sd)(n.registerUpdateListener(async()=>{await y(w)}))),[n,y,w]);let S=(0,g.useMemo)(()=>(null==C?void 0:C.length)?C.map(e=>(0,v.jsx)(ne,{active:x.activeItemKeys.includes(e.key),anchorElem:t,editor:n,enabled:x.enabledItemKeys.includes(e.key),item:e},e.key)):null,[C,x,t,n]);return(0,v.jsx)(l8,{buttonAriaLabel:"".concat(k," dropdown"),buttonClassName:[l9,"".concat(l9,"-").concat(k),...l||[]].filter(Boolean).join(" "),disabled:!x.enabledGroup,dropdownKey:k,Icon:o,itemsContainerClassNames:["".concat(l9,"-items"),...i||[]],label:a,children:S},k)};function nl(e){let{anchorElem:t,editor:l,item:n}=e;return n.Component?(null==n?void 0:n.Component)&&(0,v.jsx)(n.Component,{anchorElem:t,editor:l,item:n},n.key):n.ChildComponent?(0,v.jsx)(l1,{editor:l,item:n,children:(0,v.jsx)(n.ChildComponent,{})},n.key):null}function nn(e){var t,l,n,r,o;let i,a,s=(0,c.c)(23),{anchorElem:d,editor:p,editorConfig:h,group:f,index:m}=e,{i18n:x}=(0,_.d)(),{fieldProps:b}=(0,u.b)(),{featureClientSchemaMap:C,schemaPath:k}=b,[y,w]=g.useState(void 0),[S,E]=g.useState(void 0),T;s[0]!==f.ChildComponent||s[1]!==f.items||s[2]!==f.type?(T=()=>{(null==f?void 0:f.type)==="dropdown"&&f.items.length&&f.ChildComponent?E(()=>f.ChildComponent):E(void 0)},s[0]=f.ChildComponent,s[1]=f.items,s[2]=f.type,s[3]=T):T=s[3],s[4]!==f?(i=[f],s[4]=f,s[5]=i):i=s[5],g.useEffect(T,i),s[6]!==C||s[7]!==f.ChildComponent||s[8]!==f.items||s[9]!==f.type||s[10]!==x||s[11]!==k?(a=e=>{let{activeItems:t}=e;if(!t.length)return void((null==f?void 0:f.type)==="dropdown"&&f.items.length&&f.ChildComponent?E(()=>f.ChildComponent):E(void 0),w(void 0));let l=t[0],n=l.key;l.label&&(n="function"==typeof l.label?l.label({featureClientSchemaMap:C,i18n:x,schemaPath:k}):l.label),n.length>25&&(n=n.substring(0,25)+"..."),1===t.length?(w(n),E(()=>l.ChildComponent)):(w(x.t("lexical:general:toolbarItemsActive",{count:t.length})),(null==f?void 0:f.type)==="dropdown"&&f.items.length&&f.ChildComponent?E(()=>f.ChildComponent):E(void 0))},s[6]=C,s[7]=f.ChildComponent,s[8]=f.items,s[9]=f.type,s[10]=x,s[11]=k,s[12]=a):a=s[12];let L=a,N="fixed-toolbar__group fixed-toolbar__group-".concat(f.key),j;return s[13]!==S||s[14]!==d||s[15]!==y||s[16]!==p||s[17]!==(null==(t=h.features.toolbarFixed)?void 0:t.groups.length)||s[18]!==f||s[19]!==m||s[20]!==L||s[21]!==N?(j=(0,v.jsxs)("div",{className:N,"data-toolbar-group-key":f.key,children:["dropdown"===f.type&&f.items.length?S?(0,v.jsx)(nt,{anchorElem:d,editor:p,group:f,Icon:S,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:y,maxActiveItems:null!=(r=f.maxActiveItems)?r:1,onActiveChange:L}):(0,v.jsx)(nt,{anchorElem:d,editor:p,group:f,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:y,maxActiveItems:null!=(o=f.maxActiveItems)?o:1,onActiveChange:L}):null,"buttons"===f.type&&f.items.length?f.items.map(e=>(0,v.jsx)(nl,{anchorElem:d,editor:p,item:e},e.key)):null,m<(null==(l=h.features.toolbarFixed)?void 0:l.groups.length)-1&&(0,v.jsx)("div",{className:"divider"})]},f.key),s[13]=S,s[14]=d,s[15]=y,s[16]=p,s[17]=null==(n=h.features.toolbarFixed)?void 0:n.groups.length,s[18]=f,s[19]=m,s[20]=L,s[21]=N,s[22]=j):j=s[22],j}function nr(e){var t,l;let{anchorElem:n,clientProps:r,editor:o,editorConfig:i,parentWithFixedToolbar:a}=e,s=g.useRef(null),d=(0,w.a)(),{y:u}=(0,S.useScrollInfo)(),c=(0,g.useMemo)(()=>
1{if(!a||(null==r?void 0:r.disableIfParentHasFixedToolbar))return null;let e=a.editorContainerRef.current.previousElementSibling;for(;e;){if(e.classList.contains("fixed-toolbar"))return e;e=e.previousElementSibling}return null},[null==r?void 0:r.disableIfParentHasFixedToolbar,a]);return(0,S.useThrottledEffect)(()=>{if(!c)return;let e=s.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,[s,c,u]),(0,v.jsx)("div",{className:"fixed-toolbar",onFocus:e=>{e.stopPropagation()},ref:s,children:d&&(0,v.jsx)(g.Fragment,{children:(null==i?void 0:i.features)&&(null==(l=i.features)||null==(t=l.toolbarFixed)?void 0:t.groups.map((e,t)=>(0,v.jsx)(nn,{anchorElem:n,editor:o,editorConfig:i,group:e,index:t},e.key)))})})}var no=e=>{var t,l;if(null==(t=e.parentEditor)?void 0:t.editorConfig){if(null==(l=e.parentEditor)?void 0:l.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return e.parentEditor;if(e.parentEditor)return no(e.parentEditor)}return!1},ni=Z({plugins:[{Component:e=>{var t,l,n,r,o;let i=(0,c.c)(6),{clientProps:a}=e,[s]=(0,p.DF)(),d=(0,u.b)();if(!(0,w.a)())return null;let{editorConfig:h}=d,f=a.applyToFocusedEditor&&(null==(t=d.focusedEditor)?void 0:t.editor)||s,m=a.applyToFocusedEditor&&(null==(l=d.focusedEditor)?void 0:l.editorConfig)||h,g,x;if(i[0]!==a.disableIfParentHasFixedToolbar||i[1]!==f||i[2]!==m||i[3]!==d){x=Symbol.for("react.early_return_sentinel");e:{let e=no(d);if((null==a?void 0:a.disableIfParentHasFixedToolbar)&&e||!(null==m||null==(o=m.features)||null==(r=o.toolbarFixed)||null==(n=r.groups)?void 0:n.length)){x=null;break e}g=(0,v.jsx)(nr,{anchorElem:document.body,editor:f,editorConfig:m,parentWithFixedToolbar:e})}i[0]=a.disableIfParentHasFixedToolbar,i[1]=f,i[2]=m,i[3]=d,i[4]=g,i[5]=x}else g=i[4],x=i[5];return x!==Symbol.for("react.early_return_sentinel")?x:g},position:"aboveContainer"}]});function na(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 ns(e){let{alwaysDisplayOnTop:t=!1,anchorElem:l,anchorFlippedOffset:n=0,floatingElem:r,horizontalOffset:o=32,horizontalPosition:i="left",specialHandlingForCaret:a=!1,targetRect:s,verticalGap:d=10}=e,u=l.parentElement;if(null===s||null==u){r.style.opacity="0",r.style.transform="translate(-10000px, -10000px)";return}let c=r.getBoundingClientRect(),p=l.getBoundingClientRect(),h=u.getBoundingClientRect(),f=s.top-c.height-d,m=s.left-o;"center"===i&&(m=s.left+s.width/2-c.width/2);let g=0;return t||!(f<h.top)||a||(f+=g=c.height+s.height+2*d),"center"===i?m+c.width>h.right?m=h.right-c.width-o:m<h.left&&(m=h.left+o):m+c.width>h.right&&(m=h.right-c.width-o),m-=p.left,r.style.opacity="1",a&&0!==n?(f-=p.bottom-n+c.height-3,r.style.transform="translate(".concat(m,"px, ").concat(f,"px) rotate(180deg)")):(f-=p.top,r.style.transform="translate(".concat(m,"px, ").concat(f,"px)")),g}function nd(e){let{anchorElem:t,editor:l,item:n}=e;return n.Component?(null==n?void 0:n.Component)&&(0,v.jsx)(n.Component,{anchorElem:t,editor:l,item:n},n.key):n.ChildComponent?(0,v.jsx)(l1,{editor:l,item:n,children:(0,v.jsx)(n.ChildComponent,{})},n.key):null}function nu(e){var t,l,n,r,o;let i,a,s=(0,c.c)(19),{anchorElem:d,editor:p,group:h,index:f}=e,{editorConfig:m}=(0,u.b)(),[x,b]=g.useState(),C;s[0]!==h.ChildComponent||s[1]!==h.items||s[2]!==h.type?(C=()=>{(null==h?void 0:h.type)==="dropdown"&&h.items.length&&h.ChildComponent?b(()=>h.ChildComponent):b(void 0)},s[0]=h.ChildComponent,s[1]=h.items,s[2]=h.type,s[3]=C):C=s[3],s[4]!==h?(i=[h],s[4]=h,s[5]=i):i=s[5],g.useEffect(C,i),s[6]!==h.ChildComponent||s[7]!==h.items||s[8]!==h.type?(a=e=>{let{activeItems:t}=e;if(!t.length)return void((null==h?void 0:h.type)==="dropdown"&&h.items.length&&h.ChildComponent?b(()=>h.ChildComponent):b(void 0));let l=t[0];b(()=>null==l?void 0:l.ChildComponent)},s[6]=h.ChildComponent,s[7]=h.items,s[8]=h.type,s[9]=a):a=s[9];let k=a,y="inline-toolbar-popup__group inline-toolbar-popup__group-".concat(h.key),w;return s[10]!==x||s[11]!==d||s[12]!==p||s[13]!==(null==(t=m.features.toolbarInline)?void 0:t.groups.length)||s[14]!==h||s[15]!==f||s[16]!==k||s[17]!==y?(w=(0,v.jsxs)("div",{className:y,"data-toolbar-group-key":h.key,children:["dropdown"===h.type&&h.items.length?x?(0,v.jsx)(nt,{anchorElem:d,editor:p,group:h,Icon:x,maxActiveItems:null!=(r=h.maxActiveItems)?r:1,onActiveChange:k}):(0,v.jsx)(nt,{anchorElem:d,editor:p,group:h,maxActiveItems:null!=(o=h.maxActiveItems)?o:1,onActiveChange:k}):null,"buttons"===h.type&&h.items.length?h.items.map(e=>(0,v.jsx)(nd,{anchorElem:d,editor:p,item:e},e.key)):null,f<(null==(l=m.features.toolbarInline)?void 0:l.groups.length)-1&&(0,v.jsx)("div",{className:"divider"})]},h.key),s[10]=x,s[11]=d,s[12]=p,s[13]=null==(n=m.features.toolbarInline)?void 0:n.groups.length,s[14]=h,s[15]=f,s[16]=k,s[17]=y,s[18]=w):w=s[18],w}function nc(e){var t,l;let{anchorElem:n,editor:r}=e,o=(0,g.useRef)(null),i=(0,g.useRef)(null),{editorConfig:a}=(0,u.b)(),s=(0,g.useCallback)(()=>
1{if(null==o?void 0:o.current){let e="0"===o.current.style.opacity,t="none"===o.current.style.pointerEvents;e||(o.current.style.opacity="0"),t||(o.current.style.pointerEvents="none")}},[o]),d=(0,g.useCallback)(e=>{if((null==o?void 0:o.current)&&(1===e.buttons||3===e.buttons)){let t="0"===o.current.style.opacity,l="none"===o.current.style.pointerEvents;if(!t||!l){let t=e.clientX,l=e.clientY,n=document.elementFromPoint(t,l);o.current.contains(n)||s()}}},[s]),c=(0,g.useCallback)(()=>{(null==o?void 0:o.current)&&("1"!==o.current.style.opacity&&(o.current.style.opacity="1"),"auto"!==o.current.style.pointerEvents&&(o.current.style.pointerEvents="auto"))},[]);(0,g.useEffect)(()=>(document.addEventListener("mousemove",d),document.addEventListener("mouseup",c),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c)}),[o,d,c]);let p=(0,g.useCallback)(()=>{var e;let t=(0,m.vJq)(),l=(0,m.peL)(r._window);if(null===o.current)return;let a=n.querySelector(":scope > .link-editor"),d=null!==a&&"style"in a&&(null==a||null==(e=a.style)?void 0:e.opacity)==="1",u=r.getRootElement();if(null!==t&&null!==l&&!l.isCollapsed&&null!==u&&u.contains(l.anchorNode)){let e=na(l,u),t=ns({alwaysDisplayOnTop:d,anchorElem:n,floatingElem:o.current,horizontalPosition:"center",targetRect:e});i.current&&ns({anchorElem:o.current,anchorFlippedOffset:t,floatingElem:i.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:e,verticalGap:8})}else s()},[r,s,n]);return(0,g.useEffect)(()=>{let e=n.parentElement,t=()=>{r.getEditorState().read(()=>{p()})};return window.addEventListener("resize",t),e&&e.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),e&&e.removeEventListener("scroll",t)}},[r,p,n]),(0,g.useEffect)(()=>(r.getEditorState().read(()=>{p()}),(0,f.Sd)(r.registerUpdateListener(e=>{let{editorState:t}=e;t.read(()=>{p()})}),r.registerCommand(m.MvL,()=>(p(),!1),m.AcJ))),[r,p]),(0,v.jsxs)("div",{className:"inline-toolbar-popup",ref:o,children:[(0,v.jsx)("div",{className:"caret",ref:i}),(null==a?void 0:a.features)&&(null==(l=a.features)||null==(t=l.toolbarInline)?void 0:t.groups.map((e,t)=>(0,v.jsx)(nu,{anchorElem:n,editor:r,group:e,index:t},e.key)))]})}var np=Z({plugins:[{Component:e=>{let{anchorElem:t}=e,[l]=(0,p.DF)();return function(e,t){let l,n,r,o=(0,c.c)(12),[i,a]=(0,g.useState)(!1),s=(0,w.a)(),d;o[0]!==e?(d=()=>{e.getEditorState().read(()=>{if(e.isComposing())return;let t=(0,m.vJq)(),l=(0,m.peL)(e._window),n=e.getRootElement();if(null!==l&&(!(0,m.I2P)(t)||null===n||!n.contains(l.anchorNode)))return void a(!1);if(!(0,m.I2P)(t))return;if(""!==t.getTextContent()){let e=t.getNodes(),l=!1;for(let t of e)if((0,m.kFe)(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]=d):d=o[1];let u=d,p,h;return(o[2]!==u?(p=()=>(document.addEventListener("selectionchange",u),document.addEventListener("mouseup",u),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("mouseup",u)}),h=[u],o[2]=u,o[3]=p,o[4]=h):(p=o[3],h=o[4]),(0,g.useEffect)(p,h),o[5]!==e||o[6]!==u?(l=()=>(0,f.Sd)(e.registerUpdateListener(()=>{u()}),e.registerRootListener(()=>{null===e.getRootElement()&&a(!1)})),n=[e,u],o[5]=e,o[6]=u,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,P.createPortal)((0,v.jsx)(nc,{anchorElem:t,editor:e}),t),o[9]=t,o[10]=e,o[11]=r):r=o[11],r):null}(l,t)},position:"floatingAnchorElem"}]}),nh=()=>(0,v.jsx)("svg",{className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,v.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"})}),nf=/^\|(.+)\|\s?$/,nm=/^(\| ?:?-*:? ?)+\|\s?$/,ng=(e,t)=>
1{e=e.replace(/\\n/g,"\n");let l=(0,F.np)(F.o5.NO_STATUS);return(0,d.b)(e,t,l),l},nv=(e,t)=>{let l=e.match(nf);return l&&l[1]?l[1].split("|").map(e=>ng(e,t)):null},nx=()=>(0,v.jsxs)("svg",{fill:"none",height:"18",viewBox:"0 0 20 20",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.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,v.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,v.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 nb(e){let t=e.getShape();return{columns:t.toX-t.fromX+1,rows:t.toY-t.fromY+1}}function nC(e){let{cellMerge:t,contextRef:l,onClose:n,setIsMenuOpen:r,tableCellNode:o}=e,[i]=(0,p.DF)(),a=(0,g.useRef)(null),[s,d]=(0,g.useState)(o),[u,c]=(0,g.useState)({columns:1,rows:1}),[h,f]=(0,g.useState)(!1),[x,b]=(0,g.useState)(!1),{y:C}=(0,S.useScrollInfo)();(0,g.useEffect)(()=>i.registerMutationListener(F.B9,e=>{"updated"===e.get(s.getKey())&&i.getEditorState().read(()=>{d(s.getLatest())})},{skipInitialization:!0}),[i,s]),(0,g.useEffect)(()=>{i.getEditorState().read(()=>{let e=(0,m.vJq)();if((0,F.Ln)(e)){let t=nb(e);c(nb(e)),f(t.columns>1||t.rows>1)}b(function(){let e=(0,m.vJq)();if((0,m.I2P)(e)&&!e.isCollapsed()||(0,F.Ln)(e)&&!e.anchor.is(e.focus)||!(0,m.I2P)(e)&&!(0,F.Ln)(e))return!1;let[t]=(0,F.be)(e.anchor);return t.__colSpan>1||t.__rowSpan>1}())})},[i]),(0,g.useEffect)(()=>{let e=l.current,t=a.current,n=i.getRootElement();if(null!=e&&null!=t&&null!=n){let l=n.getBoundingClientRect(),r=e.getBoundingClientRect();t.style.opacity="1";let o=t.getBoundingClientRect(),i=r.right+5;if(i+o.width>window.innerWidth||i+o.width>l.right){let e=r.left-o.width-5;i=(e<0?5:e)+window.pageXOffset}t.style.left="".concat(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}t.style.top="".concat(a,"px")}},[l,a,i,C]),(0,g.useEffect)(()=>{function e(e){null!=a.current&&null!=l.current&&(0,m.vAA)(e.target)&&!a.current.contains(e.target)&&!l.current.contains(e.target)&&r(!1)}return window.addEventListener("click",e),()=>window.removeEventListener("click",e)},[r,l]);let k=(0,g.useCallback)(()=>{i.update(()=>{if(s.isAttached()){let e=(0,F.sJ)(s),t=(0,F.SZ)(e,i.getElementByKey(e.getKey()));if(null===t)throw Error("Expected to find tableElement in DOM");let l=(0,F.xp)(t);null!==l&&l.$clearHighlight(),e.markDirty(),d(s.getLatest())}(0,m.n1P)(null)})},[i,s]),y=(0,g.useCallback)(e=>{i.update(()=>{for(let t=0;t<u.rows;t++)(0,F.zC)(e);n()})},[i,n,u.rows]),w=(0,g.useCallback)(e=>{i.update(()=>{for(let t=0;t<u.columns;t++)(0,F.JW)(e);
1n()})},[i,n,u.columns]),E=(0,g.useCallback)(()=>{i.update(()=>{(0,F.Hv)(),n()})},[i,n]),_=(0,g.useCallback)(()=>{i.update(()=>{(0,F.sJ)(s).remove(),k(),n()})},[i,s,k,n]),T=(0,g.useCallback)(()=>{i.update(()=>{(0,F.NL)(),n()})},[i,n]),L=(0,g.useCallback)(()=>{i.update(()=>{let e=(0,F.sJ)(s),t=(0,F.pA)(s),[l]=(0,F.tV)(e,null,null),r=new Set,o=s.getHeaderStyles()^F.o5.ROW;if(l[t])for(let e=0;e<l[t].length;e++){let n=l[t][e];(null==n?void 0:n.cell)&&(r.has(n.cell)||(r.add(n.cell),n.cell.setHeaderStyles(o,F.o5.ROW)))}k(),n()})},[i,s,k,n]),N=(0,g.useCallback)(()=>{i.update(()=>{let e=(0,F.sJ)(s),t=(0,F.Ze)(s),[l]=(0,F.tV)(e,null,null),r=new Set,o=s.getHeaderStyles()^F.o5.COLUMN;if(l)for(let e=0;e<l.length;e++){var i;let n=null==l||null==(i=l[e])?void 0:i[t];(null==n?void 0:n.cell)&&(r.has(n.cell)||(r.add(n.cell),n.cell.setHeaderStyles(o,F.o5.COLUMN)))}k(),n()})},[i,s,k,n]),j=(0,g.useCallback)(()=>{i.update(()=>{if(s.isAttached()){let e=(0,F.sJ)(s);e&&e.setRowStriping(!e.getRowStriping())}k(),n()})},[i,s,k,n]),I=(0,g.useCallback)(()=>{i.update(()=>{if(s.isAttached()){let e=(0,F.sJ)(s);e&&e.setFrozenColumns(+(0===e.getFrozenColumns()))}k(),n()})},[i,s,k,n]),M=null;return t&&(h?M=(0,v.jsx)("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>void i.update(()=>{let e,t=(0,m.vJq)();if(!(0,F.Ln)(t))return;let l=t.getNodes().filter(F.Xx),r=(0,F.ur)(l);r&&(e=r.getLastDescendant(),(0,m.kFe)(e)?e.select():(0,m.ff4)(e)?e.selectEnd():null!==e&&e.selectNext(),n())}),type:"button",children:(0,v.jsx)("span",{className:"text",children:"Merge cells"})}):x&&(M=(0,v.jsx)("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>void i.update(()=>{(0,F.GA)()}),type:"button",children:(0,v.jsx)("span",{className:"text",children:"Unmerge cells"})}))),(0,P.createPortal)((0,v.jsxs)("div",{className:"table-action-menu-dropdown",onClick:e=>{e.stopPropagation()},ref:a,children:[M?(0,v.jsxs)(g.Fragment,{children:[M,(0,v.jsx)("hr",{})]}):null,(0,v.jsx)("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>j(),type:"button",children:(0,v.jsx)("span",{className:"text",children:"Toggle Row Striping"})}),(0,v.jsx)("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>I(),type:"button",children:(0,v.jsx)("span",{className:"text",children:"Toggle First Column Freeze"})}),(0,v.jsx)("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>y(!1),type:"button",children:(0,v.jsxs)("span",{className:"text",children:["Insert ",1===u.rows?"row":"".concat(u.rows," rows")," above"]})}),(0,v.jsx)("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>y(!0),type:"button",children:(0,v.jsxs)("span",{className:"text",children:["Insert ",1===u.rows?"row":"".concat(u.rows," rows")," below"]})}),(0,v.jsx)("hr",{}),(0,v.jsx)("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>w(!1),type:"button",children:(0,v.jsxs)("span",{className:"text",children:["Insert ",1===u.columns?"column":"".concat(u.columns," columns")," ","left"]})}),(0,v.jsx)("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>w(!0),type:"button",children:(0,v.jsxs)("span",{className:"text",children:["Insert ",1===u.columns?"column":"".concat(u.columns," columns")," ","right"]})}),(0,v.jsx)("hr",{}),(0,v.jsx)("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>T(),type:"button",children:(0,v.jsx)("span",{className:"text",children:"Delete column"})}),(0,v.jsx)("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>E(),type:"button",children:(0,v.jsx)("span",{className:"text",children:"Delete row"})}),(0,v.jsx)("button",{className:"item","data-test-id":"table-delete",onClick:()=>_(),type:"button",children:(0,v.jsx)("span",{className:"text",children:"Delete table"})}),(0,v.jsx)("hr",{}),(0,v.jsx)("button",{className:"item","data-test-id":"table-row-header",onClick:()=>L(),type:"button",children:(0,v.jsxs)("span",{className:"text",children:[(s.__headerState&F.o5.ROW)===F.o5.ROW?"Remove":"Add"," ","row header"]})}),(0,v.jsx)("button",{className:"item","data-test-id":"table-column-header",onClick:()=>N(),type:"button",children:(0,v.jsxs)("span",{className:"text",children:[(s.__headerState&F.o5.COLUMN)===F.o5.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function nk(e){let{anchorElem:t,cellMerge:l}=e,[n]=(0,p.DF)(),r=(0,g.useRef)(null),o=(0,g.useRef)(null),[i,a]=(0,g.useState)(!1),[s,d]=(0,g.useState)(null),u=(0,g.useCallback)(()=>{let e=r.current,l=(0,m.vJq)(),o=(0,m.peL)(n._window),i=document.activeElement;function a(){e&&(e.classList.remove("table-cell-action-button-container--active"),e.classList.add("table-cell-action-button-container--inactive")),d(null)}if(null==l||null==e)return a();let s=n.getRootElement(),u=null,c=null;if((0,m.I2P)(l)&&null!==s&&null!==o&&s.contains(o.anchorNode)){let e=(0,F.zp)(l.anchor.getNode());if(null==e||null==(c=n.getElementByKey(e.getKey()))||!e.isAttached())return a();let t=(0,F.sJ)(e),r=(0,F.SZ)(t,n.getElementByKey(t.getKey()));if(null===r)throw Error("TableActionMenu: Expected to find tableElement in DOM");u=(0,F.xp)(r),d(e)}else if((0,F.Ln)(l)){let e=(0,F.zp)(l.anchor.getNode());if(!(0,F.Xx)(e))throw Error("TableSelection anchorNode must be a TableCellNode");let t=(0,F.sJ)(e),r=(0,F.SZ)(t,n.getElementByKey(t.getKey()));if(null===r)throw Error("TableActionMenu: Expected to find tableElement in DOM");u=(0,F.xp)(r),c=n.getElementByKey(e.getKey())}else if(!i)return a();if(null===u||null===c)return a();let p=!u||!u.isSelecting;if(e.classList.toggle("table-cell-action-button-container--active",p),e.classList.toggle("table-cell-action-button-container--inactive",!p),p){let l=c.getBoundingClientRect(),n=t.getBoundingClientRect(),r=l.top-n.top,o=l.right-n.left;e.style.transform="translate(".concat(o,"px, ").concat(r,"px)")}},[n,t]);(0,g.useEffect)(()=>{let e,t=()=>{e=void 0,n.getEditorState().read(u)},l=()=>(void 0===e&&(e=setTimeout(t,0)),!1);return(0,f.Sd)(n.registerUpdateListener(l),n.registerCommand(m.MvL,l,m.da8),n.registerRootListener((e,t)=>
1{t&&t.removeEventListener("pointerup",l),e&&(e.addEventListener("pointerup",l),l())}),()=>clearTimeout(e))});let c=(0,g.useRef)(s);return(0,g.useEffect)(()=>{c.current!==s&&a(!1),c.current=s},[c,s]),(0,v.jsx)("div",{className:"table-cell-action-button-container",ref:r,children:null!=s&&(0,v.jsxs)(g.Fragment,{children:[(0,v.jsx)("button",{className:"table-cell-action-button",onClick:e=>{e.stopPropagation(),a(!i)},ref:o,type:"button",children:(0,v.jsx)(nx,{})}),i&&(0,v.jsx)(nC,{cellMerge:l,contextRef:o,onClose:()=>a(!1),setIsMenuOpen:a,tableCellNode:s})]})})}function ny(e){let{editor:t}=e,l=(0,g.useRef)(null),n=(0,g.useRef)(null),r=(0,g.useRef)(null),[o,i]=(0,g.useState)(!1),a=(0,u.b)(),s=(0,g.useRef)(null),[d,c]=(0,g.useState)(null),[p,h]=(0,g.useState)(null),[x,b]=(0,g.useState)(!1),[C,k]=(0,g.useState)(null),y=(0,g.useCallback)(()=>{h(null),l.current=null,k(null),s.current=null,r.current=null},[]);(0,g.useEffect)(()=>{let e=new Set;return(0,f.Sd)(t.registerMutationListener(F.HA,t=>{for(let[l,n]of t)"destroyed"===n?e.delete(l):e.add(l);i(e.size>0)}),t.registerNodeTransform(F.HA,e=>{if(e.getColWidths())return e;let t=e.getColumnCount();return e.setColWidths(Array(t).fill(92)),e}))},[t]),(0,g.useEffect)(()=>{if(!o)return;let e=e=>{let o=e.target;if((0,m.sby)(o)){if(C)return void c({x:e.clientX,y:e.clientY});if(b((1&e.buttons)==1),!(n.current&&n.current.contains(o))&&l.current!==o){l.current=o;let e=(0,F.cn)(o);e&&p!==e?t.getEditorState().read(()=>{let n=(0,m.xL4)(e.elem);if(!n)throw Error("TableCellResizer: Table cell node not found.");let i=(0,F.sJ)(n),a=(0,F.SZ)(i,t.getElementByKey(i.getKey()));if(!a)throw Error("TableCellResizer: Table element not found.");l.current=o,r.current=a.getBoundingClientRect(),h(e)},{editor:t}):null==e&&y()}}},i=e=>{b(!0)},a=e=>{b(!1)},s=t.registerRootListener((t,l)=>{null==l||l.removeEventListener("mousemove",e),null==l||l.removeEventListener("mousedown",i),null==l||l.removeEventListener("mouseup",a),null==t||t.addEventListener("mousemove",e),null==t||t.addEventListener("mousedown",i),null==t||t.addEventListener("mouseup",a)});return()=>{s()}},[p,C,t,o,y]);let w=(0,g.useCallback)(e=>{if(!p)throw Error("TableCellResizer: Expected active cell.");t.update(()=>{let l=(0,m.xL4)(p.elem);if(!(0,F.Xx)(l))throw Error("TableCellResizer: Table cell node not found.");let n=(0,F.sJ)(l),r=(0,F.pA)(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(!(0,F.RN)(a))throw Error("Expected table row");let s=a.getHeight();void 0===s&&(s=Math.min(...a.getChildren().map(e=>{var l;return null!=(l=S(e,t))?l:1/0})));let d=Math.max(s+e,33);a.setHeight(d)},{tag:m.OQi})},[p,t]),S=(e,t)=>{var l;return null==(l=t.getElementByKey(e.getKey()))?void 0:l.clientHeight},E=(0,g.useCallback)(e=>{if(!p)throw Error("TableCellResizer: Expected active cell.");t.update(()=>{let t,l=(0,m.xL4)(p.elem);if(!(0,F.Xx)(l))throw Error("TableCellResizer: Table cell node not found.");let n=(0,F.sJ)(l),[r]=(0,F.tV)(n,null,null),o=(r.forEach(e=>{e.forEach((e,n)=>{e.cell===l&&(t=n)})}),t);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],d=Math.max(a+e,92);s[o]=d,n.setColWidths(s)},{tag:m.OQi})},[p,t]),_=(0,g.useCallback)(e=>{let t=l=>{if(l.preventDefault(),l.stopPropagation(),!p)throw Error("TableCellResizer: Expected active cell.");if(s.current){let{x:n,y:r}=s.current;if(null===p)return;let o=(0,f.OV)(l.target);"bottom"===e?w((l.clientY-r)/o):E((l.clientX-n)/o),y(),document.removeEventListener("mouseup",t)}};return t},[p,y,E,w]),T=(0,g.useCallback)(e=>t=>{if(t.preventDefault(),t.stopPropagation(),!p)throw Error("TableCellResizer: Expected active cell.");s.current={x:t.clientX,y:t.clientY},c(s.current),k(e),document.addEventListener("mouseup",_(e))},[p,_]),[L,N]=(0,g.useState)({bottom:null,left:null,right:null,top:null});return(0,g.useEffect)(()=>{if(p){let{height:e,left:t,top:l,width:n}=p.elem.getBoundingClientRect(),o=(0,f.OV)(p.elem),i={bottom:{backgroundColor:"none",cursor:"row-resize",height:"".concat(10,"px"),left:"".concat(window.scrollX+t,"px"),top:"".concat(window.scrollY+l+e-5,"px"),width:"".concat(n,"px")},right:{backgroundColor:"none",cursor:"col-resize",height:"".concat(e,"px"),left:"".concat(window.scrollX+t+n-5,"px"),top:"".concat(window.scrollY+l,"px"),width:"".concat(10,"px")}},a=r.current;C&&d&&a&&("bottom"===C?(i[C].left="".concat(window.scrollX+a.left,"px"),i[C].top="".concat(window.scrollY+d.y/o,"px"),i[C].height="3px",i[C].width="".concat(a.width,"px")):(i[C].top="".concat(window.scrollY+a.top,"px"),i[C].left="".concat(window.scrollX+d.x/o,"px"),i[C].width="3px",i[C].height="".concat(a.height,"px")),i[C].backgroundColor="#adf"),N(i)}else N({bottom:null,left:null,right:null,top:null})},[p,C,d]),(0,v.jsx)("div",{ref:n,children:null!=p&&!x&&(0,v.jsxs)(g.Fragment,{children:[(0,v.jsx)("div",{className:"".concat(a.editorConfig.lexical.theme.tableCellResizer," TableCellResizer__ui"),onMouseDown:T("right"),style:L.right||void 0}),(0,v.jsx)("div",{className:"".concat(a.editorConfig.lexical.theme.tableCellResizer," TableCellResizer__ui"),onMouseDown:T("bottom"),style:L.bottom||void 0})]})})}var nw=Math.max,nS=Math.min,nE=function(e,t,l){let n,r,o=0,i,a=!1,s=!1,d,u,c,p=!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 f(e){let l=e-r,n=e-o;return void 0===r||l>=t||l<0||s&&n>=d}function m(){let e,l,n,i=Date.now();if(f(i))return g(i);c=setTimeout(m,(e=i-r,l=i-o,n=t-e,s?nS(n,d-l):n))}function g(e){return c=void 0,p&&n?h(e):(n=i=void 0,u)}function v(){let e=Date.now(),l=f(e);
1if(n=arguments,i=this,r=e,l){if(void 0===c){var d;return o=d=r,c=setTimeout(m,t),a?h(d):u}if(s)return clearTimeout(c),c=setTimeout(m,t),h(r)}return void 0===c&&(c=setTimeout(m,t)),u}return t=t||0,"object"==typeof l&&(a=!!l.leading,d=(s="maxWait"in l)?nw(l.maxWait||0,t):d,p="trailing"in l?!!l.trailing:p),v.cancel=function(){void 0!==c&&clearTimeout(c),o=0,n=r=i=c=void 0},v.flush=function(){return void 0===c?u:g(Date.now())},v};function n_(e){var t;let l,n,r,o,i,{anchorElem:a}=e,[s]=(0,p.DF)(),d=(0,w.a)(),h=(0,u.b)(),[x,b]=(0,g.useState)(!1),[C,k]=(0,g.useState)(!1),[y,S]=(0,g.useState)(!1),[E,_]=(0,g.useState)({}),T=(0,g.useRef)(new Set),L=(0,g.useRef)(null),N=(t=e=>{var t;let{isOutside:l,tableDOMNode:n}=function(e,t){let l=e.target;if(!(0,m.sby)(l))return{isOutside:!0,tableDOMNode:null};{let e=l.closest("td.".concat(t.theme.tableCell,", th.").concat(t.theme.tableCell));return{isOutside:!(e||l.closest("button.".concat(t.theme.tableAddRows))||l.closest("button.".concat(t.theme.tableAddColumns))||l.closest("div.".concat(t.theme.tableCellResizer))),tableDOMNode:e}}}(e,null==(t=h.editorConfig)?void 0:t.lexical);if(l){b(!1),k(!1);return}if(!n)return;L.current=n;let r=null,o=null,i=null;if(s.getEditorState().read(()=>{let e=(0,m.xL4)(n);if((0,F.Xx)(e)){let l=(0,f.Bt)(e,e=>(0,F.TX)(e));if(!(0,F.TX)(l))return;if(i=(0,F.SZ)(l,s.getElementByKey(l.getKey()))){var t;let n=l.getChildrenSize(),i=null==(t=l.getChildAtIndex(0))?void 0:t.getChildrenSize(),a=(0,F.pA)(e),s=(0,F.Ze)(e);a===n-1?r=e:s===i-1&&(o=e)}}},{editor:s}),!i)return;let d=i.parentElement;if(!d)return;let{bottom:u,height:c,left:p,right:g,width:v,y:x}=i.getBoundingClientRect(),C=!1;d&&d.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(C=d.scrollWidth>d.clientWidth);let{left:y,y:w}=a.getBoundingClientRect();r?(k(!1),b(!0),_({height:20,left:C&&d?d.offsetLeft:p-y,top:u-w+5,width:C&&d?d.offsetWidth:v})):o&&(k(!0),b(!1),_({height:c,left:g-y+5,top:x-w,width:20}))},n=(0,c.c)(6),r=(0,g.useRef)(null),n[0]!==t||250!==n[1]||50!==n[2]?(o=()=>(r.current=nE(t,50,{maxWait:250}),()=>{var e;null==(e=r.current)||e.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=function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];r.current&&r.current(...t)},n[5]=l):l=n[5],l),j=(0,g.useMemo)(()=>new ResizeObserver(()=>{b(!1),k(!1)}),[]);(0,g.useEffect)(()=>{if(y)return document.addEventListener("mousemove",N),()=>{b(!1),k(!1),document.removeEventListener("mousemove",N)}},[y,N]),(0,g.useEffect)(()=>(0,f.Sd)(s.registerMutationListener(F.HA,e=>{s.getEditorState().read(()=>{let t=!1;for(let[l,n]of e)switch(n){case"created":T.current.add(l),t=!0;break;case"destroyed":T.current.delete(l),t=!0}if(t){for(let e of(j.disconnect(),T.current)){let{tableElement:t}=(0,F.cl)(e);j.observe(t)}S(T.current.size>0)}},{editor:s})},{skipInitialization:!1})),[s,j]);let I=e=>{s.update(()=>{var t;L.current&&(null==(t=(0,m.xL4)(L.current))||t.selectEnd(),e?((0,F.zC)(),b(!1)):((0,F.JW)(),k(!1)))})};return d?(0,v.jsxs)(v.Fragment,{children:[x&&(0,v.jsx)("button",{"aria-label":"Add Row",className:h.editorConfig.lexical.theme.tableAddRows,onClick:()=>I(!0),style:{...E},type:"button"}),C&&(0,v.jsx)("button",{"aria-label":"Add Column",className:h.editorConfig.lexical.theme.tableAddColumns,onClick:()=>I(!1),style:{...E},type:"button"})]}):null}var nT=(0,m.guI)("OPEN_EMBED_DRAWER_COMMAND"),nL=(0,g.createContext)({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}}),nN=Z({markdownTransformers:[e=>{let{allTransformers:t}=e;return{type:"element",dependencies:[F.HA,F.py,F.B9],export:e=>{if(!(0,F.TX)(e))return null;let l=[];for(let n of e.getChildren()){let e=[];
1if(!(0,F.RN)(n))continue;let r=!1;for(let l of n.getChildren())(0,F.Xx)(l)&&(e.push((0,d.c)(t,l).replace(/\n/g,"\\n").trim()),l.__headerState===F.o5.ROW&&(r=!0));l.push("| ".concat(e.join(" | ")," |")),r&&l.push("| ".concat(e.map(e=>"---").join(" | ")," |"))}return l.join("\n")},regExp:nf,replace:(e,l,n)=>{let r=n[0];if(!r)return;if(nm.test(r)){let t=e.getPreviousSibling();if(!t||!(0,F.TX)(t))return;let l=t.getChildren(),n=l[l.length-1];if(!n||!(0,F.RN)(n))return;n.getChildren().forEach(e=>{(0,F.Xx)(e)&&e.setHeaderStyles(F.o5.ROW,F.o5.ROW)}),e.remove();return}let o=nv(r,t);if(null==o)return;let i=[o],a=e.getPreviousSibling(),s=o.length;for(;a&&!(!(0,m.bSg)(a)||1!==a.getChildrenSize());){let e=a.getFirstChild();if(!(0,m.kFe)(e))break;let l=nv(e.getTextContent(),t);if(null==l)break;s=Math.max(s,l.length),i.unshift(l);let n=a.getPreviousSibling();a.remove(),a=n}let d=(0,F.pK)();for(let e of i){let l=(0,F.hx)();d.append(l);for(let n=0;n<s;n++)l.append(n<e.length?e[n]:ng("",t))}let u=e.getPreviousSibling();(0,F.TX)(u)&&function(e){let t=e.getFirstChild();return(0,F.RN)(t)?t.getChildrenSize():0}(u)===s?(u.append(...d.getChildren()),e.remove()):e.replace(d),d.selectEnd()}}}],nodes:[F.HA,F.B9,F.py],plugins:[{Component:()=>{let e,t,l,n=(0,c.c)(16),[r]=(0,p.DF)(),o=(0,g.use)(nL),s=(0,S.useEditDepth)(),{fieldProps:d,uuid:h}=(0,u.b)(),{schemaPath:x}=d,b="lexical-table-create-"+h,C;n[0]!==s||n[1]!==b?(C=(0,S.formatDrawerSlug)({slug:b,depth:s}),n[0]=s,n[1]=b,n[2]=C):C=n[2];let k=C,{toggleDrawer:y}=(0,a.a)(k,!0),w;return n[3]!==r||n[4]!==y?(w=()=>{if(!r.hasNodes([F.HA,F.py,F.B9]))throw Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return(0,f.Sd)(r.registerCommand(nT,()=>{let e=null;return r.getEditorState().read(()=>{let t=(0,m.vJq)();(0,m.I2P)(t)&&(e=t)}),e&&y(),!0},m.jZM))},n[3]=r,n[4]=y,n[5]=w):w=n[5],n[6]!==o||n[7]!==r||n[8]!==y?(e=[o,r,y],n[6]=o,n[7]=r,n[8]=y,n[9]=e):e=n[9],(0,g.useEffect)(w,e),n[10]!==r?(t=(e,t)=>{t.columns&&t.rows&&r.dispatchCommand(F.Ng,{columns:String(t.columns),rows:String(t.rows)})},n[10]=r,n[11]=t):t=n[11],n[12]!==k||n[13]!==x||n[14]!==t?(l=(0,v.jsxs)(g.Fragment,{children:[(0,v.jsx)(i.a,{drawerSlug:k,drawerTitle:"Create Table",featureKey:"experimental_table",handleDrawerSubmit:t,schemaPath:x,schemaPathSuffix:"fields"}
1),(0,v.jsx)(J.A,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]}),n[12]=k,n[13]=x,n[14]=t,n[15]=l):l=n[15],l},position:"normal"},{Component:()=>{let e=(0,c.c)(3),[t]=(0,p.DF)(),l=(0,w.a)(),n;return e[0]!==t||e[1]!==l?(n=l?(0,P.createPortal)((0,v.jsx)(ny,{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.a)(),r;return t[0]!==l||t[1]!==n?(r=(0,P.createPortal)(n?(0,v.jsx)(nk,{anchorElem:null!=l?l:document.body,cellMerge:!0}):null,null!=l?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.a)()?(l[0]!==r?(t=(0,P.createPortal)((0,v.jsx)(n_,{anchorElem:r}),r),l[0]=r,l[1]=t):t=l[1],t):null},position:"floatingAnchorElem"}],providers:[function(e){let{children:t}=e,[l,n]=(0,g.useState)({cellEditorConfig:null,cellEditorPlugins:null});return(0,v.jsx)(nL,{value:(0,g.useMemo)(()=>({cellEditorConfig:l.cellEditorConfig,cellEditorPlugins:l.cellEditorPlugins,set:(e,t)=>{n({cellEditorConfig:e,cellEditorPlugins:t})}}),[l.cellEditorConfig,l.cellEditorPlugins]),children:t})}],slashMenu:{groups:[W([{Icon:nh,key:"table",keywords:["table"],label:"Table",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(nT,{})}}])]},toolbarFixed:{groups:[te([{ChildComponent:nh,key:"table",label:"Table",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(nT,{})}}])]}}),nj=()=>(0,v.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.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,v.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,v.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 nI(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 y.default().toHexString(),src:e.getAttribute("src")||""}}})}}var nM=class extends h.d{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=>nI(e,nF),priority:0})}}static importJSON(e){var t;1===e.version&&(null==e||null==(t=e.value)?void 0:t.id)&&(e.value=e.value.id),2!==e.version||(null==e?void 0:e.id)||(e.id=new y.default().toHexString(),e.version=3);let l=nF({data:{id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value}});return l.setFormat(e.format),l}static isInline(){return!1}createDOM(e){var t;let l=document.createElement("div");return(0,f.ZB)(l,null==e||null==(t=e.theme)?void 0:t.upload),l}decorate(){return null}exportDOM(){var e,t;let l=document.createElement("img"),n=this.__data;return n.pending?(l.setAttribute("data-lexical-pending-upload-form-id",String(null==n||null==(e=n.pending)?void 0:e.formID)),l.setAttribute("src",(null==n||null==(t=n.pending)?void 0:t.src)||"")):(l.setAttribute("data-lexical-upload-id",String(null==n?void 0:n.value)),l.setAttribute("data-lexical-upload-relation-to",null==n?void 0:n.relationTo)),{element:l}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(e){this.getWritable().__data=e}updateDOM(){return!1}constructor({data:e,format:t,key:l}){super(t,l),this.__data=e}};function nF(e){let{data:t}=e;return(null==t?void 0:t.id)||(t.id=new y.default().toHexString()),(0,m.pTq)(new nM({data:t}))}var nA=()=>(0,v.jsx)("div",{className:"lexical-upload",children:(0,v.jsx)(E.f,{height:"95px",width:"203px"})}),nR=g.lazy(()=>l.e(9207).then(l.bind(l,39207)).then(e=>({default:e.UploadComponent}))),nP=class extends nM{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:e=>nI(e,nD),priority:0})}}static importJSON(e){var t;1===e.version&&(null==e||null==(t=e.value)?void 0:t.id)&&(e.value=e.value.id),2!==e.version||(null==e?void 0:e.id)||(e.id=new y.default().toHexString(),e.version=3);let l=nD({data:{id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value}});return l.setFormat(e.format),l}decorate(e,t){var l,n;return this.__data.pending?(0,v.jsx)(nA,{}):(0,v.jsx)(nR,{className:null!=(n=null==t||null==(l=t.theme)?void 0:l.upload)?n:"LexicalEditorTheme__upload",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function nD(e){let{data:t}=e;return(null==t?void 0:t.id)||(t.id=new y.default().toHexString()),(0,m.pTq)(new nP({data:t}))}function nH(e){return e instanceof nP}var nB=e=>
1{let t,l=(0,c.c)(13),{enabledCollectionSlugs:n}=e,[r]=(0,p.DF)(),[o,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:u,openListDrawer:h}=lU(s),f,x;l[2]!==r||l[3]!==h?(f=()=>r.registerCommand(i.b,e=>(a((null==e?void 0:e.replace)?null==e?void 0:e.replace.nodeKey:null),h(),!0),m.jZM),x=[r,h],l[2]=r,l[3]=h,l[4]=f,l[5]=x):(f=l[4],x=l[5]),(0,g.useEffect)(f,x),l[6]!==d||l[7]!==r||l[8]!==o?(t=e=>{let{collectionSlug:t,doc:l}=e;d(),(e=>{let{editor:t,relationTo:l,replaceNodeKey:n,value:r}=e;n?t.update(()=>{let e=(0,m.nsf)(n);e&&e.replace(nD({data:{fields:null,relationTo:l,value:r}}))}):t.dispatchCommand(nV,{fields:null,relationTo:l,value:r})})({editor:r,relationTo:t,replaceNodeKey:o,value:l.id})},l[6]=d,l[7]=r,l[8]=o,l[9]=t):t=l[9];let b=t,C;return l[10]!==u||l[11]!==b?(C=(0,v.jsx)(u,{onSelect:b}),l[10]=u,l[11]=b,l[12]=C):C=l[12],C},nO=()=>{let e=(0,c.c)(3),[t]=(0,p.DF)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(i.b,nz,m.jZM),n=[t],e[0]=t,e[1]=l,e[2]=n):(l=e[1],n=e[2]),(0,g.useEffect)(l,n),null},nJ=e=>{let{enabledCollectionSlugs:t}=e;return(null==t?void 0:t.length)?(0,v.jsx)(nB,{enabledCollectionSlugs:t}):(0,v.jsx)(nO,{})};function nz(){return S.toast.error("No upload collections enabled"),!0}var nV=(0,m.guI)("INSERT_UPLOAD_COMMAND");function nW(e){return{file:e.file,formID:e.formID}}function nU(){for(let t of(0,f.YF)()){var e;let l=t.node;nH(l)&&(null==(e=l.getData())?void 0:e.pending)&&l.remove()}}function nZ(e){return[e.formID,e]}var nK=Z({nodes:[nP],plugins:[{Component:e=>{let t,l,n=(0,c.c)(21),{clientProps:r}=e,[o]=(0,p.DF)(),i=null==r?void 0:r.disabledCollections,a=null==r?void 0: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}=lY(s),{drawerSlug:u,setCollectionSlug:h,setInitialForms:x,setOnCancel:b,setOnSuccess:C,setSelectableCollections:k}=(0,S.useBulkUpload)(),{isModalOpen:w,openModal:E}=(0,S.useModal)(),_;n[3]!==u||n[4]!==o||n[5]!==d||n[6]!==w||n[7]!==E||n[8]!==h||n[9]!==x||n[10]!==b||n[11]!==C||n[12]!==k?(_=e=>{let{files:t}=e;if((null==t?void 0:t.length)!==0&&(x(e=>[...null!=e?e:[],...t.map(nW)]),!w(u))){if(!d.length||!d[0])return;h(d[0]),k(d),b(()=>{o.update(nU)}),C(e=>{let t=new Map(e.map(nZ));o.update(()=>{for(let l of(0,f.YF)()){let n=l.node;if(nH(n)){let l=n.getData();if(null==l?void 0:l.pending){var e;let r=t.get(null==(e=l.pending)?void 0:e.formID);r&&n.replace(nD({data:{id:new y.default().toHexString(),fields:{},relationTo:r.collectionSlug,value:r.doc.id}}))}}}})}),E(u)}},n[3]=u,n[4]=o,n[5]=d,n[6]=w,n[7]=E,n[8]=h,n[9]=x,n[10]=b,n[11]=C,n[12]=k,n[13]=_):_=n[13];let T=(0,S.useEffectEvent)(_),L;return n[14]!==o||n[15]!==T?(L=()=>{if(!o.hasNodes([nP]))throw Error("UploadPlugin: UploadNode not registered on editor");return(0,f.Sd)(o.registerNodeTransform(nP,e=>{let t=e.getData();(null==t?void 0:t.pending)&&async function(){var e,l;let n=null,r=null==t||null==(e=t.pending)?void 0:e.src,o=null==t||null==(l=t.pending)?void 0:l.formID;if(null==r?void 0:r.startsWith("data:")){let e=r.match(/data:(image\/[a-zA-Z]+);base64,/),t=e?e[1]:"image/png",l=atob(r.replace(/^data:image\/[a-zA-Z]+;base64,/,"")),i=Array(l.length);for(let e=0;e<l.length;e++)i[e]=l.charCodeAt(e);n={alt:void 0,file:new File([new Uint8Array(i)],"pasted-image."+(null==t?void 0:t.split("/",2)[1]),{type:t}),formID:o}}else if((null==r?void 0:r.startsWith("http"))||(null==r?void 0:r.startsWith("https"))){let e=await (await fetch(r)).blob(),t=r.split("/").pop()||"pasted-image"+e.type.split("/",2)[1];n={alt:void 0,file:new File([e],t,{type:e.type}),formID:o}}n&&T({files:[n]})}()}),o.registerCommand(nV,e=>(o.update(()=>{let t=(0,m.vJq)()||(0,m.S1w)();if((0,m.I2P)(t)){let l=nD({data:{id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value}}),{focus:n}=t,r=n.getNode();(0,f.Pe)(l),(0,m.bSg)(r)&&!r.__first&&r.remove()}}),!0),m.jZM),o.registerCommand(m.waI,e=>{var t,l,n;if(!(e instanceof ClipboardEvent))return!1;let r=e.clipboardData;if(!(null==r||null==(t=r.types)?void 0:t.length)||(null==r||null==(l=r.types)?void 0:l.includes("text/html")))return!1;let i=[];return(null==r||null==(n=r.files)?void 0:n.length)&&Array.from(r.files).forEac
1h(e=>{i.push({alt:"",file:e,formID:new y.default().toHexString()})}),!!i.length&&(o.update(()=>{let e=(0,m.vJq)()||(0,m.S1w)();if((0,m.I2P)(e))for(let t of i){let l=nD({data:{pending:{formID:t.formID,src:URL.createObjectURL(t.file)}}}),{focus:n}=e,r=n.getNode();(0,f.Pe)(l),(0,m.bSg)(r)&&!r.__first&&r.remove()}}),T({files:i}),!0)},m.AcJ),o.registerCommand(m.Sr4,e=>{var t,l;if(!(e instanceof DragEvent))return!1;let n=e.dataTransfer;if(!(null==n||null==(t=n.types)?void 0:t.length))return!1;let r=[];return(null==n||null==(l=n.files)?void 0:l.length)&&Array.from(n.files).forEach(e=>{r.push({alt:"",file:e,formID:new y.default().toHexString()})}),!!r.length&&(e.preventDefault(),e.stopPropagation(),o.update(()=>{if(function(e){let t=e.target;return!!((0,m.sby)(t)&&!t.closest("code, span.editor-image")&&(0,m.sby)(t.parentElement)&&t.parentElement.closest("div.ContentEditable__root"))}(e)){let t=function(e){let t,l=(0,m.OSq)(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),l=(0,m.uTE)();for(let e of(null!=t&&l.applyDOMRange(t),(0,m.n1P)(l),r)){let t=nD({data:{pending:{formID:e.formID,src:URL.createObjectURL(e.file)}}}),{focus:n}=l,r=n.getNode();(0,f.Pe)(t),(0,m.bSg)(r)&&!r.__first&&r.remove()}}}),T({files:r}),!0)},m.AcJ))},n[14]=o,n[15]=T,n[16]=L):L=n[16],n[17]!==o?(t=[o],n[17]=o,n[18]=t):t=n[18],(0,g.useEffect)(L,t),n[19]!==d?(l=(0,v.jsx)(nJ,{enabledCollectionSlugs:d}),n[19]=d,n[20]=l):l=n[20],l},position:"normal"}],slashMenu:{groups:[W([{Icon:nj,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:e=>{let{i18n:t}=e;return t.t("lexical:upload:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(i.b,{replace:!1})}}])]},toolbarFixed:{groups:[te([{ChildComponent:nj,isActive:e=>{let{selection:t}=e;return!!(0,m.RTZ)(t)&&!!t.getNodes().length&&nH(t.getNodes()[0])},key:"upload",label:e=>{let{i18n:t}=e;return t.t("lexical:upload:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(i.b,{replace:!1})}}])]}}),nG={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"}},nq=e=>{let t={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},l={};
1if(e.forEach(e=>{var t;"toolbarFixed"===e.key&&(null==(t=e.sanitizedClientFeatureProps)?void 0:t.customGroups)&&(l={...l,...e.sanitizedClientFeatureProps.customGroups})}),!(null==e?void 0:e.size))return t;for(let n of(e.forEach(e=>{var l,n,r,o,i,a,s,d,u,c,p,h,f,m,g,v;if((null==(l=e.providers)?void 0:l.length)&&(t.providers=t.providers.concat(e.providers)),(null==(n=e.enableFormats)?void 0:n.length)&&t.enabledFormats.push(...e.enableFormats),null==(r=e.nodes)?void 0:r.length)for(let l of e.nodes)t.nodes.push(l);if((null==(o=e.plugins)?void 0:o.length)&&e.plugins.forEach((l,n)=>{var r;null==(r=t.plugins)||r.push({clientProps:e.sanitizedClientFeatureProps,Component:l.Component,key:e.key+n,position:l.position})}),null==(a=e.toolbarInline)||null==(i=a.groups)?void 0:i.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:[]},(null==l||null==(p=l.items)?void 0:p.length)&&(e.items=e.items.concat(l.items)),null==(h=t.toolbarInline)||h.groups.push(e)}if(null==(d=e.toolbarFixed)||null==(s=d.groups)?void 0:s.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:[]},(null==l||null==(f=l.items)?void 0:f.length)&&(e.items=e.items.concat(l.items)),null==(m=t.toolbarFixed)||m.groups.push(e)}if(null==(u=e.slashMenu)?void 0:u.groups)for(let l of((null==(g=e.slashMenu.dynamicGroups)?void 0:g.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:[]},(null==l||null==(v=l.items)?void 0:v.length)&&(e.items=e.items.concat(l.items)),t.slashMenu.groups.push(e)}if(null==(c=e.markdownTransformers)?void 0:c.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?z(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 nY(e,t,l){return{admin:l,features:nq(e),lexical:t,resolvedFeatureMap:e}}var nX=(0,g.lazy)(()=>Promise.all([l.e(4797),l.e(1227)]).then(l.bind(l,31227)).then(e=>({default:e.RichText}))),n$=e=>{let t,l=(0,c.c)(18),{admin:n,clientFeatures:r,featureClientImportMap:o,featureClientSchemaMap:i,field:a,lexicalEditorConfig:s,schemaPath:d}=e,u;l[0]!==n?(u=void 0===n?{}:n,l[0]=n,l[1]=u):u=l[1];let p=u,h;l[2]!==o?(h=void 0===o?{}:o,l[2]=o,l[3]=h):h=l[3];let f=h,m=void 0===s?nG:s,{config:x}=(0,E.c)(),[b,C]=(0,g.useState)(null),k,y;return l[4]!==p||l[5]!==r||l[6]!==x||l[7]!==f||l[8]!==i||l[9]!==a||l[10]!==b||l[11]!==m||l[12]!==d?(k=()=>{if(b)return;let e=[];for(let t of Object.values(r))t.clientFeatureProvider&&e.push(t.clientFeatureProvider(t.clientFeatureProps));C(nY(function(e){let{config:t,featureClientImportMap:l,featureClientSchemaMap:n,field:r,schemaPath:o,unSanitizedEditorConfig:i}=e,a=new Map;for(let e of i.features){var s,d,u;if(!(null==e||null==(s=e.clientFeatureProps)?void 0:s.featureKey)||(null==e||null==(d=e.clientFeatureProps)?void 0:d.order)===void 0||(null==e||null==(u=e.clientFeatureProps)?void 0:u.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.");a.set(e.clientFeatureProps.featureKey,e)}i.features=i.features.sort((e,t)=>
1e.clientFeatureProps.order-t.clientFeatureProps.order);let c=new Map,p=0;for(let e of i.features){let s="function"==typeof e.feature?e.feature({config:t,featureClientImportMap:l,featureClientSchemaMap:n,featureProviderMap:a,field:r,resolvedFeatures:c,schemaPath:o,unSanitizedEditorConfig:i}):e.feature;s.key=e.clientFeatureProps.featureKey,s.order=p,c.set(e.clientFeatureProps.featureKey,s),p++}return c}({config:x,featureClientImportMap:f,featureClientSchemaMap:i,field:a,schemaPath:null!=d?d:a.name,unSanitizedEditorConfig:{features:e,lexical:m}}),m,p))},y=[p,r,x,f,i,a,b,m,d],l[4]=p,l[5]=r,l[6]=x,l[7]=f,l[8]=i,l[9]=a,l[10]=b,l[11]=m,l[12]=d,l[13]=k,l[14]=y):(k=l[13],y=l[14]),(0,g.useEffect)(k,y),l[15]!==b||l[16]!==e?(t=(0,v.jsx)(g.Suspense,{fallback:(0,v.jsx)(E.f,{height:"35vh"}),children:b&&(0,v.jsx)(nX,{...e,editorConfig:b})}),l[15]=b,l[16]=e,l[17]=t):t=l[17],t};function nQ(e){return e instanceof HTMLElement}function n0(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return t.filter(Boolean).join(" ")}var n1=new WeakMap;function n2(e){let t=e.changedTouches[0];return void 0===t?null:[t.clientX,t.clientY]}function n6(e,t){let l=n1.get(e);if(void 0===l){let t=new Set,n=e=>{void 0!==l&&(l.start=n2(e))},r=e=>{if(void 0===l)return;let{start:n}=l;if(null===n)return;let r=n2(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},n1.set(e,l)}return l.listeners.add(t),()=>{!function(e,t){let l=n1.get(e);if(void 0===l)return;let{listeners:n}=l;n.delete(t),0===n.size&&(n1.delete(e),e.removeEventListener("touchstart",l.handleTouchstart),e.removeEventListener("touchend",l.handleTouchend))}(e,t)}}function n5(e,t){return n6(e,(e,l)=>{let[n,r]=e;n<0&&-n>Math.abs(r)&&t(n,l)})}function n3(e,t){return n6(e,(e,l)=>{let[n,r]=e;n>0&&n>Math.abs(r)&&t(n,l)})}function n4(e,t){return n6(e,(e,l)=>{let[n,r]=e;r<0&&-r>Math.abs(n)&&t(n,l)})}function n7(e,t){return n6(e,(e,l)=>{let[n,r]=e;r>0&&r>Math.abs(n)&&t(n,l)})}var n8=()=>{let e=(0,c.c)(2),{EditButton:t}=(0,r.a)(),l;return e[0]!==t?(l=t?(0,v.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},n9=()=>{let e=(0,c.c)(2),{RemoveButton:t}=(0,r.a)(),l;return e[0]!==t?(l=t?(0,v.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},re=()=>{let e=(0,c.c)(2),{Label:t}=(0,r.a)(),l;return e[0]!==t?(l=t?(0,v.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},rt=e=>{let t=(0,c.c)(3),{children:l}=e,{InlineBlockContainer:n}=(0,r.a)(),o;return t[0]!==n||t[1]!==l?(o=n?(0,v.jsx)(n,{children:l}):null,t[0]=n,t[1]=l,t[2]=o):o=t[2],o},rl=e=>{let{children:t,...l}=e,{BlockCollapsible:n}=ef();return n?(0,v.jsx)(n,{...l,children:t}):null},rn=()=>{let e=(0,c.c)(2),{EditButton:t}=ef(),l;return e[0]!==t?(l=t?(0,v.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},rr=()=>{let e=(0,c.c)(2),{RemoveButton:t}=ef(),l;return e[0]!==t?(l=t?(0,v.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},ro=e=>{let{apiURL:t,depth:l,draft:n,locale:r}=e;return async e=>{let{id:o,collectionSlug:i,select:a}=e,s=(0,V.A)({depth:null!=l?l:0,draft:null!=n&&n,locale:r,select:a},{addQueryPrefix:!0});return await fetch("".concat(t,"/").concat(i,"/").concat(o).concat(s),{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(e=>e.json())}},ri={customEndRegex:{optional:!0,regExp:/[ \t]*```$/},customStartRegex:/^[ \t]*```(\w+)?/,doNotTrimChildren:!0,export:e=>{var t;let{fields:l}=e;return l.code.includes("\n")||(null==(t=l.language)?void 0:t.length)?"```"+(l.language||"")+(l.code?"\n"+l.code:"")+"\n```":"```"+l.code+"```"},import:e=>{var t;let{children:l,closeMatch:n,openMatch:r}=e,o=null==r?void 0:r[1];return l.startsWith("\n")&&(l=l.slice(1)),l.endsWith("\n")&&(l=l.slice(0,-1)),n&&!l.includes("\n")&&(null==r||null==(t=r.input)?void 0:t.trim())!=="```"+o?{code:o+((null==l?void 0:l.length)?l:""),language:""}:{code:l,language:o}}},ra={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
1:"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"},rs=e=>{let{autoComplete:t,field:l,forceRender:n,languages:r=ra,path:o,permissions:i,readOnly:a,renderedBlocks:s,schemaPath:d,typescript:u,validate:c}=e,p=(0,S.useFormFields)(e=>{let[t]=e;return t.language}),h=(null==p?void 0:p.value)||(null==p?void 0:p.initialValue)||"typescript",f=(0,g.useId)(),m=r[h],x=(0,g.useMemo)(()=>({...l,type:"code",admin:{...l.admin,editorOptions:{},editorProps:{defaultPath:"ts"===h?"file-".concat(l.name,"-").concat(f,".tsx"):void 0},language:h}}),[l,h,f]),b="".concat(l.name,"-").concat(h,"-").concat(m);return x&&(0,v.jsx)(S.CodeField,{autoComplete:t,field:x,forceRender:n,onMount:(e,t)=>{var l,n;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:null==u?void 0:u.paths,reactNamespace:"React",target:t.languages.typescript.ScriptTarget[null!=(l=null==u?void 0:u.target)?l:"ESNext"],typeRoots:null!=(n=null==u?void 0:u.typeRoots)?n:["node_modules/@types"]}),t.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!(null==u?void 0:u.enableSemanticValidation),noSyntaxValidation:!1}),(async()=>(null==u?void 0:u.fetchTypes)&&Array.isArray(u.fetchTypes)&&u.fetchTypes.length>0&&await Promise.all(u.fetchTypes.map(async e=>{let l=await (await fetch(e.url)).text();t.languages.typescript.typescriptDefaults.addExtraLib(l,e.filePath)})))()},path:o,permissions:i,readOnly:a,renderedBlocks:s,schemaPath:d,validate:c},b)},rd=()=>(0,v.jsx)("svg",{fill:"none",height:"12",viewBox:"0 0 15 12",width:"15",xmlns:"http://www.w3.org/2000/svg",children:(0,v.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"})}),ru=()=>(0,v.jsx)("svg",{fill:"none",height:"15",viewBox:"0 0 15 15",width:"15",xmlns:"http://www.w3.org/2000/svg",children:(0,v.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"})}),rc=()=>{let{toggle:e}=(0,S.useCollapsible)();return(0,v.jsx)("button",{className:"code-block-collapse-button",onClick:e,type:"button",children:(0,v.jsx)(ru,{})})},rp=()=>{let{isCollapsed:e,toggle:t}=(0,S.useCollapsible)(),{t:l}=(0,_.d)();return e?(0,v.jsxs)("button",{className:"code-block-floating-collapse-button",onClick:t,type:"button",children:[(0,v.jsx)("span",{children:l("general:collapse")}),(0,v.jsx)(ru,{})]}):null},rh="payload-richtext-code-block",rf=e=>{var t;let{languages:l}=e,n=l||ra,{BlockCollapsible:r,formSchema:o,RemoveButton:i}=ef(),{setModified:a}=(0,S.useForm)(),{t:s}=(0,_.d)(),{codeField:d}=(0,S.useFormFields)(e=>{let[t]=e;return{codeField:null==t?void 0:t.code}}),{selectedLanguageField:u,setSelectedLanguage:c}=(0,S.useFormFields)(e=>{let[t,l]=e;return{selectedLanguageField:null==t?void 0:t.language,setSelectedLanguage:e=>{l({type:"UPDATE",path:"language",value:e}),a(!0)}}}),p=n[null==u?void 0:u.value],h=(0,w.a)(),f=g.useMemo(()=>Object.entries(n).map(e=>{let[t,l]=e;return{name:"".concat(t," ").concat(l),Component:(0,v.jsx)(S.PopupList.Button,{active:!1,disabled:!1,onClick:()=>{c(t)},children:(0,v.jsx)("span",{className:"".concat(rh,"__language-code"),"data-language":t,children:l})})}}),[n,c]);return(0,v.jsx)(r,{Actions:(0,v.jsxs)("div",{className:"".concat(rh,"__actions"),children:[(0,v.jsx)(S.Combobox,{button:(0,v.jsxs)("div",{className:"".concat(rh,"__language-selector-button"),"data-selected-language":null==u?void 0:u.value,children:[(0,v.jsx)("span",{children:p}),(0,v.jsx)(S.ChevronIcon,{className:"".concat(rh,"__chevron")})]}),buttonType:"custom",className:"".concat(rh,"__language-selector"),disabled:!h,entries:f,horizontalAlign:"right",minEntriesForSearch:8,searchPlaceholder:s("fields:searchForLanguage"),showScrollbar:!0,size:"large"}),(0,v.jsx)(S.CopyToClipboard,{value:null!=(t=null==d?void 0:d.value)?t:""}),(0,v.jsx)(rc,{}),h&&(0,v.jsx)(i,{})]}),className:rh,collapsibleProps:{AfterCollapsible:(0,v.jsx)(rp,{}),disableHeaderToggle:!0,disableToggleIndicator:!0},Pill:(0,v.jsx)("div",{className:"".concat(rh,"__pill"),children:(0,v.jsx)(rd,{})}),children:(0,v.jsx)(S.RenderFields,{fields:o,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!h})})},rm=e=>{var t;
1let l=(0,c.c)(9),{field:n,initialValue:r,Loading:o,path:i,schemaPath:a,setValue:s,value:d}=e,[u,p]=g.useState(null),h=(0,S.useServerFunctions)(),{_internal_renderField:f}=h,[m,x]=a.split(".",2),b=null!=(t=null!=i?i:n&&"name"in n?null==n?void 0:n.name:"")?t:"",C;l[0]!==f||l[1]!==n||l[2]!==r||l[3]!==i||l[4]!==a?(C=()=>{!async function(){let{Field:e}=await f({field:{...n||{},type:"richText",admin:{...(null==n?void 0:n.admin)||{},hidden:!1}},initialValue:null!=r?r:void 0,path:i,schemaPath:a});p(e)}()},l[0]=f,l[1]=n,l[2]=r,l[3]=i,l[4]=a,l[5]=C):C=l[5];let k=C,y=(0,g.useRef)(!1),w,_;if(l[6]!==k?(w=()=>{y.current||(y.current=!0,k())},_=[k],l[6]=k,l[7]=w,l[8]=_):(w=l[7],_=l[8]),(0,g.useEffect)(w,_),!u)return"u">typeof o?o:(0,v.jsx)(E.f,{});let T={...h,getFormState:async e=>h.getFormState({...e,collectionSlug:"collection"===m?x:void 0,globalSlug:"global"===m?x:void 0})};return typeof d>"u"&&!s?(0,v.jsx)(S.ServerFunctionsContext,{value:{...T},children:(0,v.jsx)(S.FieldPathContext,{value:b,children:u},b)}):(0,v.jsx)(S.ServerFunctionsContext,{value:{...T},children:(0,v.jsx)(S.FieldPathContext,{value:b,children:(0,v.jsx)(S.FieldContext,{value:{disabled:!1,formInitializing:!1,formProcessing:!1,formSubmitted:!1,initialValue:d,path:b,setValue:null!=s?s:rg,showError:!1,value:d},children:u})},b)})};function rg(){}function rv(e){let{nodes:t,text:l}=e,n={root:{type:"root",children:[],direction:"ltr",format:"",indent:0,version:1}};return l&&n.root.children.push({type:"paragraph",children:[{type:"text",detail:0,format:0,mode:"normal",style:"",text:l,version:1}],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),(null==t?void 0:t.length)&&n.root.children.push(...t),n}var rx=rv}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.