@simoncomputing/mui-bueno-v2 0.32.2 → 0.32.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
  - Minor increment --> singlular/minor changes. Minimal breaking changes.
12
12
  - Patch increment --> singlular/minor changes. Zero breaking changes.
13
13
 
14
+ ## [0.32.3] - 2026-06-23
15
+
16
+ ### Changed
17
+
18
+ - `DiffProvider`
19
+ - improved stability
20
+
14
21
  ## [0.32.2] - 2026-06-23
15
22
 
16
23
  ### Added
package/dist/index.cjs.js CHANGED
@@ -76,7 +76,7 @@ theme.transitions = createTransitions(theme.transitions || {});
76
76
 
77
77
  export default theme;`}function xb(t={},...e){const{breakpoints:n,mixins:r={},spacing:o,palette:i={},transitions:s={},typography:a={},shape:l,...u}=t;if(t.vars&&t.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Go(20));const f=A0(i),p=bh(t);let m=Vn(p,{mixins:VH(p.breakpoints,r),palette:f,shadows:KH.slice(),typography:HH(f,a),transitions:JH(s),zIndex:{...XH}});if(m=Vn(m,u),m=e.reduce((b,v)=>Vn(b,v),m),process.env.NODE_ENV!=="production"){const b=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],v=(y,x)=>{let C;for(C in y){const k=y[C];if(b.includes(C)&&Object.keys(k).length>0){if(process.env.NODE_ENV!=="production"){const T=qe("",C);console.error([`MUI: The \`${x}\` component increases the CSS specificity of the \`${C}\` internal state.`,"You can not override it like this: ",JSON.stringify(y,null,2),"",`Instead, you need to use the '&.${T}' syntax:`,JSON.stringify({root:{[`&.${T}`]:k}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
78
78
  `))}y[C]={}}}};Object.keys(m.components).forEach(y=>{const x=m.components[y].styleOverrides;x&&y.startsWith("Mui")&&v(x,y)})}return m.unstable_sxConfig={...Au,...u==null?void 0:u.unstable_sxConfig},m.unstable_sx=function(v){return ya({sx:v,theme:this})},m.toRuntimeSource=yM,m}function wb(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const QH=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=wb(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function bM(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function vM(t){return t==="dark"?QH:[]}function eW(t){const{palette:e={mode:"light"},opacity:n,overlays:r,...o}=t,i=A0(e);return{palette:i,opacity:{...bM(i.mode),...n},overlays:r||vM(i.mode),...o}}function tW(t){var e;return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!((e=t[1])!=null&&e.match(/(mode|contrastThreshold|tonalOffset)/))}const nW=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],rW=t=>(e,n)=>{const r=t.rootSelector||":root",o=t.colorSchemeSelector;let i=o;if(o==="class"&&(i=".%s"),o==="data"&&(i="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const s={};return nW(t.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),i==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:i?{[i.replace("%s",e)]:s,[`${r}, ${i.replace("%s",e)}`]:n}:{[r]:{...n,...s}}}if(i&&i!=="media")return`${r}, ${i.replace("%s",String(e))}`}else if(e){if(i==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[r]:n}};if(i)return i.replace("%s",String(e))}return r};function oW(t,e){e.forEach(n=>{t[n]||(t[n]={})})}function xe(t,e,n){!t[e]&&n&&(t[e]=n)}function Ac(t){return typeof t!="string"||!t.startsWith("hsl")?t:pM(t)}function gi(t,e){`${e}Channel`in t||(t[`${e}Channel`]=Dc(Ac(t[e]),`MUI: Can't create \`palette.${e}Channel\` because \`palette.${e}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
79
- To suppress this warning, you need to explicitly provide the \`palette.${e}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function iW(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const jo=t=>{try{return t()}catch{}},sW=(t="mui")=>xH(t);function Hg(t,e,n,r){if(!e)return;e=e===!0?{}:e;const o=r==="dark"?"dark":"light";if(!n){t[r]=eW({...e,palette:{mode:o,...e==null?void 0:e.palette}});return}const{palette:i,...s}=xb({...n,palette:{mode:o,...e==null?void 0:e.palette}});return t[r]={...e,palette:i,opacity:{...bM(o),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||vM(o)},s}function aW(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:s=tW,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...u}=t,f=Object.keys(n)[0],p=r||(n.light&&f!=="light"?"light":f),m=sW(i),{[p]:b,light:v,dark:y,...x}=n,C={...x};let k=b;if((p==="dark"&&!("dark"in n)||p==="light"&&!("light"in n))&&(k=!0),!k)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${p}\` option is either missing or invalid.`:Go(21,p));const T=Hg(C,k,u,p);v&&!C.light&&Hg(C,v,void 0,"light"),y&&!C.dark&&Hg(C,y,void 0,"dark");let S={defaultColorScheme:p,...T,cssVarPrefix:i,colorSchemeSelector:a,rootSelector:l,getCssVar:m,colorSchemes:C,font:{...FH(T.typography),...T.font},spacing:iW(u.spacing)};Object.keys(S.colorSchemes).forEach(F=>{const M=S.colorSchemes[F].palette,j=z=>{const L=z.split("-"),A=L[1],_=L[2];return m(z,M[A][_])};if(M.mode==="light"&&(xe(M.common,"background","#fff"),xe(M.common,"onBackground","#000")),M.mode==="dark"&&(xe(M.common,"background","#000"),xe(M.common,"onBackground","#fff")),oW(M,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),M.mode==="light"){xe(M.Alert,"errorColor",Lt(M.error.light,.6)),xe(M.Alert,"infoColor",Lt(M.info.light,.6)),xe(M.Alert,"successColor",Lt(M.success.light,.6)),xe(M.Alert,"warningColor",Lt(M.warning.light,.6)),xe(M.Alert,"errorFilledBg",j("palette-error-main")),xe(M.Alert,"infoFilledBg",j("palette-info-main")),xe(M.Alert,"successFilledBg",j("palette-success-main")),xe(M.Alert,"warningFilledBg",j("palette-warning-main")),xe(M.Alert,"errorFilledColor",jo(()=>M.getContrastText(M.error.main))),xe(M.Alert,"infoFilledColor",jo(()=>M.getContrastText(M.info.main))),xe(M.Alert,"successFilledColor",jo(()=>M.getContrastText(M.success.main))),xe(M.Alert,"warningFilledColor",jo(()=>M.getContrastText(M.warning.main))),xe(M.Alert,"errorStandardBg",Bt(M.error.light,.9)),xe(M.Alert,"infoStandardBg",Bt(M.info.light,.9)),xe(M.Alert,"successStandardBg",Bt(M.success.light,.9)),xe(M.Alert,"warningStandardBg",Bt(M.warning.light,.9)),xe(M.Alert,"errorIconColor",j("palette-error-main")),xe(M.Alert,"infoIconColor",j("palette-info-main")),xe(M.Alert,"successIconColor",j("palette-success-main")),xe(M.Alert,"warningIconColor",j("palette-warning-main")),xe(M.AppBar,"defaultBg",j("palette-grey-100")),xe(M.Avatar,"defaultBg",j("palette-grey-400")),xe(M.Button,"inheritContainedBg",j("palette-grey-300")),xe(M.Button,"inheritContainedHoverBg",j("palette-grey-A100")),xe(M.Chip,"defaultBorder",j("palette-grey-400")),xe(M.Chip,"defaultAvatarColor",j("palette-grey-700")),xe(M.Chip,"defaultIconColor",j("palette-grey-700")),xe(M.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),xe(M.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),xe(M.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),xe(M.LinearProgress,"primaryBg",Bt(M.primary.main,.62)),xe(M.LinearProgress,"secondaryBg",Bt(M.secondary.main,.62)),xe(M.LinearProgress,"errorBg",Bt(M.error.main,.62)),xe(M.LinearProgress,"infoBg",Bt(M.info.main,.62)),xe(M.LinearProgress,"successBg",Bt(M.success.main,.62)),xe(M.LinearProgress,"warningBg",Bt(M.warning.main,.62)),xe(M.Skeleton,"bg",`rgba(${j("palette-text-primaryChannel")} / 0.11)`),xe(M.Slider,"primaryTrack",Bt(M.primary.main,.62)),xe(M.Slider,"secondaryTrack",Bt(M.secondary.main,.62)),xe(M.Slider,"errorTrack",Bt(M.error.main,.62)),xe(M.Slider,"infoTrack",Bt(M.info.main,.62)),xe(M.Slider,"successTrack",Bt(M.success.main,.62)),xe(M.Slider,"warningTrack",Bt(M.warning.main,.62));const z=Yd(M.background.default,.8);xe(M.SnackbarContent,"bg",z),xe(M.SnackbarContent,"color",jo(()=>M.getContrastText(z))),xe(M.SpeedDialAction,"fabHoverBg",Yd(M.background.paper,.15)),xe(M.StepConnector,"border",j("palette-grey-400")),xe(M.StepContent,"border",j("palette-grey-400")),xe(M.Switch,"defaultColor",j("palette-common-white")),xe(M.Switch,"defaultDisabledColor",j("palette-grey-100")),xe(M.Switch,"primaryDisabledColor",Bt(M.primary.main,.62)),xe(M.Switch,"secondaryDisabledColor",Bt(M.secondary.main,.62)),xe(M.Switch,"errorDisabledColor",Bt(M.error.main,.62)),xe(M.Switch,"infoDisabledColor",Bt(M.info.main,.62)),xe(M.Switch,"successDisabledColor",Bt(M.success.main,.62)),xe(M.Switch,"warningDisabledColor",Bt(M.warning.main,.62)),xe(M.TableCell,"border",Bt(Kd(M.divider,1),.88)),xe(M.Tooltip,"bg",Kd(M.grey[700],.92))}if(M.mode==="dark"){xe(M.Alert,"errorColor",Bt(M.error.light,.6)),xe(M.Alert,"infoColor",Bt(M.info.light,.6)),xe(M.Alert,"successColor",Bt(M.success.light,.6)),xe(M.Alert,"warningColor",Bt(M.warning.light,.6)),xe(M.Alert,"errorFilledBg",j("palette-error-dark")),xe(M.Alert,"infoFilledBg",j("palette-info-dark")),xe(M.Alert,"successFilledBg",j("palette-success-dark")),xe(M.Alert,"warningFilledBg",j("palette-warning-dark")),xe(M.Alert,"errorFilledColor",jo(()=>M.getContrastText(M.error.dark))),xe(M.Alert,"infoFilledColor",jo(()=>M.getContrastText(M.info.dark))),xe(M.Alert,"successFilledColor",jo(()=>M.getContrastText(M.success.dark))),xe(M.Alert,"warningFilledColor",jo(()=>M.getContrastText(M.warning.dark))),xe(M.Alert,"errorStandardBg",Lt(M.error.light,.9)),xe(M.Alert,"infoStandardBg",Lt(M.info.light,.9)),xe(M.Alert,"successStandardBg",Lt(M.success.light,.9)),xe(M.Alert,"warningStandardBg",Lt(M.warning.light,.9)),xe(M.Alert,"errorIconColor",j("palette-error-main")),xe(M.Alert,"infoIconColor",j("palette-info-main")),xe(M.Alert,"successIconColor",j("palette-success-main")),xe(M.Alert,"warningIconColor",j("palette-warning-main")),xe(M.AppBar,"defaultBg",j("palette-grey-900")),xe(M.AppBar,"darkBg",j("palette-background-paper")),xe(M.AppBar,"darkColor",j("palette-text-primary")),xe(M.Avatar,"defaultBg",j("palette-grey-600")),xe(M.Button,"inheritContainedBg",j("palette-grey-800")),xe(M.Button,"inheritContainedHoverBg",j("palette-grey-700")),xe(M.Chip,"defaultBorder",j("palette-grey-700")),xe(M.Chip,"defaultAvatarColor",j("palette-grey-300")),xe(M.Chip,"defaultIconColor",j("palette-grey-300")),xe(M.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),xe(M.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),xe(M.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),xe(M.LinearProgress,"primaryBg",Lt(M.primary.main,.5)),xe(M.LinearProgress,"secondaryBg",Lt(M.secondary.main,.5)),xe(M.LinearProgress,"errorBg",Lt(M.error.main,.5)),xe(M.LinearProgress,"infoBg",Lt(M.info.main,.5)),xe(M.LinearProgress,"successBg",Lt(M.success.main,.5)),xe(M.LinearProgress,"warningBg",Lt(M.warning.main,.5)),xe(M.Skeleton,"bg",`rgba(${j("palette-text-primaryChannel")} / 0.13)`),xe(M.Slider,"primaryTrack",Lt(M.primary.main,.5)),xe(M.Slider,"secondaryTrack",Lt(M.secondary.main,.5)),xe(M.Slider,"errorTrack",Lt(M.error.main,.5)),xe(M.Slider,"infoTrack",Lt(M.info.main,.5)),xe(M.Slider,"successTrack",Lt(M.success.main,.5)),xe(M.Slider,"warningTrack",Lt(M.warning.main,.5));const z=Yd(M.background.default,.98);xe(M.SnackbarContent,"bg",z),xe(M.SnackbarContent,"color",jo(()=>M.getContrastText(z))),xe(M.SpeedDialAction,"fabHoverBg",Yd(M.background.paper,.15)),xe(M.StepConnector,"border",j("palette-grey-600")),xe(M.StepContent,"border",j("palette-grey-600")),xe(M.Switch,"defaultColor",j("palette-grey-300")),xe(M.Switch,"defaultDisabledColor",j("palette-grey-600")),xe(M.Switch,"primaryDisabledColor",Lt(M.primary.main,.55)),xe(M.Switch,"secondaryDisabledColor",Lt(M.secondary.main,.55)),xe(M.Switch,"errorDisabledColor",Lt(M.error.main,.55)),xe(M.Switch,"infoDisabledColor",Lt(M.info.main,.55)),xe(M.Switch,"successDisabledColor",Lt(M.success.main,.55)),xe(M.Switch,"warningDisabledColor",Lt(M.warning.main,.55)),xe(M.TableCell,"border",Lt(Kd(M.divider,1),.68)),xe(M.Tooltip,"bg",Kd(M.grey[700],.92))}gi(M.background,"default"),gi(M.background,"paper"),gi(M.common,"background"),gi(M.common,"onBackground"),gi(M,"divider"),Object.keys(M).forEach(z=>{const L=M[z];z!=="tonalOffset"&&L&&typeof L=="object"&&(L.main&&xe(M[z],"mainChannel",Dc(Ac(L.main))),L.light&&xe(M[z],"lightChannel",Dc(Ac(L.light))),L.dark&&xe(M[z],"darkChannel",Dc(Ac(L.dark))),L.contrastText&&xe(M[z],"contrastTextChannel",Dc(Ac(L.contrastText))),z==="text"&&(gi(M[z],"primary"),gi(M[z],"secondary")),z==="action"&&(L.active&&gi(M[z],"active"),L.selected&&gi(M[z],"selected")))})}),S=e.reduce((F,M)=>Vn(F,M),S);const O={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:s,getSelector:rW(S)},{vars:R,generateThemeVars:P,generateStyleSheets:$}=SH(S,O);return S.vars=R,Object.entries(S.colorSchemes[S.defaultColorScheme]).forEach(([F,M])=>{S[F]=M}),S.generateThemeVars=P,S.generateStyleSheets=$,S.generateSpacing=function(){return nM(u.spacing,fh(this))},S.getColorSchemeSelector=TH(a),S.spacing=S.generateSpacing(),S.shouldSkipGeneratingVar=s,S.unstable_sxConfig={...Au,...u==null?void 0:u.unstable_sxConfig},S.unstable_sx=function(M){return ya({sx:M,theme:this})},S.toRuntimeSource=yM,S}function HC(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:A0({...n===!0?{}:n.palette,mode:e})})}function xM(t={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:i=n==null?void 0:n.mode,...s}=t,a=i||"light",l=o==null?void 0:o[a],u={...o,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in t))return xb(t,...e);let f=n;"palette"in t||u[a]&&(u[a]!==!0?f=u[a].palette:a==="dark"&&(f={mode:"dark"}));const p=xb({...t,palette:f},...e);return p.defaultColorScheme=a,p.colorSchemes=u,p.palette.mode==="light"&&(p.colorSchemes.light={...u.light!==!0&&u.light,palette:p.palette},HC(p,"dark",u.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:p.palette},HC(p,"light",u.light)),p}return!n&&!("light"in u)&&a==="light"&&(u.light=!0),aW({...s,colorSchemes:u,defaultColorScheme:a,...typeof r!="boolean"&&r},...e)}const wh=xM(),Ul="$$material";function Mo(){const t=vh(wh);return process.env.NODE_ENV!=="production"&&D.useDebugValue(t),t[Ul]||t}function wM(t){return g.jsx(oM,{...t,defaultTheme:wh,themeId:Ul})}process.env.NODE_ENV!=="production"&&(wM.propTypes={styles:c.oneOfType([c.array,c.func,c.number,c.object,c.string,c.bool])});function CM(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const go=t=>CM(t)&&t!=="classes",ne=aM({themeId:Ul,defaultTheme:wh,rootShouldForwardProp:go});function lW(t){return function(n){return g.jsx(wM,{styles:typeof t=="function"?r=>t({theme:r,...n}):t})}}function cW(){return R0}const vt=vH;process.env.NODE_ENV!=="production"&&(c.node,c.object.isRequired);function mt(t){return bH(t)}function uW(t){return qe("MuiSvgIcon",t)}const WC=He("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]),dW=t=>{const{color:e,fontSize:n,classes:r}=t,o={root:["root",e!=="inherit"&&`color${Pe(e)}`,`fontSize${Pe(n)}`]};return Ue(o,uW,r)},fW=ne("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Pe(n.color)}`],e[`fontSize${Pe(n.fontSize)}`]]}})(vt(({theme:t})=>{var e,n,r,o,i,s,a,l,u,f,p,m,b,v;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(e=t.transitions)==null?void 0:e.create)==null?void 0:o.call(e,"fill",{duration:(r=(n=(t.vars??t).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:y=>!y.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(i=t.typography)==null?void 0:i.pxToRem)==null?void 0:s.call(i,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=t.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((f=(u=t.typography)==null?void 0:u.pxToRem)==null?void 0:f.call(u,35))||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter(([,y])=>y&&y.main).map(([y])=>{var x,C;return{props:{color:y},style:{color:(C=(x=(t.vars??t).palette)==null?void 0:x[y])==null?void 0:C.main}}}),{props:{color:"action"},style:{color:(m=(p=(t.vars??t).palette)==null?void 0:p.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(v=(b=(t.vars??t).palette)==null?void 0:b.action)==null?void 0:v.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Qf=D.forwardRef(function(e,n){const r=mt({props:e,name:"MuiSvgIcon"}),{children:o,className:i,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:f=!1,titleAccess:p,viewBox:m="0 0 24 24",...b}=r,v=D.isValidElement(o)&&o.type==="svg",y={...r,color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:f,viewBox:m,hasSvgAsChild:v},x={};f||(x.viewBox=m);const C=dW(y);return g.jsxs(fW,{as:a,className:ye(C.root,i),focusable:"false",color:u,"aria-hidden":p?void 0:!0,role:p?"img":void 0,ref:n,...x,...b,...v&&o.props,ownerState:y,children:[v?o.props.children:o,p?g.jsx("title",{children:p}):null]})});process.env.NODE_ENV!=="production"&&(Qf.propTypes={children:c.node,classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),c.string]),component:c.elementType,fontSize:c.oneOfType([c.oneOf(["inherit","large","medium","small"]),c.string]),htmlColor:c.string,inheritViewBox:c.bool,shapeRendering:c.string,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),titleAccess:c.string,viewBox:c.string});Qf.muiName="SvgIcon";function Ne(t,e){function n(r,o){return g.jsx(Qf,{"data-testid":`${e}Icon`,ref:o,...r,children:t})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${e}Icon`),n.muiName=Qf.muiName,D.memo(D.forwardRef(n))}function pW(t,e){if(!t)return e;if(typeof t=="function"||typeof e=="function")return o=>{const i=typeof e=="function"?e(o):e,s=typeof t=="function"?t({...o,...i}):t,a=ye(o==null?void 0:o.className,i==null?void 0:i.className,s==null?void 0:s.className);return{...i,...s,...!!a&&{className:a},...(i==null?void 0:i.style)&&(s==null?void 0:s.style)&&{style:{...i.style,...s.style}},...(i==null?void 0:i.sx)&&(s==null?void 0:s.sx)&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(s.sx)?s.sx:[s.sx]]}}};const n=e,r=ye(n==null?void 0:n.className,t==null?void 0:t.className);return{...e,...t,...!!r&&{className:r},...(n==null?void 0:n.style)&&(t==null?void 0:t.style)&&{style:{...n.style,...t.style}},...(n==null?void 0:n.sx)&&(t==null?void 0:t.sx)&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(t.sx)?t.sx:[t.sx]]}}}const SM=Ne(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),P0=({icon:t,offset:e=".2rem",...n})=>g.jsx(V.Box,{component:"span",sx:{display:"inline-flex",alignItems:"center",position:"relative",mr:.5,top:e},children:g.jsx(t,{fontSize:"inherit",...n})}),_r=t=>{const{name:e,id:n,className:r,errorMode:o="normal"}=t,[i,s,a]=Ht.useField(e),{error:l}=s;if(o!=="hidden"&&!(o==="collapse"&&!l))return g.jsxs(V.Typography,{id:n,"data-testid":`test-${n}`,variant:"caption",display:"block",color:"error",style:{visibility:l?"visible":"hidden"},className:r,fontSize:".9rem",children:[g.jsx(P0,{icon:SM,offset:".15rem"}),l]})},TM=J.createContext(!1),kM=({readOnly:t=!0,children:e})=>g.jsx(TM.Provider,{value:t,children:e}),Ra=()=>J.useContext(TM),EM=J.createContext({showDiff:!1,getPreviousValue:()=>{},getCurrentValue:()=>{}}),OM=({showDiff:t=!0,previousSnapshot:e=null,currentSnapshot:n=null,children:r})=>{const o=(s,a)=>UC(e,s,a),i=(s,a)=>UC(n,s,a);return g.jsx(EM.Provider,{value:{showDiff:t,getPreviousValue:o,getCurrentValue:i},children:g.jsx(kM,{children:r})})},UC=(t,e,n)=>(e?e.replace(/\[(\d+)\]/g,".$1").split(".").reduce((r,o)=>r==null?void 0:r[o],t):t)??n,Ia=()=>J.useContext(EM);function Jn(t){this.content=t}Jn.prototype={constructor:Jn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Jn(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Jn(n)},addToStart:function(t,e){return new Jn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Jn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new Jn(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Jn.from(t),t.size?new Jn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Jn.from(t),t.size?new Jn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Jn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Jn.from=function(t){if(t instanceof Jn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Jn(e)};function MM(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=MM(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function _M(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let u=0,f=Math.min(s.text.length,a.text.length);for(;u<f&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let u=_M(s.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class Oe{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let f=a+1;l.nodesBetween(Math.max(0,e-f),Math.min(l.content.size,n-f),r,o+f)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new Oe(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new Oe(r,o)}cutByIndex(e,n){return e==n?Oe.empty:e==0&&n==this.content.length?this:new Oe(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new Oe(o,i)}addToStart(e){return new Oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Oe(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return MM(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return _M(this,e,n,r)}findIndex(e){if(e==0)return Gd(0,e);if(e==this.size)return Gd(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),i=r+o.nodeSize;if(i>=e)return i==e?Gd(n+1,i):Gd(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Oe.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new Oe(n||e,r)}static from(e){if(!e)return Oe.empty;if(e instanceof Oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Oe.empty=new Oe([],0);const Wg={index:0,offset:0};function Gd(t,e){return Wg.index=t,Wg.offset=e,Wg}function ep(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ep(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ep(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Ft=class Cb{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ep(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cb.none;if(e instanceof Cb)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Ft.none=[];class tp extends Error{}class je{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=IM(this.content,e+this.openStart,n);return r&&new je(r,this.openStart,this.openEnd)}removeBetween(e,n){return new je(RM(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return je.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new je(Oe.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new je(e,r,o)}}je.empty=new je(Oe.empty,0,0);function RM(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(RM(i.content,e-o-1,n-o-1)))}function IM(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=IM(s.content,e-i-1,n,s);return a&&t.replaceChild(o,s.copy(a))}function hW(t,e,n){if(n.openStart>t.depth)throw new tp("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new tp("Inconsistent open depths");return DM(t,e,n,0)}function DM(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=DM(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return ua(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=mW(n,t);return ua(i,PM(t,s,a,e,r))}else return ua(i,np(t,e,r))}function AM(t,e){if(!e.type.compatibleContent(t.type))throw new tp("Cannot join "+e.type.name+" onto "+t.type.name)}function Sb(t,e,n){let r=t.node(n);return AM(r,e.node(n)),r}function ca(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Wc(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(ca(t.nodeAfter,r),i++));for(let a=i;a<s;a++)ca(o.child(a),r);e&&e.depth==n&&e.textOffset&&ca(e.nodeBefore,r)}function ua(t,e){return t.type.checkContent(e),t.copy(e)}function PM(t,e,n,r,o){let i=t.depth>o&&Sb(t,e,o+1),s=r.depth>o&&Sb(n,r,o+1),a=[];return Wc(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(AM(i,s),ca(ua(i,PM(t,e,n,r,o+1)),a)):(i&&ca(ua(i,np(t,e,o+1)),a),Wc(e,n,o,a),s&&ca(ua(s,np(n,r,o+1)),a)),Wc(r,null,o,a),new Oe(a)}function np(t,e,n){let r=[];if(Wc(null,t,n,r),t.depth>n){let o=Sb(t,e,n+1);ca(ua(o,np(t,e,n+1)),r)}return Wc(e,null,n,r),new Oe(r)}function mW(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(Oe.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class uu{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ft.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new rp(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),u=i-l;if(r.push(s,a,o+l),!u||(s=s.child(a),s.isText))break;i=u-1,o+=l+1}return new uu(n,r,i)}static resolveCached(e,n){let r=qC.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else qC.set(e,r=new gW);let o=r.elts[r.i]=uu.resolve(e,n);return r.i=(r.i+1)%yW,o}}class gW{constructor(){this.elts=[],this.i=0}}const yW=12,qC=new WeakMap;class rp{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const bW=Object.create(null);let Ii=class Tb{constructor(e,n,r,o=Ft.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||Oe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ep(this.attrs,n||e.defaultAttrs||bW)&&Ft.sameSet(this.marks,r||Ft.none)}copy(e=null){return e==this.content?this:new Tb(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Tb(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return je.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),u=o.node(s).content.cut(o.pos-a,i.pos-a);return new je(u,o.depth-s,i.depth-s)}replace(e,n,r){return hW(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return uu.resolveCached(this,e)}resolveNoCache(e){return uu.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),NM(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Oe.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ft.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ft.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=Oe.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Ii.prototype.text=void 0;class op extends Ii{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):NM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new op(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new op(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function NM(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class va{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new vW(e,n);if(r.next==null)return va.empty;let o=$M(r);r.next&&r.err("Unexpected trailing text");let i=EW(kW(o));return OW(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return Oe.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:f,next:p}=s.next[u];if(!(f.isText||f.hasRequiredAttrs())&&o.indexOf(p)==-1){o.push(p);let m=i(p,a.concat(f));if(m)return m}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
79
+ To suppress this warning, you need to explicitly provide the \`palette.${e}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function iW(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const jo=t=>{try{return t()}catch{}},sW=(t="mui")=>xH(t);function Hg(t,e,n,r){if(!e)return;e=e===!0?{}:e;const o=r==="dark"?"dark":"light";if(!n){t[r]=eW({...e,palette:{mode:o,...e==null?void 0:e.palette}});return}const{palette:i,...s}=xb({...n,palette:{mode:o,...e==null?void 0:e.palette}});return t[r]={...e,palette:i,opacity:{...bM(o),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||vM(o)},s}function aW(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:s=tW,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...u}=t,f=Object.keys(n)[0],p=r||(n.light&&f!=="light"?"light":f),m=sW(i),{[p]:b,light:v,dark:y,...x}=n,C={...x};let k=b;if((p==="dark"&&!("dark"in n)||p==="light"&&!("light"in n))&&(k=!0),!k)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${p}\` option is either missing or invalid.`:Go(21,p));const T=Hg(C,k,u,p);v&&!C.light&&Hg(C,v,void 0,"light"),y&&!C.dark&&Hg(C,y,void 0,"dark");let S={defaultColorScheme:p,...T,cssVarPrefix:i,colorSchemeSelector:a,rootSelector:l,getCssVar:m,colorSchemes:C,font:{...FH(T.typography),...T.font},spacing:iW(u.spacing)};Object.keys(S.colorSchemes).forEach(F=>{const M=S.colorSchemes[F].palette,j=z=>{const L=z.split("-"),A=L[1],_=L[2];return m(z,M[A][_])};if(M.mode==="light"&&(xe(M.common,"background","#fff"),xe(M.common,"onBackground","#000")),M.mode==="dark"&&(xe(M.common,"background","#000"),xe(M.common,"onBackground","#fff")),oW(M,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),M.mode==="light"){xe(M.Alert,"errorColor",Lt(M.error.light,.6)),xe(M.Alert,"infoColor",Lt(M.info.light,.6)),xe(M.Alert,"successColor",Lt(M.success.light,.6)),xe(M.Alert,"warningColor",Lt(M.warning.light,.6)),xe(M.Alert,"errorFilledBg",j("palette-error-main")),xe(M.Alert,"infoFilledBg",j("palette-info-main")),xe(M.Alert,"successFilledBg",j("palette-success-main")),xe(M.Alert,"warningFilledBg",j("palette-warning-main")),xe(M.Alert,"errorFilledColor",jo(()=>M.getContrastText(M.error.main))),xe(M.Alert,"infoFilledColor",jo(()=>M.getContrastText(M.info.main))),xe(M.Alert,"successFilledColor",jo(()=>M.getContrastText(M.success.main))),xe(M.Alert,"warningFilledColor",jo(()=>M.getContrastText(M.warning.main))),xe(M.Alert,"errorStandardBg",Bt(M.error.light,.9)),xe(M.Alert,"infoStandardBg",Bt(M.info.light,.9)),xe(M.Alert,"successStandardBg",Bt(M.success.light,.9)),xe(M.Alert,"warningStandardBg",Bt(M.warning.light,.9)),xe(M.Alert,"errorIconColor",j("palette-error-main")),xe(M.Alert,"infoIconColor",j("palette-info-main")),xe(M.Alert,"successIconColor",j("palette-success-main")),xe(M.Alert,"warningIconColor",j("palette-warning-main")),xe(M.AppBar,"defaultBg",j("palette-grey-100")),xe(M.Avatar,"defaultBg",j("palette-grey-400")),xe(M.Button,"inheritContainedBg",j("palette-grey-300")),xe(M.Button,"inheritContainedHoverBg",j("palette-grey-A100")),xe(M.Chip,"defaultBorder",j("palette-grey-400")),xe(M.Chip,"defaultAvatarColor",j("palette-grey-700")),xe(M.Chip,"defaultIconColor",j("palette-grey-700")),xe(M.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),xe(M.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),xe(M.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),xe(M.LinearProgress,"primaryBg",Bt(M.primary.main,.62)),xe(M.LinearProgress,"secondaryBg",Bt(M.secondary.main,.62)),xe(M.LinearProgress,"errorBg",Bt(M.error.main,.62)),xe(M.LinearProgress,"infoBg",Bt(M.info.main,.62)),xe(M.LinearProgress,"successBg",Bt(M.success.main,.62)),xe(M.LinearProgress,"warningBg",Bt(M.warning.main,.62)),xe(M.Skeleton,"bg",`rgba(${j("palette-text-primaryChannel")} / 0.11)`),xe(M.Slider,"primaryTrack",Bt(M.primary.main,.62)),xe(M.Slider,"secondaryTrack",Bt(M.secondary.main,.62)),xe(M.Slider,"errorTrack",Bt(M.error.main,.62)),xe(M.Slider,"infoTrack",Bt(M.info.main,.62)),xe(M.Slider,"successTrack",Bt(M.success.main,.62)),xe(M.Slider,"warningTrack",Bt(M.warning.main,.62));const z=Yd(M.background.default,.8);xe(M.SnackbarContent,"bg",z),xe(M.SnackbarContent,"color",jo(()=>M.getContrastText(z))),xe(M.SpeedDialAction,"fabHoverBg",Yd(M.background.paper,.15)),xe(M.StepConnector,"border",j("palette-grey-400")),xe(M.StepContent,"border",j("palette-grey-400")),xe(M.Switch,"defaultColor",j("palette-common-white")),xe(M.Switch,"defaultDisabledColor",j("palette-grey-100")),xe(M.Switch,"primaryDisabledColor",Bt(M.primary.main,.62)),xe(M.Switch,"secondaryDisabledColor",Bt(M.secondary.main,.62)),xe(M.Switch,"errorDisabledColor",Bt(M.error.main,.62)),xe(M.Switch,"infoDisabledColor",Bt(M.info.main,.62)),xe(M.Switch,"successDisabledColor",Bt(M.success.main,.62)),xe(M.Switch,"warningDisabledColor",Bt(M.warning.main,.62)),xe(M.TableCell,"border",Bt(Kd(M.divider,1),.88)),xe(M.Tooltip,"bg",Kd(M.grey[700],.92))}if(M.mode==="dark"){xe(M.Alert,"errorColor",Bt(M.error.light,.6)),xe(M.Alert,"infoColor",Bt(M.info.light,.6)),xe(M.Alert,"successColor",Bt(M.success.light,.6)),xe(M.Alert,"warningColor",Bt(M.warning.light,.6)),xe(M.Alert,"errorFilledBg",j("palette-error-dark")),xe(M.Alert,"infoFilledBg",j("palette-info-dark")),xe(M.Alert,"successFilledBg",j("palette-success-dark")),xe(M.Alert,"warningFilledBg",j("palette-warning-dark")),xe(M.Alert,"errorFilledColor",jo(()=>M.getContrastText(M.error.dark))),xe(M.Alert,"infoFilledColor",jo(()=>M.getContrastText(M.info.dark))),xe(M.Alert,"successFilledColor",jo(()=>M.getContrastText(M.success.dark))),xe(M.Alert,"warningFilledColor",jo(()=>M.getContrastText(M.warning.dark))),xe(M.Alert,"errorStandardBg",Lt(M.error.light,.9)),xe(M.Alert,"infoStandardBg",Lt(M.info.light,.9)),xe(M.Alert,"successStandardBg",Lt(M.success.light,.9)),xe(M.Alert,"warningStandardBg",Lt(M.warning.light,.9)),xe(M.Alert,"errorIconColor",j("palette-error-main")),xe(M.Alert,"infoIconColor",j("palette-info-main")),xe(M.Alert,"successIconColor",j("palette-success-main")),xe(M.Alert,"warningIconColor",j("palette-warning-main")),xe(M.AppBar,"defaultBg",j("palette-grey-900")),xe(M.AppBar,"darkBg",j("palette-background-paper")),xe(M.AppBar,"darkColor",j("palette-text-primary")),xe(M.Avatar,"defaultBg",j("palette-grey-600")),xe(M.Button,"inheritContainedBg",j("palette-grey-800")),xe(M.Button,"inheritContainedHoverBg",j("palette-grey-700")),xe(M.Chip,"defaultBorder",j("palette-grey-700")),xe(M.Chip,"defaultAvatarColor",j("palette-grey-300")),xe(M.Chip,"defaultIconColor",j("palette-grey-300")),xe(M.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),xe(M.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),xe(M.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),xe(M.LinearProgress,"primaryBg",Lt(M.primary.main,.5)),xe(M.LinearProgress,"secondaryBg",Lt(M.secondary.main,.5)),xe(M.LinearProgress,"errorBg",Lt(M.error.main,.5)),xe(M.LinearProgress,"infoBg",Lt(M.info.main,.5)),xe(M.LinearProgress,"successBg",Lt(M.success.main,.5)),xe(M.LinearProgress,"warningBg",Lt(M.warning.main,.5)),xe(M.Skeleton,"bg",`rgba(${j("palette-text-primaryChannel")} / 0.13)`),xe(M.Slider,"primaryTrack",Lt(M.primary.main,.5)),xe(M.Slider,"secondaryTrack",Lt(M.secondary.main,.5)),xe(M.Slider,"errorTrack",Lt(M.error.main,.5)),xe(M.Slider,"infoTrack",Lt(M.info.main,.5)),xe(M.Slider,"successTrack",Lt(M.success.main,.5)),xe(M.Slider,"warningTrack",Lt(M.warning.main,.5));const z=Yd(M.background.default,.98);xe(M.SnackbarContent,"bg",z),xe(M.SnackbarContent,"color",jo(()=>M.getContrastText(z))),xe(M.SpeedDialAction,"fabHoverBg",Yd(M.background.paper,.15)),xe(M.StepConnector,"border",j("palette-grey-600")),xe(M.StepContent,"border",j("palette-grey-600")),xe(M.Switch,"defaultColor",j("palette-grey-300")),xe(M.Switch,"defaultDisabledColor",j("palette-grey-600")),xe(M.Switch,"primaryDisabledColor",Lt(M.primary.main,.55)),xe(M.Switch,"secondaryDisabledColor",Lt(M.secondary.main,.55)),xe(M.Switch,"errorDisabledColor",Lt(M.error.main,.55)),xe(M.Switch,"infoDisabledColor",Lt(M.info.main,.55)),xe(M.Switch,"successDisabledColor",Lt(M.success.main,.55)),xe(M.Switch,"warningDisabledColor",Lt(M.warning.main,.55)),xe(M.TableCell,"border",Lt(Kd(M.divider,1),.68)),xe(M.Tooltip,"bg",Kd(M.grey[700],.92))}gi(M.background,"default"),gi(M.background,"paper"),gi(M.common,"background"),gi(M.common,"onBackground"),gi(M,"divider"),Object.keys(M).forEach(z=>{const L=M[z];z!=="tonalOffset"&&L&&typeof L=="object"&&(L.main&&xe(M[z],"mainChannel",Dc(Ac(L.main))),L.light&&xe(M[z],"lightChannel",Dc(Ac(L.light))),L.dark&&xe(M[z],"darkChannel",Dc(Ac(L.dark))),L.contrastText&&xe(M[z],"contrastTextChannel",Dc(Ac(L.contrastText))),z==="text"&&(gi(M[z],"primary"),gi(M[z],"secondary")),z==="action"&&(L.active&&gi(M[z],"active"),L.selected&&gi(M[z],"selected")))})}),S=e.reduce((F,M)=>Vn(F,M),S);const O={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:s,getSelector:rW(S)},{vars:R,generateThemeVars:P,generateStyleSheets:$}=SH(S,O);return S.vars=R,Object.entries(S.colorSchemes[S.defaultColorScheme]).forEach(([F,M])=>{S[F]=M}),S.generateThemeVars=P,S.generateStyleSheets=$,S.generateSpacing=function(){return nM(u.spacing,fh(this))},S.getColorSchemeSelector=TH(a),S.spacing=S.generateSpacing(),S.shouldSkipGeneratingVar=s,S.unstable_sxConfig={...Au,...u==null?void 0:u.unstable_sxConfig},S.unstable_sx=function(M){return ya({sx:M,theme:this})},S.toRuntimeSource=yM,S}function HC(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:A0({...n===!0?{}:n.palette,mode:e})})}function xM(t={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:i=n==null?void 0:n.mode,...s}=t,a=i||"light",l=o==null?void 0:o[a],u={...o,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in t))return xb(t,...e);let f=n;"palette"in t||u[a]&&(u[a]!==!0?f=u[a].palette:a==="dark"&&(f={mode:"dark"}));const p=xb({...t,palette:f},...e);return p.defaultColorScheme=a,p.colorSchemes=u,p.palette.mode==="light"&&(p.colorSchemes.light={...u.light!==!0&&u.light,palette:p.palette},HC(p,"dark",u.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:p.palette},HC(p,"light",u.light)),p}return!n&&!("light"in u)&&a==="light"&&(u.light=!0),aW({...s,colorSchemes:u,defaultColorScheme:a,...typeof r!="boolean"&&r},...e)}const wh=xM(),Ul="$$material";function Mo(){const t=vh(wh);return process.env.NODE_ENV!=="production"&&D.useDebugValue(t),t[Ul]||t}function wM(t){return g.jsx(oM,{...t,defaultTheme:wh,themeId:Ul})}process.env.NODE_ENV!=="production"&&(wM.propTypes={styles:c.oneOfType([c.array,c.func,c.number,c.object,c.string,c.bool])});function CM(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const go=t=>CM(t)&&t!=="classes",ne=aM({themeId:Ul,defaultTheme:wh,rootShouldForwardProp:go});function lW(t){return function(n){return g.jsx(wM,{styles:typeof t=="function"?r=>t({theme:r,...n}):t})}}function cW(){return R0}const vt=vH;process.env.NODE_ENV!=="production"&&(c.node,c.object.isRequired);function mt(t){return bH(t)}function uW(t){return qe("MuiSvgIcon",t)}const WC=He("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]),dW=t=>{const{color:e,fontSize:n,classes:r}=t,o={root:["root",e!=="inherit"&&`color${Pe(e)}`,`fontSize${Pe(n)}`]};return Ue(o,uW,r)},fW=ne("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Pe(n.color)}`],e[`fontSize${Pe(n.fontSize)}`]]}})(vt(({theme:t})=>{var e,n,r,o,i,s,a,l,u,f,p,m,b,v;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(e=t.transitions)==null?void 0:e.create)==null?void 0:o.call(e,"fill",{duration:(r=(n=(t.vars??t).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:y=>!y.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(i=t.typography)==null?void 0:i.pxToRem)==null?void 0:s.call(i,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=t.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((f=(u=t.typography)==null?void 0:u.pxToRem)==null?void 0:f.call(u,35))||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter(([,y])=>y&&y.main).map(([y])=>{var x,C;return{props:{color:y},style:{color:(C=(x=(t.vars??t).palette)==null?void 0:x[y])==null?void 0:C.main}}}),{props:{color:"action"},style:{color:(m=(p=(t.vars??t).palette)==null?void 0:p.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(v=(b=(t.vars??t).palette)==null?void 0:b.action)==null?void 0:v.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Qf=D.forwardRef(function(e,n){const r=mt({props:e,name:"MuiSvgIcon"}),{children:o,className:i,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:f=!1,titleAccess:p,viewBox:m="0 0 24 24",...b}=r,v=D.isValidElement(o)&&o.type==="svg",y={...r,color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:f,viewBox:m,hasSvgAsChild:v},x={};f||(x.viewBox=m);const C=dW(y);return g.jsxs(fW,{as:a,className:ye(C.root,i),focusable:"false",color:u,"aria-hidden":p?void 0:!0,role:p?"img":void 0,ref:n,...x,...b,...v&&o.props,ownerState:y,children:[v?o.props.children:o,p?g.jsx("title",{children:p}):null]})});process.env.NODE_ENV!=="production"&&(Qf.propTypes={children:c.node,classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),c.string]),component:c.elementType,fontSize:c.oneOfType([c.oneOf(["inherit","large","medium","small"]),c.string]),htmlColor:c.string,inheritViewBox:c.bool,shapeRendering:c.string,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),titleAccess:c.string,viewBox:c.string});Qf.muiName="SvgIcon";function Ne(t,e){function n(r,o){return g.jsx(Qf,{"data-testid":`${e}Icon`,ref:o,...r,children:t})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${e}Icon`),n.muiName=Qf.muiName,D.memo(D.forwardRef(n))}function pW(t,e){if(!t)return e;if(typeof t=="function"||typeof e=="function")return o=>{const i=typeof e=="function"?e(o):e,s=typeof t=="function"?t({...o,...i}):t,a=ye(o==null?void 0:o.className,i==null?void 0:i.className,s==null?void 0:s.className);return{...i,...s,...!!a&&{className:a},...(i==null?void 0:i.style)&&(s==null?void 0:s.style)&&{style:{...i.style,...s.style}},...(i==null?void 0:i.sx)&&(s==null?void 0:s.sx)&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(s.sx)?s.sx:[s.sx]]}}};const n=e,r=ye(n==null?void 0:n.className,t==null?void 0:t.className);return{...e,...t,...!!r&&{className:r},...(n==null?void 0:n.style)&&(t==null?void 0:t.style)&&{style:{...n.style,...t.style}},...(n==null?void 0:n.sx)&&(t==null?void 0:t.sx)&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(t.sx)?t.sx:[t.sx]]}}}const SM=Ne(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),P0=({icon:t,offset:e=".2rem",...n})=>g.jsx(V.Box,{component:"span",sx:{display:"inline-flex",alignItems:"center",position:"relative",mr:.5,top:e},children:g.jsx(t,{fontSize:"inherit",...n})}),_r=t=>{const{name:e,id:n,className:r,errorMode:o="normal"}=t,[i,s,a]=Ht.useField(e),{error:l}=s;if(o!=="hidden"&&!(o==="collapse"&&!l))return g.jsxs(V.Typography,{id:n,"data-testid":`test-${n}`,variant:"caption",display:"block",color:"error",style:{visibility:l?"visible":"hidden"},className:r,fontSize:".9rem",children:[g.jsx(P0,{icon:SM,offset:".15rem"}),l]})},TM=J.createContext(!1),kM=({readOnly:t=!0,children:e})=>g.jsx(TM.Provider,{value:t,children:e}),Ra=()=>J.useContext(TM),EM=J.createContext({showDiff:!1,getPreviousValue:()=>{},getCurrentValue:()=>{}}),OM=({showDiff:t=!0,previousSnapshot:e=null,currentSnapshot:n=null,children:r})=>{const o=J.useCallback((a,l)=>UC(e,a,l),[e]),i=J.useCallback((a,l)=>UC(n,a,l),[n]),s=J.useMemo(()=>({showDiff:t,getPreviousValue:o,getCurrentValue:i}),[t,o,i]);return g.jsx(EM.Provider,{value:s,children:g.jsx(kM,{children:r})})},UC=(t,e,n)=>(e?e.replace(/\[(\d+)\]/g,".$1").split(".").reduce((r,o)=>r==null?void 0:r[o],t):t)??n,Ia=()=>J.useContext(EM);function Jn(t){this.content=t}Jn.prototype={constructor:Jn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Jn(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Jn(n)},addToStart:function(t,e){return new Jn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Jn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new Jn(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Jn.from(t),t.size?new Jn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Jn.from(t),t.size?new Jn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Jn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Jn.from=function(t){if(t instanceof Jn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Jn(e)};function MM(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=MM(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function _M(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let u=0,f=Math.min(s.text.length,a.text.length);for(;u<f&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let u=_M(s.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class Oe{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let f=a+1;l.nodesBetween(Math.max(0,e-f),Math.min(l.content.size,n-f),r,o+f)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new Oe(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new Oe(r,o)}cutByIndex(e,n){return e==n?Oe.empty:e==0&&n==this.content.length?this:new Oe(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new Oe(o,i)}addToStart(e){return new Oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Oe(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return MM(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return _M(this,e,n,r)}findIndex(e){if(e==0)return Gd(0,e);if(e==this.size)return Gd(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),i=r+o.nodeSize;if(i>=e)return i==e?Gd(n+1,i):Gd(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Oe.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new Oe(n||e,r)}static from(e){if(!e)return Oe.empty;if(e instanceof Oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Oe.empty=new Oe([],0);const Wg={index:0,offset:0};function Gd(t,e){return Wg.index=t,Wg.offset=e,Wg}function ep(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ep(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ep(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Ft=class Cb{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ep(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cb.none;if(e instanceof Cb)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Ft.none=[];class tp extends Error{}class je{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=IM(this.content,e+this.openStart,n);return r&&new je(r,this.openStart,this.openEnd)}removeBetween(e,n){return new je(RM(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return je.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new je(Oe.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new je(e,r,o)}}je.empty=new je(Oe.empty,0,0);function RM(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(RM(i.content,e-o-1,n-o-1)))}function IM(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=IM(s.content,e-i-1,n,s);return a&&t.replaceChild(o,s.copy(a))}function hW(t,e,n){if(n.openStart>t.depth)throw new tp("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new tp("Inconsistent open depths");return DM(t,e,n,0)}function DM(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=DM(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return ua(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=mW(n,t);return ua(i,PM(t,s,a,e,r))}else return ua(i,np(t,e,r))}function AM(t,e){if(!e.type.compatibleContent(t.type))throw new tp("Cannot join "+e.type.name+" onto "+t.type.name)}function Sb(t,e,n){let r=t.node(n);return AM(r,e.node(n)),r}function ca(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Wc(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(ca(t.nodeAfter,r),i++));for(let a=i;a<s;a++)ca(o.child(a),r);e&&e.depth==n&&e.textOffset&&ca(e.nodeBefore,r)}function ua(t,e){return t.type.checkContent(e),t.copy(e)}function PM(t,e,n,r,o){let i=t.depth>o&&Sb(t,e,o+1),s=r.depth>o&&Sb(n,r,o+1),a=[];return Wc(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(AM(i,s),ca(ua(i,PM(t,e,n,r,o+1)),a)):(i&&ca(ua(i,np(t,e,o+1)),a),Wc(e,n,o,a),s&&ca(ua(s,np(n,r,o+1)),a)),Wc(r,null,o,a),new Oe(a)}function np(t,e,n){let r=[];if(Wc(null,t,n,r),t.depth>n){let o=Sb(t,e,n+1);ca(ua(o,np(t,e,n+1)),r)}return Wc(e,null,n,r),new Oe(r)}function mW(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(Oe.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class uu{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ft.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new rp(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),u=i-l;if(r.push(s,a,o+l),!u||(s=s.child(a),s.isText))break;i=u-1,o+=l+1}return new uu(n,r,i)}static resolveCached(e,n){let r=qC.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else qC.set(e,r=new gW);let o=r.elts[r.i]=uu.resolve(e,n);return r.i=(r.i+1)%yW,o}}class gW{constructor(){this.elts=[],this.i=0}}const yW=12,qC=new WeakMap;class rp{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const bW=Object.create(null);let Ii=class Tb{constructor(e,n,r,o=Ft.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||Oe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ep(this.attrs,n||e.defaultAttrs||bW)&&Ft.sameSet(this.marks,r||Ft.none)}copy(e=null){return e==this.content?this:new Tb(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Tb(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return je.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),u=o.node(s).content.cut(o.pos-a,i.pos-a);return new je(u,o.depth-s,i.depth-s)}replace(e,n,r){return hW(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return uu.resolveCached(this,e)}resolveNoCache(e){return uu.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),NM(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Oe.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ft.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ft.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=Oe.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Ii.prototype.text=void 0;class op extends Ii{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):NM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new op(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new op(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function NM(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class va{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new vW(e,n);if(r.next==null)return va.empty;let o=$M(r);r.next&&r.err("Unexpected trailing text");let i=EW(kW(o));return OW(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return Oe.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:f,next:p}=s.next[u];if(!(f.isText||f.hasRequiredAttrs())&&o.indexOf(p)==-1){o.push(p);let m=i(p,a.concat(f));if(m)return m}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
80
80
  `)}}va.empty=new va(!0);class vW{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function $M(t){let e=[];do e.push(xW(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function xW(t){let e=[];do e.push(wW(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function wW(t){let e=TW(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=CW(t,e);else break;return e}function KC(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function CW(t,e){let n=KC(t),r=n;return t.eat(",")&&(t.next!="}"?r=KC(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function SW(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function TW(t){if(t.eat("(")){let e=$M(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=SW(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function kW(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(i(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=i(s.exprs[l],a);if(l==s.exprs.length-1)return u;o(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u<s.min;u++){let f=n();o(i(s.expr,l),f),l=f}if(s.max==-1)o(i(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let f=n();r(l,f),o(i(s.expr,l),f),l=f}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function jM(t,e){return e-t}function YC(t,e){let n=[];return r(e),n.sort(jM);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function EW(t){let e=Object.create(null);return n(YC(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let f=0;f<o.length;f++)o[f][0]==a&&(u=o[f][1]);YC(t,l).forEach(f=>{u||o.push([a,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let i=e[r.join(",")]=new va(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(jM);i.next.push({type:o[s][0],next:e[a.join(",")]||n(a)})}return i}}function OW(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:u}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(u)==-1&&r.push(u)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function LM(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function BM(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function FM(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function VM(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new _W(t,r,e[r]);return n}let GC=class zM{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=VM(e,r.attrs),this.defaultAttrs=LM(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==va.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:BM(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ii(this,this.computeAttrs(e),Oe.from(n),Ft.setFrom(r))}createChecked(e=null,n,r){return n=Oe.from(n),this.checkContent(n),new Ii(this,this.computeAttrs(e),n,Ft.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=Oe.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(Oe.empty,!0);return i?new Ii(this,e,n.append(i),Ft.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){FM(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Ft.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new zM(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function MW(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class _W{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?MW(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ch{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=VM(e,o.attrs),this.excluded=null;let i=LM(this.attrs);this.instance=i?new Ft(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Ft(this,BM(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Ch(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){FM(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let HM=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Jn.from(e.nodes),n.marks=Jn.from(e.marks||{}),this.nodes=GC.compile(this.spec.nodes,this),this.marks=Ch.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=va.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?JC(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:JC(this,s.split(" "))}this.nodeFromJSON=o=>Ii.fromJSON(this,o),this.markFromJSON=o=>Ft.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof GC){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new op(r,r.defaultAttrs,e,Ft.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function JC(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function RW(t){return t.tag!=null}function IW(t){return t.style!=null}class bs{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(RW(o))this.tags.push(o);else if(IW(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new ZC(this,n,!1);return r.addAll(e,Ft.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new ZC(this,n,!0);return r.addAll(e,Ft.none,n.from,n.to),je.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(PW(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=QC(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=QC(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new bs(e,bs.schemaRules(e)))}}const WM={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},DW={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},UM={ol:!0,ul:!0},du=1,kb=2,Uc=4;function XC(t,e,n){return e!=null?(e?du:0)|(e==="full"?kb:0):t&&t.whitespace=="pre"?du|kb:n&~Uc}class Jd{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Ft.none,this.match=i||(s&Uc?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Oe.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&du)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=Oe.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Oe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!WM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ZC{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,i,s=XC(null,n.preserveWhitespace,0)|(r?Uc:0);o?i=new Jd(o.type,o.attrs,Ft.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new Jd(null,null,Ft.none,!0,null,s):i=new Jd(e.schema.topNodeType,null,Ft.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,i=o.options&kb?"full":this.localPreserveWS||(o.options&du)>0,{schema:s}=this.parser;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
81
81
  `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(s.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=o.content[o.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;UM.hasOwnProperty(s)&&this.parser.normalizeLists&&AW(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:DW.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,f=this.needsBlock;if(WM.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),u=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let p=l&&l.skip?n:this.readStyles(e,n);p&&this.addAll(e,p),u&&this.sync(i),this.needsBlock=f}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
82
82
  `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let o,i;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(e);if(u&&(!o||o.length>u.length+a)&&(o=u,i=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)n=this.enterInner(o[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=Ft.none;for(let a of o.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):eS(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=XC(e,i,s.options);s.options&Uc&&s.content.length==0&&(a|=Uc);let l=Ft.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):eS(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Jd(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=du)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let f=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!f||f.name!=u&&!f.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function AW(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&UM.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function PW(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function QC(t){let e={};for(let n in t)e[n]=t[n];return e}function eS(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:f}=a.edge(l);if(u==e||i.indexOf(f)<0&&s(f))return!0}};if(s(o.contentMatch))return!0}}class Da{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ug(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(i[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],f=this.serializeMark(u,s.isInline,n);f&&(i.push([u,o]),o.appendChild(f.dom),o=f.contentDOM||f.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=_f(Ug(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&_f(Ug(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return _f(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Da(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=tS(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return tS(e.marks)}}function tS(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ug(t){return t.document||window.document}const nS=new WeakMap;function NW(t){let e=nS.get(t);return e===void 0&&nS.set(t,e=$W(t)),e}function $W(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function _f(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=NW(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),u=e[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let p in u)if(u[p]!=null){let m=p.indexOf(" ");m>0?l.setAttributeNS(p.slice(0,m),p.slice(m+1),u[p]):p=="style"&&l.style?l.style.cssText=u[p]:l.setAttribute(p,u[p])}}for(let p=f;p<e.length;p++){let m=e[p];if(m===0){if(p<e.length-1||p>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:b,contentDOM:v}=_f(t,m,n,r);if(l.appendChild(b),v){if(a)throw new RangeError("Multiple content holes");a=v}}}return{dom:l,contentDOM:a}}const qM=65535,KM=Math.pow(2,16);function jW(t,e){return t+e*KM}function rS(t){return t&qM}function LW(t){return(t-(t&qM))/KM}const YM=1,GM=2,Rf=4,JM=8;class Eb{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&JM)>0}get deletedBefore(){return(this.delInfo&(YM|Rf))>0}get deletedAfter(){return(this.delInfo&(GM|Rf))>0}get deletedAcross(){return(this.delInfo&Rf)>0}}class jr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&jr.empty)return jr.empty}recover(e){let n=0,r=rS(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+LW(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let u=this.ranges[a+i],f=this.ranges[a+s],p=l+u;if(e<=p){let m=u?e==l?-1:e==p?1:n:n,b=l+o+(m<0?0:f);if(r)return b;let v=e==(n<0?l:p)?null:jW(a/3,e-l),y=e==l?GM:e==p?YM:Rf;return(n<0?e!=l:e!=p)&&(y|=JM),new Eb(b,y,v)}o+=f-u}return r?e+o:new Eb(e+o,0,null)}touches(e,n){let r=0,o=rS(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+i],f=l+u;if(e<=f&&a==o*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),u=this.ranges[o+n],f=this.ranges[o+r];e(a,a+u,l,l+f),i+=f-u}}invert(){return new jr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?jr.empty:new jr(e<0?[0,-e,0]:[0,0,e])}}jr.empty=new jr([]);class fu{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new fu(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new fu;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Eb(e,o,null)}}const qg=Object.create(null);class ar{getMap(){return jr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=qg[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in qg)throw new RangeError("Duplicate use of step JSON ID "+e);return qg[e]=n,n.prototype.jsonID=e,n}}class kn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new kn(e,null)}static fail(e){return new kn(null,e)}static fromReplace(e,n,r,o){try{return kn.ok(e.replace(n,r,o))}catch(i){if(i instanceof tp)return kn.fail(i.message);throw i}}}function N0(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(N0(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return Oe.fromArray(r)}class hs extends ar{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new je(N0(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return kn.fromReplace(e,this.from,this.to,i)}invert(){return new qo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new hs(n.pos,r.pos,this.mark)}merge(e){return e instanceof hs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new hs(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new hs(n.from,n.to,e.markFromJSON(n.mark))}}ar.jsonID("addMark",hs);class qo extends ar{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new je(N0(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return kn.fromReplace(e,this.from,this.to,r)}invert(){return new hs(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new qo(n.pos,r.pos,this.mark)}merge(e){return e instanceof qo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new qo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new qo(n.from,n.to,e.markFromJSON(n.mark))}}ar.jsonID("removeMark",qo);class ms extends ar{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return kn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return kn.fromReplace(e,this.pos,this.pos+1,new je(Oe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new ms(this.pos,n.marks[o]);return new ms(this.pos,this.mark)}}return new xa(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ms(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ms(n.pos,e.markFromJSON(n.mark))}}ar.jsonID("addNodeMark",ms);class xa extends ar{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return kn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return kn.fromReplace(e,this.pos,this.pos+1,new je(Oe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ms(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new xa(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new xa(n.pos,e.markFromJSON(n.mark))}}ar.jsonID("removeNodeMark",xa);class $n extends ar{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Ob(e,this.from,this.to)?kn.fail("Structure replace would overwrite content"):kn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new jr([this.from,this.to-this.from,this.slice.size])}invert(e){return new $n(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new $n(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof $n)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?je.empty:new je(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new $n(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?je.empty:new je(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new $n(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new $n(n.from,n.to,je.fromJSON(e,n.slice),!!n.structure)}}ar.jsonID("replace",$n);class zn extends ar{constructor(e,n,r,o,i,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Ob(e,this.from,this.gapFrom)||Ob(e,this.gapTo,this.to)))return kn.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return kn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?kn.fromReplace(e,this.from,this.to,r):kn.fail("Content does not fit in gap")}getMap(){return new jr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new zn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new zn(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new zn(n.from,n.to,n.gapFrom,n.gapTo,je.fromJSON(e,n.slice),n.insert,!!n.structure)}}ar.jsonID("replaceAround",zn);function Ob(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function BW(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,u,f)=>{if(!l.isInline)return;let p=l.marks;if(!r.isInSet(p)&&f.type.allowsMarkType(r.type)){let m=Math.max(u,e),b=Math.min(u+l.nodeSize,n),v=r.addToSet(p);for(let y=0;y<p.length;y++)p[y].isInSet(v)||(s&&s.to==m&&s.mark.eq(p[y])?s.to=b:o.push(s=new qo(m,b,p[y])));a&&a.to==m?a.to=b:i.push(a=new hs(m,b,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function FW(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Ch){let u=s.marks,f;for(;f=r.isInSet(u);)(l||(l=[])).push(f),u=f.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let f=0;f<l.length;f++){let p=l[f],m;for(let b=0;b<o.length;b++){let v=o[b];v.step==i-1&&p.eq(o[b].style)&&(m=v)}m?(m.to=u,m.step=i):o.push({style:p,from:Math.max(a,e),to:u,step:i})}}}),o.forEach(s=>t.step(new qo(s.from,s.to,s.style)))}function $0(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<i.childCount;l++){let u=i.child(l),f=a+u.nodeSize,p=r.matchType(u.type);if(!p)s.push(new $n(a,f,je.empty));else{r=p;for(let m=0;m<u.marks.length;m++)n.allowsMarkType(u.marks[m].type)||t.step(new qo(a,f,u.marks[m]));if(o&&u.isText&&n.whitespace!="pre"){let m,b=/\r?\n|\r/g,v;for(;m=b.exec(u.text);)v||(v=new je(Oe.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new $n(a+m.index,a+m.index+m[0].length,v))}}a=f}if(!r.validEnd){let l=r.fillBefore(Oe.empty,!0);t.replace(a,a,new je(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function VW(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ql(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,o=0,i=0;;--r){let s=t.$from.node(r),a=t.$from.index(r)+o,l=t.$to.indexAfter(r)-i;if(r<t.depth&&s.canReplace(a,l,n))return r;if(r==0||s.type.spec.isolating||!VW(s,a,l))break;a&&(o=1),l<s.childCount&&(i=1)}return null}function zW(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,u=a,f=Oe.empty,p=0;for(let v=i,y=!1;v>n;v--)y||r.index(v)>0?(y=!0,f=Oe.from(r.node(v).copy(f)),p++):l--;let m=Oe.empty,b=0;for(let v=i,y=!1;v>n;v--)y||o.after(v+1)<o.end(v)?(y=!0,m=Oe.from(o.node(v).copy(m)),b++):u++;t.step(new zn(l,u,s,a,new je(f.append(m),p,b),f.size-p,!0))}function j0(t,e,n=null,r=t){let o=HW(t,e),i=o&&WW(r,e);return i?o.map(oS).concat({type:e,attrs:n}).concat(i.map(oS)):null}function oS(t){return{type:t,attrs:null}}function HW(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function WW(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let u=r;l&&u<o;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:s}function UW(t,e,n){let r=Oe.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Oe.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new zn(o,i,o,i,new je(r,0,0),n.length,!0))}function qW(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&KW(t.doc,t.mapping.slice(i).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",v=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!v?u=!1:!b&&v&&(u=!0)}u===!1&&ZM(t,s,a,i),$0(t,t.mapping.slice(i).map(a,1),r,void 0,u===null);let f=t.mapping.slice(i),p=f.map(a,1),m=f.map(a+s.nodeSize,1);return t.step(new zn(p,m,p+1,m-1,new je(Oe.from(r.create(l,null,s.marks)),0,0),1,!0)),u===!0&&XM(t,s,a,i),!1}})}function XM(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function ZM(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`