@micacms/editor-ui 0.5.0 → 0.6.0-rc.2

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.
Files changed (52) hide show
  1. package/README.md +3 -1
  2. package/dist/THIRD_PARTY_NOTICES.txt +3837 -0
  3. package/dist/assets/ChangesView-B37VddpZ.js +7 -0
  4. package/dist/assets/ChangesView-B37VddpZ.js.map +1 -0
  5. package/dist/assets/{CollectionView-Dm0AZ-4T.js → CollectionView-DMmV03BG.js} +2 -2
  6. package/dist/assets/{CollectionView-Dm0AZ-4T.js.map → CollectionView-DMmV03BG.js.map} +1 -1
  7. package/dist/assets/{ConfirmDialog.vue_vue_type_script_setup_true_lang-BY6pag2U.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-DaYRluZs.js} +2 -2
  8. package/dist/assets/{ConfirmDialog.vue_vue_type_script_setup_true_lang-BY6pag2U.js.map → ConfirmDialog.vue_vue_type_script_setup_true_lang-DaYRluZs.js.map} +1 -1
  9. package/dist/assets/{DashboardView-DHf6CKvk.js → DashboardView-CslqN0A1.js} +2 -2
  10. package/dist/assets/{DashboardView-DHf6CKvk.js.map → DashboardView-CslqN0A1.js.map} +1 -1
  11. package/dist/assets/{EntryView-DX4MCIIz.js → EntryView-CpappvZe.js} +2 -2
  12. package/dist/assets/{EntryView-DX4MCIIz.js.map → EntryView-CpappvZe.js.map} +1 -1
  13. package/dist/assets/{LoginView-D3ztIdgO.js → LoginView-BMcE8J5l.js} +2 -2
  14. package/dist/assets/{LoginView-D3ztIdgO.js.map → LoginView-BMcE8J5l.js.map} +1 -1
  15. package/dist/assets/{MediaView-CeF4DCQR.js → MediaView-CN7asOkJ.js} +2 -2
  16. package/dist/assets/{MediaView-CeF4DCQR.js.map → MediaView-CN7asOkJ.js.map} +1 -1
  17. package/dist/assets/{NotFoundView-DvofX918.js → NotFoundView-BT-zH9Ky.js} +2 -2
  18. package/dist/assets/{NotFoundView-DvofX918.js.map → NotFoundView-BT-zH9Ky.js.map} +1 -1
  19. package/dist/assets/{ObjectField--_IMDLHp.js → ObjectField-BHoHeIbi.js} +2 -2
  20. package/dist/assets/{ObjectField--_IMDLHp.js.map → ObjectField-BHoHeIbi.js.map} +1 -1
  21. package/dist/assets/{PageHeader.vue_vue_type_script_setup_true_lang-Cr0v1G7O.js → PageHeader.vue_vue_type_script_setup_true_lang-C3ip7WDx.js} +2 -2
  22. package/dist/assets/{PageHeader.vue_vue_type_script_setup_true_lang-Cr0v1G7O.js.map → PageHeader.vue_vue_type_script_setup_true_lang-C3ip7WDx.js.map} +1 -1
  23. package/dist/assets/{ReadOnlyNotice.vue_vue_type_script_setup_true_lang-BtfQSv1l.js → ReadOnlyNotice.vue_vue_type_script_setup_true_lang-B276O7Z8.js} +2 -2
  24. package/dist/assets/{ReadOnlyNotice.vue_vue_type_script_setup_true_lang-BtfQSv1l.js.map → ReadOnlyNotice.vue_vue_type_script_setup_true_lang-B276O7Z8.js.map} +1 -1
  25. package/dist/assets/{RepeaterField-CRo8CLz6.js → RepeaterField-CgFHog9l.js} +2 -2
  26. package/dist/assets/{RepeaterField-CRo8CLz6.js.map → RepeaterField-CgFHog9l.js.map} +1 -1
  27. package/dist/assets/{SingletonView-C1VhZ6Vv.js → SingletonView-BHtlstaz.js} +2 -2
  28. package/dist/assets/{SingletonView-C1VhZ6Vv.js.map → SingletonView-BHtlstaz.js.map} +1 -1
  29. package/dist/assets/{SystemView-Bc2he_Af.js → SystemView-S-i2v0ly.js} +2 -2
  30. package/dist/assets/{SystemView-Bc2he_Af.js.map → SystemView-S-i2v0ly.js.map} +1 -1
  31. package/dist/assets/{arrow-right-D8-sqdXS.js → arrow-right-DMhFU3-4.js} +2 -2
  32. package/dist/assets/{arrow-right-D8-sqdXS.js.map → arrow-right-DMhFU3-4.js.map} +1 -1
  33. package/dist/assets/{arrow-up-Bg3MuXmP.js → arrow-up-DeNDcETx.js} +2 -2
  34. package/dist/assets/{arrow-up-Bg3MuXmP.js.map → arrow-up-DeNDcETx.js.map} +1 -1
  35. package/dist/assets/{chevron-down-CnhoXsgY.js → chevron-down-D4nmRhPt.js} +2 -2
  36. package/dist/assets/{chevron-down-CnhoXsgY.js.map → chevron-down-D4nmRhPt.js.map} +1 -1
  37. package/dist/assets/format-CW--BYT5.js +2 -0
  38. package/dist/assets/{format-Cpnr2As6.js.map → format-CW--BYT5.js.map} +1 -1
  39. package/dist/assets/{index-BHBq4-Io.js → index-BBFDilFH.js} +3 -3
  40. package/dist/assets/{index-BHBq4-Io.js.map → index-BBFDilFH.js.map} +1 -1
  41. package/dist/assets/index-BSYHt4Oa.css +1 -0
  42. package/dist/assets/{useField-vKkdSfn7.js → useField-DcIPoU4r.js} +2 -2
  43. package/dist/assets/{useField-vKkdSfn7.js.map → useField-DcIPoU4r.js.map} +1 -1
  44. package/dist/assets/{useUnsavedChanges-FKPfUHdo.js → useUnsavedChanges-C4vyxObi.js} +48 -48
  45. package/dist/assets/useUnsavedChanges-C4vyxObi.js.map +1 -0
  46. package/dist/index.html +2 -2
  47. package/package.json +10 -3
  48. package/dist/assets/ChangesView-DVLSWguI.js +0 -7
  49. package/dist/assets/ChangesView-DVLSWguI.js.map +0 -1
  50. package/dist/assets/format-Cpnr2As6.js +0 -2
  51. package/dist/assets/index-bRiiEobC.css +0 -1
  52. package/dist/assets/useUnsavedChanges-FKPfUHdo.js.map +0 -1
@@ -1,22 +1,22 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ObjectField--_IMDLHp.js","assets/index-BHBq4-Io.js","assets/index-bRiiEobC.css","assets/useField-vKkdSfn7.js","assets/chevron-down-CnhoXsgY.js","assets/arrow-right-D8-sqdXS.js","assets/ReadOnlyNotice.vue_vue_type_script_setup_true_lang-BtfQSv1l.js","assets/RepeaterField-CRo8CLz6.js","assets/arrow-up-Bg3MuXmP.js"])))=>i.map(i=>d[i]);
2
- import{D as gh,d as Pe,h as z,c as W,a as j,l as N,t as Y,b as ge,g as ee,e as _o,E as yh,C as Ae,s as rt,w as gt,F as Ye,k as ut,G as bh,q as si,H as Ou,I as Yi,T as kh,v as vh,x as xh,j as Rt,X as Nu,z as $n,i as gr,r as je,A as ql,n as Ch,o as To,y as Ah,J as wh,K as Eh,L as Sh,M as Dh,N as _h,O as Th,P as Vl,Q as jl,R as Mh,S as Oh,U as Nh,V as Ih,W as Bh}from"./index-BHBq4-Io.js";import{u as ft,w as Hl}from"./useField-vKkdSfn7.js";import{A as Fh}from"./arrow-right-D8-sqdXS.js";import{P as Rh}from"./ReadOnlyNotice.vue_vue_type_script_setup_true_lang-BtfQSv1l.js";/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ObjectField-BHoHeIbi.js","assets/index-BBFDilFH.js","assets/index-BSYHt4Oa.css","assets/useField-DcIPoU4r.js","assets/chevron-down-D4nmRhPt.js","assets/arrow-right-DMhFU3-4.js","assets/ReadOnlyNotice.vue_vue_type_script_setup_true_lang-B276O7Z8.js","assets/RepeaterField-CgFHog9l.js","assets/arrow-up-DeNDcETx.js"])))=>i.map(i=>d[i]);
2
+ import{D as vh,d as Pe,h as z,c as H,a as V,l as N,t as Z,b as fe,g as X,e as Lr,E as xh,C as xe,s as rt,w as gt,F as Ye,k as ut,G as Ch,q as rn,H as Nu,I as Qi,T as Ah,v as wh,x as Eh,j as Rt,X as Iu,z as Ln,i as yr,r as je,A as Vl,n as Sh,o as Mo,y as Dh,J as _h,K as Th,L as Mh,M as Oh,N as Nh,O as Ih,P as jl,Q as Hl,R as Bh,S as Fh,U as Rh,V as $h,W as Ph}from"./index-BBFDilFH.js";import{u as ft,w as Ul}from"./useField-DcIPoU4r.js";import{A as Lh}from"./arrow-right-DMhFU3-4.js";import{P as zh}from"./ReadOnlyNotice.vue_vue_type_script_setup_true_lang-B276O7Z8.js";/**
3
3
  * @license @lucide/vue v1.37.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
- */const $h=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ph=gh("arrow-left",$h);function Iu(r){switch(r.kind){case"boolean":return r.default??!1;case"repeater":return[];case"object":return Lh(r.fields);case"select":return r.multiple?Array.isArray(r.default)?r.default:[]:typeof r.default=="string"?r.default:null;case"media":case"relation":return r.multiple?[]:null;case"text":case"textarea":case"richText":case"email":case"url":case"color":case"date":return r.default??null;case"number":return r.default??null;case"slug":case"coordinates":return null}}function Lh(r){const e={};for(const[t,n]of Object.entries(r))e[t]=Iu(n);return e}function Ul(r,e){const t=e??{},n={};for(const[i,s]of Object.entries(r)){const o=t[i];if(o===void 0){n[i]=Iu(s);continue}if(s.kind==="object"){n[i]=Ul(s.fields,o??{});continue}if(s.kind==="repeater"){const l=Array.isArray(o)?o:[];n[i]=l.map(a=>Ul(s.fields,a));continue}n[i]=o}return n}const zh=["for"],qh=["id","checked","disabled","aria-describedby"],Vh={class:"min-w-0"},jh={class:"block text-sm font-medium"},Hh=["id"],Uh=["id"],Wh=Pe({__name:"BooleanField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=ee(()=>t.modelValue===!0);return(f,h)=>(z(),W("div",null,[j("label",{for:N(s),class:"flex cursor-pointer items-start gap-3 rounded-sm border border-line bg-raised p-3 transition hover:bg-canvas has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60"},[j("input",{id:N(s),type:"checkbox",checked:d.value,disabled:r.disabled||i.value.readonly,"aria-describedby":N(a),class:"mt-0.5 h-4 w-4 shrink-0 rounded-sm border-line text-accent focus:ring-ink/20",onChange:h[0]||(h[0]=m=>n("update:modelValue",m.target.checked))},null,40,qh),j("span",Vh,[j("span",jh,Y(N(o)),1),i.value.description?(z(),W("span",{key:0,id:N(u),class:"block text-xs text-muted"},Y(i.value.description),9,Hh)):ge("",!0)])],8,zh),N(l)?(z(),W("p",{key:0,id:N(c),class:"field-error"},Y(N(l)),9,Uh)):ge("",!0)]))}}),Kh=["for"],Jh={key:0,class:"text-danger","aria-hidden":"true"},Gh={key:1,class:"sr-only"},Zh=["id"],Yh=["id"],yt=Pe({__name:"FieldShell",props:{inputId:{},label:{},description:{},required:{type:Boolean},error:{},hintId:{},errorId:{},bare:{type:Boolean}},setup(r){return(e,t)=>(z(),W("div",null,[r.bare?ge("",!0):(z(),W("label",{key:0,for:r.inputId,class:"field-label"},[_o(Y(r.label)+" ",1),r.required?(z(),W("span",Jh,"*")):ge("",!0),r.required?(z(),W("span",Gh,"(required)")):ge("",!0)],8,Kh)),j("div",{class:Ae(r.bare?"":"mt-1.5")},[yh(e.$slots,"default")],2),r.description?(z(),W("p",{key:1,id:r.hintId,class:"field-hint"},Y(r.description),9,Zh)):ge("",!0),r.error?(z(),W("p",{key:2,id:r.errorId,class:"field-error"},Y(r.error),9,Yh)):ge("",!0)]))}}),Qh={class:"flex items-center gap-2"},Xh=["value","disabled","aria-label"],ep=["id","value","disabled","aria-invalid","aria-describedby"],tp={key:0,class:"mt-2 flex flex-wrap gap-1.5"},rp=["title","disabled","aria-pressed","onClick"],np={class:"sr-only"},ip=Pe({__name:"ColorField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=ee(()=>typeof t.modelValue=="string"?t.modelValue:""),f=ee(()=>/^#[0-9a-f]{6}$/i.test(d.value)?d.value:"#000000");function h(m){n("update:modelValue",m===""?null:m)}return(m,p)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>{var g;return[j("div",Qh,[j("input",{type:"color",value:f.value,disabled:r.disabled||i.value.readonly,"aria-label":`${N(o)} colour picker`,class:"h-9.5 w-12 shrink-0 cursor-pointer rounded-sm border border-line bg-raised p-1",onInput:p[0]||(p[0]=y=>h(y.target.value))},null,40,Xh),j("input",{id:N(s),type:"text",value:d.value,placeholder:"#1a2b3c",spellcheck:"false",disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:Ae(["input font-mono text-[13px] uppercase",N(l)&&"input-invalid"]),onInput:p[1]||(p[1]=y=>h(y.target.value.trim()))},null,42,ep)]),(g=i.value.presets)!=null&&g.length?(z(),W("div",tp,[(z(!0),W(Ye,null,ut(i.value.presets,y=>(z(),W("button",{key:y,type:"button",title:y,disabled:r.disabled||i.value.readonly,"aria-pressed":d.value.toLowerCase()===y.toLowerCase(),class:Ae(["h-7 w-7 rounded-full border transition",d.value.toLowerCase()===y.toLowerCase()?"border-ink ring-2 ring-ink/15":"border-line hover:scale-110"]),style:bh({backgroundColor:y}),onClick:x=>h(y)},[j("span",np,"Use "+Y(y),1)],14,rp))),128))])):ge("",!0)]}),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),sp={class:"grid grid-cols-2 gap-2"},op=["for"],lp=["id","value","disabled","aria-describedby"],ap=["for"],up=["id","value","disabled"],cp={key:0,class:"field-error"},dp={class:"mt-1.5 flex items-center gap-3 text-xs text-muted"},fp=["href"],hp=Pe({__name:"CoordinatesField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=ee(()=>{const g=t.modelValue;if(!g||typeof g!="object")return null;const{lat:y,lng:x}=g;return typeof y=="number"&&typeof x=="number"?{lat:y,lng:x}:null}),f=g=>{var y,x;return((x=(y=t.issues)==null?void 0:y.find(k=>k.path===`${t.path}.${g}`))==null?void 0:x.message)??null};function h(g,y){const x=Number(y),k=d.value??{lat:0,lng:0};if(y.trim()===""){n("update:modelValue",null);return}Number.isFinite(x)&&n("update:modelValue",{...k,[g]:x})}function m(g){var k;const y=((k=g.clipboardData)==null?void 0:k.getData("text"))??"",x=/^\s*(-?\d+(?:\.\d+)?)\s*[,;\s]\s*(-?\d+(?:\.\d+)?)\s*$/.exec(y);x&&(g.preventDefault(),n("update:modelValue",{lat:Number(x[1]),lng:Number(x[2])}))}const p=ee(()=>d.value?`https://www.openstreetmap.org/?mlat=${d.value.lat}&mlon=${d.value.lng}#map=16/${d.value.lat}/${d.value.lng}`:null);return(g,y)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>{var x,k;return[j("div",sp,[j("div",null,[j("label",{for:`${N(s)}-lat`,class:"sr-only"},"Latitude",8,op),j("input",{id:`${N(s)}-lat`,type:"number",step:"any",min:"-90",max:"90",placeholder:"Latitude",value:((x=d.value)==null?void 0:x.lat)??"",disabled:r.disabled||i.value.readonly,"aria-describedby":N(a),class:Ae(["input font-mono text-[13px]",f("lat")&&"input-invalid"]),onInput:y[0]||(y[0]=A=>h("lat",A.target.value)),onPaste:m},null,42,lp)]),j("div",null,[j("label",{for:`${N(s)}-lng`,class:"sr-only"},"Longitude",8,ap),j("input",{id:`${N(s)}-lng`,type:"number",step:"any",min:"-180",max:"180",placeholder:"Longitude",value:((k=d.value)==null?void 0:k.lng)??"",disabled:r.disabled||i.value.readonly,class:Ae(["input font-mono text-[13px]",f("lng")&&"input-invalid"]),onInput:y[1]||(y[1]=A=>h("lng",A.target.value)),onPaste:m},null,42,up)])]),f("lat")||f("lng")?(z(),W("p",cp,Y(f("lat")??f("lng")),1)):ge("",!0),j("div",dp,[y[3]||(y[3]=j("span",null,'Paste "47.3769, 8.5417" into either box to fill both.',-1)),p.value?(z(),W("a",{key:0,href:p.value,target:"_blank",rel:"noopener noreferrer",class:"font-medium text-accent underline underline-offset-2"}," Check on the map ",8,fp)):ge("",!0),d.value?(z(),W("button",{key:1,type:"button",class:"ml-auto font-medium hover:text-ink",onClick:y[2]||(y[2]=A=>n("update:modelValue",null))}," Clear ")):ge("",!0)])]}),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),pp={class:"flex items-center gap-2"},mp=["id","type","value","min","max","required","disabled","aria-invalid","aria-describedby"],gp=["disabled"],yp=Pe({__name:"DateField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=ee(()=>{const m=t.modelValue;if(typeof m!="string"||m==="")return"";if(!i.value.includeTime)return m.slice(0,10);const p=new Date(m);if(Number.isNaN(p.getTime()))return"";const g=y=>String(y).padStart(2,"0");return`${p.getFullYear()}-${g(p.getMonth()+1)}-${g(p.getDate())}T${g(p.getHours())}:${g(p.getMinutes())}`});function f(m){const p=m.target.value;if(!p){n("update:modelValue",null);return}if(!i.value.includeTime){n("update:modelValue",p);return}const g=new Date(p);n("update:modelValue",Number.isNaN(g.getTime())?null:g.toISOString())}function h(){const m=new Date;n("update:modelValue",i.value.includeTime?m.toISOString():m.toISOString().slice(0,10))}return(m,p)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[j("div",pp,[j("input",{id:N(s),type:i.value.includeTime?"datetime-local":"date",value:d.value,min:i.value.min,max:i.value.max,required:i.value.required,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:Ae(["input",N(l)&&"input-invalid"]),onInput:f},null,42,mp),j("button",{type:"button",class:"btn-secondary shrink-0",disabled:r.disabled||i.value.readonly,onClick:h}," Today ",8,gp)])]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),bp={class:"flex items-center gap-3 border-b border-line px-5 py-3.5"},kp={class:"mb-4 flex cursor-pointer flex-col items-center justify-center gap-1 rounded-md border border-dashed border-line-strong bg-canvas/50 px-4 py-6 text-center transition hover:border-ink/40"},vp=["accept","multiple","disabled"],xp={class:"text-sm font-medium"},Cp={class:"text-xs text-muted"},Ap={key:0,class:"py-8 text-center text-sm text-muted"},wp={key:1,class:"py-8 text-center text-sm text-muted"},Ep={key:2,class:"grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-5"},Sp=["aria-pressed","onClick"],Dp={class:"block aspect-4/3 bg-canvas"},_p=["src"],Tp={key:1,class:"flex h-full w-full items-center justify-center text-xs font-medium uppercase text-muted"},Mp={class:"block px-2 py-1.5"},Op={class:"block truncate text-xs font-medium"},Np=["title"],Ip={class:"block text-[11px] text-muted"},Bp={key:0,class:"flex items-center justify-between gap-3 border-t border-line px-5 py-3"},Fp={class:"text-sm text-muted"},Rp={class:"flex gap-2"},$p=["disabled"],Pp=Pe({__name:"MediaPicker",props:{open:{type:Boolean},accept:{default:"any"},multiple:{type:Boolean,default:!1},selected:{default:()=>[]}},emits:["close","choose"],setup(r,{emit:e}){const t=r,n=e,i=Ch(),s=je([]),o=je(!1),l=je(!1),a=je(""),u=je([]),c=je(null),d=je(null),f=je(!1);let h=null;const m=ee(()=>t.accept==="image"?"image/*":t.accept==="document"?"application/pdf":void 0),p=ee(()=>{const T=a.value.trim().toLowerCase();return s.value.filter(I=>t.accept==="image"&&!y(I)||t.accept==="document"&&y(I)?!1:!T||I.path.toLowerCase().includes(T))}),g=ee(()=>u.value.length>0),y=T=>T.mimeType.startsWith("image/");async function x(){o.value=!0;try{s.value=(await gr.media.list()).items}catch(T){i.error(T instanceof ql?T.message:"Could not load the media library.")}finally{o.value=!1}}si(()=>t.open,async T=>{var I,O;if(!T){document.body.style.overflow="",h==null||h.focus();return}h=document.activeElement,document.body.style.overflow="hidden",u.value=[],a.value="",await x(),await Ou(),(O=(I=c.value)==null?void 0:I.querySelector("input, button"))==null||O.focus()}),Yi(()=>{document.body.style.overflow=""});function k(T){if(!t.multiple){n("choose",[T]),n("close");return}u.value=u.value.includes(T.path)?u.value.filter(I=>I!==T.path):[...u.value,T.path]}function A(){const T=new Map(s.value.map(O=>[O.path,O])),I=u.value.map(O=>T.get(O)).filter(O=>O!==void 0);n("choose",I),n("close")}async function v(T){const I=Array.from(T??[]);if(I.length!==0){l.value=!0;try{const{items:O}=await gr.media.upload(I,{accept:t.accept});if(!t.multiple){O[0]&&n("choose",[O[0]]),n("close");return}await x(),u.value=[...u.value,...O.map(q=>q.path)],i.success(`Uploaded ${O.length} file${O.length===1?"":"s"}.`)}catch(O){i.error(O instanceof ql?O.message:"The upload failed.")}finally{l.value=!1,d.value&&(d.value.value="")}}}function S(T){var I;f.value=!1,v(((I=T.dataTransfer)==null?void 0:I.files)??null)}function D(T){if(T.key==="Escape"){n("close");return}if(T.key!=="Tab"||!c.value)return;const I=c.value.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'),O=I[0],q=I[I.length-1];!O||!q||(T.shiftKey&&document.activeElement===O?(T.preventDefault(),q.focus()):!T.shiftKey&&document.activeElement===q&&(T.preventDefault(),O.focus()))}const _=T=>T<1024*1024?`${Math.round(T/1024)} KB`:`${(T/1024/1024).toFixed(1)} MB`,$=T=>{const I=T.split("/");return I.pop(),I.join("/")||"/"};return(T,I)=>(z(),rt(kh,{to:"body"},[r.open?(z(),W("div",{key:0,class:"fixed inset-0 z-50 flex items-end justify-center bg-ink/40 p-0 sm:items-center sm:p-6",onClick:I[6]||(I[6]=$n(O=>n("close"),["self"])),onKeydown:D},[j("div",{ref_key:"dialog",ref:c,role:"dialog","aria-modal":"true","aria-labelledby":"media-picker-title",class:"flex max-h-[90vh] w-full max-w-4xl flex-col rounded-t-xl border border-line bg-raised shadow-2xl sm:rounded-xl"},[j("header",bp,[I[8]||(I[8]=j("h2",{id:"media-picker-title",class:"text-base font-semibold"},"Media",-1)),vh(j("input",{"onUpdate:modelValue":I[0]||(I[0]=O=>a.value=O),type:"search",placeholder:"Search files…",class:"input ml-auto max-w-56","aria-label":"Search media"},null,512),[[xh,a.value]]),j("button",{type:"button",class:"btn-ghost -mr-2 px-2",onClick:I[1]||(I[1]=O=>n("close"))},[Rt(N(Nu),{size:20,"aria-hidden":"true"}),I[7]||(I[7]=j("span",{class:"sr-only"},"Close",-1))])]),j("div",{class:Ae(["min-h-0 flex-1 overflow-y-auto p-5",f.value&&"bg-accent-soft"]),onDragover:I[3]||(I[3]=$n(O=>f.value=!0,["prevent"])),onDragleave:I[4]||(I[4]=$n(O=>f.value=!1,["prevent"])),onDrop:$n(S,["prevent"])},[j("label",kp,[j("input",{ref_key:"fileInput",ref:d,type:"file",class:"sr-only",accept:m.value,multiple:r.multiple,disabled:l.value,onChange:I[2]||(I[2]=O=>v(O.target.files))},null,40,vp),j("span",xp,Y(l.value?"Uploading…":"Drop files here, or choose from your device"),1),j("span",Cp,Y(r.accept==="image"?"Images":r.accept==="document"?"PDF documents":"Images and documents"),1)]),o.value?(z(),W("p",Ap,"Loading…")):p.value.length===0?(z(),W("p",wp,Y(a.value?`Nothing matches "${a.value}".`:"No files yet."),1)):(z(),W("ul",Ep,[(z(!0),W(Ye,null,ut(p.value,O=>(z(),W("li",{key:O.path},[j("button",{type:"button","aria-pressed":u.value.includes(O.path)||r.selected.includes(O.path),class:Ae(["group block w-full overflow-hidden rounded-lg border text-left transition",u.value.includes(O.path)?"border-accent ring-2 ring-accent/25":r.selected.includes(O.path)?"border-accent/50":"border-line hover:border-accent/40"]),onClick:q=>k(O)},[j("span",Dp,[y(O)?(z(),W("img",{key:0,src:N(gr).media.url(O.path),alt:"",loading:"lazy",class:"h-full w-full object-cover"},null,8,_p)):(z(),W("span",Tp,Y(O.mimeType.split("/")[1]),1))]),j("span",Mp,[j("span",Op,Y(O.filename),1),j("span",{class:"block truncate text-[11px] text-muted",title:O.path},Y($(O.path)),9,Np),j("span",Ip,Y(O.width?`${O.width}×${O.height} · `:"")+Y(_(O.size)),1)])],10,Sp)]))),128))]))],34),r.multiple?(z(),W("footer",Bp,[j("span",Fp,Y(u.value.length)+" selected ",1),j("div",Rp,[j("button",{type:"button",class:"btn-secondary",onClick:I[5]||(I[5]=O=>n("close"))},"Cancel"),j("button",{type:"button",class:"btn-primary",disabled:!g.value,onClick:A}," Add "+Y(u.value.length||""),9,$p)])])):ge("",!0)],512)],32)):ge("",!0)]))}}),Lp=["aria-describedby"],zp={class:"aspect-4/3"},qp=["src"],Vp={key:1,class:"flex h-full w-full flex-col items-center justify-center gap-1 p-2 text-center"},jp={class:"text-[11px] font-semibold uppercase text-muted"},Hp=["title"],Up={class:"absolute inset-x-0 top-0 flex justify-end gap-0.5 bg-gradient-to-b from-ink/50 to-transparent p-1 opacity-0 transition group-hover:opacity-100 group-focus-within:opacity-100"},Wp=["disabled","onClick"],Kp={class:"sr-only"},Jp=["disabled","onClick"],Gp={class:"sr-only"},Zp=["disabled","onClick"],Yp={class:"sr-only"},Qp=["id","disabled"],Xp={key:1,class:"ml-2 text-xs text-muted"},em=Pe({__name:"MediaField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=je(!1),f=ee(()=>i.value.multiple?Array.isArray(t.modelValue)?t.modelValue:[]:typeof t.modelValue=="string"&&t.modelValue?[t.modelValue]:[]),h=ee(()=>f.value.map(x=>({path:x,filename:x.split("/").pop()??x,url:gr.media.url(x),isImage:/\.(jpe?g|png|webp|avif|gif)$/i.test(x)}))),m=ee(()=>i.value.multiple&&i.value.max!==void 0&&f.value.length>=i.value.max);function p(x){var A;if(!i.value.multiple){n("update:modelValue",((A=x[0])==null?void 0:A.path)??null);return}const k=[...f.value];for(const v of x)k.includes(v.path)||k.push(v.path);n("update:modelValue",i.value.max?k.slice(0,i.value.max):k)}function g(x){if(!i.value.multiple){n("update:modelValue",null);return}n("update:modelValue",f.value.filter((k,A)=>A!==x))}function y(x,k){const A=x+k;if(A<0||A>=f.value.length)return;const v=[...f.value];[v[x],v[A]]=[v[A],v[x]],n("update:modelValue",v)}return(x,k)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[j("div",{"aria-describedby":N(a)},[h.value.length?(z(),W("ul",{key:0,class:Ae(["mb-2 gap-2",i.value.multiple?"grid grid-cols-3 sm:grid-cols-5":"flex"])},[(z(!0),W(Ye,null,ut(h.value,(A,v)=>(z(),W("li",{key:`${A.path}-${v}`,class:Ae(["group relative overflow-hidden rounded-lg border border-line bg-canvas",i.value.multiple?"":"w-40"])},[j("div",zp,[A.isImage?(z(),W("img",{key:0,src:A.url,alt:"",class:"h-full w-full object-cover"},null,8,qp)):(z(),W("div",Vp,[j("span",jp,Y(A.filename.split(".").pop()),1)]))]),j("p",{class:"truncate px-1.5 py-1 text-[11px] text-muted",title:A.path},Y(A.filename),9,Hp),j("div",Up,[i.value.multiple&&v>0?(z(),W("button",{key:0,type:"button",class:"rounded-sm bg-raised/90 px-1.5 text-xs font-semibold hover:bg-raised",disabled:r.disabled,onClick:S=>y(v,-1)},[Rt(N(Ph),{size:14,"aria-hidden":"true"}),j("span",Kp,"Move "+Y(A.filename)+" earlier",1)],8,Wp)):ge("",!0),i.value.multiple&&v<h.value.length-1?(z(),W("button",{key:1,type:"button",class:"rounded-sm bg-raised/90 px-1.5 text-xs font-semibold hover:bg-raised",disabled:r.disabled,onClick:S=>y(v,1)},[Rt(N(Fh),{size:14,"aria-hidden":"true"}),j("span",Gp,"Move "+Y(A.filename)+" later",1)],8,Jp)):ge("",!0),j("button",{type:"button",class:"rounded-sm bg-raised/90 px-1.5 text-xs font-semibold text-danger hover:bg-raised",disabled:r.disabled,onClick:S=>g(v)},[Rt(N(Nu),{size:14,"aria-hidden":"true"}),j("span",Yp,"Remove "+Y(A.filename),1)],8,Zp)])],2))),128))],2)):ge("",!0),j("button",{id:N(s),type:"button",class:"btn-secondary",disabled:r.disabled||i.value.readonly||m.value,onClick:k[0]||(k[0]=A=>d.value=!0)},[Rt(N(Rh),{size:16,"aria-hidden":"true"}),_o(" "+Y(h.value.length&&!i.value.multiple?"Replace":"Add"),1)],8,Qp),m.value?(z(),W("span",Xp," Maximum of "+Y(i.value.max)+" reached. ",1)):ge("",!0)],8,Lp),Rt(Pp,{open:d.value,accept:i.value.accept??"any",multiple:i.value.multiple,selected:f.value,onClose:k[1]||(k[1]=A=>d.value=!1),onChoose:p},null,8,["open","accept","multiple","selected"])]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),tm={class:"relative"},rm=["id","value","min","max","step","required","disabled","aria-invalid","aria-describedby"],nm={key:0,class:"pointer-events-none absolute inset-y-0 right-3 flex items-center text-sm text-muted"},im=Pe({__name:"NumberField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=ee(()=>typeof t.modelValue=="number"?String(t.modelValue):"");function f(h){const m=h.target.value;if(m.trim()===""){n("update:modelValue",null);return}const p=Number(m);n("update:modelValue",Number.isFinite(p)?p:null)}return(h,m)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[j("div",tm,[j("input",{id:N(s),type:"number",inputmode:"decimal",value:d.value,min:i.value.min,max:i.value.max,step:i.value.step??(i.value.integer?1:"any"),required:i.value.required,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:Ae(["input",i.value.unit&&"pr-12",N(l)&&"input-invalid"]),onInput:f},null,42,rm),i.value.unit?(z(),W("span",nm,Y(i.value.unit),1)):ge("",!0)])]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),sm={key:0,class:"text-sm text-muted"},om={key:1,class:"text-sm text-muted"},lm=["aria-describedby"],am={class:"sr-only"},um=["checked","disabled","onChange"],cm={class:"min-w-0 flex-1 truncate"},dm={class:"shrink-0 font-mono text-[11px] text-muted"},fm=["id","value","disabled","aria-invalid","aria-describedby"],hm=["value"],pm=Pe({__name:"RelationField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=Ah(),f=je([]),h=je(!0),m=ee(()=>{var k;return((k=d.collection(i.value.collection))==null?void 0:k.label)??i.value.collection});To(async()=>{try{f.value=(await gr.entries.list(i.value.collection)).items}finally{h.value=!1}});const p=ee(()=>i.value.multiple?Array.isArray(t.modelValue)?t.modelValue:[]:typeof t.modelValue=="string"?[t.modelValue]:[]),g=k=>{var A;return((A=f.value.find(v=>v.slug===k))==null?void 0:A.title)??k},y=k=>!h.value&&!f.value.some(A=>A.slug===k);function x(k){const A=p.value.includes(k)?p.value.filter(v=>v!==k):[...p.value,k];n("update:modelValue",A)}return(k,A)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[h.value?(z(),W("p",sm,"Loading "+Y(m.value)+"…",1)):f.value.length===0?(z(),W("p",om," There are no entries in "+Y(m.value)+" yet. ",1)):(z(),W(Ye,{key:2},[i.value.multiple?(z(),W("fieldset",{key:0,class:"space-y-1.5","aria-describedby":N(a)},[j("legend",am,Y(N(o)),1),(z(!0),W(Ye,null,ut(f.value,v=>(z(),W("label",{key:v.slug,class:"flex cursor-pointer items-center gap-2.5 rounded-sm border border-line bg-raised px-3 py-2 text-sm hover:bg-canvas"},[j("input",{type:"checkbox",checked:p.value.includes(v.slug),disabled:r.disabled||i.value.readonly,class:"h-4 w-4 rounded-sm border-line text-accent focus:ring-ink/20",onChange:S=>x(v.slug)},null,40,um),j("span",cm,Y(v.title),1),j("span",dm,Y(v.slug),1)]))),128))],8,lm)):(z(),W("select",{key:1,id:N(s),value:p.value[0]??"",disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:Ae(["input",N(l)&&"input-invalid"]),onChange:A[0]||(A[0]=v=>n("update:modelValue",v.target.value||null))},[A[1]||(A[1]=j("option",{value:""},"Not set",-1)),(z(!0),W(Ye,null,ut(f.value,v=>(z(),W("option",{key:v.slug,value:v.slug},Y(v.title),9,hm))),128))],42,fm))],64)),(z(!0),W(Ye,null,ut(p.value.filter(y),v=>(z(),W("p",{key:v,class:"field-error"},' "'+Y(g(v))+'" is no longer in '+Y(m.value)+". ",1))),128))]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}});function Ne(r){this.content=r}Ne.prototype={constructor:Ne,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),s=n.content.slice();return i==-1?s.push(t||r,e):(s[i+1]=e,t&&(s[i]=t)),new Ne(s)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ne(t)},addToStart:function(r,e){return new Ne([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Ne(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),s=n.find(r);return i.splice(s==-1?i.length:s,0,e,t),new Ne(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Ne.from(r),r.size?new Ne(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Ne.from(r),r.size?new Ne(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Ne.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};Ne.from=function(r){if(r instanceof Ne)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Ne(e)};function Bu(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a<o.length&&a<l.length&&$u(o.charCodeAt(a-1))&&Ru(o.charCodeAt(a))&&t--,t}if(i.content.size||s.content.size){let o=Bu(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Fu(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,n-=a;continue}if(!o.sameMarkup(l))return{a:t,b:n};if(o.isText&&o.text!=l.text){let u=o.text,c=l.text,d=u.length,f=c.length;for(;d>0&&f>0&&u[d-1]==c[f-1];)d--,f--,t--,n--;return d&&f&&d<u.length&&$u(u.charCodeAt(d-1))&&Ru(u.charCodeAt(d))&&(t++,n++),{a:t,b:n}}if(o.content.size||l.content.size){let u=Fu(o.content,l.content,t-1,n-1);if(u)return u}t-=a,n-=a}}function Ru(r){return r>=56320&&r<57344}function $u(r){return r>=55296&&r<56320}class R{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,s){for(let o=0,l=0;l<t;o++){let a=this.content[o],u=l+a.nodeSize;if(u>e&&n(a,i+l,s||null,o)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,t-c),n,i+c)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let u=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&n&&(o?o=!1:s+=n),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new R(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),i+=l.nodeSize),o=a}return new R(n,i)}cutByIndex(e,t){return e==t?R.empty:e==0&&t==this.content.length?this:new R(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new R(i,s)}addToStart(e){return new R([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new R(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Bu(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Fu(this,e,t,n)}findIndex(e){if(e==0)return Pn(0,e);if(e==this.size)return Pn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),s=n+i.nodeSize;if(s>=e)return s==e?Pn(t+1,s):Pn(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return R.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return R.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return R.empty;let t,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new R(t||e,n)}static from(e){if(!e)return R.empty;if(e instanceof R)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new R([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}R.empty=new R([],0);const ys={index:0,offset:0};function Pn(r,e){return ys.index=r,ys.offset=e,ys}function oi(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!oi(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!oi(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let fe=class Ws{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&oi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ws.none;if(e instanceof Ws)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};fe.none=[];class fn extends Error{}class H{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Lu(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new H(n,this.openStart,this.openEnd)}removeBetween(e,t){return new H(Pu(this.content,e+this.openStart,t+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,t){if(!t)return H.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new H(R.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new H(e,n,i)}}H.empty=new H(R.empty,0,0);function Pu(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:l}=r.findIndex(t);if(i==e||s.isText){if(l!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(Pu(s.content,e-i-1,t-i-1)))}function Lu(r,e,t,n,i,s){let{index:o,offset:l}=r.findIndex(e),a=r.maybeChild(o);if(l==e||a.isText)return s&&n<=0&&i<=0&&!s.canReplace(o,o,t)?null:r.cut(0,e).append(t).append(r.cut(e));let u=Lu(a.content,e-l-1,t,o==0?n-1:0,o==r.childCount-1?i-1:0,a);return u&&r.replaceChild(o,a.copy(u))}function mm(r,e,t){if(t.openStart>r.depth)throw new fn("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new fn("Inconsistent open depths");return zu(r,e,t,0)}function zu(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=zu(r,e,t,n+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,l=o.content;return br(o,l.cut(0,r.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=gm(t,r);return br(s,Vu(r,o,l,e,n))}else return br(s,li(r,e,n))}function qu(r,e){if(!e.type.compatibleContent(r.type))throw new fn("Cannot join "+e.type.name+" onto "+r.type.name)}function Ks(r,e,t){let n=r.node(t);return qu(n,e.node(t)),n}function yr(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function tn(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(yr(r.nodeAfter,n),s++));for(let l=s;l<o;l++)yr(i.child(l),n);e&&e.depth==t&&e.textOffset&&yr(e.nodeBefore,n)}function br(r,e){if(!r.type.validContent(e))throw new fn("Invalid content for node "+r.type.name);return r.copy(e)}function Vu(r,e,t,n,i){let s=r.depth>i&&Ks(r,e,i+1),o=n.depth>i&&Ks(t,n,i+1),l=[];return tn(null,r,i,l),s&&o&&e.index(i)==t.index(i)?(qu(s,o),yr(br(s,Vu(r,e,t,n,i+1)),l)):(s&&yr(br(s,li(r,e,i+1)),l),tn(e,t,i,l),o&&yr(br(o,li(t,n,i+1)),l)),tn(n,null,i,l),new R(l)}function li(r,e,t){let n=[];if(tn(null,r,t,n),r.depth>t){let i=Ks(r,e,t+1);yr(br(i,li(r,e,t+1)),n)}return tn(e,null,t,n),new R(n)}function gm(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(R.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class hn{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return fe.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let l=n;n=i,i=l}let s=n.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ai(this,e,n);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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),u=s-a;if(n.push(o,l,i+a),!u||(o=o.child(l),o.isText))break;s=u-1,i+=a+1}return new hn(t,n,s)}static resolveCached(e,t){let n=Wl.get(e);if(n)for(let s=0;s<n.elts.length;s++){let o=n.elts[s];if(o.pos==t)return o}else Wl.set(e,n=new ym);let i=n.elts[n.i]=hn.resolve(e,t);return n.i=(n.i+1)%bm,i}}class ym{constructor(){this.elts=[],this.i=0}}const bm=12,Wl=new WeakMap;class ai{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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 km=Object.create(null);let Yt=class Js{constructor(e,t,n,i=fe.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||R.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,t,n,i=0){this.content.nodesBetween(e,t,n,i,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,t,n,i){return this.content.textBetween(e,t,n,i)}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,t,n){return this.type==e&&oi(this.attrs,t||e.defaultAttrs||km)&&fe.sameSet(this.marks,n||fe.none)}copy(e=null){return e==this.content?this:new Js(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Js(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return H.empty;let i=this.resolve(e),s=this.resolve(t),o=n?0:i.sharedDepth(t),l=i.start(o),u=i.node(o).content.cut(i.pos-l,s.pos-l);return new H(u,i.depth-o,s.depth-o)}replace(e,t,n){return mm(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return hn.resolveCached(this,e)}resolveNoCache(e){return hn.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}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()+")"),ju(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=R.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),o=s&&s.matchFragment(this.content,t);return o?o.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=fe.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!fe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t 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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=R.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};Yt.prototype.text=void 0;class ui extends Yt{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ju(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ui(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ui(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ju(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class Ar{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new vm(e,t);if(n.next==null)return Ar.empty;let i=Hu(n);n.next&&n.err("Unexpected trailing text");let s=Dm(Sm(i));return _m(s,n),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let s=t;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function s(o,l){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return R.from(l.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:c,next:d}=o.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(c));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!i.type||a.validEnd)&&(n.push({match:l.contentMatch,type:l,via:i}),t[l.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 t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)s+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return s}).join(`
8
- `)}}Ar.empty=new Ar(!0);class vm{constructor(e,t){this.string=e,this.nodeTypes=t,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 Hu(r){let e=[];do e.push(xm(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function xm(r){let e=[];do e.push(Cm(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Cm(r){let e=Em(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=Am(r,e);else break;return e}function Kl(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function Am(r,e){let t=Kl(r),n=t;return r.eat(",")&&(r.next!="}"?n=Kl(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function wm(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function Em(r){if(r.eat("(")){let e=Hu(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=wm(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Sm(r){let e=[[]];return i(s(r,0),t()),e;function t(){return e.push([])-1}function n(o,l,a){let u={term:a,to:l};return e[o].push(u),u}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(o.type=="seq")for(let a=0;;a++){let u=s(o.exprs[a],l);if(a==o.exprs.length-1)return u;i(u,l=t())}else if(o.type=="star"){let a=t();return n(l,a),i(s(o.expr,a),a),[n(a)]}else if(o.type=="plus"){let a=t();return i(s(o.expr,l),a),i(s(o.expr,a),a),[n(a)]}else{if(o.type=="opt")return[n(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let u=0;u<o.min;u++){let c=t();i(s(o.expr,a),c),a=c}if(o.max==-1)i(s(o.expr,a),a);else for(let u=o.min;u<o.max;u++){let c=t();n(a,c),i(s(o.expr,a),c),a=c}return[n(a)]}else{if(o.type=="name")return[n(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Uu(r,e){return e-r}function Jl(r,e){let t=[];return n(e),t.sort(Uu);function n(i){let s=r[i];if(s.length==1&&!s[0].term)return n(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:l,to:a}=s[o];!l&&t.indexOf(a)==-1&&n(a)}}}function Dm(r){let e=Object.create(null);return t(Jl(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c<i.length;c++)i[c][0]==l&&(u=i[c][1]);Jl(r,a).forEach(c=>{u||i.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=e[n.join(",")]=new Ar(n.indexOf(r.length-1)>-1);for(let o=0;o<i.length;o++){let l=i[o][1].sort(Uu);s.next.push({type:i[o][0],next:e[l.join(",")]||t(l)})}return s}}function _m(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],s=!i.validEnd,o=[];for(let l=0;l<i.next.length;l++){let{type:a,next:u}=i.next[l];o.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),n.indexOf(u)==-1&&n.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Wu(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function Ku(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let s=r[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function Ju(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${n}`);for(let i in r)r[i].validate&&r[i].validate(e[i])}function Gu(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Mm(r,n,e[n]);return t}let Gl=class Zu{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Gu(e,n.attrs),this.defaultAttrs=Wu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ar.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:Ku(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Yt(this,this.computeAttrs(e),R.from(t),fe.setFrom(n))}createChecked(e=null,t,n){return t=R.from(t),this.checkContent(t),new Yt(this,this.computeAttrs(e),t,fe.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=R.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(R.empty,!0);return s?new Yt(this,e,t.append(s),fe.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).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){Ju(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 t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:fe.none:e}static compile(e,t){let n=Object.create(null);e.forEach((s,o)=>n[s]=new Zu(s,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function Tm(r,e,t){let n=t.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${s}`)}}class Mm{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?Tm(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Qi{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Gu(e,i.attrs),this.excluded=null;let s=Wu(this.attrs);this.instance=s?new fe(this,s):null}create(e=null){return!e&&this.instance?this.instance:new fe(this,Ku(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new Qi(s,i++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Ju(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Yu{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Ne.from(e.nodes),t.marks=Ne.from(e.marks||{}),this.nodes=Gl.compile(this.spec.nodes,this),this.marks=Qi.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=n[o]||(n[o]=Ar.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?Zl(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Zl(this,o.split(" "))}this.nodeFromJSON=i=>Yt.fromJSON(this,i),this.markFromJSON=i=>fe.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Gl){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(t,n,i)}text(e,t){let n=this.nodes.text;return new ui(n,n.defaultAttrs,e,fe.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Zl(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],s=r.marks[i],o=s;if(s)t.push(s);else for(let l in r.marks){let a=r.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function Om(r){return r.tag!=null}function Nm(r){return r.style!=null}class Qt{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(Om(i))this.tags.push(i);else if(Nm(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let n=new Ql(this,t,!1);return n.addAll(e,fe.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ql(this,t,!0);return n.addAll(e,fe.none,t.from,t.to),H.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Fm(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,n,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{n(o=Xl(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=Xl(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Qt(e,Qt.schemaRules(e)))}}const Qu={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},Im={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Xu={ol:!0,ul:!0},pn=1,Gs=2,rn=4;function Yl(r,e,t){return e!=null?(e?pn:0)|(e==="full"?Gs:0):r&&r.whitespace=="pre"?pn|Gs:t&~rn}class Ln{constructor(e,t,n,i,s,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=fe.none,this.match=s||(o&rn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(R.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&pn)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=R.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(R.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Qu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ql{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=Yl(null,t.preserveWhitespace,0)|(n?rn:0);i?s=new Ln(i.type,i.attrs,fe.none,!0,t.topMatch||i.type.contentMatch,o):n?s=new Ln(null,null,fe.none,!0,null,o):s=new Ln(e.schema.topNodeType,null,fe.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,s=i.options&Gs?"full":this.localPreserveWS||(i.options&pn)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)if(s==="full")n=n.replace(/\r\n?/g,`
9
- `);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=n.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;Xu.hasOwnProperty(o)&&this.parser.normalizeLists&&Bm(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,n));e:if(a?a.ignore:Im.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let u,c=this.needsBlock;if(Qu.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),u&&this.sync(s),this.needsBlock=c}else{let u=this.readStyles(e,t);u&&this.addElementByRule(e,a,u,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
10
- `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=n.getPropertyValue(s);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(s,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(u=>!a.clearMark(u)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,n,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let a=this.enter(o,t.attrs||null,n,t.preserveWhitespace);a&&(s=!0,n=a)}else{let a=this.parser.schema.marks[t.mark];n=n.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,n,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,n),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,t,n,i){let s=n||0;for(let o=n?e.childNodes[n]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,n){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],u=a.findWrapping(e);if(u&&(!i||i.length>u.length+l)&&(i=u,s=a,!u.length))break;if(a.solid){if(n)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=fe.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):ea(l.type,e.type))&&(o=l.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let s=this.findPlace(e.create(t),n,!1);return s&&(s=this.enterInner(e,t,n,!0,i)),s}enterInner(e,t,n,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Yl(e,s,o.options);o.options&rn&&o.content.length==0&&(l|=rn);let a=fe.none;return n=n.filter(u=>(o.type?o.type.allowsMarkType(u.type):ea(u.type,e))?(a=u.addToSet(a),!1):!0),this.nodes.push(new Ln(e,t,a,i,null,l)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=pn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let u=t[l];if(u==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:n&&a>=s?n.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function Bm(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&Xu.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function Fm(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function Xl(r){let e={};for(let t in r)e[t]=r[t];return e}function ea(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:u,next:c}=l.edge(a);if(u==e||s.indexOf(c)<0&&o(c))return!0}};if(o(i.contentMatch))return!0}}class Dr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=zn(t).createDocumentFragment());let i=n,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let l=0,a=0;for(;l<s.length&&a<o.marks.length;){let u=o.marks[a];if(!this.marks[u.type.name]){a++;continue}if(!u.eq(s[l][0])||u.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)i=s.pop()[1];for(;a<o.marks.length;){let u=o.marks[a++],c=this.serializeMark(u,o.isInline,t);c&&(s.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){if(e.isText)return zn(t).createTextNode(e.text);let{dom:n,contentDOM:i}=Qn(zn(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Qn(zn(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:Qn(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Dr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ta(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return ta(e.marks)}}function ta(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function zn(r){return r.document||window.document}const ra=new WeakMap;function Rm(r){let e=ra.get(r);return e===void 0&&ra.set(r,e=$m(r)),e}function $m(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function Qn(r,e,t,n){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=Rm(n))&&s.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 o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let l,a=t?r.createElementNS(t,i):r.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(r.createTextNode(f));else{let{dom:h,contentDOM:m}=Qn(r,f,t,n);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const ec=65535,tc=Math.pow(2,16);function Pm(r,e){return r+e*tc}function na(r){return r&ec}function Lm(r){return(r-(r&ec))/tc}const rc=1,nc=2,Xn=4,ic=8;class Zs{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&ic)>0}get deletedBefore(){return(this.delInfo&(rc|Xn))>0}get deletedAfter(){return(this.delInfo&(nc|Xn))>0}get deletedAcross(){return(this.delInfo&Xn)>0}}class et{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&et.empty)return et.empty}recover(e){let t=0,n=na(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+Lm(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let u=this.ranges[l+s],c=this.ranges[l+o],d=a+u;if(e<=d){let f=u?e==a?-1:e==d?1:t:t,h=a+i+(f<0?0:c);if(n)return h;let m=e==(t<0?a:d)?null:Pm(l/3,e-a),p=e==a?nc:e==d?rc:Xn;return(t<0?e!=a:e!=d)&&(p|=ic),new Zs(h,p,m)}i+=c-u}return n?e+i:new Zs(e+i,0,null)}touches(e,t){let n=0,i=na(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?n:0);if(a>e)break;let u=this.ranges[l+s],c=a+u;if(e<=c&&l==i*3)return!0;n+=this.ranges[l+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),a=o+(this.inverted?0:s),u=this.ranges[i+t],c=this.ranges[i+n];e(l,l+u,a,a+c),s+=c-u}}invert(){return new et(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?et.empty:new et(e<0?[0,-e,0]:[0,0,e])}}et.empty=new et([]);class mn{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new mn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new mn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return n?e:new Zs(e,i,null)}}const bs=Object.create(null);class Ve{getMap(){return et.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=bs[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in bs)throw new RangeError("Duplicate use of step JSON ID "+e);return bs[e]=t,t.prototype.jsonID=e,t}}class Ce{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Ce(e,null)}static fail(e){return new Ce(null,e)}static fromReplace(e,t,n,i){try{return Ce.ok(e.replace(t,n,i))}catch(s){if(s instanceof fn)return Ce.fail(s.message);throw s}}}function Mo(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let s=r.child(i);s.content.size&&(s=s.copy(Mo(s.content,e,s))),s.isInline&&(s=e(s,t,i)),n.push(s)}return R.fromArray(n)}class Gt extends Ve{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new H(Mo(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return Ce.fromReplace(e,this.from,this.to,s)}invert(){return new wt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Gt(t.pos,n.pos,this.mark)}merge(e){return e instanceof Gt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Gt(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Gt(t.from,t.to,e.markFromJSON(t.mark))}}Ve.jsonID("addMark",Gt);class wt extends Ve{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new H(Mo(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Ce.fromReplace(e,this.from,this.to,n)}invert(){return new Gt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new wt(t.pos,n.pos,this.mark)}merge(e){return e instanceof wt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wt(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new wt(t.from,t.to,e.markFromJSON(t.mark))}}Ve.jsonID("removeMark",wt);class Zt extends Ve{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ce.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ce.fromReplace(e,this.pos,this.pos+1,new H(R.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new Zt(this.pos,t.marks[i]);return new Zt(this.pos,this.mark)}}return new wr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Zt(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Zt(t.pos,e.markFromJSON(t.mark))}}Ve.jsonID("addNodeMark",Zt);class wr extends Ve{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ce.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ce.fromReplace(e,this.pos,this.pos+1,new H(R.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Zt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new wr(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new wr(t.pos,e.markFromJSON(t.mark))}}Ve.jsonID("removeNodeMark",wr);class xe extends Ve{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&Ys(e,this.from,this.to)?Ce.fail("Structure replace would overwrite content"):Ce.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new et([this.from,this.to-this.from,this.slice.size])}invert(e){return new xe(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&xe.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new xe(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof xe)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?H.empty:new H(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new xe(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?H.empty:new H(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new xe(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new xe(t.from,t.to,H.fromJSON(e,t.slice),!!t.structure)}}xe.MAP_BIAS=1;Ve.jsonID("replace",xe);class De extends Ve{constructor(e,t,n,i,s,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Ys(e,this.from,this.gapFrom)||Ys(e,this.gapTo,this.to)))return Ce.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ce.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Ce.fromReplace(e,this.from,this.to,n):Ce.fail("Content does not fit in gap")}getMap(){return new et([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new De(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||s>n.pos?null:new De(t.pos,n.pos,i,s,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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new De(t.from,t.to,t.gapFrom,t.gapTo,H.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ve.jsonID("replaceAround",De);function Ys(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function zm(r,e,t,n){let i=[],s=[],o,l;r.doc.nodesBetween(e,t,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){let f=Math.max(u,e),h=Math.min(u+a.nodeSize,t),m=n.addToSet(d);for(let p=0;p<d.length;p++)d[p].isInSet(m)||(o&&o.to==f&&o.mark.eq(d[p])?o.to=h:i.push(o=new wt(f,h,d[p])));l&&l.to==f?l.to=h:s.push(l=new Gt(f,h,n))}}),i.forEach(a=>r.step(a)),s.forEach(a=>r.step(a))}function qm(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(n instanceof Qi){let u=o.marks,c;for(;c=n.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else n?n.isInSet(o.marks)&&(a=[n]):a=o.marks;if(a&&a.length){let u=Math.min(l+o.nodeSize,t);for(let c=0;c<a.length;c++){let d=a[c],f;for(let h=0;h<i.length;h++){let m=i[h];m.step==s-1&&d.eq(i[h].style)&&(f=m)}f?(f.to=u,f.step=s):i.push({style:d,from:Math.max(l,e),to:u,step:s})}}}),i.forEach(o=>r.step(new wt(o.from,o.to,o.style)))}function Oo(r,e,t,n=t.contentMatch,i=!0){let s=r.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<s.childCount;a++){let u=s.child(a),c=l+u.nodeSize,d=n.matchType(u.type);if(!d)o.push(new xe(l,c,H.empty));else{n=d;for(let f=0;f<u.marks.length;f++)t.allowsMarkType(u.marks[f].type)||r.step(new wt(l,c,u.marks[f]));if(i&&u.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(u.text);)m||(m=new H(R.from(t.schema.text(" ",t.allowedMarks(u.marks))),0,0)),o.push(new xe(l+f.index,l+f.index+f[0].length,m))}}l=c}if(!n.validEnd){let a=n.fillBefore(R.empty,!0);r.replace(l,l,new H(a,0,0))}for(let a=o.length-1;a>=0;a--)r.step(o[a])}function Vm(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Hr(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth,i=0,s=0;;--n){let o=r.$from.node(n),l=r.$from.index(n)+i,a=r.$to.indexAfter(n)-s;if(n<r.depth&&o.canReplace(l,a,t))return n;if(n==0||o.type.spec.isolating||!Vm(o,l,a))break;l&&(i=1),a<o.childCount&&(s=1)}return null}function jm(r,e,t){let{$from:n,$to:i,depth:s}=e,o=n.before(s+1),l=i.after(s+1),a=o,u=l,c=R.empty,d=0;for(let m=s,p=!1;m>t;m--)p||n.index(m)>0?(p=!0,c=R.from(n.node(m).copy(c)),d++):a--;let f=R.empty,h=0;for(let m=s,p=!1;m>t;m--)p||i.after(m+1)<i.end(m)?(p=!0,f=R.from(i.node(m).copy(f)),h++):u++;r.step(new De(a,u,o,l,new H(c.append(f),d,h),c.size-d,!0))}function No(r,e,t=null,n=r){let i=Hm(r,e),s=i&&Um(n,e);return s?i.map(ia).concat({type:e,attrs:t}).concat(s.map(ia)):null}function ia(r){return{type:r,attrs:null}}function Hm(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.contentMatchAt(n).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(n,i,o)?s:null}function Um(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.child(n),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let u=n;a&&u<i;u++)a=a.matchType(t.child(u).type);return!a||!a.validEnd?null:o}function Wm(r,e,t){let n=R.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let l=t[o].type.contentMatch.matchFragment(n);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=R.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new De(i,s,i,s,new H(n,0,0),t.length,!0))}function Km(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,a)&&Jm(r.doc,r.mapping.slice(s).map(l),n)){let u=null;if(n.schema.linebreakReplacement){let h=n.whitespace=="pre",m=!!n.contentMatch.matchType(n.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&oc(r,o,l,s),Oo(r,r.mapping.slice(s).map(l,1),n,void 0,u===null);let c=r.mapping.slice(s),d=c.map(l,1),f=c.map(l+o.nodeSize,1);return r.step(new De(d,f,d+1,f-1,new H(R.from(n.create(a,null,o.marks)),0,0),1,!0)),u===!0&&sc(r,o,l,s),!1}})}function sc(r,e,t,n){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=r.mapping.slice(n).map(t+1+s+o.index);r.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function oc(r,e,t,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+s);r.replaceWith(o,o+1,e.type.schema.text(`
11
- `))}})}function Jm(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function Gm(r,e,t,n,i){let s=r.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(n,null,i||s.marks);if(s.isLeaf)return r.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new De(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new H(R.from(o),0,0),1,!0))}function Lt(r,e,t=1,n){let i=r.resolve(e),s=i.depth-t,o=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>s;u--,c--){let d=i.node(u),f=i.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=n&&n[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let p=n&&n[c]||d;if(!d.canReplace(f+1,d.childCount)||!p.type.validContent(h))return!1}let l=i.indexAfter(s),a=n&&n[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function Zm(r,e,t=1,n){let i=r.doc.resolve(e),s=R.empty,o=R.empty;for(let l=i.depth,a=i.depth-t,u=t-1;l>a;l--,u--){s=R.from(i.node(l).copy(s));let c=n&&n[u];o=R.from(c?c.type.create(c.attrs,o):i.node(l).copy(o))}r.step(new xe(e,e,new H(s.append(o),t,t),!0))}function ir(r,e){let t=r.resolve(e),n=t.index();return lc(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function Ym(r,e){e.content.size||r.type.compatibleContent(e.type);let t=r.contentMatchAt(r.childCount),{linebreakReplacement:n}=r.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==n?r.type.schema.nodes.text:s.type;if(t=t.matchType(o),!t||!r.type.allowsMarks(s.marks))return!1}return t.validEnd}function lc(r,e){return!!(r&&e&&!r.isLeaf&&Ym(r,e))}function Xi(r,e,t=-1){let n=r.resolve(e);for(let i=n.depth;;i--){let s,o,l=n.index(i);if(i==n.depth?(s=n.nodeBefore,o=n.nodeAfter):t>0?(s=n.node(i+1),l++,o=n.node(i).maybeChild(l)):(s=n.node(i).maybeChild(l-1),o=n.node(i+1)),s&&!s.isTextblock&&lc(s,o)&&n.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function Qm(r,e,t){let n=null,{linebreakReplacement:i}=r.doc.type.schema,s=r.doc.resolve(e-t),o=s.node().type;if(i&&o.inlineContent){let c=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);c&&!d?n=!1:!c&&d&&(n=!0)}let l=r.steps.length;if(n===!1){let c=r.doc.resolve(e+t);oc(r,c.node(),c.before(),l)}o.inlineContent&&Oo(r,e+t-1,o,s.node().contentMatchAt(s.index()),n==null);let a=r.mapping.slice(l),u=a.map(e-t);if(r.step(new xe(u,a.map(e+t,-1),H.empty,!0)),n===!0){let c=r.doc.resolve(u);sc(r,c.node(),c.before(),r.steps.length)}return r}function Xm(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,t))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,t))return n.after(i+1);if(s<n.node(i).childCount)return null}return null}function ac(r,e,t){let n=r.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let o=n.depth;o>=0;o--){let l=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,a=n.index(o)+(l>0?1:0),u=n.node(o),c=!1;if(s==1)c=u.canReplace(a,a,i);else{let d=u.contentMatchAt(a).findWrapping(i.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?n.pos:l<0?n.before(o+1):n.after(o+1)}return null}function es(r,e,t=e,n=H.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return uc(i,s,n)?new xe(e,t,n):new eg(i,s,n).fit()}function uc(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class eg{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=R.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=R.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new H(s,o,l);return e>-1?new De(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new xe(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=ks(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(t==1&&(o?u.matchType(o.type)||(d=u.fillBefore(R.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:l,parent:s,inject:d};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=ks(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new H(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=ks(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new H(Gr(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new H(Gr(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let p=0;p<s.length;p++)this.openFrontierNode(s[p]);let o=this.unplaced,l=n?n.content:o.content,a=o.openStart-e,u=0,c=[],{match:d,type:f}=this.frontier[t];if(i){for(let p=0;p<i.childCount;p++)c.push(i.child(p));d=d.matchFragment(i)}let h=l.size+e-(o.content.size-o.openEnd);for(;u<l.childCount;){let p=l.child(u),g=d.matchType(p.type);if(!g)break;u++,(u>1||a==0||p.content.size)&&(d=g,c.push(cc(p.mark(f.allowedMarks(p.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=Zr(this.placed,t,R.from(c)),this.frontier[t].match=d,m&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,g=l;p<h;p++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=m?e==0?H.empty:new H(Gr(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new H(Gr(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!vs(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=vs(e,t,i,n,s);if(o){for(let l=t-1;l>=0;l--){let{match:a,type:u}=this.frontier[l],c=vs(e,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Zr(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Zr(this.placed,this.depth,R.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(R.empty,!0);t.childCount&&(this.placed=Zr(this.placed,this.frontier.length,t))}}function Gr(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(Gr(r.firstChild.content,e-1,t)))}function Zr(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(Zr(r.lastChild.content,e-1,t)))}function ks(r,e){for(let t=0;t<e;t++)r=r.firstChild.content;return r}function cc(r,e,t){if(e<=0)return r;let n=r.content;return e>1&&(n=n.replaceChild(0,cc(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(R.empty,!0)))),r.copy(n)}function vs(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let l=n.fillBefore(s.content,!0,o);return l&&!tg(t,s.content,o)?l:null}function tg(r,e,t){for(let n=t;n<e.childCount;n++)if(!r.allowsMarks(e.child(n).marks))return!0;return!1}function rg(r){return r.spec.defining||r.spec.definingForContent}function ng(r,e,t,n){if(!n.size)return r.deleteRange(e,t);let i=r.doc.resolve(e),s=r.doc.resolve(t);if(uc(i,s,n))return r.step(new xe(e,t,n));let o=fc(i,s);o[o.length-1]==0&&o.pop();let l=-(i.depth+1);o.unshift(l);for(let f=i.depth,h=i.pos-1;f>0;f--,h--){let m=i.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(f)>-1?l=f:i.before(f)==h&&o.splice(1,0,-f)}let a=o.indexOf(l),u=[],c=n.openStart;for(let f=n.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==n.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=rg(h.type);if(m&&!h.sameMarkup(i.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let h=(f+c+1)%(n.openStart+1),m=u[h];if(m)for(let p=0;p<o.length;p++){let g=o[(p+a)%o.length],y=!0;g<0&&(y=!1,g=-g);let x=i.node(g-1),k=i.index(g-1);if(x.canReplaceWith(k,k,m.type,m.marks))return r.replace(i.before(g),y?s.after(g):t,new H(dc(n.content,0,n.openStart,h),h,n.openEnd))}}let d=r.steps.length;for(let f=o.length-1;f>=0&&(r.replace(e,t,n),!(r.steps.length>d));f--){let h=o[f];h<0||(e=i.before(h),t=s.after(h))}}function dc(r,e,t,n,i){if(e<t){let s=r.firstChild;r=r.replaceChild(0,s.copy(dc(s.content,e+1,t,n,s)))}if(e>n){let s=i.contentMatchAt(0),o=s.fillBefore(r).append(r);r=o.append(s.matchFragment(o).fillBefore(R.empty,!0))}return r}function ig(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=Xm(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new H(R.from(n),0,0))}function sg(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t);if(n.parent.isTextblock&&i.parent.isTextblock&&n.start()!=i.start()&&n.parentOffset==0&&i.parentOffset==0){let o=n.sharedDepth(t),l=!1;for(let a=n.depth;a>o;a--)n.node(a).type.spec.isolating&&(l=!0);for(let a=i.depth;a>o;a--)i.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=n.depth;a>0&&e==n.start(a);a--)e=n.before(a);for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);n=r.doc.resolve(e),i=r.doc.resolve(t)}}let s=fc(n,i);for(let o=0;o<s.length;o++){let l=s[o],a=o==s.length-1;if(a&&l==0||n.node(l).type.contentMatch.validEnd)return r.delete(n.start(l),i.end(l));if(l>0&&(a||n.node(l-1).canReplace(n.index(l-1),i.indexAfter(l-1))))return r.delete(n.before(l),i.after(l))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return r.delete(n.before(o),t);r.delete(e,t)}function fc(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let s=r.start(i);if(s<r.pos-(r.depth-i)||e.end(i)>e.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class Rr extends Ve{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ce.fail("No node at attribute step's position");let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return Ce.fromReplace(e,this.pos,this.pos+1,new H(R.from(i),0,t.isLeaf?0:1))}getMap(){return et.empty}invert(e){return new Rr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Rr(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Rr(t.pos,t.attr,t.value)}}Ve.jsonID("attr",Rr);class gn extends Ve{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Ce.ok(n)}getMap(){return et.empty}invert(e){return new gn(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new gn(t.attr,t.value)}}Ve.jsonID("docAttr",gn);let Lr=class extends Error{};Lr=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};Lr.prototype=Object.create(Error.prototype);Lr.prototype.constructor=Lr;Lr.prototype.name="TransformError";class hc{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new mn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Lr(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let i=this.mapping.maps[n];n&&(e=i.map(e,1),t=i.map(t,-1)),i.forEach((s,o,l,a)=>{e=Math.min(e,l),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=H.empty){let i=es(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new H(R.from(n),0,0))}delete(e,t){return this.replace(e,t,H.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return ng(this,e,t,n),this}replaceRangeWith(e,t,n){return ig(this,e,t,n),this}deleteRange(e,t){return sg(this,e,t),this}lift(e,t){return jm(this,e,t),this}join(e,t=1){return Qm(this,e,t),this}wrap(e,t){return Wm(this,e,t),this}setBlockType(e,t=e,n,i=null){return Km(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return Gm(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Rr(e,t,n)),this}setDocAttribute(e,t){return this.step(new gn(e,t)),this}addNodeMark(e,t){return this.step(new Zt(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof fe)t.isInSet(n.marks)&&this.step(new wr(e,t));else{let i=n.marks,s,o=[];for(;s=t.isInSet(i);)o.push(new wr(e,s)),i=s.removeFromSet(i);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,t=1,n){return Zm(this,e,t,n),this}addMark(e,t,n){return zm(this,e,t,n),this}removeMark(e,t,n){return qm(this,e,t,n),this}clearIncompatible(e,t,n){return Oo(this,e,t,n),this}}const xs=Object.create(null);class te{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new og(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=H.empty){let n=t.content.lastChild,i=null;for(let l=0;l<t.openEnd;l++)i=n,n=n.lastChild;let s=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:u}=o[l],c=e.mapping.slice(s);e.replaceRange(c.map(a.pos),c.map(u.pos),l?H.empty:t),l==0&&la(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:l}=i[s],a=e.mapping.slice(n),u=a.map(o.pos),c=a.map(l.pos);s?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),la(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new Q(e):Or(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=t<0?Or(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):Or(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new tt(e.node(0))}static atStart(e){return Or(e,e,0,0,1)||new tt(e)}static atEnd(e){return Or(e,e,e.content.size,e.childCount,-1)||new tt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=xs[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in xs)throw new RangeError("Duplicate use of selection JSON ID "+e);return xs[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Q.between(this.$anchor,this.$head).getBookmark()}}te.prototype.visible=!0;class og{constructor(e,t){this.$from=e,this.$to=t}}let sa=!1;function oa(r){!sa&&!r.parent.inlineContent&&(sa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class Q extends te{constructor(e,t=e){oa(e),oa(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return te.near(n);let i=e.resolve(t.map(this.anchor));return new Q(i.parent.inlineContent?i:n,n)}replace(e,t=H.empty){if(super.replace(e,t),t==H.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Q&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ts(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Q(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=te.findFrom(t,n,!0)||te.findFrom(t,-n,!0);if(s)t=s.$head;else return te.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(te.findFrom(e,-n,!0)||te.findFrom(e,n,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new Q(e,t)}}te.jsonID("text",Q);class ts{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ts(e.map(this.anchor),e.map(this.head))}resolve(e){return Q.between(e.resolve(this.anchor),e.resolve(this.head))}}class G extends te{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return n?te.near(s):new G(s)}content(){return new H(R.from(this.node),0,0)}eq(e){return e instanceof G&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Io(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new G(e.resolve(t.anchor))}static create(e,t){return new G(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}G.prototype.visible=!1;te.jsonID("node",G);class Io{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new ts(n,n):new Io(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&G.isSelectable(n)?new G(t):te.near(t)}}class tt extends te{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=H.empty){if(t==H.empty){e.delete(0,e.doc.content.size);let n=te.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new tt(e)}map(e){return new tt(e)}eq(e){return e instanceof tt}getBookmark(){return lg}}te.jsonID("all",tt);const lg={map(){return this},resolve(r){return new tt(r)}};function Or(r,e,t,n,i,s=!1){if(e.inlineContent)return Q.create(r,t);for(let o=n-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&G.isSelectable(l))return G.create(r,t-(i<0?l.nodeSize:0))}else{let a=Or(r,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function la(r,e,t){let n=r.steps.length-1;if(n<e)return;let i=r.steps[n];if(!(i instanceof xe||i instanceof De))return;let s=r.mapping.maps[n],o;s.forEach((l,a,u,c)=>{o==null&&(o=c)}),r.setSelection(te.near(r.doc.resolve(o),t))}const aa=1,qn=2,ua=4;class ag extends hc{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|aa)&~qn,this.storedMarks=null,this}get selectionSet(){return(this.updated&aa)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=qn,this}ensureMarks(e){return fe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&qn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~qn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||fe.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),!e)return this.deleteRange(t,n);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,s)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(te.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=ua,this}get scrolledIntoView(){return(this.updated&ua)>0}}function ca(r,e){return!e||!r?r:r.bind(e)}class Yr{constructor(e,t,n){this.name=e,this.init=ca(t.init,n),this.apply=ca(t.apply,n)}}const ug=[new Yr("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new Yr("selection",{init(r,e){return r.selection||te.atStart(e.doc)},apply(r){return r.selection}}),new Yr("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new Yr("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];class Cs{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ug.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Yr(n.key,n.spec.state,n))})}}class Br{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let a=i?i[o].n:0,u=i?i[o].state:this,c=a<t.length&&l.spec.appendTransaction.call(l,a?t.slice(a):t,u,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),s=!0}i&&(i[o]={state:n,n:t.length})}}if(!s)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Br(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let s=n[i];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new ag(this)}static create(e){let t=new Cs(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Br(t);for(let i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n}reconfigure(e){let t=new Cs(this.schema,e.plugins),n=t.fields,i=new Br(t);for(let s=0;s<n.length;s++){let o=n[s].name;i[o]=this.hasOwnProperty(o)?this[o]:n[s].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(t[n]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Cs(e.schema,e.plugins),s=new Br(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Yt.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=te.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let l in n){let a=n[l],u=a.spec.state;if(a.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){s[o.name]=u.fromJSON.call(a,e,t[l],s);return}}s[o.name]=o.init(e,s)}}),s}}function pc(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=pc(i,e,{})),t[n]=i}return t}class Le{constructor(e){this.spec=e,this.props={},e.props&&pc(e.props,this,this.props),this.key=e.key?e.key.key:mc("plugin")}getState(e){return e[this.key]}}const As=Object.create(null);function mc(r){return r in As?r+"$"+ ++As[r]:(As[r]=0,r+"$")}class nt{constructor(e="key"){this.key=mc(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ie=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},zr=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let Qs=null;const Bt=function(r,e,t){let n=Qs||(Qs=document.createRange());return n.setEnd(r,t??r.nodeValue.length),n.setStart(r,e||0),n},cg=function(){Qs=null},Er=function(r,e,t,n){return t&&(da(r,e,t,n,-1)||da(r,e,t,n,1))},dg=/^(img|br|input|textarea|hr)$/i;function da(r,e,t,n,i){for(var s;;){if(r==t&&e==n)return!0;if(e==(i<0?0:lt(r))){let o=r.parentNode;if(!o||o.nodeType!=1||Sn(r)||dg.test(r.nodeName)||r.contentEditable=="false")return!1;e=Ie(r)+(i<0?0:1),r=o}else if(r.nodeType==1){let o=r.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else r=o,e=i<0?lt(r):0}else return!1}}function lt(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function fg(r,e){for(;;){if(r.nodeType==3&&e)return r;if(r.nodeType==1&&e>0){if(r.contentEditable=="false")return null;r=r.childNodes[e-1],e=lt(r)}else if(r.parentNode&&!Sn(r))e=Ie(r),r=r.parentNode;else return null}}function hg(r,e){for(;;){if(r.nodeType==3&&e<r.nodeValue.length)return r;if(r.nodeType==1&&e<r.childNodes.length){if(r.contentEditable=="false")return null;r=r.childNodes[e],e=0}else if(r.parentNode&&!Sn(r))e=Ie(r)+1,r=r.parentNode;else return null}}function pg(r,e,t){for(let n=e==0,i=e==lt(r);n||i;){if(r==t)return!0;let s=Ie(r);if(r=r.parentNode,!r)return!1;n=n&&s==0,i=i&&s==lt(r)}}function Sn(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const rs=function(r){return r.focusNode&&Er(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function ur(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}function mg(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function gg(r,e,t){if(r.caretPositionFromPoint)try{let n=r.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:Math.min(lt(n.offsetNode),n.offset)}}catch{}if(r.caretRangeFromPoint){let n=r.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:Math.min(lt(n.startContainer),n.startOffset)}}}const St=typeof navigator<"u"?navigator:null,fa=typeof document<"u"?document:null,sr=St&&St.userAgent||"",Xs=/Edge\/(\d+)/.exec(sr),gc=/MSIE \d/.exec(sr),eo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(sr),Qe=!!(gc||eo||Xs),Xt=gc?document.documentMode:eo?+eo[1]:Xs?+Xs[1]:0,ct=!Qe&&/gecko\/(\d+)/i.test(sr);ct&&+(/Firefox\/(\d+)/.exec(sr)||[0,0])[1];const to=!Qe&&/Chrome\/(\d+)/.exec(sr),Fe=!!to,yc=to?+to[1]:0,qe=!Qe&&!!St&&/Apple Computer/.test(St.vendor),qr=qe&&(/Mobile\/\w+/.test(sr)||!!St&&St.maxTouchPoints>2),ot=qr||(St?/Mac/.test(St.platform):!1),bc=St?/Win/.test(St.platform):!1,$t=/Android \d/.test(sr),Dn=!!fa&&"webkitFontSmoothing"in fa.documentElement.style,yg=Dn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function bg(r){let e=r.defaultView&&r.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function Mt(r,e){return typeof r=="number"?r:r[e]}function kg(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,n=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*n}}function ha(r,e,t){if(!ro(e)&&e.left==0)return;let n=r.someProp("scrollThreshold")||0,i=r.someProp("scrollMargin")||5,s=r.dom.ownerDocument;for(let o=t||r.dom;o;){if(o.nodeType!=1){o=zr(o);continue}let l=o,a=l==s.body,u=a?bg(s):kg(l),c=0,d=0;if(e.top<u.top+Mt(n,"top")?d=-(u.top-e.top+Mt(i,"top")):e.bottom>u.bottom-Mt(n,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Mt(i,"top")-u.top:e.bottom-u.bottom+Mt(i,"bottom")),e.left<u.left+Mt(n,"left")?c=-(u.left-e.left+Mt(i,"left")):e.right>u.right-Mt(n,"right")&&(c=e.right-u.right+Mt(i,"right")),c||d)if(a)s.defaultView.scrollBy(c,d);else{let h=l.scrollLeft,m=l.scrollTop;d&&(l.scrollTop+=d),c&&(l.scrollLeft+=c);let p=l.scrollLeft-h,g=l.scrollTop-m;e={left:e.left-p,top:e.top-g,right:e.right-p,bottom:e.bottom-g}}let f=a?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:zr(o)}}function vg(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,o=t+1;o<Math.min(innerHeight,e.bottom);o+=5){let l=r.root.elementFromPoint(s,o);if(!l||l==r.dom||!r.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=t-20){n=l,i=a.top;break}}return{refDOM:n,refTop:i,stack:kc(r.dom)}}function kc(r){let e=[],t=r.ownerDocument;for(let n=r;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),r!=t);n=zr(n));return e}function xg({refDOM:r,refTop:e,stack:t}){let n=r?r.getBoundingClientRect().top:0;vc(t,n==0?0:n-e)}function vc(r,e){for(let t=0;t<r.length;t++){let{dom:n,top:i,left:s}=r[t];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=s&&(n.scrollLeft=s)}}let Tr=null;function Cg(r){if(r.setActive)return r.setActive();if(Tr)return r.focus(Tr);let e=kc(r);r.focus(Tr==null?{get preventScroll(){return Tr={preventScroll:!0},!0}}:void 0),Tr||(Tr=!1,vc(e,0))}function xc(r,e){let t,n=2e8,i,s=0,o=e.top,l=e.top,a,u;for(let c=r.firstChild,d=0;c;c=c.nextSibling,d++){let f;if(c.nodeType==1)f=c.getClientRects();else if(c.nodeType==3)f=Bt(c).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=o&&m.bottom>=l){o=Math.max(m.bottom,o),l=Math.min(m.top,l);let p=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(p<n){t=c,n=p,i=p&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,c.nodeType==1&&p&&(s=d+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!a&&m.left<=e.left&&m.right>=e.left&&(a=c,u={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(s=d+1)}}return!t&&a&&(t=a,i=u,n=0),t&&t.nodeType==3?Ag(t,i):!t||n&&t.nodeType==1?{node:r,offset:s}:xc(t,i)}function Ag(r,e){let t=r.nodeValue.length,n=document.createRange(),i;for(let s=0;s<t;s++){n.setEnd(r,s+1),n.setStart(r,s);let o=Ht(n,1);if(o.top!=o.bottom&&Bo(e,o)){i={node:r,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return n.detach(),i||{node:r,offset:0}}function Bo(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function wg(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<r.getBoundingClientRect().left?t:r}function Eg(r,e,t){let{node:n,offset:i}=xc(e,t),s=-1;if(n.nodeType==1&&!n.firstChild){let o=n.getBoundingClientRect();s=o.left!=o.right&&t.left>(o.left+o.right)/2?1:-1}return r.docView.posFromDOM(n,i,s)}function Sg(r,e,t,n){let i=-1;for(let s=e,o=!1;s!=r.dom;){let l=r.docView.nearestDesc(s,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&a.left>n.left||a.top>n.top?i=l.posBefore:(!o&&a.right<n.left||a.bottom<n.top)&&(i=l.posAfter),o=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?n.top<(a.top+a.bottom)/2:n.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return i>-1?i:r.docView.posFromDOM(e,t,-1)}function Cc(r,e,t){let n=r.childNodes.length;if(n&&t.top<t.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-t.top)/(t.bottom-t.top))-2)),s=i;;){let o=r.childNodes[s];if(o.nodeType==1){let l=o.getClientRects();for(let a=0;a<l.length;a++){let u=l[a];if(Bo(e,u))return Cc(o,e,u)}}if((s=(s+1)%n)==i)break}return r}function Dg(r,e){let t=r.dom.ownerDocument,n,i=0,s=gg(t,e.left,e.top);s&&({node:n,offset:i}=s);let o=(r.root.elementFromPoint?r.root:t).elementFromPoint(e.left,e.top),l;if(!o||!r.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=r.dom.getBoundingClientRect();if(!Bo(e,u)||(o=Cc(r.dom,e,u),!o))return null}if(qe)for(let u=o;n&&u;u=zr(u))u.draggable&&(n=void 0);if(o=wg(o,e),n){if(ct&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let c=n.childNodes[i],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let u;Dn&&i&&n.nodeType==1&&(u=n.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,n==r.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?l=r.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(l=Sg(r,n,i,e))}l==null&&(l=Eg(r,o,e));let a=r.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function ro(r){return r.top<r.bottom||r.left<r.right}function Ht(r,e){let t=r.getClientRects();if(t.length){let n=t[e<0?0:t.length-1];if(ro(n))return n}return Array.prototype.find.call(t,ro)||r.getBoundingClientRect()}const _g=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ac(r,e,t){let{node:n,offset:i,atom:s}=r.docView.domFromPos(e,t<0?-1:1),o=Dn||ct;if(n.nodeType==3)if(o&&(_g.test(n.nodeValue)||(t<0?!i:i==n.nodeValue.length))){let a=Ht(Bt(n,i,i),t);if(ct&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let u=Ht(Bt(n,i-1,i-1),-1);if(u.top==a.top){let c=Ht(Bt(n,i,i+1),-1);if(c.top!=a.top)return Ur(c,c.left<u.left)}}return a}else{let a=i,u=i,c=t<0?1:-1;return t<0&&!i?(u++,c=-1):t>=0&&i==n.nodeValue.length?(a--,c=1):t<0?a--:u++,Ur(Ht(Bt(n,a,u),c),c<0)}if(!r.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==lt(n))){let a=n.childNodes[i-1];if(a.nodeType==1)return ws(a.getBoundingClientRect(),!1)}if(s==null&&i<lt(n)){let a=n.childNodes[i];if(a.nodeType==1)return ws(a.getBoundingClientRect(),!0)}return ws(n.getBoundingClientRect(),t>=0)}if(s==null&&i&&(t<0||i==lt(n))){let a=n.childNodes[i-1],u=a.nodeType==3?Bt(a,lt(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return Ur(Ht(u,1),!1)}if(s==null&&i<lt(n)){let a=n.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let u=a?a.nodeType==3?Bt(a,0,o?0:1):a.nodeType==1?a:null:null;if(u)return Ur(Ht(u,-1),!0)}return Ur(Ht(n.nodeType==3?Bt(n):n,-t),t>=0)}function Ur(r,e){if(r.width==0)return r;let t=e?r.left:r.right;return{top:r.top,bottom:r.bottom,left:t,right:t}}function ws(r,e){if(r.height==0)return r;let t=e?r.top:r.bottom;return{top:t,bottom:t,left:r.left,right:r.right}}function wc(r,e,t){let n=r.state,i=r.root.activeElement;n!=e&&r.updateState(e),i!=r.dom&&r.focus();try{return t()}finally{n!=e&&r.updateState(n),i!=r.dom&&i&&i.focus()}}function Tg(r,e,t){let n=e.selection,i=t=="up"?n.$from:n.$to;return wc(r,e,()=>{let{node:s}=r.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=r.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let o=Ac(r,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Bt(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;u<a.length;u++){let c=a[u];if(c.bottom>c.top+1&&(t=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const Mg=/[\u0590-\u08ac]/;function Og(r,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,o=i==n.parent.content.size,l=r.domSelection();return l?!Mg.test(n.parent.textContent)||!l.modify?t=="left"||t=="backward"?s:o:wc(r,e,()=>{let{focusNode:a,focusOffset:u,anchorNode:c,anchorOffset:d}=r.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let h=n.depth?r.docView.domAfterPos(n.before()):r.dom,{focusNode:m,focusOffset:p}=r.domSelectionRange(),g=m&&!h.contains(m.nodeType==1?m:m.parentNode)||a==m&&u==p;try{l.collapse(c,d),a&&(a!=c||u!=d)&&l.extend&&l.extend(a,u)}catch{}return f!=null&&(l.caretBidiLevel=f),g}):n.pos==n.start()||n.pos==n.end()}let pa=null,ma=null,ga=!1;function Ng(r,e,t){return pa==e&&ma==t?ga:(pa=e,ma=t,ga=t=="up"||t=="down"?Tg(r,e,t):Og(r,e,t))}const dt=0,ya=1,dr=2,mt=3;class _n{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=dt,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let i=this.children[t];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let s,o;if(e==this.contentDOM)s=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>Ie(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(n&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],s=n+i.size;if(n==e&&s!=n){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let l=i.children[o];if(l.size){i=l;break}}return i}if(e<s)return i.descAt(e-n-i.border);n=s}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let s=0;n<this.children.length;n++){let o=this.children[n],l=s+o.size;if(l>e||o instanceof Sc){i=e-s;break}s=l}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof Ec&&s.side>=0;n--);if(t<=0){let s,o=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?Ie(s.dom)+1:0}}else{let s,o=!0;for(;s=n<this.children.length?this.children[n]:null,!(!s||s.dom.parentNode==this.contentDOM);n++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,t):{node:this.contentDOM,offset:s?Ie(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=n,l=0;;l++){let a=this.children[l],u=o+a.size;if(i==-1&&e<=u){let c=o+a.border;if(e>=c&&t<=u-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,c);e=o;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Ie(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(u>t||l==this.children.length-1)){t=u;for(let c=l+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=Ie(d.dom);break}t+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,i=!1){let s=Math.min(e,t),o=Math.max(e,t);for(let h=0,m=0;h<this.children.length;h++){let p=this.children[h],g=m+p.size;if(s>m&&o<g)return p.setSelection(e-m-p.border,t-m-p.border,n,i);m=g}let l=this.domFromPos(e,e?-1:1),a=t==e?l:this.domFromPos(t,t?-1:1),u=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((ct||qe)&&e==t){let{node:h,offset:m}=l;if(h.nodeType==3){if(d=!!(m&&h.nodeValue[m-1]==`
12
- `),d&&m==h.nodeValue.length)for(let p=h,g;p;p=p.parentNode){if(g=p.nextSibling){g.nodeName=="BR"&&(l=a={node:g.parentNode,offset:Ie(g)+1});break}let y=p.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let p=h.childNodes[m-1];d=p&&(p.nodeName=="BR"||p.contentEditable=="false")}}if(ct&&c.focusNode&&c.focusNode!=a.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||d&&qe)&&Er(l.node,l.offset,c.anchorNode,c.anchorOffset)&&Er(a.node,a.offset,c.focusNode,c.focusOffset))return;let f=!1;if((u.extend||e==t)&&!(d&&ct)){u.collapse(l.node,l.offset);try{e!=t&&u.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>t){let m=l;l=a,a=m}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let s=this.children[i],o=n+s.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let l=n+s.border,a=o-s.border;if(e>=l&&t<=a){this.dirty=e==n||t==o?dr:ya,e==l&&t==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=mt:s.markDirty(e-l,t-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?dr:mt}n=o}this.dirty=dr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?dr:ya;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Ec extends _n{constructor(e,t,n,i){let s,o=t.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.hasAttribute("contenteditable")||(o.contentEditable="false"),o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==dt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Ig extends _n{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class er extends _n{constructor(e,t,n,i,s){super(e,[],n,i),this.mark=t,this.spec=s}static create(e,t,n,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,n);return(!o||!o.dom)&&(o=Dr.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new er(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&mt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=mt&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=dt){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=dt}}slice(e,t,n){let i=er.create(this.parent,this.mark,!0,n),s=this.children,o=this.size;t<o&&(s=io(s,t,o,n)),e>0&&(s=io(s,0,e,n));for(let l=0;l<s.length;l++)s[l].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class tr extends _n{constructor(e,t,n,i,s,o,l){super(e,[],s,o),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=l}static create(e,t,n,i,s,o){let l=s.nodeViews[t.type.name],a,u=l&&l(t,s,()=>{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},n,i),c=u&&u.dom,d=u&&u.contentDOM;if(t.isText){if(!c)c=document.createTextNode(t.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=Dr.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let f=c;return c=Tc(c,n,t),u?a=new Bg(e,t,n,i,c,d||null,f,u):t.isText?new ns(e,t,n,i,c,f):new tr(e,t,n,i,c,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let i=this.children[n];if(this.dom.contains(i.dom.parentNode)){t.contentElement=i.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(i=>i.nodeType==1&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));n?t.contentElement=n:t.getContent=()=>R.empty}}return t}matchesNode(e,t,n){return this.dirty==dt&&e.eq(this.node)&&ci(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new Rg(this,o&&o.node,e);Lg(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?a.syncToMarks(u.spec.marks,n,e,c):u.type.side>=0&&!d&&a.syncToMarks(c==this.node.childCount?fe.none:this.node.child(c).marks,n,e,c),a.placeWidget(u,e,i)},(u,c,d,f)=>{a.syncToMarks(u.marks,n,e,f);let h;a.findNodeMatch(u,c,d,f)||l&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(h=a.findIndexWithChild(s.node))>-1&&a.updateNodeAt(u,c,d,h,e)||a.updateNextNode(u,c,d,e,f,i)||a.addNode(u,c,d,e,i),i+=u.nodeSize}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==dr)&&(o&&this.protectLocalComposition(e,o),Dc(this.contentDOM,this.children,e),qr&&zg(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof Q)||n<t||i>t+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,l=qg(this.node.content,o,n-t,i-t);return l<0?null:{node:s,pos:l,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new Ig(this,s,t,i);e.input.compositionNodes.push(o),this.children=io(this.children,n,n+i.length,e,o)}update(e,t,n,i){return this.dirty==mt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=dt}updateOuterDeco(e){if(ci(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=_c(this.dom,this.nodeDOM,no(this.outerDeco,this.node,t),no(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ba(r,e,t,n,i){Tc(n,e,r);let s=new tr(void 0,r,e,t,n,n,n);return s.contentDOM&&s.updateChildren(i,0),s}class ns extends tr{constructor(e,t,n,i,s,o){super(e,t,n,i,s,null,o)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return this.dirty==mt||this.dirty!=dt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=dt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=dt,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new ns(this.parent,i,this.outerDeco,this.innerDeco,s,s)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=mt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Sc extends _n{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==dt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Bg extends tr{constructor(e,t,n,i,s,o,l,a){super(e,t,n,i,s,o,l),this.spec=a}update(e,t,n,i){if(this.dirty==mt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,t,n);return s&&this.updateInner(e,t,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Dc(r,e,t){let n=r.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],l=o.dom;if(l.parentNode==r){for(;l!=n;)n=ka(n),i=!0;n=n.nextSibling}else i=!0,r.insertBefore(l,n);if(o instanceof er){let a=n?n.previousSibling:r.lastChild;Dc(o.contentDOM,o.children,t),n=a?a.nextSibling:r.firstChild}}for(;n;)n=ka(n),i=!0;i&&t.trackWrites==r&&(t.trackWrites=null)}const nn=function(r){r&&(this.nodeName=r)};nn.prototype=Object.create(null);const fr=[new nn];function no(r,e,t){if(r.length==0)return fr;let n=t?fr[0]:new nn,i=[n];for(let s=0;s<r.length;s++){let o=r[s].type.attrs;if(o){o.nodeName&&i.push(n=new nn(o.nodeName));for(let l in o){let a=o[l];a!=null&&(t&&i.length==1&&i.push(n=new nn(e.isInline?"span":"div")),l=="class"?n.class=(n.class?n.class+" ":"")+a:l=="style"?n.style=(n.style?n.style+";":"")+a:l!="nodeName"&&(n[l]=a))}}}return i}function _c(r,e,t,n){if(t==fr&&n==fr)return e;let i=e;for(let s=0;s<n.length;s++){let o=n[s],l=t[s];if(s){let a;l&&l.nodeName==o.nodeName&&i!=r&&(a=i.parentNode)&&a.nodeName.toLowerCase()==o.nodeName||(a=document.createElement(o.nodeName),a.pmIsDeco=!0,a.appendChild(i),l=fr[0]),i=a}Fg(i,l||fr[0],o)}return i}function Fg(r,e,t){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in t)&&r.removeAttribute(n);for(let n in t)n!="class"&&n!="style"&&n!="nodeName"&&t[n]!=e[n]&&r.setAttribute(n,t[n]);if(e.class!=t.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let s=0;s<n.length;s++)i.indexOf(n[s])==-1&&r.classList.remove(n[s]);for(let s=0;s<i.length;s++)n.indexOf(i[s])==-1&&r.classList.add(i[s]);r.classList.length==0&&r.removeAttribute("class")}if(e.style!=t.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)r.style.removeProperty(i[1])}t.style&&(r.style.cssText+=t.style)}}function Tc(r,e,t){return _c(r,r,fr,no(e,t,r.nodeType!=1))}function ci(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(!r[t].type.eq(e[t].type))return!1;return!0}function ka(r){let e=r.nextSibling;return r.parentNode.removeChild(r),e}class Rg{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=$g(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,i){let s=0,o=this.stack.length>>1,l=Math.min(o,e.length);for(;s<l&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=dt,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){a=c;break}}if(a<0&&this.index<this.top.children.length){let c=this.top.children[this.index];c instanceof er&&c.dirty!=mt&&c.mark.type==e[o].type&&c.spec.update&&!this.isLocked(c.dom)&&c.spec.update(e[o])&&(c.mark=e[o],a=this.index,this.changed=!0)}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=er.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))s=this.top.children.indexOf(o,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let u=this.top.children[l];if(u.matchesNode(e,t,n)&&!this.preMatch.matched.has(u)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,n,i,s){let o=this.top.children[i];return o.dirty==mt&&o.dom==o.contentDOM&&(o.dirty=dr),o.update(e,t,n,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=t}}updateNextNode(e,t,n,i,s,o){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof tr){let u=this.preMatch.matched.get(a);if(u!=null&&u!=s)return!1;let c=a.dom,d,f=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=mt&&ci(t,a.outerDeco));if(!f&&a.update(e,t,n,i))return this.destroyBetween(this.index,l),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(a,e,t,n,i,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=dr,d.updateChildren(i,o+1),d.dirty=dt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,i,s,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ci(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=tr.create(this.top,t,n,i,s,o);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,t,n,i,s){let o=tr.create(this.top,e,t,n,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new Ec(this.top,e,t,n);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof er;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ns)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((qe||Fe)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new Sc(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function $g(r,e){let t=e,n=t.children.length,i=r.childCount,s=new Map,o=[];e:for(;i>0;){let l;for(;;)if(n){let u=t.children[n-1];if(u instanceof er)t=u,n=u.children.length;else{l=u,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=r.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}function Pg(r,e){return r.type.side-e.type.side}function Lg(r,e,t,n){let i=e.locals(r),s=0;if(i.length==0){for(let u=0;u<r.childCount;u++){let c=r.child(u);n(c,i,e.forChild(s,c),u),s+=c.nodeSize}return}let o=0,l=[],a=null;for(let u=0;;){let c,d;for(;o<i.length&&i[o].to==s;){let g=i[o++];g.widget&&(c?(d||(d=[c])).push(g):c=g)}if(c)if(d){d.sort(Pg);for(let g=0;g<d.length;g++)t(d[g],u,!!a)}else t(c,u,!!a);let f,h;if(a)h=-1,f=a,a=null;else if(u<r.childCount)h=u,f=r.child(u++);else break;for(let g=0;g<l.length;g++)l[g].to<=s&&l.splice(g--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)l.push(i[o++]);let m=s+f.nodeSize;if(f.isText){let g=m;o<i.length&&i[o].from<g&&(g=i[o].from);for(let y=0;y<l.length;y++)l[y].to<g&&(g=l[y].to);g<m&&(a=f.cut(g-s),f=f.cut(0,g-s),m=g,h=-1)}else for(;o<i.length&&i[o].to<m;)o++;let p=f.isInline&&!f.isLeaf?l.filter(g=>!g.inline):l.slice();n(f,p,e.forChild(s,f),h),s=m}}function zg(r){if(r.nodeName=="UL"||r.nodeName=="OL"){let e=r.style.cssText;r.style.cssText=e+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=e}}function qg(r,e,t,n){for(let i=0,s=0;i<r.childCount&&s<=n;){let o=r.child(i++),l=s;if(s+=o.nodeSize,!o.isText)continue;let a=o.text;for(;i<r.childCount;){let u=r.child(i++);if(s+=u.nodeSize,!u.isText)break;a+=u.text}if(s>=t){if(s>=n&&a.slice(n-e.length-l,n-l)==e)return n-e.length;let u=l<n?a.lastIndexOf(e,n-l-1):-1;if(u>=0&&u+e.length+l>=t)return l+u;if(t==n&&a.length>=n+e.length-l&&a.slice(n-l,n-l+e.length)==e)return n}}return-1}function io(r,e,t,n,i){let s=[];for(let o=0,l=0;o<r.length;o++){let a=r[o],u=l,c=l+=a.size;u>=t||c<=e?s.push(a):(u<e&&s.push(a.slice(0,e-u,n)),i&&(s.push(i),i=void 0),c>t&&s.push(a.slice(t-u,a.size,n)))}return s}function Fo(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=n.resolve(o),a,u;if(rs(t)){for(a=o;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&G.isSelectable(d)&&i.parent&&!(d.isInline&&pg(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;u=new G(o==f?l:n.resolve(f))}}else{if(t instanceof r.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=o,f=o;for(let h=0;h<t.rangeCount;h++){let m=t.getRangeAt(h);d=Math.min(d,r.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,r.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(d<0)return null;[a,o]=f==r.state.selection.anchor?[f,d]:[d,f],l=n.resolve(o)}else a=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(a<0)return null}let c=n.resolve(a);if(!u){let d=e=="pointer"||r.state.selection.head<l.pos&&!s?1:-1;u=Ro(r,c,l,d)}return u}function Mc(r){return r.editable?r.hasFocus():Nc(r)&&document.activeElement&&document.activeElement.contains(r.dom)}function zt(r,e=!1){let t=r.state.selection;if(Oc(r,t),!Mc(r))return;let n=r.input.mouseDown;if(!e&&Fe&&n){let i=r.domSelectionRange(),s=r.domObserver.currentSelection;if(i.anchorNode&&s.anchorNode&&Er(i.anchorNode,i.anchorOffset,s.anchorNode,s.anchorOffset)&&n.delaySelUpdate()){r.domObserver.setCurSelection();return}}if(r.domObserver.disconnectSelection(),r.cursorWrapper)jg(r);else{let{anchor:i,head:s}=t,o,l;va&&!(t instanceof Q)&&(t.$from.parent.inlineContent||(o=xa(r,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(l=xa(r,t.to))),r.docView.setSelection(i,s,r,e),va&&(o&&Ca(o),l&&Ca(l)),t.visible?r.dom.classList.remove("ProseMirror-hideselection"):(r.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Vg(r))}r.domObserver.setCurSelection(),r.domObserver.connectSelection()}const va=qe||Fe&&yc<63;function xa(r,e){let{node:t,offset:n}=r.docView.domFromPos(e,0),i=n<t.childNodes.length?t.childNodes[n]:null,s=n?t.childNodes[n-1]:null;if(qe&&i&&i.contentEditable=="false")return Es(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Es(i);if(s)return Es(s)}}function Es(r){return r.contentEditable="true",qe&&r.draggable&&(r.draggable=!1,r.wasDraggable=!0),r}function Ca(r){r.contentEditable="false",r.wasDraggable&&(r.draggable=!0,r.wasDraggable=null)}function Vg(r){let e=r.dom.ownerDocument;e.removeEventListener("selectionchange",r.input.hideSelectionGuard);let t=r.domSelectionRange(),n=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!Mc(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function jg(r){let e=r.domSelection();if(!e)return;let t=r.cursorWrapper.dom,n=t.nodeName=="IMG";n?e.collapse(t.parentNode,Ie(t)+1):e.collapse(t,0),!n&&!r.state.selection.visible&&Qe&&Xt<=11&&(t.disabled=!0,t.disabled=!1)}function Oc(r,e){if(e instanceof G){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(Aa(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else Aa(r)}function Aa(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function Ro(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||Q.between(e,t,n)}function wa(r){return r.editable&&!r.hasFocus()?!1:Nc(r)}function Nc(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Hg(r){let e=r.docView.domFromPos(r.state.selection.anchor,0),t=r.domSelectionRange();return Er(e.node,e.offset,t.anchorNode,t.anchorOffset)}function so(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),s=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return s&&te.findFrom(s,e)}function Ut(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function Ea(r,e,t){let n=r.state.selection;if(n instanceof Q)if(t.indexOf("s")>-1){let{$head:i}=n,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=r.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Ut(r,new Q(n.$anchor,o))}else if(n.empty){if(r.endOfTextblock(e>0?"forward":"backward")){let i=so(r.state,e);return i&&i instanceof G?Ut(r,i):!1}else if(!(ot&&t.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=r.docView.descAt(l))&&!o.contentDOM?G.isSelectable(s)?Ut(r,new G(e<0?r.state.doc.resolve(i.pos-s.nodeSize):i)):Dn?Ut(r,new Q(r.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(n instanceof G&&n.node.isInline)return Ut(r,new Q(e>0?n.$to:n.$from));{let i=so(r.state,e);return i?Ut(r,i):!1}}}function di(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function sn(r,e){let t=r.pmViewDesc;return t&&t.size==0&&(e<0||r.nextSibling||r.nodeName!="BR")}function Mr(r,e){return e<0?Ug(r):Wg(r)}function Ug(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,s,o=!1;for(ct&&t.nodeType==1&&n<di(t)&&sn(t.childNodes[n],-1)&&(o=!0);;)if(n>0){if(t.nodeType!=1)break;{let l=t.childNodes[n-1];if(sn(l,-1))i=t,s=--n;else if(l.nodeType==3)t=l,n=t.nodeValue.length;else break}}else{if(Ic(t))break;{let l=t.previousSibling;for(;l&&sn(l,-1);)i=t.parentNode,s=Ie(l),l=l.previousSibling;if(l)t=l,n=di(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?oo(r,t,n):i&&oo(r,i,s)}function Wg(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=di(t),s,o;for(;;)if(n<i){if(t.nodeType!=1)break;let l=t.childNodes[n];if(sn(l,1))s=t,o=++n;else break}else{if(Ic(t))break;{let l=t.nextSibling;for(;l&&sn(l,1);)s=l.parentNode,o=Ie(l)+1,l=l.nextSibling;if(l)t=l,n=0,i=di(t);else{if(t=t.parentNode,t==r.dom)break;n=i=0}}}s&&oo(r,s,o)}function Ic(r){let e=r.pmViewDesc;return e&&e.node&&e.node.isBlock}function Kg(r,e){for(;r&&e==r.childNodes.length&&!Sn(r);)e=Ie(r)+1,r=r.parentNode;for(;r&&e<r.childNodes.length;){let t=r.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=0}}function Jg(r,e){for(;r&&!e&&!Sn(r);)e=Ie(r),r=r.parentNode;for(;r&&e;){let t=r.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=r.childNodes.length}}function oo(r,e,t){if(e.nodeType!=3){let s,o;(o=Kg(e,t))?(e=o,t=0):(s=Jg(e,t))&&(e=s,t=s.nodeValue.length)}let n=r.domSelection();if(!n)return;if(rs(n)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),n.removeAllRanges(),n.addRange(s)}else n.extend&&n.extend(e,t);r.domObserver.setCurSelection();let{state:i}=r;setTimeout(()=>{r.state==i&&zt(r)},50)}function Sa(r,e){let t=r.state.doc.resolve(e);if(!(Fe||bc)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let s=r.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=r.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function Da(r,e,t){let n=r.state.selection;if(n instanceof Q&&!n.empty||t.indexOf("s")>-1||ot&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=so(r.state,e);if(o&&o instanceof G)return Ut(r,o)}if(!i.parent.inlineContent){let o=e<0?i:s,l=n instanceof tt?te.near(o,e):te.findFrom(o,e);return l?Ut(r,l):!1}return!1}function _a(r,e){if(!(r.state.selection instanceof Q))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=r.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),r.dispatch(o),!0}return!1}function Ta(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function Gg(r){if(!qe||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;Ta(r,n,"true"),setTimeout(()=>Ta(r,n,"false"),20)}return!1}function Zg(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function Yg(r,e){let t=e.keyCode,n=Zg(e);if(t==8||ot&&t==72&&n=="c")return _a(r,-1)||Mr(r,-1);if(t==46&&!e.shiftKey||ot&&t==68&&n=="c")return _a(r,1)||Mr(r,1);if(t==13||t==27)return!0;if(t==37||ot&&t==66&&n=="c"){let i=t==37?Sa(r,r.state.selection.from)=="ltr"?-1:1:-1;return Ea(r,i,n)||Mr(r,i)}else if(t==39||ot&&t==70&&n=="c"){let i=t==39?Sa(r,r.state.selection.from)=="ltr"?1:-1:1;return Ea(r,i,n)||Mr(r,i)}else{if(t==38||ot&&t==80&&n=="c")return Da(r,-1,n)||Mr(r,-1);if(t==40||ot&&t==78&&n=="c")return Gg(r)||Da(r,1,n)||Mr(r,1);if(n==(ot?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function $o(r,e){r.someProp("transformCopied",h=>{e=h(e,r)});let t=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let h=n.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),n=h.content}let o=r.someProp("clipboardSerializer")||Dr.fromSchema(r.state.schema),l=Lc(),a=l.createElement("div");a.appendChild(o.serializeFragment(n,{document:l}));let u=a.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=Pc[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let m=l.createElement(c[h]);for(;a.firstChild;)m.appendChild(a.firstChild);a.appendChild(m),d++}u=a.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=r.someProp("clipboardTextSerializer",h=>h(e,r))||e.content.textBetween(0,e.content.size,`
13
-
14
- `);return{dom:a,text:f,slice:e}}function Bc(r,e,t,n,i){let s=i.parent.type.spec.code,o,l;if(!t&&!e)return null;let a=!!e&&(n||s||!t);if(a){if(r.someProp("transformPastedText",f=>{e=f(e,s||n,r)}),s)return l=new H(R.from(r.state.schema.text(e.replace(/\r\n?/g,`
15
- `))),0,0),r.someProp("transformPasted",f=>{l=f(l,r,!0)}),l;let d=r.someProp("clipboardTextParser",f=>f(e,i,n,r));if(d)l=d;else{let f=i.marks(),{schema:h}=r.state,m=Dr.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(p=>{let g=o.appendChild(document.createElement("p"));p&&g.appendChild(m.serializeNode(h.text(p,f)))})}}else r.someProp("transformPastedHTML",d=>{t=d(t,r)}),o=t0(t),Dn&&r0(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(r.someProp("clipboardParser")||r.someProp("domParser")||Qt.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||c),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!Qg.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)l=n0(Ma(l,+c[1],+c[2]),c[4]);else if(l=H.maxOpen(Xg(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d<l.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=Ma(l,d,f)}return r.someProp("transformPasted",d=>{l=d(l,r,a)}),l}const Qg=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Xg(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(r.forEach(l=>{if(!o)return;let a=i.findWrapping(l.type),u;if(!a)return o=null;if(u=o.length&&s.length&&Rc(a,s,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=$c(o[o.length-1],s.length));let c=Fc(l,a);o.push(c),i=i.matchType(c.type),s=a}}),o)return R.from(o)}return r}function Fc(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,R.from(r));return r}function Rc(r,e,t,n,i){if(i<r.length&&i<e.length&&r[i]==e[i]){let s=Rc(r,e,t,n.lastChild,i+1);if(s)return n.copy(n.content.replaceChild(n.childCount-1,s));if(n.contentMatchAt(n.childCount).matchType(i==r.length-1?t.type:r[i+1]))return n.copy(n.content.append(R.from(Fc(t,r,i+1))))}}function $c(r,e){if(e==0)return r;let t=r.content.replaceChild(r.childCount-1,$c(r.lastChild,e-1)),n=r.contentMatchAt(r.childCount).fillBefore(R.empty,!0);return r.copy(t.append(n))}function lo(r,e,t,n,i,s){let o=e<0?r.firstChild:r.lastChild,l=o.content;return r.childCount>1&&(s=0),i<n-1&&(l=lo(l,e,t,n,i+1,s)),i>=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(R.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(l))}function Ma(r,e,t){return e<r.openStart&&(r=new H(lo(r.content,-1,e,r.openStart,0,r.openEnd),e,r.openEnd)),t<r.openEnd&&(r=new H(lo(r.content,1,t,r.openEnd,0,0),r.openStart,t)),r}const Pc={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function Lc(){return document.implementation.createHTMLDocument("title")}let Wr=null;function e0(r){let e=window.trustedTypes;if(!e)return r;if(!Wr){if(Wr=e.defaultPolicy)try{return Wr.createHTML(r)}catch{}Wr=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})}return Wr.createHTML(r)}function t0(r){let e=/^(\s*<meta [^>]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=Lc(),n=t.body,i=/<([a-z][^>\s]+)/i.exec(r),s;if((s=i&&Pc[i[1].toLowerCase()])&&(r=s.map(o=>"<"+o+">").join("")+r+s.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=e0(r),s)for(let o=0;o<s.length;o++)n=n.querySelector(s[o])||n;for(let o=0;o<t.styleSheets.length;o++){let l=t.styleSheets[o];for(let a=0;a<l.rules.length;a++){let u=l.rules[a];if(u instanceof CSSStyleRule){let c=n.querySelectorAll(u.selectorText);for(let d=0;d<c.length;d++)c[d].style.cssText+=u.style.cssText}}}return n}function r0(r){let e=r.querySelectorAll(Fe?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let n=e[t];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "),n)}}function n0(r,e){if(!r.size)return r;let t=r.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return r}let{content:i,openStart:s,openEnd:o}=r;for(let l=n.length-2;l>=0;l-=2){let a=t.nodes[n[l]];if(!a||a.hasRequiredAttrs())break;try{a.checkAttrs(n[l+1])}catch{break}i=R.from(a.create(n[l+1],i)),s++,o++}return new H(i,s,o)}const He={},Ue={},i0={touchstart:!0,touchmove:!0};class s0{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function o0(r){for(let e in He){let t=He[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=n=>{a0(r,n)&&!Po(r,n)&&(r.editable||!(n.type in Ue))&&t(r,n)},i0[e]?{passive:!0}:void 0)}qe&&r.dom.addEventListener("input",()=>null),ao(r)}function Pt(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}function l0(r){r.input.mouseDown&&r.input.mouseDown.done(),r.domObserver.stop();for(let e in r.input.eventHandlers)r.dom.removeEventListener(e,r.input.eventHandlers[e]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}function ao(r){r.someProp("handleDOMEvents",e=>{for(let t in e)r.input.eventHandlers[t]||r.dom.addEventListener(t,r.input.eventHandlers[t]=n=>Po(r,n))})}function Po(r,e){return r.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(r,e)||e.defaultPrevented:!1})}function a0(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=r.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function u0(r,e){!Po(r,e)&&He[e.type]&&(r.editable||!(e.type in Ue))&&He[e.type](r,e)}Ue.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!jc(r)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!($t&&Fe&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),qr&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,ur(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||Yg(r,t)?t.preventDefault():Pt(r,"key")};Ue.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)};Ue.keypress=(r,e)=>{let t=e;if(jc(r)||!t.charCode||t.ctrlKey&&!t.altKey||ot&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof Q)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode),s=()=>r.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",o=>o(r,n.$from.pos,n.$to.pos,i,s))&&r.dispatch(s()),t.preventDefault()}};function Tn(r){return{left:r.clientX,top:r.clientY}}function c0(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function Lo(r,e,t,n,i){if(n==-1)return!1;let s=r.state.doc.resolve(n);for(let o=s.depth+1;o>0;o--)if(r.someProp(e,l=>o>s.depth?l(r,t,s.nodeAfter,s.before(o),i,!0):l(r,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function Mn(r,e,t){if(r.focused||r.focus(),r.state.selection.eq(e))return;let n=r.state.tr.setSelection(e);n.setMeta("pointer",!0),r.dispatch(n)}function d0(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&G.isSelectable(n)?(Mn(r,new G(t)),!0):!1}function f0(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof G&&(n=t.node);let s=r.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(G.isSelectable(l)){n&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(Mn(r,G.create(r.state.doc,i)),!0):!1}function h0(r,e,t,n,i){return Lo(r,"handleClickOn",e,t,n)||r.someProp("handleClick",s=>s(r,e,n))||(i?f0(r,t):d0(r,t))}function p0(r,e,t,n){return Lo(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function m0(r,e,t,n){return Lo(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||g0(r,t,n)}function g0(r,e,t){if(t.button!=0)return!1;let n=zc(r,e,!0),i=r.state.doc;return n?(Mn(r,n),n instanceof Q&&i.eq(r.state.doc)&&(r.input.mouseDown=new b0(r,n)),!0):!1}function zc(r,e,t){let n=r.state.doc;if(e==-1)return n.inlineContent?Q.create(n,0,n.content.size):null;let i=n.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)return Q.create(n,l+1,l+1+o.content.size);if(t&&G.isSelectable(o))return G.create(n,l)}return null}function zo(r){return fi(r)}const qc=ot?"metaKey":"ctrlKey";He.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=zo(r),i=Date.now(),s="singleClick";i-r.input.lastClick.time<500&&c0(t,r.input.lastClick)&&!t[qc]&&r.input.lastClick.button==t.button&&(r.input.lastClick.type=="singleClick"?s="doubleClick":r.input.lastClick.type=="doubleClick"&&(s="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s,button:t.button},r.input.mouseDown&&r.input.mouseDown.done();let o=r.posAtCoords(Tn(t));o&&(s=="singleClick"?r.input.mouseDown=new y0(r,o,t,!!n):(s=="doubleClick"?p0:m0)(r,o.pos,o.inside,t)?t.preventDefault():Pt(r,"pointer"))};class Vc{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class y0 extends Vc{constructor(e,t,n,i){super(e),this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[qc],this.allowDefault=n.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let c=e.state.doc.resolve(t.pos);s=c.parent,o=c.depth?c.before():0}const l=i?null:n.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:u}=e.state;n.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof G&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ct&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Pt(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||zt(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Tn(e))),this.updateAllowDefault(e),this.allowDefault||!t?Pt(this.view,"pointer"):h0(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||qe&&this.mightDrag&&!this.mightDrag.node.isAtom||Fe&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Mn(this.view,te.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Pt(this.view,"pointer")}move(e){this.updateAllowDefault(e),Pt(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class b0 extends Vc{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Pt(this.view,"pointer");let t=this.view.posAtCoords(Tn(e)),n=t&&zc(this.view,t.inside,!1);if(!n)return;let{doc:i}=this.view.state,s=this.startSelection,[o,l]=n.from<s.from?[s.to,n.from]:[s.from,n.to];Mn(this.view,Q.create(i,o,l))}}He.touchstart=r=>{r.input.lastTouch=Date.now(),zo(r),Pt(r,"pointer")};He.touchmove=r=>{r.input.lastTouch=Date.now(),Pt(r,"pointer")};He.contextmenu=r=>zo(r);function jc(r,e){return r.composing?!0:qe&&Math.abs(Date.now()-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const k0=$t?5e3:-1;Ue.compositionstart=Ue.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$to;if(e.selection instanceof Q&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||Fe&&bc&&v0(r)))r.markCursor=r.state.storedMarks||t.marks(),fi(r,!0),r.markCursor=null;else if(fi(r,!e.selection.empty),ct&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let l=r.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}r.input.composing=!0}Hc(r,k0)};function v0(r){let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let n=e.childNodes[t];return n.nodeType==1&&n.contentEditable=="false"}Ue.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=Date.now(),r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.badSafariComposition?r.domObserver.forceFlush():r.input.compositionPendingChanges&&Promise.resolve().then(()=>r.domObserver.flush()),r.input.compositionID++,Hc(r,20))};function Hc(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>fi(r),e))}function Uc(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=Date.now());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function x0(r){let e=r.domSelectionRange();if(!e.focusNode)return null;let t=fg(e.focusNode,e.focusOffset),n=hg(e.focusNode,e.focusOffset);if(t&&n&&t!=n){let i=n.pmViewDesc,s=r.domObserver.lastChangedTextNode;if(t==s||n==s)return s;if(!i||!i.isText(n.nodeValue))return n;if(r.input.compositionNode==n){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return n}}return t||n}function fi(r,e=!1){if(!($t&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),Uc(r),e||r.docView&&r.docView.dirty){let t=Fo(r),n=r.state.selection;return t&&!t.eq(n)?r.dispatch(r.state.tr.setSelection(t)):(r.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?r.dispatch(r.state.tr.deleteSelection()):r.updateState(r.state),!0}return!1}}function C0(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const yn=Qe&&Xt<15||qr&&yg<604;He.copy=Ue.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let s=yn?null:t.clipboardData,o=n.content(),{dom:l,text:a}=$o(r,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):C0(r,l),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function A0(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function w0(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=r.input.shiftKey&&r.input.lastKeyCode!=45;setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?bn(r,n.value,null,i,e):bn(r,n.textContent,n.innerHTML,i,e)},50)}function bn(r,e,t,n,i){let s=Bc(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",a=>a(r,i,s||H.empty)))return!0;if(!s)return!1;let o=A0(s),l=o?r.state.tr.replaceSelectionWith(o,n):r.state.tr.replaceSelection(s);return r.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Wc(r){let e=r.getData("text/plain")||r.getData("Text");if(e)return e;let t=r.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ue.paste=(r,e)=>{let t=e;if(r.composing&&!$t)return;let n=yn?null:t.clipboardData,i=r.input.shiftKey&&r.input.lastKeyCode!=45;n&&bn(r,Wc(n),n.getData("text/html"),i,t)?t.preventDefault():w0(r,t)};class Kc{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const E0=ot?"altKey":"ctrlKey";function Jc(r,e){let t;return r.someProp("dragCopies",n=>{t=t||n(e)}),t!=null?!t:!e[E0]}He.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,s=i.empty?null:r.posAtCoords(Tn(t)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof G?i.to-1:i.to))){if(n&&n.mightDrag)o=G.create(r.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=r.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=r.docView&&(o=G.create(r.state.doc,d.posBefore))}}let l=(o||r.state.selection).content(),{dom:a,text:u,slice:c}=$o(r,l);(!t.dataTransfer.files.length||!Fe||yc>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(yn?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",yn||t.dataTransfer.setData("text/plain",u),r.dragging=new Kc(c,Jc(r,t),o)};He.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)};Ue.dragover=Ue.dragenter=(r,e)=>e.preventDefault();Ue.drop=(r,e)=>{try{S0(r,e,r.dragging)}finally{r.dragging=null}};function S0(r,e,t){if(!e.dataTransfer)return;let n=r.posAtCoords(Tn(e));if(!n)return;let i=r.state.doc.resolve(n.pos),s=t&&t.slice;s?r.someProp("transformPasted",h=>{s=h(s,r,!1)}):s=Bc(r,Wc(e.dataTransfer),yn?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&Jc(r,e));if(r.someProp("handleDrop",h=>h(r,e,s||H.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let l=s?ac(r.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let a=r.state.tr;if(o){let{node:h}=t;h?h.replace(a):a.deleteSelection()}let u=a.mapping.map(l),c=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=a.doc;if(c?a.replaceRangeWith(u,u,s.content.firstChild):a.replaceRange(u,u,s),a.doc.eq(d))return;let f=a.doc.resolve(u);if(c&&G.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new G(f));else{let h=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((m,p,g,y)=>h=y),a.setSelection(Ro(r,f,a.doc.resolve(h)))}r.focus(),r.dispatch(a.setMeta("uiEvent","drop"))}He.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&zt(r)},20))};He.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)};He.beforeinput=(r,e)=>{if($t&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",s=>s(r,ur(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in Ue)He[r]=Ue[r];function kn(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class hi{constructor(e,t){this.toDOM=e,this.spec=t||kr,this.side=this.spec.side||0}map(e,t,n,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new at(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof hi&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&kn(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class rr{constructor(e,t){this.attrs=e,this.spec=t||kr}map(e,t,n,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=o?null:new at(s,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof rr&&kn(this.attrs,e.attrs)&&kn(this.spec,e.spec)}static is(e){return e.type instanceof rr}destroy(){}}class qo{constructor(e,t){this.attrs=e,this.spec=t||kr}map(e,t,n,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=s.pos?null:new at(s.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(n)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof qo&&kn(this.attrs,e.attrs)&&kn(this.spec,e.spec)}destroy(){}}class at{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new at(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new at(e,e,new hi(t,n))}static inline(e,t,n,i){return new at(e,t,new rr(n,i))}static node(e,t,n,i){return new at(e,t,new qo(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof rr}get widget(){return this.type instanceof hi}}const Nr=[],kr={};class Ee{constructor(e,t){this.local=e.length?e:Nr,this.children=t.length?t:Nr}static create(e,t){return t.length?pi(t,e,0,kr):ze}find(e,t,n){let i=[];return this.findInner(e??0,t??1e9,i,0,n),i}findInner(e,t,n,i,s){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=t&&l.to>=e&&(!s||s(l.spec))&&n.push(l.copy(l.from+i,l.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,n,i+l,s)}}map(e,t,n){return this==ze||e.maps.length==0?this:this.mapInner(e,t,0,0,n||kr)}mapInner(e,t,n,i,s){let o;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,n,i);a&&a.type.valid(t,a)?(o||(o=[])).push(a):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?D0(this.children,o||[],e,t,n,i,s):o?new Ee(o.sort(vr),Nr):ze}add(e,t){return t.length?this==ze?Ee.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,s=0;e.forEach((l,a)=>{let u=a+n,c;if(c=Zc(t,l,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<a;)s+=3;i[s]==a?i[s+2]=i[s+2].addInner(l,c,u+1):i.splice(s,0,a,a+l.nodeSize,pi(c,l,u+1,kr)),s+=3}});let o=Gc(s?Yc(t):t,-n);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new Ee(o.length?this.local.concat(o).sort(vr):this.local,i||this.children)}remove(e){return e.length==0||this==ze?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let s=0;s<n.length;s+=3){let o,l=n[s]+t,a=n[s+1]+t;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>l&&d.to<a&&(e[c]=null,(o||(o=[])).push(d));if(!o)continue;n==this.children&&(n=this.children.slice());let u=n[s+2].removeInner(o,l+1);u!=ze?n[s+2]=u:(n.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let l=0;l<i.length;l++)i[l].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new Ee(i,n):ze}forChild(e,t){if(this==ze)return this;if(t.isLeaf)return Ee.empty;let n,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(n=this.children[l+2]);break}let s=e+1,o=s+t.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<o&&a.to>s&&a.type instanceof rr){let u=Math.max(s,a.from)-s,c=Math.min(o,a.to)-s;u<c&&(i||(i=[])).push(a.copy(u,c))}}if(i){let l=new Ee(i.sort(vr),Nr);return n?new Jt([l,n]):l}return n||ze}eq(e){if(this==e)return!0;if(!(e instanceof Ee)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Vo(this.localsInner(e))}localsInner(e){if(this==ze)return Nr;if(e.inlineContent||!this.local.some(rr.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof rr||t.push(this.local[n]);return t}forEachSet(e){e(this)}}Ee.empty=new Ee([],[]);Ee.removeOverlap=Vo;const ze=Ee.empty;class Jt{constructor(e){this.members=e}map(e,t){const n=this.members.map(i=>i.map(e,t,kr));return Jt.from(n)}forChild(e,t){if(t.isLeaf)return Ee.empty;let n=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=ze&&(s instanceof Jt?n=n.concat(s.members):n.push(s))}return Jt.from(n)}eq(e){if(!(e instanceof Jt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{n&&(t=t.slice(),n=!1);for(let o=0;o<s.length;o++)t.push(s[o])}}return t?Vo(n?t:t.sort(vr)):Nr}static from(e){switch(e.length){case 0:return ze;case 1:return e[0];default:return new Jt(e.every(t=>t instanceof Ee)?e:e.reduce((t,n)=>t.concat(n instanceof Ee?n:n.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function D0(r,e,t,n,i,s,o){let l=r.slice();for(let u=0,c=s;u<t.maps.length;u++){let d=0;t.maps[u].forEach((f,h,m,p)=>{let g=p-m-(h-f);for(let y=0;y<l.length;y+=3){let x=l[y+1];if(x<0||f>x+c-d)continue;let k=l[y]+c-d;h>=k?l[y+1]=f<=k?-2:-1:f>=c&&g&&(l[y]+=g,l[y+1]+=g)}d+=g}),c=t.maps[u].map(c,-1)}let a=!1;for(let u=0;u<l.length;u+=3)if(l[u+1]<0){if(l[u+1]==-2){a=!0,l[u+1]=-1;continue}let c=t.map(r[u]+s),d=c-i;if(d<0||d>=n.content.size){a=!0;continue}let f=t.map(r[u+1]+s,-1),h=f-i,{index:m,offset:p}=n.content.findIndex(d),g=n.maybeChild(m);if(g&&p==d&&p+g.nodeSize==h){let y=l[u+2].mapInner(t,g,c+1,r[u]+s+1,o);y!=ze?(l[u]=d,l[u+1]=h,l[u+2]=y):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=_0(l,r,e,t,i,s,o),c=pi(u,n,0,o);e=c.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<c.children.length;d+=3){let h=c.children[d];for(;f<l.length&&l[f]<h;)f+=3;l.splice(f,0,c.children[d],c.children[d+1],c.children[d+2])}}return new Ee(e.sort(vr),l)}function Gc(r,e){if(!e||!r.length)return r;let t=[];for(let n=0;n<r.length;n++){let i=r[n];t.push(new at(i.from+e,i.to+e,i.type))}return t}function _0(r,e,t,n,i,s,o){function l(a,u){for(let c=0;c<a.local.length;c++){let d=a.local[c].map(n,i,u);d?t.push(d):o.onRemove&&o.onRemove(a.local[c].spec)}for(let c=0;c<a.children.length;c+=3)l(a.children[c+2],a.children[c]+u+1)}for(let a=0;a<r.length;a+=3)r[a+1]==-1&&l(r[a+2],e[a]+s+1);return t}function Zc(r,e,t){if(e.isLeaf)return null;let n=t+e.nodeSize,i=null;for(let s=0,o;s<r.length;s++)(o=r[s])&&o.from>t&&o.to<n&&((i||(i=[])).push(o),r[s]=null);return i}function Yc(r){let e=[];for(let t=0;t<r.length;t++)r[t]!=null&&e.push(r[t]);return e}function pi(r,e,t,n){let i=[],s=!1;e.forEach((l,a)=>{let u=Zc(r,l,a+t);if(u){s=!0;let c=pi(u,l,t+a+1,n);c!=ze&&i.push(a,a+l.nodeSize,c)}});let o=Gc(s?Yc(r):r,-t).sort(vr);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(n.onRemove&&n.onRemove(o[l].spec),o.splice(l--,1));return o.length||i.length?new Ee(o,i):ze}function vr(r,e){return r.from-e.from||r.to-e.to}function Vo(r){let e=r;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.from!=n.to)for(let i=t+1;i<e.length;i++){let s=e[i];if(s.from==n.from){s.to!=n.to&&(e==r&&(e=r.slice()),e[i]=s.copy(s.from,n.to),Oa(e,i+1,s.copy(n.to,s.to)));continue}else{s.from<n.to&&(e==r&&(e=r.slice()),e[t]=n.copy(n.from,s.from),Oa(e,i,n.copy(s.from,n.to)));break}}}return e}function Oa(r,e,t){for(;e<r.length&&vr(t,r[e])>0;)e++;r.splice(e,0,t)}function Ss(r){let e=[];return r.someProp("decorations",t=>{let n=t(r.state);n&&n!=ze&&e.push(n)}),r.cursorWrapper&&e.push(Ee.create(r.state.doc,[r.cursorWrapper.deco])),Jt.from(e)}const T0={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},M0=Qe&&Xt<=11;class O0{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class N0{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new O0,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);Qe&&Xt<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():qe&&e.composing&&n.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),M0&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,T0)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(wa(this.view)){if(this.suppressingSelectionUpdates)return zt(this.view);if(Qe&&Xt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Er(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let s=e.focusNode;s;s=zr(s))t.add(s);for(let s=e.anchorNode;s;s=zr(s))if(t.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&wa(e)&&!this.ignoreSelectionChange(n),s=-1,o=-1,l=!1,a=[];if(e.editable)for(let c=0;c<t.length;c++){let d=this.registerMutation(t[c],a);d&&(s=s<0?d.from:Math.min(d.from,s),o=o<0?d.to:Math.max(d.to,o),d.typeOver&&(l=!0))}if(a.some(c=>c.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||Fe&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(c=>c.type=="childList"&&c.removedNodes.length))){for(let c of a)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){c.parentNode.removeChild(c);break}d=d.firstChild}}}else if(ct&&a.length){let c=a.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||F0(e,d)!=h)&&f.remove()}}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&rs(n)&&(u=Fo(e))&&u.eq(te.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,zt(e),this.currentSelection.set(n),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),I0(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,R0(e,a)),this.handleDOMChange(s,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||zt(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let d=e.addedNodes[c];t.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Qe&&Xt<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:f}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let o=i&&i.parentNode==e.target?Ie(i)+1:0,l=n.localPosFromDOM(e.target,o,-1),a=s&&s.parentNode==e.target?Ie(s):e.target.childNodes.length,u=n.localPosFromDOM(e.target,a,1);return{from:l,to:u}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Na=new WeakMap,Ia=!1;function I0(r){if(!Na.has(r)&&(Na.set(r,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace)!==-1)){if(r.requiresGeckoHackNode=ct,Ia)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Ia=!0}}function Ba(r,e){let t=e.startContainer,n=e.startOffset,i=e.endContainer,s=e.endOffset,o=r.domAtPos(r.state.selection.anchor);return Er(o.node,o.offset,i,s)&&([t,n,i,s]=[i,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:s}}function B0(r,e){if(e.getComposedRanges){let i=e.getComposedRanges(r.root)[0];if(i)return Ba(r,i)}let t;function n(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return r.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),r.dom.removeEventListener("beforeinput",n,!0),t?Ba(r,t):null}function F0(r,e){for(let t=e.parentNode;t&&t!=r.dom;t=t.parentNode){let n=r.docView.nearestDesc(t,!0);if(n&&n.node.isBlock)return t}return null}function R0(r,e){var t;let{focusNode:n,focusOffset:i}=r.domSelectionRange();for(let s of e)if(((t=s.parentNode)===null||t===void 0?void 0:t.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let l=o;for(;;){let a=l.firstChild;if(!a||a.nodeType!=1||a.contentEditable=="false"||/^(BR|IMG)$/.test(a.nodeName))break;l=a}l.insertBefore(s,l.firstChild),n==s&&r.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function $0(r,e,t,n){let{node:i,fromOffset:s,toOffset:o,from:l,to:a}=r.docView.parseRange(e,t),u=r.domSelectionRange(),c,d=u.anchorNode;if(d&&r.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:u.anchorOffset}],rs(u)||c.push({node:u.focusNode,offset:u.focusOffset})),Fe&&r.input.lastKeyCode===8)for(let y=o;y>s;y--){let x=i.childNodes[y-1],k=x.pmViewDesc;if(x.nodeName=="BR"&&!k){o=y;break}if(!k||k.size)break}let f=r.state.doc,h=r.someProp("domParser")||Qt.fromSchema(r.state.schema),m=f.resolve(l),p=null,g=h.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:s,to:o,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:P0(n),context:m});if(c&&c[0].pos!=null){let y=c[0].pos,x=c[1]&&c[1].pos;x==null&&(x=y),p={anchor:y+l,head:x+l}}return{doc:g,sel:p,from:l,to:a}}const P0=r=>e=>{let t=e.pmViewDesc;if(t)return t.parseRule(r);if(e.nodeName=="BR"&&e.parentNode){if(qe&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||qe&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},L0=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function z0(r,e,t,n,i){let s=r.input.compositionPendingChanges||(r.composing?r.input.compositionID:0);if(r.input.compositionPendingChanges=0,e<0){let D=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,_=Fo(r,D);if(_&&!r.state.selection.eq(_)){if(Fe&&$t&&r.input.lastKeyCode===13&&Date.now()-100<r.input.lastKeyCodeTime&&r.someProp("handleKeyDown",T=>T(r,ur(13,"Enter"))))return;let $=r.state.tr.setSelection(_);D=="pointer"?$.setMeta("pointer",!0):D=="key"&&$.scrollIntoView(),s&&$.setMeta("composition",s),r.dispatch($)}return}let o=r.state.doc.resolve(e),l=o.sharedDepth(t);e=o.before(l+1),t=r.state.doc.resolve(t).after(l+1);let a=r.state.selection,u=$0(r,e,t,i),c=r.state.doc,d=c.slice(u.from,u.to),f,h;r.input.lastKeyCode===8&&Date.now()-100<r.input.lastKeyCodeTime?(f=r.state.selection.to,h="end"):(f=r.state.selection.from,h="start"),r.input.lastKeyCode=null;let m=j0(d.content,u.doc.content,u.from,f,h);if(m&&r.input.domChangeCount++,(qr&&r.input.lastIOSEnter>Date.now()-225||$t)&&i.some(D=>D.nodeType==1&&!L0.test(D.nodeName))&&(!m||m.endA>=m.endB)&&r.someProp("handleKeyDown",D=>D(r,ur(13,"Enter")))){r.input.lastIOSEnter=0;return}if(!m)if(n&&a instanceof Q&&!a.empty&&a.$head.sameParent(a.$anchor)&&!r.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:a.from,endA:a.to,endB:a.to};else{if(u.sel){let D=Fa(r,r.state.doc,u.sel);if(D&&!D.eq(r.state.selection)){let _=r.state.tr.setSelection(D);s&&_.setMeta("composition",s),r.dispatch(_)}}return}r.state.selection.from<r.state.selection.to&&m.start==m.endB&&r.state.selection instanceof Q&&(m.start>r.state.selection.from&&m.start<=r.state.selection.from+2&&r.state.selection.from>=u.from?m.start=r.state.selection.from:m.endA<r.state.selection.to&&m.endA>=r.state.selection.to-2&&r.state.selection.to<=u.to&&(m.endB+=r.state.selection.to-m.endA,m.endA=r.state.selection.to)),Qe&&Xt<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let p=u.doc.resolveNoCache(m.start-u.from),g=u.doc.resolveNoCache(m.endB-u.from),y=c.resolve(m.start),x=p.sameParent(g)&&p.parent.inlineContent&&y.end()>=m.endA;if((qr&&r.input.lastIOSEnter>Date.now()-225&&(!x||i.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!x&&p.pos<u.doc.content.size&&(!p.sameParent(g)||!p.parent.inlineContent)&&p.pos<g.pos&&!/\S/.test(u.doc.textBetween(p.pos,g.pos,"","")))&&r.someProp("handleKeyDown",D=>D(r,ur(13,"Enter")))){r.input.lastIOSEnter=0;return}if(r.state.selection.anchor>m.start&&V0(c,m.start,m.endA,p,g)&&r.someProp("handleKeyDown",D=>D(r,ur(8,"Backspace")))){$t&&Fe&&r.domObserver.suppressSelectionUpdates();return}Fe&&m.endB==m.start&&(r.input.lastChromeDelete=Date.now()),$t&&!x&&p.start()!=g.start()&&g.parentOffset==0&&p.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,g=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{r.someProp("handleKeyDown",function(D){return D(r,ur(13,"Enter"))})},20));let k=m.start,A=m.endA,v=D=>{let _=D||r.state.tr.replace(k,A,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let $=Fa(r,_.doc,u.sel);$&&!(Fe&&r.composing&&$.empty&&(m.start!=m.endB||r.input.lastChromeDelete<Date.now()-100)&&($.head==k||$.head==_.mapping.map(A)-1)||Qe&&$.empty&&$.head==k)&&_.setSelection($)}return s&&_.setMeta("composition",s),_.scrollIntoView()},S;if(x)if(p.pos==g.pos){Qe&&Xt<=11&&p.parentOffset==0&&(r.domObserver.suppressSelectionUpdates(),setTimeout(()=>zt(r),20));let D=v(r.state.tr.delete(k,A)),_=c.resolve(m.start).marksAcross(c.resolve(m.endA));_&&D.ensureMarks(_),r.dispatch(D)}else if(m.endA==m.endB&&(S=q0(p.parent.content.cut(p.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let D=v(r.state.tr);S.type=="add"?D.addMark(k,A,S.mark):D.removeMark(k,A,S.mark),r.dispatch(D)}else if(p.parent.child(p.index()).isText&&p.index()==g.index()-(g.textOffset?0:1)){let D=p.parent.textBetween(p.parentOffset,g.parentOffset),_=()=>v(r.state.tr.insertText(D,k,A));r.someProp("handleTextInput",$=>$(r,k,A,D,_))||r.dispatch(_())}else r.dispatch(v());else r.dispatch(v())}function Fa(r,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:Ro(r,e.resolve(t.anchor),e.resolve(t.head))}function q0(r,e){let t=r.firstChild.marks,n=e.firstChild.marks,i=t,s=n,o,l,a;for(let c=0;c<n.length;c++)i=n[c].removeFromSet(i);for(let c=0;c<t.length;c++)s=t[c].removeFromSet(s);if(i.length==1&&s.length==0)l=i[0],o="add",a=c=>c.mark(l.addToSet(c.marks));else if(i.length==0&&s.length==1)l=s[0],o="remove",a=c=>c.mark(l.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(a(e.child(c)));if(R.from(u).eq(r))return{mark:l,type:o}}function V0(r,e,t,n,i){if(t-e<=i.pos-n.pos||Ds(n,!0,!1)<i.pos)return!1;let s=r.resolve(e);if(!n.parent.isTextblock){let l=s.nodeAfter;return l!=null&&t==e+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=r.resolve(Ds(s,!0,!0));return!o.parent.isTextblock||o.pos>t||Ds(o,!0,!1)<t?!1:n.parent.content.cut(n.parentOffset).eq(o.parent.content)}function Ds(r,e,t){let n=r.depth,i=e?r.end():r.pos;for(;n>0&&(e||r.indexAfter(n)==r.node(n).childCount);)n--,i++,e=!1;if(t){let s=r.node(n).maybeChild(r.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function j0(r,e,t,n,i){let s=r.findDiffStart(e,t),o=t+r.size,l=t+e.size;if(s==null)return null;let{a,b:u}=r.findDiffEnd(e,o,l);if(i=="end"){let c=Math.max(0,s-Math.min(a,u));n-=a+c-s}if(a<s&&o<l){let c=n<=s&&n>=a?s-n:0;s-=c,u=s+(u-a),a=s}else if(u<s){let c=n<=s&&n>=u?s-n:0;s-=c,a=s+(a-u),u=s}return{start:s,endA:a,endB:u}}class Qc{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new s0,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(za),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Pa(this),$a(this),this.nodeViews=La(this),this.docView=ba(this.state.doc,Ra(this),Ss(this),this.dom,this),this.domObserver=new N0(this,(n,i,s,o)=>z0(this,n,i,s,o)),this.domObserver.start(),o0(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ao(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(za),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(Uc(this),o=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=La(this);U0(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&ao(this),this.editable=Pa(this),$a(this);let a=Ss(this),u=Ra(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,u,a);(d||!e.selection.eq(i.selection))&&(o=!0);let f=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&vg(this);if(o){this.domObserver.stop();let h=d&&(Qe||Fe)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&H0(i.selection,e.selection);if(d){let p=Fe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=x0(this)),(s||!this.docView.update(e.doc,u,a,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=ba(e.doc,u,a,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let m=this.input.mouseDown;h||!(m&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Hg(this)&&m.delaySelUpdate())?zt(this,h):(Oc(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&xg(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof G){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&ha(this,t.getBoundingClientRect(),e)}else ha(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let n=this.directPlugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let n=this.state.plugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,i=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let s=n.from+(this.state.doc.content.size-t.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==n.node&&(i=s)}this.dragging=new Kc(e.slice,e.move,i<0?void 0:G.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],i;if(n!=null&&(i=t?t(n):n))return i;for(let o=0;o<this.directPlugins.length;o++){let l=this.directPlugins[o].props[e];if(l!=null&&(i=t?t(l):l))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let l=s[o].props[e];if(l!=null&&(i=t?t(l):l))return i}}hasFocus(){if(Qe){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Cg(this.dom),zt(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Dg(this,e)}coordsAtPos(e,t=1){return Ac(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Ng(this,t||this.state,e)}pasteHTML(e,t){return bn(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return bn(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return $o(this,e)}destroy(){this.docView&&(l0(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ss(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,cg())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return u0(this,e)}domSelectionRange(){let e=this.domSelection();return e?qe&&this.root.nodeType===11&&mg(this.dom.ownerDocument)==this.dom&&B0(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Qc.prototype.dispatch=function(r){let e=this._props.dispatchTransaction;e?e.call(this,r):this.updateState(this.state.apply(r))};function Ra(r){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(r.editable),r.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(r.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[at.node(0,r.state.doc.content.size,e)]}function $a(r){if(r.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),r.cursorWrapper={dom:e,deco:at.widget(r.state.selection.from,e,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function Pa(r){return!r.someProp("editable",e=>e(r.state)===!1)}function H0(r,e){let t=Math.min(r.$anchor.sharedDepth(r.head),e.$anchor.sharedDepth(e.head));return r.$anchor.start(t)!=e.$anchor.start(t)}function La(r){let e=Object.create(null);function t(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return r.someProp("nodeViews",t),r.someProp("markViews",t),e}function U0(r,e){let t=0,n=0;for(let i in r){if(r[i]!=e[i])return!0;t++}for(let i in e)n++;return t!=n}function za(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var nr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},mi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},W0=typeof navigator<"u"&&/Mac/.test(navigator.platform),K0=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Be=0;Be<10;Be++)nr[48+Be]=nr[96+Be]=String(Be);for(var Be=1;Be<=24;Be++)nr[Be+111]="F"+Be;for(var Be=65;Be<=90;Be++)nr[Be]=String.fromCharCode(Be+32),mi[Be]=String.fromCharCode(Be);for(var _s in nr)mi.hasOwnProperty(_s)||(mi[_s]=nr[_s]);function J0(r){var e=W0&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||K0&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?mi:nr)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const G0=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Z0=typeof navigator<"u"&&/Win/.test(navigator.platform);function Y0(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,s,o;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))G0?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+a)}return n&&(t="Alt-"+t),i&&(t="Ctrl-"+t),o&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function Q0(r){let e=Object.create(null);for(let t in r)e[Y0(t)]=r[t];return e}function Ts(r,e,t=!0){return e.altKey&&(r="Alt-"+r),e.ctrlKey&&(r="Ctrl-"+r),e.metaKey&&(r="Meta-"+r),t&&e.shiftKey&&(r="Shift-"+r),r}function X0(r){return new Le({props:{handleKeyDown:Xc(r)}})}function Xc(r){let e=Q0(r);return function(t,n){let i=J0(n),s,o=e[Ts(i,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let l=e[Ts(i,n,!1)];if(l&&l(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Z0&&n.ctrlKey&&n.altKey)&&(s=nr[n.keyCode])&&s!=i){let l=e[Ts(s,n)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const jo=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function ed(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const td=(r,e,t)=>{let n=ed(r,t);if(!n)return!1;let i=Ho(n);if(!i){let o=n.blockRange(),l=o&&Hr(o);return l==null?!1:(e&&e(r.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(cd(r,i,e,-1))return!0;if(n.parent.content.size==0&&(Vr(s,"end")||G.isSelectable(s)))for(let o=n.depth;;o--){let l=es(r.doc,n.before(o),n.after(o),H.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=r.tr.step(l);a.setSelection(Vr(s,"end")?te.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):G.create(a.doc,i.pos-s.nodeSize)),e(a.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},e2=(r,e,t)=>{let n=ed(r,t);if(!n)return!1;let i=Ho(n);return i?rd(r,i,e):!1},t2=(r,e,t)=>{let n=id(r,t);if(!n)return!1;let i=Uo(n);return i?rd(r,i,e):!1};function rd(r,e,t){let n=e.nodeBefore,i=n,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let c=l.firstChild;if(!c)return!1;l=c}let u=es(r.doc,s,a,H.empty);if(!u||u.from!=s||u instanceof xe&&u.slice.size>=a-s)return!1;if(t){let c=r.tr.step(u);c.setSelection(Q.create(c.doc,s)),t(c.scrollIntoView())}return!0}function Vr(r,e,t=!1){for(let n=r;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(t&&n.childCount!=1)return!1}return!1}const nd=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=Ho(n)}let o=s&&s.nodeBefore;return!o||!G.isSelectable(o)?!1:(e&&e(r.tr.setSelection(G.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function Ho(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function id(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset<t.parent.content.size)?null:t}const sd=(r,e,t)=>{let n=id(r,t);if(!n)return!1;let i=Uo(n);if(!i)return!1;let s=i.nodeAfter;if(cd(r,i,e,1))return!0;if(n.parent.content.size==0&&(Vr(s,"start")||G.isSelectable(s))){let o=es(r.doc,n.before(),n.after(),H.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=r.tr.step(o);l.setSelection(Vr(s,"start")?te.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):G.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},od=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset<n.parent.content.size)return!1;s=Uo(n)}let o=s&&s.nodeAfter;return!o||!G.isSelectable(o)?!1:(e&&e(r.tr.setSelection(G.create(r.doc,s.pos)).scrollIntoView()),!0)};function Uo(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){let t=r.node(e);if(r.index(e)+1<t.childCount)return r.doc.resolve(r.after(e+1));if(t.type.spec.isolating)break}return null}const r2=(r,e)=>{let t=r.selection,n=t instanceof G,i;if(n){if(t.node.isTextblock||!ir(r.doc,t.from))return!1;i=t.from}else if(i=Xi(r.doc,t.from,-1),i==null)return!1;if(e){let s=r.tr.join(i);n&&s.setSelection(G.create(s.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},n2=(r,e)=>{let t=r.selection,n;if(t instanceof G){if(t.node.isTextblock||!ir(r.doc,t.to))return!1;n=t.to}else if(n=Xi(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},i2=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),s=i&&Hr(i);return s==null?!1:(e&&e(r.tr.lift(i,s).scrollIntoView()),!0)},ld=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(`
16
- `).scrollIntoView()),!0)};function Wo(r){for(let e=0;e<r.edgeCount;e++){let{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const s2=(r,e)=>{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=Wo(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=r.tr.replaceWith(l,l,o.createAndFill());a.setSelection(te.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},ad=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof tt||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=Wo(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,l=r.tr.insert(o,s.createAndFill());l.setSelection(Q.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},ud=(r,e)=>{let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Lt(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&Hr(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)};function o2(r){return(e,t)=>{if(e.selection instanceof G&&e.selection.node.isBlock){let{$from:h}=e.selection;return!h.parentOffset||!Lt(e.doc,h.pos)?!1:(t&&t(e.tr.split(h.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let n=e.tr;!e.selection.empty&&(e.selection instanceof Q||e.selection instanceof tt)&&n.deleteSelection();let{$from:i}=n.selection,s=n.steps.length,o=[],l,a,u=!1,c=!1;for(let h=i.depth;;h--)if(i.node(h).isBlock){u=i.end(h)==i.pos+(i.depth-h),c=i.start(h)==i.pos-(i.depth-h),a=Wo(i.node(h-1).contentMatchAt(i.indexAfter(h-1))),o.unshift(u&&a?{type:a}:null),l=h;break}else{if(h==1)return!1;o.unshift(null)}let d=i.pos,f=Lt(n.doc,d,o.length,o);if(f||(o[0]=a?{type:a}:null,f=Lt(n.doc,d,o.length,o)),!f)return!1;if(n.split(d,o.length,o),!u&&c&&i.node(l).type!=a){let h=n.mapping.slice(s),m=h.map(i.before(l)),p=n.doc.resolve(m);a&&i.node(l-1).canReplaceWith(p.index(),p.index()+1,a)&&n.setNodeMarkup(h.map(i.before(l)),a)}return t&&t(n.scrollIntoView()),!0}}const l2=o2(),a2=(r,e)=>{let{$from:t,to:n}=r.selection,i,s=t.sharedDepth(n);return s==0?!1:(i=t.before(s),e&&e(r.tr.setSelection(G.create(r.doc,i))),!0)};function u2(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||ir(r.doc,e.pos))?!1:(t&&t(r.tr.join(e.pos).scrollIntoView()),!0)}function cd(r,e,t,n){let i=e.nodeBefore,s=e.nodeAfter,o,l,a=i.type.spec.isolating||s.type.spec.isolating;if(!a&&u2(r,e,t))return!0;let u=!a&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(l=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&l.matchType(o[0]||s.type).validEnd){if(t){let h=e.pos+s.nodeSize,m=R.empty;for(let y=o.length-1;y>=0;y--)m=R.from(o[y].create(null,m));m=R.from(i.copy(m));let p=r.tr.step(new De(e.pos-1,h,e.pos,h,new H(m,1,0),o.length,!0)),g=p.doc.resolve(h+2*o.length);g.nodeAfter&&g.nodeAfter.type==i.type&&ir(p.doc,g.pos)&&p.join(g.pos),t(p.scrollIntoView())}return!0}let c=s.type.spec.isolating||n>0&&a?null:te.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),f=d&&Hr(d);if(f!=null&&f>=e.depth)return t&&t(r.tr.lift(d,f).scrollIntoView()),!0;if(u&&Vr(s,"start",!0)&&Vr(i,"end")){let h=i,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let p=s,g=1;for(;!p.isTextblock;p=p.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,p.content)){if(t){let y=R.empty;for(let k=m.length-1;k>=0;k--)y=R.from(m[k].copy(y));let x=r.tr.step(new De(e.pos-m.length,e.pos+s.nodeSize,e.pos+g,e.pos+s.nodeSize-g,new H(y,m.length,0),0,!0));t(x.scrollIntoView())}return!0}}return!1}function dd(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(Q.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const c2=dd(-1),d2=dd(1);function f2(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&No(o,r,e);return l?(n&&n(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function qa(r,e=null){return function(t,n){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:l}}=t.selection.ranges[s];t.doc.nodesBetween(o,l,(a,u)=>{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(r,e)))if(a.type==r)i=!0;else{let c=t.doc.resolve(u),d=c.index();i=c.parent.canReplaceWith(d,d+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:a}}=t.selection.ranges[o];s.setBlockType(l,a,r,e)}n(s.scrollIntoView())}return!0}}function Ko(...r){return function(e,t,n){for(let i=0;i<r.length;i++)if(r[i](e,t,n))return!0;return!1}}Ko(jo,td,nd);Ko(jo,sd,od);Ko(ld,ad,ud,l2);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function h2(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s);if(!o)return!1;let l=n?t.tr:null;return p2(l,o,r,e)?(n&&n(l.scrollIntoView()),!0):!1}}function p2(r,e,t,n=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);s=new ai(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new ai(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=No(s,t,n,e);return l?(r&&m2(r,e,l,i,t),!0):!1}function m2(r,e,t,n,i){let s=R.empty;for(let c=t.length-1;c>=0;c--)s=R.from(t[c].type.create(t[c].attrs,s));r.step(new De(e.start-(n?2:0),e.end,e.start,e.end,new H(s,0,0),t.length,!0));let o=0;for(let c=0;c<t.length;c++)t[c].type==i&&(o=c+1);let l=t.length-o,a=e.start+t.length-(n?2:0),u=e.parent;for(let c=e.startIndex,d=e.endIndex,f=!0;c<d;c++,f=!1)!f&&Lt(r.doc,a,l)&&(r.split(a,l),a+=2*l),a+=u.child(c).nodeSize;return r}function g2(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,o=>o.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?y2(e,t,r,s):b2(e,t,s):!0:!1}}function y2(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);s<o&&(i.step(new De(s-1,o,s,o,new H(R.from(t.create(null,n.parent.copy())),1,0),1,!0)),n=new ai(i.doc.resolve(n.$from.pos),i.doc.resolve(o),n.depth));const l=Hr(n);if(l==null)return!1;i.lift(n,l);let a=i.doc.resolve(i.mapping.map(s,-1)-1);return ir(i.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&i.join(a.pos),e(i.scrollIntoView()),!0}function b2(r,e,t){let n=r.tr,i=t.parent;for(let h=t.end,m=t.endIndex-1,p=t.startIndex;m>p;m--)h-=i.child(m).nodeSize,n.delete(h-1,h+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(l?0:1),c+1,o.content.append(a?R.empty:R.from(i))))return!1;let d=s.pos,f=d+o.nodeSize;return n.step(new De(d-(l?1:0),f+(a?1:0),d+1,f-1,new H((l?R.empty:R.from(i.copy(R.empty))).append(a?R.empty:R.from(i.copy(R.empty))),l?0:1,a?0:1),l?0:1)),e(n.scrollIntoView()),!0}function k2(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=r)return!1;if(t){let u=a.lastChild&&a.lastChild.type==l.type,c=R.from(u?r.create():null),d=new H(R.from(r.create(null,R.from(l.type.create(null,c)))),u?3:1,0),f=s.start,h=s.end;t(e.tr.step(new De(f-(u?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}function is(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,s=t.storedMarks,t}}}class ss{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:i}=t,{tr:s}=n,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>{const d=a(...c)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i,l=[],a=!!e,u=e||s.tr,c=()=>(!a&&t&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(n).map(([f,h])=>[f,(...p)=>{const g=this.buildProps(u,t),y=h(...p)(g);return l.push(y),d}])),run:c};return d}createCan(e){const{rawCommands:t,state:n}=this,i=!1,s=e||n.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([a,u])=>[a,(...c)=>u(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i,l={tr:e,editor:i,view:o,state:is({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,u])=>[a,(...c)=>u(...c)(l)]))}};return l}}class v2{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(i=>i.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(i=>i!==t):delete this.callbacks[e]),this}once(e,t){const n=(...i)=>{this.off(e,n),t.apply(this,i)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}}function J(r,e,t){return r.config[e]===void 0&&r.parent?J(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?J(r.parent,e,t):null}):r.config[e]}function ls(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function fd(r){const e=[],{nodeExtensions:t,markExtensions:n}=ls(r),i=[...t,...n],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return r.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage,extensions:i},a=J(o,"addGlobalAttributes",l);if(!a)return;a().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([f,h])=>{e.push({type:d,name:f,attribute:{...s,...h}})})})})}),i.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},a=J(o,"addAttributes",l);if(!a)return;const u=a();Object.entries(u).forEach(([c,d])=>{const f={...s,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:o.name,name:c,attribute:f})})}),e}function Te(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}function $e(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}if(i==="class"){const l=s?String(s).split(" "):[],a=n[i]?n[i].split(" "):[],u=l.filter(c=>!a.includes(c));n[i]=[...a,...u].join(" ")}else if(i==="style"){const l=s?s.split(";").map(c=>c.trim()).filter(Boolean):[],a=n[i]?n[i].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;a.forEach(c=>{const[d,f]=c.split(":").map(h=>h.trim());u.set(d,f)}),l.forEach(c=>{const[d,f]=c.split(":").map(h=>h.trim());u.set(d,f)}),n[i]=Array.from(u.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else n[i]=s}),n},{})}function uo(r,e){return e.filter(t=>t.type===r.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(r.attrs)||{}:{[t.name]:r.attrs[t.name]}).reduce((t,n)=>$e(t,n),{})}function hd(r){return typeof r=="function"}function ie(r,e=void 0,...t){return hd(r)?e?r.bind(e)(...t):r(...t):r}function x2(r={}){return Object.keys(r).length===0&&r.constructor===Object}function C2(r){return typeof r!="string"?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):r==="true"?!0:r==="false"?!1:r}function Va(r,e){return"style"in r?r:{...r,getAttrs:t=>{const n=r.getAttrs?r.getAttrs(t):r.attrs;if(n===!1)return!1;const i=e.reduce((s,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(t):C2(t.getAttribute(o.name));return l==null?s:{...s,[o.name]:l}},{});return{...n,...i}}}}function ja(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>e==="attrs"&&x2(t)?!1:t!=null))}function A2(r,e){var t;const n=fd(r),{nodeExtensions:i,markExtensions:s}=ls(r),o=(t=i.find(u=>J(u,"topNode")))===null||t===void 0?void 0:t.name,l=Object.fromEntries(i.map(u=>{const c=n.filter(y=>y.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=r.reduce((y,x)=>{const k=J(x,"extendNodeSchema",d);return{...y,...k?k(u):{}}},{}),h=ja({...f,content:ie(J(u,"content",d)),marks:ie(J(u,"marks",d)),group:ie(J(u,"group",d)),inline:ie(J(u,"inline",d)),atom:ie(J(u,"atom",d)),selectable:ie(J(u,"selectable",d)),draggable:ie(J(u,"draggable",d)),code:ie(J(u,"code",d)),whitespace:ie(J(u,"whitespace",d)),linebreakReplacement:ie(J(u,"linebreakReplacement",d)),defining:ie(J(u,"defining",d)),isolating:ie(J(u,"isolating",d)),attrs:Object.fromEntries(c.map(y=>{var x;return[y.name,{default:(x=y==null?void 0:y.attribute)===null||x===void 0?void 0:x.default}]}))}),m=ie(J(u,"parseHTML",d));m&&(h.parseDOM=m.map(y=>Va(y,c)));const p=J(u,"renderHTML",d);p&&(h.toDOM=y=>p({node:y,HTMLAttributes:uo(y,c)}));const g=J(u,"renderText",d);return g&&(h.toText=g),[u.name,h]})),a=Object.fromEntries(s.map(u=>{const c=n.filter(g=>g.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=r.reduce((g,y)=>{const x=J(y,"extendMarkSchema",d);return{...g,...x?x(u):{}}},{}),h=ja({...f,inclusive:ie(J(u,"inclusive",d)),excludes:ie(J(u,"excludes",d)),group:ie(J(u,"group",d)),spanning:ie(J(u,"spanning",d)),code:ie(J(u,"code",d)),attrs:Object.fromEntries(c.map(g=>{var y;return[g.name,{default:(y=g==null?void 0:g.attribute)===null||y===void 0?void 0:y.default}]}))}),m=ie(J(u,"parseHTML",d));m&&(h.parseDOM=m.map(g=>Va(g,c)));const p=J(u,"renderHTML",d);return p&&(h.toDOM=g=>p({mark:g,HTMLAttributes:uo(g,c)})),[u.name,h]}));return new Yu({topNode:o,nodes:l,marks:a})}function Ms(r,e){return e.nodes[r]||e.marks[r]||null}function Ha(r,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===r.name):e}function Jo(r,e){const t=Dr.fromSchema(e).serializeFragment(r),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}const w2=(r,e=500)=>{let t="";const n=r.parentOffset;return r.parent.nodesBetween(Math.max(0,n-e),n,(i,s,o,l)=>{var a,u;const c=((u=(a=i.type.spec).toText)===null||u===void 0?void 0:u.call(a,{node:i,pos:s,parent:o,index:l}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,n-s))}),t};function Go(r){return Object.prototype.toString.call(r)==="[object RegExp]"}class as{constructor(e){this.find=e.find,this.handler=e.handler}}const E2=(r,e)=>{if(Go(e))return e.exec(r);const t=e(r);if(!t)return null;const n=[t.text];return n.index=t.index,n.input=r,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(t.replaceWith)),n};function Vn(r){var e;const{editor:t,from:n,to:i,text:s,rules:o,plugin:l}=r,{view:a}=t;if(a.composing)return!1;const u=a.state.doc.resolve(n);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let c=!1;const d=w2(u)+s;return o.forEach(f=>{if(c)return;const h=E2(d,f.find);if(!h)return;const m=a.state.tr,p=is({state:a.state,transaction:m}),g={from:n-(h[0].length-s.length),to:i},{commands:y,chain:x,can:k}=new ss({editor:t,state:p});f.handler({state:p,range:g,match:h,commands:y,chain:x,can:k})===null||!m.steps.length||(m.setMeta(l,{transform:m,from:n,to:i,text:s}),a.dispatch(m),c=!0)}),c}function S2(r){const{editor:e,rules:t}=r,n=new Le({state:{init(){return null},apply(i,s,o){const l=i.getMeta(n);if(l)return l;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:c}=a;typeof c=="string"?c=c:c=Jo(R.from(c),o.schema);const{from:d}=a,f=d+c.length;Vn({editor:e,from:d,to:f,text:c,rules:t,plugin:n})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,l){return Vn({editor:e,from:s,to:o,text:l,rules:t,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Vn({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:n})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Vn({editor:e,from:o.pos,to:o.pos,text:`
17
- `,rules:t,plugin:n}):!1}},isInputRules:!0});return n}function D2(r){return Object.prototype.toString.call(r).slice(8,-1)}function jn(r){return D2(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function us(r,e){const t={...r};return jn(r)&&jn(e)&&Object.keys(e).forEach(n=>{jn(e[n])&&jn(r[n])?t[n]=us(r[n],e[n]):t[n]=e[n]}),t}class qt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(J(this,"addOptions",{name:this.name}))),this.storage=ie(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qt(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>us(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new qt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ie(J(t,"addOptions",{name:t.name})),t.storage=ie(J(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===t.name))return!1;const a=o.find(u=>(u==null?void 0:u.type.name)===t.name);return a&&n.removeStoredMark(a),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}}function _2(r){return typeof r=="number"}class T2{constructor(e){this.find=e.find,this.handler=e.handler}}const M2=(r,e,t)=>{if(Go(e))return[...r.matchAll(e)];const n=e(r,t);return n?n.map(i=>{const s=[i.text];return s.index=i.index,s.input=r,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function O2(r){const{editor:e,state:t,from:n,to:i,rule:s,pasteEvent:o,dropEvent:l}=r,{commands:a,chain:u,can:c}=new ss({editor:e,state:t}),d=[];return t.doc.nodesBetween(n,i,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const p=Math.max(n,m),g=Math.min(i,m+h.content.size),y=h.textBetween(p-m,g-m,void 0,"");M2(y,s.find,o).forEach(k=>{if(k.index===void 0)return;const A=p+k.index+1,v=A+k[0].length,S={from:t.tr.mapping.map(A),to:t.tr.mapping.map(v)},D=s.handler({state:t,range:S,match:k,commands:a,chain:u,can:c,pasteEvent:o,dropEvent:l});d.push(D)})}),d.every(h=>h!==null)}let Hn=null;const N2=r=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",r),t};function I2(r){const{editor:e,rules:t}=r;let n=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:c,from:d,to:f,rule:h,pasteEvt:m})=>{const p=c.tr,g=is({state:c,transaction:p});if(!(!O2({editor:e,state:g,from:Math.max(d-1,0),to:f.b-1,rule:h,pasteEvent:m,dropEvent:l})||!p.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,p}};return t.map(c=>new Le({view(d){const f=m=>{var p;n=!((p=d.dom.parentElement)===null||p===void 0)&&p.contains(m.target)?d.dom.parentElement:null,n&&(Hn=e)},h=()=>{Hn&&(Hn=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(s=n===d.dom.parentElement,l=f,!s){const h=Hn;h!=null&&h.isEditable&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(d,f)=>{var h;const m=(h=f.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return o=f,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,h)=>{const m=d[0],p=m.getMeta("uiEvent")==="paste"&&!i,g=m.getMeta("uiEvent")==="drop"&&!s,y=m.getMeta("applyPasteRules"),x=!!y;if(!p&&!g&&!x)return;if(x){let{text:v}=y;typeof v=="string"?v=v:v=Jo(R.from(v),h.schema);const{from:S}=y,D=S+v.length,_=N2(v);return a({rule:c,state:h,from:S,to:{b:D},pasteEvt:_})}const k=f.doc.content.findDiffStart(h.doc.content),A=f.doc.content.findDiffEnd(h.doc.content);if(!(!_2(k)||!A||k===A.b))return a({rule:c,state:h,from:k,to:A,pasteEvt:o})}}))}function B2(r){const e=r.filter((t,n)=>r.indexOf(t)!==n);return Array.from(new Set(e))}class Fr{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Fr.resolve(e),this.schema=A2(this.extensions,t),this.setupExtensions()}static resolve(e){const t=Fr.sort(Fr.flatten(e)),n=B2(t.map(i=>i.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},i=J(t,"addExtensions",n);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((n,i)=>{const s=J(n,"priority")||100,o=J(i,"priority")||100;return s>o?-1:s<o?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Ms(t.name,this.schema)},i=J(t,"addCommands",n);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Fr.sort([...this.extensions].reverse()),n=[],i=[],s=t.map(o=>{const l={name:o.name,options:o.options,storage:o.storage,editor:e,type:Ms(o.name,this.schema)},a=[],u=J(o,"addKeyboardShortcuts",l);let c={};if(o.type==="mark"&&J(o,"exitable",l)&&(c.ArrowRight=()=>qt.handleExit({editor:e,mark:o})),u){const p=Object.fromEntries(Object.entries(u()).map(([g,y])=>[g,()=>y({editor:e})]));c={...c,...p}}const d=X0(c);a.push(d);const f=J(o,"addInputRules",l);Ha(o,e.options.enableInputRules)&&f&&n.push(...f());const h=J(o,"addPasteRules",l);Ha(o,e.options.enablePasteRules)&&h&&i.push(...h());const m=J(o,"addProseMirrorPlugins",l);if(m){const p=m();a.push(...p)}return a}).flat();return[S2({editor:e,rules:n}),...I2({editor:e,rules:i}),...s]}get attributes(){return fd(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ls(this.extensions);return Object.fromEntries(t.filter(n=>!!J(n,"addNodeView")).map(n=>{const i=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:e,type:Te(n.name,this.schema)},o=J(n,"addNodeView",s);if(!o)return[];const l=(a,u,c,d,f)=>{const h=uo(a,i);return o()({node:a,view:u,getPos:c,decorations:d,innerDecorations:f,editor:e,extension:n,HTMLAttributes:h})};return[n.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Ms(e.name,this.schema)};e.type==="mark"&&(!((t=ie(J(e,"keepOnSplit",n)))!==null&&t!==void 0)||t)&&this.splittableMarks.push(e.name);const i=J(e,"onBeforeCreate",n),s=J(e,"onCreate",n),o=J(e,"onUpdate",n),l=J(e,"onSelectionUpdate",n),a=J(e,"onTransaction",n),u=J(e,"onFocus",n),c=J(e,"onBlur",n),d=J(e,"onDestroy",n);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}}class We{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(J(this,"addOptions",{name:this.name}))),this.storage=ie(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new We(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>us(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new We({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ie(J(t,"addOptions",{name:t.name})),t.storage=ie(J(t,"addStorage",{name:t.name,options:t.options})),t}}function pd(r,e,t){const{from:n,to:i}=e,{blockSeparator:s=`
18
-
19
- `,textSerializers:o={}}=t||{};let l="";return r.nodesBetween(n,i,(a,u,c,d)=>{var f;a.isBlock&&u>n&&(l+=s);const h=o==null?void 0:o[a.type.name];if(h)return c&&(l+=h({node:a,pos:u,parent:c,index:d,range:e})),!1;a.isText&&(l+=(f=a==null?void 0:a.text)===null||f===void 0?void 0:f.slice(Math.max(n,u)-u,i-u))}),l}function md(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const F2=We.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Le({key:new nt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),l=Math.max(...s.map(c=>c.$to.pos)),a=md(t);return pd(n,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),R2=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),$2=(r=!1)=>({commands:e})=>e.setContent("",r),P2=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:s,$to:o})=>{r.doc.nodesBetween(s.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:u,mapping:c}=e,d=u.resolve(c.map(a)),f=u.resolve(c.map(a+l.nodeSize)),h=d.blockRange(f);if(!h)return;const m=Hr(h);if(l.type.isTextblock){const{defaultType:p}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,p)}(m||m===0)&&e.lift(h,m)})}),!0},L2=r=>e=>r(e),z2=()=>({state:r,dispatch:e})=>ad(r,e),q2=(r,e)=>({editor:t,tr:n})=>{const{state:i}=t,s=i.doc.slice(r.from,r.to);n.deleteRange(r.from,r.to);const o=n.mapping.map(e);return n.insert(o,s.content),n.setSelection(new Q(n.doc.resolve(Math.max(o-1,0)))),!0},V2=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const l=i.before(s),a=i.after(s);r.delete(l,a).scrollIntoView()}return!0}return!1},j2=r=>({tr:e,state:t,dispatch:n})=>{const i=Te(r,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const a=s.before(o),u=s.after(o);e.delete(a,u).scrollIntoView()}return!0}return!1},H2=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},U2=()=>({state:r,dispatch:e})=>jo(r,e),W2=()=>({commands:r})=>r.keyboardShortcut("Enter"),K2=()=>({state:r,dispatch:e})=>s2(r,e);function gi(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:Go(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function gd(r,e,t={}){return r.find(n=>n.type===e&&gi(Object.fromEntries(Object.keys(t).map(i=>[i,n.attrs[i]])),t))}function Ua(r,e,t={}){return!!gd(r,e,t)}function Zo(r,e,t){var n;if(!r||!e)return;let i=r.parent.childAfter(r.parentOffset);if((!i.node||!i.node.marks.some(c=>c.type===e))&&(i=r.parent.childBefore(r.parentOffset)),!i.node||!i.node.marks.some(c=>c.type===e)||(t=t||((n=i.node.marks[0])===null||n===void 0?void 0:n.attrs),!gd([...i.node.marks],e,t)))return;let o=i.index,l=r.start()+i.offset,a=o+1,u=l+i.node.nodeSize;for(;o>0&&Ua([...r.parent.child(o-1).marks],e,t);)o-=1,l-=r.parent.child(o).nodeSize;for(;a<r.parent.childCount&&Ua([...r.parent.child(a).marks],e,t);)u+=r.parent.child(a).nodeSize,a+=1;return{from:l,to:u}}function or(r,e){if(typeof r=="string"){if(!e.marks[r])throw Error(`There is no mark type named '${r}'. Maybe you forgot to add the extension?`);return e.marks[r]}return r}const J2=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const s=or(r,n.schema),{doc:o,selection:l}=t,{$from:a,from:u,to:c}=l;if(i){const d=Zo(a,s,e);if(d&&d.from<=u&&d.to>=c){const f=Q.create(o,d.from,d.to);t.setSelection(f)}}return!0},G2=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n<t.length;n+=1)if(t[n](e))return!0;return!1};function yd(r){return r instanceof Q}function hr(r=0,e=0,t=0){return Math.min(Math.max(r,e),t)}function bd(r,e=null){if(!e)return null;const t=te.atStart(r),n=te.atEnd(r);if(e==="start"||e===!0)return t;if(e==="end")return n;const i=t.from,s=n.to;return e==="all"?Q.create(r,hr(0,i,s),hr(r.content.size,i,s)):Q.create(r,hr(e,i,s),hr(e,i,s))}function Wa(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function yi(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Z2(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const Y2=(r=null,e={})=>({editor:t,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(yi()||Wa())&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),Z2()&&!yi()&&!Wa()&&n.dom.focus({preventScroll:!0}))})};if(n.hasFocus()&&r===null||r===!1)return!0;if(s&&r===null&&!yd(t.state.selection))return o(),!0;const l=bd(i.doc,r)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Q2=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),X2=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e),kd=r=>{const e=r.childNodes;for(let t=e.length-1;t>=0;t-=1){const n=e[t];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?r.removeChild(n):n.nodeType===1&&kd(n)}return r};function Un(r){const e=`<body>${r}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return kd(t)}function vn(r,e,t){if(r instanceof Yt||r instanceof R)return r;t={slice:!0,parseOptions:{},...t};const n=typeof r=="object"&&r!==null,i=typeof r=="string";if(n)try{if(Array.isArray(r)&&r.length>0)return R.fromArray(r.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(r);return t.errorOnInvalidContent&&o.check(),o}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",s),vn("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,l="";const a=new Yu({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,l=typeof u=="string"?u:u.outerHTML,null)}]}})});if(t.slice?Qt.fromSchema(a).parseSlice(Un(r),t.parseOptions):Qt.fromSchema(a).parse(Un(r),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Qt.fromSchema(e);return t.slice?s.parseSlice(Un(r),t.parseOptions).content:s.parse(Un(r),t.parseOptions)}return vn("",e,t)}function e1(r,e,t){const n=r.steps.length-1;if(n<e)return;const i=r.steps[n];if(!(i instanceof xe||i instanceof De))return;const s=r.mapping.maps[n];let o=0;s.forEach((l,a,u,c)=>{o===0&&(o=c)}),r.setSelection(te.near(r.doc.resolve(o),t))}const t1=r=>!("type"in r),r1=(r,e,t)=>({tr:n,dispatch:i,editor:s})=>{var o;if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const a=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{vn(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(g){a(g)}try{l=vn(e,s.schema,{parseOptions:u,errorOnInvalidContent:(o=t.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(g){return a(g),!1}let{from:c,to:d}=typeof r=="number"?{from:r,to:r}:{from:r.from,to:r.to},f=!0,h=!0;if((t1(l)?l:[l]).forEach(g=>{g.check(),f=f?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),c===d&&h){const{parent:g}=n.doc.resolve(c);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(c-=1,d+=1)}let p;if(f){if(Array.isArray(e))p=e.map(g=>g.text||"").join("");else if(e instanceof R){let g="";e.forEach(y=>{y.text&&(g+=y.text)}),p=g}else typeof e=="object"&&e&&e.text?p=e.text:p=e;n.insertText(p,c,d)}else p=l,n.replaceWith(c,d,p);t.updateSelection&&e1(n,n.steps.length-1,-1),t.applyInputRules&&n.setMeta("applyInputRules",{from:c,text:p}),t.applyPasteRules&&n.setMeta("applyPasteRules",{from:c,text:p})}return!0},n1=()=>({state:r,dispatch:e})=>r2(r,e),i1=()=>({state:r,dispatch:e})=>n2(r,e),s1=()=>({state:r,dispatch:e})=>td(r,e),o1=()=>({state:r,dispatch:e})=>sd(r,e),l1=()=>({state:r,dispatch:e,tr:t})=>{try{const n=Xi(r.doc,r.selection.$from.pos,-1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},a1=()=>({state:r,dispatch:e,tr:t})=>{try{const n=Xi(r.doc,r.selection.$from.pos,1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},u1=()=>({state:r,dispatch:e})=>e2(r,e),c1=()=>({state:r,dispatch:e})=>t2(r,e);function vd(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function d1(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,s,o;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))yi()||vd()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return n&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),o&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}const f1=r=>({editor:e,view:t,tr:n,dispatch:i})=>{const s=d1(r).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",u=>u(t,l))});return a==null||a.steps.forEach(u=>{const c=u.map(n.mapping);c&&i&&n.maybeStep(c)}),!0};function xn(r,e,t={}){const{from:n,to:i,empty:s}=r.selection,o=e?Te(e,r.schema):null,l=[];r.doc.nodesBetween(n,i,(d,f)=>{if(d.isText)return;const h=Math.max(n,f),m=Math.min(i,f+d.nodeSize);l.push({node:d,from:h,to:m})});const a=i-n,u=l.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>gi(d.node.attrs,t,{strict:!1}));return s?!!u.length:u.reduce((d,f)=>d+f.to-f.from,0)>=a}const h1=(r,e={})=>({state:t,dispatch:n})=>{const i=Te(r,t.schema);return xn(t,i,e)?i2(t,n):!1},p1=()=>({state:r,dispatch:e})=>ud(r,e),m1=r=>({state:e,dispatch:t})=>{const n=Te(r,e.schema);return g2(n)(e,t)},g1=()=>({state:r,dispatch:e})=>ld(r,e);function cs(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function Ka(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}const y1=(r,e)=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=cs(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=Te(r,n.schema)),l==="mark"&&(o=or(r,n.schema)),i&&t.selection.ranges.forEach(a=>{n.doc.nodesBetween(a.$from.pos,a.$to.pos,(u,c)=>{s&&s===u.type&&t.setNodeMarkup(c,void 0,Ka(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(d=>{o===d.type&&t.addMark(c,c+u.nodeSize,o.create(Ka(d.attrs,e)))})})}),!0):!1},b1=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),k1=()=>({tr:r,dispatch:e})=>{if(e){const t=new tt(r.doc);r.setSelection(t)}return!0},v1=()=>({state:r,dispatch:e})=>nd(r,e),x1=()=>({state:r,dispatch:e})=>od(r,e),C1=()=>({state:r,dispatch:e})=>a2(r,e),A1=()=>({state:r,dispatch:e})=>d2(r,e),w1=()=>({state:r,dispatch:e})=>c2(r,e);function co(r,e,t={},n={}){return vn(r,e,{slice:!1,parseOptions:t,errorOnInvalidContent:n.errorOnInvalidContent})}const E1=(r,e=!1,t={},n={})=>({editor:i,tr:s,dispatch:o,commands:l})=>{var a,u;const{doc:c}=s;if(t.preserveWhitespace!=="full"){const d=co(r,i.schema,t,{errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:i.options.enableContentCheck});return o&&s.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!e),!0}return o&&s.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:c.content.size},r,{parseOptions:t,errorOnInvalidContent:(u=n.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function xd(r,e){const t=or(e,r.schema),{from:n,to:i,empty:s}=r.selection,o=[];s?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function S1(r,e){const t=new hc(r);return e.forEach(n=>{n.steps.forEach(i=>{t.step(i)})}),t}function D1(r){for(let e=0;e<r.edgeCount;e+=1){const{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function _1(r,e,t){const n=[];return r.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&n.push({node:i,pos:s})}),n}function T1(r,e){for(let t=r.depth;t>0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function Yo(r){return e=>T1(e.$from,r)}function M1(r,e){const t={from:0,to:r.content.size};return pd(r,t,e)}function O1(r,e){const t=Te(e,r.schema),{from:n,to:i}=r.selection,s=[];r.doc.nodesBetween(n,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function Cd(r,e){const t=cs(typeof e=="string"?e:e.name,r.schema);return t==="node"?O1(r,e):t==="mark"?xd(r,e):{}}function N1(r,e=JSON.stringify){const t={};return r.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function I1(r){const e=N1(r);return e.length===1?e:e.filter((t,n)=>!e.filter((s,o)=>o!==n).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function B1(r){const{mapping:e,steps:t}=r,n=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=t[s];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const u=e.slice(s).map(l,-1),c=e.slice(s).map(a),d=e.invert().map(u,-1),f=e.invert().map(c);n.push({oldRange:{from:d,to:f},newRange:{from:u,to:c}})})}),I1(n)}function Qo(r,e,t){const n=[];return r===e?t.resolve(r).marks().forEach(i=>{const s=t.resolve(r),o=Zo(s,i.type);o&&n.push({mark:i,...o})}):t.nodesBetween(r,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),n}function ei(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}function fo(r,e,t={}){const{empty:n,ranges:i}=r.selection,s=e?or(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>gi(d.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:d,$to:f})=>{const h=d.pos,m=f.pos;r.doc.nodesBetween(h,m,(p,g)=>{if(!p.isText&&!p.marks.length)return;const y=Math.max(h,g),x=Math.min(m,g+p.nodeSize),k=x-y;o+=k,l.push(...p.marks.map(A=>({mark:A,from:y,to:x})))})}),o===0)return!1;const a=l.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>gi(d.mark.attrs,t,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),u=l.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+u:a)>=o}function F1(r,e,t={}){if(!e)return xn(r,null,t)||fo(r,null,t);const n=cs(e,r.schema);return n==="node"?xn(r,e,t):n==="mark"?fo(r,e,t):!1}function Ja(r,e){const{nodeExtensions:t}=ls(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=ie(J(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Xo(r,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var n;if(t){if(r.type.name==="hardBreak")return!0;if(r.isText)return/^\s*$/m.test((n=r.text)!==null&&n!==void 0?n:"")}if(r.isText)return!r.text;if(r.isAtom||r.isLeaf)return!1;if(r.content.childCount===0)return!0;if(e){let i=!0;return r.content.forEach(s=>{i!==!1&&(Xo(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function R1(r){return r instanceof G}function $1(r,e,t){var n;const{selection:i}=e;let s=null;if(yd(i)&&(s=i.$cursor),s){const l=(n=r.storedMarks)!==null&&n!==void 0?n:s.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:l,$to:a})=>{let u=l.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(l.pos,a.pos,(c,d,f)=>{if(u)return!1;if(c.isInline){const h=!f||f.type.allowsMarkType(t),m=!!t.isInSet(c.marks)||!c.marks.some(p=>p.type.excludes(t));u=h&&m}return!u}),u})}const P1=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=or(r,n.schema);if(i)if(o){const u=xd(n,a);t.addStoredMark(a.create({...u,...e}))}else l.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;n.doc.nodesBetween(c,d,(f,h)=>{const m=Math.max(h,c),p=Math.min(h+f.nodeSize,d);f.marks.find(y=>y.type===a)?f.marks.forEach(y=>{a===y.type&&t.addMark(m,p,a.create({...y.attrs,...e}))}):t.addMark(m,p,a.create(e))})});return $1(n,t,a)},L1=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),z1=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const s=Te(r,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>qa(s,{...o,...e})(t)?!0:l.clearNodes()).command(({state:l})=>qa(s,{...o,...e})(l,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},q1=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=hr(r,0,n.content.size),s=G.create(n,i);e.setSelection(s)}return!0},V1=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:s}=typeof r=="number"?{from:r,to:r}:r,o=Q.atStart(n).from,l=Q.atEnd(n).to,a=hr(i,o,l),u=hr(s,o,l),c=Q.create(n,a,u);e.setSelection(c)}return!0},j1=r=>({state:e,dispatch:t})=>{const n=Te(r,e.schema);return k2(n)(e,t)};function Ga(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e==null?void 0:e.includes(i.type.name));r.tr.ensureMarks(n)}}const H1=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,u=i.extensionManager.attributes,c=ei(u,l.node().type.name,l.node().attrs);if(s instanceof G&&s.node.isBlock)return!l.parentOffset||!Lt(o,l.pos)?!1:(n&&(r&&Ga(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:D1(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=d&&f?[{type:f,attrs:c}]:void 0,m=Lt(e.doc,e.mapping.map(l.pos),1,h);if(!h&&!m&&Lt(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:c}]:void 0),n){if(m&&(s instanceof Q&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const p=e.mapping.map(l.before()),g=e.doc.resolve(p);l.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}r&&Ga(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},U1=(r,e={})=>({tr:t,state:n,dispatch:i,editor:s})=>{var o;const l=Te(r,n.schema),{$from:a,$to:u}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(u))return!1;const d=a.node(-1);if(d.type!==l)return!1;const f=s.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let y=R.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let _=a.depth-x;_>=a.depth-3;_-=1)y=R.from(a.node(_).copy(y));const k=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,A={...ei(f,a.node().type.name,a.node().attrs),...e},v=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(A))||void 0;y=y.append(R.from(l.createAndFill(null,v)||void 0));const S=a.before(a.depth-(x-1));t.replace(S,a.after(-k),new H(y,4-x,0));let D=-1;t.doc.nodesBetween(S,t.doc.content.size,(_,$)=>{if(D>-1)return!1;_.isTextblock&&_.content.size===0&&(D=$+1)}),D>-1&&t.setSelection(Q.near(t.doc.resolve(D))),t.scrollIntoView()}return!0}const h=u.pos===a.end()?d.contentMatchAt(0).defaultType:null,m={...ei(f,d.type.name,d.attrs),...e},p={...ei(f,a.node().type.name,a.node().attrs),...e};t.delete(a.pos,u.pos);const g=h?[{type:l,attrs:m},{type:h,attrs:p}]:[{type:l,attrs:m}];if(!Lt(t.doc,a.pos,2))return!1;if(i){const{selection:y,storedMarks:x}=n,{splittableMarks:k}=s.extensionManager,A=x||y.$to.parentOffset&&y.$from.marks();if(t.split(a.pos,2,g).scrollIntoView(),!A||!i)return!0;const v=A.filter(S=>k.includes(S.type.name));t.ensureMarks(v)}return!0},Os=(r,e)=>{const t=Yo(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&ir(r.doc,t.pos)&&r.join(t.pos),!0},Ns=(r,e)=>{const t=Yo(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&ir(r.doc,n)&&r.join(n),!0},W1=(r,e,t,n={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:u,can:c})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,h=Te(r,o.schema),m=Te(e,o.schema),{selection:p,storedMarks:g}=o,{$from:y,$to:x}=p,k=y.blockRange(x),A=g||p.$to.parentOffset&&p.$from.marks();if(!k)return!1;const v=Yo(S=>Ja(S.type.name,d))(p);if(k.depth>=1&&v&&k.depth-v.depth<=1){if(v.node.type===h)return u.liftListItem(m);if(Ja(v.node.type.name,d)&&h.validContent(v.node.content)&&l)return a().command(()=>(s.setNodeMarkup(v.pos,h),!0)).command(()=>Os(s,h)).command(()=>Ns(s,h)).run()}return!t||!A||!l?a().command(()=>c().wrapInList(h,n)?!0:u.clearNodes()).wrapInList(h,n).command(()=>Os(s,h)).command(()=>Ns(s,h)).run():a().command(()=>{const S=c().wrapInList(h,n),D=A.filter(_=>f.includes(_.type.name));return s.ensureMarks(D),S?!0:u.clearNodes()}).wrapInList(h,n).command(()=>Os(s,h)).command(()=>Ns(s,h)).run()},K1=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=or(r,n.schema);return fo(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},J1=(r,e,t={})=>({state:n,commands:i})=>{const s=Te(r,n.schema),o=Te(e,n.schema),l=xn(n,s,t);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),l?i.setNode(o,a):i.setNode(s,{...a,...t})},G1=(r,e={})=>({state:t,commands:n})=>{const i=Te(r,t.schema);return xn(t,i,e)?n.lift(i):n.wrapIn(i,e)},Z1=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n<t.length;n+=1){const i=t[n];let s;if(i.spec.isInputRules&&(s=i.getState(r))){if(e){const o=r.tr,l=s.transform;for(let a=l.steps.length-1;a>=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},Y1=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(s=>{r.removeMark(s.$from.pos,s.$to.pos)}),!0},Q1=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=or(r,n.schema),{$from:u,empty:c,ranges:d}=l;if(!i)return!0;if(c&&o){let{from:f,to:h}=l;const m=(s=u.marks().find(g=>g.type===a))===null||s===void 0?void 0:s.attrs,p=Zo(u,a,m);p&&(f=p.from,h=p.to),t.removeMark(f,h,a)}else d.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,a)});return t.removeStoredMark(a),!0},X1=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=cs(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=Te(r,n.schema)),l==="mark"&&(o=or(r,n.schema)),i&&t.selection.ranges.forEach(a=>{const u=a.$from.pos,c=a.$to.pos;let d,f,h,m;t.selection.empty?n.doc.nodesBetween(u,c,(p,g)=>{s&&s===p.type&&(h=Math.max(g,u),m=Math.min(g+p.nodeSize,c),d=g,f=p)}):n.doc.nodesBetween(u,c,(p,g)=>{g<u&&s&&s===p.type&&(h=Math.max(g,u),m=Math.min(g+p.nodeSize,c),d=g,f=p),g>=u&&g<=c&&(s&&s===p.type&&t.setNodeMarkup(g,void 0,{...p.attrs,...e}),o&&p.marks.length&&p.marks.forEach(y=>{if(o===y.type){const x=Math.max(g,u),k=Math.min(g+p.nodeSize,c);t.addMark(x,k,o.create({...y.attrs,...e}))}}))}),f&&(d!==void 0&&t.setNodeMarkup(d,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(p=>{o===p.type&&t.addMark(h,m,o.create({...p.attrs,...e}))}))}),!0):!1},ey=(r,e={})=>({state:t,dispatch:n})=>{const i=Te(r,t.schema);return f2(i,e)(t,n)},ty=(r,e={})=>({state:t,dispatch:n})=>{const i=Te(r,t.schema);return h2(i,e)(t,n)};var ry=Object.freeze({__proto__:null,blur:R2,clearContent:$2,clearNodes:P2,command:L2,createParagraphNear:z2,cut:q2,deleteCurrentNode:V2,deleteNode:j2,deleteRange:H2,deleteSelection:U2,enter:W2,exitCode:K2,extendMarkRange:J2,first:G2,focus:Y2,forEach:Q2,insertContent:X2,insertContentAt:r1,joinBackward:s1,joinDown:i1,joinForward:o1,joinItemBackward:l1,joinItemForward:a1,joinTextblockBackward:u1,joinTextblockForward:c1,joinUp:n1,keyboardShortcut:f1,lift:h1,liftEmptyBlock:p1,liftListItem:m1,newlineInCode:g1,resetAttributes:y1,scrollIntoView:b1,selectAll:k1,selectNodeBackward:v1,selectNodeForward:x1,selectParentNode:C1,selectTextblockEnd:A1,selectTextblockStart:w1,setContent:E1,setMark:P1,setMeta:L1,setNode:z1,setNodeSelection:q1,setTextSelection:V1,sinkListItem:j1,splitBlock:H1,splitListItem:U1,toggleList:W1,toggleMark:K1,toggleNode:J1,toggleWrap:G1,undoInputRule:Z1,unsetAllMarks:Y1,unsetMark:Q1,updateAttributes:X1,wrapIn:ey,wrapInList:ty});const ny=We.create({name:"commands",addCommands(){return{...ry}}}),iy=We.create({name:"drop",addProseMirrorPlugins(){return[new Le({key:new nt("tiptapDrop"),props:{handleDrop:(r,e,t,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:n})}}})]}}),sy=We.create({name:"editable",addProseMirrorPlugins(){return[new Le({key:new nt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),oy=new nt("focusEvents"),ly=We.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new Le({key:oy,props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),ay=We.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:u}=l,{empty:c,$anchor:d}=a,{pos:f,parent:h}=d,m=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,p=m.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=p&&m.parent.childCount===1?g===d.pos:te.atStart(u).from===f;return!c||!h.type.isTextblock||h.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return yi()||vd()?s:i},addProseMirrorPlugins(){return[new Le({key:new nt("clearDocument"),appendTransaction:(r,e,t)=>{if(r.some(p=>p.getMeta("composition")))return;const n=r.some(p=>p.docChanged)&&!e.doc.eq(t.doc),i=r.some(p=>p.getMeta("preventClearDocument"));if(!n||i)return;const{empty:s,from:o,to:l}=e.selection,a=te.atStart(e.doc).from,u=te.atEnd(e.doc).to;if(s||!(o===a&&l===u)||!Xo(t.doc))return;const f=t.tr,h=is({state:t,transaction:f}),{commands:m}=new ss({editor:this.editor,state:h});if(m.clearNodes(),!!f.steps.length)return f}})]}}),uy=We.create({name:"paste",addProseMirrorPlugins(){return[new Le({key:new nt("tiptapPaste"),props:{handlePaste:(r,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),cy=We.create({name:"tabindex",addProseMirrorPlugins(){return[new Le({key:new nt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class cr{get name(){return this.node.type.name}constructor(e,t,n=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new cr(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new cr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new cr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,n)=>{const i=t.isBlock&&!t.isTextblock,s=t.isAtom&&!t.isText,o=this.pos+n+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(o);if(!i&&l.depth<=this.depth)return;const a=new cr(l,this.editor,i,i?t:null);i&&(a.actualDepth=this.depth+1),e.push(new cr(l,this.editor,i,i?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,i=this.parent;for(;i&&!n;){if(i.node.type.name===e)if(Object.keys(t).length>0){const s=i.node.attrs,o=Object.keys(t);for(let l=0;l<o.length;l+=1){const a=o[l];if(s[a]!==t[a])break}}else n=i;i=i.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(t);return this.children.forEach(o=>{n&&i.length>0||(o.node.type.name===e&&s.every(a=>t[a]===o.node.attrs[a])&&i.push(o),!(n&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,t,n))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}}const dy=`.ProseMirror {
7
+ */const qh=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Vh=vh("arrow-left",qh);function Bu(r){switch(r.kind){case"boolean":return r.default??!1;case"repeater":return[];case"object":return jh(r.fields);case"select":return r.multiple?Array.isArray(r.default)?r.default:[]:typeof r.default=="string"?r.default:null;case"media":case"relation":return r.multiple?[]:null;case"text":case"textarea":case"richText":case"email":case"url":case"color":case"date":return r.default??null;case"number":return r.default??null;case"slug":case"coordinates":return null}}function jh(r){const e={};for(const[t,n]of Object.entries(r))e[t]=Bu(n);return e}function Wl(r,e){const t=e??{},n={};for(const[i,s]of Object.entries(r)){const o=t[i];if(o===void 0){n[i]=Bu(s);continue}if(s.kind==="object"){n[i]=Wl(s.fields,o??{});continue}if(s.kind==="repeater"){const l=Array.isArray(o)?o:[];n[i]=l.map(a=>Wl(s.fields,a));continue}n[i]=o}return n}const Hh=["for"],Uh=["id","checked","disabled","aria-describedby"],Wh={class:"min-w-0"},Kh={class:"block text-sm font-medium"},Jh=["id"],Gh=["id"],Zh=Pe({__name:"BooleanField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=X(()=>t.modelValue===!0);return(f,h)=>(z(),H("div",null,[V("label",{for:N(s),class:"flex cursor-pointer items-start gap-3 rounded-sm border border-line bg-raised p-3 transition hover:bg-canvas has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60"},[V("input",{id:N(s),type:"checkbox",checked:d.value,disabled:r.disabled||i.value.readonly,"aria-describedby":N(a),class:"mt-0.5 h-4 w-4 shrink-0 rounded-sm border-line text-accent focus:ring-ink/20",onChange:h[0]||(h[0]=m=>n("update:modelValue",m.target.checked))},null,40,Uh),V("span",Wh,[V("span",Kh,Z(N(o)),1),i.value.description?(z(),H("span",{key:0,id:N(u),class:"block text-xs text-muted"},Z(i.value.description),9,Jh)):fe("",!0)])],8,Hh),N(l)?(z(),H("p",{key:0,id:N(c),class:"field-error"},Z(N(l)),9,Gh)):fe("",!0)]))}}),Yh=["for"],Qh={key:0,class:"text-danger","aria-hidden":"true"},Xh={key:1,class:"sr-only"},ep=["id"],tp=["id"],yt=Pe({__name:"FieldShell",props:{inputId:{},label:{},description:{},required:{type:Boolean},error:{},hintId:{},errorId:{},bare:{type:Boolean}},setup(r){return(e,t)=>(z(),H("div",null,[r.bare?fe("",!0):(z(),H("label",{key:0,for:r.inputId,class:"field-label"},[Lr(Z(r.label)+" ",1),r.required?(z(),H("span",Qh,"*")):fe("",!0),r.required?(z(),H("span",Xh,"(required)")):fe("",!0)],8,Yh)),V("div",{class:xe(r.bare?"":"mt-1.5")},[xh(e.$slots,"default")],2),r.description?(z(),H("p",{key:1,id:r.hintId,class:"field-hint"},Z(r.description),9,ep)):fe("",!0),r.error?(z(),H("p",{key:2,id:r.errorId,class:"field-error"},Z(r.error),9,tp)):fe("",!0)]))}}),rp={class:"flex items-center gap-2"},np=["value","disabled","aria-label"],ip=["id","value","disabled","aria-invalid","aria-describedby"],sp={key:0,class:"mt-2 flex flex-wrap gap-1.5"},op=["title","disabled","aria-pressed","onClick"],lp={class:"sr-only"},ap=Pe({__name:"ColorField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=X(()=>typeof t.modelValue=="string"?t.modelValue:""),f=X(()=>/^#[0-9a-f]{6}$/i.test(d.value)?d.value:"#000000");function h(m){n("update:modelValue",m===""?null:m)}return(m,p)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>{var g;return[V("div",rp,[V("input",{type:"color",value:f.value,disabled:r.disabled||i.value.readonly,"aria-label":`${N(o)} colour picker`,class:"h-9.5 w-12 shrink-0 cursor-pointer rounded-sm border border-line bg-raised p-1",onInput:p[0]||(p[0]=b=>h(b.target.value))},null,40,np),V("input",{id:N(s),type:"text",value:d.value,placeholder:"#1a2b3c",spellcheck:"false",disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:xe(["input font-mono text-[13px] uppercase",N(l)&&"input-invalid"]),onInput:p[1]||(p[1]=b=>h(b.target.value.trim()))},null,42,ip)]),(g=i.value.presets)!=null&&g.length?(z(),H("div",sp,[(z(!0),H(Ye,null,ut(i.value.presets,b=>(z(),H("button",{key:b,type:"button",title:b,disabled:r.disabled||i.value.readonly,"aria-pressed":d.value.toLowerCase()===b.toLowerCase(),class:xe(["h-7 w-7 rounded-full border transition",d.value.toLowerCase()===b.toLowerCase()?"border-ink ring-2 ring-ink/15":"border-line hover:scale-110"]),style:Ch({backgroundColor:b}),onClick:E=>h(b)},[V("span",lp,"Use "+Z(b),1)],14,op))),128))])):fe("",!0)]}),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),up={class:"grid grid-cols-2 gap-2"},cp=["for"],dp=["id","value","disabled","aria-describedby"],fp=["for"],hp=["id","value","disabled"],pp={key:0,class:"field-error"},mp={class:"mt-1.5 flex items-center gap-3 text-xs text-muted"},gp=["href"],yp=Pe({__name:"CoordinatesField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=X(()=>{const g=t.modelValue;if(!g||typeof g!="object")return null;const{lat:b,lng:E}=g;return typeof b=="number"&&typeof E=="number"?{lat:b,lng:E}:null}),f=g=>{var b,E;return((E=(b=t.issues)==null?void 0:b.find(v=>v.path===`${t.path}.${g}`))==null?void 0:E.message)??null};function h(g,b){const E=Number(b),v=d.value??{lat:0,lng:0};if(b.trim()===""){n("update:modelValue",null);return}Number.isFinite(E)&&n("update:modelValue",{...v,[g]:E})}function m(g){var v;const b=((v=g.clipboardData)==null?void 0:v.getData("text"))??"",E=/^\s*(-?\d+(?:\.\d+)?)\s*[,;\s]\s*(-?\d+(?:\.\d+)?)\s*$/.exec(b);E&&(g.preventDefault(),n("update:modelValue",{lat:Number(E[1]),lng:Number(E[2])}))}const p=X(()=>d.value?`https://www.openstreetmap.org/?mlat=${d.value.lat}&mlon=${d.value.lng}#map=16/${d.value.lat}/${d.value.lng}`:null);return(g,b)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>{var E,v;return[V("div",up,[V("div",null,[V("label",{for:`${N(s)}-lat`,class:"sr-only"},"Latitude",8,cp),V("input",{id:`${N(s)}-lat`,type:"number",step:"any",min:"-90",max:"90",placeholder:"Latitude",value:((E=d.value)==null?void 0:E.lat)??"",disabled:r.disabled||i.value.readonly,"aria-describedby":N(a),class:xe(["input font-mono text-[13px]",f("lat")&&"input-invalid"]),onInput:b[0]||(b[0]=D=>h("lat",D.target.value)),onPaste:m},null,42,dp)]),V("div",null,[V("label",{for:`${N(s)}-lng`,class:"sr-only"},"Longitude",8,fp),V("input",{id:`${N(s)}-lng`,type:"number",step:"any",min:"-180",max:"180",placeholder:"Longitude",value:((v=d.value)==null?void 0:v.lng)??"",disabled:r.disabled||i.value.readonly,class:xe(["input font-mono text-[13px]",f("lng")&&"input-invalid"]),onInput:b[1]||(b[1]=D=>h("lng",D.target.value)),onPaste:m},null,42,hp)])]),f("lat")||f("lng")?(z(),H("p",pp,Z(f("lat")??f("lng")),1)):fe("",!0),V("div",mp,[b[3]||(b[3]=V("span",null,'Paste "47.3769, 8.5417" into either box to fill both.',-1)),p.value?(z(),H("a",{key:0,href:p.value,target:"_blank",rel:"noopener noreferrer",class:"font-medium text-accent underline underline-offset-2"}," Check on the map ",8,gp)):fe("",!0),d.value?(z(),H("button",{key:1,type:"button",class:"ml-auto font-medium hover:text-ink",onClick:b[2]||(b[2]=D=>n("update:modelValue",null))}," Clear ")):fe("",!0)])]}),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),bp={class:"flex items-center gap-2"},kp=["id","type","value","min","max","required","disabled","aria-invalid","aria-describedby"],vp=["disabled"],xp=Pe({__name:"DateField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=X(()=>{const m=t.modelValue;if(typeof m!="string"||m==="")return"";if(!i.value.includeTime)return m.slice(0,10);const p=new Date(m);if(Number.isNaN(p.getTime()))return"";const g=b=>String(b).padStart(2,"0");return`${p.getFullYear()}-${g(p.getMonth()+1)}-${g(p.getDate())}T${g(p.getHours())}:${g(p.getMinutes())}`});function f(m){const p=m.target.value;if(!p){n("update:modelValue",null);return}if(!i.value.includeTime){n("update:modelValue",p);return}const g=new Date(p);n("update:modelValue",Number.isNaN(g.getTime())?null:g.toISOString())}function h(){const m=new Date;n("update:modelValue",i.value.includeTime?m.toISOString():m.toISOString().slice(0,10))}return(m,p)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[V("div",bp,[V("input",{id:N(s),type:i.value.includeTime?"datetime-local":"date",value:d.value,min:i.value.min,max:i.value.max,required:i.value.required,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:xe(["input",N(l)&&"input-invalid"]),onInput:f},null,42,kp),V("button",{type:"button",class:"btn-secondary shrink-0",disabled:r.disabled||i.value.readonly,onClick:h}," Today ",8,vp)])]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),Cp={class:"flex items-center gap-3 border-b border-line px-5 py-3.5"},Ap={class:"mb-4 flex cursor-pointer flex-col items-center justify-center gap-1 rounded-md border border-dashed border-line-strong bg-canvas/50 px-4 py-6 text-center transition hover:border-ink/40"},wp=["accept","multiple","disabled"],Ep={class:"text-sm font-medium"},Sp={class:"text-xs text-muted"},Dp={key:0,class:"py-8 text-center text-sm text-muted"},_p={key:1,class:"py-8 text-center text-sm text-muted"},Tp={key:2,class:"grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-5"},Mp=["aria-pressed","onClick"],Op={class:"block aspect-4/3 bg-canvas"},Np=["src"],Ip={key:1,class:"flex h-full w-full items-center justify-center text-xs font-medium uppercase text-muted"},Bp={class:"block px-2 py-1.5"},Fp={class:"block truncate text-xs font-medium"},Rp=["title"],$p={class:"block text-[11px] text-muted"},Pp={key:0,class:"flex items-center justify-between gap-3 border-t border-line px-5 py-3"},Lp={class:"text-sm text-muted"},zp={class:"flex gap-2"},qp=["disabled"],Vp=Pe({__name:"MediaPicker",props:{open:{type:Boolean},accept:{default:"any"},multiple:{type:Boolean,default:!1},selected:{default:()=>[]}},emits:["close","choose"],setup(r,{emit:e}){const t=r,n=e,i=Sh(),s=je([]),o=je(!1),l=je(!1),a=je(""),u=je([]),c=je(null),d=je(null),f=je(!1);let h=null;const m=X(()=>t.accept==="image"?"image/*":t.accept==="document"?"application/pdf":void 0),p=X(()=>{const T=a.value.trim().toLowerCase();return s.value.filter(B=>t.accept==="image"&&!b(B)||t.accept==="document"&&b(B)?!1:!T||B.path.toLowerCase().includes(T))}),g=X(()=>u.value.length>0),b=T=>T.mimeType.startsWith("image/");async function E(){o.value=!0;try{s.value=(await yr.media.list()).items}catch(T){i.error(T instanceof Vl?T.message:"Could not load the media library.")}finally{o.value=!1}}rn(()=>t.open,async T=>{var B,O;if(!T){document.body.style.overflow="",h==null||h.focus();return}h=document.activeElement,document.body.style.overflow="hidden",u.value=[],a.value="",await E(),await Nu(),(O=(B=c.value)==null?void 0:B.querySelector("input, button"))==null||O.focus()}),Qi(()=>{document.body.style.overflow=""});function v(T){if(!t.multiple){n("choose",[T]),n("close");return}u.value=u.value.includes(T.path)?u.value.filter(B=>B!==T.path):[...u.value,T.path]}function D(){const T=new Map(s.value.map(O=>[O.path,O])),B=u.value.map(O=>T.get(O)).filter(O=>O!==void 0);n("choose",B),n("close")}async function x(T){const B=Array.from(T??[]);if(B.length!==0){l.value=!0;try{const{items:O}=await yr.media.upload(B,{accept:t.accept});if(!t.multiple){O[0]&&n("choose",[O[0]]),n("close");return}await E(),u.value=[...u.value,...O.map(q=>q.path)],i.success(`Uploaded ${O.length} file${O.length===1?"":"s"}.`)}catch(O){i.error(O instanceof Vl?O.message:"The upload failed.")}finally{l.value=!1,d.value&&(d.value.value="")}}}function k(T){var B;f.value=!1,x(((B=T.dataTransfer)==null?void 0:B.files)??null)}function C(T){if(T.key==="Escape"){n("close");return}if(T.key!=="Tab"||!c.value)return;const B=c.value.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'),O=B[0],q=B[B.length-1];!O||!q||(T.shiftKey&&document.activeElement===O?(T.preventDefault(),q.focus()):!T.shiftKey&&document.activeElement===q&&(T.preventDefault(),O.focus()))}const w=T=>T<1024*1024?`${Math.round(T/1024)} KB`:`${(T/1024/1024).toFixed(1)} MB`,I=T=>{const B=T.split("/");return B.pop(),B.join("/")||"/"};return(T,B)=>(z(),rt(Ah,{to:"body"},[r.open?(z(),H("div",{key:0,class:"fixed inset-0 z-50 flex items-end justify-center bg-ink/40 p-0 sm:items-center sm:p-6",onClick:B[6]||(B[6]=Ln(O=>n("close"),["self"])),onKeydown:C},[V("div",{ref_key:"dialog",ref:c,role:"dialog","aria-modal":"true","aria-labelledby":"media-picker-title",class:"flex max-h-[90vh] w-full max-w-4xl flex-col rounded-t-xl border border-line bg-raised shadow-2xl sm:rounded-xl"},[V("header",Cp,[B[8]||(B[8]=V("h2",{id:"media-picker-title",class:"text-base font-semibold"},"Media",-1)),wh(V("input",{"onUpdate:modelValue":B[0]||(B[0]=O=>a.value=O),type:"search",placeholder:"Search files…",class:"input ml-auto max-w-56","aria-label":"Search media"},null,512),[[Eh,a.value]]),V("button",{type:"button",class:"btn-ghost -mr-2 px-2",onClick:B[1]||(B[1]=O=>n("close"))},[Rt(N(Iu),{size:20,"aria-hidden":"true"}),B[7]||(B[7]=V("span",{class:"sr-only"},"Close",-1))])]),V("div",{class:xe(["min-h-0 flex-1 overflow-y-auto p-5",f.value&&"bg-accent-soft"]),onDragover:B[3]||(B[3]=Ln(O=>f.value=!0,["prevent"])),onDragleave:B[4]||(B[4]=Ln(O=>f.value=!1,["prevent"])),onDrop:Ln(k,["prevent"])},[V("label",Ap,[V("input",{ref_key:"fileInput",ref:d,type:"file",class:"sr-only",accept:m.value,multiple:r.multiple,disabled:l.value,onChange:B[2]||(B[2]=O=>x(O.target.files))},null,40,wp),V("span",Ep,Z(l.value?"Uploading…":"Drop files here, or choose from your device"),1),V("span",Sp,Z(r.accept==="image"?"Images":r.accept==="document"?"PDF documents":"Images and documents"),1)]),o.value?(z(),H("p",Dp,"Loading…")):p.value.length===0?(z(),H("p",_p,Z(a.value?`Nothing matches "${a.value}".`:"No files yet."),1)):(z(),H("ul",Tp,[(z(!0),H(Ye,null,ut(p.value,O=>(z(),H("li",{key:O.path},[V("button",{type:"button","aria-pressed":u.value.includes(O.path)||r.selected.includes(O.path),class:xe(["group block w-full overflow-hidden rounded-lg border text-left transition",u.value.includes(O.path)?"border-accent ring-2 ring-accent/25":r.selected.includes(O.path)?"border-accent/50":"border-line hover:border-accent/40"]),onClick:q=>v(O)},[V("span",Op,[b(O)?(z(),H("img",{key:0,src:N(yr).media.url(O.path),alt:"",loading:"lazy",class:"h-full w-full object-cover"},null,8,Np)):(z(),H("span",Ip,Z(O.mimeType.split("/")[1]),1))]),V("span",Bp,[V("span",Fp,Z(O.filename),1),V("span",{class:"block truncate text-[11px] text-muted",title:O.path},Z(I(O.path)),9,Rp),V("span",$p,Z(O.width?`${O.width}×${O.height} · `:"")+Z(w(O.size)),1)])],10,Mp)]))),128))]))],34),r.multiple?(z(),H("footer",Pp,[V("span",Lp,Z(u.value.length)+" selected ",1),V("div",zp,[V("button",{type:"button",class:"btn-secondary",onClick:B[5]||(B[5]=O=>n("close"))},"Cancel"),V("button",{type:"button",class:"btn-primary",disabled:!g.value,onClick:D}," Add "+Z(u.value.length||""),9,qp)])])):fe("",!0)],512)],32)):fe("",!0)]))}}),jp=["aria-describedby"],Hp={class:"aspect-4/3"},Up=["src"],Wp={key:1,class:"flex h-full w-full flex-col items-center justify-center gap-1 p-2 text-center"},Kp={class:"text-[11px] font-semibold uppercase text-muted"},Jp=["title"],Gp={key:0,class:"px-1.5 pb-1.5"},Zp=["for"],Yp={key:0,class:"text-danger","aria-hidden":"true"},Qp={key:1,class:"sr-only"},Xp=["id","value","required","disabled","aria-invalid","aria-describedby","onInput"],em=["id"],tm={class:"absolute inset-x-0 top-0 flex justify-end gap-0.5 bg-gradient-to-b from-ink/50 to-transparent p-1 opacity-0 transition group-hover:opacity-100 group-focus-within:opacity-100"},rm=["disabled","onClick"],nm={class:"sr-only"},im=["disabled","onClick"],sm={class:"sr-only"},om=["disabled","onClick"],lm={class:"sr-only"},am=["id","disabled"],um={key:1,class:"ml-2 text-xs text-muted"},cm=Pe({__name:"MediaField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=je(!1);function f(k){if(typeof k=="string")return{path:k,alt:null};const C=k??{};return{path:typeof C.path=="string"?C.path:"",alt:typeof C.alt=="string"?C.alt:null}}const h=X(()=>(i.value.multiple?Array.isArray(t.modelValue)?t.modelValue:[]:t.modelValue==null||t.modelValue===""?[]:[t.modelValue]).map(f).filter(C=>C.path!=="")),m=X(()=>h.value.map(k=>k.path)),p=X(()=>h.value.map((k,C)=>{var w,I;return{...k,filename:k.path.split("/").pop()??k.path,url:yr.media.url(k.path),isImage:/\.(jpe?g|png|webp|avif|gif)$/i.test(k.path),altId:`${s}-alt-${C}`,altErrorId:`${s}-alt-${C}-error`,altError:((I=(w=t.issues)==null?void 0:w.find(T=>T.path===(i.value.multiple?`${t.path}.${C}.alt`:`${t.path}.alt`)))==null?void 0:I.message)??null}})),g=X(()=>i.value.multiple&&i.value.max!==void 0&&m.value.length>=i.value.max);function b(k){const C=i.value.alt?k:k.map(w=>w.path);n("update:modelValue",i.value.multiple?C:C[0]??null)}function E(k){if(!i.value.multiple){b(k[0]?[{path:k[0].path,alt:null}]:[]);return}const C=[...h.value];for(const w of k)m.value.includes(w.path)||C.push({path:w.path,alt:null});b(i.value.max?C.slice(0,i.value.max):C)}function v(k){b(h.value.filter((C,w)=>w!==k))}function D(k,C){const w=k+C;if(w<0||w>=h.value.length)return;const I=[...h.value];[I[k],I[w]]=[I[w],I[k]],b(I)}function x(k,C){const w=C.target.value;b(h.value.map((I,T)=>T===k?{...I,alt:w===""?null:w}:I))}return(k,C)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[V("div",{"aria-describedby":N(a)},[p.value.length?(z(),H("ul",{key:0,class:xe(["mb-2 gap-2",i.value.multiple?i.value.alt?"grid grid-cols-2 sm:grid-cols-3":"grid grid-cols-3 sm:grid-cols-5":"flex"])},[(z(!0),H(Ye,null,ut(p.value,(w,I)=>(z(),H("li",{key:`${w.path}-${I}`,class:xe(["group relative overflow-hidden rounded-lg border border-line bg-canvas",i.value.multiple?"":i.value.alt?"w-64":"w-40"])},[V("div",Hp,[w.isImage?(z(),H("img",{key:0,src:w.url,alt:"",class:"h-full w-full object-cover"},null,8,Up)):(z(),H("div",Wp,[V("span",Kp,Z(w.filename.split(".").pop()),1)]))]),V("p",{class:"truncate px-1.5 py-1 text-[11px] text-muted",title:w.path},Z(w.filename),9,Jp),i.value.alt?(z(),H("div",Gp,[V("label",{for:w.altId,class:"text-[11px] font-medium"},[C[2]||(C[2]=Lr(" Alt text ",-1)),i.value.alt==="required"?(z(),H("span",Yp,"*")):fe("",!0),i.value.alt==="required"?(z(),H("span",Qp,"(required)")):fe("",!0)],8,Zp),V("input",{id:w.altId,type:"text",value:w.alt??"",required:i.value.alt==="required",disabled:r.disabled||i.value.readonly,"aria-invalid":w.altError?"true":void 0,"aria-describedby":w.altError?w.altErrorId:void 0,class:xe(["input mt-0.5 text-xs",w.altError&&"input-invalid"]),autocomplete:"off",onInput:T=>x(I,T)},null,42,Xp),w.altError?(z(),H("p",{key:0,id:w.altErrorId,class:"field-error"},Z(w.altError),9,em)):fe("",!0)])):fe("",!0),V("div",tm,[i.value.multiple&&I>0?(z(),H("button",{key:0,type:"button",class:"rounded-sm bg-raised/90 px-1.5 text-xs font-semibold hover:bg-raised",disabled:r.disabled,onClick:T=>D(I,-1)},[Rt(N(Vh),{size:14,"aria-hidden":"true"}),V("span",nm,"Move "+Z(w.filename)+" earlier",1)],8,rm)):fe("",!0),i.value.multiple&&I<p.value.length-1?(z(),H("button",{key:1,type:"button",class:"rounded-sm bg-raised/90 px-1.5 text-xs font-semibold hover:bg-raised",disabled:r.disabled,onClick:T=>D(I,1)},[Rt(N(Lh),{size:14,"aria-hidden":"true"}),V("span",sm,"Move "+Z(w.filename)+" later",1)],8,im)):fe("",!0),V("button",{type:"button",class:"rounded-sm bg-raised/90 px-1.5 text-xs font-semibold text-danger hover:bg-raised",disabled:r.disabled,onClick:T=>v(I)},[Rt(N(Iu),{size:14,"aria-hidden":"true"}),V("span",lm,"Remove "+Z(w.filename),1)],8,om)])],2))),128))],2)):fe("",!0),V("button",{id:N(s),type:"button",class:"btn-secondary",disabled:r.disabled||i.value.readonly||g.value,onClick:C[0]||(C[0]=w=>d.value=!0)},[Rt(N(zh),{size:16,"aria-hidden":"true"}),Lr(" "+Z(p.value.length&&!i.value.multiple?"Replace":"Add"),1)],8,am),g.value?(z(),H("span",um," Maximum of "+Z(i.value.max)+" reached. ",1)):fe("",!0)],8,jp),Rt(Vp,{open:d.value,accept:i.value.accept??"any",multiple:i.value.multiple,selected:m.value,onClose:C[1]||(C[1]=w=>d.value=!1),onChoose:E},null,8,["open","accept","multiple","selected"])]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),dm={class:"relative"},fm=["id","value","min","max","step","required","disabled","aria-invalid","aria-describedby"],hm={key:0,class:"pointer-events-none absolute inset-y-0 right-3 flex items-center text-sm text-muted"},pm=Pe({__name:"NumberField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=X(()=>typeof t.modelValue=="number"?String(t.modelValue):"");function f(h){const m=h.target.value;if(m.trim()===""){n("update:modelValue",null);return}const p=Number(m);n("update:modelValue",Number.isFinite(p)?p:null)}return(h,m)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[V("div",dm,[V("input",{id:N(s),type:"number",inputmode:"decimal",value:d.value,min:i.value.min,max:i.value.max,step:i.value.step??(i.value.integer?1:"any"),required:i.value.required,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:xe(["input",i.value.unit&&"pr-12",N(l)&&"input-invalid"]),onInput:f},null,42,fm),i.value.unit?(z(),H("span",hm,Z(i.value.unit),1)):fe("",!0)])]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),mm={key:0,class:"text-sm text-muted"},gm={key:1,class:"text-sm text-muted"},ym=["aria-describedby"],bm={class:"sr-only"},km=["checked","disabled","onChange"],vm={class:"min-w-0 flex-1 truncate"},xm={class:"shrink-0 font-mono text-[11px] text-muted"},Cm=["id","value","disabled","aria-invalid","aria-describedby"],Am=["value"],wm=Pe({__name:"RelationField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=Dh(),f=je([]),h=je(!0),m=X(()=>{var v;return((v=d.collection(i.value.collection))==null?void 0:v.label)??i.value.collection});Mo(async()=>{try{f.value=(await yr.entries.list(i.value.collection)).items}finally{h.value=!1}});const p=X(()=>i.value.multiple?Array.isArray(t.modelValue)?t.modelValue:[]:typeof t.modelValue=="string"?[t.modelValue]:[]),g=v=>{var D;return((D=f.value.find(x=>x.slug===v))==null?void 0:D.title)??v},b=v=>!h.value&&!f.value.some(D=>D.slug===v);function E(v){const D=p.value.includes(v)?p.value.filter(x=>x!==v):[...p.value,v];n("update:modelValue",D)}return(v,D)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[h.value?(z(),H("p",mm,"Loading "+Z(m.value)+"…",1)):f.value.length===0?(z(),H("p",gm," There are no entries in "+Z(m.value)+" yet. ",1)):(z(),H(Ye,{key:2},[i.value.multiple?(z(),H("fieldset",{key:0,class:"space-y-1.5","aria-describedby":N(a)},[V("legend",bm,Z(N(o)),1),(z(!0),H(Ye,null,ut(f.value,x=>(z(),H("label",{key:x.slug,class:"flex cursor-pointer items-center gap-2.5 rounded-sm border border-line bg-raised px-3 py-2 text-sm hover:bg-canvas"},[V("input",{type:"checkbox",checked:p.value.includes(x.slug),disabled:r.disabled||i.value.readonly,class:"h-4 w-4 rounded-sm border-line text-accent focus:ring-ink/20",onChange:k=>E(x.slug)},null,40,km),V("span",vm,Z(x.title),1),V("span",xm,Z(x.slug),1)]))),128))],8,ym)):(z(),H("select",{key:1,id:N(s),value:p.value[0]??"",disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:xe(["input",N(l)&&"input-invalid"]),onChange:D[0]||(D[0]=x=>n("update:modelValue",x.target.value||null))},[D[1]||(D[1]=V("option",{value:""},"Not set",-1)),(z(!0),H(Ye,null,ut(f.value,x=>(z(),H("option",{key:x.slug,value:x.slug},Z(x.title),9,Am))),128))],42,Cm))],64)),(z(!0),H(Ye,null,ut(p.value.filter(b),x=>(z(),H("p",{key:x,class:"field-error"},' "'+Z(g(x))+'" is no longer in '+Z(m.value)+". ",1))),128))]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}});function Ne(r){this.content=r}Ne.prototype={constructor:Ne,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),s=n.content.slice();return i==-1?s.push(t||r,e):(s[i+1]=e,t&&(s[i]=t)),new Ne(s)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ne(t)},addToStart:function(r,e){return new Ne([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Ne(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),s=n.find(r);return i.splice(s==-1?i.length:s,0,e,t),new Ne(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Ne.from(r),r.size?new Ne(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Ne.from(r),r.size?new Ne(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Ne.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};Ne.from=function(r){if(r instanceof Ne)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Ne(e)};function Fu(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a<o.length&&a<l.length&&Pu(o.charCodeAt(a-1))&&$u(o.charCodeAt(a))&&t--,t}if(i.content.size||s.content.size){let o=Fu(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Ru(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,n-=a;continue}if(!o.sameMarkup(l))return{a:t,b:n};if(o.isText&&o.text!=l.text){let u=o.text,c=l.text,d=u.length,f=c.length;for(;d>0&&f>0&&u[d-1]==c[f-1];)d--,f--,t--,n--;return d&&f&&d<u.length&&Pu(u.charCodeAt(d-1))&&$u(u.charCodeAt(d))&&(t++,n++),{a:t,b:n}}if(o.content.size||l.content.size){let u=Ru(o.content,l.content,t-1,n-1);if(u)return u}t-=a,n-=a}}function $u(r){return r>=56320&&r<57344}function Pu(r){return r>=55296&&r<56320}class ${constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,s){for(let o=0,l=0;l<t;o++){let a=this.content[o],u=l+a.nodeSize;if(u>e&&n(a,i+l,s||null,o)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,t-c),n,i+c)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let u=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&n&&(o?o=!1:s+=n),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new $(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),i+=l.nodeSize),o=a}return new $(n,i)}cutByIndex(e,t){return e==t?$.empty:e==0&&t==this.content.length?this:new $(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new $(i,s)}addToStart(e){return new $([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new $(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Fu(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ru(this,e,t,n)}findIndex(e){if(e==0)return zn(0,e);if(e==this.size)return zn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),s=n+i.nodeSize;if(s>=e)return s==e?zn(t+1,s):zn(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return $.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return $.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return $.empty;let t,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new $(t||e,n)}static from(e){if(!e)return $.empty;if(e instanceof $)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new $([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}$.empty=new $([],0);const bs={index:0,offset:0};function zn(r,e){return bs.index=r,bs.offset=e,bs}function li(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!li(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!li(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let he=class Js{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&li(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Js.none;if(e instanceof Js)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};he.none=[];class pn extends Error{}class U{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=zu(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new U(n,this.openStart,this.openEnd)}removeBetween(e,t){return new U(Lu(this.content,e+this.openStart,t+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,t){if(!t)return U.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new U($.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new U(e,n,i)}}U.empty=new U($.empty,0,0);function Lu(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:l}=r.findIndex(t);if(i==e||s.isText){if(l!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(Lu(s.content,e-i-1,t-i-1)))}function zu(r,e,t,n,i,s){let{index:o,offset:l}=r.findIndex(e),a=r.maybeChild(o);if(l==e||a.isText)return s&&n<=0&&i<=0&&!s.canReplace(o,o,t)?null:r.cut(0,e).append(t).append(r.cut(e));let u=zu(a.content,e-l-1,t,o==0?n-1:0,o==r.childCount-1?i-1:0,a);return u&&r.replaceChild(o,a.copy(u))}function Em(r,e,t){if(t.openStart>r.depth)throw new pn("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new pn("Inconsistent open depths");return qu(r,e,t,0)}function qu(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=qu(r,e,t,n+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,l=o.content;return kr(o,l.cut(0,r.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Sm(t,r);return kr(s,ju(r,o,l,e,n))}else return kr(s,ai(r,e,n))}function Vu(r,e){if(!e.type.compatibleContent(r.type))throw new pn("Cannot join "+e.type.name+" onto "+r.type.name)}function Gs(r,e,t){let n=r.node(t);return Vu(n,e.node(t)),n}function br(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function nn(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(br(r.nodeAfter,n),s++));for(let l=s;l<o;l++)br(i.child(l),n);e&&e.depth==t&&e.textOffset&&br(e.nodeBefore,n)}function kr(r,e){if(!r.type.validContent(e))throw new pn("Invalid content for node "+r.type.name);return r.copy(e)}function ju(r,e,t,n,i){let s=r.depth>i&&Gs(r,e,i+1),o=n.depth>i&&Gs(t,n,i+1),l=[];return nn(null,r,i,l),s&&o&&e.index(i)==t.index(i)?(Vu(s,o),br(kr(s,ju(r,e,t,n,i+1)),l)):(s&&br(kr(s,ai(r,e,i+1)),l),nn(e,t,i,l),o&&br(kr(o,ai(t,n,i+1)),l)),nn(n,null,i,l),new $(l)}function ai(r,e,t){let n=[];if(nn(null,r,t,n),r.depth>t){let i=Gs(r,e,t+1);br(kr(i,ai(r,e,t+1)),n)}return nn(e,null,t,n),new $(n)}function Sm(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy($.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class mn{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return he.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let l=n;n=i,i=l}let s=n.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ui(this,e,n);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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),u=s-a;if(n.push(o,l,i+a),!u||(o=o.child(l),o.isText))break;s=u-1,i+=a+1}return new mn(t,n,s)}static resolveCached(e,t){let n=Kl.get(e);if(n)for(let s=0;s<n.elts.length;s++){let o=n.elts[s];if(o.pos==t)return o}else Kl.set(e,n=new Dm);let i=n.elts[n.i]=mn.resolve(e,t);return n.i=(n.i+1)%_m,i}}class Dm{constructor(){this.elts=[],this.i=0}}const _m=12,Kl=new WeakMap;class ui{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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 Tm=Object.create(null);let Yt=class Zs{constructor(e,t,n,i=he.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||$.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,t,n,i=0){this.content.nodesBetween(e,t,n,i,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,t,n,i){return this.content.textBetween(e,t,n,i)}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,t,n){return this.type==e&&li(this.attrs,t||e.defaultAttrs||Tm)&&he.sameSet(this.marks,n||he.none)}copy(e=null){return e==this.content?this:new Zs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Zs(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return U.empty;let i=this.resolve(e),s=this.resolve(t),o=n?0:i.sharedDepth(t),l=i.start(o),u=i.node(o).content.cut(i.pos-l,s.pos-l);return new U(u,i.depth-o,s.depth-o)}replace(e,t,n){return Em(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return mn.resolveCached(this,e)}resolveNoCache(e){return mn.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}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()+")"),Hu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=$.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),o=s&&s.matchFragment(this.content,t);return o?o.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=he.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!he.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t 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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=$.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};Yt.prototype.text=void 0;class ci extends Yt{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Hu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ci(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ci(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Hu(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class wr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Mm(e,t);if(n.next==null)return wr.empty;let i=Uu(n);n.next&&n.err("Unexpected trailing text");let s=$m(Rm(i));return Pm(s,n),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let s=t;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function s(o,l){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return $.from(l.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:c,next:d}=o.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(c));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!i.type||a.validEnd)&&(n.push({match:l.contentMatch,type:l,via:i}),t[l.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 t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)s+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return s}).join(`
8
+ `)}}wr.empty=new wr(!0);class Mm{constructor(e,t){this.string=e,this.nodeTypes=t,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 Uu(r){let e=[];do e.push(Om(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Om(r){let e=[];do e.push(Nm(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Nm(r){let e=Fm(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=Im(r,e);else break;return e}function Jl(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function Im(r,e){let t=Jl(r),n=t;return r.eat(",")&&(r.next!="}"?n=Jl(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function Bm(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function Fm(r){if(r.eat("(")){let e=Uu(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=Bm(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Rm(r){let e=[[]];return i(s(r,0),t()),e;function t(){return e.push([])-1}function n(o,l,a){let u={term:a,to:l};return e[o].push(u),u}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(o.type=="seq")for(let a=0;;a++){let u=s(o.exprs[a],l);if(a==o.exprs.length-1)return u;i(u,l=t())}else if(o.type=="star"){let a=t();return n(l,a),i(s(o.expr,a),a),[n(a)]}else if(o.type=="plus"){let a=t();return i(s(o.expr,l),a),i(s(o.expr,a),a),[n(a)]}else{if(o.type=="opt")return[n(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let u=0;u<o.min;u++){let c=t();i(s(o.expr,a),c),a=c}if(o.max==-1)i(s(o.expr,a),a);else for(let u=o.min;u<o.max;u++){let c=t();n(a,c),i(s(o.expr,a),c),a=c}return[n(a)]}else{if(o.type=="name")return[n(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Wu(r,e){return e-r}function Gl(r,e){let t=[];return n(e),t.sort(Wu);function n(i){let s=r[i];if(s.length==1&&!s[0].term)return n(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:l,to:a}=s[o];!l&&t.indexOf(a)==-1&&n(a)}}}function $m(r){let e=Object.create(null);return t(Gl(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c<i.length;c++)i[c][0]==l&&(u=i[c][1]);Gl(r,a).forEach(c=>{u||i.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=e[n.join(",")]=new wr(n.indexOf(r.length-1)>-1);for(let o=0;o<i.length;o++){let l=i[o][1].sort(Wu);s.next.push({type:i[o][0],next:e[l.join(",")]||t(l)})}return s}}function Pm(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],s=!i.validEnd,o=[];for(let l=0;l<i.next.length;l++){let{type:a,next:u}=i.next[l];o.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),n.indexOf(u)==-1&&n.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ku(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function Ju(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let s=r[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function Gu(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${n}`);for(let i in r)r[i].validate&&r[i].validate(e[i])}function Zu(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new zm(r,n,e[n]);return t}let Zl=class Yu{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Zu(e,n.attrs),this.defaultAttrs=Ku(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==wr.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:Ju(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Yt(this,this.computeAttrs(e),$.from(t),he.setFrom(n))}createChecked(e=null,t,n){return t=$.from(t),this.checkContent(t),new Yt(this,this.computeAttrs(e),t,he.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=$.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore($.empty,!0);return s?new Yt(this,e,t.append(s),he.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).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){Gu(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 t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:he.none:e}static compile(e,t){let n=Object.create(null);e.forEach((s,o)=>n[s]=new Yu(s,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function Lm(r,e,t){let n=t.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${s}`)}}class zm{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?Lm(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Xi{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Zu(e,i.attrs),this.excluded=null;let s=Ku(this.attrs);this.instance=s?new he(this,s):null}create(e=null){return!e&&this.instance?this.instance:new he(this,Ju(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new Xi(s,i++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Gu(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Qu{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Ne.from(e.nodes),t.marks=Ne.from(e.marks||{}),this.nodes=Zl.compile(this.spec.nodes,this),this.marks=Xi.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=n[o]||(n[o]=wr.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?Yl(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Yl(this,o.split(" "))}this.nodeFromJSON=i=>Yt.fromJSON(this,i),this.markFromJSON=i=>he.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Zl){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(t,n,i)}text(e,t){let n=this.nodes.text;return new ci(n,n.defaultAttrs,e,he.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Yl(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],s=r.marks[i],o=s;if(s)t.push(s);else for(let l in r.marks){let a=r.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function qm(r){return r.tag!=null}function Vm(r){return r.style!=null}class Qt{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(qm(i))this.tags.push(i);else if(Vm(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let n=new Xl(this,t,!1);return n.addAll(e,he.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Xl(this,t,!0);return n.addAll(e,he.none,t.from,t.to),U.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Um(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,n,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{n(o=ea(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=ea(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Qt(e,Qt.schemaRules(e)))}}const Xu={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},jm={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ec={ol:!0,ul:!0},gn=1,Ys=2,sn=4;function Ql(r,e,t){return e!=null?(e?gn:0)|(e==="full"?Ys:0):r&&r.whitespace=="pre"?gn|Ys:t&~sn}class qn{constructor(e,t,n,i,s,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=he.none,this.match=s||(o&sn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore($.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&gn)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=$.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore($.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Xu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Xl{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=Ql(null,t.preserveWhitespace,0)|(n?sn:0);i?s=new qn(i.type,i.attrs,he.none,!0,t.topMatch||i.type.contentMatch,o):n?s=new qn(null,null,he.none,!0,null,o):s=new qn(e.schema.topNodeType,null,he.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,s=i.options&Ys?"full":this.localPreserveWS||(i.options&gn)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)if(s==="full")n=n.replace(/\r\n?/g,`
9
+ `);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=n.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;ec.hasOwnProperty(o)&&this.parser.normalizeLists&&Hm(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,n));e:if(a?a.ignore:jm.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let u,c=this.needsBlock;if(Xu.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),u&&this.sync(s),this.needsBlock=c}else{let u=this.readStyles(e,t);u&&this.addElementByRule(e,a,u,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
10
+ `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=n.getPropertyValue(s);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(s,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(u=>!a.clearMark(u)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,n,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let a=this.enter(o,t.attrs||null,n,t.preserveWhitespace);a&&(s=!0,n=a)}else{let a=this.parser.schema.marks[t.mark];n=n.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,n,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,n),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,t,n,i){let s=n||0;for(let o=n?e.childNodes[n]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,n){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],u=a.findWrapping(e);if(u&&(!i||i.length>u.length+l)&&(i=u,s=a,!u.length))break;if(a.solid){if(n)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=he.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):ta(l.type,e.type))&&(o=l.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let s=this.findPlace(e.create(t),n,!1);return s&&(s=this.enterInner(e,t,n,!0,i)),s}enterInner(e,t,n,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Ql(e,s,o.options);o.options&sn&&o.content.length==0&&(l|=sn);let a=he.none;return n=n.filter(u=>(o.type?o.type.allowsMarkType(u.type):ta(u.type,e))?(a=u.addToSet(a),!1):!0),this.nodes.push(new qn(e,t,a,i,null,l)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=gn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let u=t[l];if(u==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:n&&a>=s?n.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function Hm(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&ec.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function Um(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function ea(r){let e={};for(let t in r)e[t]=r[t];return e}function ta(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:u,next:c}=l.edge(a);if(u==e||s.indexOf(c)<0&&o(c))return!0}};if(o(i.contentMatch))return!0}}class _r{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Vn(t).createDocumentFragment());let i=n,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let l=0,a=0;for(;l<s.length&&a<o.marks.length;){let u=o.marks[a];if(!this.marks[u.type.name]){a++;continue}if(!u.eq(s[l][0])||u.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)i=s.pop()[1];for(;a<o.marks.length;){let u=o.marks[a++],c=this.serializeMark(u,o.isInline,t);c&&(s.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){if(e.isText)return Vn(t).createTextNode(e.text);let{dom:n,contentDOM:i}=ei(Vn(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&ei(Vn(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:ei(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new _r(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ra(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return ra(e.marks)}}function ra(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Vn(r){return r.document||window.document}const na=new WeakMap;function Wm(r){let e=na.get(r);return e===void 0&&na.set(r,e=Km(r)),e}function Km(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function ei(r,e,t,n){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=Wm(n))&&s.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 o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let l,a=t?r.createElementNS(t,i):r.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(r.createTextNode(f));else{let{dom:h,contentDOM:m}=ei(r,f,t,n);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const tc=65535,rc=Math.pow(2,16);function Jm(r,e){return r+e*rc}function ia(r){return r&tc}function Gm(r){return(r-(r&tc))/rc}const nc=1,ic=2,ti=4,sc=8;class Qs{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&sc)>0}get deletedBefore(){return(this.delInfo&(nc|ti))>0}get deletedAfter(){return(this.delInfo&(ic|ti))>0}get deletedAcross(){return(this.delInfo&ti)>0}}class et{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&et.empty)return et.empty}recover(e){let t=0,n=ia(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+Gm(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let u=this.ranges[l+s],c=this.ranges[l+o],d=a+u;if(e<=d){let f=u?e==a?-1:e==d?1:t:t,h=a+i+(f<0?0:c);if(n)return h;let m=e==(t<0?a:d)?null:Jm(l/3,e-a),p=e==a?ic:e==d?nc:ti;return(t<0?e!=a:e!=d)&&(p|=sc),new Qs(h,p,m)}i+=c-u}return n?e+i:new Qs(e+i,0,null)}touches(e,t){let n=0,i=ia(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?n:0);if(a>e)break;let u=this.ranges[l+s],c=a+u;if(e<=c&&l==i*3)return!0;n+=this.ranges[l+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),a=o+(this.inverted?0:s),u=this.ranges[i+t],c=this.ranges[i+n];e(l,l+u,a,a+c),s+=c-u}}invert(){return new et(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?et.empty:new et(e<0?[0,-e,0]:[0,0,e])}}et.empty=new et([]);class yn{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new yn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new yn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return n?e:new Qs(e,i,null)}}const ks=Object.create(null);class Ve{getMap(){return et.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=ks[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ks)throw new RangeError("Duplicate use of step JSON ID "+e);return ks[e]=t,t.prototype.jsonID=e,t}}class Ae{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Ae(e,null)}static fail(e){return new Ae(null,e)}static fromReplace(e,t,n,i){try{return Ae.ok(e.replace(t,n,i))}catch(s){if(s instanceof pn)return Ae.fail(s.message);throw s}}}function Oo(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let s=r.child(i);s.content.size&&(s=s.copy(Oo(s.content,e,s))),s.isInline&&(s=e(s,t,i)),n.push(s)}return $.fromArray(n)}class Gt extends Ve{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new U(Oo(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return Ae.fromReplace(e,this.from,this.to,s)}invert(){return new wt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Gt(t.pos,n.pos,this.mark)}merge(e){return e instanceof Gt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Gt(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Gt(t.from,t.to,e.markFromJSON(t.mark))}}Ve.jsonID("addMark",Gt);class wt extends Ve{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new U(Oo(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Ae.fromReplace(e,this.from,this.to,n)}invert(){return new Gt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new wt(t.pos,n.pos,this.mark)}merge(e){return e instanceof wt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wt(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new wt(t.from,t.to,e.markFromJSON(t.mark))}}Ve.jsonID("removeMark",wt);class Zt extends Ve{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ae.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ae.fromReplace(e,this.pos,this.pos+1,new U($.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new Zt(this.pos,t.marks[i]);return new Zt(this.pos,this.mark)}}return new Er(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Zt(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Zt(t.pos,e.markFromJSON(t.mark))}}Ve.jsonID("addNodeMark",Zt);class Er extends Ve{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ae.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ae.fromReplace(e,this.pos,this.pos+1,new U($.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Zt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Er(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Er(t.pos,e.markFromJSON(t.mark))}}Ve.jsonID("removeNodeMark",Er);class Ce extends Ve{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&Xs(e,this.from,this.to)?Ae.fail("Structure replace would overwrite content"):Ae.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new et([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ce(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&Ce.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new Ce(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ce)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?U.empty:new U(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ce(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?U.empty:new U(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ce(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ce(t.from,t.to,U.fromJSON(e,t.slice),!!t.structure)}}Ce.MAP_BIAS=1;Ve.jsonID("replace",Ce);class De extends Ve{constructor(e,t,n,i,s,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Xs(e,this.from,this.gapFrom)||Xs(e,this.gapTo,this.to)))return Ae.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ae.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Ae.fromReplace(e,this.from,this.to,n):Ae.fail("Content does not fit in gap")}getMap(){return new et([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new De(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||s>n.pos?null:new De(t.pos,n.pos,i,s,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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new De(t.from,t.to,t.gapFrom,t.gapTo,U.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ve.jsonID("replaceAround",De);function Xs(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Zm(r,e,t,n){let i=[],s=[],o,l;r.doc.nodesBetween(e,t,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){let f=Math.max(u,e),h=Math.min(u+a.nodeSize,t),m=n.addToSet(d);for(let p=0;p<d.length;p++)d[p].isInSet(m)||(o&&o.to==f&&o.mark.eq(d[p])?o.to=h:i.push(o=new wt(f,h,d[p])));l&&l.to==f?l.to=h:s.push(l=new Gt(f,h,n))}}),i.forEach(a=>r.step(a)),s.forEach(a=>r.step(a))}function Ym(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(n instanceof Xi){let u=o.marks,c;for(;c=n.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else n?n.isInSet(o.marks)&&(a=[n]):a=o.marks;if(a&&a.length){let u=Math.min(l+o.nodeSize,t);for(let c=0;c<a.length;c++){let d=a[c],f;for(let h=0;h<i.length;h++){let m=i[h];m.step==s-1&&d.eq(i[h].style)&&(f=m)}f?(f.to=u,f.step=s):i.push({style:d,from:Math.max(l,e),to:u,step:s})}}}),i.forEach(o=>r.step(new wt(o.from,o.to,o.style)))}function No(r,e,t,n=t.contentMatch,i=!0){let s=r.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<s.childCount;a++){let u=s.child(a),c=l+u.nodeSize,d=n.matchType(u.type);if(!d)o.push(new Ce(l,c,U.empty));else{n=d;for(let f=0;f<u.marks.length;f++)t.allowsMarkType(u.marks[f].type)||r.step(new wt(l,c,u.marks[f]));if(i&&u.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(u.text);)m||(m=new U($.from(t.schema.text(" ",t.allowedMarks(u.marks))),0,0)),o.push(new Ce(l+f.index,l+f.index+f[0].length,m))}}l=c}if(!n.validEnd){let a=n.fillBefore($.empty,!0);r.replace(l,l,new U(a,0,0))}for(let a=o.length-1;a>=0;a--)r.step(o[a])}function Qm(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Ur(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth,i=0,s=0;;--n){let o=r.$from.node(n),l=r.$from.index(n)+i,a=r.$to.indexAfter(n)-s;if(n<r.depth&&o.canReplace(l,a,t))return n;if(n==0||o.type.spec.isolating||!Qm(o,l,a))break;l&&(i=1),a<o.childCount&&(s=1)}return null}function Xm(r,e,t){let{$from:n,$to:i,depth:s}=e,o=n.before(s+1),l=i.after(s+1),a=o,u=l,c=$.empty,d=0;for(let m=s,p=!1;m>t;m--)p||n.index(m)>0?(p=!0,c=$.from(n.node(m).copy(c)),d++):a--;let f=$.empty,h=0;for(let m=s,p=!1;m>t;m--)p||i.after(m+1)<i.end(m)?(p=!0,f=$.from(i.node(m).copy(f)),h++):u++;r.step(new De(a,u,o,l,new U(c.append(f),d,h),c.size-d,!0))}function Io(r,e,t=null,n=r){let i=eg(r,e),s=i&&tg(n,e);return s?i.map(sa).concat({type:e,attrs:t}).concat(s.map(sa)):null}function sa(r){return{type:r,attrs:null}}function eg(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.contentMatchAt(n).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(n,i,o)?s:null}function tg(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.child(n),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let u=n;a&&u<i;u++)a=a.matchType(t.child(u).type);return!a||!a.validEnd?null:o}function rg(r,e,t){let n=$.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let l=t[o].type.contentMatch.matchFragment(n);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=$.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new De(i,s,i,s,new U(n,0,0),t.length,!0))}function ng(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,a)&&ig(r.doc,r.mapping.slice(s).map(l),n)){let u=null;if(n.schema.linebreakReplacement){let h=n.whitespace=="pre",m=!!n.contentMatch.matchType(n.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&lc(r,o,l,s),No(r,r.mapping.slice(s).map(l,1),n,void 0,u===null);let c=r.mapping.slice(s),d=c.map(l,1),f=c.map(l+o.nodeSize,1);return r.step(new De(d,f,d+1,f-1,new U($.from(n.create(a,null,o.marks)),0,0),1,!0)),u===!0&&oc(r,o,l,s),!1}})}function oc(r,e,t,n){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=r.mapping.slice(n).map(t+1+s+o.index);r.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function lc(r,e,t,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+s);r.replaceWith(o,o+1,e.type.schema.text(`
11
+ `))}})}function ig(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function sg(r,e,t,n,i){let s=r.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(n,null,i||s.marks);if(s.isLeaf)return r.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new De(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new U($.from(o),0,0),1,!0))}function Lt(r,e,t=1,n){let i=r.resolve(e),s=i.depth-t,o=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>s;u--,c--){let d=i.node(u),f=i.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=n&&n[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let p=n&&n[c]||d;if(!d.canReplace(f+1,d.childCount)||!p.type.validContent(h))return!1}let l=i.indexAfter(s),a=n&&n[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function og(r,e,t=1,n){let i=r.doc.resolve(e),s=$.empty,o=$.empty;for(let l=i.depth,a=i.depth-t,u=t-1;l>a;l--,u--){s=$.from(i.node(l).copy(s));let c=n&&n[u];o=$.from(c?c.type.create(c.attrs,o):i.node(l).copy(o))}r.step(new Ce(e,e,new U(s.append(o),t,t),!0))}function ir(r,e){let t=r.resolve(e),n=t.index();return ac(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function lg(r,e){e.content.size||r.type.compatibleContent(e.type);let t=r.contentMatchAt(r.childCount),{linebreakReplacement:n}=r.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==n?r.type.schema.nodes.text:s.type;if(t=t.matchType(o),!t||!r.type.allowsMarks(s.marks))return!1}return t.validEnd}function ac(r,e){return!!(r&&e&&!r.isLeaf&&lg(r,e))}function es(r,e,t=-1){let n=r.resolve(e);for(let i=n.depth;;i--){let s,o,l=n.index(i);if(i==n.depth?(s=n.nodeBefore,o=n.nodeAfter):t>0?(s=n.node(i+1),l++,o=n.node(i).maybeChild(l)):(s=n.node(i).maybeChild(l-1),o=n.node(i+1)),s&&!s.isTextblock&&ac(s,o)&&n.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function ag(r,e,t){let n=null,{linebreakReplacement:i}=r.doc.type.schema,s=r.doc.resolve(e-t),o=s.node().type;if(i&&o.inlineContent){let c=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);c&&!d?n=!1:!c&&d&&(n=!0)}let l=r.steps.length;if(n===!1){let c=r.doc.resolve(e+t);lc(r,c.node(),c.before(),l)}o.inlineContent&&No(r,e+t-1,o,s.node().contentMatchAt(s.index()),n==null);let a=r.mapping.slice(l),u=a.map(e-t);if(r.step(new Ce(u,a.map(e+t,-1),U.empty,!0)),n===!0){let c=r.doc.resolve(u);oc(r,c.node(),c.before(),r.steps.length)}return r}function ug(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,t))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,t))return n.after(i+1);if(s<n.node(i).childCount)return null}return null}function uc(r,e,t){let n=r.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let o=n.depth;o>=0;o--){let l=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,a=n.index(o)+(l>0?1:0),u=n.node(o),c=!1;if(s==1)c=u.canReplace(a,a,i);else{let d=u.contentMatchAt(a).findWrapping(i.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?n.pos:l<0?n.before(o+1):n.after(o+1)}return null}function ts(r,e,t=e,n=U.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return cc(i,s,n)?new Ce(e,t,n):new cg(i,s,n).fit()}function cc(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class cg{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=$.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=$.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new U(s,o,l);return e>-1?new De(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Ce(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=vs(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(t==1&&(o?u.matchType(o.type)||(d=u.fillBefore($.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:l,parent:s,inject:d};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=vs(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new U(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=vs(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new U(Zr(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new U(Zr(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let p=0;p<s.length;p++)this.openFrontierNode(s[p]);let o=this.unplaced,l=n?n.content:o.content,a=o.openStart-e,u=0,c=[],{match:d,type:f}=this.frontier[t];if(i){for(let p=0;p<i.childCount;p++)c.push(i.child(p));d=d.matchFragment(i)}let h=l.size+e-(o.content.size-o.openEnd);for(;u<l.childCount;){let p=l.child(u),g=d.matchType(p.type);if(!g)break;u++,(u>1||a==0||p.content.size)&&(d=g,c.push(dc(p.mark(f.allowedMarks(p.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=Yr(this.placed,t,$.from(c)),this.frontier[t].match=d,m&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,g=l;p<h;p++){let b=g.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),g=b.content}this.unplaced=m?e==0?U.empty:new U(Zr(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new U(Zr(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!xs(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=xs(e,t,i,n,s);if(o){for(let l=t-1;l>=0;l--){let{match:a,type:u}=this.frontier[l],c=xs(e,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Yr(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Yr(this.placed,this.depth,$.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore($.empty,!0);t.childCount&&(this.placed=Yr(this.placed,this.frontier.length,t))}}function Zr(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(Zr(r.firstChild.content,e-1,t)))}function Yr(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(Yr(r.lastChild.content,e-1,t)))}function vs(r,e){for(let t=0;t<e;t++)r=r.firstChild.content;return r}function dc(r,e,t){if(e<=0)return r;let n=r.content;return e>1&&(n=n.replaceChild(0,dc(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore($.empty,!0)))),r.copy(n)}function xs(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let l=n.fillBefore(s.content,!0,o);return l&&!dg(t,s.content,o)?l:null}function dg(r,e,t){for(let n=t;n<e.childCount;n++)if(!r.allowsMarks(e.child(n).marks))return!0;return!1}function fg(r){return r.spec.defining||r.spec.definingForContent}function hg(r,e,t,n){if(!n.size)return r.deleteRange(e,t);let i=r.doc.resolve(e),s=r.doc.resolve(t);if(cc(i,s,n))return r.step(new Ce(e,t,n));let o=hc(i,s);o[o.length-1]==0&&o.pop();let l=-(i.depth+1);o.unshift(l);for(let f=i.depth,h=i.pos-1;f>0;f--,h--){let m=i.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(f)>-1?l=f:i.before(f)==h&&o.splice(1,0,-f)}let a=o.indexOf(l),u=[],c=n.openStart;for(let f=n.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==n.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=fg(h.type);if(m&&!h.sameMarkup(i.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let h=(f+c+1)%(n.openStart+1),m=u[h];if(m)for(let p=0;p<o.length;p++){let g=o[(p+a)%o.length],b=!0;g<0&&(b=!1,g=-g);let E=i.node(g-1),v=i.index(g-1);if(E.canReplaceWith(v,v,m.type,m.marks))return r.replace(i.before(g),b?s.after(g):t,new U(fc(n.content,0,n.openStart,h),h,n.openEnd))}}let d=r.steps.length;for(let f=o.length-1;f>=0&&(r.replace(e,t,n),!(r.steps.length>d));f--){let h=o[f];h<0||(e=i.before(h),t=s.after(h))}}function fc(r,e,t,n,i){if(e<t){let s=r.firstChild;r=r.replaceChild(0,s.copy(fc(s.content,e+1,t,n,s)))}if(e>n){let s=i.contentMatchAt(0),o=s.fillBefore(r).append(r);r=o.append(s.matchFragment(o).fillBefore($.empty,!0))}return r}function pg(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=ug(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new U($.from(n),0,0))}function mg(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t);if(n.parent.isTextblock&&i.parent.isTextblock&&n.start()!=i.start()&&n.parentOffset==0&&i.parentOffset==0){let o=n.sharedDepth(t),l=!1;for(let a=n.depth;a>o;a--)n.node(a).type.spec.isolating&&(l=!0);for(let a=i.depth;a>o;a--)i.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=n.depth;a>0&&e==n.start(a);a--)e=n.before(a);for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);n=r.doc.resolve(e),i=r.doc.resolve(t)}}let s=hc(n,i);for(let o=0;o<s.length;o++){let l=s[o],a=o==s.length-1;if(a&&l==0||n.node(l).type.contentMatch.validEnd)return r.delete(n.start(l),i.end(l));if(l>0&&(a||n.node(l-1).canReplace(n.index(l-1),i.indexAfter(l-1))))return r.delete(n.before(l),i.after(l))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return r.delete(n.before(o),t);r.delete(e,t)}function hc(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let s=r.start(i);if(s<r.pos-(r.depth-i)||e.end(i)>e.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class Rr extends Ve{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ae.fail("No node at attribute step's position");let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return Ae.fromReplace(e,this.pos,this.pos+1,new U($.from(i),0,t.isLeaf?0:1))}getMap(){return et.empty}invert(e){return new Rr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Rr(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Rr(t.pos,t.attr,t.value)}}Ve.jsonID("attr",Rr);class bn extends Ve{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Ae.ok(n)}getMap(){return et.empty}invert(e){return new bn(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new bn(t.attr,t.value)}}Ve.jsonID("docAttr",bn);let zr=class extends Error{};zr=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};zr.prototype=Object.create(Error.prototype);zr.prototype.constructor=zr;zr.prototype.name="TransformError";class pc{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new yn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new zr(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let i=this.mapping.maps[n];n&&(e=i.map(e,1),t=i.map(t,-1)),i.forEach((s,o,l,a)=>{e=Math.min(e,l),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=U.empty){let i=ts(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new U($.from(n),0,0))}delete(e,t){return this.replace(e,t,U.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return hg(this,e,t,n),this}replaceRangeWith(e,t,n){return pg(this,e,t,n),this}deleteRange(e,t){return mg(this,e,t),this}lift(e,t){return Xm(this,e,t),this}join(e,t=1){return ag(this,e,t),this}wrap(e,t){return rg(this,e,t),this}setBlockType(e,t=e,n,i=null){return ng(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return sg(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Rr(e,t,n)),this}setDocAttribute(e,t){return this.step(new bn(e,t)),this}addNodeMark(e,t){return this.step(new Zt(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof he)t.isInSet(n.marks)&&this.step(new Er(e,t));else{let i=n.marks,s,o=[];for(;s=t.isInSet(i);)o.push(new Er(e,s)),i=s.removeFromSet(i);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,t=1,n){return og(this,e,t,n),this}addMark(e,t,n){return Zm(this,e,t,n),this}removeMark(e,t,n){return Ym(this,e,t,n),this}clearIncompatible(e,t,n){return No(this,e,t,n),this}}const Cs=Object.create(null);class te{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new gg(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=U.empty){let n=t.content.lastChild,i=null;for(let l=0;l<t.openEnd;l++)i=n,n=n.lastChild;let s=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:u}=o[l],c=e.mapping.slice(s);e.replaceRange(c.map(a.pos),c.map(u.pos),l?U.empty:t),l==0&&aa(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:l}=i[s],a=e.mapping.slice(n),u=a.map(o.pos),c=a.map(l.pos);s?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),aa(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new Q(e):Nr(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=t<0?Nr(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):Nr(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new tt(e.node(0))}static atStart(e){return Nr(e,e,0,0,1)||new tt(e)}static atEnd(e){return Nr(e,e,e.content.size,e.childCount,-1)||new tt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Cs[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Cs)throw new RangeError("Duplicate use of selection JSON ID "+e);return Cs[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Q.between(this.$anchor,this.$head).getBookmark()}}te.prototype.visible=!0;class gg{constructor(e,t){this.$from=e,this.$to=t}}let oa=!1;function la(r){!oa&&!r.parent.inlineContent&&(oa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class Q extends te{constructor(e,t=e){la(e),la(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return te.near(n);let i=e.resolve(t.map(this.anchor));return new Q(i.parent.inlineContent?i:n,n)}replace(e,t=U.empty){if(super.replace(e,t),t==U.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Q&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new rs(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Q(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=te.findFrom(t,n,!0)||te.findFrom(t,-n,!0);if(s)t=s.$head;else return te.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(te.findFrom(e,-n,!0)||te.findFrom(e,n,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new Q(e,t)}}te.jsonID("text",Q);class rs{constructor(e,t){this.anchor=e,this.head=t}map(e){return new rs(e.map(this.anchor),e.map(this.head))}resolve(e){return Q.between(e.resolve(this.anchor),e.resolve(this.head))}}class G extends te{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return n?te.near(s):new G(s)}content(){return new U($.from(this.node),0,0)}eq(e){return e instanceof G&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Bo(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new G(e.resolve(t.anchor))}static create(e,t){return new G(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}G.prototype.visible=!1;te.jsonID("node",G);class Bo{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new rs(n,n):new Bo(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&G.isSelectable(n)?new G(t):te.near(t)}}class tt extends te{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=U.empty){if(t==U.empty){e.delete(0,e.doc.content.size);let n=te.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new tt(e)}map(e){return new tt(e)}eq(e){return e instanceof tt}getBookmark(){return yg}}te.jsonID("all",tt);const yg={map(){return this},resolve(r){return new tt(r)}};function Nr(r,e,t,n,i,s=!1){if(e.inlineContent)return Q.create(r,t);for(let o=n-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&G.isSelectable(l))return G.create(r,t-(i<0?l.nodeSize:0))}else{let a=Nr(r,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function aa(r,e,t){let n=r.steps.length-1;if(n<e)return;let i=r.steps[n];if(!(i instanceof Ce||i instanceof De))return;let s=r.mapping.maps[n],o;s.forEach((l,a,u,c)=>{o==null&&(o=c)}),r.setSelection(te.near(r.doc.resolve(o),t))}const ua=1,jn=2,ca=4;class bg extends pc{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|ua)&~jn,this.storedMarks=null,this}get selectionSet(){return(this.updated&ua)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=jn,this}ensureMarks(e){return he.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&jn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~jn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||he.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),!e)return this.deleteRange(t,n);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,s)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(te.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=ca,this}get scrolledIntoView(){return(this.updated&ca)>0}}function da(r,e){return!e||!r?r:r.bind(e)}class Qr{constructor(e,t,n){this.name=e,this.init=da(t.init,n),this.apply=da(t.apply,n)}}const kg=[new Qr("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new Qr("selection",{init(r,e){return r.selection||te.atStart(e.doc)},apply(r){return r.selection}}),new Qr("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new Qr("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];class As{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=kg.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Qr(n.key,n.spec.state,n))})}}class Fr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let a=i?i[o].n:0,u=i?i[o].state:this,c=a<t.length&&l.spec.appendTransaction.call(l,a?t.slice(a):t,u,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),s=!0}i&&(i[o]={state:n,n:t.length})}}if(!s)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Fr(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let s=n[i];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new bg(this)}static create(e){let t=new As(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Fr(t);for(let i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n}reconfigure(e){let t=new As(this.schema,e.plugins),n=t.fields,i=new Fr(t);for(let s=0;s<n.length;s++){let o=n[s].name;i[o]=this.hasOwnProperty(o)?this[o]:n[s].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(t[n]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new As(e.schema,e.plugins),s=new Fr(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Yt.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=te.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let l in n){let a=n[l],u=a.spec.state;if(a.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){s[o.name]=u.fromJSON.call(a,e,t[l],s);return}}s[o.name]=o.init(e,s)}}),s}}function mc(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=mc(i,e,{})),t[n]=i}return t}class Le{constructor(e){this.spec=e,this.props={},e.props&&mc(e.props,this,this.props),this.key=e.key?e.key.key:gc("plugin")}getState(e){return e[this.key]}}const ws=Object.create(null);function gc(r){return r in ws?r+"$"+ ++ws[r]:(ws[r]=0,r+"$")}class nt{constructor(e="key"){this.key=gc(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ie=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},qr=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let eo=null;const Bt=function(r,e,t){let n=eo||(eo=document.createRange());return n.setEnd(r,t??r.nodeValue.length),n.setStart(r,e||0),n},vg=function(){eo=null},Sr=function(r,e,t,n){return t&&(fa(r,e,t,n,-1)||fa(r,e,t,n,1))},xg=/^(img|br|input|textarea|hr)$/i;function fa(r,e,t,n,i){for(var s;;){if(r==t&&e==n)return!0;if(e==(i<0?0:lt(r))){let o=r.parentNode;if(!o||o.nodeType!=1||_n(r)||xg.test(r.nodeName)||r.contentEditable=="false")return!1;e=Ie(r)+(i<0?0:1),r=o}else if(r.nodeType==1){let o=r.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else r=o,e=i<0?lt(r):0}else return!1}}function lt(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Cg(r,e){for(;;){if(r.nodeType==3&&e)return r;if(r.nodeType==1&&e>0){if(r.contentEditable=="false")return null;r=r.childNodes[e-1],e=lt(r)}else if(r.parentNode&&!_n(r))e=Ie(r),r=r.parentNode;else return null}}function Ag(r,e){for(;;){if(r.nodeType==3&&e<r.nodeValue.length)return r;if(r.nodeType==1&&e<r.childNodes.length){if(r.contentEditable=="false")return null;r=r.childNodes[e],e=0}else if(r.parentNode&&!_n(r))e=Ie(r)+1,r=r.parentNode;else return null}}function wg(r,e,t){for(let n=e==0,i=e==lt(r);n||i;){if(r==t)return!0;let s=Ie(r);if(r=r.parentNode,!r)return!1;n=n&&s==0,i=i&&s==lt(r)}}function _n(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const ns=function(r){return r.focusNode&&Sr(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function ur(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}function Eg(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Sg(r,e,t){if(r.caretPositionFromPoint)try{let n=r.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:Math.min(lt(n.offsetNode),n.offset)}}catch{}if(r.caretRangeFromPoint){let n=r.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:Math.min(lt(n.startContainer),n.startOffset)}}}const St=typeof navigator<"u"?navigator:null,ha=typeof document<"u"?document:null,sr=St&&St.userAgent||"",to=/Edge\/(\d+)/.exec(sr),yc=/MSIE \d/.exec(sr),ro=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(sr),Qe=!!(yc||ro||to),Xt=yc?document.documentMode:ro?+ro[1]:to?+to[1]:0,ct=!Qe&&/gecko\/(\d+)/i.test(sr);ct&&+(/Firefox\/(\d+)/.exec(sr)||[0,0])[1];const no=!Qe&&/Chrome\/(\d+)/.exec(sr),Fe=!!no,bc=no?+no[1]:0,qe=!Qe&&!!St&&/Apple Computer/.test(St.vendor),Vr=qe&&(/Mobile\/\w+/.test(sr)||!!St&&St.maxTouchPoints>2),ot=Vr||(St?/Mac/.test(St.platform):!1),kc=St?/Win/.test(St.platform):!1,$t=/Android \d/.test(sr),Tn=!!ha&&"webkitFontSmoothing"in ha.documentElement.style,Dg=Tn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _g(r){let e=r.defaultView&&r.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function Mt(r,e){return typeof r=="number"?r:r[e]}function Tg(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,n=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*n}}function pa(r,e,t){if(!io(e)&&e.left==0)return;let n=r.someProp("scrollThreshold")||0,i=r.someProp("scrollMargin")||5,s=r.dom.ownerDocument;for(let o=t||r.dom;o;){if(o.nodeType!=1){o=qr(o);continue}let l=o,a=l==s.body,u=a?_g(s):Tg(l),c=0,d=0;if(e.top<u.top+Mt(n,"top")?d=-(u.top-e.top+Mt(i,"top")):e.bottom>u.bottom-Mt(n,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Mt(i,"top")-u.top:e.bottom-u.bottom+Mt(i,"bottom")),e.left<u.left+Mt(n,"left")?c=-(u.left-e.left+Mt(i,"left")):e.right>u.right-Mt(n,"right")&&(c=e.right-u.right+Mt(i,"right")),c||d)if(a)s.defaultView.scrollBy(c,d);else{let h=l.scrollLeft,m=l.scrollTop;d&&(l.scrollTop+=d),c&&(l.scrollLeft+=c);let p=l.scrollLeft-h,g=l.scrollTop-m;e={left:e.left-p,top:e.top-g,right:e.right-p,bottom:e.bottom-g}}let f=a?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:qr(o)}}function Mg(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,o=t+1;o<Math.min(innerHeight,e.bottom);o+=5){let l=r.root.elementFromPoint(s,o);if(!l||l==r.dom||!r.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=t-20){n=l,i=a.top;break}}return{refDOM:n,refTop:i,stack:vc(r.dom)}}function vc(r){let e=[],t=r.ownerDocument;for(let n=r;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),r!=t);n=qr(n));return e}function Og({refDOM:r,refTop:e,stack:t}){let n=r?r.getBoundingClientRect().top:0;xc(t,n==0?0:n-e)}function xc(r,e){for(let t=0;t<r.length;t++){let{dom:n,top:i,left:s}=r[t];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=s&&(n.scrollLeft=s)}}let Mr=null;function Ng(r){if(r.setActive)return r.setActive();if(Mr)return r.focus(Mr);let e=vc(r);r.focus(Mr==null?{get preventScroll(){return Mr={preventScroll:!0},!0}}:void 0),Mr||(Mr=!1,xc(e,0))}function Cc(r,e){let t,n=2e8,i,s=0,o=e.top,l=e.top,a,u;for(let c=r.firstChild,d=0;c;c=c.nextSibling,d++){let f;if(c.nodeType==1)f=c.getClientRects();else if(c.nodeType==3)f=Bt(c).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=o&&m.bottom>=l){o=Math.max(m.bottom,o),l=Math.min(m.top,l);let p=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(p<n){t=c,n=p,i=p&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,c.nodeType==1&&p&&(s=d+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!a&&m.left<=e.left&&m.right>=e.left&&(a=c,u={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(s=d+1)}}return!t&&a&&(t=a,i=u,n=0),t&&t.nodeType==3?Ig(t,i):!t||n&&t.nodeType==1?{node:r,offset:s}:Cc(t,i)}function Ig(r,e){let t=r.nodeValue.length,n=document.createRange(),i;for(let s=0;s<t;s++){n.setEnd(r,s+1),n.setStart(r,s);let o=Ht(n,1);if(o.top!=o.bottom&&Fo(e,o)){i={node:r,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return n.detach(),i||{node:r,offset:0}}function Fo(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function Bg(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<r.getBoundingClientRect().left?t:r}function Fg(r,e,t){let{node:n,offset:i}=Cc(e,t),s=-1;if(n.nodeType==1&&!n.firstChild){let o=n.getBoundingClientRect();s=o.left!=o.right&&t.left>(o.left+o.right)/2?1:-1}return r.docView.posFromDOM(n,i,s)}function Rg(r,e,t,n){let i=-1;for(let s=e,o=!1;s!=r.dom;){let l=r.docView.nearestDesc(s,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&a.left>n.left||a.top>n.top?i=l.posBefore:(!o&&a.right<n.left||a.bottom<n.top)&&(i=l.posAfter),o=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?n.top<(a.top+a.bottom)/2:n.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return i>-1?i:r.docView.posFromDOM(e,t,-1)}function Ac(r,e,t){let n=r.childNodes.length;if(n&&t.top<t.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-t.top)/(t.bottom-t.top))-2)),s=i;;){let o=r.childNodes[s];if(o.nodeType==1){let l=o.getClientRects();for(let a=0;a<l.length;a++){let u=l[a];if(Fo(e,u))return Ac(o,e,u)}}if((s=(s+1)%n)==i)break}return r}function $g(r,e){let t=r.dom.ownerDocument,n,i=0,s=Sg(t,e.left,e.top);s&&({node:n,offset:i}=s);let o=(r.root.elementFromPoint?r.root:t).elementFromPoint(e.left,e.top),l;if(!o||!r.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=r.dom.getBoundingClientRect();if(!Fo(e,u)||(o=Ac(r.dom,e,u),!o))return null}if(qe)for(let u=o;n&&u;u=qr(u))u.draggable&&(n=void 0);if(o=Bg(o,e),n){if(ct&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let c=n.childNodes[i],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let u;Tn&&i&&n.nodeType==1&&(u=n.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,n==r.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?l=r.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(l=Rg(r,n,i,e))}l==null&&(l=Fg(r,o,e));let a=r.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function io(r){return r.top<r.bottom||r.left<r.right}function Ht(r,e){let t=r.getClientRects();if(t.length){let n=t[e<0?0:t.length-1];if(io(n))return n}return Array.prototype.find.call(t,io)||r.getBoundingClientRect()}const Pg=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function wc(r,e,t){let{node:n,offset:i,atom:s}=r.docView.domFromPos(e,t<0?-1:1),o=Tn||ct;if(n.nodeType==3)if(o&&(Pg.test(n.nodeValue)||(t<0?!i:i==n.nodeValue.length))){let a=Ht(Bt(n,i,i),t);if(ct&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let u=Ht(Bt(n,i-1,i-1),-1);if(u.top==a.top){let c=Ht(Bt(n,i,i+1),-1);if(c.top!=a.top)return Wr(c,c.left<u.left)}}return a}else{let a=i,u=i,c=t<0?1:-1;return t<0&&!i?(u++,c=-1):t>=0&&i==n.nodeValue.length?(a--,c=1):t<0?a--:u++,Wr(Ht(Bt(n,a,u),c),c<0)}if(!r.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==lt(n))){let a=n.childNodes[i-1];if(a.nodeType==1)return Es(a.getBoundingClientRect(),!1)}if(s==null&&i<lt(n)){let a=n.childNodes[i];if(a.nodeType==1)return Es(a.getBoundingClientRect(),!0)}return Es(n.getBoundingClientRect(),t>=0)}if(s==null&&i&&(t<0||i==lt(n))){let a=n.childNodes[i-1],u=a.nodeType==3?Bt(a,lt(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return Wr(Ht(u,1),!1)}if(s==null&&i<lt(n)){let a=n.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let u=a?a.nodeType==3?Bt(a,0,o?0:1):a.nodeType==1?a:null:null;if(u)return Wr(Ht(u,-1),!0)}return Wr(Ht(n.nodeType==3?Bt(n):n,-t),t>=0)}function Wr(r,e){if(r.width==0)return r;let t=e?r.left:r.right;return{top:r.top,bottom:r.bottom,left:t,right:t}}function Es(r,e){if(r.height==0)return r;let t=e?r.top:r.bottom;return{top:t,bottom:t,left:r.left,right:r.right}}function Ec(r,e,t){let n=r.state,i=r.root.activeElement;n!=e&&r.updateState(e),i!=r.dom&&r.focus();try{return t()}finally{n!=e&&r.updateState(n),i!=r.dom&&i&&i.focus()}}function Lg(r,e,t){let n=e.selection,i=t=="up"?n.$from:n.$to;return Ec(r,e,()=>{let{node:s}=r.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=r.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let o=wc(r,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Bt(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;u<a.length;u++){let c=a[u];if(c.bottom>c.top+1&&(t=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const zg=/[\u0590-\u08ac]/;function qg(r,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,o=i==n.parent.content.size,l=r.domSelection();return l?!zg.test(n.parent.textContent)||!l.modify?t=="left"||t=="backward"?s:o:Ec(r,e,()=>{let{focusNode:a,focusOffset:u,anchorNode:c,anchorOffset:d}=r.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let h=n.depth?r.docView.domAfterPos(n.before()):r.dom,{focusNode:m,focusOffset:p}=r.domSelectionRange(),g=m&&!h.contains(m.nodeType==1?m:m.parentNode)||a==m&&u==p;try{l.collapse(c,d),a&&(a!=c||u!=d)&&l.extend&&l.extend(a,u)}catch{}return f!=null&&(l.caretBidiLevel=f),g}):n.pos==n.start()||n.pos==n.end()}let ma=null,ga=null,ya=!1;function Vg(r,e,t){return ma==e&&ga==t?ya:(ma=e,ga=t,ya=t=="up"||t=="down"?Lg(r,e,t):qg(r,e,t))}const dt=0,ba=1,dr=2,mt=3;class Mn{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=dt,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let i=this.children[t];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let s,o;if(e==this.contentDOM)s=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>Ie(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(n&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],s=n+i.size;if(n==e&&s!=n){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let l=i.children[o];if(l.size){i=l;break}}return i}if(e<s)return i.descAt(e-n-i.border);n=s}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let s=0;n<this.children.length;n++){let o=this.children[n],l=s+o.size;if(l>e||o instanceof Dc){i=e-s;break}s=l}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof Sc&&s.side>=0;n--);if(t<=0){let s,o=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?Ie(s.dom)+1:0}}else{let s,o=!0;for(;s=n<this.children.length?this.children[n]:null,!(!s||s.dom.parentNode==this.contentDOM);n++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,t):{node:this.contentDOM,offset:s?Ie(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=n,l=0;;l++){let a=this.children[l],u=o+a.size;if(i==-1&&e<=u){let c=o+a.border;if(e>=c&&t<=u-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,c);e=o;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Ie(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(u>t||l==this.children.length-1)){t=u;for(let c=l+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=Ie(d.dom);break}t+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,i=!1){let s=Math.min(e,t),o=Math.max(e,t);for(let h=0,m=0;h<this.children.length;h++){let p=this.children[h],g=m+p.size;if(s>m&&o<g)return p.setSelection(e-m-p.border,t-m-p.border,n,i);m=g}let l=this.domFromPos(e,e?-1:1),a=t==e?l:this.domFromPos(t,t?-1:1),u=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((ct||qe)&&e==t){let{node:h,offset:m}=l;if(h.nodeType==3){if(d=!!(m&&h.nodeValue[m-1]==`
12
+ `),d&&m==h.nodeValue.length)for(let p=h,g;p;p=p.parentNode){if(g=p.nextSibling){g.nodeName=="BR"&&(l=a={node:g.parentNode,offset:Ie(g)+1});break}let b=p.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let p=h.childNodes[m-1];d=p&&(p.nodeName=="BR"||p.contentEditable=="false")}}if(ct&&c.focusNode&&c.focusNode!=a.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||d&&qe)&&Sr(l.node,l.offset,c.anchorNode,c.anchorOffset)&&Sr(a.node,a.offset,c.focusNode,c.focusOffset))return;let f=!1;if((u.extend||e==t)&&!(d&&ct)){u.collapse(l.node,l.offset);try{e!=t&&u.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>t){let m=l;l=a,a=m}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let s=this.children[i],o=n+s.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let l=n+s.border,a=o-s.border;if(e>=l&&t<=a){this.dirty=e==n||t==o?dr:ba,e==l&&t==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=mt:s.markDirty(e-l,t-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?dr:mt}n=o}this.dirty=dr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?dr:ba;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Sc extends Mn{constructor(e,t,n,i){let s,o=t.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.hasAttribute("contenteditable")||(o.contentEditable="false"),o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==dt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class jg extends Mn{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class er extends Mn{constructor(e,t,n,i,s){super(e,[],n,i),this.mark=t,this.spec=s}static create(e,t,n,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,n);return(!o||!o.dom)&&(o=_r.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new er(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&mt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=mt&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=dt){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=dt}}slice(e,t,n){let i=er.create(this.parent,this.mark,!0,n),s=this.children,o=this.size;t<o&&(s=oo(s,t,o,n)),e>0&&(s=oo(s,0,e,n));for(let l=0;l<s.length;l++)s[l].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class tr extends Mn{constructor(e,t,n,i,s,o,l){super(e,[],s,o),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=l}static create(e,t,n,i,s,o){let l=s.nodeViews[t.type.name],a,u=l&&l(t,s,()=>{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},n,i),c=u&&u.dom,d=u&&u.contentDOM;if(t.isText){if(!c)c=document.createTextNode(t.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=_r.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let f=c;return c=Mc(c,n,t),u?a=new Hg(e,t,n,i,c,d||null,f,u):t.isText?new is(e,t,n,i,c,f):new tr(e,t,n,i,c,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let i=this.children[n];if(this.dom.contains(i.dom.parentNode)){t.contentElement=i.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(i=>i.nodeType==1&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));n?t.contentElement=n:t.getContent=()=>$.empty}}return t}matchesNode(e,t,n){return this.dirty==dt&&e.eq(this.node)&&di(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new Wg(this,o&&o.node,e);Gg(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?a.syncToMarks(u.spec.marks,n,e,c):u.type.side>=0&&!d&&a.syncToMarks(c==this.node.childCount?he.none:this.node.child(c).marks,n,e,c),a.placeWidget(u,e,i)},(u,c,d,f)=>{a.syncToMarks(u.marks,n,e,f);let h;a.findNodeMatch(u,c,d,f)||l&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(h=a.findIndexWithChild(s.node))>-1&&a.updateNodeAt(u,c,d,h,e)||a.updateNextNode(u,c,d,e,f,i)||a.addNode(u,c,d,e,i),i+=u.nodeSize}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==dr)&&(o&&this.protectLocalComposition(e,o),_c(this.contentDOM,this.children,e),Vr&&Zg(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof Q)||n<t||i>t+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,l=Yg(this.node.content,o,n-t,i-t);return l<0?null:{node:s,pos:l,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new jg(this,s,t,i);e.input.compositionNodes.push(o),this.children=oo(this.children,n,n+i.length,e,o)}update(e,t,n,i){return this.dirty==mt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=dt}updateOuterDeco(e){if(di(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Tc(this.dom,this.nodeDOM,so(this.outerDeco,this.node,t),so(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ka(r,e,t,n,i){Mc(n,e,r);let s=new tr(void 0,r,e,t,n,n,n);return s.contentDOM&&s.updateChildren(i,0),s}class is extends tr{constructor(e,t,n,i,s,o){super(e,t,n,i,s,null,o)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return this.dirty==mt||this.dirty!=dt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=dt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=dt,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new is(this.parent,i,this.outerDeco,this.innerDeco,s,s)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=mt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Dc extends Mn{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==dt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Hg extends tr{constructor(e,t,n,i,s,o,l,a){super(e,t,n,i,s,o,l),this.spec=a}update(e,t,n,i){if(this.dirty==mt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,t,n);return s&&this.updateInner(e,t,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function _c(r,e,t){let n=r.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],l=o.dom;if(l.parentNode==r){for(;l!=n;)n=va(n),i=!0;n=n.nextSibling}else i=!0,r.insertBefore(l,n);if(o instanceof er){let a=n?n.previousSibling:r.lastChild;_c(o.contentDOM,o.children,t),n=a?a.nextSibling:r.firstChild}}for(;n;)n=va(n),i=!0;i&&t.trackWrites==r&&(t.trackWrites=null)}const on=function(r){r&&(this.nodeName=r)};on.prototype=Object.create(null);const fr=[new on];function so(r,e,t){if(r.length==0)return fr;let n=t?fr[0]:new on,i=[n];for(let s=0;s<r.length;s++){let o=r[s].type.attrs;if(o){o.nodeName&&i.push(n=new on(o.nodeName));for(let l in o){let a=o[l];a!=null&&(t&&i.length==1&&i.push(n=new on(e.isInline?"span":"div")),l=="class"?n.class=(n.class?n.class+" ":"")+a:l=="style"?n.style=(n.style?n.style+";":"")+a:l!="nodeName"&&(n[l]=a))}}}return i}function Tc(r,e,t,n){if(t==fr&&n==fr)return e;let i=e;for(let s=0;s<n.length;s++){let o=n[s],l=t[s];if(s){let a;l&&l.nodeName==o.nodeName&&i!=r&&(a=i.parentNode)&&a.nodeName.toLowerCase()==o.nodeName||(a=document.createElement(o.nodeName),a.pmIsDeco=!0,a.appendChild(i),l=fr[0]),i=a}Ug(i,l||fr[0],o)}return i}function Ug(r,e,t){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in t)&&r.removeAttribute(n);for(let n in t)n!="class"&&n!="style"&&n!="nodeName"&&t[n]!=e[n]&&r.setAttribute(n,t[n]);if(e.class!=t.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let s=0;s<n.length;s++)i.indexOf(n[s])==-1&&r.classList.remove(n[s]);for(let s=0;s<i.length;s++)n.indexOf(i[s])==-1&&r.classList.add(i[s]);r.classList.length==0&&r.removeAttribute("class")}if(e.style!=t.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)r.style.removeProperty(i[1])}t.style&&(r.style.cssText+=t.style)}}function Mc(r,e,t){return Tc(r,r,fr,so(e,t,r.nodeType!=1))}function di(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(!r[t].type.eq(e[t].type))return!1;return!0}function va(r){let e=r.nextSibling;return r.parentNode.removeChild(r),e}class Wg{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Kg(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,i){let s=0,o=this.stack.length>>1,l=Math.min(o,e.length);for(;s<l&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=dt,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){a=c;break}}if(a<0&&this.index<this.top.children.length){let c=this.top.children[this.index];c instanceof er&&c.dirty!=mt&&c.mark.type==e[o].type&&c.spec.update&&!this.isLocked(c.dom)&&c.spec.update(e[o])&&(c.mark=e[o],a=this.index,this.changed=!0)}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=er.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))s=this.top.children.indexOf(o,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let u=this.top.children[l];if(u.matchesNode(e,t,n)&&!this.preMatch.matched.has(u)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,n,i,s){let o=this.top.children[i];return o.dirty==mt&&o.dom==o.contentDOM&&(o.dirty=dr),o.update(e,t,n,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=t}}updateNextNode(e,t,n,i,s,o){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof tr){let u=this.preMatch.matched.get(a);if(u!=null&&u!=s)return!1;let c=a.dom,d,f=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=mt&&di(t,a.outerDeco));if(!f&&a.update(e,t,n,i))return this.destroyBetween(this.index,l),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(a,e,t,n,i,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=dr,d.updateChildren(i,o+1),d.dirty=dt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,i,s,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!di(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=tr.create(this.top,t,n,i,s,o);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,t,n,i,s){let o=tr.create(this.top,e,t,n,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new Sc(this.top,e,t,n);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof er;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof is)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((qe||Fe)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new Dc(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Kg(r,e){let t=e,n=t.children.length,i=r.childCount,s=new Map,o=[];e:for(;i>0;){let l;for(;;)if(n){let u=t.children[n-1];if(u instanceof er)t=u,n=u.children.length;else{l=u,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=r.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}function Jg(r,e){return r.type.side-e.type.side}function Gg(r,e,t,n){let i=e.locals(r),s=0;if(i.length==0){for(let u=0;u<r.childCount;u++){let c=r.child(u);n(c,i,e.forChild(s,c),u),s+=c.nodeSize}return}let o=0,l=[],a=null;for(let u=0;;){let c,d;for(;o<i.length&&i[o].to==s;){let g=i[o++];g.widget&&(c?(d||(d=[c])).push(g):c=g)}if(c)if(d){d.sort(Jg);for(let g=0;g<d.length;g++)t(d[g],u,!!a)}else t(c,u,!!a);let f,h;if(a)h=-1,f=a,a=null;else if(u<r.childCount)h=u,f=r.child(u++);else break;for(let g=0;g<l.length;g++)l[g].to<=s&&l.splice(g--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)l.push(i[o++]);let m=s+f.nodeSize;if(f.isText){let g=m;o<i.length&&i[o].from<g&&(g=i[o].from);for(let b=0;b<l.length;b++)l[b].to<g&&(g=l[b].to);g<m&&(a=f.cut(g-s),f=f.cut(0,g-s),m=g,h=-1)}else for(;o<i.length&&i[o].to<m;)o++;let p=f.isInline&&!f.isLeaf?l.filter(g=>!g.inline):l.slice();n(f,p,e.forChild(s,f),h),s=m}}function Zg(r){if(r.nodeName=="UL"||r.nodeName=="OL"){let e=r.style.cssText;r.style.cssText=e+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=e}}function Yg(r,e,t,n){for(let i=0,s=0;i<r.childCount&&s<=n;){let o=r.child(i++),l=s;if(s+=o.nodeSize,!o.isText)continue;let a=o.text;for(;i<r.childCount;){let u=r.child(i++);if(s+=u.nodeSize,!u.isText)break;a+=u.text}if(s>=t){if(s>=n&&a.slice(n-e.length-l,n-l)==e)return n-e.length;let u=l<n?a.lastIndexOf(e,n-l-1):-1;if(u>=0&&u+e.length+l>=t)return l+u;if(t==n&&a.length>=n+e.length-l&&a.slice(n-l,n-l+e.length)==e)return n}}return-1}function oo(r,e,t,n,i){let s=[];for(let o=0,l=0;o<r.length;o++){let a=r[o],u=l,c=l+=a.size;u>=t||c<=e?s.push(a):(u<e&&s.push(a.slice(0,e-u,n)),i&&(s.push(i),i=void 0),c>t&&s.push(a.slice(t-u,a.size,n)))}return s}function Ro(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=n.resolve(o),a,u;if(ns(t)){for(a=o;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&G.isSelectable(d)&&i.parent&&!(d.isInline&&wg(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;u=new G(o==f?l:n.resolve(f))}}else{if(t instanceof r.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=o,f=o;for(let h=0;h<t.rangeCount;h++){let m=t.getRangeAt(h);d=Math.min(d,r.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,r.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(d<0)return null;[a,o]=f==r.state.selection.anchor?[f,d]:[d,f],l=n.resolve(o)}else a=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(a<0)return null}let c=n.resolve(a);if(!u){let d=e=="pointer"||r.state.selection.head<l.pos&&!s?1:-1;u=$o(r,c,l,d)}return u}function Oc(r){return r.editable?r.hasFocus():Ic(r)&&document.activeElement&&document.activeElement.contains(r.dom)}function zt(r,e=!1){let t=r.state.selection;if(Nc(r,t),!Oc(r))return;let n=r.input.mouseDown;if(!e&&Fe&&n){let i=r.domSelectionRange(),s=r.domObserver.currentSelection;if(i.anchorNode&&s.anchorNode&&Sr(i.anchorNode,i.anchorOffset,s.anchorNode,s.anchorOffset)&&n.delaySelUpdate()){r.domObserver.setCurSelection();return}}if(r.domObserver.disconnectSelection(),r.cursorWrapper)Xg(r);else{let{anchor:i,head:s}=t,o,l;xa&&!(t instanceof Q)&&(t.$from.parent.inlineContent||(o=Ca(r,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(l=Ca(r,t.to))),r.docView.setSelection(i,s,r,e),xa&&(o&&Aa(o),l&&Aa(l)),t.visible?r.dom.classList.remove("ProseMirror-hideselection"):(r.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Qg(r))}r.domObserver.setCurSelection(),r.domObserver.connectSelection()}const xa=qe||Fe&&bc<63;function Ca(r,e){let{node:t,offset:n}=r.docView.domFromPos(e,0),i=n<t.childNodes.length?t.childNodes[n]:null,s=n?t.childNodes[n-1]:null;if(qe&&i&&i.contentEditable=="false")return Ss(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Ss(i);if(s)return Ss(s)}}function Ss(r){return r.contentEditable="true",qe&&r.draggable&&(r.draggable=!1,r.wasDraggable=!0),r}function Aa(r){r.contentEditable="false",r.wasDraggable&&(r.draggable=!0,r.wasDraggable=null)}function Qg(r){let e=r.dom.ownerDocument;e.removeEventListener("selectionchange",r.input.hideSelectionGuard);let t=r.domSelectionRange(),n=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!Oc(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function Xg(r){let e=r.domSelection();if(!e)return;let t=r.cursorWrapper.dom,n=t.nodeName=="IMG";n?e.collapse(t.parentNode,Ie(t)+1):e.collapse(t,0),!n&&!r.state.selection.visible&&Qe&&Xt<=11&&(t.disabled=!0,t.disabled=!1)}function Nc(r,e){if(e instanceof G){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(wa(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else wa(r)}function wa(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function $o(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||Q.between(e,t,n)}function Ea(r){return r.editable&&!r.hasFocus()?!1:Ic(r)}function Ic(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function e0(r){let e=r.docView.domFromPos(r.state.selection.anchor,0),t=r.domSelectionRange();return Sr(e.node,e.offset,t.anchorNode,t.anchorOffset)}function lo(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),s=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return s&&te.findFrom(s,e)}function Ut(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function Sa(r,e,t){let n=r.state.selection;if(n instanceof Q)if(t.indexOf("s")>-1){let{$head:i}=n,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=r.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Ut(r,new Q(n.$anchor,o))}else if(n.empty){if(r.endOfTextblock(e>0?"forward":"backward")){let i=lo(r.state,e);return i&&i instanceof G?Ut(r,i):!1}else if(!(ot&&t.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=r.docView.descAt(l))&&!o.contentDOM?G.isSelectable(s)?Ut(r,new G(e<0?r.state.doc.resolve(i.pos-s.nodeSize):i)):Tn?Ut(r,new Q(r.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(n instanceof G&&n.node.isInline)return Ut(r,new Q(e>0?n.$to:n.$from));{let i=lo(r.state,e);return i?Ut(r,i):!1}}}function fi(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function ln(r,e){let t=r.pmViewDesc;return t&&t.size==0&&(e<0||r.nextSibling||r.nodeName!="BR")}function Or(r,e){return e<0?t0(r):r0(r)}function t0(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,s,o=!1;for(ct&&t.nodeType==1&&n<fi(t)&&ln(t.childNodes[n],-1)&&(o=!0);;)if(n>0){if(t.nodeType!=1)break;{let l=t.childNodes[n-1];if(ln(l,-1))i=t,s=--n;else if(l.nodeType==3)t=l,n=t.nodeValue.length;else break}}else{if(Bc(t))break;{let l=t.previousSibling;for(;l&&ln(l,-1);)i=t.parentNode,s=Ie(l),l=l.previousSibling;if(l)t=l,n=fi(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?ao(r,t,n):i&&ao(r,i,s)}function r0(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=fi(t),s,o;for(;;)if(n<i){if(t.nodeType!=1)break;let l=t.childNodes[n];if(ln(l,1))s=t,o=++n;else break}else{if(Bc(t))break;{let l=t.nextSibling;for(;l&&ln(l,1);)s=l.parentNode,o=Ie(l)+1,l=l.nextSibling;if(l)t=l,n=0,i=fi(t);else{if(t=t.parentNode,t==r.dom)break;n=i=0}}}s&&ao(r,s,o)}function Bc(r){let e=r.pmViewDesc;return e&&e.node&&e.node.isBlock}function n0(r,e){for(;r&&e==r.childNodes.length&&!_n(r);)e=Ie(r)+1,r=r.parentNode;for(;r&&e<r.childNodes.length;){let t=r.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=0}}function i0(r,e){for(;r&&!e&&!_n(r);)e=Ie(r),r=r.parentNode;for(;r&&e;){let t=r.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=r.childNodes.length}}function ao(r,e,t){if(e.nodeType!=3){let s,o;(o=n0(e,t))?(e=o,t=0):(s=i0(e,t))&&(e=s,t=s.nodeValue.length)}let n=r.domSelection();if(!n)return;if(ns(n)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),n.removeAllRanges(),n.addRange(s)}else n.extend&&n.extend(e,t);r.domObserver.setCurSelection();let{state:i}=r;setTimeout(()=>{r.state==i&&zt(r)},50)}function Da(r,e){let t=r.state.doc.resolve(e);if(!(Fe||kc)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let s=r.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=r.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function _a(r,e,t){let n=r.state.selection;if(n instanceof Q&&!n.empty||t.indexOf("s")>-1||ot&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=lo(r.state,e);if(o&&o instanceof G)return Ut(r,o)}if(!i.parent.inlineContent){let o=e<0?i:s,l=n instanceof tt?te.near(o,e):te.findFrom(o,e);return l?Ut(r,l):!1}return!1}function Ta(r,e){if(!(r.state.selection instanceof Q))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=r.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),r.dispatch(o),!0}return!1}function Ma(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function s0(r){if(!qe||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;Ma(r,n,"true"),setTimeout(()=>Ma(r,n,"false"),20)}return!1}function o0(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function l0(r,e){let t=e.keyCode,n=o0(e);if(t==8||ot&&t==72&&n=="c")return Ta(r,-1)||Or(r,-1);if(t==46&&!e.shiftKey||ot&&t==68&&n=="c")return Ta(r,1)||Or(r,1);if(t==13||t==27)return!0;if(t==37||ot&&t==66&&n=="c"){let i=t==37?Da(r,r.state.selection.from)=="ltr"?-1:1:-1;return Sa(r,i,n)||Or(r,i)}else if(t==39||ot&&t==70&&n=="c"){let i=t==39?Da(r,r.state.selection.from)=="ltr"?1:-1:1;return Sa(r,i,n)||Or(r,i)}else{if(t==38||ot&&t==80&&n=="c")return _a(r,-1,n)||Or(r,-1);if(t==40||ot&&t==78&&n=="c")return s0(r)||_a(r,1,n)||Or(r,1);if(n==(ot?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Po(r,e){r.someProp("transformCopied",h=>{e=h(e,r)});let t=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let h=n.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),n=h.content}let o=r.someProp("clipboardSerializer")||_r.fromSchema(r.state.schema),l=zc(),a=l.createElement("div");a.appendChild(o.serializeFragment(n,{document:l}));let u=a.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=Lc[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let m=l.createElement(c[h]);for(;a.firstChild;)m.appendChild(a.firstChild);a.appendChild(m),d++}u=a.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=r.someProp("clipboardTextSerializer",h=>h(e,r))||e.content.textBetween(0,e.content.size,`
13
+
14
+ `);return{dom:a,text:f,slice:e}}function Fc(r,e,t,n,i){let s=i.parent.type.spec.code,o,l;if(!t&&!e)return null;let a=!!e&&(n||s||!t);if(a){if(r.someProp("transformPastedText",f=>{e=f(e,s||n,r)}),s)return l=new U($.from(r.state.schema.text(e.replace(/\r\n?/g,`
15
+ `))),0,0),r.someProp("transformPasted",f=>{l=f(l,r,!0)}),l;let d=r.someProp("clipboardTextParser",f=>f(e,i,n,r));if(d)l=d;else{let f=i.marks(),{schema:h}=r.state,m=_r.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(p=>{let g=o.appendChild(document.createElement("p"));p&&g.appendChild(m.serializeNode(h.text(p,f)))})}}else r.someProp("transformPastedHTML",d=>{t=d(t,r)}),o=d0(t),Tn&&f0(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(r.someProp("clipboardParser")||r.someProp("domParser")||Qt.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||c),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!a0.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)l=h0(Oa(l,+c[1],+c[2]),c[4]);else if(l=U.maxOpen(u0(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d<l.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=Oa(l,d,f)}return r.someProp("transformPasted",d=>{l=d(l,r,a)}),l}const a0=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function u0(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(r.forEach(l=>{if(!o)return;let a=i.findWrapping(l.type),u;if(!a)return o=null;if(u=o.length&&s.length&&$c(a,s,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=Pc(o[o.length-1],s.length));let c=Rc(l,a);o.push(c),i=i.matchType(c.type),s=a}}),o)return $.from(o)}return r}function Rc(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,$.from(r));return r}function $c(r,e,t,n,i){if(i<r.length&&i<e.length&&r[i]==e[i]){let s=$c(r,e,t,n.lastChild,i+1);if(s)return n.copy(n.content.replaceChild(n.childCount-1,s));if(n.contentMatchAt(n.childCount).matchType(i==r.length-1?t.type:r[i+1]))return n.copy(n.content.append($.from(Rc(t,r,i+1))))}}function Pc(r,e){if(e==0)return r;let t=r.content.replaceChild(r.childCount-1,Pc(r.lastChild,e-1)),n=r.contentMatchAt(r.childCount).fillBefore($.empty,!0);return r.copy(t.append(n))}function uo(r,e,t,n,i,s){let o=e<0?r.firstChild:r.lastChild,l=o.content;return r.childCount>1&&(s=0),i<n-1&&(l=uo(l,e,t,n,i+1,s)),i>=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore($.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(l))}function Oa(r,e,t){return e<r.openStart&&(r=new U(uo(r.content,-1,e,r.openStart,0,r.openEnd),e,r.openEnd)),t<r.openEnd&&(r=new U(uo(r.content,1,t,r.openEnd,0,0),r.openStart,t)),r}const Lc={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function zc(){return document.implementation.createHTMLDocument("title")}let Kr=null;function c0(r){let e=window.trustedTypes;if(!e)return r;if(!Kr){if(Kr=e.defaultPolicy)try{return Kr.createHTML(r)}catch{}Kr=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})}return Kr.createHTML(r)}function d0(r){let e=/^(\s*<meta [^>]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=zc(),n=t.body,i=/<([a-z][^>\s]+)/i.exec(r),s;if((s=i&&Lc[i[1].toLowerCase()])&&(r=s.map(o=>"<"+o+">").join("")+r+s.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=c0(r),s)for(let o=0;o<s.length;o++)n=n.querySelector(s[o])||n;for(let o=0;o<t.styleSheets.length;o++){let l=t.styleSheets[o];for(let a=0;a<l.rules.length;a++){let u=l.rules[a];if(u instanceof CSSStyleRule){let c=n.querySelectorAll(u.selectorText);for(let d=0;d<c.length;d++)c[d].style.cssText+=u.style.cssText}}}return n}function f0(r){let e=r.querySelectorAll(Fe?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let n=e[t];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "),n)}}function h0(r,e){if(!r.size)return r;let t=r.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return r}let{content:i,openStart:s,openEnd:o}=r;for(let l=n.length-2;l>=0;l-=2){let a=t.nodes[n[l]];if(!a||a.hasRequiredAttrs())break;try{a.checkAttrs(n[l+1])}catch{break}i=$.from(a.create(n[l+1],i)),s++,o++}return new U(i,s,o)}const He={},Ue={},p0={touchstart:!0,touchmove:!0};class m0{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function g0(r){for(let e in He){let t=He[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=n=>{b0(r,n)&&!Lo(r,n)&&(r.editable||!(n.type in Ue))&&t(r,n)},p0[e]?{passive:!0}:void 0)}qe&&r.dom.addEventListener("input",()=>null),co(r)}function Pt(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}function y0(r){r.input.mouseDown&&r.input.mouseDown.done(),r.domObserver.stop();for(let e in r.input.eventHandlers)r.dom.removeEventListener(e,r.input.eventHandlers[e]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}function co(r){r.someProp("handleDOMEvents",e=>{for(let t in e)r.input.eventHandlers[t]||r.dom.addEventListener(t,r.input.eventHandlers[t]=n=>Lo(r,n))})}function Lo(r,e){return r.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(r,e)||e.defaultPrevented:!1})}function b0(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=r.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function k0(r,e){!Lo(r,e)&&He[e.type]&&(r.editable||!(e.type in Ue))&&He[e.type](r,e)}Ue.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!Hc(r)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!($t&&Fe&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),Vr&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,ur(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||l0(r,t)?t.preventDefault():Pt(r,"key")};Ue.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)};Ue.keypress=(r,e)=>{let t=e;if(Hc(r)||!t.charCode||t.ctrlKey&&!t.altKey||ot&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof Q)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode),s=()=>r.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",o=>o(r,n.$from.pos,n.$to.pos,i,s))&&r.dispatch(s()),t.preventDefault()}};function On(r){return{left:r.clientX,top:r.clientY}}function v0(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function zo(r,e,t,n,i){if(n==-1)return!1;let s=r.state.doc.resolve(n);for(let o=s.depth+1;o>0;o--)if(r.someProp(e,l=>o>s.depth?l(r,t,s.nodeAfter,s.before(o),i,!0):l(r,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function Nn(r,e,t){if(r.focused||r.focus(),r.state.selection.eq(e))return;let n=r.state.tr.setSelection(e);n.setMeta("pointer",!0),r.dispatch(n)}function x0(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&G.isSelectable(n)?(Nn(r,new G(t)),!0):!1}function C0(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof G&&(n=t.node);let s=r.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(G.isSelectable(l)){n&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(Nn(r,G.create(r.state.doc,i)),!0):!1}function A0(r,e,t,n,i){return zo(r,"handleClickOn",e,t,n)||r.someProp("handleClick",s=>s(r,e,n))||(i?C0(r,t):x0(r,t))}function w0(r,e,t,n){return zo(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function E0(r,e,t,n){return zo(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||S0(r,t,n)}function S0(r,e,t){if(t.button!=0)return!1;let n=qc(r,e,!0),i=r.state.doc;return n?(Nn(r,n),n instanceof Q&&i.eq(r.state.doc)&&(r.input.mouseDown=new _0(r,n)),!0):!1}function qc(r,e,t){let n=r.state.doc;if(e==-1)return n.inlineContent?Q.create(n,0,n.content.size):null;let i=n.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)return Q.create(n,l+1,l+1+o.content.size);if(t&&G.isSelectable(o))return G.create(n,l)}return null}function qo(r){return hi(r)}const Vc=ot?"metaKey":"ctrlKey";He.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=qo(r),i=Date.now(),s="singleClick";i-r.input.lastClick.time<500&&v0(t,r.input.lastClick)&&!t[Vc]&&r.input.lastClick.button==t.button&&(r.input.lastClick.type=="singleClick"?s="doubleClick":r.input.lastClick.type=="doubleClick"&&(s="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s,button:t.button},r.input.mouseDown&&r.input.mouseDown.done();let o=r.posAtCoords(On(t));o&&(s=="singleClick"?r.input.mouseDown=new D0(r,o,t,!!n):(s=="doubleClick"?w0:E0)(r,o.pos,o.inside,t)?t.preventDefault():Pt(r,"pointer"))};class jc{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class D0 extends jc{constructor(e,t,n,i){super(e),this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[Vc],this.allowDefault=n.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let c=e.state.doc.resolve(t.pos);s=c.parent,o=c.depth?c.before():0}const l=i?null:n.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:u}=e.state;n.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof G&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ct&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Pt(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||zt(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(On(e))),this.updateAllowDefault(e),this.allowDefault||!t?Pt(this.view,"pointer"):A0(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||qe&&this.mightDrag&&!this.mightDrag.node.isAtom||Fe&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Nn(this.view,te.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Pt(this.view,"pointer")}move(e){this.updateAllowDefault(e),Pt(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class _0 extends jc{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Pt(this.view,"pointer");let t=this.view.posAtCoords(On(e)),n=t&&qc(this.view,t.inside,!1);if(!n)return;let{doc:i}=this.view.state,s=this.startSelection,[o,l]=n.from<s.from?[s.to,n.from]:[s.from,n.to];Nn(this.view,Q.create(i,o,l))}}He.touchstart=r=>{r.input.lastTouch=Date.now(),qo(r),Pt(r,"pointer")};He.touchmove=r=>{r.input.lastTouch=Date.now(),Pt(r,"pointer")};He.contextmenu=r=>qo(r);function Hc(r,e){return r.composing?!0:qe&&Math.abs(Date.now()-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const T0=$t?5e3:-1;Ue.compositionstart=Ue.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$to;if(e.selection instanceof Q&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||Fe&&kc&&M0(r)))r.markCursor=r.state.storedMarks||t.marks(),hi(r,!0),r.markCursor=null;else if(hi(r,!e.selection.empty),ct&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let l=r.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}r.input.composing=!0}Uc(r,T0)};function M0(r){let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let n=e.childNodes[t];return n.nodeType==1&&n.contentEditable=="false"}Ue.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=Date.now(),r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.badSafariComposition?r.domObserver.forceFlush():r.input.compositionPendingChanges&&Promise.resolve().then(()=>r.domObserver.flush()),r.input.compositionID++,Uc(r,20))};function Uc(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>hi(r),e))}function Wc(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=Date.now());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function O0(r){let e=r.domSelectionRange();if(!e.focusNode)return null;let t=Cg(e.focusNode,e.focusOffset),n=Ag(e.focusNode,e.focusOffset);if(t&&n&&t!=n){let i=n.pmViewDesc,s=r.domObserver.lastChangedTextNode;if(t==s||n==s)return s;if(!i||!i.isText(n.nodeValue))return n;if(r.input.compositionNode==n){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return n}}return t||n}function hi(r,e=!1){if(!($t&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),Wc(r),e||r.docView&&r.docView.dirty){let t=Ro(r),n=r.state.selection;return t&&!t.eq(n)?r.dispatch(r.state.tr.setSelection(t)):(r.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?r.dispatch(r.state.tr.deleteSelection()):r.updateState(r.state),!0}return!1}}function N0(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const kn=Qe&&Xt<15||Vr&&Dg<604;He.copy=Ue.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let s=kn?null:t.clipboardData,o=n.content(),{dom:l,text:a}=Po(r,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):N0(r,l),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function I0(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function B0(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=r.input.shiftKey&&r.input.lastKeyCode!=45;setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?vn(r,n.value,null,i,e):vn(r,n.textContent,n.innerHTML,i,e)},50)}function vn(r,e,t,n,i){let s=Fc(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",a=>a(r,i,s||U.empty)))return!0;if(!s)return!1;let o=I0(s),l=o?r.state.tr.replaceSelectionWith(o,n):r.state.tr.replaceSelection(s);return r.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Kc(r){let e=r.getData("text/plain")||r.getData("Text");if(e)return e;let t=r.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ue.paste=(r,e)=>{let t=e;if(r.composing&&!$t)return;let n=kn?null:t.clipboardData,i=r.input.shiftKey&&r.input.lastKeyCode!=45;n&&vn(r,Kc(n),n.getData("text/html"),i,t)?t.preventDefault():B0(r,t)};class Jc{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const F0=ot?"altKey":"ctrlKey";function Gc(r,e){let t;return r.someProp("dragCopies",n=>{t=t||n(e)}),t!=null?!t:!e[F0]}He.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,s=i.empty?null:r.posAtCoords(On(t)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof G?i.to-1:i.to))){if(n&&n.mightDrag)o=G.create(r.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=r.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=r.docView&&(o=G.create(r.state.doc,d.posBefore))}}let l=(o||r.state.selection).content(),{dom:a,text:u,slice:c}=Po(r,l);(!t.dataTransfer.files.length||!Fe||bc>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(kn?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",kn||t.dataTransfer.setData("text/plain",u),r.dragging=new Jc(c,Gc(r,t),o)};He.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)};Ue.dragover=Ue.dragenter=(r,e)=>e.preventDefault();Ue.drop=(r,e)=>{try{R0(r,e,r.dragging)}finally{r.dragging=null}};function R0(r,e,t){if(!e.dataTransfer)return;let n=r.posAtCoords(On(e));if(!n)return;let i=r.state.doc.resolve(n.pos),s=t&&t.slice;s?r.someProp("transformPasted",h=>{s=h(s,r,!1)}):s=Fc(r,Kc(e.dataTransfer),kn?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&Gc(r,e));if(r.someProp("handleDrop",h=>h(r,e,s||U.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let l=s?uc(r.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let a=r.state.tr;if(o){let{node:h}=t;h?h.replace(a):a.deleteSelection()}let u=a.mapping.map(l),c=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=a.doc;if(c?a.replaceRangeWith(u,u,s.content.firstChild):a.replaceRange(u,u,s),a.doc.eq(d))return;let f=a.doc.resolve(u);if(c&&G.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new G(f));else{let h=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((m,p,g,b)=>h=b),a.setSelection($o(r,f,a.doc.resolve(h)))}r.focus(),r.dispatch(a.setMeta("uiEvent","drop"))}He.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&zt(r)},20))};He.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)};He.beforeinput=(r,e)=>{if($t&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",s=>s(r,ur(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in Ue)He[r]=Ue[r];function xn(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class pi{constructor(e,t){this.toDOM=e,this.spec=t||vr,this.side=this.spec.side||0}map(e,t,n,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new at(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof pi&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&xn(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class rr{constructor(e,t){this.attrs=e,this.spec=t||vr}map(e,t,n,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=o?null:new at(s,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof rr&&xn(this.attrs,e.attrs)&&xn(this.spec,e.spec)}static is(e){return e.type instanceof rr}destroy(){}}class Vo{constructor(e,t){this.attrs=e,this.spec=t||vr}map(e,t,n,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=s.pos?null:new at(s.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(n)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof Vo&&xn(this.attrs,e.attrs)&&xn(this.spec,e.spec)}destroy(){}}class at{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new at(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new at(e,e,new pi(t,n))}static inline(e,t,n,i){return new at(e,t,new rr(n,i))}static node(e,t,n,i){return new at(e,t,new Vo(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof rr}get widget(){return this.type instanceof pi}}const Ir=[],vr={};class Ee{constructor(e,t){this.local=e.length?e:Ir,this.children=t.length?t:Ir}static create(e,t){return t.length?mi(t,e,0,vr):ze}find(e,t,n){let i=[];return this.findInner(e??0,t??1e9,i,0,n),i}findInner(e,t,n,i,s){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=t&&l.to>=e&&(!s||s(l.spec))&&n.push(l.copy(l.from+i,l.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,n,i+l,s)}}map(e,t,n){return this==ze||e.maps.length==0?this:this.mapInner(e,t,0,0,n||vr)}mapInner(e,t,n,i,s){let o;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,n,i);a&&a.type.valid(t,a)?(o||(o=[])).push(a):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?$0(this.children,o||[],e,t,n,i,s):o?new Ee(o.sort(xr),Ir):ze}add(e,t){return t.length?this==ze?Ee.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,s=0;e.forEach((l,a)=>{let u=a+n,c;if(c=Yc(t,l,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<a;)s+=3;i[s]==a?i[s+2]=i[s+2].addInner(l,c,u+1):i.splice(s,0,a,a+l.nodeSize,mi(c,l,u+1,vr)),s+=3}});let o=Zc(s?Qc(t):t,-n);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new Ee(o.length?this.local.concat(o).sort(xr):this.local,i||this.children)}remove(e){return e.length==0||this==ze?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let s=0;s<n.length;s+=3){let o,l=n[s]+t,a=n[s+1]+t;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>l&&d.to<a&&(e[c]=null,(o||(o=[])).push(d));if(!o)continue;n==this.children&&(n=this.children.slice());let u=n[s+2].removeInner(o,l+1);u!=ze?n[s+2]=u:(n.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let l=0;l<i.length;l++)i[l].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new Ee(i,n):ze}forChild(e,t){if(this==ze)return this;if(t.isLeaf)return Ee.empty;let n,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(n=this.children[l+2]);break}let s=e+1,o=s+t.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<o&&a.to>s&&a.type instanceof rr){let u=Math.max(s,a.from)-s,c=Math.min(o,a.to)-s;u<c&&(i||(i=[])).push(a.copy(u,c))}}if(i){let l=new Ee(i.sort(xr),Ir);return n?new Jt([l,n]):l}return n||ze}eq(e){if(this==e)return!0;if(!(e instanceof Ee)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return jo(this.localsInner(e))}localsInner(e){if(this==ze)return Ir;if(e.inlineContent||!this.local.some(rr.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof rr||t.push(this.local[n]);return t}forEachSet(e){e(this)}}Ee.empty=new Ee([],[]);Ee.removeOverlap=jo;const ze=Ee.empty;class Jt{constructor(e){this.members=e}map(e,t){const n=this.members.map(i=>i.map(e,t,vr));return Jt.from(n)}forChild(e,t){if(t.isLeaf)return Ee.empty;let n=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=ze&&(s instanceof Jt?n=n.concat(s.members):n.push(s))}return Jt.from(n)}eq(e){if(!(e instanceof Jt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{n&&(t=t.slice(),n=!1);for(let o=0;o<s.length;o++)t.push(s[o])}}return t?jo(n?t:t.sort(xr)):Ir}static from(e){switch(e.length){case 0:return ze;case 1:return e[0];default:return new Jt(e.every(t=>t instanceof Ee)?e:e.reduce((t,n)=>t.concat(n instanceof Ee?n:n.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function $0(r,e,t,n,i,s,o){let l=r.slice();for(let u=0,c=s;u<t.maps.length;u++){let d=0;t.maps[u].forEach((f,h,m,p)=>{let g=p-m-(h-f);for(let b=0;b<l.length;b+=3){let E=l[b+1];if(E<0||f>E+c-d)continue;let v=l[b]+c-d;h>=v?l[b+1]=f<=v?-2:-1:f>=c&&g&&(l[b]+=g,l[b+1]+=g)}d+=g}),c=t.maps[u].map(c,-1)}let a=!1;for(let u=0;u<l.length;u+=3)if(l[u+1]<0){if(l[u+1]==-2){a=!0,l[u+1]=-1;continue}let c=t.map(r[u]+s),d=c-i;if(d<0||d>=n.content.size){a=!0;continue}let f=t.map(r[u+1]+s,-1),h=f-i,{index:m,offset:p}=n.content.findIndex(d),g=n.maybeChild(m);if(g&&p==d&&p+g.nodeSize==h){let b=l[u+2].mapInner(t,g,c+1,r[u]+s+1,o);b!=ze?(l[u]=d,l[u+1]=h,l[u+2]=b):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=P0(l,r,e,t,i,s,o),c=mi(u,n,0,o);e=c.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<c.children.length;d+=3){let h=c.children[d];for(;f<l.length&&l[f]<h;)f+=3;l.splice(f,0,c.children[d],c.children[d+1],c.children[d+2])}}return new Ee(e.sort(xr),l)}function Zc(r,e){if(!e||!r.length)return r;let t=[];for(let n=0;n<r.length;n++){let i=r[n];t.push(new at(i.from+e,i.to+e,i.type))}return t}function P0(r,e,t,n,i,s,o){function l(a,u){for(let c=0;c<a.local.length;c++){let d=a.local[c].map(n,i,u);d?t.push(d):o.onRemove&&o.onRemove(a.local[c].spec)}for(let c=0;c<a.children.length;c+=3)l(a.children[c+2],a.children[c]+u+1)}for(let a=0;a<r.length;a+=3)r[a+1]==-1&&l(r[a+2],e[a]+s+1);return t}function Yc(r,e,t){if(e.isLeaf)return null;let n=t+e.nodeSize,i=null;for(let s=0,o;s<r.length;s++)(o=r[s])&&o.from>t&&o.to<n&&((i||(i=[])).push(o),r[s]=null);return i}function Qc(r){let e=[];for(let t=0;t<r.length;t++)r[t]!=null&&e.push(r[t]);return e}function mi(r,e,t,n){let i=[],s=!1;e.forEach((l,a)=>{let u=Yc(r,l,a+t);if(u){s=!0;let c=mi(u,l,t+a+1,n);c!=ze&&i.push(a,a+l.nodeSize,c)}});let o=Zc(s?Qc(r):r,-t).sort(xr);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(n.onRemove&&n.onRemove(o[l].spec),o.splice(l--,1));return o.length||i.length?new Ee(o,i):ze}function xr(r,e){return r.from-e.from||r.to-e.to}function jo(r){let e=r;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.from!=n.to)for(let i=t+1;i<e.length;i++){let s=e[i];if(s.from==n.from){s.to!=n.to&&(e==r&&(e=r.slice()),e[i]=s.copy(s.from,n.to),Na(e,i+1,s.copy(n.to,s.to)));continue}else{s.from<n.to&&(e==r&&(e=r.slice()),e[t]=n.copy(n.from,s.from),Na(e,i,n.copy(s.from,n.to)));break}}}return e}function Na(r,e,t){for(;e<r.length&&xr(t,r[e])>0;)e++;r.splice(e,0,t)}function Ds(r){let e=[];return r.someProp("decorations",t=>{let n=t(r.state);n&&n!=ze&&e.push(n)}),r.cursorWrapper&&e.push(Ee.create(r.state.doc,[r.cursorWrapper.deco])),Jt.from(e)}const L0={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},z0=Qe&&Xt<=11;class q0{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class V0{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new q0,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);Qe&&Xt<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():qe&&e.composing&&n.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),z0&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,L0)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ea(this.view)){if(this.suppressingSelectionUpdates)return zt(this.view);if(Qe&&Xt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Sr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let s=e.focusNode;s;s=qr(s))t.add(s);for(let s=e.anchorNode;s;s=qr(s))if(t.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Ea(e)&&!this.ignoreSelectionChange(n),s=-1,o=-1,l=!1,a=[];if(e.editable)for(let c=0;c<t.length;c++){let d=this.registerMutation(t[c],a);d&&(s=s<0?d.from:Math.min(d.from,s),o=o<0?d.to:Math.max(d.to,o),d.typeOver&&(l=!0))}if(a.some(c=>c.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||Fe&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(c=>c.type=="childList"&&c.removedNodes.length))){for(let c of a)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){c.parentNode.removeChild(c);break}d=d.firstChild}}}else if(ct&&a.length){let c=a.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||U0(e,d)!=h)&&f.remove()}}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ns(n)&&(u=Ro(e))&&u.eq(te.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,zt(e),this.currentSelection.set(n),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),j0(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,W0(e,a)),this.handleDOMChange(s,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||zt(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let d=e.addedNodes[c];t.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Qe&&Xt<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:f}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let o=i&&i.parentNode==e.target?Ie(i)+1:0,l=n.localPosFromDOM(e.target,o,-1),a=s&&s.parentNode==e.target?Ie(s):e.target.childNodes.length,u=n.localPosFromDOM(e.target,a,1);return{from:l,to:u}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Ia=new WeakMap,Ba=!1;function j0(r){if(!Ia.has(r)&&(Ia.set(r,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace)!==-1)){if(r.requiresGeckoHackNode=ct,Ba)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Ba=!0}}function Fa(r,e){let t=e.startContainer,n=e.startOffset,i=e.endContainer,s=e.endOffset,o=r.domAtPos(r.state.selection.anchor);return Sr(o.node,o.offset,i,s)&&([t,n,i,s]=[i,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:s}}function H0(r,e){if(e.getComposedRanges){let i=e.getComposedRanges(r.root)[0];if(i)return Fa(r,i)}let t;function n(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return r.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),r.dom.removeEventListener("beforeinput",n,!0),t?Fa(r,t):null}function U0(r,e){for(let t=e.parentNode;t&&t!=r.dom;t=t.parentNode){let n=r.docView.nearestDesc(t,!0);if(n&&n.node.isBlock)return t}return null}function W0(r,e){var t;let{focusNode:n,focusOffset:i}=r.domSelectionRange();for(let s of e)if(((t=s.parentNode)===null||t===void 0?void 0:t.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let l=o;for(;;){let a=l.firstChild;if(!a||a.nodeType!=1||a.contentEditable=="false"||/^(BR|IMG)$/.test(a.nodeName))break;l=a}l.insertBefore(s,l.firstChild),n==s&&r.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function K0(r,e,t,n){let{node:i,fromOffset:s,toOffset:o,from:l,to:a}=r.docView.parseRange(e,t),u=r.domSelectionRange(),c,d=u.anchorNode;if(d&&r.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:u.anchorOffset}],ns(u)||c.push({node:u.focusNode,offset:u.focusOffset})),Fe&&r.input.lastKeyCode===8)for(let b=o;b>s;b--){let E=i.childNodes[b-1],v=E.pmViewDesc;if(E.nodeName=="BR"&&!v){o=b;break}if(!v||v.size)break}let f=r.state.doc,h=r.someProp("domParser")||Qt.fromSchema(r.state.schema),m=f.resolve(l),p=null,g=h.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:s,to:o,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:J0(n),context:m});if(c&&c[0].pos!=null){let b=c[0].pos,E=c[1]&&c[1].pos;E==null&&(E=b),p={anchor:b+l,head:E+l}}return{doc:g,sel:p,from:l,to:a}}const J0=r=>e=>{let t=e.pmViewDesc;if(t)return t.parseRule(r);if(e.nodeName=="BR"&&e.parentNode){if(qe&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||qe&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},G0=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Z0(r,e,t,n,i){let s=r.input.compositionPendingChanges||(r.composing?r.input.compositionID:0);if(r.input.compositionPendingChanges=0,e<0){let C=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,w=Ro(r,C);if(w&&!r.state.selection.eq(w)){if(Fe&&$t&&r.input.lastKeyCode===13&&Date.now()-100<r.input.lastKeyCodeTime&&r.someProp("handleKeyDown",T=>T(r,ur(13,"Enter"))))return;let I=r.state.tr.setSelection(w);C=="pointer"?I.setMeta("pointer",!0):C=="key"&&I.scrollIntoView(),s&&I.setMeta("composition",s),r.dispatch(I)}return}let o=r.state.doc.resolve(e),l=o.sharedDepth(t);e=o.before(l+1),t=r.state.doc.resolve(t).after(l+1);let a=r.state.selection,u=K0(r,e,t,i),c=r.state.doc,d=c.slice(u.from,u.to),f,h;r.input.lastKeyCode===8&&Date.now()-100<r.input.lastKeyCodeTime?(f=r.state.selection.to,h="end"):(f=r.state.selection.from,h="start"),r.input.lastKeyCode=null;let m=X0(d.content,u.doc.content,u.from,f,h);if(m&&r.input.domChangeCount++,(Vr&&r.input.lastIOSEnter>Date.now()-225||$t)&&i.some(C=>C.nodeType==1&&!G0.test(C.nodeName))&&(!m||m.endA>=m.endB)&&r.someProp("handleKeyDown",C=>C(r,ur(13,"Enter")))){r.input.lastIOSEnter=0;return}if(!m)if(n&&a instanceof Q&&!a.empty&&a.$head.sameParent(a.$anchor)&&!r.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:a.from,endA:a.to,endB:a.to};else{if(u.sel){let C=Ra(r,r.state.doc,u.sel);if(C&&!C.eq(r.state.selection)){let w=r.state.tr.setSelection(C);s&&w.setMeta("composition",s),r.dispatch(w)}}return}r.state.selection.from<r.state.selection.to&&m.start==m.endB&&r.state.selection instanceof Q&&(m.start>r.state.selection.from&&m.start<=r.state.selection.from+2&&r.state.selection.from>=u.from?m.start=r.state.selection.from:m.endA<r.state.selection.to&&m.endA>=r.state.selection.to-2&&r.state.selection.to<=u.to&&(m.endB+=r.state.selection.to-m.endA,m.endA=r.state.selection.to)),Qe&&Xt<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let p=u.doc.resolveNoCache(m.start-u.from),g=u.doc.resolveNoCache(m.endB-u.from),b=c.resolve(m.start),E=p.sameParent(g)&&p.parent.inlineContent&&b.end()>=m.endA;if((Vr&&r.input.lastIOSEnter>Date.now()-225&&(!E||i.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!E&&p.pos<u.doc.content.size&&(!p.sameParent(g)||!p.parent.inlineContent)&&p.pos<g.pos&&!/\S/.test(u.doc.textBetween(p.pos,g.pos,"","")))&&r.someProp("handleKeyDown",C=>C(r,ur(13,"Enter")))){r.input.lastIOSEnter=0;return}if(r.state.selection.anchor>m.start&&Q0(c,m.start,m.endA,p,g)&&r.someProp("handleKeyDown",C=>C(r,ur(8,"Backspace")))){$t&&Fe&&r.domObserver.suppressSelectionUpdates();return}Fe&&m.endB==m.start&&(r.input.lastChromeDelete=Date.now()),$t&&!E&&p.start()!=g.start()&&g.parentOffset==0&&p.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,g=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{r.someProp("handleKeyDown",function(C){return C(r,ur(13,"Enter"))})},20));let v=m.start,D=m.endA,x=C=>{let w=C||r.state.tr.replace(v,D,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let I=Ra(r,w.doc,u.sel);I&&!(Fe&&r.composing&&I.empty&&(m.start!=m.endB||r.input.lastChromeDelete<Date.now()-100)&&(I.head==v||I.head==w.mapping.map(D)-1)||Qe&&I.empty&&I.head==v)&&w.setSelection(I)}return s&&w.setMeta("composition",s),w.scrollIntoView()},k;if(E)if(p.pos==g.pos){Qe&&Xt<=11&&p.parentOffset==0&&(r.domObserver.suppressSelectionUpdates(),setTimeout(()=>zt(r),20));let C=x(r.state.tr.delete(v,D)),w=c.resolve(m.start).marksAcross(c.resolve(m.endA));w&&C.ensureMarks(w),r.dispatch(C)}else if(m.endA==m.endB&&(k=Y0(p.parent.content.cut(p.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let C=x(r.state.tr);k.type=="add"?C.addMark(v,D,k.mark):C.removeMark(v,D,k.mark),r.dispatch(C)}else if(p.parent.child(p.index()).isText&&p.index()==g.index()-(g.textOffset?0:1)){let C=p.parent.textBetween(p.parentOffset,g.parentOffset),w=()=>x(r.state.tr.insertText(C,v,D));r.someProp("handleTextInput",I=>I(r,v,D,C,w))||r.dispatch(w())}else r.dispatch(x());else r.dispatch(x())}function Ra(r,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:$o(r,e.resolve(t.anchor),e.resolve(t.head))}function Y0(r,e){let t=r.firstChild.marks,n=e.firstChild.marks,i=t,s=n,o,l,a;for(let c=0;c<n.length;c++)i=n[c].removeFromSet(i);for(let c=0;c<t.length;c++)s=t[c].removeFromSet(s);if(i.length==1&&s.length==0)l=i[0],o="add",a=c=>c.mark(l.addToSet(c.marks));else if(i.length==0&&s.length==1)l=s[0],o="remove",a=c=>c.mark(l.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(a(e.child(c)));if($.from(u).eq(r))return{mark:l,type:o}}function Q0(r,e,t,n,i){if(t-e<=i.pos-n.pos||_s(n,!0,!1)<i.pos)return!1;let s=r.resolve(e);if(!n.parent.isTextblock){let l=s.nodeAfter;return l!=null&&t==e+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=r.resolve(_s(s,!0,!0));return!o.parent.isTextblock||o.pos>t||_s(o,!0,!1)<t?!1:n.parent.content.cut(n.parentOffset).eq(o.parent.content)}function _s(r,e,t){let n=r.depth,i=e?r.end():r.pos;for(;n>0&&(e||r.indexAfter(n)==r.node(n).childCount);)n--,i++,e=!1;if(t){let s=r.node(n).maybeChild(r.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function X0(r,e,t,n,i){let s=r.findDiffStart(e,t),o=t+r.size,l=t+e.size;if(s==null)return null;let{a,b:u}=r.findDiffEnd(e,o,l);if(i=="end"){let c=Math.max(0,s-Math.min(a,u));n-=a+c-s}if(a<s&&o<l){let c=n<=s&&n>=a?s-n:0;s-=c,u=s+(u-a),a=s}else if(u<s){let c=n<=s&&n>=u?s-n:0;s-=c,a=s+(a-u),u=s}return{start:s,endA:a,endB:u}}class Xc{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new m0,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(qa),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=La(this),Pa(this),this.nodeViews=za(this),this.docView=ka(this.state.doc,$a(this),Ds(this),this.dom,this),this.domObserver=new V0(this,(n,i,s,o)=>Z0(this,n,i,s,o)),this.domObserver.start(),g0(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&co(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(qa),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(Wc(this),o=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=za(this);t2(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&co(this),this.editable=La(this),Pa(this);let a=Ds(this),u=$a(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,u,a);(d||!e.selection.eq(i.selection))&&(o=!0);let f=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&Mg(this);if(o){this.domObserver.stop();let h=d&&(Qe||Fe)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&e2(i.selection,e.selection);if(d){let p=Fe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=O0(this)),(s||!this.docView.update(e.doc,u,a,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=ka(e.doc,u,a,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let m=this.input.mouseDown;h||!(m&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&e0(this)&&m.delaySelUpdate())?zt(this,h):(Nc(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&Og(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof G){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&pa(this,t.getBoundingClientRect(),e)}else pa(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let n=this.directPlugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let n=this.state.plugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,i=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let s=n.from+(this.state.doc.content.size-t.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==n.node&&(i=s)}this.dragging=new Jc(e.slice,e.move,i<0?void 0:G.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],i;if(n!=null&&(i=t?t(n):n))return i;for(let o=0;o<this.directPlugins.length;o++){let l=this.directPlugins[o].props[e];if(l!=null&&(i=t?t(l):l))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let l=s[o].props[e];if(l!=null&&(i=t?t(l):l))return i}}hasFocus(){if(Qe){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Ng(this.dom),zt(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return $g(this,e)}coordsAtPos(e,t=1){return wc(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Vg(this,t||this.state,e)}pasteHTML(e,t){return vn(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return vn(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Po(this,e)}destroy(){this.docView&&(y0(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ds(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,vg())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return k0(this,e)}domSelectionRange(){let e=this.domSelection();return e?qe&&this.root.nodeType===11&&Eg(this.dom.ownerDocument)==this.dom&&H0(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Xc.prototype.dispatch=function(r){let e=this._props.dispatchTransaction;e?e.call(this,r):this.updateState(this.state.apply(r))};function $a(r){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(r.editable),r.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(r.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[at.node(0,r.state.doc.content.size,e)]}function Pa(r){if(r.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),r.cursorWrapper={dom:e,deco:at.widget(r.state.selection.from,e,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function La(r){return!r.someProp("editable",e=>e(r.state)===!1)}function e2(r,e){let t=Math.min(r.$anchor.sharedDepth(r.head),e.$anchor.sharedDepth(e.head));return r.$anchor.start(t)!=e.$anchor.start(t)}function za(r){let e=Object.create(null);function t(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return r.someProp("nodeViews",t),r.someProp("markViews",t),e}function t2(r,e){let t=0,n=0;for(let i in r){if(r[i]!=e[i])return!0;t++}for(let i in e)n++;return t!=n}function qa(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var nr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},gi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},r2=typeof navigator<"u"&&/Mac/.test(navigator.platform),n2=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Be=0;Be<10;Be++)nr[48+Be]=nr[96+Be]=String(Be);for(var Be=1;Be<=24;Be++)nr[Be+111]="F"+Be;for(var Be=65;Be<=90;Be++)nr[Be]=String.fromCharCode(Be+32),gi[Be]=String.fromCharCode(Be);for(var Ts in nr)gi.hasOwnProperty(Ts)||(gi[Ts]=nr[Ts]);function i2(r){var e=r2&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||n2&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?gi:nr)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const s2=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),o2=typeof navigator<"u"&&/Win/.test(navigator.platform);function l2(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,s,o;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))s2?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+a)}return n&&(t="Alt-"+t),i&&(t="Ctrl-"+t),o&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function a2(r){let e=Object.create(null);for(let t in r)e[l2(t)]=r[t];return e}function Ms(r,e,t=!0){return e.altKey&&(r="Alt-"+r),e.ctrlKey&&(r="Ctrl-"+r),e.metaKey&&(r="Meta-"+r),t&&e.shiftKey&&(r="Shift-"+r),r}function u2(r){return new Le({props:{handleKeyDown:ed(r)}})}function ed(r){let e=a2(r);return function(t,n){let i=i2(n),s,o=e[Ms(i,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let l=e[Ms(i,n,!1)];if(l&&l(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(o2&&n.ctrlKey&&n.altKey)&&(s=nr[n.keyCode])&&s!=i){let l=e[Ms(s,n)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const Ho=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function td(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const rd=(r,e,t)=>{let n=td(r,t);if(!n)return!1;let i=Uo(n);if(!i){let o=n.blockRange(),l=o&&Ur(o);return l==null?!1:(e&&e(r.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(dd(r,i,e,-1))return!0;if(n.parent.content.size==0&&(jr(s,"end")||G.isSelectable(s)))for(let o=n.depth;;o--){let l=ts(r.doc,n.before(o),n.after(o),U.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=r.tr.step(l);a.setSelection(jr(s,"end")?te.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):G.create(a.doc,i.pos-s.nodeSize)),e(a.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},c2=(r,e,t)=>{let n=td(r,t);if(!n)return!1;let i=Uo(n);return i?nd(r,i,e):!1},d2=(r,e,t)=>{let n=sd(r,t);if(!n)return!1;let i=Wo(n);return i?nd(r,i,e):!1};function nd(r,e,t){let n=e.nodeBefore,i=n,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let c=l.firstChild;if(!c)return!1;l=c}let u=ts(r.doc,s,a,U.empty);if(!u||u.from!=s||u instanceof Ce&&u.slice.size>=a-s)return!1;if(t){let c=r.tr.step(u);c.setSelection(Q.create(c.doc,s)),t(c.scrollIntoView())}return!0}function jr(r,e,t=!1){for(let n=r;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(t&&n.childCount!=1)return!1}return!1}const id=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=Uo(n)}let o=s&&s.nodeBefore;return!o||!G.isSelectable(o)?!1:(e&&e(r.tr.setSelection(G.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function Uo(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function sd(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset<t.parent.content.size)?null:t}const od=(r,e,t)=>{let n=sd(r,t);if(!n)return!1;let i=Wo(n);if(!i)return!1;let s=i.nodeAfter;if(dd(r,i,e,1))return!0;if(n.parent.content.size==0&&(jr(s,"start")||G.isSelectable(s))){let o=ts(r.doc,n.before(),n.after(),U.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=r.tr.step(o);l.setSelection(jr(s,"start")?te.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):G.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},ld=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset<n.parent.content.size)return!1;s=Wo(n)}let o=s&&s.nodeAfter;return!o||!G.isSelectable(o)?!1:(e&&e(r.tr.setSelection(G.create(r.doc,s.pos)).scrollIntoView()),!0)};function Wo(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){let t=r.node(e);if(r.index(e)+1<t.childCount)return r.doc.resolve(r.after(e+1));if(t.type.spec.isolating)break}return null}const f2=(r,e)=>{let t=r.selection,n=t instanceof G,i;if(n){if(t.node.isTextblock||!ir(r.doc,t.from))return!1;i=t.from}else if(i=es(r.doc,t.from,-1),i==null)return!1;if(e){let s=r.tr.join(i);n&&s.setSelection(G.create(s.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},h2=(r,e)=>{let t=r.selection,n;if(t instanceof G){if(t.node.isTextblock||!ir(r.doc,t.to))return!1;n=t.to}else if(n=es(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},p2=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),s=i&&Ur(i);return s==null?!1:(e&&e(r.tr.lift(i,s).scrollIntoView()),!0)},ad=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(`
16
+ `).scrollIntoView()),!0)};function Ko(r){for(let e=0;e<r.edgeCount;e++){let{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const m2=(r,e)=>{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=Ko(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=r.tr.replaceWith(l,l,o.createAndFill());a.setSelection(te.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},ud=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof tt||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=Ko(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,l=r.tr.insert(o,s.createAndFill());l.setSelection(Q.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},cd=(r,e)=>{let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Lt(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&Ur(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)};function g2(r){return(e,t)=>{if(e.selection instanceof G&&e.selection.node.isBlock){let{$from:h}=e.selection;return!h.parentOffset||!Lt(e.doc,h.pos)?!1:(t&&t(e.tr.split(h.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let n=e.tr;!e.selection.empty&&(e.selection instanceof Q||e.selection instanceof tt)&&n.deleteSelection();let{$from:i}=n.selection,s=n.steps.length,o=[],l,a,u=!1,c=!1;for(let h=i.depth;;h--)if(i.node(h).isBlock){u=i.end(h)==i.pos+(i.depth-h),c=i.start(h)==i.pos-(i.depth-h),a=Ko(i.node(h-1).contentMatchAt(i.indexAfter(h-1))),o.unshift(u&&a?{type:a}:null),l=h;break}else{if(h==1)return!1;o.unshift(null)}let d=i.pos,f=Lt(n.doc,d,o.length,o);if(f||(o[0]=a?{type:a}:null,f=Lt(n.doc,d,o.length,o)),!f)return!1;if(n.split(d,o.length,o),!u&&c&&i.node(l).type!=a){let h=n.mapping.slice(s),m=h.map(i.before(l)),p=n.doc.resolve(m);a&&i.node(l-1).canReplaceWith(p.index(),p.index()+1,a)&&n.setNodeMarkup(h.map(i.before(l)),a)}return t&&t(n.scrollIntoView()),!0}}const y2=g2(),b2=(r,e)=>{let{$from:t,to:n}=r.selection,i,s=t.sharedDepth(n);return s==0?!1:(i=t.before(s),e&&e(r.tr.setSelection(G.create(r.doc,i))),!0)};function k2(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||ir(r.doc,e.pos))?!1:(t&&t(r.tr.join(e.pos).scrollIntoView()),!0)}function dd(r,e,t,n){let i=e.nodeBefore,s=e.nodeAfter,o,l,a=i.type.spec.isolating||s.type.spec.isolating;if(!a&&k2(r,e,t))return!0;let u=!a&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(l=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&l.matchType(o[0]||s.type).validEnd){if(t){let h=e.pos+s.nodeSize,m=$.empty;for(let b=o.length-1;b>=0;b--)m=$.from(o[b].create(null,m));m=$.from(i.copy(m));let p=r.tr.step(new De(e.pos-1,h,e.pos,h,new U(m,1,0),o.length,!0)),g=p.doc.resolve(h+2*o.length);g.nodeAfter&&g.nodeAfter.type==i.type&&ir(p.doc,g.pos)&&p.join(g.pos),t(p.scrollIntoView())}return!0}let c=s.type.spec.isolating||n>0&&a?null:te.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),f=d&&Ur(d);if(f!=null&&f>=e.depth)return t&&t(r.tr.lift(d,f).scrollIntoView()),!0;if(u&&jr(s,"start",!0)&&jr(i,"end")){let h=i,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let p=s,g=1;for(;!p.isTextblock;p=p.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,p.content)){if(t){let b=$.empty;for(let v=m.length-1;v>=0;v--)b=$.from(m[v].copy(b));let E=r.tr.step(new De(e.pos-m.length,e.pos+s.nodeSize,e.pos+g,e.pos+s.nodeSize-g,new U(b,m.length,0),0,!0));t(E.scrollIntoView())}return!0}}return!1}function fd(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(Q.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const v2=fd(-1),x2=fd(1);function C2(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&Io(o,r,e);return l?(n&&n(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Va(r,e=null){return function(t,n){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:l}}=t.selection.ranges[s];t.doc.nodesBetween(o,l,(a,u)=>{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(r,e)))if(a.type==r)i=!0;else{let c=t.doc.resolve(u),d=c.index();i=c.parent.canReplaceWith(d,d+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:a}}=t.selection.ranges[o];s.setBlockType(l,a,r,e)}n(s.scrollIntoView())}return!0}}function Jo(...r){return function(e,t,n){for(let i=0;i<r.length;i++)if(r[i](e,t,n))return!0;return!1}}Jo(Ho,rd,id);Jo(Ho,od,ld);Jo(ad,ud,cd,y2);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function A2(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s);if(!o)return!1;let l=n?t.tr:null;return w2(l,o,r,e)?(n&&n(l.scrollIntoView()),!0):!1}}function w2(r,e,t,n=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);s=new ui(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new ui(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=Io(s,t,n,e);return l?(r&&E2(r,e,l,i,t),!0):!1}function E2(r,e,t,n,i){let s=$.empty;for(let c=t.length-1;c>=0;c--)s=$.from(t[c].type.create(t[c].attrs,s));r.step(new De(e.start-(n?2:0),e.end,e.start,e.end,new U(s,0,0),t.length,!0));let o=0;for(let c=0;c<t.length;c++)t[c].type==i&&(o=c+1);let l=t.length-o,a=e.start+t.length-(n?2:0),u=e.parent;for(let c=e.startIndex,d=e.endIndex,f=!0;c<d;c++,f=!1)!f&&Lt(r.doc,a,l)&&(r.split(a,l),a+=2*l),a+=u.child(c).nodeSize;return r}function S2(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,o=>o.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?D2(e,t,r,s):_2(e,t,s):!0:!1}}function D2(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);s<o&&(i.step(new De(s-1,o,s,o,new U($.from(t.create(null,n.parent.copy())),1,0),1,!0)),n=new ui(i.doc.resolve(n.$from.pos),i.doc.resolve(o),n.depth));const l=Ur(n);if(l==null)return!1;i.lift(n,l);let a=i.doc.resolve(i.mapping.map(s,-1)-1);return ir(i.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&i.join(a.pos),e(i.scrollIntoView()),!0}function _2(r,e,t){let n=r.tr,i=t.parent;for(let h=t.end,m=t.endIndex-1,p=t.startIndex;m>p;m--)h-=i.child(m).nodeSize,n.delete(h-1,h+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(l?0:1),c+1,o.content.append(a?$.empty:$.from(i))))return!1;let d=s.pos,f=d+o.nodeSize;return n.step(new De(d-(l?1:0),f+(a?1:0),d+1,f-1,new U((l?$.empty:$.from(i.copy($.empty))).append(a?$.empty:$.from(i.copy($.empty))),l?0:1,a?0:1),l?0:1)),e(n.scrollIntoView()),!0}function T2(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=r)return!1;if(t){let u=a.lastChild&&a.lastChild.type==l.type,c=$.from(u?r.create():null),d=new U($.from(r.create(null,$.from(l.type.create(null,c)))),u?3:1,0),f=s.start,h=s.end;t(e.tr.step(new De(f-(u?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}function ss(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,s=t.storedMarks,t}}}class ls{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:i}=t,{tr:s}=n,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>{const d=a(...c)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i,l=[],a=!!e,u=e||s.tr,c=()=>(!a&&t&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(n).map(([f,h])=>[f,(...p)=>{const g=this.buildProps(u,t),b=h(...p)(g);return l.push(b),d}])),run:c};return d}createCan(e){const{rawCommands:t,state:n}=this,i=!1,s=e||n.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([a,u])=>[a,(...c)=>u(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i,l={tr:e,editor:i,view:o,state:ss({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,u])=>[a,(...c)=>u(...c)(l)]))}};return l}}class M2{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(i=>i.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(i=>i!==t):delete this.callbacks[e]),this}once(e,t){const n=(...i)=>{this.off(e,n),t.apply(this,i)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}}function J(r,e,t){return r.config[e]===void 0&&r.parent?J(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?J(r.parent,e,t):null}):r.config[e]}function as(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function hd(r){const e=[],{nodeExtensions:t,markExtensions:n}=as(r),i=[...t,...n],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return r.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage,extensions:i},a=J(o,"addGlobalAttributes",l);if(!a)return;a().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([f,h])=>{e.push({type:d,name:f,attribute:{...s,...h}})})})})}),i.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},a=J(o,"addAttributes",l);if(!a)return;const u=a();Object.entries(u).forEach(([c,d])=>{const f={...s,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:o.name,name:c,attribute:f})})}),e}function Te(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}function $e(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}if(i==="class"){const l=s?String(s).split(" "):[],a=n[i]?n[i].split(" "):[],u=l.filter(c=>!a.includes(c));n[i]=[...a,...u].join(" ")}else if(i==="style"){const l=s?s.split(";").map(c=>c.trim()).filter(Boolean):[],a=n[i]?n[i].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;a.forEach(c=>{const[d,f]=c.split(":").map(h=>h.trim());u.set(d,f)}),l.forEach(c=>{const[d,f]=c.split(":").map(h=>h.trim());u.set(d,f)}),n[i]=Array.from(u.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else n[i]=s}),n},{})}function fo(r,e){return e.filter(t=>t.type===r.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(r.attrs)||{}:{[t.name]:r.attrs[t.name]}).reduce((t,n)=>$e(t,n),{})}function pd(r){return typeof r=="function"}function ie(r,e=void 0,...t){return pd(r)?e?r.bind(e)(...t):r(...t):r}function O2(r={}){return Object.keys(r).length===0&&r.constructor===Object}function N2(r){return typeof r!="string"?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):r==="true"?!0:r==="false"?!1:r}function ja(r,e){return"style"in r?r:{...r,getAttrs:t=>{const n=r.getAttrs?r.getAttrs(t):r.attrs;if(n===!1)return!1;const i=e.reduce((s,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(t):N2(t.getAttribute(o.name));return l==null?s:{...s,[o.name]:l}},{});return{...n,...i}}}}function Ha(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>e==="attrs"&&O2(t)?!1:t!=null))}function md(r,e){var t;const n=hd(r),{nodeExtensions:i,markExtensions:s}=as(r),o=(t=i.find(u=>J(u,"topNode")))===null||t===void 0?void 0:t.name,l=Object.fromEntries(i.map(u=>{const c=n.filter(b=>b.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=r.reduce((b,E)=>{const v=J(E,"extendNodeSchema",d);return{...b,...v?v(u):{}}},{}),h=Ha({...f,content:ie(J(u,"content",d)),marks:ie(J(u,"marks",d)),group:ie(J(u,"group",d)),inline:ie(J(u,"inline",d)),atom:ie(J(u,"atom",d)),selectable:ie(J(u,"selectable",d)),draggable:ie(J(u,"draggable",d)),code:ie(J(u,"code",d)),whitespace:ie(J(u,"whitespace",d)),linebreakReplacement:ie(J(u,"linebreakReplacement",d)),defining:ie(J(u,"defining",d)),isolating:ie(J(u,"isolating",d)),attrs:Object.fromEntries(c.map(b=>{var E;return[b.name,{default:(E=b==null?void 0:b.attribute)===null||E===void 0?void 0:E.default}]}))}),m=ie(J(u,"parseHTML",d));m&&(h.parseDOM=m.map(b=>ja(b,c)));const p=J(u,"renderHTML",d);p&&(h.toDOM=b=>p({node:b,HTMLAttributes:fo(b,c)}));const g=J(u,"renderText",d);return g&&(h.toText=g),[u.name,h]})),a=Object.fromEntries(s.map(u=>{const c=n.filter(g=>g.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=r.reduce((g,b)=>{const E=J(b,"extendMarkSchema",d);return{...g,...E?E(u):{}}},{}),h=Ha({...f,inclusive:ie(J(u,"inclusive",d)),excludes:ie(J(u,"excludes",d)),group:ie(J(u,"group",d)),spanning:ie(J(u,"spanning",d)),code:ie(J(u,"code",d)),attrs:Object.fromEntries(c.map(g=>{var b;return[g.name,{default:(b=g==null?void 0:g.attribute)===null||b===void 0?void 0:b.default}]}))}),m=ie(J(u,"parseHTML",d));m&&(h.parseDOM=m.map(g=>ja(g,c)));const p=J(u,"renderHTML",d);return p&&(h.toDOM=g=>p({mark:g,HTMLAttributes:fo(g,c)})),[u.name,h]}));return new Qu({topNode:o,nodes:l,marks:a})}function Os(r,e){return e.nodes[r]||e.marks[r]||null}function Ua(r,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===r.name):e}function Go(r,e){const t=_r.fromSchema(e).serializeFragment(r),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}const I2=(r,e=500)=>{let t="";const n=r.parentOffset;return r.parent.nodesBetween(Math.max(0,n-e),n,(i,s,o,l)=>{var a,u;const c=((u=(a=i.type.spec).toText)===null||u===void 0?void 0:u.call(a,{node:i,pos:s,parent:o,index:l}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,n-s))}),t};function Zo(r){return Object.prototype.toString.call(r)==="[object RegExp]"}class us{constructor(e){this.find=e.find,this.handler=e.handler}}const B2=(r,e)=>{if(Zo(e))return e.exec(r);const t=e(r);if(!t)return null;const n=[t.text];return n.index=t.index,n.input=r,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(t.replaceWith)),n};function Hn(r){var e;const{editor:t,from:n,to:i,text:s,rules:o,plugin:l}=r,{view:a}=t;if(a.composing)return!1;const u=a.state.doc.resolve(n);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let c=!1;const d=I2(u)+s;return o.forEach(f=>{if(c)return;const h=B2(d,f.find);if(!h)return;const m=a.state.tr,p=ss({state:a.state,transaction:m}),g={from:n-(h[0].length-s.length),to:i},{commands:b,chain:E,can:v}=new ls({editor:t,state:p});f.handler({state:p,range:g,match:h,commands:b,chain:E,can:v})===null||!m.steps.length||(m.setMeta(l,{transform:m,from:n,to:i,text:s}),a.dispatch(m),c=!0)}),c}function F2(r){const{editor:e,rules:t}=r,n=new Le({state:{init(){return null},apply(i,s,o){const l=i.getMeta(n);if(l)return l;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:c}=a;typeof c=="string"?c=c:c=Go($.from(c),o.schema);const{from:d}=a,f=d+c.length;Hn({editor:e,from:d,to:f,text:c,rules:t,plugin:n})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,l){return Hn({editor:e,from:s,to:o,text:l,rules:t,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Hn({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:n})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Hn({editor:e,from:o.pos,to:o.pos,text:`
17
+ `,rules:t,plugin:n}):!1}},isInputRules:!0});return n}function R2(r){return Object.prototype.toString.call(r).slice(8,-1)}function Un(r){return R2(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function cs(r,e){const t={...r};return Un(r)&&Un(e)&&Object.keys(e).forEach(n=>{Un(e[n])&&Un(r[n])?t[n]=cs(r[n],e[n]):t[n]=e[n]}),t}class qt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(J(this,"addOptions",{name:this.name}))),this.storage=ie(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qt(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>cs(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new qt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ie(J(t,"addOptions",{name:t.name})),t.storage=ie(J(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===t.name))return!1;const a=o.find(u=>(u==null?void 0:u.type.name)===t.name);return a&&n.removeStoredMark(a),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}}function $2(r){return typeof r=="number"}class P2{constructor(e){this.find=e.find,this.handler=e.handler}}const L2=(r,e,t)=>{if(Zo(e))return[...r.matchAll(e)];const n=e(r,t);return n?n.map(i=>{const s=[i.text];return s.index=i.index,s.input=r,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function z2(r){const{editor:e,state:t,from:n,to:i,rule:s,pasteEvent:o,dropEvent:l}=r,{commands:a,chain:u,can:c}=new ls({editor:e,state:t}),d=[];return t.doc.nodesBetween(n,i,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const p=Math.max(n,m),g=Math.min(i,m+h.content.size),b=h.textBetween(p-m,g-m,void 0,"");L2(b,s.find,o).forEach(v=>{if(v.index===void 0)return;const D=p+v.index+1,x=D+v[0].length,k={from:t.tr.mapping.map(D),to:t.tr.mapping.map(x)},C=s.handler({state:t,range:k,match:v,commands:a,chain:u,can:c,pasteEvent:o,dropEvent:l});d.push(C)})}),d.every(h=>h!==null)}let Wn=null;const q2=r=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",r),t};function V2(r){const{editor:e,rules:t}=r;let n=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:c,from:d,to:f,rule:h,pasteEvt:m})=>{const p=c.tr,g=ss({state:c,transaction:p});if(!(!z2({editor:e,state:g,from:Math.max(d-1,0),to:f.b-1,rule:h,pasteEvent:m,dropEvent:l})||!p.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,p}};return t.map(c=>new Le({view(d){const f=m=>{var p;n=!((p=d.dom.parentElement)===null||p===void 0)&&p.contains(m.target)?d.dom.parentElement:null,n&&(Wn=e)},h=()=>{Wn&&(Wn=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(s=n===d.dom.parentElement,l=f,!s){const h=Wn;h!=null&&h.isEditable&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(d,f)=>{var h;const m=(h=f.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return o=f,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,h)=>{const m=d[0],p=m.getMeta("uiEvent")==="paste"&&!i,g=m.getMeta("uiEvent")==="drop"&&!s,b=m.getMeta("applyPasteRules"),E=!!b;if(!p&&!g&&!E)return;if(E){let{text:x}=b;typeof x=="string"?x=x:x=Go($.from(x),h.schema);const{from:k}=b,C=k+x.length,w=q2(x);return a({rule:c,state:h,from:k,to:{b:C},pasteEvt:w})}const v=f.doc.content.findDiffStart(h.doc.content),D=f.doc.content.findDiffEnd(h.doc.content);if(!(!$2(v)||!D||v===D.b))return a({rule:c,state:h,from:v,to:D,pasteEvt:o})}}))}function j2(r){const e=r.filter((t,n)=>r.indexOf(t)!==n);return Array.from(new Set(e))}class hr{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=hr.resolve(e),this.schema=md(this.extensions,t),this.setupExtensions()}static resolve(e){const t=hr.sort(hr.flatten(e)),n=j2(t.map(i=>i.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},i=J(t,"addExtensions",n);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((n,i)=>{const s=J(n,"priority")||100,o=J(i,"priority")||100;return s>o?-1:s<o?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Os(t.name,this.schema)},i=J(t,"addCommands",n);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=hr.sort([...this.extensions].reverse()),n=[],i=[],s=t.map(o=>{const l={name:o.name,options:o.options,storage:o.storage,editor:e,type:Os(o.name,this.schema)},a=[],u=J(o,"addKeyboardShortcuts",l);let c={};if(o.type==="mark"&&J(o,"exitable",l)&&(c.ArrowRight=()=>qt.handleExit({editor:e,mark:o})),u){const p=Object.fromEntries(Object.entries(u()).map(([g,b])=>[g,()=>b({editor:e})]));c={...c,...p}}const d=u2(c);a.push(d);const f=J(o,"addInputRules",l);Ua(o,e.options.enableInputRules)&&f&&n.push(...f());const h=J(o,"addPasteRules",l);Ua(o,e.options.enablePasteRules)&&h&&i.push(...h());const m=J(o,"addProseMirrorPlugins",l);if(m){const p=m();a.push(...p)}return a}).flat();return[F2({editor:e,rules:n}),...V2({editor:e,rules:i}),...s]}get attributes(){return hd(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=as(this.extensions);return Object.fromEntries(t.filter(n=>!!J(n,"addNodeView")).map(n=>{const i=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:e,type:Te(n.name,this.schema)},o=J(n,"addNodeView",s);if(!o)return[];const l=(a,u,c,d,f)=>{const h=fo(a,i);return o()({node:a,view:u,getPos:c,decorations:d,innerDecorations:f,editor:e,extension:n,HTMLAttributes:h})};return[n.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Os(e.name,this.schema)};e.type==="mark"&&(!((t=ie(J(e,"keepOnSplit",n)))!==null&&t!==void 0)||t)&&this.splittableMarks.push(e.name);const i=J(e,"onBeforeCreate",n),s=J(e,"onCreate",n),o=J(e,"onUpdate",n),l=J(e,"onSelectionUpdate",n),a=J(e,"onTransaction",n),u=J(e,"onFocus",n),c=J(e,"onBlur",n),d=J(e,"onDestroy",n);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}}class We{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(J(this,"addOptions",{name:this.name}))),this.storage=ie(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new We(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>cs(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new We({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ie(J(t,"addOptions",{name:t.name})),t.storage=ie(J(t,"addStorage",{name:t.name,options:t.options})),t}}function gd(r,e,t){const{from:n,to:i}=e,{blockSeparator:s=`
18
+
19
+ `,textSerializers:o={}}=t||{};let l="";return r.nodesBetween(n,i,(a,u,c,d)=>{var f;a.isBlock&&u>n&&(l+=s);const h=o==null?void 0:o[a.type.name];if(h)return c&&(l+=h({node:a,pos:u,parent:c,index:d,range:e})),!1;a.isText&&(l+=(f=a==null?void 0:a.text)===null||f===void 0?void 0:f.slice(Math.max(n,u)-u,i-u))}),l}function yd(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const H2=We.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Le({key:new nt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),l=Math.max(...s.map(c=>c.$to.pos)),a=yd(t);return gd(n,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),U2=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),W2=(r=!1)=>({commands:e})=>e.setContent("",r),K2=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:s,$to:o})=>{r.doc.nodesBetween(s.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:u,mapping:c}=e,d=u.resolve(c.map(a)),f=u.resolve(c.map(a+l.nodeSize)),h=d.blockRange(f);if(!h)return;const m=Ur(h);if(l.type.isTextblock){const{defaultType:p}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,p)}(m||m===0)&&e.lift(h,m)})}),!0},J2=r=>e=>r(e),G2=()=>({state:r,dispatch:e})=>ud(r,e),Z2=(r,e)=>({editor:t,tr:n})=>{const{state:i}=t,s=i.doc.slice(r.from,r.to);n.deleteRange(r.from,r.to);const o=n.mapping.map(e);return n.insert(o,s.content),n.setSelection(new Q(n.doc.resolve(Math.max(o-1,0)))),!0},Y2=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const l=i.before(s),a=i.after(s);r.delete(l,a).scrollIntoView()}return!0}return!1},Q2=r=>({tr:e,state:t,dispatch:n})=>{const i=Te(r,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const a=s.before(o),u=s.after(o);e.delete(a,u).scrollIntoView()}return!0}return!1},X2=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},e1=()=>({state:r,dispatch:e})=>Ho(r,e),t1=()=>({commands:r})=>r.keyboardShortcut("Enter"),r1=()=>({state:r,dispatch:e})=>m2(r,e);function yi(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:Zo(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function bd(r,e,t={}){return r.find(n=>n.type===e&&yi(Object.fromEntries(Object.keys(t).map(i=>[i,n.attrs[i]])),t))}function Wa(r,e,t={}){return!!bd(r,e,t)}function Yo(r,e,t){var n;if(!r||!e)return;let i=r.parent.childAfter(r.parentOffset);if((!i.node||!i.node.marks.some(c=>c.type===e))&&(i=r.parent.childBefore(r.parentOffset)),!i.node||!i.node.marks.some(c=>c.type===e)||(t=t||((n=i.node.marks[0])===null||n===void 0?void 0:n.attrs),!bd([...i.node.marks],e,t)))return;let o=i.index,l=r.start()+i.offset,a=o+1,u=l+i.node.nodeSize;for(;o>0&&Wa([...r.parent.child(o-1).marks],e,t);)o-=1,l-=r.parent.child(o).nodeSize;for(;a<r.parent.childCount&&Wa([...r.parent.child(a).marks],e,t);)u+=r.parent.child(a).nodeSize,a+=1;return{from:l,to:u}}function or(r,e){if(typeof r=="string"){if(!e.marks[r])throw Error(`There is no mark type named '${r}'. Maybe you forgot to add the extension?`);return e.marks[r]}return r}const n1=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const s=or(r,n.schema),{doc:o,selection:l}=t,{$from:a,from:u,to:c}=l;if(i){const d=Yo(a,s,e);if(d&&d.from<=u&&d.to>=c){const f=Q.create(o,d.from,d.to);t.setSelection(f)}}return!0},i1=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n<t.length;n+=1)if(t[n](e))return!0;return!1};function kd(r){return r instanceof Q}function pr(r=0,e=0,t=0){return Math.min(Math.max(r,e),t)}function vd(r,e=null){if(!e)return null;const t=te.atStart(r),n=te.atEnd(r);if(e==="start"||e===!0)return t;if(e==="end")return n;const i=t.from,s=n.to;return e==="all"?Q.create(r,pr(0,i,s),pr(r.content.size,i,s)):Q.create(r,pr(e,i,s),pr(e,i,s))}function Ka(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function bi(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function s1(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const o1=(r=null,e={})=>({editor:t,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(bi()||Ka())&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),s1()&&!bi()&&!Ka()&&n.dom.focus({preventScroll:!0}))})};if(n.hasFocus()&&r===null||r===!1)return!0;if(s&&r===null&&!kd(t.state.selection))return o(),!0;const l=vd(i.doc,r)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},l1=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),a1=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e),xd=r=>{const e=r.childNodes;for(let t=e.length-1;t>=0;t-=1){const n=e[t];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?r.removeChild(n):n.nodeType===1&&xd(n)}return r};function Kn(r){const e=`<body>${r}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return xd(t)}function Cn(r,e,t){if(r instanceof Yt||r instanceof $)return r;t={slice:!0,parseOptions:{},...t};const n=typeof r=="object"&&r!==null,i=typeof r=="string";if(n)try{if(Array.isArray(r)&&r.length>0)return $.fromArray(r.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(r);return t.errorOnInvalidContent&&o.check(),o}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",s),Cn("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,l="";const a=new Qu({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,l=typeof u=="string"?u:u.outerHTML,null)}]}})});if(t.slice?Qt.fromSchema(a).parseSlice(Kn(r),t.parseOptions):Qt.fromSchema(a).parse(Kn(r),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Qt.fromSchema(e);return t.slice?s.parseSlice(Kn(r),t.parseOptions).content:s.parse(Kn(r),t.parseOptions)}return Cn("",e,t)}function u1(r,e,t){const n=r.steps.length-1;if(n<e)return;const i=r.steps[n];if(!(i instanceof Ce||i instanceof De))return;const s=r.mapping.maps[n];let o=0;s.forEach((l,a,u,c)=>{o===0&&(o=c)}),r.setSelection(te.near(r.doc.resolve(o),t))}const c1=r=>!("type"in r),d1=(r,e,t)=>({tr:n,dispatch:i,editor:s})=>{var o;if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const a=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Cn(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(g){a(g)}try{l=Cn(e,s.schema,{parseOptions:u,errorOnInvalidContent:(o=t.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(g){return a(g),!1}let{from:c,to:d}=typeof r=="number"?{from:r,to:r}:{from:r.from,to:r.to},f=!0,h=!0;if((c1(l)?l:[l]).forEach(g=>{g.check(),f=f?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),c===d&&h){const{parent:g}=n.doc.resolve(c);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(c-=1,d+=1)}let p;if(f){if(Array.isArray(e))p=e.map(g=>g.text||"").join("");else if(e instanceof $){let g="";e.forEach(b=>{b.text&&(g+=b.text)}),p=g}else typeof e=="object"&&e&&e.text?p=e.text:p=e;n.insertText(p,c,d)}else p=l,n.replaceWith(c,d,p);t.updateSelection&&u1(n,n.steps.length-1,-1),t.applyInputRules&&n.setMeta("applyInputRules",{from:c,text:p}),t.applyPasteRules&&n.setMeta("applyPasteRules",{from:c,text:p})}return!0},f1=()=>({state:r,dispatch:e})=>f2(r,e),h1=()=>({state:r,dispatch:e})=>h2(r,e),p1=()=>({state:r,dispatch:e})=>rd(r,e),m1=()=>({state:r,dispatch:e})=>od(r,e),g1=()=>({state:r,dispatch:e,tr:t})=>{try{const n=es(r.doc,r.selection.$from.pos,-1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},y1=()=>({state:r,dispatch:e,tr:t})=>{try{const n=es(r.doc,r.selection.$from.pos,1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},b1=()=>({state:r,dispatch:e})=>c2(r,e),k1=()=>({state:r,dispatch:e})=>d2(r,e);function Cd(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function v1(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,s,o;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))bi()||Cd()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return n&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),o&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}const x1=r=>({editor:e,view:t,tr:n,dispatch:i})=>{const s=v1(r).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",u=>u(t,l))});return a==null||a.steps.forEach(u=>{const c=u.map(n.mapping);c&&i&&n.maybeStep(c)}),!0};function An(r,e,t={}){const{from:n,to:i,empty:s}=r.selection,o=e?Te(e,r.schema):null,l=[];r.doc.nodesBetween(n,i,(d,f)=>{if(d.isText)return;const h=Math.max(n,f),m=Math.min(i,f+d.nodeSize);l.push({node:d,from:h,to:m})});const a=i-n,u=l.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>yi(d.node.attrs,t,{strict:!1}));return s?!!u.length:u.reduce((d,f)=>d+f.to-f.from,0)>=a}const C1=(r,e={})=>({state:t,dispatch:n})=>{const i=Te(r,t.schema);return An(t,i,e)?p2(t,n):!1},A1=()=>({state:r,dispatch:e})=>cd(r,e),w1=r=>({state:e,dispatch:t})=>{const n=Te(r,e.schema);return S2(n)(e,t)},E1=()=>({state:r,dispatch:e})=>ad(r,e);function ds(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function Ja(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}const S1=(r,e)=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=ds(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=Te(r,n.schema)),l==="mark"&&(o=or(r,n.schema)),i&&t.selection.ranges.forEach(a=>{n.doc.nodesBetween(a.$from.pos,a.$to.pos,(u,c)=>{s&&s===u.type&&t.setNodeMarkup(c,void 0,Ja(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(d=>{o===d.type&&t.addMark(c,c+u.nodeSize,o.create(Ja(d.attrs,e)))})})}),!0):!1},D1=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),_1=()=>({tr:r,dispatch:e})=>{if(e){const t=new tt(r.doc);r.setSelection(t)}return!0},T1=()=>({state:r,dispatch:e})=>id(r,e),M1=()=>({state:r,dispatch:e})=>ld(r,e),O1=()=>({state:r,dispatch:e})=>b2(r,e),N1=()=>({state:r,dispatch:e})=>x2(r,e),I1=()=>({state:r,dispatch:e})=>v2(r,e);function ho(r,e,t={},n={}){return Cn(r,e,{slice:!1,parseOptions:t,errorOnInvalidContent:n.errorOnInvalidContent})}const B1=(r,e=!1,t={},n={})=>({editor:i,tr:s,dispatch:o,commands:l})=>{var a,u;const{doc:c}=s;if(t.preserveWhitespace!=="full"){const d=ho(r,i.schema,t,{errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:i.options.enableContentCheck});return o&&s.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!e),!0}return o&&s.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:c.content.size},r,{parseOptions:t,errorOnInvalidContent:(u=n.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function Ad(r,e){const t=or(e,r.schema),{from:n,to:i,empty:s}=r.selection,o=[];s?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function F1(r,e){const t=new pc(r);return e.forEach(n=>{n.steps.forEach(i=>{t.step(i)})}),t}function R1(r){for(let e=0;e<r.edgeCount;e+=1){const{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function $1(r,e,t){const n=[];return r.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&n.push({node:i,pos:s})}),n}function P1(r,e){for(let t=r.depth;t>0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function Qo(r){return e=>P1(e.$from,r)}function L1(r,e){const t=hr.resolve(r);return md(t,e)}function z1(r,e){const t={from:0,to:r.content.size};return gd(r,t,e)}function q1(r,e){const t=Te(e,r.schema),{from:n,to:i}=r.selection,s=[];r.doc.nodesBetween(n,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function wd(r,e){const t=ds(typeof e=="string"?e:e.name,r.schema);return t==="node"?q1(r,e):t==="mark"?Ad(r,e):{}}function V1(r,e=JSON.stringify){const t={};return r.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function j1(r){const e=V1(r);return e.length===1?e:e.filter((t,n)=>!e.filter((s,o)=>o!==n).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function H1(r){const{mapping:e,steps:t}=r,n=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=t[s];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const u=e.slice(s).map(l,-1),c=e.slice(s).map(a),d=e.invert().map(u,-1),f=e.invert().map(c);n.push({oldRange:{from:d,to:f},newRange:{from:u,to:c}})})}),j1(n)}function Xo(r,e,t){const n=[];return r===e?t.resolve(r).marks().forEach(i=>{const s=t.resolve(r),o=Yo(s,i.type);o&&n.push({mark:i,...o})}):t.nodesBetween(r,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),n}function ri(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}function po(r,e,t={}){const{empty:n,ranges:i}=r.selection,s=e?or(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>yi(d.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:d,$to:f})=>{const h=d.pos,m=f.pos;r.doc.nodesBetween(h,m,(p,g)=>{if(!p.isText&&!p.marks.length)return;const b=Math.max(h,g),E=Math.min(m,g+p.nodeSize),v=E-b;o+=v,l.push(...p.marks.map(D=>({mark:D,from:b,to:E})))})}),o===0)return!1;const a=l.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>yi(d.mark.attrs,t,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),u=l.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+u:a)>=o}function U1(r,e,t={}){if(!e)return An(r,null,t)||po(r,null,t);const n=ds(e,r.schema);return n==="node"?An(r,e,t):n==="mark"?po(r,e,t):!1}function Ga(r,e){const{nodeExtensions:t}=as(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=ie(J(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function el(r,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var n;if(t){if(r.type.name==="hardBreak")return!0;if(r.isText)return/^\s*$/m.test((n=r.text)!==null&&n!==void 0?n:"")}if(r.isText)return!r.text;if(r.isAtom||r.isLeaf)return!1;if(r.content.childCount===0)return!0;if(e){let i=!0;return r.content.forEach(s=>{i!==!1&&(el(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function W1(r){return r instanceof G}function K1(r,e,t){var n;const{selection:i}=e;let s=null;if(kd(i)&&(s=i.$cursor),s){const l=(n=r.storedMarks)!==null&&n!==void 0?n:s.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:l,$to:a})=>{let u=l.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(l.pos,a.pos,(c,d,f)=>{if(u)return!1;if(c.isInline){const h=!f||f.type.allowsMarkType(t),m=!!t.isInSet(c.marks)||!c.marks.some(p=>p.type.excludes(t));u=h&&m}return!u}),u})}const J1=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=or(r,n.schema);if(i)if(o){const u=Ad(n,a);t.addStoredMark(a.create({...u,...e}))}else l.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;n.doc.nodesBetween(c,d,(f,h)=>{const m=Math.max(h,c),p=Math.min(h+f.nodeSize,d);f.marks.find(b=>b.type===a)?f.marks.forEach(b=>{a===b.type&&t.addMark(m,p,a.create({...b.attrs,...e}))}):t.addMark(m,p,a.create(e))})});return K1(n,t,a)},G1=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),Z1=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const s=Te(r,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>Va(s,{...o,...e})(t)?!0:l.clearNodes()).command(({state:l})=>Va(s,{...o,...e})(l,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Y1=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=pr(r,0,n.content.size),s=G.create(n,i);e.setSelection(s)}return!0},Q1=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:s}=typeof r=="number"?{from:r,to:r}:r,o=Q.atStart(n).from,l=Q.atEnd(n).to,a=pr(i,o,l),u=pr(s,o,l),c=Q.create(n,a,u);e.setSelection(c)}return!0},X1=r=>({state:e,dispatch:t})=>{const n=Te(r,e.schema);return T2(n)(e,t)};function Za(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e==null?void 0:e.includes(i.type.name));r.tr.ensureMarks(n)}}const ey=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,u=i.extensionManager.attributes,c=ri(u,l.node().type.name,l.node().attrs);if(s instanceof G&&s.node.isBlock)return!l.parentOffset||!Lt(o,l.pos)?!1:(n&&(r&&Za(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:R1(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=d&&f?[{type:f,attrs:c}]:void 0,m=Lt(e.doc,e.mapping.map(l.pos),1,h);if(!h&&!m&&Lt(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:c}]:void 0),n){if(m&&(s instanceof Q&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const p=e.mapping.map(l.before()),g=e.doc.resolve(p);l.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}r&&Za(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},ty=(r,e={})=>({tr:t,state:n,dispatch:i,editor:s})=>{var o;const l=Te(r,n.schema),{$from:a,$to:u}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(u))return!1;const d=a.node(-1);if(d.type!==l)return!1;const f=s.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let b=$.empty;const E=a.index(-1)?1:a.index(-2)?2:3;for(let w=a.depth-E;w>=a.depth-3;w-=1)b=$.from(a.node(w).copy(b));const v=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,D={...ri(f,a.node().type.name,a.node().attrs),...e},x=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(D))||void 0;b=b.append($.from(l.createAndFill(null,x)||void 0));const k=a.before(a.depth-(E-1));t.replace(k,a.after(-v),new U(b,4-E,0));let C=-1;t.doc.nodesBetween(k,t.doc.content.size,(w,I)=>{if(C>-1)return!1;w.isTextblock&&w.content.size===0&&(C=I+1)}),C>-1&&t.setSelection(Q.near(t.doc.resolve(C))),t.scrollIntoView()}return!0}const h=u.pos===a.end()?d.contentMatchAt(0).defaultType:null,m={...ri(f,d.type.name,d.attrs),...e},p={...ri(f,a.node().type.name,a.node().attrs),...e};t.delete(a.pos,u.pos);const g=h?[{type:l,attrs:m},{type:h,attrs:p}]:[{type:l,attrs:m}];if(!Lt(t.doc,a.pos,2))return!1;if(i){const{selection:b,storedMarks:E}=n,{splittableMarks:v}=s.extensionManager,D=E||b.$to.parentOffset&&b.$from.marks();if(t.split(a.pos,2,g).scrollIntoView(),!D||!i)return!0;const x=D.filter(k=>v.includes(k.type.name));t.ensureMarks(x)}return!0},Ns=(r,e)=>{const t=Qo(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&ir(r.doc,t.pos)&&r.join(t.pos),!0},Is=(r,e)=>{const t=Qo(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&ir(r.doc,n)&&r.join(n),!0},ry=(r,e,t,n={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:u,can:c})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,h=Te(r,o.schema),m=Te(e,o.schema),{selection:p,storedMarks:g}=o,{$from:b,$to:E}=p,v=b.blockRange(E),D=g||p.$to.parentOffset&&p.$from.marks();if(!v)return!1;const x=Qo(k=>Ga(k.type.name,d))(p);if(v.depth>=1&&x&&v.depth-x.depth<=1){if(x.node.type===h)return u.liftListItem(m);if(Ga(x.node.type.name,d)&&h.validContent(x.node.content)&&l)return a().command(()=>(s.setNodeMarkup(x.pos,h),!0)).command(()=>Ns(s,h)).command(()=>Is(s,h)).run()}return!t||!D||!l?a().command(()=>c().wrapInList(h,n)?!0:u.clearNodes()).wrapInList(h,n).command(()=>Ns(s,h)).command(()=>Is(s,h)).run():a().command(()=>{const k=c().wrapInList(h,n),C=D.filter(w=>f.includes(w.type.name));return s.ensureMarks(C),k?!0:u.clearNodes()}).wrapInList(h,n).command(()=>Ns(s,h)).command(()=>Is(s,h)).run()},ny=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=or(r,n.schema);return po(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},iy=(r,e,t={})=>({state:n,commands:i})=>{const s=Te(r,n.schema),o=Te(e,n.schema),l=An(n,s,t);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),l?i.setNode(o,a):i.setNode(s,{...a,...t})},sy=(r,e={})=>({state:t,commands:n})=>{const i=Te(r,t.schema);return An(t,i,e)?n.lift(i):n.wrapIn(i,e)},oy=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n<t.length;n+=1){const i=t[n];let s;if(i.spec.isInputRules&&(s=i.getState(r))){if(e){const o=r.tr,l=s.transform;for(let a=l.steps.length-1;a>=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},ly=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(s=>{r.removeMark(s.$from.pos,s.$to.pos)}),!0},ay=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=or(r,n.schema),{$from:u,empty:c,ranges:d}=l;if(!i)return!0;if(c&&o){let{from:f,to:h}=l;const m=(s=u.marks().find(g=>g.type===a))===null||s===void 0?void 0:s.attrs,p=Yo(u,a,m);p&&(f=p.from,h=p.to),t.removeMark(f,h,a)}else d.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,a)});return t.removeStoredMark(a),!0},uy=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=ds(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=Te(r,n.schema)),l==="mark"&&(o=or(r,n.schema)),i&&t.selection.ranges.forEach(a=>{const u=a.$from.pos,c=a.$to.pos;let d,f,h,m;t.selection.empty?n.doc.nodesBetween(u,c,(p,g)=>{s&&s===p.type&&(h=Math.max(g,u),m=Math.min(g+p.nodeSize,c),d=g,f=p)}):n.doc.nodesBetween(u,c,(p,g)=>{g<u&&s&&s===p.type&&(h=Math.max(g,u),m=Math.min(g+p.nodeSize,c),d=g,f=p),g>=u&&g<=c&&(s&&s===p.type&&t.setNodeMarkup(g,void 0,{...p.attrs,...e}),o&&p.marks.length&&p.marks.forEach(b=>{if(o===b.type){const E=Math.max(g,u),v=Math.min(g+p.nodeSize,c);t.addMark(E,v,o.create({...b.attrs,...e}))}}))}),f&&(d!==void 0&&t.setNodeMarkup(d,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(p=>{o===p.type&&t.addMark(h,m,o.create({...p.attrs,...e}))}))}),!0):!1},cy=(r,e={})=>({state:t,dispatch:n})=>{const i=Te(r,t.schema);return C2(i,e)(t,n)},dy=(r,e={})=>({state:t,dispatch:n})=>{const i=Te(r,t.schema);return A2(i,e)(t,n)};var fy=Object.freeze({__proto__:null,blur:U2,clearContent:W2,clearNodes:K2,command:J2,createParagraphNear:G2,cut:Z2,deleteCurrentNode:Y2,deleteNode:Q2,deleteRange:X2,deleteSelection:e1,enter:t1,exitCode:r1,extendMarkRange:n1,first:i1,focus:o1,forEach:l1,insertContent:a1,insertContentAt:d1,joinBackward:p1,joinDown:h1,joinForward:m1,joinItemBackward:g1,joinItemForward:y1,joinTextblockBackward:b1,joinTextblockForward:k1,joinUp:f1,keyboardShortcut:x1,lift:C1,liftEmptyBlock:A1,liftListItem:w1,newlineInCode:E1,resetAttributes:S1,scrollIntoView:D1,selectAll:_1,selectNodeBackward:T1,selectNodeForward:M1,selectParentNode:O1,selectTextblockEnd:N1,selectTextblockStart:I1,setContent:B1,setMark:J1,setMeta:G1,setNode:Z1,setNodeSelection:Y1,setTextSelection:Q1,sinkListItem:X1,splitBlock:ey,splitListItem:ty,toggleList:ry,toggleMark:ny,toggleNode:iy,toggleWrap:sy,undoInputRule:oy,unsetAllMarks:ly,unsetMark:ay,updateAttributes:uy,wrapIn:cy,wrapInList:dy});const hy=We.create({name:"commands",addCommands(){return{...fy}}}),py=We.create({name:"drop",addProseMirrorPlugins(){return[new Le({key:new nt("tiptapDrop"),props:{handleDrop:(r,e,t,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:n})}}})]}}),my=We.create({name:"editable",addProseMirrorPlugins(){return[new Le({key:new nt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),gy=new nt("focusEvents"),yy=We.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new Le({key:gy,props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),by=We.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:u}=l,{empty:c,$anchor:d}=a,{pos:f,parent:h}=d,m=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,p=m.parent.type.spec.isolating,g=d.pos-d.parentOffset,b=p&&m.parent.childCount===1?g===d.pos:te.atStart(u).from===f;return!c||!h.type.isTextblock||h.textContent.length||!b||b&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return bi()||Cd()?s:i},addProseMirrorPlugins(){return[new Le({key:new nt("clearDocument"),appendTransaction:(r,e,t)=>{if(r.some(p=>p.getMeta("composition")))return;const n=r.some(p=>p.docChanged)&&!e.doc.eq(t.doc),i=r.some(p=>p.getMeta("preventClearDocument"));if(!n||i)return;const{empty:s,from:o,to:l}=e.selection,a=te.atStart(e.doc).from,u=te.atEnd(e.doc).to;if(s||!(o===a&&l===u)||!el(t.doc))return;const f=t.tr,h=ss({state:t,transaction:f}),{commands:m}=new ls({editor:this.editor,state:h});if(m.clearNodes(),!!f.steps.length)return f}})]}}),ky=We.create({name:"paste",addProseMirrorPlugins(){return[new Le({key:new nt("tiptapPaste"),props:{handlePaste:(r,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),vy=We.create({name:"tabindex",addProseMirrorPlugins(){return[new Le({key:new nt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class cr{get name(){return this.node.type.name}constructor(e,t,n=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new cr(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new cr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new cr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,n)=>{const i=t.isBlock&&!t.isTextblock,s=t.isAtom&&!t.isText,o=this.pos+n+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(o);if(!i&&l.depth<=this.depth)return;const a=new cr(l,this.editor,i,i?t:null);i&&(a.actualDepth=this.depth+1),e.push(new cr(l,this.editor,i,i?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,i=this.parent;for(;i&&!n;){if(i.node.type.name===e)if(Object.keys(t).length>0){const s=i.node.attrs,o=Object.keys(t);for(let l=0;l<o.length;l+=1){const a=o[l];if(s[a]!==t[a])break}}else n=i;i=i.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(t);return this.children.forEach(o=>{n&&i.length>0||(o.node.type.name===e&&s.every(a=>t[a]===o.node.attrs[a])&&i.push(o),!(n&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,t,n))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}}const xy=`.ProseMirror {
20
20
  position: relative;
21
21
  }
22
22
 
@@ -90,14 +90,14 @@ img.ProseMirror-separator {
90
90
 
91
91
  .tippy-box[data-animation=fade][data-state=hidden] {
92
92
  opacity: 0
93
- }`;function fy(r,e,t){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(i),i}let hy=class extends v2{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:t,slice:n,moved:i})=>this.options.onDrop(t,n,i)),this.on("paste",({event:t,slice:n})=>this.options.onPaste(t,n)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=fy(dy,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=hd(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:n});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;n=n.filter(l=>!l.key.startsWith(o))}),t.length===n.length)return;const i=this.state.reconfigure({plugins:n});return this.view.updateState(i),i}createExtensionManager(){var e,t;const i=[...this.options.enableCoreExtensions?[sy,F2.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),ny,ly,ay,cy,iy,uy].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new Fr(i,this)}createCommandManager(){this.commandManager=new ss({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let t;try{t=co(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(l=>l.name!=="collaboration"),this.createExtensionManager()}}),t=co(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=bd(t,this.options.autofocus);this.view=new Qc(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Br.create({doc:t,selection:n||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const s=this.view.dom;s.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(o)});return}const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Cd(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return F1(this.state,n,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Jo(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
94
-
95
- `,textSerializers:n={}}=e||{};return M1(this.state.doc,{blockSeparator:t,textSerializers:{...md(this.schema),...n}})}get isEmpty(){return Xo(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new cr(t,this)}get $doc(){return this.$pos(0)}};function jr(r){return new as({find:r.find,handler:({state:e,range:t,match:n})=>{const i=ie(r.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];if(o){const a=l.search(/\S/),u=t.from+l.indexOf(o),c=u+o.length;if(Qo(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(p=>p===r.type&&p!==h.mark.type)).filter(h=>h.to>u).length)return null;c<t.to&&s.delete(c,t.to),u>t.from&&s.delete(t.from+a,u);const f=t.from+a+o.length;s.addMark(t.from+a,f,r.type.create(i||{})),s.removeStoredMark(r.type)}}})}function py(r){return new as({find:r.find,handler:({state:e,range:t,match:n})=>{const i=ie(r.getAttributes,void 0,n)||{},{tr:s}=e,o=t.from;let l=t.to;const a=r.type.create(i);if(n[1]){const u=n[0].lastIndexOf(n[1]);let c=o+u;c>l?c=l:l=c+n[1].length;const d=n[0][n[0].length-1];s.insertText(d,o+n[0].length-1),s.replaceWith(c,l,a)}else if(n[0]){const u=r.type.isInline?o:o-1;s.insert(u,r.type.create(i)).delete(s.mapping.map(o),s.mapping.map(l))}s.scrollIntoView()}})}function ho(r){return new as({find:r.find,handler:({state:e,range:t,match:n})=>{const i=e.doc.resolve(t.from),s=ie(r.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),r.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,r.type,s)}})}function Cn(r){return new as({find:r.find,handler:({state:e,range:t,match:n,chain:i})=>{const s=ie(r.getAttributes,void 0,n)||{},o=e.tr.delete(t.from,t.to),a=o.doc.resolve(t.from).blockRange(),u=a&&No(a,r.type,s);if(!u)return null;if(o.wrap(a,u),r.keepMarks&&r.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:h}=r.editor.extensionManager,m=f||d.$to.parentOffset&&d.$from.marks();if(m){const p=m.filter(g=>h.includes(g.type.name));o.ensureMarks(p)}}if(r.keepAttributes){const d=r.type.name==="bulletList"||r.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,s).run()}const c=o.doc.resolve(t.from-1).nodeBefore;c&&c.type===r.type&&ir(o.doc,t.from-1)&&(!r.joinPredicate||r.joinPredicate(n,c))&&o.join(t.from-1)}})}let bt=class po{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(J(this,"addOptions",{name:this.name}))),this.storage=ie(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new po(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>us(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new po(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ie(J(t,"addOptions",{name:t.name})),t.storage=ie(J(t,"addStorage",{name:t.name,options:t.options})),t}};function Sr(r){return new T2({find:r.find,handler:({state:e,range:t,match:n,pasteEvent:i})=>{const s=ie(r.getAttributes,void 0,n,i);if(s===!1||s===null)return null;const{tr:o}=e,l=n[n.length-1],a=n[0];let u=t.to;if(l){const c=a.search(/\S/),d=t.from+a.indexOf(l),f=d+l.length;if(Qo(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(g=>g===r.type&&g!==m.mark.type)).filter(m=>m.to>d).length)return null;f<t.to&&o.delete(f,t.to),d>t.from&&o.delete(t.from+c,d),u=t.from+c+l.length,o.addMark(t.from+c,u,r.type.create(s||{})),o.removeStoredMark(r.type)}}})}function my(r,e){const{selection:t}=r,{$from:n}=t;if(t instanceof G){const s=n.index();return n.parent.canReplaceWith(s,s+1,e)}let i=n.depth;for(;i>=0;){const s=n.index(i);if(n.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function Za(r){return _h((e,t)=>({get(){return e(),r},set(n){r=n,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}class gy extends hy{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Za(this.view.state),this.reactiveExtensionStorage=Za(this.extensionStorage),this.on("beforeTransaction",({nextState:t})=>{this.reactiveState.value=t,this.reactiveExtensionStorage.value=this.extensionStorage}),Sh(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){const n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}}const yy=Pe({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(r){const e=je(),t=Th();return Eh(()=>{const n=r.editor;n&&n.options.element&&e.value&&Ou(()=>{if(!e.value||!n.options.element.firstChild)return;const i=N(e.value);e.value.append(...n.options.element.childNodes),n.contentComponent=t.ctx._,t&&(n.appContext={...t.appContext,provides:t.provides}),n.setOptions({element:i}),n.createNodeViews()})}),Yi(()=>{const n=r.editor;n&&(n.contentComponent=null,n.appContext=null)}),{rootEl:e}},render(){return wh("div",{ref:r=>{this.rootEl=r}})}}),by=(r={})=>{const e=Dh();return To(()=>{e.value=new gy(r)}),Yi(()=>{var t,n,i;const s=(t=e.value)===null||t===void 0?void 0:t.options.element,o=s==null?void 0:s.cloneNode(!0);(n=s==null?void 0:s.parentNode)===null||n===void 0||n.replaceChild(o,s),(i=e.value)===null||i===void 0||i.destroy()}),e};var ky=Object.create,el=Object.defineProperty,vy=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,xy=Object.getPrototypeOf,Cy=Object.prototype.hasOwnProperty,U=(r,e)=>function(){return e||(0,r[Ad(r)[0]])((e={exports:{}}).exports,e),e.exports},wd=(r,e)=>{for(var t in e)el(r,t,{get:e[t],enumerable:!0})},Ay=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ad(e))!Cy.call(r,i)&&i!==t&&el(r,i,{get:()=>e[i],enumerable:!(n=vy(e,i))||n.enumerable});return r},ds=(r,e,t)=>(t=r!=null?ky(xy(r)):{},Ay(!r||!r.__esModule?el(t,"default",{value:r,enumerable:!0}):t,r)),Ed=U({"src/grammar/tag.js"(r,e){function t(s,o){function l(){this.constructor=s}l.prototype=o.prototype,s.prototype=new l}function n(s,o,l,a){this.message=s,this.expected=o,this.found=l,this.location=a,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,n)}t(n,Error),n.buildMessage=function(s,o,l){var a={literal:function(p){return'"'+c(p.text)+'"'},class:function(p){var g=p.parts.map(function(y){return Array.isArray(y)?d(y[0])+"-"+d(y[1]):d(y)});return"["+(p.inverted?"^":"")+g+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(p){return p.description},not:function(p){return"not "+f(p.expected)}};function u(p){return p.charCodeAt(0).toString(16).toUpperCase()}function c(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+u(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+u(g)})}function d(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+u(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+u(g)})}function f(p){return a[p.type](p)}function h(p){var g=p.map(f),y,x;if(g.sort(),g.length>0){for(y=1,x=1;y<g.length;y++)g[y-1]!==g[y]&&(g[x]=g[y],x++);g.length=x}switch(g.length){case 1:return g[0];case 2:return g[0]+" or "+g[1];default:return g.slice(0,-1).join(", ")+", or "+g[g.length-1]}}function m(p){return p?'"'+c(p)+'"':"end of input"}return"Expected "+h(s)+" but "+m(o)+" found."};function i(s,o){o=o!==void 0?o:{};var l={},a={Top:El},u=El,c="/",d=".",f="#",h="=",m="(",p=")",g=",",y="[",x="]",k="null",A="true",v="false",S="{",D="}",_=":",$='"',T="\\",I="n",O="r",q="t",B=/^[$@]/,F=/^[0-9]/,V=/^[^\0-\x1F"\\]/,Z=/^[a-zA-Z0-9_\-]/,re=/^[ \n\t]/,ce=kt("/",!1),ye=vt("tag name"),Se=vt("class"),ae=vt("id"),be=kt("=",!1),Me=kt("(",!1),Oe=kt(")",!1),Ke=kt(",",!1),ht=vt("variable"),_t=vt("null"),lr=vt("boolean"),In=kt("[",!1),df=kt("]",!1),ff=kt("{",!1),hf=kt("}",!1),pf=kt(":",!1),mf=vt("number"),gf=vt("string"),yf=vt("identifier"),bf=vt("whitespace"),kf=function(b){return{type:"variable",meta:{variable:b}}},vf=function(b){return{type:"annotation",meta:{attributes:b}}},xf=function(b,C){return C},Cf=function(b,C,E,M){C&&(E=E||[],E.unshift({type:"attribute",name:"primary",value:C}));const[P,K]=M?["tag",0]:["tag_open",1];return{type:P,nesting:K,meta:{tag:b,attributes:E}}},Af=function(b){return{type:"tag_close",nesting:-1,meta:{tag:b}}},wf=function(b,C){return b?[b,...C]:[]},xl=function(b){return b},Ef=function(b){return b},Sf=function(b){return b},Df=function(b){return b},_f=function(b){return{type:"class",name:b,value:!0}},Tf=function(b){return{type:"attribute",name:"id",value:b}},Mf=function(b,C){return{type:"attribute",name:b,value:C}},Of=function(b,C,E){return C?[C,...E]:[]},Nf=function(b,C){let E={};for(let[M,{name:P,value:K}]of C.entries())E[P||M]=K;return new ph(b,E)},Cl=function(b){return b},If=function(b,C){return{name:b,value:C}},ms=function(b){return b},Bf=function(b,C,E){return b==="@"?[C,...E]:new hh([C,...E])},Ff=function(){return null},Rf=function(){return!0},$f=function(){return!1},Pf=function(b,C){return[b,...C]},Lf=function(b){return b||[]},zf=function(b,C){return Object.assign(b,...C)},qf=function(b){return b||{}},Vf=function(b,C){return b==="$$mdtype"?{}:{[b]:C}},jf=function(){return parseFloat(Gf())},Hf=function(b){return b.join("")},Uf=function(){return`
96
- `},Wf=function(){return"\r"},Kf=function(){return" "},Jf=function(b){return b},w=0,se=0,Bn=[{line:1,column:1}],Fn=[],X=0,Rn;if("startRule"in o){if(!(o.startRule in a))throw new Error(`Can't start parsing from rule "`+o.startRule+'".');u=a[o.startRule]}function Gf(){return s.substring(se,w)}function kt(b,C){return{type:"literal",text:b,ignoreCase:C}}function Zf(){return{type:"end"}}function vt(b){return{type:"other",description:b}}function Al(b){var C=Bn[b],E;if(C)return C;for(E=b-1;!Bn[E];)E--;for(C=Bn[E],C={line:C.line,column:C.column};E<b;)s.charCodeAt(E)===10?(C.line++,C.column=1):C.column++,E++;return Bn[b]=C,C}var Yf=typeof o.filename=="string"&&o.filename.length>0;function wl(b,C){var E={};Yf&&(E.filename=o.filename);var M=Al(b);E.start={offset:b,line:M.line,column:M.column};var P=Al(C);return E.end={offset:C,line:P.line,column:P.column},E}function Qf(){Fn.push({pos:w,variants:[]})}function pe(b){var C=Fn[Fn.length-1];w<C.pos||(w>C.pos&&(C.pos=w,C.variants=[]),C.variants.push(b))}function Xf(b,C,E){return new n(n.buildMessage(b,C,E),b,C,E)}function eh(){var b=Fn[0],C=b.pos;return Xf(b.variants,C<s.length?s.charAt(C):null,C<s.length?wl(C,C+1):wl(C,C))}function El(){var b;return b=th(),b===l&&(b=rh(),b===l&&(b=nh(),b===l&&(b=ih()))),b}function th(){var b,C;return b=w,C=Bl(),C===l&&(C=Ml()),C!==l&&(se=b,C=kf(C)),b=C,b}function rh(){var b,C,E,M;if(b=w,C=Dl(),C!==l){for(E=[],M=le();M!==l;)E.push(M),M=le();se=b,b=vf(C)}else w=b,b=l;return b}function nh(){var b,C,E,M,P,K,oe,Je=function(Vt){X===0&&pe(Vt)};if(b=w,C=Sl(),C!==l){for(E=[],M=le();M!==l;)E.push(M),M=le();for(M=w,P=_r(),P!==l?(K=le(),K===l&&(K=null),se=M,M=xf(C,P)):(w=M,M=l),M===l&&(M=null),P=Dl(),P===l&&(P=null),K=[],oe=le();oe!==l;)K.push(oe),oe=le();Je(ce),s.charCodeAt(w)===47?(oe=c,w++):oe=l,oe===l&&(oe=null),se=b,b=Cf(C,M,P,oe)}else w=b,b=l;return b}function ih(){var b,C,E,M=function(P){X===0&&pe(P)};return b=w,M(ce),s.charCodeAt(w)===47?(C=c,w++):C=l,C!==l?(E=Sl(),E!==l?(se=b,b=Af(E)):(w=b,b=l)):(w=b,b=l),b}function Sl(){var b,C=function(E){X===0&&pe(E)};return C(ye),X++,b=Tt(),X--,b}function Dl(){var b,C,E,M;if(b=w,C=Tl(),C!==l){for(E=[],M=_l();M!==l;)E.push(M),M=_l();se=b,b=wf(C,E)}else w=b,b=l;return b}function _l(){var b,C,E;if(b=w,C=[],E=le(),E!==l)for(;E!==l;)C.push(E),E=le();else C=l;return C!==l?(E=Tl(),E!==l?(se=b,b=xl(E)):(w=b,b=l)):(w=b,b=l),b}function Tl(){var b,C;return b=w,C=oh(),C!==l&&(se=b,C=Ef(C)),b=C,b===l&&(b=w,C=sh(),C!==l&&(se=b,C=Sf(C)),b=C,b===l&&(b=w,C=lh(),C!==l&&(se=b,C=Df(C)),b=C)),b}function sh(){var b,C,E,M=function(P){X===0&&pe(P)};return M(Se),X++,b=w,s.charCodeAt(w)===46?(C=d,w++):C=l,C!==l?(E=Tt(),E!==l?(se=b,b=_f(E)):(w=b,b=l)):(w=b,b=l),X--,b}function oh(){var b,C,E,M=function(P){X===0&&pe(P)};return M(ae),X++,b=w,s.charCodeAt(w)===35?(C=f,w++):C=l,C!==l?(E=Tt(),E!==l?(se=b,b=Tf(E)):(w=b,b=l)):(w=b,b=l),X--,b}function lh(){var b,C,E,M,P=function(K){X===0&&pe(K)};return b=w,C=Tt(),C!==l?(P(be),s.charCodeAt(w)===61?(E=h,w++):E=l,E!==l?(M=_r(),M!==l?(se=b,b=Mf(C,M)):(w=b,b=l)):(w=b,b=l)):(w=b,b=l),b}function Ml(){var b,C,E,M,P,K,oe,Je,Vt=function(mh){X===0&&pe(mh)};if(b=w,C=Tt(),C!==l)if(Vt(Me),s.charCodeAt(w)===40?(E=m,w++):E=l,E!==l){for(M=[],P=le();P!==l;)M.push(P),P=le();for(P=w,K=Ol(),K===l&&(K=null),oe=[],Je=Nl();Je!==l;)oe.push(Je),Je=Nl();se=P,P=Of(C,K,oe),Vt(Oe),s.charCodeAt(w)===41?(K=p,w++):K=l,K!==l?(se=b,b=Nf(C,P)):(w=b,b=l)}else w=b,b=l;else w=b,b=l;return b}function Ol(){var b,C,E,M,P=function(K){X===0&&pe(K)};return b=w,C=w,E=Tt(),E!==l?(P(be),s.charCodeAt(w)===61?(M=h,w++):M=l,M!==l?(se=C,C=Cl(E)):(w=C,C=l)):(w=C,C=l),C===l&&(C=null),E=_r(),E!==l?(se=b,b=If(C,E)):(w=b,b=l),b}function Nl(){var b,C,E,M,P,K=function(oe){X===0&&pe(oe)};for(b=w,C=[],E=le();E!==l;)C.push(E),E=le();if(K(Ke),s.charCodeAt(w)===44?(E=g,w++):E=l,E!==l){for(M=[],P=le();P!==l;)M.push(P),P=le();P=Ol(),P!==l?(se=b,b=ms(P)):(w=b,b=l)}else w=b,b=l;return b}function Il(){var b,C,E,M=function(P){X===0&&pe(P)};for(b=w,C=[],E=le();E!==l;)C.push(E),E=le();return M(Ke),s.charCodeAt(w)===44?(E=g,w++):E=l,E!==l?(C=[C,E],b=C):(w=b,b=l),b===l&&(b=null),b}function Bl(){var b,C,E,M,P,K=function(oe){X===0&&pe(oe)};if(K(ht),X++,b=w,B.test(s.charAt(w))?(C=s.charAt(w),w++):C=l,C!==l)if(E=Tt(),E!==l){for(M=[],P=Fl();P!==l;)M.push(P),P=Fl();se=b,b=Bf(C,E,M)}else w=b,b=l;else w=b,b=l;return X--,b}function Fl(){var b,C,E,M;return b=w,s.charCodeAt(w)===46?(C=d,w++):C=l,C!==l?(E=Tt(),E!==l?(se=b,b=Cl(E)):(w=b,b=l)):(w=b,b=l),b===l&&(b=w,s.charCodeAt(w)===91?(C=y,w++):C=l,C!==l?(E=Ll(),E===l&&(E=gs()),E!==l?(s.charCodeAt(w)===93?(M=x,w++):M=l,M!==l?(se=b,b=ms(E)):(w=b,b=l)):(w=b,b=l)):(w=b,b=l)),b}function _r(){var b;return b=ah(),b===l&&(b=uh(),b===l&&(b=gs(),b===l&&(b=Ll(),b===l&&(b=ch(),b===l&&(b=dh(),b===l&&(b=Ml(),b===l&&(b=Bl()))))))),b}function ah(){var b,C,E=function(M){X===0&&pe(M)};return E(_t),X++,b=w,s.substr(w,4)===k?(C=k,w+=4):C=l,C!==l&&(se=b,C=Ff()),b=C,X--,b}function uh(){var b,C,E=function(M){X===0&&pe(M)};return E(lr),X++,b=w,s.substr(w,4)===A?(C=A,w+=4):C=l,C!==l&&(se=b,C=Rf()),b=C,b===l&&(b=w,s.substr(w,5)===v?(C=v,w+=5):C=l,C!==l&&(se=b,C=$f()),b=C),X--,b}function ch(){var b,C,E,M,P,K,oe,Je=function(Vt){X===0&&pe(Vt)};if(b=w,Je(In),s.charCodeAt(w)===91?(C=y,w++):C=l,C!==l){for(E=[],M=le();M!==l;)E.push(M),M=le();if(M=w,P=_r(),P!==l){for(K=[],oe=Rl();oe!==l;)K.push(oe),oe=Rl();oe=Il(),se=M,M=Pf(P,K)}else w=M,M=l;for(M===l&&(M=null),P=[],K=le();K!==l;)P.push(K),K=le();Je(df),s.charCodeAt(w)===93?(K=x,w++):K=l,K!==l?(se=b,b=Lf(M)):(w=b,b=l)}else w=b,b=l;return b}function Rl(){var b,C,E,M,P,K=function(oe){X===0&&pe(oe)};for(b=w,C=[],E=le();E!==l;)C.push(E),E=le();if(K(Ke),s.charCodeAt(w)===44?(E=g,w++):E=l,E!==l){for(M=[],P=le();P!==l;)M.push(P),P=le();P=_r(),P!==l?(se=b,b=ms(P)):(w=b,b=l)}else w=b,b=l;return b}function dh(){var b,C,E,M,P,K,oe,Je=function(Vt){X===0&&pe(Vt)};if(b=w,Je(ff),s.charCodeAt(w)===123?(C=S,w++):C=l,C!==l){for(E=[],M=le();M!==l;)E.push(M),M=le();if(M=w,P=Pl(),P!==l){for(K=[],oe=$l();oe!==l;)K.push(oe),oe=$l();oe=Il(),se=M,M=zf(P,K)}else w=M,M=l;for(M===l&&(M=null),P=[],K=le();K!==l;)P.push(K),K=le();Je(hf),s.charCodeAt(w)===125?(K=D,w++):K=l,K!==l?(se=b,b=qf(M)):(w=b,b=l)}else w=b,b=l;return b}function $l(){var b,C,E,M,P,K=function(oe){X===0&&pe(oe)};for(b=w,C=[],E=le();E!==l;)C.push(E),E=le();if(K(Ke),s.charCodeAt(w)===44?(E=g,w++):E=l,E!==l){for(M=[],P=le();P!==l;)M.push(P),P=le();P=Pl(),P!==l?(se=b,b=xl(P)):(w=b,b=l)}else w=b,b=l;return b}function Pl(){var b,C,E,M,P,K=function(oe){X===0&&pe(oe)};if(b=w,C=Tt(),C===l&&(C=gs()),C!==l)if(K(pf),s.charCodeAt(w)===58?(E=_,w++):E=l,E!==l){for(M=[],P=le();P!==l;)M.push(P),P=le();P=_r(),P!==l?(se=b,b=Vf(C,P)):(w=b,b=l)}else w=b,b=l;else w=b,b=l;return b}function Ll(){var b,C,E,M,P,K,oe=function(Je){X===0&&pe(Je)};if(oe(mf),X++,b=w,s.charCodeAt(w)===45&&w++,C=[],F.test(s.charAt(w))?(E=s.charAt(w),w++):E=l,E!==l)for(;E!==l;)C.push(E),F.test(s.charAt(w))?(E=s.charAt(w),w++):E=l;else C=l;if(C!==l){if(E=w,s.charCodeAt(w)===46?(M=d,w++):M=l,M!==l){if(P=[],F.test(s.charAt(w))?(K=s.charAt(w),w++):K=l,K!==l)for(;K!==l;)P.push(K),F.test(s.charAt(w))?(K=s.charAt(w),w++):K=l;else P=l;P!==l?(M=[M,P],E=M):(w=E,E=l)}else w=E,E=l;E===l&&(E=null),se=b,b=jf()}else w=b,b=l;return X--,b}function gs(){var b,C,E,M,P=function(K){X===0&&pe(K)};if(P(gf),X++,b=w,s.charCodeAt(w)===34?(C=$,w++):C=l,C!==l){for(E=[],M=zl();M!==l;)E.push(M),M=zl();s.charCodeAt(w)===34?(M=$,w++):M=l,M!==l?(se=b,b=Hf(E)):(w=b,b=l)}else w=b,b=l;return X--,b}function zl(){var b;return V.test(s.charAt(w))?(b=s.charAt(w),w++):b=l,b===l&&(b=fh()),b}function fh(){var b,C,E,M;return b=w,s.charCodeAt(w)===92?(C=T,w++):C=l,C!==l?(s.charCodeAt(w)===34?(E=$,w++):E=l,E===l&&(s.charCodeAt(w)===92?(E=T,w++):E=l,E===l&&(E=w,s.charCodeAt(w)===110?(M=I,w++):M=l,M!==l&&(se=E,M=Uf()),E=M,E===l&&(E=w,s.charCodeAt(w)===114?(M=O,w++):M=l,M!==l&&(se=E,M=Wf()),E=M,E===l&&(E=w,s.charCodeAt(w)===116?(M=q,w++):M=l,M!==l&&(se=E,M=Kf()),E=M)))),E!==l?(se=b,b=Jf(E)):(w=b,b=l)):(w=b,b=l),b}function Tt(){var b,C,E,M=function(P){X===0&&pe(P)};if(M(yf),X++,b=w,C=[],Z.test(s.charAt(w))?(E=s.charAt(w),w++):E=l,E!==l)for(;E!==l;)C.push(E),Z.test(s.charAt(w))?(E=s.charAt(w),w++):E=l;else C=l;return C!==l?b=s.substring(b,w):b=C,X--,b}function le(){var b,C=function(E){X===0&&pe(E)};return C(bf),X++,re.test(s.charAt(w))?(b=s.charAt(w),w++):b=l,X--,b}const{Variable:hh,Function:ph}=o;if(Qf(),Rn=u(),Rn!==l&&w===s.length)return Rn;throw Rn!==l&&w<s.length&&pe(Zf()),eh()}e.exports={SyntaxError:n,parse:i}}}),wy=U({"node_modules/entities/lib/maps/entities.json"(r,e){e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
97
- `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}}}),Sd=U({"node_modules/markdown-it/lib/common/entities.js"(r,e){e.exports=wy()}}),tl=U({"node_modules/uc.micro/categories/P/regex.js"(r,e){e.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/}}),Ey=U({"node_modules/mdurl/encode.js"(r,e){var t={};function n(s){var o,l,a=t[s];if(a)return a;for(a=t[s]=[],o=0;o<128;o++)l=String.fromCharCode(o),/^[0-9a-z]$/i.test(l)?a.push(l):a.push("%"+("0"+o.toString(16).toUpperCase()).slice(-2));for(o=0;o<s.length;o++)a[s.charCodeAt(o)]=s[o];return a}function i(s,o,l){var a,u,c,d,f,h="";for(typeof o!="string"&&(l=o,o=i.defaultChars),typeof l>"u"&&(l=!0),f=n(o),a=0,u=s.length;a<u;a++){if(c=s.charCodeAt(a),l&&c===37&&a+2<u&&/^[0-9a-f]{2}$/i.test(s.slice(a+1,a+3))){h+=s.slice(a,a+3),a+=2;continue}if(c<128){h+=f[c];continue}if(c>=55296&&c<=57343){if(c>=55296&&c<=56319&&a+1<u&&(d=s.charCodeAt(a+1),d>=56320&&d<=57343)){h+=encodeURIComponent(s[a]+s[a+1]),a++;continue}h+="%EF%BF%BD";continue}h+=encodeURIComponent(s[a])}return h}i.defaultChars=";/?:@&=+$,-_.!~*'()#",i.componentChars="-_.!~*'()",e.exports=i}}),Sy=U({"node_modules/mdurl/decode.js"(r,e){var t={};function n(s){var o,l,a=t[s];if(a)return a;for(a=t[s]=[],o=0;o<128;o++)l=String.fromCharCode(o),a.push(l);for(o=0;o<s.length;o++)l=s.charCodeAt(o),a[l]="%"+("0"+l.toString(16).toUpperCase()).slice(-2);return a}function i(s,o){var l;return typeof o!="string"&&(o=i.defaultChars),l=n(o),s.replace(/(%[a-f0-9]{2})+/gi,function(a){var u,c,d,f,h,m,p,g="";for(u=0,c=a.length;u<c;u+=3){if(d=parseInt(a.slice(u+1,u+3),16),d<128){g+=l[d];continue}if((d&224)===192&&u+3<c&&(f=parseInt(a.slice(u+4,u+6),16),(f&192)===128)){p=d<<6&1984|f&63,p<128?g+="��":g+=String.fromCharCode(p),u+=3;continue}if((d&240)===224&&u+6<c&&(f=parseInt(a.slice(u+4,u+6),16),h=parseInt(a.slice(u+7,u+9),16),(f&192)===128&&(h&192)===128)){p=d<<12&61440|f<<6&4032|h&63,p<2048||p>=55296&&p<=57343?g+="���":g+=String.fromCharCode(p),u+=6;continue}if((d&248)===240&&u+9<c&&(f=parseInt(a.slice(u+4,u+6),16),h=parseInt(a.slice(u+7,u+9),16),m=parseInt(a.slice(u+10,u+12),16),(f&192)===128&&(h&192)===128&&(m&192)===128)){p=d<<18&1835008|f<<12&258048|h<<6&4032|m&63,p<65536||p>1114111?g+="����":(p-=65536,g+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),u+=9;continue}g+="�"}return g})}i.defaultChars=";/?:@&=+$,#",i.componentChars="",e.exports=i}}),Dy=U({"node_modules/mdurl/format.js"(r,e){e.exports=function(n){var i="";return i+=n.protocol||"",i+=n.slashes?"//":"",i+=n.auth?n.auth+"@":"",n.hostname&&n.hostname.indexOf(":")!==-1?i+="["+n.hostname+"]":i+=n.hostname||"",i+=n.port?":"+n.port:"",i+=n.pathname||"",i+=n.search||"",i+=n.hash||"",i}}}),_y=U({"node_modules/mdurl/parse.js"(r,e){function t(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var n=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
98
- `," "],l=["{","}","|","\\","^","`"].concat(o),a=["'"].concat(l),u=["%","/","?",";","#"].concat(a),c=["/","?","#"],d=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function g(y,x){if(y&&y instanceof t)return y;var k=new t;return k.parse(y,x),k}t.prototype.parse=function(y,x){var k,A,v,S,D,_=y;if(_=_.trim(),!x&&y.split("#").length===1){var $=s.exec(_);if($)return this.pathname=$[1],$[2]&&(this.search=$[2]),this}var T=n.exec(_);if(T&&(T=T[0],v=T.toLowerCase(),this.protocol=T,_=_.substr(T.length)),(x||T||_.match(/^\/\/[^@\/]+@[^@\/]+/))&&(D=_.substr(0,2)==="//",D&&!(T&&m[T])&&(_=_.substr(2),this.slashes=!0)),!m[T]&&(D||T&&!p[T])){var I=-1;for(k=0;k<c.length;k++)S=_.indexOf(c[k]),S!==-1&&(I===-1||S<I)&&(I=S);var O,q;for(I===-1?q=_.lastIndexOf("@"):q=_.lastIndexOf("@",I),q!==-1&&(O=_.slice(0,q),_=_.slice(q+1),this.auth=O),I=-1,k=0;k<u.length;k++)S=_.indexOf(u[k]),S!==-1&&(I===-1||S<I)&&(I=S);I===-1&&(I=_.length),_[I-1]===":"&&I--;var B=_.slice(0,I);_=_.slice(I),this.parseHost(B),this.hostname=this.hostname||"";var F=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!F){var V=this.hostname.split(/\./);for(k=0,A=V.length;k<A;k++){var Z=V[k];if(Z&&!Z.match(f)){for(var re="",ce=0,ye=Z.length;ce<ye;ce++)Z.charCodeAt(ce)>127?re+="x":re+=Z[ce];if(!re.match(f)){var Se=V.slice(0,k),ae=V.slice(k+1),be=Z.match(h);be&&(Se.push(be[1]),ae.unshift(be[2])),ae.length&&(_=ae.join(".")+_),this.hostname=Se.join(".");break}}}}this.hostname.length>d&&(this.hostname=""),F&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var Me=_.indexOf("#");Me!==-1&&(this.hash=_.substr(Me),_=_.slice(0,Me));var Oe=_.indexOf("?");return Oe!==-1&&(this.search=_.substr(Oe),_=_.slice(0,Oe)),_&&(this.pathname=_),p[v]&&this.hostname&&!this.pathname&&(this.pathname=""),this},t.prototype.parseHost=function(y){var x=i.exec(y);x&&(x=x[0],x!==":"&&(this.port=x.substr(1)),y=y.substr(0,y.length-x.length)),y&&(this.hostname=y)},e.exports=g}}),Dd=U({"node_modules/mdurl/index.js"(r,e){e.exports.encode=Ey(),e.exports.decode=Sy(),e.exports.format=Dy(),e.exports.parse=_y()}}),_d=U({"node_modules/uc.micro/properties/Any/regex.js"(r,e){e.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/}}),Td=U({"node_modules/uc.micro/categories/Cc/regex.js"(r,e){e.exports=/[\0-\x1F\x7F-\x9F]/}}),Ty=U({"node_modules/uc.micro/categories/Cf/regex.js"(r,e){e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/}}),Md=U({"node_modules/uc.micro/categories/Z/regex.js"(r,e){e.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/}}),My=U({"node_modules/uc.micro/index.js"(r){r.Any=_d(),r.Cc=Td(),r.Cf=Ty(),r.P=tl(),r.Z=Md()}}),de=U({"node_modules/markdown-it/lib/common/utils.js"(r){function e(B){return Object.prototype.toString.call(B)}function t(B){return e(B)==="[object String]"}var n=Object.prototype.hasOwnProperty;function i(B,F){return n.call(B,F)}function s(B){var F=Array.prototype.slice.call(arguments,1);return F.forEach(function(V){if(V){if(typeof V!="object")throw new TypeError(V+"must be object");Object.keys(V).forEach(function(Z){B[Z]=V[Z]})}}),B}function o(B,F,V){return[].concat(B.slice(0,F),V,B.slice(F+1))}function l(B){return!(B>=55296&&B<=57343||B>=64976&&B<=65007||(B&65535)===65535||(B&65535)===65534||B>=0&&B<=8||B===11||B>=14&&B<=31||B>=127&&B<=159||B>1114111)}function a(B){if(B>65535){B-=65536;var F=55296+(B>>10),V=56320+(B&1023);return String.fromCharCode(F,V)}return String.fromCharCode(B)}var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=/&([a-z#][a-z0-9]{1,31});/gi,d=new RegExp(u.source+"|"+c.source,"gi"),f=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,h=Sd();function m(B,F){var V=0;return i(h,F)?h[F]:F.charCodeAt(0)===35&&f.test(F)&&(V=F[1].toLowerCase()==="x"?parseInt(F.slice(2),16):parseInt(F.slice(1),10),l(V))?a(V):B}function p(B){return B.indexOf("\\")<0?B:B.replace(u,"$1")}function g(B){return B.indexOf("\\")<0&&B.indexOf("&")<0?B:B.replace(d,function(F,V,Z){return V||m(F,Z)})}var y=/[&<>"]/,x=/[&<>"]/g,k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function A(B){return k[B]}function v(B){return y.test(B)?B.replace(x,A):B}var S=/[.?*+^$[\]\\(){}|-]/g;function D(B){return B.replace(S,"\\$&")}function _(B){switch(B){case 9:case 32:return!0}return!1}function $(B){if(B>=8192&&B<=8202)return!0;switch(B){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}var T=tl();function I(B){return T.test(B)}function O(B){switch(B){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function q(B){return B=B.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(B=B.replace(/ẞ/g,"ß")),B.toLowerCase().toUpperCase()}r.lib={},r.lib.mdurl=Dd(),r.lib.ucmicro=My(),r.assign=s,r.isString=t,r.has=i,r.unescapeMd=p,r.unescapeAll=g,r.isValidEntityCode=l,r.fromCodePoint=a,r.escapeHtml=v,r.arrayReplaceAt=o,r.isSpace=_,r.isWhiteSpace=$,r.isMdAsciiPunct=O,r.isPunctChar=I,r.escapeRE=D,r.normalizeReference=q}}),Oy=U({"node_modules/markdown-it/lib/helpers/parse_link_label.js"(r,e){e.exports=function(n,i,s){var o,l,a,u,c=-1,d=n.posMax,f=n.pos;for(n.pos=i+1,o=1;n.pos<d;){if(a=n.src.charCodeAt(n.pos),a===93&&(o--,o===0)){l=!0;break}if(u=n.pos,n.md.inline.skipToken(n),a===91){if(u===n.pos-1)o++;else if(s)return n.pos=f,-1}}return l&&(c=n.pos),n.pos=f,c}}}),Ny=U({"node_modules/markdown-it/lib/helpers/parse_link_destination.js"(r,e){var t=de().unescapeAll;e.exports=function(i,s,o){var l,a,u=0,c=s,d={ok:!1,pos:0,lines:0,str:""};if(i.charCodeAt(s)===60){for(s++;s<o;){if(l=i.charCodeAt(s),l===10||l===60)return d;if(l===62)return d.pos=s+1,d.str=t(i.slice(c+1,s)),d.ok=!0,d;if(l===92&&s+1<o){s+=2;continue}s++}return d}for(a=0;s<o&&(l=i.charCodeAt(s),!(l===32||l<32||l===127));){if(l===92&&s+1<o){if(i.charCodeAt(s+1)===32)break;s+=2;continue}if(l===40&&(a++,a>32))return d;if(l===41){if(a===0)break;a--}s++}return c===s||a!==0||(d.str=t(i.slice(c,s)),d.lines=u,d.pos=s,d.ok=!0),d}}}),Iy=U({"node_modules/markdown-it/lib/helpers/parse_link_title.js"(r,e){var t=de().unescapeAll;e.exports=function(i,s,o){var l,a,u=0,c=s,d={ok:!1,pos:0,lines:0,str:""};if(s>=o||(a=i.charCodeAt(s),a!==34&&a!==39&&a!==40))return d;for(s++,a===40&&(a=41);s<o;){if(l=i.charCodeAt(s),l===a)return d.pos=s+1,d.lines=u,d.str=t(i.slice(c+1,s)),d.ok=!0,d;if(l===40&&a===41)return d;l===10?u++:l===92&&s+1<o&&(s++,i.charCodeAt(s)===10&&u++),s++}return d}}}),By=U({"node_modules/markdown-it/lib/helpers/index.js"(r){r.parseLinkLabel=Oy(),r.parseLinkDestination=Ny(),r.parseLinkTitle=Iy()}}),Fy=U({"node_modules/markdown-it/lib/renderer.js"(r,e){var t=de().assign,n=de().unescapeAll,i=de().escapeHtml,s={};s.code_inline=function(l,a,u,c,d){var f=l[a];return"<code"+d.renderAttrs(f)+">"+i(l[a].content)+"</code>"},s.code_block=function(l,a,u,c,d){var f=l[a];return"<pre"+d.renderAttrs(f)+"><code>"+i(l[a].content)+`</code></pre>
99
- `},s.fence=function(l,a,u,c,d){var f=l[a],h=f.info?n(f.info).trim():"",m="",p="",g,y,x,k,A;return h&&(x=h.split(/(\s+)/g),m=x[0],p=x.slice(2).join("")),u.highlight?g=u.highlight(f.content,m,p)||i(f.content):g=i(f.content),g.indexOf("<pre")===0?g+`
100
- `:h?(y=f.attrIndex("class"),k=f.attrs?f.attrs.slice():[],y<0?k.push(["class",u.langPrefix+m]):(k[y]=k[y].slice(),k[y][1]+=" "+u.langPrefix+m),A={attrs:k},"<pre><code"+d.renderAttrs(A)+">"+g+`</code></pre>
93
+ }`;function Cy(r,e,t){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(i),i}let Ay=class extends M2{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:t,slice:n,moved:i})=>this.options.onDrop(t,n,i)),this.on("paste",({event:t,slice:n})=>this.options.onPaste(t,n)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Cy(xy,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=pd(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:n});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;n=n.filter(l=>!l.key.startsWith(o))}),t.length===n.length)return;const i=this.state.reconfigure({plugins:n});return this.view.updateState(i),i}createExtensionManager(){var e,t;const i=[...this.options.enableCoreExtensions?[my,H2.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),hy,yy,by,vy,py,ky].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new hr(i,this)}createCommandManager(){this.commandManager=new ls({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let t;try{t=ho(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(l=>l.name!=="collaboration"),this.createExtensionManager()}}),t=ho(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=vd(t,this.options.autofocus);this.view=new Xc(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Fr.create({doc:t,selection:n||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const s=this.view.dom;s.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(o)});return}const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return wd(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return U1(this.state,n,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Go(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
94
+
95
+ `,textSerializers:n={}}=e||{};return z1(this.state.doc,{blockSeparator:t,textSerializers:{...yd(this.schema),...n}})}get isEmpty(){return el(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new cr(t,this)}get $doc(){return this.$pos(0)}};function Hr(r){return new us({find:r.find,handler:({state:e,range:t,match:n})=>{const i=ie(r.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];if(o){const a=l.search(/\S/),u=t.from+l.indexOf(o),c=u+o.length;if(Xo(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(p=>p===r.type&&p!==h.mark.type)).filter(h=>h.to>u).length)return null;c<t.to&&s.delete(c,t.to),u>t.from&&s.delete(t.from+a,u);const f=t.from+a+o.length;s.addMark(t.from+a,f,r.type.create(i||{})),s.removeStoredMark(r.type)}}})}function wy(r){return new us({find:r.find,handler:({state:e,range:t,match:n})=>{const i=ie(r.getAttributes,void 0,n)||{},{tr:s}=e,o=t.from;let l=t.to;const a=r.type.create(i);if(n[1]){const u=n[0].lastIndexOf(n[1]);let c=o+u;c>l?c=l:l=c+n[1].length;const d=n[0][n[0].length-1];s.insertText(d,o+n[0].length-1),s.replaceWith(c,l,a)}else if(n[0]){const u=r.type.isInline?o:o-1;s.insert(u,r.type.create(i)).delete(s.mapping.map(o),s.mapping.map(l))}s.scrollIntoView()}})}function mo(r){return new us({find:r.find,handler:({state:e,range:t,match:n})=>{const i=e.doc.resolve(t.from),s=ie(r.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),r.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,r.type,s)}})}function wn(r){return new us({find:r.find,handler:({state:e,range:t,match:n,chain:i})=>{const s=ie(r.getAttributes,void 0,n)||{},o=e.tr.delete(t.from,t.to),a=o.doc.resolve(t.from).blockRange(),u=a&&Io(a,r.type,s);if(!u)return null;if(o.wrap(a,u),r.keepMarks&&r.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:h}=r.editor.extensionManager,m=f||d.$to.parentOffset&&d.$from.marks();if(m){const p=m.filter(g=>h.includes(g.type.name));o.ensureMarks(p)}}if(r.keepAttributes){const d=r.type.name==="bulletList"||r.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,s).run()}const c=o.doc.resolve(t.from-1).nodeBefore;c&&c.type===r.type&&ir(o.doc,t.from-1)&&(!r.joinPredicate||r.joinPredicate(n,c))&&o.join(t.from-1)}})}let bt=class go{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(J(this,"addOptions",{name:this.name}))),this.storage=ie(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new go(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>cs(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new go(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ie(J(t,"addOptions",{name:t.name})),t.storage=ie(J(t,"addStorage",{name:t.name,options:t.options})),t}};function Dr(r){return new P2({find:r.find,handler:({state:e,range:t,match:n,pasteEvent:i})=>{const s=ie(r.getAttributes,void 0,n,i);if(s===!1||s===null)return null;const{tr:o}=e,l=n[n.length-1],a=n[0];let u=t.to;if(l){const c=a.search(/\S/),d=t.from+a.indexOf(l),f=d+l.length;if(Xo(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(g=>g===r.type&&g!==m.mark.type)).filter(m=>m.to>d).length)return null;f<t.to&&o.delete(f,t.to),d>t.from&&o.delete(t.from+c,d),u=t.from+c+l.length,o.addMark(t.from+c,u,r.type.create(s||{})),o.removeStoredMark(r.type)}}})}function Ey(r,e){const{selection:t}=r,{$from:n}=t;if(t instanceof G){const s=n.index();return n.parent.canReplaceWith(s,s+1,e)}let i=n.depth;for(;i>=0;){const s=n.index(i);if(n.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function Ya(r){return Nh((e,t)=>({get(){return e(),r},set(n){r=n,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}class Sy extends Ay{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Ya(this.view.state),this.reactiveExtensionStorage=Ya(this.extensionStorage),this.on("beforeTransaction",({nextState:t})=>{this.reactiveState.value=t,this.reactiveExtensionStorage.value=this.extensionStorage}),Mh(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){const n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}}const Dy=Pe({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(r){const e=je(),t=Ih();return Th(()=>{const n=r.editor;n&&n.options.element&&e.value&&Nu(()=>{if(!e.value||!n.options.element.firstChild)return;const i=N(e.value);e.value.append(...n.options.element.childNodes),n.contentComponent=t.ctx._,t&&(n.appContext={...t.appContext,provides:t.provides}),n.setOptions({element:i}),n.createNodeViews()})}),Qi(()=>{const n=r.editor;n&&(n.contentComponent=null,n.appContext=null)}),{rootEl:e}},render(){return _h("div",{ref:r=>{this.rootEl=r}})}}),_y=(r={})=>{const e=Oh();return Mo(()=>{e.value=new Sy(r)}),Qi(()=>{var t,n,i;const s=(t=e.value)===null||t===void 0?void 0:t.options.element,o=s==null?void 0:s.cloneNode(!0);(n=s==null?void 0:s.parentNode)===null||n===void 0||n.replaceChild(o,s),(i=e.value)===null||i===void 0||i.destroy()}),e};var Ty=Object.create,tl=Object.defineProperty,My=Object.getOwnPropertyDescriptor,Ed=Object.getOwnPropertyNames,Oy=Object.getPrototypeOf,Ny=Object.prototype.hasOwnProperty,W=(r,e)=>function(){return e||(0,r[Ed(r)[0]])((e={exports:{}}).exports,e),e.exports},Sd=(r,e)=>{for(var t in e)tl(r,t,{get:e[t],enumerable:!0})},Iy=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ed(e))!Ny.call(r,i)&&i!==t&&tl(r,i,{get:()=>e[i],enumerable:!(n=My(e,i))||n.enumerable});return r},fs=(r,e,t)=>(t=r!=null?Ty(Oy(r)):{},Iy(!r||!r.__esModule?tl(t,"default",{value:r,enumerable:!0}):t,r)),Dd=W({"src/grammar/tag.js"(r,e){function t(s,o){function l(){this.constructor=s}l.prototype=o.prototype,s.prototype=new l}function n(s,o,l,a){this.message=s,this.expected=o,this.found=l,this.location=a,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,n)}t(n,Error),n.buildMessage=function(s,o,l){var a={literal:function(p){return'"'+c(p.text)+'"'},class:function(p){var g=p.parts.map(function(b){return Array.isArray(b)?d(b[0])+"-"+d(b[1]):d(b)});return"["+(p.inverted?"^":"")+g+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(p){return p.description},not:function(p){return"not "+f(p.expected)}};function u(p){return p.charCodeAt(0).toString(16).toUpperCase()}function c(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+u(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+u(g)})}function d(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+u(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+u(g)})}function f(p){return a[p.type](p)}function h(p){var g=p.map(f),b,E;if(g.sort(),g.length>0){for(b=1,E=1;b<g.length;b++)g[b-1]!==g[b]&&(g[E]=g[b],E++);g.length=E}switch(g.length){case 1:return g[0];case 2:return g[0]+" or "+g[1];default:return g.slice(0,-1).join(", ")+", or "+g[g.length-1]}}function m(p){return p?'"'+c(p)+'"':"end of input"}return"Expected "+h(s)+" but "+m(o)+" found."};function i(s,o){o=o!==void 0?o:{};var l={},a={Top:Sl},u=Sl,c="/",d=".",f="#",h="=",m="(",p=")",g=",",b="[",E="]",v="null",D="true",x="false",k="{",C="}",w=":",I='"',T="\\",B="n",O="r",q="t",F=/^[$@]/,R=/^[0-9]/,j=/^[^\0-\x1F"\\]/,Y=/^[a-zA-Z0-9_\-]/,re=/^[ \n\t]/,ce=kt("/",!1),ye=vt("tag name"),Se=vt("class"),ae=vt("id"),be=kt("=",!1),Me=kt("(",!1),Oe=kt(")",!1),Ke=kt(",",!1),ht=vt("variable"),_t=vt("null"),lr=vt("boolean"),Fn=kt("[",!1),mf=kt("]",!1),gf=kt("{",!1),yf=kt("}",!1),bf=kt(":",!1),kf=vt("number"),vf=vt("string"),xf=vt("identifier"),Cf=vt("whitespace"),Af=function(y){return{type:"variable",meta:{variable:y}}},wf=function(y){return{type:"annotation",meta:{attributes:y}}},Ef=function(y,A){return A},Sf=function(y,A,_,M){A&&(_=_||[],_.unshift({type:"attribute",name:"primary",value:A}));const[P,K]=M?["tag",0]:["tag_open",1];return{type:P,nesting:K,meta:{tag:y,attributes:_}}},Df=function(y){return{type:"tag_close",nesting:-1,meta:{tag:y}}},_f=function(y,A){return y?[y,...A]:[]},Cl=function(y){return y},Tf=function(y){return y},Mf=function(y){return y},Of=function(y){return y},Nf=function(y){return{type:"class",name:y,value:!0}},If=function(y){return{type:"attribute",name:"id",value:y}},Bf=function(y,A){return{type:"attribute",name:y,value:A}},Ff=function(y,A,_){return A?[A,..._]:[]},Rf=function(y,A){let _={};for(let[M,{name:P,value:K}]of A.entries())_[P||M]=K;return new bh(y,_)},Al=function(y){return y},$f=function(y,A){return{name:y,value:A}},gs=function(y){return y},Pf=function(y,A,_){return y==="@"?[A,..._]:new yh([A,..._])},Lf=function(){return null},zf=function(){return!0},qf=function(){return!1},Vf=function(y,A){return[y,...A]},jf=function(y){return y||[]},Hf=function(y,A){return Object.assign(y,...A)},Uf=function(y){return y||{}},Wf=function(y,A){return y==="$$mdtype"?{}:{[y]:A}},Kf=function(){return parseFloat(Xf())},Jf=function(y){return y.join("")},Gf=function(){return`
96
+ `},Zf=function(){return"\r"},Yf=function(){return" "},Qf=function(y){return y},S=0,se=0,Rn=[{line:1,column:1}],$n=[],ee=0,Pn;if("startRule"in o){if(!(o.startRule in a))throw new Error(`Can't start parsing from rule "`+o.startRule+'".');u=a[o.startRule]}function Xf(){return s.substring(se,S)}function kt(y,A){return{type:"literal",text:y,ignoreCase:A}}function eh(){return{type:"end"}}function vt(y){return{type:"other",description:y}}function wl(y){var A=Rn[y],_;if(A)return A;for(_=y-1;!Rn[_];)_--;for(A=Rn[_],A={line:A.line,column:A.column};_<y;)s.charCodeAt(_)===10?(A.line++,A.column=1):A.column++,_++;return Rn[y]=A,A}var th=typeof o.filename=="string"&&o.filename.length>0;function El(y,A){var _={};th&&(_.filename=o.filename);var M=wl(y);_.start={offset:y,line:M.line,column:M.column};var P=wl(A);return _.end={offset:A,line:P.line,column:P.column},_}function rh(){$n.push({pos:S,variants:[]})}function me(y){var A=$n[$n.length-1];S<A.pos||(S>A.pos&&(A.pos=S,A.variants=[]),A.variants.push(y))}function nh(y,A,_){return new n(n.buildMessage(y,A,_),y,A,_)}function ih(){var y=$n[0],A=y.pos;return nh(y.variants,A<s.length?s.charAt(A):null,A<s.length?El(A,A+1):El(A,A))}function Sl(){var y;return y=sh(),y===l&&(y=oh(),y===l&&(y=lh(),y===l&&(y=ah()))),y}function sh(){var y,A;return y=S,A=Fl(),A===l&&(A=Ol()),A!==l&&(se=y,A=Af(A)),y=A,y}function oh(){var y,A,_,M;if(y=S,A=_l(),A!==l){for(_=[],M=le();M!==l;)_.push(M),M=le();se=y,y=wf(A)}else S=y,y=l;return y}function lh(){var y,A,_,M,P,K,oe,Je=function(Vt){ee===0&&me(Vt)};if(y=S,A=Dl(),A!==l){for(_=[],M=le();M!==l;)_.push(M),M=le();for(M=S,P=Tr(),P!==l?(K=le(),K===l&&(K=null),se=M,M=Ef(A,P)):(S=M,M=l),M===l&&(M=null),P=_l(),P===l&&(P=null),K=[],oe=le();oe!==l;)K.push(oe),oe=le();Je(ce),s.charCodeAt(S)===47?(oe=c,S++):oe=l,oe===l&&(oe=null),se=y,y=Sf(A,M,P,oe)}else S=y,y=l;return y}function ah(){var y,A,_,M=function(P){ee===0&&me(P)};return y=S,M(ce),s.charCodeAt(S)===47?(A=c,S++):A=l,A!==l?(_=Dl(),_!==l?(se=y,y=Df(_)):(S=y,y=l)):(S=y,y=l),y}function Dl(){var y,A=function(_){ee===0&&me(_)};return A(ye),ee++,y=Tt(),ee--,y}function _l(){var y,A,_,M;if(y=S,A=Ml(),A!==l){for(_=[],M=Tl();M!==l;)_.push(M),M=Tl();se=y,y=_f(A,_)}else S=y,y=l;return y}function Tl(){var y,A,_;if(y=S,A=[],_=le(),_!==l)for(;_!==l;)A.push(_),_=le();else A=l;return A!==l?(_=Ml(),_!==l?(se=y,y=Cl(_)):(S=y,y=l)):(S=y,y=l),y}function Ml(){var y,A;return y=S,A=ch(),A!==l&&(se=y,A=Tf(A)),y=A,y===l&&(y=S,A=uh(),A!==l&&(se=y,A=Mf(A)),y=A,y===l&&(y=S,A=dh(),A!==l&&(se=y,A=Of(A)),y=A)),y}function uh(){var y,A,_,M=function(P){ee===0&&me(P)};return M(Se),ee++,y=S,s.charCodeAt(S)===46?(A=d,S++):A=l,A!==l?(_=Tt(),_!==l?(se=y,y=Nf(_)):(S=y,y=l)):(S=y,y=l),ee--,y}function ch(){var y,A,_,M=function(P){ee===0&&me(P)};return M(ae),ee++,y=S,s.charCodeAt(S)===35?(A=f,S++):A=l,A!==l?(_=Tt(),_!==l?(se=y,y=If(_)):(S=y,y=l)):(S=y,y=l),ee--,y}function dh(){var y,A,_,M,P=function(K){ee===0&&me(K)};return y=S,A=Tt(),A!==l?(P(be),s.charCodeAt(S)===61?(_=h,S++):_=l,_!==l?(M=Tr(),M!==l?(se=y,y=Bf(A,M)):(S=y,y=l)):(S=y,y=l)):(S=y,y=l),y}function Ol(){var y,A,_,M,P,K,oe,Je,Vt=function(kh){ee===0&&me(kh)};if(y=S,A=Tt(),A!==l)if(Vt(Me),s.charCodeAt(S)===40?(_=m,S++):_=l,_!==l){for(M=[],P=le();P!==l;)M.push(P),P=le();for(P=S,K=Nl(),K===l&&(K=null),oe=[],Je=Il();Je!==l;)oe.push(Je),Je=Il();se=P,P=Ff(A,K,oe),Vt(Oe),s.charCodeAt(S)===41?(K=p,S++):K=l,K!==l?(se=y,y=Rf(A,P)):(S=y,y=l)}else S=y,y=l;else S=y,y=l;return y}function Nl(){var y,A,_,M,P=function(K){ee===0&&me(K)};return y=S,A=S,_=Tt(),_!==l?(P(be),s.charCodeAt(S)===61?(M=h,S++):M=l,M!==l?(se=A,A=Al(_)):(S=A,A=l)):(S=A,A=l),A===l&&(A=null),_=Tr(),_!==l?(se=y,y=$f(A,_)):(S=y,y=l),y}function Il(){var y,A,_,M,P,K=function(oe){ee===0&&me(oe)};for(y=S,A=[],_=le();_!==l;)A.push(_),_=le();if(K(Ke),s.charCodeAt(S)===44?(_=g,S++):_=l,_!==l){for(M=[],P=le();P!==l;)M.push(P),P=le();P=Nl(),P!==l?(se=y,y=gs(P)):(S=y,y=l)}else S=y,y=l;return y}function Bl(){var y,A,_,M=function(P){ee===0&&me(P)};for(y=S,A=[],_=le();_!==l;)A.push(_),_=le();return M(Ke),s.charCodeAt(S)===44?(_=g,S++):_=l,_!==l?(A=[A,_],y=A):(S=y,y=l),y===l&&(y=null),y}function Fl(){var y,A,_,M,P,K=function(oe){ee===0&&me(oe)};if(K(ht),ee++,y=S,F.test(s.charAt(S))?(A=s.charAt(S),S++):A=l,A!==l)if(_=Tt(),_!==l){for(M=[],P=Rl();P!==l;)M.push(P),P=Rl();se=y,y=Pf(A,_,M)}else S=y,y=l;else S=y,y=l;return ee--,y}function Rl(){var y,A,_,M;return y=S,s.charCodeAt(S)===46?(A=d,S++):A=l,A!==l?(_=Tt(),_!==l?(se=y,y=Al(_)):(S=y,y=l)):(S=y,y=l),y===l&&(y=S,s.charCodeAt(S)===91?(A=b,S++):A=l,A!==l?(_=zl(),_===l&&(_=ys()),_!==l?(s.charCodeAt(S)===93?(M=E,S++):M=l,M!==l?(se=y,y=gs(_)):(S=y,y=l)):(S=y,y=l)):(S=y,y=l)),y}function Tr(){var y;return y=fh(),y===l&&(y=hh(),y===l&&(y=ys(),y===l&&(y=zl(),y===l&&(y=ph(),y===l&&(y=mh(),y===l&&(y=Ol(),y===l&&(y=Fl()))))))),y}function fh(){var y,A,_=function(M){ee===0&&me(M)};return _(_t),ee++,y=S,s.substr(S,4)===v?(A=v,S+=4):A=l,A!==l&&(se=y,A=Lf()),y=A,ee--,y}function hh(){var y,A,_=function(M){ee===0&&me(M)};return _(lr),ee++,y=S,s.substr(S,4)===D?(A=D,S+=4):A=l,A!==l&&(se=y,A=zf()),y=A,y===l&&(y=S,s.substr(S,5)===x?(A=x,S+=5):A=l,A!==l&&(se=y,A=qf()),y=A),ee--,y}function ph(){var y,A,_,M,P,K,oe,Je=function(Vt){ee===0&&me(Vt)};if(y=S,Je(Fn),s.charCodeAt(S)===91?(A=b,S++):A=l,A!==l){for(_=[],M=le();M!==l;)_.push(M),M=le();if(M=S,P=Tr(),P!==l){for(K=[],oe=$l();oe!==l;)K.push(oe),oe=$l();oe=Bl(),se=M,M=Vf(P,K)}else S=M,M=l;for(M===l&&(M=null),P=[],K=le();K!==l;)P.push(K),K=le();Je(mf),s.charCodeAt(S)===93?(K=E,S++):K=l,K!==l?(se=y,y=jf(M)):(S=y,y=l)}else S=y,y=l;return y}function $l(){var y,A,_,M,P,K=function(oe){ee===0&&me(oe)};for(y=S,A=[],_=le();_!==l;)A.push(_),_=le();if(K(Ke),s.charCodeAt(S)===44?(_=g,S++):_=l,_!==l){for(M=[],P=le();P!==l;)M.push(P),P=le();P=Tr(),P!==l?(se=y,y=gs(P)):(S=y,y=l)}else S=y,y=l;return y}function mh(){var y,A,_,M,P,K,oe,Je=function(Vt){ee===0&&me(Vt)};if(y=S,Je(gf),s.charCodeAt(S)===123?(A=k,S++):A=l,A!==l){for(_=[],M=le();M!==l;)_.push(M),M=le();if(M=S,P=Ll(),P!==l){for(K=[],oe=Pl();oe!==l;)K.push(oe),oe=Pl();oe=Bl(),se=M,M=Hf(P,K)}else S=M,M=l;for(M===l&&(M=null),P=[],K=le();K!==l;)P.push(K),K=le();Je(yf),s.charCodeAt(S)===125?(K=C,S++):K=l,K!==l?(se=y,y=Uf(M)):(S=y,y=l)}else S=y,y=l;return y}function Pl(){var y,A,_,M,P,K=function(oe){ee===0&&me(oe)};for(y=S,A=[],_=le();_!==l;)A.push(_),_=le();if(K(Ke),s.charCodeAt(S)===44?(_=g,S++):_=l,_!==l){for(M=[],P=le();P!==l;)M.push(P),P=le();P=Ll(),P!==l?(se=y,y=Cl(P)):(S=y,y=l)}else S=y,y=l;return y}function Ll(){var y,A,_,M,P,K=function(oe){ee===0&&me(oe)};if(y=S,A=Tt(),A===l&&(A=ys()),A!==l)if(K(bf),s.charCodeAt(S)===58?(_=w,S++):_=l,_!==l){for(M=[],P=le();P!==l;)M.push(P),P=le();P=Tr(),P!==l?(se=y,y=Wf(A,P)):(S=y,y=l)}else S=y,y=l;else S=y,y=l;return y}function zl(){var y,A,_,M,P,K,oe=function(Je){ee===0&&me(Je)};if(oe(kf),ee++,y=S,s.charCodeAt(S)===45&&S++,A=[],R.test(s.charAt(S))?(_=s.charAt(S),S++):_=l,_!==l)for(;_!==l;)A.push(_),R.test(s.charAt(S))?(_=s.charAt(S),S++):_=l;else A=l;if(A!==l){if(_=S,s.charCodeAt(S)===46?(M=d,S++):M=l,M!==l){if(P=[],R.test(s.charAt(S))?(K=s.charAt(S),S++):K=l,K!==l)for(;K!==l;)P.push(K),R.test(s.charAt(S))?(K=s.charAt(S),S++):K=l;else P=l;P!==l?(M=[M,P],_=M):(S=_,_=l)}else S=_,_=l;_===l&&(_=null),se=y,y=Kf()}else S=y,y=l;return ee--,y}function ys(){var y,A,_,M,P=function(K){ee===0&&me(K)};if(P(vf),ee++,y=S,s.charCodeAt(S)===34?(A=I,S++):A=l,A!==l){for(_=[],M=ql();M!==l;)_.push(M),M=ql();s.charCodeAt(S)===34?(M=I,S++):M=l,M!==l?(se=y,y=Jf(_)):(S=y,y=l)}else S=y,y=l;return ee--,y}function ql(){var y;return j.test(s.charAt(S))?(y=s.charAt(S),S++):y=l,y===l&&(y=gh()),y}function gh(){var y,A,_,M;return y=S,s.charCodeAt(S)===92?(A=T,S++):A=l,A!==l?(s.charCodeAt(S)===34?(_=I,S++):_=l,_===l&&(s.charCodeAt(S)===92?(_=T,S++):_=l,_===l&&(_=S,s.charCodeAt(S)===110?(M=B,S++):M=l,M!==l&&(se=_,M=Gf()),_=M,_===l&&(_=S,s.charCodeAt(S)===114?(M=O,S++):M=l,M!==l&&(se=_,M=Zf()),_=M,_===l&&(_=S,s.charCodeAt(S)===116?(M=q,S++):M=l,M!==l&&(se=_,M=Yf()),_=M)))),_!==l?(se=y,y=Qf(_)):(S=y,y=l)):(S=y,y=l),y}function Tt(){var y,A,_,M=function(P){ee===0&&me(P)};if(M(xf),ee++,y=S,A=[],Y.test(s.charAt(S))?(_=s.charAt(S),S++):_=l,_!==l)for(;_!==l;)A.push(_),Y.test(s.charAt(S))?(_=s.charAt(S),S++):_=l;else A=l;return A!==l?y=s.substring(y,S):y=A,ee--,y}function le(){var y,A=function(_){ee===0&&me(_)};return A(Cf),ee++,re.test(s.charAt(S))?(y=s.charAt(S),S++):y=l,ee--,y}const{Variable:yh,Function:bh}=o;if(rh(),Pn=u(),Pn!==l&&S===s.length)return Pn;throw Pn!==l&&S<s.length&&me(eh()),ih()}e.exports={SyntaxError:n,parse:i}}}),By=W({"node_modules/entities/lib/maps/entities.json"(r,e){e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
97
+ `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}}}),_d=W({"node_modules/markdown-it/lib/common/entities.js"(r,e){e.exports=By()}}),rl=W({"node_modules/uc.micro/categories/P/regex.js"(r,e){e.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/}}),Fy=W({"node_modules/mdurl/encode.js"(r,e){var t={};function n(s){var o,l,a=t[s];if(a)return a;for(a=t[s]=[],o=0;o<128;o++)l=String.fromCharCode(o),/^[0-9a-z]$/i.test(l)?a.push(l):a.push("%"+("0"+o.toString(16).toUpperCase()).slice(-2));for(o=0;o<s.length;o++)a[s.charCodeAt(o)]=s[o];return a}function i(s,o,l){var a,u,c,d,f,h="";for(typeof o!="string"&&(l=o,o=i.defaultChars),typeof l>"u"&&(l=!0),f=n(o),a=0,u=s.length;a<u;a++){if(c=s.charCodeAt(a),l&&c===37&&a+2<u&&/^[0-9a-f]{2}$/i.test(s.slice(a+1,a+3))){h+=s.slice(a,a+3),a+=2;continue}if(c<128){h+=f[c];continue}if(c>=55296&&c<=57343){if(c>=55296&&c<=56319&&a+1<u&&(d=s.charCodeAt(a+1),d>=56320&&d<=57343)){h+=encodeURIComponent(s[a]+s[a+1]),a++;continue}h+="%EF%BF%BD";continue}h+=encodeURIComponent(s[a])}return h}i.defaultChars=";/?:@&=+$,-_.!~*'()#",i.componentChars="-_.!~*'()",e.exports=i}}),Ry=W({"node_modules/mdurl/decode.js"(r,e){var t={};function n(s){var o,l,a=t[s];if(a)return a;for(a=t[s]=[],o=0;o<128;o++)l=String.fromCharCode(o),a.push(l);for(o=0;o<s.length;o++)l=s.charCodeAt(o),a[l]="%"+("0"+l.toString(16).toUpperCase()).slice(-2);return a}function i(s,o){var l;return typeof o!="string"&&(o=i.defaultChars),l=n(o),s.replace(/(%[a-f0-9]{2})+/gi,function(a){var u,c,d,f,h,m,p,g="";for(u=0,c=a.length;u<c;u+=3){if(d=parseInt(a.slice(u+1,u+3),16),d<128){g+=l[d];continue}if((d&224)===192&&u+3<c&&(f=parseInt(a.slice(u+4,u+6),16),(f&192)===128)){p=d<<6&1984|f&63,p<128?g+="��":g+=String.fromCharCode(p),u+=3;continue}if((d&240)===224&&u+6<c&&(f=parseInt(a.slice(u+4,u+6),16),h=parseInt(a.slice(u+7,u+9),16),(f&192)===128&&(h&192)===128)){p=d<<12&61440|f<<6&4032|h&63,p<2048||p>=55296&&p<=57343?g+="���":g+=String.fromCharCode(p),u+=6;continue}if((d&248)===240&&u+9<c&&(f=parseInt(a.slice(u+4,u+6),16),h=parseInt(a.slice(u+7,u+9),16),m=parseInt(a.slice(u+10,u+12),16),(f&192)===128&&(h&192)===128&&(m&192)===128)){p=d<<18&1835008|f<<12&258048|h<<6&4032|m&63,p<65536||p>1114111?g+="����":(p-=65536,g+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),u+=9;continue}g+="�"}return g})}i.defaultChars=";/?:@&=+$,#",i.componentChars="",e.exports=i}}),$y=W({"node_modules/mdurl/format.js"(r,e){e.exports=function(n){var i="";return i+=n.protocol||"",i+=n.slashes?"//":"",i+=n.auth?n.auth+"@":"",n.hostname&&n.hostname.indexOf(":")!==-1?i+="["+n.hostname+"]":i+=n.hostname||"",i+=n.port?":"+n.port:"",i+=n.pathname||"",i+=n.search||"",i+=n.hash||"",i}}}),Py=W({"node_modules/mdurl/parse.js"(r,e){function t(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var n=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
98
+ `," "],l=["{","}","|","\\","^","`"].concat(o),a=["'"].concat(l),u=["%","/","?",";","#"].concat(a),c=["/","?","#"],d=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function g(b,E){if(b&&b instanceof t)return b;var v=new t;return v.parse(b,E),v}t.prototype.parse=function(b,E){var v,D,x,k,C,w=b;if(w=w.trim(),!E&&b.split("#").length===1){var I=s.exec(w);if(I)return this.pathname=I[1],I[2]&&(this.search=I[2]),this}var T=n.exec(w);if(T&&(T=T[0],x=T.toLowerCase(),this.protocol=T,w=w.substr(T.length)),(E||T||w.match(/^\/\/[^@\/]+@[^@\/]+/))&&(C=w.substr(0,2)==="//",C&&!(T&&m[T])&&(w=w.substr(2),this.slashes=!0)),!m[T]&&(C||T&&!p[T])){var B=-1;for(v=0;v<c.length;v++)k=w.indexOf(c[v]),k!==-1&&(B===-1||k<B)&&(B=k);var O,q;for(B===-1?q=w.lastIndexOf("@"):q=w.lastIndexOf("@",B),q!==-1&&(O=w.slice(0,q),w=w.slice(q+1),this.auth=O),B=-1,v=0;v<u.length;v++)k=w.indexOf(u[v]),k!==-1&&(B===-1||k<B)&&(B=k);B===-1&&(B=w.length),w[B-1]===":"&&B--;var F=w.slice(0,B);w=w.slice(B),this.parseHost(F),this.hostname=this.hostname||"";var R=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!R){var j=this.hostname.split(/\./);for(v=0,D=j.length;v<D;v++){var Y=j[v];if(Y&&!Y.match(f)){for(var re="",ce=0,ye=Y.length;ce<ye;ce++)Y.charCodeAt(ce)>127?re+="x":re+=Y[ce];if(!re.match(f)){var Se=j.slice(0,v),ae=j.slice(v+1),be=Y.match(h);be&&(Se.push(be[1]),ae.unshift(be[2])),ae.length&&(w=ae.join(".")+w),this.hostname=Se.join(".");break}}}}this.hostname.length>d&&(this.hostname=""),R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var Me=w.indexOf("#");Me!==-1&&(this.hash=w.substr(Me),w=w.slice(0,Me));var Oe=w.indexOf("?");return Oe!==-1&&(this.search=w.substr(Oe),w=w.slice(0,Oe)),w&&(this.pathname=w),p[x]&&this.hostname&&!this.pathname&&(this.pathname=""),this},t.prototype.parseHost=function(b){var E=i.exec(b);E&&(E=E[0],E!==":"&&(this.port=E.substr(1)),b=b.substr(0,b.length-E.length)),b&&(this.hostname=b)},e.exports=g}}),Td=W({"node_modules/mdurl/index.js"(r,e){e.exports.encode=Fy(),e.exports.decode=Ry(),e.exports.format=$y(),e.exports.parse=Py()}}),Md=W({"node_modules/uc.micro/properties/Any/regex.js"(r,e){e.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/}}),Od=W({"node_modules/uc.micro/categories/Cc/regex.js"(r,e){e.exports=/[\0-\x1F\x7F-\x9F]/}}),Ly=W({"node_modules/uc.micro/categories/Cf/regex.js"(r,e){e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/}}),Nd=W({"node_modules/uc.micro/categories/Z/regex.js"(r,e){e.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/}}),zy=W({"node_modules/uc.micro/index.js"(r){r.Any=Md(),r.Cc=Od(),r.Cf=Ly(),r.P=rl(),r.Z=Nd()}}),de=W({"node_modules/markdown-it/lib/common/utils.js"(r){function e(F){return Object.prototype.toString.call(F)}function t(F){return e(F)==="[object String]"}var n=Object.prototype.hasOwnProperty;function i(F,R){return n.call(F,R)}function s(F){var R=Array.prototype.slice.call(arguments,1);return R.forEach(function(j){if(j){if(typeof j!="object")throw new TypeError(j+"must be object");Object.keys(j).forEach(function(Y){F[Y]=j[Y]})}}),F}function o(F,R,j){return[].concat(F.slice(0,R),j,F.slice(R+1))}function l(F){return!(F>=55296&&F<=57343||F>=64976&&F<=65007||(F&65535)===65535||(F&65535)===65534||F>=0&&F<=8||F===11||F>=14&&F<=31||F>=127&&F<=159||F>1114111)}function a(F){if(F>65535){F-=65536;var R=55296+(F>>10),j=56320+(F&1023);return String.fromCharCode(R,j)}return String.fromCharCode(F)}var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=/&([a-z#][a-z0-9]{1,31});/gi,d=new RegExp(u.source+"|"+c.source,"gi"),f=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,h=_d();function m(F,R){var j=0;return i(h,R)?h[R]:R.charCodeAt(0)===35&&f.test(R)&&(j=R[1].toLowerCase()==="x"?parseInt(R.slice(2),16):parseInt(R.slice(1),10),l(j))?a(j):F}function p(F){return F.indexOf("\\")<0?F:F.replace(u,"$1")}function g(F){return F.indexOf("\\")<0&&F.indexOf("&")<0?F:F.replace(d,function(R,j,Y){return j||m(R,Y)})}var b=/[&<>"]/,E=/[&<>"]/g,v={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function D(F){return v[F]}function x(F){return b.test(F)?F.replace(E,D):F}var k=/[.?*+^$[\]\\(){}|-]/g;function C(F){return F.replace(k,"\\$&")}function w(F){switch(F){case 9:case 32:return!0}return!1}function I(F){if(F>=8192&&F<=8202)return!0;switch(F){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}var T=rl();function B(F){return T.test(F)}function O(F){switch(F){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function q(F){return F=F.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(F=F.replace(/ẞ/g,"ß")),F.toLowerCase().toUpperCase()}r.lib={},r.lib.mdurl=Td(),r.lib.ucmicro=zy(),r.assign=s,r.isString=t,r.has=i,r.unescapeMd=p,r.unescapeAll=g,r.isValidEntityCode=l,r.fromCodePoint=a,r.escapeHtml=x,r.arrayReplaceAt=o,r.isSpace=w,r.isWhiteSpace=I,r.isMdAsciiPunct=O,r.isPunctChar=B,r.escapeRE=C,r.normalizeReference=q}}),qy=W({"node_modules/markdown-it/lib/helpers/parse_link_label.js"(r,e){e.exports=function(n,i,s){var o,l,a,u,c=-1,d=n.posMax,f=n.pos;for(n.pos=i+1,o=1;n.pos<d;){if(a=n.src.charCodeAt(n.pos),a===93&&(o--,o===0)){l=!0;break}if(u=n.pos,n.md.inline.skipToken(n),a===91){if(u===n.pos-1)o++;else if(s)return n.pos=f,-1}}return l&&(c=n.pos),n.pos=f,c}}}),Vy=W({"node_modules/markdown-it/lib/helpers/parse_link_destination.js"(r,e){var t=de().unescapeAll;e.exports=function(i,s,o){var l,a,u=0,c=s,d={ok:!1,pos:0,lines:0,str:""};if(i.charCodeAt(s)===60){for(s++;s<o;){if(l=i.charCodeAt(s),l===10||l===60)return d;if(l===62)return d.pos=s+1,d.str=t(i.slice(c+1,s)),d.ok=!0,d;if(l===92&&s+1<o){s+=2;continue}s++}return d}for(a=0;s<o&&(l=i.charCodeAt(s),!(l===32||l<32||l===127));){if(l===92&&s+1<o){if(i.charCodeAt(s+1)===32)break;s+=2;continue}if(l===40&&(a++,a>32))return d;if(l===41){if(a===0)break;a--}s++}return c===s||a!==0||(d.str=t(i.slice(c,s)),d.lines=u,d.pos=s,d.ok=!0),d}}}),jy=W({"node_modules/markdown-it/lib/helpers/parse_link_title.js"(r,e){var t=de().unescapeAll;e.exports=function(i,s,o){var l,a,u=0,c=s,d={ok:!1,pos:0,lines:0,str:""};if(s>=o||(a=i.charCodeAt(s),a!==34&&a!==39&&a!==40))return d;for(s++,a===40&&(a=41);s<o;){if(l=i.charCodeAt(s),l===a)return d.pos=s+1,d.lines=u,d.str=t(i.slice(c+1,s)),d.ok=!0,d;if(l===40&&a===41)return d;l===10?u++:l===92&&s+1<o&&(s++,i.charCodeAt(s)===10&&u++),s++}return d}}}),Hy=W({"node_modules/markdown-it/lib/helpers/index.js"(r){r.parseLinkLabel=qy(),r.parseLinkDestination=Vy(),r.parseLinkTitle=jy()}}),Uy=W({"node_modules/markdown-it/lib/renderer.js"(r,e){var t=de().assign,n=de().unescapeAll,i=de().escapeHtml,s={};s.code_inline=function(l,a,u,c,d){var f=l[a];return"<code"+d.renderAttrs(f)+">"+i(l[a].content)+"</code>"},s.code_block=function(l,a,u,c,d){var f=l[a];return"<pre"+d.renderAttrs(f)+"><code>"+i(l[a].content)+`</code></pre>
99
+ `},s.fence=function(l,a,u,c,d){var f=l[a],h=f.info?n(f.info).trim():"",m="",p="",g,b,E,v,D;return h&&(E=h.split(/(\s+)/g),m=E[0],p=E.slice(2).join("")),u.highlight?g=u.highlight(f.content,m,p)||i(f.content):g=i(f.content),g.indexOf("<pre")===0?g+`
100
+ `:h?(b=f.attrIndex("class"),v=f.attrs?f.attrs.slice():[],b<0?v.push(["class",u.langPrefix+m]):(v[b]=v[b].slice(),v[b][1]+=" "+u.langPrefix+m),D={attrs:v},"<pre><code"+d.renderAttrs(D)+">"+g+`</code></pre>
101
101
  `):"<pre><code"+d.renderAttrs(f)+">"+g+`</code></pre>
102
102
  `},s.image=function(l,a,u,c,d){var f=l[a];return f.attrs[f.attrIndex("alt")][1]=d.renderInlineAsText(f.children,u,c),d.renderToken(l,a,u)},s.hardbreak=function(l,a,u){return u.xhtmlOut?`<br />
103
103
  `:`<br>
@@ -107,39 +107,39 @@ img.ProseMirror-separator {
107
107
  `},s.text=function(l,a){return i(l[a].content)},s.html_block=function(l,a){return l[a].content},s.html_inline=function(l,a){return l[a].content};function o(){this.rules=t({},s)}o.prototype.renderAttrs=function(a){var u,c,d;if(!a.attrs)return"";for(d="",u=0,c=a.attrs.length;u<c;u++)d+=" "+i(a.attrs[u][0])+'="'+i(a.attrs[u][1])+'"';return d},o.prototype.renderToken=function(a,u,c){var d,f="",h=!1,m=a[u];return m.hidden?"":(m.block&&m.nesting!==-1&&u&&a[u-1].hidden&&(f+=`
108
108
  `),f+=(m.nesting===-1?"</":"<")+m.tag,f+=this.renderAttrs(m),m.nesting===0&&c.xhtmlOut&&(f+=" /"),m.block&&(h=!0,m.nesting===1&&u+1<a.length&&(d=a[u+1],(d.type==="inline"||d.hidden||d.nesting===-1&&d.tag===m.tag)&&(h=!1))),f+=h?`>
109
109
  `:">",f)},o.prototype.renderInline=function(l,a,u){for(var c,d="",f=this.rules,h=0,m=l.length;h<m;h++)c=l[h].type,typeof f[c]<"u"?d+=f[c](l,h,a,u,this):d+=this.renderToken(l,h,a);return d},o.prototype.renderInlineAsText=function(l,a,u){for(var c="",d=0,f=l.length;d<f;d++)l[d].type==="text"?c+=l[d].content:l[d].type==="image"?c+=this.renderInlineAsText(l[d].children,a,u):l[d].type==="softbreak"&&(c+=`
110
- `);return c},o.prototype.render=function(l,a,u){var c,d,f,h="",m=this.rules;for(c=0,d=l.length;c<d;c++)f=l[c].type,f==="inline"?h+=this.renderInline(l[c].children,a,u):typeof m[f]<"u"?h+=m[l[c].type](l,c,a,u,this):h+=this.renderToken(l,c,a,u);return h},e.exports=o}}),rl=U({"node_modules/markdown-it/lib/ruler.js"(r,e){function t(){this.__rules__=[],this.__cache__=null}t.prototype.__find__=function(n){for(var i=0;i<this.__rules__.length;i++)if(this.__rules__[i].name===n)return i;return-1},t.prototype.__compile__=function(){var n=this,i=[""];n.__rules__.forEach(function(s){s.enabled&&s.alt.forEach(function(o){i.indexOf(o)<0&&i.push(o)})}),n.__cache__={},i.forEach(function(s){n.__cache__[s]=[],n.__rules__.forEach(function(o){o.enabled&&(s&&o.alt.indexOf(s)<0||n.__cache__[s].push(o.fn))})})},t.prototype.at=function(n,i,s){var o=this.__find__(n),l=s||{};if(o===-1)throw new Error("Parser rule not found: "+n);this.__rules__[o].fn=i,this.__rules__[o].alt=l.alt||[],this.__cache__=null},t.prototype.before=function(n,i,s,o){var l=this.__find__(n),a=o||{};if(l===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(l,0,{name:i,enabled:!0,fn:s,alt:a.alt||[]}),this.__cache__=null},t.prototype.after=function(n,i,s,o){var l=this.__find__(n),a=o||{};if(l===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(l+1,0,{name:i,enabled:!0,fn:s,alt:a.alt||[]}),this.__cache__=null},t.prototype.push=function(n,i,s){var o=s||{};this.__rules__.push({name:n,enabled:!0,fn:i,alt:o.alt||[]}),this.__cache__=null},t.prototype.enable=function(n,i){Array.isArray(n)||(n=[n]);var s=[];return n.forEach(function(o){var l=this.__find__(o);if(l<0){if(i)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[l].enabled=!0,s.push(o)},this),this.__cache__=null,s},t.prototype.enableOnly=function(n,i){Array.isArray(n)||(n=[n]),this.__rules__.forEach(function(s){s.enabled=!1}),this.enable(n,i)},t.prototype.disable=function(n,i){Array.isArray(n)||(n=[n]);var s=[];return n.forEach(function(o){var l=this.__find__(o);if(l<0){if(i)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[l].enabled=!1,s.push(o)},this),this.__cache__=null,s},t.prototype.getRules=function(n){return this.__cache__===null&&this.__compile__(),this.__cache__[n]||[]},e.exports=t}}),Ry=U({"node_modules/markdown-it/lib/rules_core/normalize.js"(r,e){var t=/\r\n?|\n/g,n=/\0/g;e.exports=function(s){var o;o=s.src.replace(t,`
111
- `),o=o.replace(n,"�"),s.src=o}}}),$y=U({"node_modules/markdown-it/lib/rules_core/block.js"(r,e){e.exports=function(n){var i;n.inlineMode?(i=new n.Token("inline","",0),i.content=n.src,i.map=[0,1],i.children=[],n.tokens.push(i)):n.md.block.parse(n.src,n.md,n.env,n.tokens)}}}),Py=U({"node_modules/markdown-it/lib/rules_core/inline.js"(r,e){e.exports=function(n){var i=n.tokens,s,o,l;for(o=0,l=i.length;o<l;o++)s=i[o],s.type==="inline"&&n.md.inline.parse(s.content,n.md,n.env,s.children)}}}),Ly=U({"node_modules/markdown-it/lib/rules_core/linkify.js"(r,e){var t=de().arrayReplaceAt;function n(s){return/^<a[>\s]/i.test(s)}function i(s){return/^<\/a\s*>/i.test(s)}e.exports=function(o){var l,a,u,c,d,f,h,m,p,g,y,x,k,A,v,S,D=o.tokens,_;if(o.md.options.linkify){for(a=0,u=D.length;a<u;a++)if(!(D[a].type!=="inline"||!o.md.linkify.pretest(D[a].content)))for(c=D[a].children,k=0,l=c.length-1;l>=0;l--){if(f=c[l],f.type==="link_close"){for(l--;c[l].level!==f.level&&c[l].type!=="link_open";)l--;continue}if(f.type==="html_inline"&&(n(f.content)&&k>0&&k--,i(f.content)&&k++),!(k>0)&&f.type==="text"&&o.md.linkify.test(f.content)){for(p=f.content,_=o.md.linkify.match(p),h=[],x=f.level,y=0,m=0;m<_.length;m++)A=_[m].url,v=o.md.normalizeLink(A),o.md.validateLink(v)&&(S=_[m].text,_[m].schema?_[m].schema==="mailto:"&&!/^mailto:/i.test(S)?S=o.md.normalizeLinkText("mailto:"+S).replace(/^mailto:/,""):S=o.md.normalizeLinkText(S):S=o.md.normalizeLinkText("http://"+S).replace(/^http:\/\//,""),g=_[m].index,g>y&&(d=new o.Token("text","",0),d.content=p.slice(y,g),d.level=x,h.push(d)),d=new o.Token("link_open","a",1),d.attrs=[["href",v]],d.level=x++,d.markup="linkify",d.info="auto",h.push(d),d=new o.Token("text","",0),d.content=S,d.level=x,h.push(d),d=new o.Token("link_close","a",-1),d.level=--x,d.markup="linkify",d.info="auto",h.push(d),y=_[m].lastIndex);y<p.length&&(d=new o.Token("text","",0),d.content=p.slice(y),d.level=x,h.push(d)),D[a].children=c=t(c,l,h)}}}}}}),zy=U({"node_modules/markdown-it/lib/rules_core/replacements.js"(r,e){var t=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,n=/\((c|tm|r|p)\)/i,i=/\((c|tm|r|p)\)/ig,s={c:"©",r:"®",p:"§",tm:"™"};function o(u,c){return s[c.toLowerCase()]}function l(u){var c,d,f=0;for(c=u.length-1;c>=0;c--)d=u[c],d.type==="text"&&!f&&(d.content=d.content.replace(i,o)),d.type==="link_open"&&d.info==="auto"&&f--,d.type==="link_close"&&d.info==="auto"&&f++}function a(u){var c,d,f=0;for(c=u.length-1;c>=0;c--)d=u[c],d.type==="text"&&!f&&t.test(d.content)&&(d.content=d.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),d.type==="link_open"&&d.info==="auto"&&f--,d.type==="link_close"&&d.info==="auto"&&f++}e.exports=function(c){var d;if(c.md.options.typographer)for(d=c.tokens.length-1;d>=0;d--)c.tokens[d].type==="inline"&&(n.test(c.tokens[d].content)&&l(c.tokens[d].children),t.test(c.tokens[d].content)&&a(c.tokens[d].children))}}}),qy=U({"node_modules/markdown-it/lib/rules_core/smartquotes.js"(r,e){var t=de().isWhiteSpace,n=de().isPunctChar,i=de().isMdAsciiPunct,s=/['"]/,o=/['"]/g,l="’";function a(c,d,f){return c.substr(0,d)+f+c.substr(d+1)}function u(c,d){var f,h,m,p,g,y,x,k,A,v,S,D,_,$,T,I,O,q,B,F,V;for(B=[],f=0;f<c.length;f++){for(h=c[f],x=c[f].level,O=B.length-1;O>=0&&!(B[O].level<=x);O--);if(B.length=O+1,h.type==="text"){m=h.content,g=0,y=m.length;e:for(;g<y&&(o.lastIndex=g,p=o.exec(m),!!p);){if(T=I=!0,g=p.index+1,q=p[0]==="'",A=32,p.index-1>=0)A=m.charCodeAt(p.index-1);else for(O=f-1;O>=0&&!(c[O].type==="softbreak"||c[O].type==="hardbreak");O--)if(c[O].content){A=c[O].content.charCodeAt(c[O].content.length-1);break}if(v=32,g<y)v=m.charCodeAt(g);else for(O=f+1;O<c.length&&!(c[O].type==="softbreak"||c[O].type==="hardbreak");O++)if(c[O].content){v=c[O].content.charCodeAt(0);break}if(S=i(A)||n(String.fromCharCode(A)),D=i(v)||n(String.fromCharCode(v)),_=t(A),$=t(v),$?T=!1:D&&(_||S||(T=!1)),_?I=!1:S&&($||D||(I=!1)),v===34&&p[0]==='"'&&A>=48&&A<=57&&(I=T=!1),T&&I&&(T=S,I=D),!T&&!I){q&&(h.content=a(h.content,p.index,l));continue}if(I){for(O=B.length-1;O>=0&&(k=B[O],!(B[O].level<x));O--)if(k.single===q&&B[O].level===x){k=B[O],q?(F=d.md.options.quotes[2],V=d.md.options.quotes[3]):(F=d.md.options.quotes[0],V=d.md.options.quotes[1]),h.content=a(h.content,p.index,V),c[k.token].content=a(c[k.token].content,k.pos,F),g+=V.length-1,k.token===f&&(g+=F.length-1),m=h.content,y=m.length,B.length=O;continue e}}T?B.push({token:f,pos:p.index,single:q,level:x}):I&&q&&(h.content=a(h.content,p.index,l))}}}}e.exports=function(d){var f;if(d.md.options.typographer)for(f=d.tokens.length-1;f>=0;f--)d.tokens[f].type!=="inline"||!s.test(d.tokens[f].content)||u(d.tokens[f].children,d)}}}),nl=U({"node_modules/markdown-it/lib/token.js"(r,e){function t(n,i,s){this.type=n,this.tag=i,this.attrs=null,this.map=null,this.nesting=s,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}t.prototype.attrIndex=function(i){var s,o,l;if(!this.attrs)return-1;for(s=this.attrs,o=0,l=s.length;o<l;o++)if(s[o][0]===i)return o;return-1},t.prototype.attrPush=function(i){this.attrs?this.attrs.push(i):this.attrs=[i]},t.prototype.attrSet=function(i,s){var o=this.attrIndex(i),l=[i,s];o<0?this.attrPush(l):this.attrs[o]=l},t.prototype.attrGet=function(i){var s=this.attrIndex(i),o=null;return s>=0&&(o=this.attrs[s][1]),o},t.prototype.attrJoin=function(i,s){var o=this.attrIndex(i);o<0?this.attrPush([i,s]):this.attrs[o][1]=this.attrs[o][1]+" "+s},e.exports=t}}),Vy=U({"node_modules/markdown-it/lib/rules_core/state_core.js"(r,e){var t=nl();function n(i,s,o){this.src=i,this.env=o,this.tokens=[],this.inlineMode=!1,this.md=s}n.prototype.Token=t,e.exports=n}}),jy=U({"node_modules/markdown-it/lib/parser_core.js"(r,e){var t=rl(),n=[["normalize",Ry()],["block",$y()],["inline",Py()],["linkify",Ly()],["replacements",zy()],["smartquotes",qy()]];function i(){this.ruler=new t;for(var s=0;s<n.length;s++)this.ruler.push(n[s][0],n[s][1])}i.prototype.process=function(s){var o,l,a;for(a=this.ruler.getRules(""),o=0,l=a.length;o<l;o++)a[o](s)},i.prototype.State=Vy(),e.exports=i}}),Hy=U({"node_modules/markdown-it/lib/rules_block/table.js"(r,e){var t=de().isSpace;function n(s,o){var l=s.bMarks[o]+s.tShift[o],a=s.eMarks[o];return s.src.substr(l,a-l)}function i(s){var o=[],l=0,a=s.length,u,c=!1,d=0,f="";for(u=s.charCodeAt(l);l<a;)u===124&&(c?(f+=s.substring(d,l-1),d=l):(o.push(f+s.substring(d,l)),f="",d=l+1)),c=u===92,l++,u=s.charCodeAt(l);return o.push(f+s.substring(d)),o}e.exports=function(o,l,a,u){var c,d,f,h,m,p,g,y,x,k,A,v,S,D,_,$,T,I;if(l+2>a||(p=l+1,o.sCount[p]<o.blkIndent)||!o.md.options.allowIndentation&&o.sCount[p]-o.blkIndent>=4||(f=o.bMarks[p]+o.tShift[p],f>=o.eMarks[p])||(T=o.src.charCodeAt(f++),T!==124&&T!==45&&T!==58)||f>=o.eMarks[p]||(I=o.src.charCodeAt(f++),I!==124&&I!==45&&I!==58&&!t(I))||T===45&&t(I))return!1;for(;f<o.eMarks[p];){if(c=o.src.charCodeAt(f),c!==124&&c!==45&&c!==58&&!t(c))return!1;f++}for(d=n(o,l+1),g=d.split("|"),k=[],h=0;h<g.length;h++){if(A=g[h].trim(),!A){if(h===0||h===g.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?k.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?k.push("left"):k.push("")}if(d=n(o,l).trim(),d.indexOf("|")===-1||!o.md.options.allowIndentation&&o.sCount[l]-o.blkIndent>=4||(g=i(d),g.length&&g[0]===""&&g.shift(),g.length&&g[g.length-1]===""&&g.pop(),y=g.length,y===0||y!==k.length))return!1;if(u)return!0;for(D=o.parentType,o.parentType="table",$=o.md.block.ruler.getRules("blockquote"),x=o.push("table_open","table",1),x.map=v=[l,0],x=o.push("thead_open","thead",1),x.map=[l,l+1],x=o.push("tr_open","tr",1),x.map=[l,l+1],h=0;h<g.length;h++)x=o.push("th_open","th",1),k[h]&&(x.attrs=[["style","text-align:"+k[h]]]),x=o.push("inline","",0),x.content=g[h].trim(),x.children=[],x=o.push("th_close","th",-1);for(x=o.push("tr_close","tr",-1),x=o.push("thead_close","thead",-1),p=l+2;p<a&&!(o.sCount[p]<o.blkIndent);p++){for(_=!1,h=0,m=$.length;h<m;h++)if($[h](o,p,a,!0)){_=!0;break}if(_||(d=n(o,p).trim(),!d)||!o.md.options.allowIndentation&&o.sCount[p]-o.blkIndent>=4)break;for(g=i(d),g.length&&g[0]===""&&g.shift(),g.length&&g[g.length-1]===""&&g.pop(),p===l+2&&(x=o.push("tbody_open","tbody",1),x.map=S=[l+2,0]),x=o.push("tr_open","tr",1),x.map=[p,p+1],h=0;h<y;h++)x=o.push("td_open","td",1),k[h]&&(x.attrs=[["style","text-align:"+k[h]]]),x=o.push("inline","",0),x.content=g[h]?g[h].trim():"",x.children=[],x=o.push("td_close","td",-1);x=o.push("tr_close","tr",-1)}return S&&(x=o.push("tbody_close","tbody",-1),S[1]=p),x=o.push("table_close","table",-1),v[1]=p,o.parentType=D,o.line=p,!0}}}),Uy=U({"node_modules/markdown-it/lib/rules_block/code.js"(r,e){e.exports=function(n,i,s){if(n.md.options.allowIndentation)return!1;var o,l,a;if(n.sCount[i]-n.blkIndent<4)return!1;for(l=o=i+1;o<s;){if(n.isEmpty(o)){o++;continue}if(n.sCount[o]-n.blkIndent>=4){o++,l=o;continue}break}return n.line=l,a=n.push("code_block","code",0),a.content=n.getLines(i,l,4+n.blkIndent,!1)+`
112
- `,a.map=[i,n.line],!0}}}),Wy=U({"node_modules/markdown-it/lib/rules_block/fence.js"(r,e){e.exports=function(n,i,s,o){var l,a,u,c,d,f,h,m=!1,p=n.bMarks[i]+n.tShift[i],g=n.eMarks[i];if(!n.md.options.allowIndentation&&n.sCount[i]-n.blkIndent>=4||p+3>g||(l=n.src.charCodeAt(p),l!==126&&l!==96)||(d=p,p=n.skipChars(p,l),a=p-d,a<3)||(h=n.src.slice(d,p),u=n.src.slice(p,g),l===96&&u.indexOf(String.fromCharCode(l))>=0))return!1;if(o)return!0;for(c=i;c++,!(c>=s||(p=d=n.bMarks[c]+n.tShift[c],g=n.eMarks[c],p<g&&n.sCount[c]<n.blkIndent));)if(n.src.charCodeAt(p)===l&&!(!n.md.options.allowIndentation&&n.sCount[c]-n.blkIndent>=4)&&(p=n.skipChars(p,l),!(p-d<a)&&(p=n.skipSpaces(p),!(p<g)))){m=!0;break}return a=n.sCount[i],n.line=c+(m?1:0),f=n.push("fence","code",0),f.info=u,f.content=n.getLines(i+1,c,a,!0),f.markup=h,f.map=[i,n.line],!0}}}),Ky=U({"node_modules/markdown-it/lib/rules_block/blockquote.js"(r,e){var t=de().isSpace;e.exports=function(i,s,o,l){var a,u,c,d,f,h,m,p,g,y,x,k,A,v,S,D,_,$,T,I,O=i.lineMax,q=i.bMarks[s]+i.tShift[s],B=i.eMarks[s];if(!i.md.options.allowIndentation&&i.sCount[s]-i.blkIndent>=4||i.src.charCodeAt(q++)!==62)return!1;if(l)return!0;for(d=g=i.sCount[s]+1,i.src.charCodeAt(q)===32?(q++,d++,g++,a=!1,D=!0):i.src.charCodeAt(q)===9?(D=!0,(i.bsCount[s]+g)%4===3?(q++,d++,g++,a=!1):a=!0):D=!1,y=[i.bMarks[s]],i.bMarks[s]=q;q<B&&(u=i.src.charCodeAt(q),t(u));){u===9?g+=4-(g+i.bsCount[s]+(a?1:0))%4:g++;q++}for(x=[i.bsCount[s]],i.bsCount[s]=i.sCount[s]+1+(D?1:0),h=q>=B,v=[i.sCount[s]],i.sCount[s]=g-d,S=[i.tShift[s]],i.tShift[s]=q-i.bMarks[s],$=i.md.block.ruler.getRules("blockquote"),A=i.parentType,i.parentType="blockquote",p=s+1;p<o&&(I=i.sCount[p]<i.blkIndent,q=i.bMarks[p]+i.tShift[p],B=i.eMarks[p],!(q>=B));p++){if(i.src.charCodeAt(q++)===62&&!I){for(d=g=i.sCount[p]+1,i.src.charCodeAt(q)===32?(q++,d++,g++,a=!1,D=!0):i.src.charCodeAt(q)===9?(D=!0,(i.bsCount[p]+g)%4===3?(q++,d++,g++,a=!1):a=!0):D=!1,y.push(i.bMarks[p]),i.bMarks[p]=q;q<B&&(u=i.src.charCodeAt(q),t(u));){u===9?g+=4-(g+i.bsCount[p]+(a?1:0))%4:g++;q++}h=q>=B,x.push(i.bsCount[p]),i.bsCount[p]=i.sCount[p]+1+(D?1:0),v.push(i.sCount[p]),i.sCount[p]=g-d,S.push(i.tShift[p]),i.tShift[p]=q-i.bMarks[p];continue}if(h)break;for(_=!1,c=0,f=$.length;c<f;c++)if($[c](i,p,o,!0)){_=!0;break}if(_){i.lineMax=p,i.blkIndent!==0&&(y.push(i.bMarks[p]),x.push(i.bsCount[p]),S.push(i.tShift[p]),v.push(i.sCount[p]),i.sCount[p]-=i.blkIndent);break}y.push(i.bMarks[p]),x.push(i.bsCount[p]),S.push(i.tShift[p]),v.push(i.sCount[p]),i.sCount[p]=-1}for(k=i.blkIndent,i.blkIndent=0,T=i.push("blockquote_open","blockquote",1),T.markup=">",T.map=m=[s,0],i.md.block.tokenize(i,s,p),T=i.push("blockquote_close","blockquote",-1),T.markup=">",i.lineMax=O,i.parentType=A,m[1]=i.line,c=0;c<S.length;c++)i.bMarks[c+s]=y[c],i.tShift[c+s]=S[c],i.sCount[c+s]=v[c],i.bsCount[c+s]=x[c];return i.blkIndent=k,!0}}}),Jy=U({"node_modules/markdown-it/lib/rules_block/hr.js"(r,e){var t=de().isSpace;e.exports=function(i,s,o,l){var a,u,c,d,f=i.bMarks[s]+i.tShift[s],h=i.eMarks[s];if(!i.md.options.allowIndentation&&i.sCount[s]-i.blkIndent>=4||(a=i.src.charCodeAt(f++),a!==42&&a!==45&&a!==95))return!1;for(u=1;f<h;){if(c=i.src.charCodeAt(f++),c!==a&&!t(c))return!1;c===a&&u++}return u<3?!1:(l||(i.line=s+1,d=i.push("hr","hr",0),d.map=[s,i.line],d.markup=Array(u+1).join(String.fromCharCode(a))),!0)}}}),Gy=U({"node_modules/markdown-it/lib/rules_block/list.js"(r,e){var t=de().isSpace;function n(o,l){var a,u,c,d;return u=o.bMarks[l]+o.tShift[l],c=o.eMarks[l],a=o.src.charCodeAt(u++),a!==42&&a!==45&&a!==43||u<c&&(d=o.src.charCodeAt(u),!t(d))?-1:u}function i(o,l){var a,u=o.bMarks[l]+o.tShift[l],c=u,d=o.eMarks[l];if(c+1>=d||(a=o.src.charCodeAt(c++),a<48||a>57))return-1;for(;;){if(c>=d)return-1;if(a=o.src.charCodeAt(c++),a>=48&&a<=57){if(c-u>=10)return-1;continue}if(a===41||a===46)break;return-1}return c<d&&(a=o.src.charCodeAt(c),!t(a))?-1:c}function s(o,l){var a,u,c=o.level+2;for(a=l+2,u=o.tokens.length-2;a<u;a++)o.tokens[a].level===c&&o.tokens[a].type==="paragraph_open"&&(o.tokens[a+2].hidden=!0,o.tokens[a].hidden=!0,a+=2)}e.exports=function(l,a,u,c){var d,f,h,m,p,g,y,x,k,A,v,S,D,_,$,T,I,O,q,B,F,V,Z,re,ce,ye,Se,ae,be=!1,Me=!0;if(!l.md.options.allowIndentation&&l.sCount[a]-l.blkIndent>=4||!l.md.options.allowIndentation&&l.listIndent>=0&&l.sCount[a]-l.listIndent>=4&&l.sCount[a]<l.blkIndent)return!1;if(c&&l.parentType==="paragraph"&&l.sCount[a]>=l.blkIndent&&(be=!0),(Z=i(l,a))>=0){if(y=!0,ce=l.bMarks[a]+l.tShift[a],D=Number(l.src.slice(ce,Z-1)),be&&D!==1)return!1}else if((Z=n(l,a))>=0)y=!1;else return!1;if(be&&l.skipSpaces(Z)>=l.eMarks[a])return!1;if(S=l.src.charCodeAt(Z-1),c)return!0;for(v=l.tokens.length,y?(ae=l.push("ordered_list_open","ol",1),D!==1&&(ae.attrs=[["start",D]])):ae=l.push("bullet_list_open","ul",1),ae.map=A=[a,0],ae.markup=String.fromCharCode(S),$=a,re=!1,Se=l.md.block.ruler.getRules("list"),O=l.parentType,l.parentType="list";$<u;){for(V=Z,_=l.eMarks[$],g=T=l.sCount[$]+Z-(l.bMarks[a]+l.tShift[a]);V<_;){if(d=l.src.charCodeAt(V),d===9)T+=4-(T+l.bsCount[$])%4;else if(d===32)T++;else break;V++}if(f=V,f>=_?p=1:p=T-g,!l.md.options.allowIndentation&&p>4&&(p=1),m=g+p,ae=l.push("list_item_open","li",1),ae.markup=String.fromCharCode(S),ae.map=x=[a,0],y&&(ae.info=l.src.slice(ce,Z-1)),F=l.tight,B=l.tShift[a],q=l.sCount[a],I=l.listIndent,l.listIndent=l.blkIndent,l.blkIndent=m,l.tight=!0,l.tShift[a]=f-l.bMarks[a],l.sCount[a]=T,f>=_&&l.isEmpty(a+1)?l.line=Math.min(l.line+2,u):l.md.block.tokenize(l,a,u,!0),(!l.tight||re)&&(Me=!1),re=l.line-a>1&&l.isEmpty(l.line-1),l.blkIndent=l.listIndent,l.listIndent=I,l.tShift[a]=B,l.sCount[a]=q,l.tight=F,ae=l.push("list_item_close","li",-1),ae.markup=String.fromCharCode(S),$=a=l.line,x[1]=$,f=l.bMarks[a],$>=u||l.sCount[$]<l.blkIndent||!l.md.options.allowIndentation&&l.sCount[a]-l.blkIndent>=4)break;for(ye=!1,h=0,k=Se.length;h<k;h++)if(Se[h](l,$,u,!0)){ye=!0;break}if(ye)break;if(y){if(Z=i(l,$),Z<0)break;ce=l.bMarks[$]+l.tShift[$]}else if(Z=n(l,$),Z<0)break;if(S!==l.src.charCodeAt(Z-1))break}return y?ae=l.push("ordered_list_close","ol",-1):ae=l.push("bullet_list_close","ul",-1),ae.markup=String.fromCharCode(S),A[1]=$,l.line=$,l.parentType=O,Me&&s(l,v),!0}}}),Zy=U({"node_modules/markdown-it/lib/rules_block/reference.js"(r,e){var t=de().normalizeReference,n=de().isSpace;e.exports=function(s,o,l,a){var u,c,d,f,h,m,p,g,y,x,k,A,v,S,D,_,$=0,T=s.bMarks[o]+s.tShift[o],I=s.eMarks[o],O=o+1;if(!s.md.options.allowIndentation&&s.sCount[o]-s.blkIndent>=4||s.src.charCodeAt(T)!==91)return!1;for(;++T<I;)if(s.src.charCodeAt(T)===93&&s.src.charCodeAt(T-1)!==92){if(T+1===I||s.src.charCodeAt(T+1)!==58)return!1;break}for(f=s.lineMax,D=s.md.block.ruler.getRules("reference"),x=s.parentType,s.parentType="reference";O<f&&!s.isEmpty(O);O++)if(!(!s.md.options.allowIndentation&&s.sCount[O]-s.blkIndent>3)&&!(s.sCount[O]<0)){for(S=!1,m=0,p=D.length;m<p;m++)if(D[m](s,O,f,!0)){S=!0;break}if(S)break}for(v=s.getLines(o,O,s.blkIndent,!1).trim(),I=v.length,T=1;T<I;T++){if(u=v.charCodeAt(T),u===91)return!1;if(u===93){y=T;break}else u===10?$++:u===92&&(T++,T<I&&v.charCodeAt(T)===10&&$++)}if(y<0||v.charCodeAt(y+1)!==58)return!1;for(T=y+2;T<I;T++)if(u=v.charCodeAt(T),u===10)$++;else if(!n(u))break;if(k=s.md.helpers.parseLinkDestination(v,T,I),!k.ok||(h=s.md.normalizeLink(k.str),!s.md.validateLink(h)))return!1;for(T=k.pos,$+=k.lines,c=T,d=$,A=T;T<I;T++)if(u=v.charCodeAt(T),u===10)$++;else if(!n(u))break;for(k=s.md.helpers.parseLinkTitle(v,T,I),T<I&&A!==T&&k.ok?(_=k.str,T=k.pos,$+=k.lines):(_="",T=c,$=d);T<I&&(u=v.charCodeAt(T),!!n(u));)T++;if(T<I&&v.charCodeAt(T)!==10&&_)for(_="",T=c,$=d;T<I&&(u=v.charCodeAt(T),!!n(u));)T++;return T<I&&v.charCodeAt(T)!==10||(g=t(v.slice(1,y)),!g)?!1:(a||(typeof s.env.references>"u"&&(s.env.references={}),typeof s.env.references[g]>"u"&&(s.env.references[g]={title:_,href:h}),s.parentType=x,s.line=o+$+1),!0)}}}),Yy=U({"node_modules/markdown-it/lib/common/html_blocks.js"(r,e){e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]}}),Od=U({"node_modules/markdown-it/lib/common/html_re.js"(r,e){var t="[a-zA-Z_:][a-zA-Z0-9:._-]*",n="[^\"'=<>`\\x00-\\x20]+",i="'[^']*'",s='"[^"]*"',o="(?:"+n+"|"+i+"|"+s+")",l="(?:\\s+"+t+"(?:\\s*=\\s*"+o+")?)",a="<[A-Za-z][A-Za-z0-9\\-]*"+l+"*\\s*\\/?>",u="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",c="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",d="<[?][\\s\\S]*?[?]>",f="<![A-Z]+\\s+[^>]*>",h="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",m=new RegExp("^(?:"+a+"|"+u+"|"+c+"|"+d+"|"+f+"|"+h+")"),p=new RegExp("^(?:"+a+"|"+u+")");e.exports.HTML_TAG_RE=m,e.exports.HTML_OPEN_CLOSE_TAG_RE=p}}),Qy=U({"node_modules/markdown-it/lib/rules_block/html_block.js"(r,e){var t=Yy(),n=Od().HTML_OPEN_CLOSE_TAG_RE,i=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+t.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(n.source+"\\s*$"),/^$/,!1]];e.exports=function(o,l,a,u){var c,d,f,h,m=o.bMarks[l]+o.tShift[l],p=o.eMarks[l];if(!o.md.options.allowIndentation&&o.sCount[l]-o.blkIndent>=4||!o.md.options.html||o.src.charCodeAt(m)!==60)return!1;for(h=o.src.slice(m,p),c=0;c<i.length&&!i[c][0].test(h);c++);if(c===i.length)return!1;if(u)return i[c][2];if(d=l+1,!i[c][1].test(h)){for(;d<a&&!(o.sCount[d]<o.blkIndent);d++)if(m=o.bMarks[d]+o.tShift[d],p=o.eMarks[d],h=o.src.slice(m,p),i[c][1].test(h)){h.length!==0&&d++;break}}return o.line=d,f=o.push("html_block","",0),f.map=[l,d],f.content=o.getLines(l,d,o.blkIndent,!0),!0}}}),Xy=U({"node_modules/markdown-it/lib/rules_block/heading.js"(r,e){var t=de().isSpace;e.exports=function(i,s,o,l){var a,u,c,d,f=i.bMarks[s]+i.tShift[s],h=i.eMarks[s];if(!i.md.options.allowIndentation&&i.sCount[s]-i.blkIndent>=4||(a=i.src.charCodeAt(f),a!==35||f>=h))return!1;for(u=1,a=i.src.charCodeAt(++f);a===35&&f<h&&u<=6;)u++,a=i.src.charCodeAt(++f);return u>6||f<h&&!t(a)?!1:(l||(h=i.skipSpacesBack(h,f),c=i.skipCharsBack(h,35,f),c>f&&t(i.src.charCodeAt(c-1))&&(h=c),i.line=s+1,d=i.push("heading_open","h"+String(u),1),d.markup="########".slice(0,u),d.map=[s,i.line],d=i.push("inline","",0),d.content=i.src.slice(f,h).trim(),d.map=[s,i.line],d.children=[],d=i.push("heading_close","h"+String(u),-1),d.markup="########".slice(0,u)),!0)}}}),eb=U({"node_modules/markdown-it/lib/rules_block/lheading.js"(r,e){e.exports=function(n,i,s){var o,l,a,u,c,d,f,h,m,p=i+1,g,y=n.md.block.ruler.getRules("paragraph");if(!n.md.options.allowIndentation&&n.sCount[i]-n.blkIndent>=4)return!1;for(g=n.parentType,n.parentType="paragraph";p<s&&!n.isEmpty(p);p++)if(!(!n.md.options.allowIndentation&&n.sCount[p]-n.blkIndent>3)){if(n.sCount[p]>=n.blkIndent&&(d=n.bMarks[p]+n.tShift[p],f=n.eMarks[p],d<f&&(m=n.src.charCodeAt(d),(m===45||m===61)&&(d=n.skipChars(d,m),d=n.skipSpaces(d),d>=f)))){h=m===61?1:2;break}if(!(n.sCount[p]<0)){for(l=!1,a=0,u=y.length;a<u;a++)if(y[a](n,p,s,!0)){l=!0;break}if(l)break}}return h?(o=n.getLines(i,p,n.blkIndent,!1).trim(),n.line=p+1,c=n.push("heading_open","h"+String(h),1),c.markup=String.fromCharCode(m),c.map=[i,n.line],c=n.push("inline","",0),c.content=o,c.map=[i,n.line-1],c.children=[],c=n.push("heading_close","h"+String(h),-1),c.markup=String.fromCharCode(m),n.parentType=g,!0):!1}}}),tb=U({"node_modules/markdown-it/lib/rules_block/paragraph.js"(r,e){e.exports=function(n,i){var s,o,l,a,u,c,d=i+1,f=n.md.block.ruler.getRules("paragraph"),h=n.lineMax;for(c=n.parentType,n.parentType="paragraph";d<h&&!n.isEmpty(d);d++)if(!(!n.md.options.allowIndentation&&n.sCount[d]-n.blkIndent>3)&&!(n.sCount[d]<0)){for(o=!1,l=0,a=f.length;l<a;l++)if(f[l](n,d,h,!0)){o=!0;break}if(o)break}return s=n.getLines(i,d,n.blkIndent,!1).trim(),n.line=d,u=n.push("paragraph_open","p",1),u.map=[i,n.line],u=n.push("inline","",0),u.content=s,u.map=[i,n.line],u.children=[],u=n.push("paragraph_close","p",-1),n.parentType=c,!0}}}),rb=U({"node_modules/markdown-it/lib/rules_block/state_block.js"(r,e){var t=nl(),n=de().isSpace;function i(s,o,l,a){var u,c,d,f,h,m,p,g;for(this.src=s,this.md=o,this.env=l,this.tokens=a,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",c=this.src,g=!1,d=f=m=p=0,h=c.length;f<h;f++){if(u=c.charCodeAt(f),!g)if(n(u)){m++,u===9?p+=4-p%4:p++;continue}else g=!0;(u===10||f===h-1)&&(u!==10&&f++,this.bMarks.push(d),this.eMarks.push(f),this.tShift.push(m),this.sCount.push(p),this.bsCount.push(0),g=!1,m=0,p=0,d=f+1)}this.bMarks.push(c.length),this.eMarks.push(c.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}i.prototype.push=function(s,o,l){var a=new t(s,o,l);return a.block=!0,l<0&&this.level--,a.level=this.level,l>0&&this.level++,this.tokens.push(a),a},i.prototype.isEmpty=function(o){return this.bMarks[o]+this.tShift[o]>=this.eMarks[o]},i.prototype.skipEmptyLines=function(o){for(var l=this.lineMax;o<l&&!(this.bMarks[o]+this.tShift[o]<this.eMarks[o]);o++);return o},i.prototype.skipSpaces=function(o){for(var l,a=this.src.length;o<a&&(l=this.src.charCodeAt(o),!!n(l));o++);return o},i.prototype.skipSpacesBack=function(o,l){if(o<=l)return o;for(;o>l;)if(!n(this.src.charCodeAt(--o)))return o+1;return o},i.prototype.skipChars=function(o,l){for(var a=this.src.length;o<a&&this.src.charCodeAt(o)===l;o++);return o},i.prototype.skipCharsBack=function(o,l,a){if(o<=a)return o;for(;o>a;)if(l!==this.src.charCodeAt(--o))return o+1;return o},i.prototype.getLines=function(o,l,a,u){var c,d,f,h,m,p,g,y=o;if(o>=l)return"";for(p=new Array(l-o),c=0;y<l;y++,c++){for(d=0,g=h=this.bMarks[y],y+1<l||u?m=this.eMarks[y]+1:m=this.eMarks[y];h<m&&d<a;){if(f=this.src.charCodeAt(h),n(f))f===9?d+=4-(d+this.bsCount[y])%4:d++;else if(h-g<this.tShift[y])d++;else break;h++}d>a?p[c]=new Array(d-a+1).join(" ")+this.src.slice(h,m):p[c]=this.src.slice(h,m)}return p.join("")},i.prototype.Token=t,e.exports=i}}),nb=U({"node_modules/markdown-it/lib/parser_block.js"(r,e){var t=rl(),n=[["table",Hy(),["paragraph","reference"]],["code",Uy()],["fence",Wy(),["paragraph","reference","blockquote","list"]],["blockquote",Ky(),["paragraph","reference","blockquote","list"]],["hr",Jy(),["paragraph","reference","blockquote","list"]],["list",Gy(),["paragraph","reference","blockquote"]],["reference",Zy()],["html_block",Qy(),["paragraph","reference","blockquote"]],["heading",Xy(),["paragraph","reference","blockquote"]],["lheading",eb()],["paragraph",tb()]];function i(){this.ruler=new t;for(var s=0;s<n.length;s++)this.ruler.push(n[s][0],n[s][1],{alt:(n[s][2]||[]).slice()})}i.prototype.tokenize=function(s,o,l){for(var a,u,c=this.ruler.getRules(""),d=c.length,f=o,h=!1,m=s.md.options.maxNesting;f<l&&(s.line=f=s.skipEmptyLines(f),!(f>=l||s.sCount[f]<s.blkIndent));){if(s.level>=m){s.line=l;break}for(u=0;u<d&&(a=c[u](s,f,l,!1),!a);u++);s.tight=!h,s.isEmpty(s.line-1)&&(h=!0),f=s.line,f<l&&s.isEmpty(f)&&(h=!0,f++,s.line=f)}},i.prototype.parse=function(s,o,l,a){var u;s&&(u=new this.State(s,o,l,a),this.tokenize(u,u.line,u.lineMax))},i.prototype.State=rb(),e.exports=i}}),ib=U({"node_modules/markdown-it/lib/rules_inline/text.js"(r,e){function t(n){switch(n){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}e.exports=function(i,s){for(var o=i.pos;o<i.posMax&&!t(i.src.charCodeAt(o));)o++;return o===i.pos?!1:(s||(i.pending+=i.src.slice(i.pos,o)),i.pos=o,!0)}}}),sb=U({"node_modules/markdown-it/lib/rules_inline/newline.js"(r,e){var t=de().isSpace;e.exports=function(i,s){var o,l,a,u=i.pos;if(i.src.charCodeAt(u)!==10)return!1;if(o=i.pending.length-1,l=i.posMax,!s)if(o>=0&&i.pending.charCodeAt(o)===32)if(o>=1&&i.pending.charCodeAt(o-1)===32){for(a=o-1;a>=1&&i.pending.charCodeAt(a-1)===32;)a--;i.pending=i.pending.slice(0,a),i.push("hardbreak","br",0)}else i.pending=i.pending.slice(0,-1),i.push("softbreak","br",0);else i.push("softbreak","br",0);for(u++;u<l&&t(i.src.charCodeAt(u));)u++;return i.pos=u,!0}}}),ob=U({"node_modules/markdown-it/lib/rules_inline/escape.js"(r,e){var t=de().isSpace,n=[];for(i=0;i<256;i++)n.push(0);var i;"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(s){n[s.charCodeAt(0)]=1}),e.exports=function(o,l){var a,u=o.pos,c=o.posMax;if(o.src.charCodeAt(u)!==92)return!1;if(u++,u<c){if(a=o.src.charCodeAt(u),a<256&&n[a]!==0)return l||(o.pending+=o.src[u]),o.pos+=2,!0;if(a===10){for(l||o.push("hardbreak","br",0),u++;u<c&&(a=o.src.charCodeAt(u),!!t(a));)u++;return o.pos=u,!0}}return l||(o.pending+="\\"),o.pos++,!0}}}),lb=U({"node_modules/markdown-it/lib/rules_inline/backticks.js"(r,e){e.exports=function(n,i){var s,o,l,a,u,c,d,f,h=n.pos,m=n.src.charCodeAt(h);if(m!==96)return!1;for(s=h,h++,o=n.posMax;h<o&&n.src.charCodeAt(h)===96;)h++;if(l=n.src.slice(s,h),d=l.length,n.backticksScanned&&(n.backticks[d]||0)<=s)return i||(n.pending+=l),n.pos+=d,!0;for(u=c=h;(u=n.src.indexOf("`",c))!==-1;){for(c=u+1;c<o&&n.src.charCodeAt(c)===96;)c++;if(f=c-u,f===d)return i||(a=n.push("code_inline","code",0),a.markup=l,a.content=n.src.slice(h,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),n.pos=c,!0;n.backticks[f]=u}return n.backticksScanned=!0,i||(n.pending+=l),n.pos+=d,!0}}}),Ya=U({"node_modules/markdown-it/lib/rules_inline/strikethrough.js"(r,e){e.exports.tokenize=function(i,s){var o,l,a,u,c,d=i.pos,f=i.src.charCodeAt(d);if(s||f!==126||(l=i.scanDelims(i.pos,!0),u=l.length,c=String.fromCharCode(f),u<2))return!1;for(u%2&&(a=i.push("text","",0),a.content=c,u--),o=0;o<u;o+=2)a=i.push("text","",0),a.content=c+c,i.delimiters.push({marker:f,length:0,token:i.tokens.length-1,end:-1,open:l.can_open,close:l.can_close});return i.pos+=l.length,!0};function t(n,i){var s,o,l,a,u,c=[],d=i.length;for(s=0;s<d;s++)l=i[s],l.marker===126&&l.end!==-1&&(a=i[l.end],u=n.tokens[l.token],u.type="s_open",u.tag="s",u.nesting=1,u.markup="~~",u.content="",u=n.tokens[a.token],u.type="s_close",u.tag="s",u.nesting=-1,u.markup="~~",u.content="",n.tokens[a.token-1].type==="text"&&n.tokens[a.token-1].content==="~"&&c.push(a.token-1));for(;c.length;){for(s=c.pop(),o=s+1;o<n.tokens.length&&n.tokens[o].type==="s_close";)o++;o--,s!==o&&(u=n.tokens[o],n.tokens[o]=n.tokens[s],n.tokens[s]=u)}}e.exports.postProcess=function(i){var s,o=i.tokens_meta,l=i.tokens_meta.length;for(t(i,i.delimiters),s=0;s<l;s++)o[s]&&o[s].delimiters&&t(i,o[s].delimiters)}}}),Qa=U({"node_modules/markdown-it/lib/rules_inline/emphasis.js"(r,e){e.exports.tokenize=function(i,s){var o,l,a,u=i.pos,c=i.src.charCodeAt(u);if(s||c!==95&&c!==42)return!1;for(l=i.scanDelims(i.pos,c===42),o=0;o<l.length;o++)a=i.push("text","",0),a.content=String.fromCharCode(c),i.delimiters.push({marker:c,length:l.length,token:i.tokens.length-1,end:-1,open:l.can_open,close:l.can_close});return i.pos+=l.length,!0};function t(n,i){var s,o,l,a,u,c,d=i.length;for(s=d-1;s>=0;s--)o=i[s],!(o.marker!==95&&o.marker!==42)&&o.end!==-1&&(l=i[o.end],c=s>0&&i[s-1].end===o.end+1&&i[s-1].marker===o.marker&&i[s-1].token===o.token-1&&i[o.end+1].token===l.token+1,u=String.fromCharCode(o.marker),a=n.tokens[o.token],a.type=c?"strong_open":"em_open",a.tag=c?"strong":"em",a.nesting=1,a.markup=c?u+u:u,a.content="",a=n.tokens[l.token],a.type=c?"strong_close":"em_close",a.tag=c?"strong":"em",a.nesting=-1,a.markup=c?u+u:u,a.content="",c&&(n.tokens[i[s-1].token].content="",n.tokens[i[o.end+1].token].content="",s--))}e.exports.postProcess=function(i){var s,o=i.tokens_meta,l=i.tokens_meta.length;for(t(i,i.delimiters),s=0;s<l;s++)o[s]&&o[s].delimiters&&t(i,o[s].delimiters)}}}),ab=U({"node_modules/markdown-it/lib/rules_inline/link.js"(r,e){var t=de().normalizeReference,n=de().isSpace;e.exports=function(s,o){var l,a,u,c,d,f,h,m,p,g="",y="",x=s.pos,k=s.posMax,A=s.pos,v=!0;if(s.src.charCodeAt(s.pos)!==91||(d=s.pos+1,c=s.md.helpers.parseLinkLabel(s,s.pos,!0),c<0))return!1;if(f=c+1,f<k&&s.src.charCodeAt(f)===40){for(v=!1,f++;f<k&&(a=s.src.charCodeAt(f),!(!n(a)&&a!==10));f++);if(f>=k)return!1;if(A=f,h=s.md.helpers.parseLinkDestination(s.src,f,s.posMax),h.ok){for(g=s.md.normalizeLink(h.str),s.md.validateLink(g)?f=h.pos:g="",A=f;f<k&&(a=s.src.charCodeAt(f),!(!n(a)&&a!==10));f++);if(h=s.md.helpers.parseLinkTitle(s.src,f,s.posMax),f<k&&A!==f&&h.ok)for(y=h.str,f=h.pos;f<k&&(a=s.src.charCodeAt(f),!(!n(a)&&a!==10));f++);}(f>=k||s.src.charCodeAt(f)!==41)&&(v=!0),f++}if(v){if(typeof s.env.references>"u")return!1;if(f<k&&s.src.charCodeAt(f)===91?(A=f+1,f=s.md.helpers.parseLinkLabel(s,f),f>=0?u=s.src.slice(A,f++):f=c+1):f=c+1,u||(u=s.src.slice(d,c)),m=s.env.references[t(u)],!m)return s.pos=x,!1;g=m.href,y=m.title}return o||(s.pos=d,s.posMax=c,p=s.push("link_open","a",1),p.attrs=l=[["href",g]],y&&l.push(["title",y]),s.md.inline.tokenize(s),p=s.push("link_close","a",-1)),s.pos=f,s.posMax=k,!0}}}),ub=U({"node_modules/markdown-it/lib/rules_inline/image.js"(r,e){var t=de().normalizeReference,n=de().isSpace;e.exports=function(s,o){var l,a,u,c,d,f,h,m,p,g,y,x,k,A="",v=s.pos,S=s.posMax;if(s.src.charCodeAt(s.pos)!==33||s.src.charCodeAt(s.pos+1)!==91||(f=s.pos+2,d=s.md.helpers.parseLinkLabel(s,s.pos+1,!1),d<0))return!1;if(h=d+1,h<S&&s.src.charCodeAt(h)===40){for(h++;h<S&&(a=s.src.charCodeAt(h),!(!n(a)&&a!==10));h++);if(h>=S)return!1;for(k=h,p=s.md.helpers.parseLinkDestination(s.src,h,s.posMax),p.ok&&(A=s.md.normalizeLink(p.str),s.md.validateLink(A)?h=p.pos:A=""),k=h;h<S&&(a=s.src.charCodeAt(h),!(!n(a)&&a!==10));h++);if(p=s.md.helpers.parseLinkTitle(s.src,h,s.posMax),h<S&&k!==h&&p.ok)for(g=p.str,h=p.pos;h<S&&(a=s.src.charCodeAt(h),!(!n(a)&&a!==10));h++);else g="";if(h>=S||s.src.charCodeAt(h)!==41)return s.pos=v,!1;h++}else{if(typeof s.env.references>"u")return!1;if(h<S&&s.src.charCodeAt(h)===91?(k=h+1,h=s.md.helpers.parseLinkLabel(s,h),h>=0?c=s.src.slice(k,h++):h=d+1):h=d+1,c||(c=s.src.slice(f,d)),m=s.env.references[t(c)],!m)return s.pos=v,!1;A=m.href,g=m.title}return o||(u=s.src.slice(f,d),s.md.inline.parse(u,s.md,s.env,x=[]),y=s.push("image","img",0),y.attrs=l=[["src",A],["alt",""]],y.children=x,y.content=u,g&&l.push(["title",g])),s.pos=h,s.posMax=S,!0}}}),cb=U({"node_modules/markdown-it/lib/rules_inline/autolink.js"(r,e){var t=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,n=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;e.exports=function(s,o){var l,a,u,c,d,f,h=s.pos;if(s.src.charCodeAt(h)!==60)return!1;for(d=s.pos,f=s.posMax;;){if(++h>=f||(c=s.src.charCodeAt(h),c===60))return!1;if(c===62)break}return l=s.src.slice(d+1,h),n.test(l)?(a=s.md.normalizeLink(l),s.md.validateLink(a)?(o||(u=s.push("link_open","a",1),u.attrs=[["href",a]],u.markup="autolink",u.info="auto",u=s.push("text","",0),u.content=s.md.normalizeLinkText(l),u=s.push("link_close","a",-1),u.markup="autolink",u.info="auto"),s.pos+=l.length+2,!0):!1):t.test(l)?(a=s.md.normalizeLink("mailto:"+l),s.md.validateLink(a)?(o||(u=s.push("link_open","a",1),u.attrs=[["href",a]],u.markup="autolink",u.info="auto",u=s.push("text","",0),u.content=s.md.normalizeLinkText(l),u=s.push("link_close","a",-1),u.markup="autolink",u.info="auto"),s.pos+=l.length+2,!0):!1):!1}}}),db=U({"node_modules/markdown-it/lib/rules_inline/html_inline.js"(r,e){var t=Od().HTML_TAG_RE;function n(i){var s=i|32;return s>=97&&s<=122}e.exports=function(s,o){var l,a,u,c,d=s.pos;return!s.md.options.html||(u=s.posMax,s.src.charCodeAt(d)!==60||d+2>=u)||(l=s.src.charCodeAt(d+1),l!==33&&l!==63&&l!==47&&!n(l))||(a=s.src.slice(d).match(t),!a)?!1:(o||(c=s.push("html_inline","",0),c.content=s.src.slice(d,d+a[0].length)),s.pos+=a[0].length,!0)}}}),fb=U({"node_modules/markdown-it/lib/rules_inline/entity.js"(r,e){var t=Sd(),n=de().has,i=de().isValidEntityCode,s=de().fromCodePoint,o=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,l=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(u,c){var d,f,h,m=u.pos,p=u.posMax;if(u.src.charCodeAt(m)!==38)return!1;if(m+1<p){if(d=u.src.charCodeAt(m+1),d===35){if(h=u.src.slice(m).match(o),h)return c||(f=h[1][0].toLowerCase()==="x"?parseInt(h[1].slice(1),16):parseInt(h[1],10),u.pending+=i(f)?s(f):s(65533)),u.pos+=h[0].length,!0}else if(h=u.src.slice(m).match(l),h&&n(t,h[1]))return c||(u.pending+=t[h[1]]),u.pos+=h[0].length,!0}return c||(u.pending+="&"),u.pos++,!0}}}),hb=U({"node_modules/markdown-it/lib/rules_inline/balance_pairs.js"(r,e){function t(n,i){var s,o,l,a,u,c,d,f,h={},m=i.length;if(m){var p=0,g=-2,y=[];for(s=0;s<m;s++)if(l=i[s],y.push(0),(i[p].marker!==l.marker||g!==l.token-1)&&(p=s),g=l.token,l.length=l.length||0,!!l.close){for(h.hasOwnProperty(l.marker)||(h[l.marker]=[-1,-1,-1,-1,-1,-1]),u=h[l.marker][(l.open?3:0)+l.length%3],o=p-y[p]-1,c=o;o>u;o-=y[o]+1)if(a=i[o],a.marker===l.marker&&a.open&&a.end<0&&(d=!1,(a.close||l.open)&&(a.length+l.length)%3===0&&(a.length%3!==0||l.length%3!==0)&&(d=!0),!d)){f=o>0&&!i[o-1].open?y[o-1]+1:0,y[s]=s-o+f,y[o]=f,l.open=!1,a.end=s,a.close=!1,c=-1,g=-2;break}c!==-1&&(h[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}}e.exports=function(i){var s,o=i.tokens_meta,l=i.tokens_meta.length;for(t(i,i.delimiters),s=0;s<l;s++)o[s]&&o[s].delimiters&&t(i,o[s].delimiters)}}}),pb=U({"node_modules/markdown-it/lib/rules_inline/text_collapse.js"(r,e){e.exports=function(n){var i,s,o=0,l=n.tokens,a=n.tokens.length;for(i=s=0;i<a;i++)l[i].nesting<0&&o--,l[i].level=o,l[i].nesting>0&&o++,l[i].type==="text"&&i+1<a&&l[i+1].type==="text"?l[i+1].content=l[i].content+l[i+1].content:(i!==s&&(l[s]=l[i]),s++);i!==s&&(l.length=s)}}}),mb=U({"node_modules/markdown-it/lib/rules_inline/state_inline.js"(r,e){var t=nl(),n=de().isWhiteSpace,i=de().isPunctChar,s=de().isMdAsciiPunct;function o(l,a,u,c){this.src=l,this.env=u,this.md=a,this.tokens=c,this.tokens_meta=Array(c.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1}o.prototype.pushPending=function(){var l=new t("text","",0);return l.content=this.pending,l.level=this.pendingLevel,this.tokens.push(l),this.pending="",l},o.prototype.push=function(l,a,u){this.pending&&this.pushPending();var c=new t(l,a,u),d=null;return u<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),c.level=this.level,u>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],d={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(c),this.tokens_meta.push(d),c},o.prototype.scanDelims=function(l,a){var u=l,c,d,f,h,m,p,g,y,x,k=!0,A=!0,v=this.posMax,S=this.src.charCodeAt(l);for(c=l>0?this.src.charCodeAt(l-1):32;u<v&&this.src.charCodeAt(u)===S;)u++;return f=u-l,d=u<v?this.src.charCodeAt(u):32,g=s(c)||i(String.fromCharCode(c)),x=s(d)||i(String.fromCharCode(d)),p=n(c),y=n(d),y?k=!1:x&&(p||g||(k=!1)),p?A=!1:g&&(y||x||(A=!1)),a?(h=k,m=A):(h=k&&(!A||g),m=A&&(!k||x)),{can_open:h,can_close:m,length:f}},o.prototype.Token=t,e.exports=o}}),gb=U({"node_modules/markdown-it/lib/parser_inline.js"(r,e){var t=rl(),n=[["text",ib()],["newline",sb()],["escape",ob()],["backticks",lb()],["strikethrough",Ya().tokenize],["emphasis",Qa().tokenize],["link",ab()],["image",ub()],["autolink",cb()],["html_inline",db()],["entity",fb()]],i=[["balance_pairs",hb()],["strikethrough",Ya().postProcess],["emphasis",Qa().postProcess],["text_collapse",pb()]];function s(){var o;for(this.ruler=new t,o=0;o<n.length;o++)this.ruler.push(n[o][0],n[o][1]);for(this.ruler2=new t,o=0;o<i.length;o++)this.ruler2.push(i[o][0],i[o][1])}s.prototype.skipToken=function(o){var l,a,u=o.pos,c=this.ruler.getRules(""),d=c.length,f=o.md.options.maxNesting,h=o.cache;if(typeof h[u]<"u"){o.pos=h[u];return}if(o.level<f)for(a=0;a<d&&(o.level++,l=c[a](o,!0),o.level--,!l);a++);else o.pos=o.posMax;l||o.pos++,h[u]=o.pos},s.prototype.tokenize=function(o){for(var l,a,u=this.ruler.getRules(""),c=u.length,d=o.posMax,f=o.md.options.maxNesting;o.pos<d;){if(o.level<f)for(a=0;a<c&&(l=u[a](o,!1),!l);a++);if(l){if(o.pos>=d)break;continue}o.pending+=o.src[o.pos++]}o.pending&&o.pushPending()},s.prototype.parse=function(o,l,a,u){var c,d,f,h=new this.State(o,l,a,u);for(this.tokenize(h),d=this.ruler2.getRules(""),f=d.length,c=0;c<f;c++)d[c](h)},s.prototype.State=mb(),e.exports=s}}),yb=U({"node_modules/linkify-it/lib/re.js"(r,e){e.exports=function(t){var n={};n.src_Any=_d().source,n.src_Cc=Td().source,n.src_Z=Md().source,n.src_P=tl().source,n.src_ZPCc=[n.src_Z,n.src_P,n.src_Cc].join("|"),n.src_ZCc=[n.src_Z,n.src_Cc].join("|");var i="[><|]";return n.src_pseudo_letter="(?:(?!"+i+"|"+n.src_ZPCc+")"+n.src_Any+")",n.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",n.src_auth="(?:(?:(?!"+n.src_ZCc+"|[@/\\[\\]()]).)+@)?",n.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",n.src_host_terminator="(?=$|"+i+"|"+n.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+n.src_ZPCc+"))",n.src_path="(?:[/?#](?:(?!"+n.src_ZCc+"|"+i+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+n.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+n.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+n.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+n.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+n.src_ZCc+"|[']).)+\\'|\\'(?="+n.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+n.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+n.src_ZCc+").|;(?!"+n.src_ZCc+").|\\!+(?!"+n.src_ZCc+"|[!]).|\\?(?!"+n.src_ZCc+"|[?]).)+|\\/)?",n.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',n.src_xn="xn--[a-z0-9\\-]{1,59}",n.src_domain_root="(?:"+n.src_xn+"|"+n.src_pseudo_letter+"{1,63})",n.src_domain="(?:"+n.src_xn+"|(?:"+n.src_pseudo_letter+")|(?:"+n.src_pseudo_letter+"(?:-|"+n.src_pseudo_letter+"){0,61}"+n.src_pseudo_letter+"))",n.src_host="(?:(?:(?:(?:"+n.src_domain+")\\.)*"+n.src_domain+"))",n.tpl_host_fuzzy="(?:"+n.src_ip4+"|(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%)))",n.tpl_host_no_ip_fuzzy="(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%))",n.src_host_strict=n.src_host+n.src_host_terminator,n.tpl_host_fuzzy_strict=n.tpl_host_fuzzy+n.src_host_terminator,n.src_host_port_strict=n.src_host+n.src_port+n.src_host_terminator,n.tpl_host_port_fuzzy_strict=n.tpl_host_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_port_no_ip_fuzzy_strict=n.tpl_host_no_ip_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+n.src_ZPCc+"|>|$))",n.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+n.src_ZCc+")("+n.src_email_name+"@"+n.tpl_host_fuzzy_strict+")",n.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_fuzzy_strict+n.src_path+")",n.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_no_ip_fuzzy_strict+n.src_path+")",n}}}),bb=U({"node_modules/linkify-it/index.js"(r,e){function t(v){var S=Array.prototype.slice.call(arguments,1);return S.forEach(function(D){D&&Object.keys(D).forEach(function(_){v[_]=D[_]})}),v}function n(v){return Object.prototype.toString.call(v)}function i(v){return n(v)==="[object String]"}function s(v){return n(v)==="[object Object]"}function o(v){return n(v)==="[object RegExp]"}function l(v){return n(v)==="[object Function]"}function a(v){return v.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var u={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function c(v){return Object.keys(v||{}).reduce(function(S,D){return S||u.hasOwnProperty(D)},!1)}var d={"http:":{validate:function(v,S,D){var _=v.slice(S);return D.re.http||(D.re.http=new RegExp("^\\/\\/"+D.re.src_auth+D.re.src_host_port_strict+D.re.src_path,"i")),D.re.http.test(_)?_.match(D.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(v,S,D){var _=v.slice(S);return D.re.no_http||(D.re.no_http=new RegExp("^"+D.re.src_auth+"(?:localhost|(?:(?:"+D.re.src_domain+")\\.)+"+D.re.src_domain_root+")"+D.re.src_port+D.re.src_host_terminator+D.re.src_path,"i")),D.re.no_http.test(_)?S>=3&&v[S-3]===":"||S>=3&&v[S-3]==="/"?0:_.match(D.re.no_http)[0].length:0}},"mailto:":{validate:function(v,S,D){var _=v.slice(S);return D.re.mailto||(D.re.mailto=new RegExp("^"+D.re.src_email_name+"@"+D.re.src_host_strict,"i")),D.re.mailto.test(_)?_.match(D.re.mailto)[0].length:0}}},f="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",h="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function m(v){v.__index__=-1,v.__text_cache__=""}function p(v){return function(S,D){var _=S.slice(D);return v.test(_)?_.match(v)[0].length:0}}function g(){return function(v,S){S.normalize(v)}}function y(v){var S=v.re=yb()(v.__opts__),D=v.__tlds__.slice();v.onCompile(),v.__tlds_replaced__||D.push(f),D.push(S.src_xn),S.src_tlds=D.join("|");function _(O){return O.replace("%TLDS%",S.src_tlds)}S.email_fuzzy=RegExp(_(S.tpl_email_fuzzy),"i"),S.link_fuzzy=RegExp(_(S.tpl_link_fuzzy),"i"),S.link_no_ip_fuzzy=RegExp(_(S.tpl_link_no_ip_fuzzy),"i"),S.host_fuzzy_test=RegExp(_(S.tpl_host_fuzzy_test),"i");var $=[];v.__compiled__={};function T(O,q){throw new Error('(LinkifyIt) Invalid schema "'+O+'": '+q)}Object.keys(v.__schemas__).forEach(function(O){var q=v.__schemas__[O];if(q!==null){var B={validate:null,link:null};if(v.__compiled__[O]=B,s(q)){o(q.validate)?B.validate=p(q.validate):l(q.validate)?B.validate=q.validate:T(O,q),l(q.normalize)?B.normalize=q.normalize:q.normalize?T(O,q):B.normalize=g();return}if(i(q)){$.push(O);return}T(O,q)}}),$.forEach(function(O){v.__compiled__[v.__schemas__[O]]&&(v.__compiled__[O].validate=v.__compiled__[v.__schemas__[O]].validate,v.__compiled__[O].normalize=v.__compiled__[v.__schemas__[O]].normalize)}),v.__compiled__[""]={validate:null,normalize:g()};var I=Object.keys(v.__compiled__).filter(function(O){return O.length>0&&v.__compiled__[O]}).map(a).join("|");v.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+S.src_ZPCc+"))("+I+")","i"),v.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+S.src_ZPCc+"))("+I+")","ig"),v.re.pretest=RegExp("("+v.re.schema_test.source+")|("+v.re.host_fuzzy_test.source+")|@","i"),m(v)}function x(v,S){var D=v.__index__,_=v.__last_index__,$=v.__text_cache__.slice(D,_);this.schema=v.__schema__.toLowerCase(),this.index=D+S,this.lastIndex=_+S,this.raw=$,this.text=$,this.url=$}function k(v,S){var D=new x(v,S);return v.__compiled__[D.schema].normalize(D,v),D}function A(v,S){if(!(this instanceof A))return new A(v,S);S||c(v)&&(S=v,v={}),this.__opts__=t({},u,S),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=t({},d,v),this.__compiled__={},this.__tlds__=h,this.__tlds_replaced__=!1,this.re={},y(this)}A.prototype.add=function(S,D){return this.__schemas__[S]=D,y(this),this},A.prototype.set=function(S){return this.__opts__=t(this.__opts__,S),this},A.prototype.test=function(S){if(this.__text_cache__=S,this.__index__=-1,!S.length)return!1;var D,_,$,T,I,O,q,B,F;if(this.re.schema_test.test(S)){for(q=this.re.schema_search,q.lastIndex=0;(D=q.exec(S))!==null;)if(T=this.testSchemaAt(S,D[2],q.lastIndex),T){this.__schema__=D[2],this.__index__=D.index+D[1].length,this.__last_index__=D.index+D[0].length+T;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(B=S.search(this.re.host_fuzzy_test),B>=0&&(this.__index__<0||B<this.__index__)&&(_=S.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(I=_.index+_[1].length,(this.__index__<0||I<this.__index__)&&(this.__schema__="",this.__index__=I,this.__last_index__=_.index+_[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(F=S.indexOf("@"),F>=0&&($=S.match(this.re.email_fuzzy))!==null&&(I=$.index+$[1].length,O=$.index+$[0].length,(this.__index__<0||I<this.__index__||I===this.__index__&&O>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=I,this.__last_index__=O))),this.__index__>=0},A.prototype.pretest=function(S){return this.re.pretest.test(S)},A.prototype.testSchemaAt=function(S,D,_){return this.__compiled__[D.toLowerCase()]?this.__compiled__[D.toLowerCase()].validate(S,_,this):0},A.prototype.match=function(S){var D=0,_=[];this.__index__>=0&&this.__text_cache__===S&&(_.push(k(this,D)),D=this.__last_index__);for(var $=D?S.slice(D):S;this.test($);)_.push(k(this,D)),$=$.slice(this.__last_index__),D+=this.__last_index__;return _.length?_:null},A.prototype.tlds=function(S,D){return S=Array.isArray(S)?S:[S],D?(this.__tlds__=this.__tlds__.concat(S).sort().filter(function(_,$,T){return _!==T[$-1]}).reverse(),y(this),this):(this.__tlds__=S.slice(),this.__tlds_replaced__=!0,y(this),this)},A.prototype.normalize=function(S){S.schema||(S.url="http://"+S.url),S.schema==="mailto:"&&!/^mailto:/i.test(S.url)&&(S.url="mailto:"+S.url)},A.prototype.onCompile=function(){},e.exports=A}}),kb=U({"node_modules/punycode/punycode.js"(r,e){var t=2147483647,n=36,i=1,s=26,o=38,l=700,a=72,u=128,c="-",d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=n-i,g=Math.floor,y=String.fromCharCode;function x(F){throw new RangeError(m[F])}function k(F,V){const Z=[];let re=F.length;for(;re--;)Z[re]=V(F[re]);return Z}function A(F,V){const Z=F.split("@");let re="";Z.length>1&&(re=Z[0]+"@",F=Z[1]),F=F.replace(h,".");const ce=F.split("."),ye=k(ce,V).join(".");return re+ye}function v(F){const V=[];let Z=0;const re=F.length;for(;Z<re;){const ce=F.charCodeAt(Z++);if(ce>=55296&&ce<=56319&&Z<re){const ye=F.charCodeAt(Z++);(ye&64512)==56320?V.push(((ce&1023)<<10)+(ye&1023)+65536):(V.push(ce),Z--)}else V.push(ce)}return V}var S=F=>String.fromCodePoint(...F),D=function(F){return F>=48&&F<58?26+(F-48):F>=65&&F<91?F-65:F>=97&&F<123?F-97:n},_=function(F,V){return F+22+75*(F<26)-((V!=0)<<5)},$=function(F,V,Z){let re=0;for(F=Z?g(F/l):F>>1,F+=g(F/V);F>p*s>>1;re+=n)F=g(F/p);return g(re+(p+1)*F/(F+o))},T=function(F){const V=[],Z=F.length;let re=0,ce=u,ye=a,Se=F.lastIndexOf(c);Se<0&&(Se=0);for(let ae=0;ae<Se;++ae)F.charCodeAt(ae)>=128&&x("not-basic"),V.push(F.charCodeAt(ae));for(let ae=Se>0?Se+1:0;ae<Z;){const be=re;for(let Oe=1,Ke=n;;Ke+=n){ae>=Z&&x("invalid-input");const ht=D(F.charCodeAt(ae++));ht>=n&&x("invalid-input"),ht>g((t-re)/Oe)&&x("overflow"),re+=ht*Oe;const _t=Ke<=ye?i:Ke>=ye+s?s:Ke-ye;if(ht<_t)break;const lr=n-_t;Oe>g(t/lr)&&x("overflow"),Oe*=lr}const Me=V.length+1;ye=$(re-be,Me,be==0),g(re/Me)>t-ce&&x("overflow"),ce+=g(re/Me),re%=Me,V.splice(re++,0,ce)}return String.fromCodePoint(...V)},I=function(F){const V=[];F=v(F);const Z=F.length;let re=u,ce=0,ye=a;for(const be of F)be<128&&V.push(y(be));const Se=V.length;let ae=Se;for(Se&&V.push(c);ae<Z;){let be=t;for(const Oe of F)Oe>=re&&Oe<be&&(be=Oe);const Me=ae+1;be-re>g((t-ce)/Me)&&x("overflow"),ce+=(be-re)*Me,re=be;for(const Oe of F)if(Oe<re&&++ce>t&&x("overflow"),Oe===re){let Ke=ce;for(let ht=n;;ht+=n){const _t=ht<=ye?i:ht>=ye+s?s:ht-ye;if(Ke<_t)break;const lr=Ke-_t,In=n-_t;V.push(y(_(_t+lr%In,0))),Ke=g(lr/In)}V.push(y(_(Ke,0))),ye=$(ce,Me,ae===Se),ce=0,++ae}++ce,++re}return V.join("")},O=function(F){return A(F,function(V){return d.test(V)?T(V.slice(4).toLowerCase()):V})},q=function(F){return A(F,function(V){return f.test(V)?"xn--"+I(V):V})},B={version:"2.3.1",ucs2:{decode:v,encode:S},decode:T,encode:I,toASCII:q,toUnicode:O};e.exports=B}}),vb=U({"node_modules/markdown-it/lib/presets/default.js"(r,e){e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}}}),xb=U({"node_modules/markdown-it/lib/presets/zero.js"(r,e){e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}}}),Cb=U({"node_modules/markdown-it/lib/presets/commonmark.js"(r,e){e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}}}),Nd=U({"node_modules/markdown-it/lib/index.js"(r,e){var t=de(),n=By(),i=Fy(),s=jy(),o=nb(),l=gb(),a=bb(),u=Dd(),c=kb(),d={default:vb(),zero:xb(),commonmark:Cb()},f=/^(vbscript|javascript|file|data):/,h=/^data:image\/(gif|png|jpeg|webp);/;function m(k){var A=k.trim().toLowerCase();return f.test(A)?!!h.test(A):!0}var p=["http:","https:","mailto:"];function g(k){var A=u.parse(k,!0);if(A.hostname&&(!A.protocol||p.indexOf(A.protocol)>=0))try{A.hostname=c.toASCII(A.hostname)}catch{}return u.encode(u.format(A))}function y(k){var A=u.parse(k,!0);if(A.hostname&&(!A.protocol||p.indexOf(A.protocol)>=0))try{A.hostname=c.toUnicode(A.hostname)}catch{}return u.decode(u.format(A),u.decode.defaultChars+"%")}function x(k,A){if(!(this instanceof x))return new x(k,A);A||t.isString(k)||(A=k||{},k="default"),this.inline=new l,this.block=new o,this.core=new s,this.renderer=new i,this.linkify=new a,this.validateLink=m,this.normalizeLink=g,this.normalizeLinkText=y,this.utils=t,this.helpers=t.assign({},n),this.options={},this.configure(k),A&&this.set(A)}x.prototype.set=function(k){return t.assign(this.options,k),this},x.prototype.configure=function(k){var A=this,v;if(t.isString(k)&&(v=k,k=d[v],!k))throw new Error('Wrong `markdown-it` preset "'+v+'", check name');if(!k)throw new Error("Wrong `markdown-it` preset, can't be empty");return k.options&&A.set(k.options),k.components&&Object.keys(k.components).forEach(function(S){k.components[S].rules&&A[S].ruler.enableOnly(k.components[S].rules),k.components[S].rules2&&A[S].ruler2.enableOnly(k.components[S].rules2)}),this},x.prototype.enable=function(k,A){var v=[];Array.isArray(k)||(k=[k]),["core","block","inline"].forEach(function(D){v=v.concat(this[D].ruler.enable(k,!0))},this),v=v.concat(this.inline.ruler2.enable(k,!0));var S=k.filter(function(D){return v.indexOf(D)<0});if(S.length&&!A)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+S);return this},x.prototype.disable=function(k,A){var v=[];Array.isArray(k)||(k=[k]),["core","block","inline"].forEach(function(D){v=v.concat(this[D].ruler.disable(k,!0))},this),v=v.concat(this.inline.ruler2.disable(k,!0));var S=k.filter(function(D){return v.indexOf(D)<0});if(S.length&&!A)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+S);return this},x.prototype.use=function(k){var A=[this].concat(Array.prototype.slice.call(arguments,1));return k.apply(k,A),this},x.prototype.parse=function(k,A){if(typeof k!="string")throw new Error("Input data should be a String");var v=new this.core.State(k,this,A);return this.core.process(v),v.tokens},x.prototype.render=function(k,A){return A=A||{},this.renderer.render(this.parse(k,A),this.options,A)},x.prototype.parseInline=function(k,A){var v=new this.core.State(k,this,A);return v.inlineMode=!0,this.core.process(v),v.tokens},x.prototype.renderInline=function(k,A){return A=A||{},this.renderer.render(this.parseInline(k,A),this.options,A)},e.exports=x}}),Ab=U({"node_modules/markdown-it/index.js"(r,e){e.exports=Nd()}}),Id={};wd(Id,{getAstValues:()=>mo,isAst:()=>il,isFunction:()=>wb,isVariable:()=>Eb,resolve:()=>An});function il(r){return!!(r!=null&&r.$$mdtype)}function wb(r){return(r==null?void 0:r.$$mdtype)==="Function"}function Eb(r){return(r==null?void 0:r.$$mdtype)==="Variable"}function*mo(r){if(!(r==null||typeof r!="object")){if(Array.isArray(r))for(const e of r)yield*mo(e);if(il(r)&&(yield r),Object.getPrototypeOf(r)===Object.prototype)for(const e of Object.values(r))yield*mo(e)}}function An(r,e={}){if(r==null||typeof r!="object")return r;if(Array.isArray(r))return r.map(n=>An(n,e));if(il(r)&&(r==null?void 0:r.resolve)instanceof Function)return r.resolve(e);if(Object.getPrototypeOf(r)!==Object.prototype)return r;const t={};for(const[n,i]of Object.entries(r))t[n]=An(i,e);return t}var Pr,Dt=(Pr=class{constructor(e="div",t={},n=[]){this.$$mdtype="Tag",this.name=e,this.attributes=t,this.children=n}},Pr.isTag=e=>(e==null?void 0:e.$$mdtype)==="Tag",Pr),Sb=class{validate(r,e,t){return typeof r=="string"||typeof r=="object"?[]:[{id:"attribute-type-invalid",level:"error",message:`Attribute '${t}' must be type 'string | object'`}]}transform(r){if(!r||typeof r=="string")return r;const e=[];for(const[t,n]of Object.entries(r??{}))n&&e.push(t);return e.join(" ")}},Db=class{validate(r){return typeof r=="string"&&r.match(/^[a-zA-Z]/)?[]:[{id:"attribute-value-invalid",level:"error",message:"The 'id' attribute must start with a letter"}]}},Xa=ds(Ed()),fs=class{constructor(r=[]){this.$$mdtype="Variable",this.path=r}resolve({variables:r}={}){return r instanceof Function?r(this.path):this.path.reduce((e={},t)=>e[t],r)}},hs=class{constructor(r,e){this.$$mdtype="Function",this.name=r,this.parameters=e}resolve(r={}){var n,i;const e=(n=r==null?void 0:r.functions)==null?void 0:n[this.name];if(!e)return null;const t=An(this.parameters,r);return(i=e.transform)==null?void 0:i.call(e,t,r)}},Re="{%",Et="%}",_b=/^[a-zA-Z0-9_-]+$/;function bi(r){return typeof r=="string"&&_b.test(r)}function xr(r){return r&&typeof r=="object"&&typeof r.then=="function"}function On(r,e=0){let t=0;for(let n=e;n<r.length;n++){const i=r[n];switch(t){case 1:switch(i){case'"':t=0;break;case"\\":t=2;break}break;case 2:t=1;break;case 0:if(i==='"')t=1;else if(r.startsWith(Et,n))return n}}return null}function Tb(r,e){for(let t=0;t<r.length;t++){if(!r.startsWith(Re,t))continue;if(On(r,t)===null){t+=Re.length-1;continue}let i=t;for(;i>0&&!/\s/.test(r[i-1]);)i--;for(const s of e)if(r.slice(i,t).includes(`${s}://`))return!0;return!1}return!1}function Mb(r,e,t){try{return(0,Xa.parse)(r,{Variable:fs,Function:hs})}catch(n){if(!(n instanceof Xa.SyntaxError))throw n;const{message:i,location:{start:s,end:o}}=n,l={start:{line:e,character:s.offset+t},end:{line:e+1,character:o.offset+t}};return{type:"error",meta:{error:{message:i,location:l}}}}}function Bd(r,e=0){let t=e+1;const n=[];let i=0;for(let s=0;s<r.length;s++){if(r[s]===`
113
- `){t++;continue}if(!r.startsWith(Re,s))continue;const o=On(r,s);if(o==null){s=s+Re.length;continue}const l=r.slice(s,o+Et.length),a=r.slice(s+Re.length,o),u=r.lastIndexOf(`
110
+ `);return c},o.prototype.render=function(l,a,u){var c,d,f,h="",m=this.rules;for(c=0,d=l.length;c<d;c++)f=l[c].type,f==="inline"?h+=this.renderInline(l[c].children,a,u):typeof m[f]<"u"?h+=m[l[c].type](l,c,a,u,this):h+=this.renderToken(l,c,a,u);return h},e.exports=o}}),nl=W({"node_modules/markdown-it/lib/ruler.js"(r,e){function t(){this.__rules__=[],this.__cache__=null}t.prototype.__find__=function(n){for(var i=0;i<this.__rules__.length;i++)if(this.__rules__[i].name===n)return i;return-1},t.prototype.__compile__=function(){var n=this,i=[""];n.__rules__.forEach(function(s){s.enabled&&s.alt.forEach(function(o){i.indexOf(o)<0&&i.push(o)})}),n.__cache__={},i.forEach(function(s){n.__cache__[s]=[],n.__rules__.forEach(function(o){o.enabled&&(s&&o.alt.indexOf(s)<0||n.__cache__[s].push(o.fn))})})},t.prototype.at=function(n,i,s){var o=this.__find__(n),l=s||{};if(o===-1)throw new Error("Parser rule not found: "+n);this.__rules__[o].fn=i,this.__rules__[o].alt=l.alt||[],this.__cache__=null},t.prototype.before=function(n,i,s,o){var l=this.__find__(n),a=o||{};if(l===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(l,0,{name:i,enabled:!0,fn:s,alt:a.alt||[]}),this.__cache__=null},t.prototype.after=function(n,i,s,o){var l=this.__find__(n),a=o||{};if(l===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(l+1,0,{name:i,enabled:!0,fn:s,alt:a.alt||[]}),this.__cache__=null},t.prototype.push=function(n,i,s){var o=s||{};this.__rules__.push({name:n,enabled:!0,fn:i,alt:o.alt||[]}),this.__cache__=null},t.prototype.enable=function(n,i){Array.isArray(n)||(n=[n]);var s=[];return n.forEach(function(o){var l=this.__find__(o);if(l<0){if(i)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[l].enabled=!0,s.push(o)},this),this.__cache__=null,s},t.prototype.enableOnly=function(n,i){Array.isArray(n)||(n=[n]),this.__rules__.forEach(function(s){s.enabled=!1}),this.enable(n,i)},t.prototype.disable=function(n,i){Array.isArray(n)||(n=[n]);var s=[];return n.forEach(function(o){var l=this.__find__(o);if(l<0){if(i)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[l].enabled=!1,s.push(o)},this),this.__cache__=null,s},t.prototype.getRules=function(n){return this.__cache__===null&&this.__compile__(),this.__cache__[n]||[]},e.exports=t}}),Wy=W({"node_modules/markdown-it/lib/rules_core/normalize.js"(r,e){var t=/\r\n?|\n/g,n=/\0/g;e.exports=function(s){var o;o=s.src.replace(t,`
111
+ `),o=o.replace(n,"�"),s.src=o}}}),Ky=W({"node_modules/markdown-it/lib/rules_core/block.js"(r,e){e.exports=function(n){var i;n.inlineMode?(i=new n.Token("inline","",0),i.content=n.src,i.map=[0,1],i.children=[],n.tokens.push(i)):n.md.block.parse(n.src,n.md,n.env,n.tokens)}}}),Jy=W({"node_modules/markdown-it/lib/rules_core/inline.js"(r,e){e.exports=function(n){var i=n.tokens,s,o,l;for(o=0,l=i.length;o<l;o++)s=i[o],s.type==="inline"&&n.md.inline.parse(s.content,n.md,n.env,s.children)}}}),Gy=W({"node_modules/markdown-it/lib/rules_core/linkify.js"(r,e){var t=de().arrayReplaceAt;function n(s){return/^<a[>\s]/i.test(s)}function i(s){return/^<\/a\s*>/i.test(s)}e.exports=function(o){var l,a,u,c,d,f,h,m,p,g,b,E,v,D,x,k,C=o.tokens,w;if(o.md.options.linkify){for(a=0,u=C.length;a<u;a++)if(!(C[a].type!=="inline"||!o.md.linkify.pretest(C[a].content)))for(c=C[a].children,v=0,l=c.length-1;l>=0;l--){if(f=c[l],f.type==="link_close"){for(l--;c[l].level!==f.level&&c[l].type!=="link_open";)l--;continue}if(f.type==="html_inline"&&(n(f.content)&&v>0&&v--,i(f.content)&&v++),!(v>0)&&f.type==="text"&&o.md.linkify.test(f.content)){for(p=f.content,w=o.md.linkify.match(p),h=[],E=f.level,b=0,m=0;m<w.length;m++)D=w[m].url,x=o.md.normalizeLink(D),o.md.validateLink(x)&&(k=w[m].text,w[m].schema?w[m].schema==="mailto:"&&!/^mailto:/i.test(k)?k=o.md.normalizeLinkText("mailto:"+k).replace(/^mailto:/,""):k=o.md.normalizeLinkText(k):k=o.md.normalizeLinkText("http://"+k).replace(/^http:\/\//,""),g=w[m].index,g>b&&(d=new o.Token("text","",0),d.content=p.slice(b,g),d.level=E,h.push(d)),d=new o.Token("link_open","a",1),d.attrs=[["href",x]],d.level=E++,d.markup="linkify",d.info="auto",h.push(d),d=new o.Token("text","",0),d.content=k,d.level=E,h.push(d),d=new o.Token("link_close","a",-1),d.level=--E,d.markup="linkify",d.info="auto",h.push(d),b=w[m].lastIndex);b<p.length&&(d=new o.Token("text","",0),d.content=p.slice(b),d.level=E,h.push(d)),C[a].children=c=t(c,l,h)}}}}}}),Zy=W({"node_modules/markdown-it/lib/rules_core/replacements.js"(r,e){var t=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,n=/\((c|tm|r|p)\)/i,i=/\((c|tm|r|p)\)/ig,s={c:"©",r:"®",p:"§",tm:"™"};function o(u,c){return s[c.toLowerCase()]}function l(u){var c,d,f=0;for(c=u.length-1;c>=0;c--)d=u[c],d.type==="text"&&!f&&(d.content=d.content.replace(i,o)),d.type==="link_open"&&d.info==="auto"&&f--,d.type==="link_close"&&d.info==="auto"&&f++}function a(u){var c,d,f=0;for(c=u.length-1;c>=0;c--)d=u[c],d.type==="text"&&!f&&t.test(d.content)&&(d.content=d.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),d.type==="link_open"&&d.info==="auto"&&f--,d.type==="link_close"&&d.info==="auto"&&f++}e.exports=function(c){var d;if(c.md.options.typographer)for(d=c.tokens.length-1;d>=0;d--)c.tokens[d].type==="inline"&&(n.test(c.tokens[d].content)&&l(c.tokens[d].children),t.test(c.tokens[d].content)&&a(c.tokens[d].children))}}}),Yy=W({"node_modules/markdown-it/lib/rules_core/smartquotes.js"(r,e){var t=de().isWhiteSpace,n=de().isPunctChar,i=de().isMdAsciiPunct,s=/['"]/,o=/['"]/g,l="’";function a(c,d,f){return c.substr(0,d)+f+c.substr(d+1)}function u(c,d){var f,h,m,p,g,b,E,v,D,x,k,C,w,I,T,B,O,q,F,R,j;for(F=[],f=0;f<c.length;f++){for(h=c[f],E=c[f].level,O=F.length-1;O>=0&&!(F[O].level<=E);O--);if(F.length=O+1,h.type==="text"){m=h.content,g=0,b=m.length;e:for(;g<b&&(o.lastIndex=g,p=o.exec(m),!!p);){if(T=B=!0,g=p.index+1,q=p[0]==="'",D=32,p.index-1>=0)D=m.charCodeAt(p.index-1);else for(O=f-1;O>=0&&!(c[O].type==="softbreak"||c[O].type==="hardbreak");O--)if(c[O].content){D=c[O].content.charCodeAt(c[O].content.length-1);break}if(x=32,g<b)x=m.charCodeAt(g);else for(O=f+1;O<c.length&&!(c[O].type==="softbreak"||c[O].type==="hardbreak");O++)if(c[O].content){x=c[O].content.charCodeAt(0);break}if(k=i(D)||n(String.fromCharCode(D)),C=i(x)||n(String.fromCharCode(x)),w=t(D),I=t(x),I?T=!1:C&&(w||k||(T=!1)),w?B=!1:k&&(I||C||(B=!1)),x===34&&p[0]==='"'&&D>=48&&D<=57&&(B=T=!1),T&&B&&(T=k,B=C),!T&&!B){q&&(h.content=a(h.content,p.index,l));continue}if(B){for(O=F.length-1;O>=0&&(v=F[O],!(F[O].level<E));O--)if(v.single===q&&F[O].level===E){v=F[O],q?(R=d.md.options.quotes[2],j=d.md.options.quotes[3]):(R=d.md.options.quotes[0],j=d.md.options.quotes[1]),h.content=a(h.content,p.index,j),c[v.token].content=a(c[v.token].content,v.pos,R),g+=j.length-1,v.token===f&&(g+=R.length-1),m=h.content,b=m.length,F.length=O;continue e}}T?F.push({token:f,pos:p.index,single:q,level:E}):B&&q&&(h.content=a(h.content,p.index,l))}}}}e.exports=function(d){var f;if(d.md.options.typographer)for(f=d.tokens.length-1;f>=0;f--)d.tokens[f].type!=="inline"||!s.test(d.tokens[f].content)||u(d.tokens[f].children,d)}}}),il=W({"node_modules/markdown-it/lib/token.js"(r,e){function t(n,i,s){this.type=n,this.tag=i,this.attrs=null,this.map=null,this.nesting=s,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}t.prototype.attrIndex=function(i){var s,o,l;if(!this.attrs)return-1;for(s=this.attrs,o=0,l=s.length;o<l;o++)if(s[o][0]===i)return o;return-1},t.prototype.attrPush=function(i){this.attrs?this.attrs.push(i):this.attrs=[i]},t.prototype.attrSet=function(i,s){var o=this.attrIndex(i),l=[i,s];o<0?this.attrPush(l):this.attrs[o]=l},t.prototype.attrGet=function(i){var s=this.attrIndex(i),o=null;return s>=0&&(o=this.attrs[s][1]),o},t.prototype.attrJoin=function(i,s){var o=this.attrIndex(i);o<0?this.attrPush([i,s]):this.attrs[o][1]=this.attrs[o][1]+" "+s},e.exports=t}}),Qy=W({"node_modules/markdown-it/lib/rules_core/state_core.js"(r,e){var t=il();function n(i,s,o){this.src=i,this.env=o,this.tokens=[],this.inlineMode=!1,this.md=s}n.prototype.Token=t,e.exports=n}}),Xy=W({"node_modules/markdown-it/lib/parser_core.js"(r,e){var t=nl(),n=[["normalize",Wy()],["block",Ky()],["inline",Jy()],["linkify",Gy()],["replacements",Zy()],["smartquotes",Yy()]];function i(){this.ruler=new t;for(var s=0;s<n.length;s++)this.ruler.push(n[s][0],n[s][1])}i.prototype.process=function(s){var o,l,a;for(a=this.ruler.getRules(""),o=0,l=a.length;o<l;o++)a[o](s)},i.prototype.State=Qy(),e.exports=i}}),eb=W({"node_modules/markdown-it/lib/rules_block/table.js"(r,e){var t=de().isSpace;function n(s,o){var l=s.bMarks[o]+s.tShift[o],a=s.eMarks[o];return s.src.substr(l,a-l)}function i(s){var o=[],l=0,a=s.length,u,c=!1,d=0,f="";for(u=s.charCodeAt(l);l<a;)u===124&&(c?(f+=s.substring(d,l-1),d=l):(o.push(f+s.substring(d,l)),f="",d=l+1)),c=u===92,l++,u=s.charCodeAt(l);return o.push(f+s.substring(d)),o}e.exports=function(o,l,a,u){var c,d,f,h,m,p,g,b,E,v,D,x,k,C,w,I,T,B;if(l+2>a||(p=l+1,o.sCount[p]<o.blkIndent)||!o.md.options.allowIndentation&&o.sCount[p]-o.blkIndent>=4||(f=o.bMarks[p]+o.tShift[p],f>=o.eMarks[p])||(T=o.src.charCodeAt(f++),T!==124&&T!==45&&T!==58)||f>=o.eMarks[p]||(B=o.src.charCodeAt(f++),B!==124&&B!==45&&B!==58&&!t(B))||T===45&&t(B))return!1;for(;f<o.eMarks[p];){if(c=o.src.charCodeAt(f),c!==124&&c!==45&&c!==58&&!t(c))return!1;f++}for(d=n(o,l+1),g=d.split("|"),v=[],h=0;h<g.length;h++){if(D=g[h].trim(),!D){if(h===0||h===g.length-1)continue;return!1}if(!/^:?-+:?$/.test(D))return!1;D.charCodeAt(D.length-1)===58?v.push(D.charCodeAt(0)===58?"center":"right"):D.charCodeAt(0)===58?v.push("left"):v.push("")}if(d=n(o,l).trim(),d.indexOf("|")===-1||!o.md.options.allowIndentation&&o.sCount[l]-o.blkIndent>=4||(g=i(d),g.length&&g[0]===""&&g.shift(),g.length&&g[g.length-1]===""&&g.pop(),b=g.length,b===0||b!==v.length))return!1;if(u)return!0;for(C=o.parentType,o.parentType="table",I=o.md.block.ruler.getRules("blockquote"),E=o.push("table_open","table",1),E.map=x=[l,0],E=o.push("thead_open","thead",1),E.map=[l,l+1],E=o.push("tr_open","tr",1),E.map=[l,l+1],h=0;h<g.length;h++)E=o.push("th_open","th",1),v[h]&&(E.attrs=[["style","text-align:"+v[h]]]),E=o.push("inline","",0),E.content=g[h].trim(),E.children=[],E=o.push("th_close","th",-1);for(E=o.push("tr_close","tr",-1),E=o.push("thead_close","thead",-1),p=l+2;p<a&&!(o.sCount[p]<o.blkIndent);p++){for(w=!1,h=0,m=I.length;h<m;h++)if(I[h](o,p,a,!0)){w=!0;break}if(w||(d=n(o,p).trim(),!d)||!o.md.options.allowIndentation&&o.sCount[p]-o.blkIndent>=4)break;for(g=i(d),g.length&&g[0]===""&&g.shift(),g.length&&g[g.length-1]===""&&g.pop(),p===l+2&&(E=o.push("tbody_open","tbody",1),E.map=k=[l+2,0]),E=o.push("tr_open","tr",1),E.map=[p,p+1],h=0;h<b;h++)E=o.push("td_open","td",1),v[h]&&(E.attrs=[["style","text-align:"+v[h]]]),E=o.push("inline","",0),E.content=g[h]?g[h].trim():"",E.children=[],E=o.push("td_close","td",-1);E=o.push("tr_close","tr",-1)}return k&&(E=o.push("tbody_close","tbody",-1),k[1]=p),E=o.push("table_close","table",-1),x[1]=p,o.parentType=C,o.line=p,!0}}}),tb=W({"node_modules/markdown-it/lib/rules_block/code.js"(r,e){e.exports=function(n,i,s){if(n.md.options.allowIndentation)return!1;var o,l,a;if(n.sCount[i]-n.blkIndent<4)return!1;for(l=o=i+1;o<s;){if(n.isEmpty(o)){o++;continue}if(n.sCount[o]-n.blkIndent>=4){o++,l=o;continue}break}return n.line=l,a=n.push("code_block","code",0),a.content=n.getLines(i,l,4+n.blkIndent,!1)+`
112
+ `,a.map=[i,n.line],!0}}}),rb=W({"node_modules/markdown-it/lib/rules_block/fence.js"(r,e){e.exports=function(n,i,s,o){var l,a,u,c,d,f,h,m=!1,p=n.bMarks[i]+n.tShift[i],g=n.eMarks[i];if(!n.md.options.allowIndentation&&n.sCount[i]-n.blkIndent>=4||p+3>g||(l=n.src.charCodeAt(p),l!==126&&l!==96)||(d=p,p=n.skipChars(p,l),a=p-d,a<3)||(h=n.src.slice(d,p),u=n.src.slice(p,g),l===96&&u.indexOf(String.fromCharCode(l))>=0))return!1;if(o)return!0;for(c=i;c++,!(c>=s||(p=d=n.bMarks[c]+n.tShift[c],g=n.eMarks[c],p<g&&n.sCount[c]<n.blkIndent));)if(n.src.charCodeAt(p)===l&&!(!n.md.options.allowIndentation&&n.sCount[c]-n.blkIndent>=4)&&(p=n.skipChars(p,l),!(p-d<a)&&(p=n.skipSpaces(p),!(p<g)))){m=!0;break}return a=n.sCount[i],n.line=c+(m?1:0),f=n.push("fence","code",0),f.info=u,f.content=n.getLines(i+1,c,a,!0),f.markup=h,f.map=[i,n.line],!0}}}),nb=W({"node_modules/markdown-it/lib/rules_block/blockquote.js"(r,e){var t=de().isSpace;e.exports=function(i,s,o,l){var a,u,c,d,f,h,m,p,g,b,E,v,D,x,k,C,w,I,T,B,O=i.lineMax,q=i.bMarks[s]+i.tShift[s],F=i.eMarks[s];if(!i.md.options.allowIndentation&&i.sCount[s]-i.blkIndent>=4||i.src.charCodeAt(q++)!==62)return!1;if(l)return!0;for(d=g=i.sCount[s]+1,i.src.charCodeAt(q)===32?(q++,d++,g++,a=!1,C=!0):i.src.charCodeAt(q)===9?(C=!0,(i.bsCount[s]+g)%4===3?(q++,d++,g++,a=!1):a=!0):C=!1,b=[i.bMarks[s]],i.bMarks[s]=q;q<F&&(u=i.src.charCodeAt(q),t(u));){u===9?g+=4-(g+i.bsCount[s]+(a?1:0))%4:g++;q++}for(E=[i.bsCount[s]],i.bsCount[s]=i.sCount[s]+1+(C?1:0),h=q>=F,x=[i.sCount[s]],i.sCount[s]=g-d,k=[i.tShift[s]],i.tShift[s]=q-i.bMarks[s],I=i.md.block.ruler.getRules("blockquote"),D=i.parentType,i.parentType="blockquote",p=s+1;p<o&&(B=i.sCount[p]<i.blkIndent,q=i.bMarks[p]+i.tShift[p],F=i.eMarks[p],!(q>=F));p++){if(i.src.charCodeAt(q++)===62&&!B){for(d=g=i.sCount[p]+1,i.src.charCodeAt(q)===32?(q++,d++,g++,a=!1,C=!0):i.src.charCodeAt(q)===9?(C=!0,(i.bsCount[p]+g)%4===3?(q++,d++,g++,a=!1):a=!0):C=!1,b.push(i.bMarks[p]),i.bMarks[p]=q;q<F&&(u=i.src.charCodeAt(q),t(u));){u===9?g+=4-(g+i.bsCount[p]+(a?1:0))%4:g++;q++}h=q>=F,E.push(i.bsCount[p]),i.bsCount[p]=i.sCount[p]+1+(C?1:0),x.push(i.sCount[p]),i.sCount[p]=g-d,k.push(i.tShift[p]),i.tShift[p]=q-i.bMarks[p];continue}if(h)break;for(w=!1,c=0,f=I.length;c<f;c++)if(I[c](i,p,o,!0)){w=!0;break}if(w){i.lineMax=p,i.blkIndent!==0&&(b.push(i.bMarks[p]),E.push(i.bsCount[p]),k.push(i.tShift[p]),x.push(i.sCount[p]),i.sCount[p]-=i.blkIndent);break}b.push(i.bMarks[p]),E.push(i.bsCount[p]),k.push(i.tShift[p]),x.push(i.sCount[p]),i.sCount[p]=-1}for(v=i.blkIndent,i.blkIndent=0,T=i.push("blockquote_open","blockquote",1),T.markup=">",T.map=m=[s,0],i.md.block.tokenize(i,s,p),T=i.push("blockquote_close","blockquote",-1),T.markup=">",i.lineMax=O,i.parentType=D,m[1]=i.line,c=0;c<k.length;c++)i.bMarks[c+s]=b[c],i.tShift[c+s]=k[c],i.sCount[c+s]=x[c],i.bsCount[c+s]=E[c];return i.blkIndent=v,!0}}}),ib=W({"node_modules/markdown-it/lib/rules_block/hr.js"(r,e){var t=de().isSpace;e.exports=function(i,s,o,l){var a,u,c,d,f=i.bMarks[s]+i.tShift[s],h=i.eMarks[s];if(!i.md.options.allowIndentation&&i.sCount[s]-i.blkIndent>=4||(a=i.src.charCodeAt(f++),a!==42&&a!==45&&a!==95))return!1;for(u=1;f<h;){if(c=i.src.charCodeAt(f++),c!==a&&!t(c))return!1;c===a&&u++}return u<3?!1:(l||(i.line=s+1,d=i.push("hr","hr",0),d.map=[s,i.line],d.markup=Array(u+1).join(String.fromCharCode(a))),!0)}}}),sb=W({"node_modules/markdown-it/lib/rules_block/list.js"(r,e){var t=de().isSpace;function n(o,l){var a,u,c,d;return u=o.bMarks[l]+o.tShift[l],c=o.eMarks[l],a=o.src.charCodeAt(u++),a!==42&&a!==45&&a!==43||u<c&&(d=o.src.charCodeAt(u),!t(d))?-1:u}function i(o,l){var a,u=o.bMarks[l]+o.tShift[l],c=u,d=o.eMarks[l];if(c+1>=d||(a=o.src.charCodeAt(c++),a<48||a>57))return-1;for(;;){if(c>=d)return-1;if(a=o.src.charCodeAt(c++),a>=48&&a<=57){if(c-u>=10)return-1;continue}if(a===41||a===46)break;return-1}return c<d&&(a=o.src.charCodeAt(c),!t(a))?-1:c}function s(o,l){var a,u,c=o.level+2;for(a=l+2,u=o.tokens.length-2;a<u;a++)o.tokens[a].level===c&&o.tokens[a].type==="paragraph_open"&&(o.tokens[a+2].hidden=!0,o.tokens[a].hidden=!0,a+=2)}e.exports=function(l,a,u,c){var d,f,h,m,p,g,b,E,v,D,x,k,C,w,I,T,B,O,q,F,R,j,Y,re,ce,ye,Se,ae,be=!1,Me=!0;if(!l.md.options.allowIndentation&&l.sCount[a]-l.blkIndent>=4||!l.md.options.allowIndentation&&l.listIndent>=0&&l.sCount[a]-l.listIndent>=4&&l.sCount[a]<l.blkIndent)return!1;if(c&&l.parentType==="paragraph"&&l.sCount[a]>=l.blkIndent&&(be=!0),(Y=i(l,a))>=0){if(b=!0,ce=l.bMarks[a]+l.tShift[a],C=Number(l.src.slice(ce,Y-1)),be&&C!==1)return!1}else if((Y=n(l,a))>=0)b=!1;else return!1;if(be&&l.skipSpaces(Y)>=l.eMarks[a])return!1;if(k=l.src.charCodeAt(Y-1),c)return!0;for(x=l.tokens.length,b?(ae=l.push("ordered_list_open","ol",1),C!==1&&(ae.attrs=[["start",C]])):ae=l.push("bullet_list_open","ul",1),ae.map=D=[a,0],ae.markup=String.fromCharCode(k),I=a,re=!1,Se=l.md.block.ruler.getRules("list"),O=l.parentType,l.parentType="list";I<u;){for(j=Y,w=l.eMarks[I],g=T=l.sCount[I]+Y-(l.bMarks[a]+l.tShift[a]);j<w;){if(d=l.src.charCodeAt(j),d===9)T+=4-(T+l.bsCount[I])%4;else if(d===32)T++;else break;j++}if(f=j,f>=w?p=1:p=T-g,!l.md.options.allowIndentation&&p>4&&(p=1),m=g+p,ae=l.push("list_item_open","li",1),ae.markup=String.fromCharCode(k),ae.map=E=[a,0],b&&(ae.info=l.src.slice(ce,Y-1)),R=l.tight,F=l.tShift[a],q=l.sCount[a],B=l.listIndent,l.listIndent=l.blkIndent,l.blkIndent=m,l.tight=!0,l.tShift[a]=f-l.bMarks[a],l.sCount[a]=T,f>=w&&l.isEmpty(a+1)?l.line=Math.min(l.line+2,u):l.md.block.tokenize(l,a,u,!0),(!l.tight||re)&&(Me=!1),re=l.line-a>1&&l.isEmpty(l.line-1),l.blkIndent=l.listIndent,l.listIndent=B,l.tShift[a]=F,l.sCount[a]=q,l.tight=R,ae=l.push("list_item_close","li",-1),ae.markup=String.fromCharCode(k),I=a=l.line,E[1]=I,f=l.bMarks[a],I>=u||l.sCount[I]<l.blkIndent||!l.md.options.allowIndentation&&l.sCount[a]-l.blkIndent>=4)break;for(ye=!1,h=0,v=Se.length;h<v;h++)if(Se[h](l,I,u,!0)){ye=!0;break}if(ye)break;if(b){if(Y=i(l,I),Y<0)break;ce=l.bMarks[I]+l.tShift[I]}else if(Y=n(l,I),Y<0)break;if(k!==l.src.charCodeAt(Y-1))break}return b?ae=l.push("ordered_list_close","ol",-1):ae=l.push("bullet_list_close","ul",-1),ae.markup=String.fromCharCode(k),D[1]=I,l.line=I,l.parentType=O,Me&&s(l,x),!0}}}),ob=W({"node_modules/markdown-it/lib/rules_block/reference.js"(r,e){var t=de().normalizeReference,n=de().isSpace;e.exports=function(s,o,l,a){var u,c,d,f,h,m,p,g,b,E,v,D,x,k,C,w,I=0,T=s.bMarks[o]+s.tShift[o],B=s.eMarks[o],O=o+1;if(!s.md.options.allowIndentation&&s.sCount[o]-s.blkIndent>=4||s.src.charCodeAt(T)!==91)return!1;for(;++T<B;)if(s.src.charCodeAt(T)===93&&s.src.charCodeAt(T-1)!==92){if(T+1===B||s.src.charCodeAt(T+1)!==58)return!1;break}for(f=s.lineMax,C=s.md.block.ruler.getRules("reference"),E=s.parentType,s.parentType="reference";O<f&&!s.isEmpty(O);O++)if(!(!s.md.options.allowIndentation&&s.sCount[O]-s.blkIndent>3)&&!(s.sCount[O]<0)){for(k=!1,m=0,p=C.length;m<p;m++)if(C[m](s,O,f,!0)){k=!0;break}if(k)break}for(x=s.getLines(o,O,s.blkIndent,!1).trim(),B=x.length,T=1;T<B;T++){if(u=x.charCodeAt(T),u===91)return!1;if(u===93){b=T;break}else u===10?I++:u===92&&(T++,T<B&&x.charCodeAt(T)===10&&I++)}if(b<0||x.charCodeAt(b+1)!==58)return!1;for(T=b+2;T<B;T++)if(u=x.charCodeAt(T),u===10)I++;else if(!n(u))break;if(v=s.md.helpers.parseLinkDestination(x,T,B),!v.ok||(h=s.md.normalizeLink(v.str),!s.md.validateLink(h)))return!1;for(T=v.pos,I+=v.lines,c=T,d=I,D=T;T<B;T++)if(u=x.charCodeAt(T),u===10)I++;else if(!n(u))break;for(v=s.md.helpers.parseLinkTitle(x,T,B),T<B&&D!==T&&v.ok?(w=v.str,T=v.pos,I+=v.lines):(w="",T=c,I=d);T<B&&(u=x.charCodeAt(T),!!n(u));)T++;if(T<B&&x.charCodeAt(T)!==10&&w)for(w="",T=c,I=d;T<B&&(u=x.charCodeAt(T),!!n(u));)T++;return T<B&&x.charCodeAt(T)!==10||(g=t(x.slice(1,b)),!g)?!1:(a||(typeof s.env.references>"u"&&(s.env.references={}),typeof s.env.references[g]>"u"&&(s.env.references[g]={title:w,href:h}),s.parentType=E,s.line=o+I+1),!0)}}}),lb=W({"node_modules/markdown-it/lib/common/html_blocks.js"(r,e){e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]}}),Id=W({"node_modules/markdown-it/lib/common/html_re.js"(r,e){var t="[a-zA-Z_:][a-zA-Z0-9:._-]*",n="[^\"'=<>`\\x00-\\x20]+",i="'[^']*'",s='"[^"]*"',o="(?:"+n+"|"+i+"|"+s+")",l="(?:\\s+"+t+"(?:\\s*=\\s*"+o+")?)",a="<[A-Za-z][A-Za-z0-9\\-]*"+l+"*\\s*\\/?>",u="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",c="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",d="<[?][\\s\\S]*?[?]>",f="<![A-Z]+\\s+[^>]*>",h="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",m=new RegExp("^(?:"+a+"|"+u+"|"+c+"|"+d+"|"+f+"|"+h+")"),p=new RegExp("^(?:"+a+"|"+u+")");e.exports.HTML_TAG_RE=m,e.exports.HTML_OPEN_CLOSE_TAG_RE=p}}),ab=W({"node_modules/markdown-it/lib/rules_block/html_block.js"(r,e){var t=lb(),n=Id().HTML_OPEN_CLOSE_TAG_RE,i=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+t.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(n.source+"\\s*$"),/^$/,!1]];e.exports=function(o,l,a,u){var c,d,f,h,m=o.bMarks[l]+o.tShift[l],p=o.eMarks[l];if(!o.md.options.allowIndentation&&o.sCount[l]-o.blkIndent>=4||!o.md.options.html||o.src.charCodeAt(m)!==60)return!1;for(h=o.src.slice(m,p),c=0;c<i.length&&!i[c][0].test(h);c++);if(c===i.length)return!1;if(u)return i[c][2];if(d=l+1,!i[c][1].test(h)){for(;d<a&&!(o.sCount[d]<o.blkIndent);d++)if(m=o.bMarks[d]+o.tShift[d],p=o.eMarks[d],h=o.src.slice(m,p),i[c][1].test(h)){h.length!==0&&d++;break}}return o.line=d,f=o.push("html_block","",0),f.map=[l,d],f.content=o.getLines(l,d,o.blkIndent,!0),!0}}}),ub=W({"node_modules/markdown-it/lib/rules_block/heading.js"(r,e){var t=de().isSpace;e.exports=function(i,s,o,l){var a,u,c,d,f=i.bMarks[s]+i.tShift[s],h=i.eMarks[s];if(!i.md.options.allowIndentation&&i.sCount[s]-i.blkIndent>=4||(a=i.src.charCodeAt(f),a!==35||f>=h))return!1;for(u=1,a=i.src.charCodeAt(++f);a===35&&f<h&&u<=6;)u++,a=i.src.charCodeAt(++f);return u>6||f<h&&!t(a)?!1:(l||(h=i.skipSpacesBack(h,f),c=i.skipCharsBack(h,35,f),c>f&&t(i.src.charCodeAt(c-1))&&(h=c),i.line=s+1,d=i.push("heading_open","h"+String(u),1),d.markup="########".slice(0,u),d.map=[s,i.line],d=i.push("inline","",0),d.content=i.src.slice(f,h).trim(),d.map=[s,i.line],d.children=[],d=i.push("heading_close","h"+String(u),-1),d.markup="########".slice(0,u)),!0)}}}),cb=W({"node_modules/markdown-it/lib/rules_block/lheading.js"(r,e){e.exports=function(n,i,s){var o,l,a,u,c,d,f,h,m,p=i+1,g,b=n.md.block.ruler.getRules("paragraph");if(!n.md.options.allowIndentation&&n.sCount[i]-n.blkIndent>=4)return!1;for(g=n.parentType,n.parentType="paragraph";p<s&&!n.isEmpty(p);p++)if(!(!n.md.options.allowIndentation&&n.sCount[p]-n.blkIndent>3)){if(n.sCount[p]>=n.blkIndent&&(d=n.bMarks[p]+n.tShift[p],f=n.eMarks[p],d<f&&(m=n.src.charCodeAt(d),(m===45||m===61)&&(d=n.skipChars(d,m),d=n.skipSpaces(d),d>=f)))){h=m===61?1:2;break}if(!(n.sCount[p]<0)){for(l=!1,a=0,u=b.length;a<u;a++)if(b[a](n,p,s,!0)){l=!0;break}if(l)break}}return h?(o=n.getLines(i,p,n.blkIndent,!1).trim(),n.line=p+1,c=n.push("heading_open","h"+String(h),1),c.markup=String.fromCharCode(m),c.map=[i,n.line],c=n.push("inline","",0),c.content=o,c.map=[i,n.line-1],c.children=[],c=n.push("heading_close","h"+String(h),-1),c.markup=String.fromCharCode(m),n.parentType=g,!0):!1}}}),db=W({"node_modules/markdown-it/lib/rules_block/paragraph.js"(r,e){e.exports=function(n,i){var s,o,l,a,u,c,d=i+1,f=n.md.block.ruler.getRules("paragraph"),h=n.lineMax;for(c=n.parentType,n.parentType="paragraph";d<h&&!n.isEmpty(d);d++)if(!(!n.md.options.allowIndentation&&n.sCount[d]-n.blkIndent>3)&&!(n.sCount[d]<0)){for(o=!1,l=0,a=f.length;l<a;l++)if(f[l](n,d,h,!0)){o=!0;break}if(o)break}return s=n.getLines(i,d,n.blkIndent,!1).trim(),n.line=d,u=n.push("paragraph_open","p",1),u.map=[i,n.line],u=n.push("inline","",0),u.content=s,u.map=[i,n.line],u.children=[],u=n.push("paragraph_close","p",-1),n.parentType=c,!0}}}),fb=W({"node_modules/markdown-it/lib/rules_block/state_block.js"(r,e){var t=il(),n=de().isSpace;function i(s,o,l,a){var u,c,d,f,h,m,p,g;for(this.src=s,this.md=o,this.env=l,this.tokens=a,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",c=this.src,g=!1,d=f=m=p=0,h=c.length;f<h;f++){if(u=c.charCodeAt(f),!g)if(n(u)){m++,u===9?p+=4-p%4:p++;continue}else g=!0;(u===10||f===h-1)&&(u!==10&&f++,this.bMarks.push(d),this.eMarks.push(f),this.tShift.push(m),this.sCount.push(p),this.bsCount.push(0),g=!1,m=0,p=0,d=f+1)}this.bMarks.push(c.length),this.eMarks.push(c.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}i.prototype.push=function(s,o,l){var a=new t(s,o,l);return a.block=!0,l<0&&this.level--,a.level=this.level,l>0&&this.level++,this.tokens.push(a),a},i.prototype.isEmpty=function(o){return this.bMarks[o]+this.tShift[o]>=this.eMarks[o]},i.prototype.skipEmptyLines=function(o){for(var l=this.lineMax;o<l&&!(this.bMarks[o]+this.tShift[o]<this.eMarks[o]);o++);return o},i.prototype.skipSpaces=function(o){for(var l,a=this.src.length;o<a&&(l=this.src.charCodeAt(o),!!n(l));o++);return o},i.prototype.skipSpacesBack=function(o,l){if(o<=l)return o;for(;o>l;)if(!n(this.src.charCodeAt(--o)))return o+1;return o},i.prototype.skipChars=function(o,l){for(var a=this.src.length;o<a&&this.src.charCodeAt(o)===l;o++);return o},i.prototype.skipCharsBack=function(o,l,a){if(o<=a)return o;for(;o>a;)if(l!==this.src.charCodeAt(--o))return o+1;return o},i.prototype.getLines=function(o,l,a,u){var c,d,f,h,m,p,g,b=o;if(o>=l)return"";for(p=new Array(l-o),c=0;b<l;b++,c++){for(d=0,g=h=this.bMarks[b],b+1<l||u?m=this.eMarks[b]+1:m=this.eMarks[b];h<m&&d<a;){if(f=this.src.charCodeAt(h),n(f))f===9?d+=4-(d+this.bsCount[b])%4:d++;else if(h-g<this.tShift[b])d++;else break;h++}d>a?p[c]=new Array(d-a+1).join(" ")+this.src.slice(h,m):p[c]=this.src.slice(h,m)}return p.join("")},i.prototype.Token=t,e.exports=i}}),hb=W({"node_modules/markdown-it/lib/parser_block.js"(r,e){var t=nl(),n=[["table",eb(),["paragraph","reference"]],["code",tb()],["fence",rb(),["paragraph","reference","blockquote","list"]],["blockquote",nb(),["paragraph","reference","blockquote","list"]],["hr",ib(),["paragraph","reference","blockquote","list"]],["list",sb(),["paragraph","reference","blockquote"]],["reference",ob()],["html_block",ab(),["paragraph","reference","blockquote"]],["heading",ub(),["paragraph","reference","blockquote"]],["lheading",cb()],["paragraph",db()]];function i(){this.ruler=new t;for(var s=0;s<n.length;s++)this.ruler.push(n[s][0],n[s][1],{alt:(n[s][2]||[]).slice()})}i.prototype.tokenize=function(s,o,l){for(var a,u,c=this.ruler.getRules(""),d=c.length,f=o,h=!1,m=s.md.options.maxNesting;f<l&&(s.line=f=s.skipEmptyLines(f),!(f>=l||s.sCount[f]<s.blkIndent));){if(s.level>=m){s.line=l;break}for(u=0;u<d&&(a=c[u](s,f,l,!1),!a);u++);s.tight=!h,s.isEmpty(s.line-1)&&(h=!0),f=s.line,f<l&&s.isEmpty(f)&&(h=!0,f++,s.line=f)}},i.prototype.parse=function(s,o,l,a){var u;s&&(u=new this.State(s,o,l,a),this.tokenize(u,u.line,u.lineMax))},i.prototype.State=fb(),e.exports=i}}),pb=W({"node_modules/markdown-it/lib/rules_inline/text.js"(r,e){function t(n){switch(n){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}e.exports=function(i,s){for(var o=i.pos;o<i.posMax&&!t(i.src.charCodeAt(o));)o++;return o===i.pos?!1:(s||(i.pending+=i.src.slice(i.pos,o)),i.pos=o,!0)}}}),mb=W({"node_modules/markdown-it/lib/rules_inline/newline.js"(r,e){var t=de().isSpace;e.exports=function(i,s){var o,l,a,u=i.pos;if(i.src.charCodeAt(u)!==10)return!1;if(o=i.pending.length-1,l=i.posMax,!s)if(o>=0&&i.pending.charCodeAt(o)===32)if(o>=1&&i.pending.charCodeAt(o-1)===32){for(a=o-1;a>=1&&i.pending.charCodeAt(a-1)===32;)a--;i.pending=i.pending.slice(0,a),i.push("hardbreak","br",0)}else i.pending=i.pending.slice(0,-1),i.push("softbreak","br",0);else i.push("softbreak","br",0);for(u++;u<l&&t(i.src.charCodeAt(u));)u++;return i.pos=u,!0}}}),gb=W({"node_modules/markdown-it/lib/rules_inline/escape.js"(r,e){var t=de().isSpace,n=[];for(i=0;i<256;i++)n.push(0);var i;"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(s){n[s.charCodeAt(0)]=1}),e.exports=function(o,l){var a,u=o.pos,c=o.posMax;if(o.src.charCodeAt(u)!==92)return!1;if(u++,u<c){if(a=o.src.charCodeAt(u),a<256&&n[a]!==0)return l||(o.pending+=o.src[u]),o.pos+=2,!0;if(a===10){for(l||o.push("hardbreak","br",0),u++;u<c&&(a=o.src.charCodeAt(u),!!t(a));)u++;return o.pos=u,!0}}return l||(o.pending+="\\"),o.pos++,!0}}}),yb=W({"node_modules/markdown-it/lib/rules_inline/backticks.js"(r,e){e.exports=function(n,i){var s,o,l,a,u,c,d,f,h=n.pos,m=n.src.charCodeAt(h);if(m!==96)return!1;for(s=h,h++,o=n.posMax;h<o&&n.src.charCodeAt(h)===96;)h++;if(l=n.src.slice(s,h),d=l.length,n.backticksScanned&&(n.backticks[d]||0)<=s)return i||(n.pending+=l),n.pos+=d,!0;for(u=c=h;(u=n.src.indexOf("`",c))!==-1;){for(c=u+1;c<o&&n.src.charCodeAt(c)===96;)c++;if(f=c-u,f===d)return i||(a=n.push("code_inline","code",0),a.markup=l,a.content=n.src.slice(h,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),n.pos=c,!0;n.backticks[f]=u}return n.backticksScanned=!0,i||(n.pending+=l),n.pos+=d,!0}}}),Qa=W({"node_modules/markdown-it/lib/rules_inline/strikethrough.js"(r,e){e.exports.tokenize=function(i,s){var o,l,a,u,c,d=i.pos,f=i.src.charCodeAt(d);if(s||f!==126||(l=i.scanDelims(i.pos,!0),u=l.length,c=String.fromCharCode(f),u<2))return!1;for(u%2&&(a=i.push("text","",0),a.content=c,u--),o=0;o<u;o+=2)a=i.push("text","",0),a.content=c+c,i.delimiters.push({marker:f,length:0,token:i.tokens.length-1,end:-1,open:l.can_open,close:l.can_close});return i.pos+=l.length,!0};function t(n,i){var s,o,l,a,u,c=[],d=i.length;for(s=0;s<d;s++)l=i[s],l.marker===126&&l.end!==-1&&(a=i[l.end],u=n.tokens[l.token],u.type="s_open",u.tag="s",u.nesting=1,u.markup="~~",u.content="",u=n.tokens[a.token],u.type="s_close",u.tag="s",u.nesting=-1,u.markup="~~",u.content="",n.tokens[a.token-1].type==="text"&&n.tokens[a.token-1].content==="~"&&c.push(a.token-1));for(;c.length;){for(s=c.pop(),o=s+1;o<n.tokens.length&&n.tokens[o].type==="s_close";)o++;o--,s!==o&&(u=n.tokens[o],n.tokens[o]=n.tokens[s],n.tokens[s]=u)}}e.exports.postProcess=function(i){var s,o=i.tokens_meta,l=i.tokens_meta.length;for(t(i,i.delimiters),s=0;s<l;s++)o[s]&&o[s].delimiters&&t(i,o[s].delimiters)}}}),Xa=W({"node_modules/markdown-it/lib/rules_inline/emphasis.js"(r,e){e.exports.tokenize=function(i,s){var o,l,a,u=i.pos,c=i.src.charCodeAt(u);if(s||c!==95&&c!==42)return!1;for(l=i.scanDelims(i.pos,c===42),o=0;o<l.length;o++)a=i.push("text","",0),a.content=String.fromCharCode(c),i.delimiters.push({marker:c,length:l.length,token:i.tokens.length-1,end:-1,open:l.can_open,close:l.can_close});return i.pos+=l.length,!0};function t(n,i){var s,o,l,a,u,c,d=i.length;for(s=d-1;s>=0;s--)o=i[s],!(o.marker!==95&&o.marker!==42)&&o.end!==-1&&(l=i[o.end],c=s>0&&i[s-1].end===o.end+1&&i[s-1].marker===o.marker&&i[s-1].token===o.token-1&&i[o.end+1].token===l.token+1,u=String.fromCharCode(o.marker),a=n.tokens[o.token],a.type=c?"strong_open":"em_open",a.tag=c?"strong":"em",a.nesting=1,a.markup=c?u+u:u,a.content="",a=n.tokens[l.token],a.type=c?"strong_close":"em_close",a.tag=c?"strong":"em",a.nesting=-1,a.markup=c?u+u:u,a.content="",c&&(n.tokens[i[s-1].token].content="",n.tokens[i[o.end+1].token].content="",s--))}e.exports.postProcess=function(i){var s,o=i.tokens_meta,l=i.tokens_meta.length;for(t(i,i.delimiters),s=0;s<l;s++)o[s]&&o[s].delimiters&&t(i,o[s].delimiters)}}}),bb=W({"node_modules/markdown-it/lib/rules_inline/link.js"(r,e){var t=de().normalizeReference,n=de().isSpace;e.exports=function(s,o){var l,a,u,c,d,f,h,m,p,g="",b="",E=s.pos,v=s.posMax,D=s.pos,x=!0;if(s.src.charCodeAt(s.pos)!==91||(d=s.pos+1,c=s.md.helpers.parseLinkLabel(s,s.pos,!0),c<0))return!1;if(f=c+1,f<v&&s.src.charCodeAt(f)===40){for(x=!1,f++;f<v&&(a=s.src.charCodeAt(f),!(!n(a)&&a!==10));f++);if(f>=v)return!1;if(D=f,h=s.md.helpers.parseLinkDestination(s.src,f,s.posMax),h.ok){for(g=s.md.normalizeLink(h.str),s.md.validateLink(g)?f=h.pos:g="",D=f;f<v&&(a=s.src.charCodeAt(f),!(!n(a)&&a!==10));f++);if(h=s.md.helpers.parseLinkTitle(s.src,f,s.posMax),f<v&&D!==f&&h.ok)for(b=h.str,f=h.pos;f<v&&(a=s.src.charCodeAt(f),!(!n(a)&&a!==10));f++);}(f>=v||s.src.charCodeAt(f)!==41)&&(x=!0),f++}if(x){if(typeof s.env.references>"u")return!1;if(f<v&&s.src.charCodeAt(f)===91?(D=f+1,f=s.md.helpers.parseLinkLabel(s,f),f>=0?u=s.src.slice(D,f++):f=c+1):f=c+1,u||(u=s.src.slice(d,c)),m=s.env.references[t(u)],!m)return s.pos=E,!1;g=m.href,b=m.title}return o||(s.pos=d,s.posMax=c,p=s.push("link_open","a",1),p.attrs=l=[["href",g]],b&&l.push(["title",b]),s.md.inline.tokenize(s),p=s.push("link_close","a",-1)),s.pos=f,s.posMax=v,!0}}}),kb=W({"node_modules/markdown-it/lib/rules_inline/image.js"(r,e){var t=de().normalizeReference,n=de().isSpace;e.exports=function(s,o){var l,a,u,c,d,f,h,m,p,g,b,E,v,D="",x=s.pos,k=s.posMax;if(s.src.charCodeAt(s.pos)!==33||s.src.charCodeAt(s.pos+1)!==91||(f=s.pos+2,d=s.md.helpers.parseLinkLabel(s,s.pos+1,!1),d<0))return!1;if(h=d+1,h<k&&s.src.charCodeAt(h)===40){for(h++;h<k&&(a=s.src.charCodeAt(h),!(!n(a)&&a!==10));h++);if(h>=k)return!1;for(v=h,p=s.md.helpers.parseLinkDestination(s.src,h,s.posMax),p.ok&&(D=s.md.normalizeLink(p.str),s.md.validateLink(D)?h=p.pos:D=""),v=h;h<k&&(a=s.src.charCodeAt(h),!(!n(a)&&a!==10));h++);if(p=s.md.helpers.parseLinkTitle(s.src,h,s.posMax),h<k&&v!==h&&p.ok)for(g=p.str,h=p.pos;h<k&&(a=s.src.charCodeAt(h),!(!n(a)&&a!==10));h++);else g="";if(h>=k||s.src.charCodeAt(h)!==41)return s.pos=x,!1;h++}else{if(typeof s.env.references>"u")return!1;if(h<k&&s.src.charCodeAt(h)===91?(v=h+1,h=s.md.helpers.parseLinkLabel(s,h),h>=0?c=s.src.slice(v,h++):h=d+1):h=d+1,c||(c=s.src.slice(f,d)),m=s.env.references[t(c)],!m)return s.pos=x,!1;D=m.href,g=m.title}return o||(u=s.src.slice(f,d),s.md.inline.parse(u,s.md,s.env,E=[]),b=s.push("image","img",0),b.attrs=l=[["src",D],["alt",""]],b.children=E,b.content=u,g&&l.push(["title",g])),s.pos=h,s.posMax=k,!0}}}),vb=W({"node_modules/markdown-it/lib/rules_inline/autolink.js"(r,e){var t=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,n=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;e.exports=function(s,o){var l,a,u,c,d,f,h=s.pos;if(s.src.charCodeAt(h)!==60)return!1;for(d=s.pos,f=s.posMax;;){if(++h>=f||(c=s.src.charCodeAt(h),c===60))return!1;if(c===62)break}return l=s.src.slice(d+1,h),n.test(l)?(a=s.md.normalizeLink(l),s.md.validateLink(a)?(o||(u=s.push("link_open","a",1),u.attrs=[["href",a]],u.markup="autolink",u.info="auto",u=s.push("text","",0),u.content=s.md.normalizeLinkText(l),u=s.push("link_close","a",-1),u.markup="autolink",u.info="auto"),s.pos+=l.length+2,!0):!1):t.test(l)?(a=s.md.normalizeLink("mailto:"+l),s.md.validateLink(a)?(o||(u=s.push("link_open","a",1),u.attrs=[["href",a]],u.markup="autolink",u.info="auto",u=s.push("text","",0),u.content=s.md.normalizeLinkText(l),u=s.push("link_close","a",-1),u.markup="autolink",u.info="auto"),s.pos+=l.length+2,!0):!1):!1}}}),xb=W({"node_modules/markdown-it/lib/rules_inline/html_inline.js"(r,e){var t=Id().HTML_TAG_RE;function n(i){var s=i|32;return s>=97&&s<=122}e.exports=function(s,o){var l,a,u,c,d=s.pos;return!s.md.options.html||(u=s.posMax,s.src.charCodeAt(d)!==60||d+2>=u)||(l=s.src.charCodeAt(d+1),l!==33&&l!==63&&l!==47&&!n(l))||(a=s.src.slice(d).match(t),!a)?!1:(o||(c=s.push("html_inline","",0),c.content=s.src.slice(d,d+a[0].length)),s.pos+=a[0].length,!0)}}}),Cb=W({"node_modules/markdown-it/lib/rules_inline/entity.js"(r,e){var t=_d(),n=de().has,i=de().isValidEntityCode,s=de().fromCodePoint,o=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,l=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(u,c){var d,f,h,m=u.pos,p=u.posMax;if(u.src.charCodeAt(m)!==38)return!1;if(m+1<p){if(d=u.src.charCodeAt(m+1),d===35){if(h=u.src.slice(m).match(o),h)return c||(f=h[1][0].toLowerCase()==="x"?parseInt(h[1].slice(1),16):parseInt(h[1],10),u.pending+=i(f)?s(f):s(65533)),u.pos+=h[0].length,!0}else if(h=u.src.slice(m).match(l),h&&n(t,h[1]))return c||(u.pending+=t[h[1]]),u.pos+=h[0].length,!0}return c||(u.pending+="&"),u.pos++,!0}}}),Ab=W({"node_modules/markdown-it/lib/rules_inline/balance_pairs.js"(r,e){function t(n,i){var s,o,l,a,u,c,d,f,h={},m=i.length;if(m){var p=0,g=-2,b=[];for(s=0;s<m;s++)if(l=i[s],b.push(0),(i[p].marker!==l.marker||g!==l.token-1)&&(p=s),g=l.token,l.length=l.length||0,!!l.close){for(h.hasOwnProperty(l.marker)||(h[l.marker]=[-1,-1,-1,-1,-1,-1]),u=h[l.marker][(l.open?3:0)+l.length%3],o=p-b[p]-1,c=o;o>u;o-=b[o]+1)if(a=i[o],a.marker===l.marker&&a.open&&a.end<0&&(d=!1,(a.close||l.open)&&(a.length+l.length)%3===0&&(a.length%3!==0||l.length%3!==0)&&(d=!0),!d)){f=o>0&&!i[o-1].open?b[o-1]+1:0,b[s]=s-o+f,b[o]=f,l.open=!1,a.end=s,a.close=!1,c=-1,g=-2;break}c!==-1&&(h[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}}e.exports=function(i){var s,o=i.tokens_meta,l=i.tokens_meta.length;for(t(i,i.delimiters),s=0;s<l;s++)o[s]&&o[s].delimiters&&t(i,o[s].delimiters)}}}),wb=W({"node_modules/markdown-it/lib/rules_inline/text_collapse.js"(r,e){e.exports=function(n){var i,s,o=0,l=n.tokens,a=n.tokens.length;for(i=s=0;i<a;i++)l[i].nesting<0&&o--,l[i].level=o,l[i].nesting>0&&o++,l[i].type==="text"&&i+1<a&&l[i+1].type==="text"?l[i+1].content=l[i].content+l[i+1].content:(i!==s&&(l[s]=l[i]),s++);i!==s&&(l.length=s)}}}),Eb=W({"node_modules/markdown-it/lib/rules_inline/state_inline.js"(r,e){var t=il(),n=de().isWhiteSpace,i=de().isPunctChar,s=de().isMdAsciiPunct;function o(l,a,u,c){this.src=l,this.env=u,this.md=a,this.tokens=c,this.tokens_meta=Array(c.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1}o.prototype.pushPending=function(){var l=new t("text","",0);return l.content=this.pending,l.level=this.pendingLevel,this.tokens.push(l),this.pending="",l},o.prototype.push=function(l,a,u){this.pending&&this.pushPending();var c=new t(l,a,u),d=null;return u<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),c.level=this.level,u>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],d={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(c),this.tokens_meta.push(d),c},o.prototype.scanDelims=function(l,a){var u=l,c,d,f,h,m,p,g,b,E,v=!0,D=!0,x=this.posMax,k=this.src.charCodeAt(l);for(c=l>0?this.src.charCodeAt(l-1):32;u<x&&this.src.charCodeAt(u)===k;)u++;return f=u-l,d=u<x?this.src.charCodeAt(u):32,g=s(c)||i(String.fromCharCode(c)),E=s(d)||i(String.fromCharCode(d)),p=n(c),b=n(d),b?v=!1:E&&(p||g||(v=!1)),p?D=!1:g&&(b||E||(D=!1)),a?(h=v,m=D):(h=v&&(!D||g),m=D&&(!v||E)),{can_open:h,can_close:m,length:f}},o.prototype.Token=t,e.exports=o}}),Sb=W({"node_modules/markdown-it/lib/parser_inline.js"(r,e){var t=nl(),n=[["text",pb()],["newline",mb()],["escape",gb()],["backticks",yb()],["strikethrough",Qa().tokenize],["emphasis",Xa().tokenize],["link",bb()],["image",kb()],["autolink",vb()],["html_inline",xb()],["entity",Cb()]],i=[["balance_pairs",Ab()],["strikethrough",Qa().postProcess],["emphasis",Xa().postProcess],["text_collapse",wb()]];function s(){var o;for(this.ruler=new t,o=0;o<n.length;o++)this.ruler.push(n[o][0],n[o][1]);for(this.ruler2=new t,o=0;o<i.length;o++)this.ruler2.push(i[o][0],i[o][1])}s.prototype.skipToken=function(o){var l,a,u=o.pos,c=this.ruler.getRules(""),d=c.length,f=o.md.options.maxNesting,h=o.cache;if(typeof h[u]<"u"){o.pos=h[u];return}if(o.level<f)for(a=0;a<d&&(o.level++,l=c[a](o,!0),o.level--,!l);a++);else o.pos=o.posMax;l||o.pos++,h[u]=o.pos},s.prototype.tokenize=function(o){for(var l,a,u=this.ruler.getRules(""),c=u.length,d=o.posMax,f=o.md.options.maxNesting;o.pos<d;){if(o.level<f)for(a=0;a<c&&(l=u[a](o,!1),!l);a++);if(l){if(o.pos>=d)break;continue}o.pending+=o.src[o.pos++]}o.pending&&o.pushPending()},s.prototype.parse=function(o,l,a,u){var c,d,f,h=new this.State(o,l,a,u);for(this.tokenize(h),d=this.ruler2.getRules(""),f=d.length,c=0;c<f;c++)d[c](h)},s.prototype.State=Eb(),e.exports=s}}),Db=W({"node_modules/linkify-it/lib/re.js"(r,e){e.exports=function(t){var n={};n.src_Any=Md().source,n.src_Cc=Od().source,n.src_Z=Nd().source,n.src_P=rl().source,n.src_ZPCc=[n.src_Z,n.src_P,n.src_Cc].join("|"),n.src_ZCc=[n.src_Z,n.src_Cc].join("|");var i="[><|]";return n.src_pseudo_letter="(?:(?!"+i+"|"+n.src_ZPCc+")"+n.src_Any+")",n.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",n.src_auth="(?:(?:(?!"+n.src_ZCc+"|[@/\\[\\]()]).)+@)?",n.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",n.src_host_terminator="(?=$|"+i+"|"+n.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+n.src_ZPCc+"))",n.src_path="(?:[/?#](?:(?!"+n.src_ZCc+"|"+i+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+n.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+n.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+n.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+n.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+n.src_ZCc+"|[']).)+\\'|\\'(?="+n.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+n.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+n.src_ZCc+").|;(?!"+n.src_ZCc+").|\\!+(?!"+n.src_ZCc+"|[!]).|\\?(?!"+n.src_ZCc+"|[?]).)+|\\/)?",n.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',n.src_xn="xn--[a-z0-9\\-]{1,59}",n.src_domain_root="(?:"+n.src_xn+"|"+n.src_pseudo_letter+"{1,63})",n.src_domain="(?:"+n.src_xn+"|(?:"+n.src_pseudo_letter+")|(?:"+n.src_pseudo_letter+"(?:-|"+n.src_pseudo_letter+"){0,61}"+n.src_pseudo_letter+"))",n.src_host="(?:(?:(?:(?:"+n.src_domain+")\\.)*"+n.src_domain+"))",n.tpl_host_fuzzy="(?:"+n.src_ip4+"|(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%)))",n.tpl_host_no_ip_fuzzy="(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%))",n.src_host_strict=n.src_host+n.src_host_terminator,n.tpl_host_fuzzy_strict=n.tpl_host_fuzzy+n.src_host_terminator,n.src_host_port_strict=n.src_host+n.src_port+n.src_host_terminator,n.tpl_host_port_fuzzy_strict=n.tpl_host_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_port_no_ip_fuzzy_strict=n.tpl_host_no_ip_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+n.src_ZPCc+"|>|$))",n.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+n.src_ZCc+")("+n.src_email_name+"@"+n.tpl_host_fuzzy_strict+")",n.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_fuzzy_strict+n.src_path+")",n.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_no_ip_fuzzy_strict+n.src_path+")",n}}}),_b=W({"node_modules/linkify-it/index.js"(r,e){function t(x){var k=Array.prototype.slice.call(arguments,1);return k.forEach(function(C){C&&Object.keys(C).forEach(function(w){x[w]=C[w]})}),x}function n(x){return Object.prototype.toString.call(x)}function i(x){return n(x)==="[object String]"}function s(x){return n(x)==="[object Object]"}function o(x){return n(x)==="[object RegExp]"}function l(x){return n(x)==="[object Function]"}function a(x){return x.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var u={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function c(x){return Object.keys(x||{}).reduce(function(k,C){return k||u.hasOwnProperty(C)},!1)}var d={"http:":{validate:function(x,k,C){var w=x.slice(k);return C.re.http||(C.re.http=new RegExp("^\\/\\/"+C.re.src_auth+C.re.src_host_port_strict+C.re.src_path,"i")),C.re.http.test(w)?w.match(C.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(x,k,C){var w=x.slice(k);return C.re.no_http||(C.re.no_http=new RegExp("^"+C.re.src_auth+"(?:localhost|(?:(?:"+C.re.src_domain+")\\.)+"+C.re.src_domain_root+")"+C.re.src_port+C.re.src_host_terminator+C.re.src_path,"i")),C.re.no_http.test(w)?k>=3&&x[k-3]===":"||k>=3&&x[k-3]==="/"?0:w.match(C.re.no_http)[0].length:0}},"mailto:":{validate:function(x,k,C){var w=x.slice(k);return C.re.mailto||(C.re.mailto=new RegExp("^"+C.re.src_email_name+"@"+C.re.src_host_strict,"i")),C.re.mailto.test(w)?w.match(C.re.mailto)[0].length:0}}},f="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",h="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function m(x){x.__index__=-1,x.__text_cache__=""}function p(x){return function(k,C){var w=k.slice(C);return x.test(w)?w.match(x)[0].length:0}}function g(){return function(x,k){k.normalize(x)}}function b(x){var k=x.re=Db()(x.__opts__),C=x.__tlds__.slice();x.onCompile(),x.__tlds_replaced__||C.push(f),C.push(k.src_xn),k.src_tlds=C.join("|");function w(O){return O.replace("%TLDS%",k.src_tlds)}k.email_fuzzy=RegExp(w(k.tpl_email_fuzzy),"i"),k.link_fuzzy=RegExp(w(k.tpl_link_fuzzy),"i"),k.link_no_ip_fuzzy=RegExp(w(k.tpl_link_no_ip_fuzzy),"i"),k.host_fuzzy_test=RegExp(w(k.tpl_host_fuzzy_test),"i");var I=[];x.__compiled__={};function T(O,q){throw new Error('(LinkifyIt) Invalid schema "'+O+'": '+q)}Object.keys(x.__schemas__).forEach(function(O){var q=x.__schemas__[O];if(q!==null){var F={validate:null,link:null};if(x.__compiled__[O]=F,s(q)){o(q.validate)?F.validate=p(q.validate):l(q.validate)?F.validate=q.validate:T(O,q),l(q.normalize)?F.normalize=q.normalize:q.normalize?T(O,q):F.normalize=g();return}if(i(q)){I.push(O);return}T(O,q)}}),I.forEach(function(O){x.__compiled__[x.__schemas__[O]]&&(x.__compiled__[O].validate=x.__compiled__[x.__schemas__[O]].validate,x.__compiled__[O].normalize=x.__compiled__[x.__schemas__[O]].normalize)}),x.__compiled__[""]={validate:null,normalize:g()};var B=Object.keys(x.__compiled__).filter(function(O){return O.length>0&&x.__compiled__[O]}).map(a).join("|");x.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+k.src_ZPCc+"))("+B+")","i"),x.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+k.src_ZPCc+"))("+B+")","ig"),x.re.pretest=RegExp("("+x.re.schema_test.source+")|("+x.re.host_fuzzy_test.source+")|@","i"),m(x)}function E(x,k){var C=x.__index__,w=x.__last_index__,I=x.__text_cache__.slice(C,w);this.schema=x.__schema__.toLowerCase(),this.index=C+k,this.lastIndex=w+k,this.raw=I,this.text=I,this.url=I}function v(x,k){var C=new E(x,k);return x.__compiled__[C.schema].normalize(C,x),C}function D(x,k){if(!(this instanceof D))return new D(x,k);k||c(x)&&(k=x,x={}),this.__opts__=t({},u,k),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=t({},d,x),this.__compiled__={},this.__tlds__=h,this.__tlds_replaced__=!1,this.re={},b(this)}D.prototype.add=function(k,C){return this.__schemas__[k]=C,b(this),this},D.prototype.set=function(k){return this.__opts__=t(this.__opts__,k),this},D.prototype.test=function(k){if(this.__text_cache__=k,this.__index__=-1,!k.length)return!1;var C,w,I,T,B,O,q,F,R;if(this.re.schema_test.test(k)){for(q=this.re.schema_search,q.lastIndex=0;(C=q.exec(k))!==null;)if(T=this.testSchemaAt(k,C[2],q.lastIndex),T){this.__schema__=C[2],this.__index__=C.index+C[1].length,this.__last_index__=C.index+C[0].length+T;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(F=k.search(this.re.host_fuzzy_test),F>=0&&(this.__index__<0||F<this.__index__)&&(w=k.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(B=w.index+w[1].length,(this.__index__<0||B<this.__index__)&&(this.__schema__="",this.__index__=B,this.__last_index__=w.index+w[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(R=k.indexOf("@"),R>=0&&(I=k.match(this.re.email_fuzzy))!==null&&(B=I.index+I[1].length,O=I.index+I[0].length,(this.__index__<0||B<this.__index__||B===this.__index__&&O>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=B,this.__last_index__=O))),this.__index__>=0},D.prototype.pretest=function(k){return this.re.pretest.test(k)},D.prototype.testSchemaAt=function(k,C,w){return this.__compiled__[C.toLowerCase()]?this.__compiled__[C.toLowerCase()].validate(k,w,this):0},D.prototype.match=function(k){var C=0,w=[];this.__index__>=0&&this.__text_cache__===k&&(w.push(v(this,C)),C=this.__last_index__);for(var I=C?k.slice(C):k;this.test(I);)w.push(v(this,C)),I=I.slice(this.__last_index__),C+=this.__last_index__;return w.length?w:null},D.prototype.tlds=function(k,C){return k=Array.isArray(k)?k:[k],C?(this.__tlds__=this.__tlds__.concat(k).sort().filter(function(w,I,T){return w!==T[I-1]}).reverse(),b(this),this):(this.__tlds__=k.slice(),this.__tlds_replaced__=!0,b(this),this)},D.prototype.normalize=function(k){k.schema||(k.url="http://"+k.url),k.schema==="mailto:"&&!/^mailto:/i.test(k.url)&&(k.url="mailto:"+k.url)},D.prototype.onCompile=function(){},e.exports=D}}),Tb=W({"node_modules/punycode/punycode.js"(r,e){var t=2147483647,n=36,i=1,s=26,o=38,l=700,a=72,u=128,c="-",d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=n-i,g=Math.floor,b=String.fromCharCode;function E(R){throw new RangeError(m[R])}function v(R,j){const Y=[];let re=R.length;for(;re--;)Y[re]=j(R[re]);return Y}function D(R,j){const Y=R.split("@");let re="";Y.length>1&&(re=Y[0]+"@",R=Y[1]),R=R.replace(h,".");const ce=R.split("."),ye=v(ce,j).join(".");return re+ye}function x(R){const j=[];let Y=0;const re=R.length;for(;Y<re;){const ce=R.charCodeAt(Y++);if(ce>=55296&&ce<=56319&&Y<re){const ye=R.charCodeAt(Y++);(ye&64512)==56320?j.push(((ce&1023)<<10)+(ye&1023)+65536):(j.push(ce),Y--)}else j.push(ce)}return j}var k=R=>String.fromCodePoint(...R),C=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:n},w=function(R,j){return R+22+75*(R<26)-((j!=0)<<5)},I=function(R,j,Y){let re=0;for(R=Y?g(R/l):R>>1,R+=g(R/j);R>p*s>>1;re+=n)R=g(R/p);return g(re+(p+1)*R/(R+o))},T=function(R){const j=[],Y=R.length;let re=0,ce=u,ye=a,Se=R.lastIndexOf(c);Se<0&&(Se=0);for(let ae=0;ae<Se;++ae)R.charCodeAt(ae)>=128&&E("not-basic"),j.push(R.charCodeAt(ae));for(let ae=Se>0?Se+1:0;ae<Y;){const be=re;for(let Oe=1,Ke=n;;Ke+=n){ae>=Y&&E("invalid-input");const ht=C(R.charCodeAt(ae++));ht>=n&&E("invalid-input"),ht>g((t-re)/Oe)&&E("overflow"),re+=ht*Oe;const _t=Ke<=ye?i:Ke>=ye+s?s:Ke-ye;if(ht<_t)break;const lr=n-_t;Oe>g(t/lr)&&E("overflow"),Oe*=lr}const Me=j.length+1;ye=I(re-be,Me,be==0),g(re/Me)>t-ce&&E("overflow"),ce+=g(re/Me),re%=Me,j.splice(re++,0,ce)}return String.fromCodePoint(...j)},B=function(R){const j=[];R=x(R);const Y=R.length;let re=u,ce=0,ye=a;for(const be of R)be<128&&j.push(b(be));const Se=j.length;let ae=Se;for(Se&&j.push(c);ae<Y;){let be=t;for(const Oe of R)Oe>=re&&Oe<be&&(be=Oe);const Me=ae+1;be-re>g((t-ce)/Me)&&E("overflow"),ce+=(be-re)*Me,re=be;for(const Oe of R)if(Oe<re&&++ce>t&&E("overflow"),Oe===re){let Ke=ce;for(let ht=n;;ht+=n){const _t=ht<=ye?i:ht>=ye+s?s:ht-ye;if(Ke<_t)break;const lr=Ke-_t,Fn=n-_t;j.push(b(w(_t+lr%Fn,0))),Ke=g(lr/Fn)}j.push(b(w(Ke,0))),ye=I(ce,Me,ae===Se),ce=0,++ae}++ce,++re}return j.join("")},O=function(R){return D(R,function(j){return d.test(j)?T(j.slice(4).toLowerCase()):j})},q=function(R){return D(R,function(j){return f.test(j)?"xn--"+B(j):j})},F={version:"2.3.1",ucs2:{decode:x,encode:k},decode:T,encode:B,toASCII:q,toUnicode:O};e.exports=F}}),Mb=W({"node_modules/markdown-it/lib/presets/default.js"(r,e){e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}}}),Ob=W({"node_modules/markdown-it/lib/presets/zero.js"(r,e){e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}}}),Nb=W({"node_modules/markdown-it/lib/presets/commonmark.js"(r,e){e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}}}),Bd=W({"node_modules/markdown-it/lib/index.js"(r,e){var t=de(),n=Hy(),i=Uy(),s=Xy(),o=hb(),l=Sb(),a=_b(),u=Td(),c=Tb(),d={default:Mb(),zero:Ob(),commonmark:Nb()},f=/^(vbscript|javascript|file|data):/,h=/^data:image\/(gif|png|jpeg|webp);/;function m(v){var D=v.trim().toLowerCase();return f.test(D)?!!h.test(D):!0}var p=["http:","https:","mailto:"];function g(v){var D=u.parse(v,!0);if(D.hostname&&(!D.protocol||p.indexOf(D.protocol)>=0))try{D.hostname=c.toASCII(D.hostname)}catch{}return u.encode(u.format(D))}function b(v){var D=u.parse(v,!0);if(D.hostname&&(!D.protocol||p.indexOf(D.protocol)>=0))try{D.hostname=c.toUnicode(D.hostname)}catch{}return u.decode(u.format(D),u.decode.defaultChars+"%")}function E(v,D){if(!(this instanceof E))return new E(v,D);D||t.isString(v)||(D=v||{},v="default"),this.inline=new l,this.block=new o,this.core=new s,this.renderer=new i,this.linkify=new a,this.validateLink=m,this.normalizeLink=g,this.normalizeLinkText=b,this.utils=t,this.helpers=t.assign({},n),this.options={},this.configure(v),D&&this.set(D)}E.prototype.set=function(v){return t.assign(this.options,v),this},E.prototype.configure=function(v){var D=this,x;if(t.isString(v)&&(x=v,v=d[x],!v))throw new Error('Wrong `markdown-it` preset "'+x+'", check name');if(!v)throw new Error("Wrong `markdown-it` preset, can't be empty");return v.options&&D.set(v.options),v.components&&Object.keys(v.components).forEach(function(k){v.components[k].rules&&D[k].ruler.enableOnly(v.components[k].rules),v.components[k].rules2&&D[k].ruler2.enableOnly(v.components[k].rules2)}),this},E.prototype.enable=function(v,D){var x=[];Array.isArray(v)||(v=[v]),["core","block","inline"].forEach(function(C){x=x.concat(this[C].ruler.enable(v,!0))},this),x=x.concat(this.inline.ruler2.enable(v,!0));var k=v.filter(function(C){return x.indexOf(C)<0});if(k.length&&!D)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+k);return this},E.prototype.disable=function(v,D){var x=[];Array.isArray(v)||(v=[v]),["core","block","inline"].forEach(function(C){x=x.concat(this[C].ruler.disable(v,!0))},this),x=x.concat(this.inline.ruler2.disable(v,!0));var k=v.filter(function(C){return x.indexOf(C)<0});if(k.length&&!D)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+k);return this},E.prototype.use=function(v){var D=[this].concat(Array.prototype.slice.call(arguments,1));return v.apply(v,D),this},E.prototype.parse=function(v,D){if(typeof v!="string")throw new Error("Input data should be a String");var x=new this.core.State(v,this,D);return this.core.process(x),x.tokens},E.prototype.render=function(v,D){return D=D||{},this.renderer.render(this.parse(v,D),this.options,D)},E.prototype.parseInline=function(v,D){var x=new this.core.State(v,this,D);return x.inlineMode=!0,this.core.process(x),x.tokens},E.prototype.renderInline=function(v,D){return D=D||{},this.renderer.render(this.parseInline(v,D),this.options,D)},e.exports=E}}),Ib=W({"node_modules/markdown-it/index.js"(r,e){e.exports=Bd()}}),Fd={};Sd(Fd,{getAstValues:()=>yo,isAst:()=>sl,isFunction:()=>Bb,isVariable:()=>Fb,resolve:()=>En});function sl(r){return!!(r!=null&&r.$$mdtype)}function Bb(r){return(r==null?void 0:r.$$mdtype)==="Function"}function Fb(r){return(r==null?void 0:r.$$mdtype)==="Variable"}function*yo(r){if(!(r==null||typeof r!="object")){if(Array.isArray(r))for(const e of r)yield*yo(e);if(sl(r)&&(yield r),Object.getPrototypeOf(r)===Object.prototype)for(const e of Object.values(r))yield*yo(e)}}function En(r,e={}){if(r==null||typeof r!="object")return r;if(Array.isArray(r))return r.map(n=>En(n,e));if(sl(r)&&(r==null?void 0:r.resolve)instanceof Function)return r.resolve(e);if(Object.getPrototypeOf(r)!==Object.prototype)return r;const t={};for(const[n,i]of Object.entries(r))t[n]=En(i,e);return t}var Pr,Dt=(Pr=class{constructor(e="div",t={},n=[]){this.$$mdtype="Tag",this.name=e,this.attributes=t,this.children=n}},Pr.isTag=e=>(e==null?void 0:e.$$mdtype)==="Tag",Pr),Rb=class{validate(r,e,t){return typeof r=="string"||typeof r=="object"?[]:[{id:"attribute-type-invalid",level:"error",message:`Attribute '${t}' must be type 'string | object'`}]}transform(r){if(!r||typeof r=="string")return r;const e=[];for(const[t,n]of Object.entries(r??{}))n&&e.push(t);return e.join(" ")}},$b=class{validate(r){return typeof r=="string"&&r.match(/^[a-zA-Z]/)?[]:[{id:"attribute-value-invalid",level:"error",message:"The 'id' attribute must start with a letter"}]}},eu=fs(Dd()),hs=class{constructor(r=[]){this.$$mdtype="Variable",this.path=r}resolve({variables:r}={}){return r instanceof Function?r(this.path):this.path.reduce((e={},t)=>e[t],r)}},ps=class{constructor(r,e){this.$$mdtype="Function",this.name=r,this.parameters=e}resolve(r={}){var n,i;const e=(n=r==null?void 0:r.functions)==null?void 0:n[this.name];if(!e)return null;const t=En(this.parameters,r);return(i=e.transform)==null?void 0:i.call(e,t,r)}},Re="{%",Et="%}",Pb=/^[a-zA-Z0-9_-]+$/;function ki(r){return typeof r=="string"&&Pb.test(r)}function Cr(r){return r&&typeof r=="object"&&typeof r.then=="function"}function In(r,e=0){let t=0;for(let n=e;n<r.length;n++){const i=r[n];switch(t){case 1:switch(i){case'"':t=0;break;case"\\":t=2;break}break;case 2:t=1;break;case 0:if(i==='"')t=1;else if(r.startsWith(Et,n))return n}}return null}function Lb(r,e){for(let t=0;t<r.length;t++){if(!r.startsWith(Re,t))continue;if(In(r,t)===null){t+=Re.length-1;continue}let i=t;for(;i>0&&!/\s/.test(r[i-1]);)i--;for(const s of e)if(r.slice(i,t).includes(`${s}://`))return!0;return!1}return!1}function zb(r,e,t){try{return(0,eu.parse)(r,{Variable:hs,Function:ps})}catch(n){if(!(n instanceof eu.SyntaxError))throw n;const{message:i,location:{start:s,end:o}}=n,l={start:{line:e,character:s.offset+t},end:{line:e+1,character:o.offset+t}};return{type:"error",meta:{error:{message:i,location:l}}}}}function Rd(r,e=0){let t=e+1;const n=[];let i=0;for(let s=0;s<r.length;s++){if(r[s]===`
113
+ `){t++;continue}if(!r.startsWith(Re,s))continue;const o=In(r,s);if(o==null){s=s+Re.length;continue}const l=r.slice(s,o+Et.length),a=r.slice(s+Re.length,o),u=r.lastIndexOf(`
114
114
  `,s),c=r.indexOf(`
115
- `,o),d=r.slice(u,c),f=Mb(a.trim(),t,s-u),h=d.trim()===l?u:s,m=r.slice(i,h);n.push({type:"text",start:i,end:s-1,content:m}),n.push({map:[t,t+1],position:{start:s-u,end:s-u+l.length},start:s,end:s+l.length-1,info:l,...f}),i=o+Et.length,s=i-1}return n.push({type:"text",start:i,end:r.length-1,content:r.slice(i)}),n}var sl={class:{type:Sb,render:!0},id:{type:Db,render:!0}},Qr={findSchema(r,{nodes:e={},tags:t={}}={}){return r.tag?t[r.tag]:e[r.type]},attributes(r,e={}){const t=this.findSchema(r,e)??{},n={},i={...sl,...t.attributes};for(const[s,o]of Object.entries(i)){if(o.render==!1)continue;const l=typeof o.render=="string"?o.render:s;let a=r.attributes[s];if(typeof o.type=="function"){const u=new o.type;u.transform&&(a=u.transform(a,e))}a=a===void 0?o.default:a,a!==void 0&&(n[l]=a)}if(t.slots)for(const[s,o]of Object.entries(t.slots)){if(o.render===!1)continue;const l=typeof o.render=="string"?o.render:s;r.slots[s]&&(n[l]=this.node(r.slots[s],e))}return n},children(r,e={}){const t=r.children.flatMap(n=>this.node(n,e));return t.some(xr)?Promise.all(t):t},node(r,e={}){const t=this.findSchema(r,e)??{};if(t&&t.transform instanceof Function)return t.transform(r,e);const n=this.children(r,e);if(!t||!t.render)return n;const i=this.attributes(r,e);return xr(i)||xr(n)?Promise.all([i,n]).then(s=>new Dt(t.render,...s)):new Dt(t.render,i,n)}},ol=class Fd{constructor(e="node",t={},n=[],i){this.$$mdtype="Node",this.errors=[],this.lines=[],this.inline=!1,this.attributes=t,this.children=n,this.type=e,this.tag=i,this.annotations=[],this.slots={}}*walk(){for(const e of[...Object.values(this.slots),...this.children])yield e,yield*e.walk()}push(e){this.children.push(e)}resolve(e={}){return Object.assign(new Fd,this,{children:this.children.map(t=>t.resolve(e)),attributes:An(this.attributes,e),slots:Object.fromEntries(Object.entries(this.slots).map(([t,n])=>[t,n.resolve(e)]))})}findSchema(e={}){return Qr.findSchema(this,e)}transformAttributes(e={}){return Qr.attributes(this,e)}transformChildren(e){return Qr.children(this,e)}transform(e){return Qr.node(this,e)}},Rd={Function:hs,Node:ol,Variable:fs};function Ob(r,e){if(!e)return e;const t=Rd[e.$$mdtype];return t?Object.assign(new t,e):e}function Nb(r){return JSON.parse(r,Ob)}var Xe={...Rd,...Id,fromJSON:Nb},we=" ",go=", ",ue=`
116
- `,Ib=".",eu="-",Bb=80,Fb=["strong","em","s"],Rb=(r,e)=>Math.max(r,e),Is=(r,e=2)=>({...r,indent:(r.indent||0)+e});function*Ge(r,e){for(const t of r.children)yield*Ft(t,e)}function*Wn(r){yield[...r].join("").trim()}function*Bs(r){yield`| ${r.join(" | ")} |`}function ki(r){if(r!==void 0)return Xe.isAst(r)?vi(r):r===null?"null":Array.isArray(r)?"["+r.map(ki).join(go)+"]":typeof r=="object"?"{"+Object.entries(r).map(([e,t])=>`${bi(e)?e:`"${e}"`}: ${ki(t)}`).join(go)+"}":JSON.stringify(r)}function yo(r){const e=ki(r.value);if(e!==void 0)return r.name==="primary"?e:r.name==="id"&&typeof r.value=="string"&&bi(r.value)?"#"+r.value:r.type==="class"&&bi(r.name)?"."+r.name:`${r.name}=${e}`}function*$b(r){for(const[e,t]of Object.entries(r.attributes))if(e==="class"&&typeof t=="object"&&!Xe.isAst(t))for(const n of Object.keys(t))yield yo({type:"class",name:n,value:t});else yield yo({type:"attribute",name:e,value:t})}function*Kr(r){r.annotations.length&&(yield Re+we,yield r.annotations.map(yo).join(we),yield we+Et)}function*Pb(r){yield"$",yield r.path.map((e,t)=>t===0?e:bi(e)?"."+e:typeof e=="number"?`[${e}]`:`["${e}"]`).join("")}function*Lb(r){yield r.name,yield"(",yield Object.values(r.parameters).map(ki).join(go),yield")"}function*tu(r){let e;do{const{value:t,done:n}=r.next();if(n)return;e=t.trimStart()}while(!e.length);yield e,yield*r}function*Kn(r,e){yield r.replace(e,"\\$&").replace(new RegExp(" ","g"),"&nbsp;")}function*zb(r,e={}){const t={...e,parent:r},n=we.repeat(t.indent||0);switch(r.type){case"document":{r.attributes.frontmatter&&r.attributes.frontmatter.length&&(yield"---"+ue+r.attributes.frontmatter+ue+"---"+ue+ue),yield*tu(Ge(r,t));break}case"heading":{yield ue,yield n,yield"#".repeat(r.attributes.level||1),yield we,yield*tu(Ge(r,t)),yield*Kr(r),yield ue;break}case"paragraph":{yield ue,yield*Ge(r,t),yield*Kr(r),yield ue;break}case"inline":{yield n,yield*Ge(r,t);break}case"image":{yield"!",yield"[",yield*Ft(r.attributes.alt,t),yield"]",yield"(",yield*typeof r.attributes.src=="string"?Kn(r.attributes.src,/[()]/g):Ft(r.attributes.src,t),r.attributes.title&&(yield we+`"${r.attributes.title}"`),yield")";break}case"link":{const i=[...Ge(r,t)].join("");if(i===r.attributes.href&&!r.attributes.title){yield`<${r.attributes.href}>`;break}yield"[",yield i,yield"]",yield"(",yield*typeof r.attributes.href=="string"?Kn(r.attributes.href,/[()]/g):Ft(r.attributes.href,t),r.attributes.title&&(yield we+`"${r.attributes.title}"`),yield")";break}case"text":{const{content:i}=r.attributes;Xe.isAst(i)?(yield Re+we,yield*Ft(i,t),yield we+Et):e.parent&&Fb.includes(e.parent.type)?yield*Kn(i,/[*_~]/g):yield*Kn(i,/^\*|#+\s|^>/);break}case"blockquote":{const i=">"+we;yield r.children.map(s=>vi(s,t).trimStart()).map(s=>ue+n+i+s).join(n+i);break}case"hr":{yield ue,yield n,yield"---",yield ue;break}case"fence":{yield ue,yield n;const s=(r.attributes.content.match(/`{3,}/g)||[]).map(a=>a.length).reduce(Rb,0),o="`".repeat(s?s+1:3),l=!r.attributes.content.endsWith(ue);yield o,r.attributes.language&&(yield r.attributes.language),r.annotations.length&&(yield we),yield*Kr(r),yield ue,yield n,yield r.attributes.content.split(ue).join(ue+n),l&&(yield ue),yield o,yield ue;break}case"tag":{r.inline||(yield ue,yield n);const i=Re+we,s=[...$b(r)].filter(u=>u!==void 0),o=[i+r.tag,...s],l=o.join(we),a=l.length+i.length*2>(e.maxTagOpeningWidth||Bb);yield(!r.inline&&a?o.join(ue+we.repeat(i.length)+n):l)+we+(r.children.length?"":"/")+Et,r.children.length&&(yield*Ge(r,t.allowIndentation?Is(t):t),r.inline||(yield n),yield Re+we+"/"+r.tag+we+Et),r.inline||(yield ue);break}case"list":{const i=r.children.some(s=>s.children.some(o=>o.type==="paragraph"));for(let s=0;s<r.children.length;s++){const o=(()=>{if(!r.attributes.ordered)return r.attributes.marker??eu;let a="1";const u=r.attributes.start??1;return s===0&&(a=u.toString()),e.orderedListMode==="increment"&&(a=(parseInt(u)+s).toString()),`${a}${r.attributes.marker??Ib}`})();let l=vi(r.children[s],Is(t,o.length+1));(!i||s===r.children.length-1)&&(l=l.trim()),yield ue+n+o+" "+l}yield ue;break}case"item":{for(let i=0;i<r.children.length;i++)yield*Ft(r.children[i],t),i===0&&(yield*Kr(r));break}case"strong":{yield r.attributes.marker??"**",yield*Wn(Ge(r,t)),yield r.attributes.marker??"**";break}case"em":{yield r.attributes.marker??"*",yield*Wn(Ge(r,t)),yield r.attributes.marker??"*";break}case"code":{yield"`",yield*Wn(Ft(r.attributes.content,t)),yield"`";break}case"s":{yield"~~",yield*Wn(Ge(r,t)),yield"~~";break}case"hardbreak":{yield"\\"+ue,yield n;break}case"softbreak":{yield ue,yield n;break}case"table":{const i=[...Ge(r,Is(t))];if(e.parent&&e.parent.type==="tag"&&e.parent.tag==="table"){for(let s=0;s<i.length;s++){const o=i[s];if(typeof o=="string")o.trim().length&&(yield ue,yield o);else{s!==0&&(yield ue,yield n+"---");for(const l of o)yield ue+n+eu+" "+l}}yield ue}else{const s=[];for(const a of i)for(let u=0;u<a.length;u++)s[u]=s[u]?Math.max(s[u],a[u].length):a[u].length;const[o,...l]=i;yield ue,yield*Bs(o.map((a,u)=>a+we.repeat(s[u]-a.length))),yield ue,yield*Bs(o.map((a,u)=>"-".repeat(s[u]))),yield ue;for(const a of l)yield*Bs(a.map((u,c)=>u+we.repeat(s[c]-u.length))),yield ue}break}case"thead":{const[i]=[...Ge(r,t)];yield i||[];break}case"tr":{yield[...Ge(r,t)];break}case"td":case"th":{yield[...Ge(r,t),...Kr(r)].join("").trim();break}case"tbody":{yield*Ge(r,t);break}case"comment":{yield"<!-- "+r.attributes.content+` -->
117
- `;break}}}function*Ft(r,e={}){switch(typeof r){case"undefined":break;case"boolean":case"number":case"string":{yield r.toString();break}case"object":{if(r===null)break;if(Array.isArray(r)){for(const t of r)yield*Ft(t,e);break}switch(r.$$mdtype){case"Function":{yield*Lb(r);break}case"Node":yield*zb(r,e);break;case"Variable":{yield*Pb(r);break}default:throw new Error(`Unimplemented: "${r.$$mdtype}"`)}break}}}function vi(r,e){let t="";for(const n of Ft(r,e))t+=n;return t.trimStart()}var $d=class{validate(r,e,t){return typeof r=="boolean"||r===null||r===void 0||typeof r=="object"?[]:[{id:"attribute-type-invalid",level:"error",message:`Attribute '${t}' must be type 'boolean | object' (null or undefined are also allowed)`}]}};function Nn(r){return r!==!1&&r!==void 0&&r!==null}function qb(r){const e=[{condition:r.attributes.primary,children:[]}];for(const t of r.children)t.type==="tag"&&t.tag==="else"?e.push({condition:"primary"in t.attributes?t.attributes.primary:!0,children:[]}):e[e.length-1].children.push(t);return e}var Vb={attributes:{primary:{type:$d,render:!1}},transform(r,e){const t=qb(r);for(const{condition:n,children:i}of t)if(Nn(n)){const s=i.flatMap(o=>o.transform(e));return s.some(xr)?Promise.all(s).then(o=>o.flat()):s}return[]}},jb={selfClosing:!0,attributes:{primary:{type:$d,render:!1}}},Hb={transform(r){return Object.values(r).every(e=>Nn(e))}},Ub={transform(r){return Object.values(r).find(e=>Nn(e))!==void 0}},Wb={parameters:{0:{required:!0}},transform(r){return!Nn(r[0])}},Kb={transform(r){const e=Object.values(r);return e.every(t=>t===e[0])}},Jb={transform(r){return JSON.stringify(r[0],null,2)}},Gb={transform(r){return r[0]===void 0?r[1]:r[0]}},Pd={and:Hb,or:Ub,not:Wb,equals:Kb,default:Gb,debug:Jb};function Fs(r,e="td"){r.type="tr",r.attributes={};for(const t of r.children)t.type=e;return r}function ru(r,e){return r.type==="tag"&&!!r.tag&&e.includes(r.tag)}function nu(r){return r.type==="comment"||r.type==="tag"&&r.tag==="comment"}function iu(r){return{id:"table-syntax",level:"critical",message:`Found ${r.type}${r.tag?` ${r.tag}`:""} where a list was expected. Make sure all content inside table cells is indented.`,location:r.location}}function Zb(r,e=["if"]){for(const t of r.walk()){if(t.type!=="tag"||t.tag!=="table")continue;const[n,...i]=t.children;if(!n||n.type==="table")continue;const s=new Xe.Node("table",t.attributes,[new Xe.Node("thead"),new Xe.Node("tbody")]),[o,l]=s.children;n.type==="list"&&o.push(Fs(n,"th"));for(const a of i){if(a.type==="list")Fs(a);else if(ru(a,e)){const u=[];for(const c of a.children)if(c.type!=="hr"){if(c.type==="list")Fs(c);else if(!(nu(c)||c.tag==="else"||ru(c,e))){a.errors.push(iu(c));continue}u.push(c)}a.children=u}else if(a.type!=="hr"&&!nu(a)){t.errors.push(iu(a));continue}else continue;l.push(a)}t.children=[s]}}var Ld=[Zb],su={ordered_list:"list",bullet_list:"list",code_inline:"code",list_item:"item",variable:"text"};function ou(r,e){for(const t of e){r.annotations.push(t);const{name:n,value:i,type:s}=t;s==="attribute"?(r.attributes[n]!==void 0&&r.errors.push({id:"duplicate-attribute",level:"warning",message:`Attribute '${n}' already set`}),r.attributes[n]=i):s==="class"&&(r.attributes.class?r.attributes.class[n]=i:r.attributes.class={[n]:i})}}function Yb(r,e){switch(e){case"heading":return{level:Number(r.tag.replace("h",""))};case"list":{const t=r.attrs?Object.fromEntries(r.attrs):void 0,n=r.type.startsWith("ordered");return n&&(t!=null&&t.start)?{ordered:!0,start:t.start,marker:r.markup}:{ordered:n,marker:r.markup}}case"link":{const t=Object.fromEntries(r.attrs);return t.title?{href:t.href,title:t.title}:{href:t.href}}case"image":{const t=Object.fromEntries(r.attrs);return t.title?{alt:r.content,src:t.src,title:t.title}:{alt:r.content,src:t.src}}case"em":case"strong":return{marker:r.markup};case"text":case"code":case"comment":return{content:(r.meta||{}).variable||r.content};case"fence":{const[t]=r.info.split(" ",1);return t===""||t===Re?{content:r.content}:{content:r.content,language:t}}case"td":case"th":{if(r.attrs){const t=Object.fromEntries(r.attrs);let n;if(t.style&&(t.style.includes("left")?n="left":t.style.includes("center")?n="center":t.style.includes("right")&&(n="right")),n)return{align:n}}return{}}default:return{}}}function zd(r,e,t,n,i,s){if(r.type==="frontmatter"){e[0].attributes.frontmatter=r.content;return}if(r.hidden||r.type==="text"&&r.content==="")return;const o=r.errors||[],l=e[e.length-1],{tag:a,attributes:u,error:c}=r.meta||{};if(r.type==="annotation")return s?ou(s,u):l.errors.push({id:"no-inline-annotations",level:"error",message:`Can't apply inline annotations to '${l.type}'`});let d=r.type.replace(/_(open|close)$/,"");if(su[d]&&(d=su[d]),d==="error"){const{message:g,location:y}=c;o.push({id:"parse-error",level:"critical",message:g,location:y})}if(r.nesting<0){if(l.type===d&&l.tag===a)return l.lines&&r.map&&l.lines.push(...r.map),e.pop();o.push({id:"missing-opening",level:"critical",message:`Node '${d}' is missing opening`})}const f=Yb(r,d),h=new ol(d,f,void 0,a||void 0),{position:m={}}=r;if(h.errors=o,i!==!1&&(h.lines=r.map||l.lines||[],h.location={file:t,start:{line:h.lines[0],character:m.start},end:{line:h.lines[1],character:m.end}}),s&&(h.inline=!0),u&&["tag","fence","image"].includes(d)&&ou(h,u),n&&a==="slot"&&typeof h.attributes.primary=="string"?l.slots[h.attributes.primary]=h:l.push(h),r.nesting>0&&e.push(h),!Array.isArray(r.children))return;if(h.type==="inline"&&(s=l),e.push(h),!(d==="image"))for(const g of r.children)zd(g,e,t,n,i,s);e.pop()}function Qb(r,e){const t=new ol("document"),n=[t];typeof e=="string"&&(e={file:e});for(const i of r)zd(i,n,e==null?void 0:e.file,e==null?void 0:e.slots,e==null?void 0:e.location);if(n.length>1)for(const i of n.slice(1))i.errors.push({id:"missing-closing",level:"critical",message:`Node '${i.tag||i.type}' is missing closing`});for(const i of Ld)i(t,e==null?void 0:e.conditionalTags);return t}var ll={};wd(ll,{blockquote:()=>ik,code:()=>kk,comment:()=>Ak,document:()=>Xb,em:()=>mk,error:()=>wk,fence:()=>nk,hardbreak:()=>xk,heading:()=>ek,hr:()=>lk,image:()=>rk,inline:()=>yk,item:()=>sk,link:()=>bk,list:()=>ok,node:()=>Ek,paragraph:()=>tk,s:()=>gk,softbreak:()=>Ck,strong:()=>pk,table:()=>ak,tbody:()=>fk,td:()=>uk,text:()=>vk,th:()=>ck,thead:()=>hk,tr:()=>dk});var Xb={render:"article",children:["heading","paragraph","image","table","tag","fence","blockquote","comment","list","hr"],attributes:{frontmatter:{render:!1}}},ek={children:["inline"],attributes:{level:{type:Number,render:!1,required:!0}},transform(r,e){return new Dt(`h${r.attributes.level}`,r.transformAttributes(e),r.transformChildren(e))}},tk={render:"p",children:["inline"]},rk={render:"img",attributes:{src:{type:String,required:!0},alt:{type:String},title:{type:String}}},nk={render:"pre",attributes:{content:{type:String,render:!1,required:!0},language:{type:String,render:"data-language"},process:{type:Boolean,render:!1,default:!0}},transform(r,e){const t=r.transformAttributes(e),n=r.children.length?r.transformChildren(e):[r.attributes.content];return new Dt("pre",t,n)}},ik={render:"blockquote",children:["heading","paragraph","image","table","tag","fence","blockquote","list","hr"]},sk={render:"li",children:["inline","heading","paragraph","image","table","tag","fence","blockquote","list","hr"]},ok={children:["item"],attributes:{ordered:{type:Boolean,render:!1,required:!0},start:{type:Number},marker:{type:String,render:!1}},transform(r,e){return new Dt(r.attributes.ordered?"ol":"ul",r.transformAttributes(e),r.transformChildren(e))}},lk={render:"hr"},ak={render:"table"},uk={render:"td",children:["inline","heading","paragraph","image","table","tag","fence","blockquote","list","hr"],attributes:{align:{type:String},colspan:{type:Number,render:"colSpan"},rowspan:{type:Number,render:"rowSpan"}}},ck={render:"th",attributes:{width:{type:String},align:{type:String},colspan:{type:Number,render:"colSpan"},rowspan:{type:Number,render:"rowSpan"}}},dk={render:"tr",children:["th","td"]},fk={render:"tbody",children:["tr","tag"]},hk={render:"thead",children:["tr"]},pk={render:"strong",children:["em","s","link","code","text","tag"],attributes:{marker:{type:String,render:!1}}},mk={render:"em",children:["strong","s","link","code","text","tag"],attributes:{marker:{type:String,render:!1}}},gk={render:"s",children:["strong","em","link","code","text","tag"]},yk={children:["strong","em","s","code","text","tag","link","image","hardbreak","softbreak","comment"]},bk={render:"a",children:["strong","em","s","code","text","tag"],attributes:{href:{type:String,required:!0},title:{type:String}}},kk={render:"code",attributes:{content:{type:String,render:!1,required:!0}},transform(r,e){const t=r.transformAttributes(e);return new Dt("code",t,[r.attributes.content])}},vk={attributes:{content:{type:String,required:!0}},transform(r){return r.attributes.content}},xk={render:"br"},Ck={transform(){return" "}},Ak={attributes:{content:{type:String,required:!0}}},wk={},Ek={},Sk=ds(Ab()),{escapeHtml:lu}=(0,Sk.default)().utils,Dk=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ti(r){if(typeof r=="string"||typeof r=="number")return lu(String(r));if(Array.isArray(r))return r.map(ti).join("");if(r===null||typeof r!="object"||!Dt.isTag(r))return"";const{name:e,attributes:t,children:n=[]}=r;if(!e)return ti(n);let i=`<${e}`;for(const[s,o]of Object.entries(t??{}))i+=` ${s.toLowerCase()}="${lu(String(o))}"`;return i+=">",Dk.has(e)||(n.length&&(i+=ti(n)),i+=`</${e}>`),i}function _k(r,e){return typeof r!="string"||r[0]!==r[0].toUpperCase()?r:e instanceof Function?e(r):e[r]}function Tk(r,e,{components:t={},resolveTagName:n=_k}={}){function i(o){if(o==null||typeof o!="object")return o;if(Array.isArray(o))return o.map(a=>i(a));if(o.$$mdtype==="Tag")return s(o);if(typeof o!="object")return o;const l={};for(const[a,u]of Object.entries(o))l[a]=i(u);return l}function s(o){if(Array.isArray(o))return e.createElement(e.Fragment,null,...o.map(s));if(o===null||typeof o!="object"||!Dt.isTag(o))return o;const{name:l,attributes:{class:a,...u}={},children:c=[]}=o;return a&&(u.className=a),e.createElement(n(l,t),Object.keys(u).length==0?null:i(u),...c.map(s))}return s(r)}function Mk(r,e){return typeof r!="string"?"Fragment":r[0]!==r[0].toUpperCase()?r:e instanceof Function?e(r):e[r]}function au(r){return r.map(al).join(", ")}function bo(r){return r==null||typeof r!="object"?JSON.stringify(r):Array.isArray(r)?`[${r.map(t=>bo(t)).join(", ")}]`:r.$$mdtype==="Tag"?al(r):typeof r!="object"?JSON.stringify(r):`{${Object.entries(r).map(([t,n])=>[JSON.stringify(t),bo(n)].join(": ")).join(", ")}}`}function al(r){if(Array.isArray(r))return`React.createElement(React.Fragment, null, ${au(r)})`;if(r===null||typeof r!="object"||!Dt.isTag(r))return JSON.stringify(r);const{name:e,attributes:{class:t,...n}={},children:i=[]}=r;return t&&(n.className=t),`React.createElement(
115
+ `,o),d=r.slice(u,c),f=zb(a.trim(),t,s-u),h=d.trim()===l?u:s,m=r.slice(i,h);n.push({type:"text",start:i,end:s-1,content:m}),n.push({map:[t,t+1],position:{start:s-u,end:s-u+l.length},start:s,end:s+l.length-1,info:l,...f}),i=o+Et.length,s=i-1}return n.push({type:"text",start:i,end:r.length-1,content:r.slice(i)}),n}var ol={class:{type:Rb,render:!0},id:{type:$b,render:!0}},Xr={findSchema(r,{nodes:e={},tags:t={}}={}){return r.tag?t[r.tag]:e[r.type]},attributes(r,e={}){const t=this.findSchema(r,e)??{},n={},i={...ol,...t.attributes};for(const[s,o]of Object.entries(i)){if(o.render==!1)continue;const l=typeof o.render=="string"?o.render:s;let a=r.attributes[s];if(typeof o.type=="function"){const u=new o.type;u.transform&&(a=u.transform(a,e))}a=a===void 0?o.default:a,a!==void 0&&(n[l]=a)}if(t.slots)for(const[s,o]of Object.entries(t.slots)){if(o.render===!1)continue;const l=typeof o.render=="string"?o.render:s;r.slots[s]&&(n[l]=this.node(r.slots[s],e))}return n},children(r,e={}){const t=r.children.flatMap(n=>this.node(n,e));return t.some(Cr)?Promise.all(t):t},node(r,e={}){const t=this.findSchema(r,e)??{};if(t&&t.transform instanceof Function)return t.transform(r,e);const n=this.children(r,e);if(!t||!t.render)return n;const i=this.attributes(r,e);return Cr(i)||Cr(n)?Promise.all([i,n]).then(s=>new Dt(t.render,...s)):new Dt(t.render,i,n)}},ll=class $d{constructor(e="node",t={},n=[],i){this.$$mdtype="Node",this.errors=[],this.lines=[],this.inline=!1,this.attributes=t,this.children=n,this.type=e,this.tag=i,this.annotations=[],this.slots={}}*walk(){for(const e of[...Object.values(this.slots),...this.children])yield e,yield*e.walk()}push(e){this.children.push(e)}resolve(e={}){return Object.assign(new $d,this,{children:this.children.map(t=>t.resolve(e)),attributes:En(this.attributes,e),slots:Object.fromEntries(Object.entries(this.slots).map(([t,n])=>[t,n.resolve(e)]))})}findSchema(e={}){return Xr.findSchema(this,e)}transformAttributes(e={}){return Xr.attributes(this,e)}transformChildren(e){return Xr.children(this,e)}transform(e){return Xr.node(this,e)}},Pd={Function:ps,Node:ll,Variable:hs};function qb(r,e){if(!e)return e;const t=Pd[e.$$mdtype];return t?Object.assign(new t,e):e}function Vb(r){return JSON.parse(r,qb)}var Xe={...Pd,...Fd,fromJSON:Vb},we=" ",bo=", ",ue=`
116
+ `,jb=".",tu="-",Hb=80,Ub=["strong","em","s"],Wb=(r,e)=>Math.max(r,e),Bs=(r,e=2)=>({...r,indent:(r.indent||0)+e});function*Ge(r,e){for(const t of r.children)yield*Ft(t,e)}function*Jn(r){yield[...r].join("").trim()}function*Fs(r){yield`| ${r.join(" | ")} |`}function vi(r){if(r!==void 0)return Xe.isAst(r)?xi(r):r===null?"null":Array.isArray(r)?"["+r.map(vi).join(bo)+"]":typeof r=="object"?"{"+Object.entries(r).map(([e,t])=>`${ki(e)?e:`"${e}"`}: ${vi(t)}`).join(bo)+"}":JSON.stringify(r)}function ko(r){const e=vi(r.value);if(e!==void 0)return r.name==="primary"?e:r.name==="id"&&typeof r.value=="string"&&ki(r.value)?"#"+r.value:r.type==="class"&&ki(r.name)?"."+r.name:`${r.name}=${e}`}function*Kb(r){for(const[e,t]of Object.entries(r.attributes))if(e==="class"&&typeof t=="object"&&!Xe.isAst(t))for(const n of Object.keys(t))yield ko({type:"class",name:n,value:t});else yield ko({type:"attribute",name:e,value:t})}function*Jr(r){r.annotations.length&&(yield Re+we,yield r.annotations.map(ko).join(we),yield we+Et)}function*Jb(r){yield"$",yield r.path.map((e,t)=>t===0?e:ki(e)?"."+e:typeof e=="number"?`[${e}]`:`["${e}"]`).join("")}function*Gb(r){yield r.name,yield"(",yield Object.values(r.parameters).map(vi).join(bo),yield")"}function*ru(r){let e;do{const{value:t,done:n}=r.next();if(n)return;e=t.trimStart()}while(!e.length);yield e,yield*r}function*Gn(r,e){yield r.replace(e,"\\$&").replace(new RegExp(" ","g"),"&nbsp;")}function*Zb(r,e={}){const t={...e,parent:r},n=we.repeat(t.indent||0);switch(r.type){case"document":{r.attributes.frontmatter&&r.attributes.frontmatter.length&&(yield"---"+ue+r.attributes.frontmatter+ue+"---"+ue+ue),yield*ru(Ge(r,t));break}case"heading":{yield ue,yield n,yield"#".repeat(r.attributes.level||1),yield we,yield*ru(Ge(r,t)),yield*Jr(r),yield ue;break}case"paragraph":{yield ue,yield*Ge(r,t),yield*Jr(r),yield ue;break}case"inline":{yield n,yield*Ge(r,t);break}case"image":{yield"!",yield"[",yield*Ft(r.attributes.alt,t),yield"]",yield"(",yield*typeof r.attributes.src=="string"?Gn(r.attributes.src,/[()]/g):Ft(r.attributes.src,t),r.attributes.title&&(yield we+`"${r.attributes.title}"`),yield")";break}case"link":{const i=[...Ge(r,t)].join("");if(i===r.attributes.href&&!r.attributes.title){yield`<${r.attributes.href}>`;break}yield"[",yield i,yield"]",yield"(",yield*typeof r.attributes.href=="string"?Gn(r.attributes.href,/[()]/g):Ft(r.attributes.href,t),r.attributes.title&&(yield we+`"${r.attributes.title}"`),yield")";break}case"text":{const{content:i}=r.attributes;Xe.isAst(i)?(yield Re+we,yield*Ft(i,t),yield we+Et):e.parent&&Ub.includes(e.parent.type)?yield*Gn(i,/[*_~]/g):yield*Gn(i,/^\*|#+\s|^>/);break}case"blockquote":{const i=">"+we;yield r.children.map(s=>xi(s,t).trimStart()).map(s=>ue+n+i+s).join(n+i);break}case"hr":{yield ue,yield n,yield"---",yield ue;break}case"fence":{yield ue,yield n;const s=(r.attributes.content.match(/`{3,}/g)||[]).map(a=>a.length).reduce(Wb,0),o="`".repeat(s?s+1:3),l=!r.attributes.content.endsWith(ue);yield o,r.attributes.language&&(yield r.attributes.language),r.annotations.length&&(yield we),yield*Jr(r),yield ue,yield n,yield r.attributes.content.split(ue).join(ue+n),l&&(yield ue),yield o,yield ue;break}case"tag":{r.inline||(yield ue,yield n);const i=Re+we,s=[...Kb(r)].filter(u=>u!==void 0),o=[i+r.tag,...s],l=o.join(we),a=l.length+i.length*2>(e.maxTagOpeningWidth||Hb);yield(!r.inline&&a?o.join(ue+we.repeat(i.length)+n):l)+we+(r.children.length?"":"/")+Et,r.children.length&&(yield*Ge(r,t.allowIndentation?Bs(t):t),r.inline||(yield n),yield Re+we+"/"+r.tag+we+Et),r.inline||(yield ue);break}case"list":{const i=r.children.some(s=>s.children.some(o=>o.type==="paragraph"));for(let s=0;s<r.children.length;s++){const o=(()=>{if(!r.attributes.ordered)return r.attributes.marker??tu;let a="1";const u=r.attributes.start??1;return s===0&&(a=u.toString()),e.orderedListMode==="increment"&&(a=(parseInt(u)+s).toString()),`${a}${r.attributes.marker??jb}`})();let l=xi(r.children[s],Bs(t,o.length+1));(!i||s===r.children.length-1)&&(l=l.trim()),yield ue+n+o+" "+l}yield ue;break}case"item":{for(let i=0;i<r.children.length;i++)yield*Ft(r.children[i],t),i===0&&(yield*Jr(r));break}case"strong":{yield r.attributes.marker??"**",yield*Jn(Ge(r,t)),yield r.attributes.marker??"**";break}case"em":{yield r.attributes.marker??"*",yield*Jn(Ge(r,t)),yield r.attributes.marker??"*";break}case"code":{yield"`",yield*Jn(Ft(r.attributes.content,t)),yield"`";break}case"s":{yield"~~",yield*Jn(Ge(r,t)),yield"~~";break}case"hardbreak":{yield"\\"+ue,yield n;break}case"softbreak":{yield ue,yield n;break}case"table":{const i=[...Ge(r,Bs(t))];if(e.parent&&e.parent.type==="tag"&&e.parent.tag==="table"){for(let s=0;s<i.length;s++){const o=i[s];if(typeof o=="string")o.trim().length&&(yield ue,yield o);else{s!==0&&(yield ue,yield n+"---");for(const l of o)yield ue+n+tu+" "+l}}yield ue}else{const s=[];for(const a of i)for(let u=0;u<a.length;u++)s[u]=s[u]?Math.max(s[u],a[u].length):a[u].length;const[o,...l]=i;yield ue,yield*Fs(o.map((a,u)=>a+we.repeat(s[u]-a.length))),yield ue,yield*Fs(o.map((a,u)=>"-".repeat(s[u]))),yield ue;for(const a of l)yield*Fs(a.map((u,c)=>u+we.repeat(s[c]-u.length))),yield ue}break}case"thead":{const[i]=[...Ge(r,t)];yield i||[];break}case"tr":{yield[...Ge(r,t)];break}case"td":case"th":{yield[...Ge(r,t),...Jr(r)].join("").trim();break}case"tbody":{yield*Ge(r,t);break}case"comment":{yield"<!-- "+r.attributes.content+` -->
117
+ `;break}}}function*Ft(r,e={}){switch(typeof r){case"undefined":break;case"boolean":case"number":case"string":{yield r.toString();break}case"object":{if(r===null)break;if(Array.isArray(r)){for(const t of r)yield*Ft(t,e);break}switch(r.$$mdtype){case"Function":{yield*Gb(r);break}case"Node":yield*Zb(r,e);break;case"Variable":{yield*Jb(r);break}default:throw new Error(`Unimplemented: "${r.$$mdtype}"`)}break}}}function xi(r,e){let t="";for(const n of Ft(r,e))t+=n;return t.trimStart()}var Ld=class{validate(r,e,t){return typeof r=="boolean"||r===null||r===void 0||typeof r=="object"?[]:[{id:"attribute-type-invalid",level:"error",message:`Attribute '${t}' must be type 'boolean | object' (null or undefined are also allowed)`}]}};function Bn(r){return r!==!1&&r!==void 0&&r!==null}function Yb(r){const e=[{condition:r.attributes.primary,children:[]}];for(const t of r.children)t.type==="tag"&&t.tag==="else"?e.push({condition:"primary"in t.attributes?t.attributes.primary:!0,children:[]}):e[e.length-1].children.push(t);return e}var Qb={attributes:{primary:{type:Ld,render:!1}},transform(r,e){const t=Yb(r);for(const{condition:n,children:i}of t)if(Bn(n)){const s=i.flatMap(o=>o.transform(e));return s.some(Cr)?Promise.all(s).then(o=>o.flat()):s}return[]}},Xb={selfClosing:!0,attributes:{primary:{type:Ld,render:!1}}},ek={transform(r){return Object.values(r).every(e=>Bn(e))}},tk={transform(r){return Object.values(r).find(e=>Bn(e))!==void 0}},rk={parameters:{0:{required:!0}},transform(r){return!Bn(r[0])}},nk={transform(r){const e=Object.values(r);return e.every(t=>t===e[0])}},ik={transform(r){return JSON.stringify(r[0],null,2)}},sk={transform(r){return r[0]===void 0?r[1]:r[0]}},zd={and:ek,or:tk,not:rk,equals:nk,default:sk,debug:ik};function Rs(r,e="td"){r.type="tr",r.attributes={};for(const t of r.children)t.type=e;return r}function nu(r,e){return r.type==="tag"&&!!r.tag&&e.includes(r.tag)}function iu(r){return r.type==="comment"||r.type==="tag"&&r.tag==="comment"}function su(r){return{id:"table-syntax",level:"critical",message:`Found ${r.type}${r.tag?` ${r.tag}`:""} where a list was expected. Make sure all content inside table cells is indented.`,location:r.location}}function ok(r,e=["if"]){for(const t of r.walk()){if(t.type!=="tag"||t.tag!=="table")continue;const[n,...i]=t.children;if(!n||n.type==="table")continue;const s=new Xe.Node("table",t.attributes,[new Xe.Node("thead"),new Xe.Node("tbody")]),[o,l]=s.children;n.type==="list"&&o.push(Rs(n,"th"));for(const a of i){if(a.type==="list")Rs(a);else if(nu(a,e)){const u=[];for(const c of a.children)if(c.type!=="hr"){if(c.type==="list")Rs(c);else if(!(iu(c)||c.tag==="else"||nu(c,e))){a.errors.push(su(c));continue}u.push(c)}a.children=u}else if(a.type!=="hr"&&!iu(a)){t.errors.push(su(a));continue}else continue;l.push(a)}t.children=[s]}}var qd=[ok],ou={ordered_list:"list",bullet_list:"list",code_inline:"code",list_item:"item",variable:"text"};function lu(r,e){for(const t of e){r.annotations.push(t);const{name:n,value:i,type:s}=t;s==="attribute"?(r.attributes[n]!==void 0&&r.errors.push({id:"duplicate-attribute",level:"warning",message:`Attribute '${n}' already set`}),r.attributes[n]=i):s==="class"&&(r.attributes.class?r.attributes.class[n]=i:r.attributes.class={[n]:i})}}function lk(r,e){switch(e){case"heading":return{level:Number(r.tag.replace("h",""))};case"list":{const t=r.attrs?Object.fromEntries(r.attrs):void 0,n=r.type.startsWith("ordered");return n&&(t!=null&&t.start)?{ordered:!0,start:t.start,marker:r.markup}:{ordered:n,marker:r.markup}}case"link":{const t=Object.fromEntries(r.attrs);return t.title?{href:t.href,title:t.title}:{href:t.href}}case"image":{const t=Object.fromEntries(r.attrs);return t.title?{alt:r.content,src:t.src,title:t.title}:{alt:r.content,src:t.src}}case"em":case"strong":return{marker:r.markup};case"text":case"code":case"comment":return{content:(r.meta||{}).variable||r.content};case"fence":{const[t]=r.info.split(" ",1);return t===""||t===Re?{content:r.content}:{content:r.content,language:t}}case"td":case"th":{if(r.attrs){const t=Object.fromEntries(r.attrs);let n;if(t.style&&(t.style.includes("left")?n="left":t.style.includes("center")?n="center":t.style.includes("right")&&(n="right")),n)return{align:n}}return{}}default:return{}}}function Vd(r,e,t,n,i,s){if(r.type==="frontmatter"){e[0].attributes.frontmatter=r.content;return}if(r.hidden||r.type==="text"&&r.content==="")return;const o=r.errors||[],l=e[e.length-1],{tag:a,attributes:u,error:c}=r.meta||{};if(r.type==="annotation")return s?lu(s,u):l.errors.push({id:"no-inline-annotations",level:"error",message:`Can't apply inline annotations to '${l.type}'`});let d=r.type.replace(/_(open|close)$/,"");if(ou[d]&&(d=ou[d]),d==="error"){const{message:g,location:b}=c;o.push({id:"parse-error",level:"critical",message:g,location:b})}if(r.nesting<0){if(l.type===d&&l.tag===a)return l.lines&&r.map&&l.lines.push(...r.map),e.pop();o.push({id:"missing-opening",level:"critical",message:`Node '${d}' is missing opening`})}const f=lk(r,d),h=new ll(d,f,void 0,a||void 0),{position:m={}}=r;if(h.errors=o,i!==!1&&(h.lines=r.map||l.lines||[],h.location={file:t,start:{line:h.lines[0],character:m.start},end:{line:h.lines[1],character:m.end}}),s&&(h.inline=!0),u&&["tag","fence","image"].includes(d)&&lu(h,u),n&&a==="slot"&&typeof h.attributes.primary=="string"?l.slots[h.attributes.primary]=h:l.push(h),r.nesting>0&&e.push(h),!Array.isArray(r.children))return;if(h.type==="inline"&&(s=l),e.push(h),!(d==="image"))for(const g of r.children)Vd(g,e,t,n,i,s);e.pop()}function ak(r,e){const t=new ll("document"),n=[t];typeof e=="string"&&(e={file:e});for(const i of r)Vd(i,n,e==null?void 0:e.file,e==null?void 0:e.slots,e==null?void 0:e.location);if(n.length>1)for(const i of n.slice(1))i.errors.push({id:"missing-closing",level:"critical",message:`Node '${i.tag||i.type}' is missing closing`});for(const i of qd)i(t,e==null?void 0:e.conditionalTags);return t}var al={};Sd(al,{blockquote:()=>pk,code:()=>Tk,comment:()=>Ik,document:()=>uk,em:()=>Ek,error:()=>Bk,fence:()=>hk,hardbreak:()=>Ok,heading:()=>ck,hr:()=>yk,image:()=>fk,inline:()=>Dk,item:()=>mk,link:()=>_k,list:()=>gk,node:()=>Fk,paragraph:()=>dk,s:()=>Sk,softbreak:()=>Nk,strong:()=>wk,table:()=>bk,tbody:()=>Ck,td:()=>kk,text:()=>Mk,th:()=>vk,thead:()=>Ak,tr:()=>xk});var uk={render:"article",children:["heading","paragraph","image","table","tag","fence","blockquote","comment","list","hr"],attributes:{frontmatter:{render:!1}}},ck={children:["inline"],attributes:{level:{type:Number,render:!1,required:!0}},transform(r,e){return new Dt(`h${r.attributes.level}`,r.transformAttributes(e),r.transformChildren(e))}},dk={render:"p",children:["inline"]},fk={render:"img",attributes:{src:{type:String,required:!0},alt:{type:String},title:{type:String}}},hk={render:"pre",attributes:{content:{type:String,render:!1,required:!0},language:{type:String,render:"data-language"},process:{type:Boolean,render:!1,default:!0}},transform(r,e){const t=r.transformAttributes(e),n=r.children.length?r.transformChildren(e):[r.attributes.content];return new Dt("pre",t,n)}},pk={render:"blockquote",children:["heading","paragraph","image","table","tag","fence","blockquote","list","hr"]},mk={render:"li",children:["inline","heading","paragraph","image","table","tag","fence","blockquote","list","hr"]},gk={children:["item"],attributes:{ordered:{type:Boolean,render:!1,required:!0},start:{type:Number},marker:{type:String,render:!1}},transform(r,e){return new Dt(r.attributes.ordered?"ol":"ul",r.transformAttributes(e),r.transformChildren(e))}},yk={render:"hr"},bk={render:"table"},kk={render:"td",children:["inline","heading","paragraph","image","table","tag","fence","blockquote","list","hr"],attributes:{align:{type:String},colspan:{type:Number,render:"colSpan"},rowspan:{type:Number,render:"rowSpan"}}},vk={render:"th",attributes:{width:{type:String},align:{type:String},colspan:{type:Number,render:"colSpan"},rowspan:{type:Number,render:"rowSpan"}}},xk={render:"tr",children:["th","td"]},Ck={render:"tbody",children:["tr","tag"]},Ak={render:"thead",children:["tr"]},wk={render:"strong",children:["em","s","link","code","text","tag"],attributes:{marker:{type:String,render:!1}}},Ek={render:"em",children:["strong","s","link","code","text","tag"],attributes:{marker:{type:String,render:!1}}},Sk={render:"s",children:["strong","em","link","code","text","tag"]},Dk={children:["strong","em","s","code","text","tag","link","image","hardbreak","softbreak","comment"]},_k={render:"a",children:["strong","em","s","code","text","tag"],attributes:{href:{type:String,required:!0},title:{type:String}}},Tk={render:"code",attributes:{content:{type:String,render:!1,required:!0}},transform(r,e){const t=r.transformAttributes(e);return new Dt("code",t,[r.attributes.content])}},Mk={attributes:{content:{type:String,required:!0}},transform(r){return r.attributes.content}},Ok={render:"br"},Nk={transform(){return" "}},Ik={attributes:{content:{type:String,required:!0}}},Bk={},Fk={},Rk=fs(Ib()),{escapeHtml:au}=(0,Rk.default)().utils,$k=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ni(r){if(typeof r=="string"||typeof r=="number")return au(String(r));if(Array.isArray(r))return r.map(ni).join("");if(r===null||typeof r!="object"||!Dt.isTag(r))return"";const{name:e,attributes:t,children:n=[]}=r;if(!e)return ni(n);let i=`<${e}`;for(const[s,o]of Object.entries(t??{}))i+=` ${s.toLowerCase()}="${au(String(o))}"`;return i+=">",$k.has(e)||(n.length&&(i+=ni(n)),i+=`</${e}>`),i}function Pk(r,e){return typeof r!="string"||r[0]!==r[0].toUpperCase()?r:e instanceof Function?e(r):e[r]}function Lk(r,e,{components:t={},resolveTagName:n=Pk}={}){function i(o){if(o==null||typeof o!="object")return o;if(Array.isArray(o))return o.map(a=>i(a));if(o.$$mdtype==="Tag")return s(o);if(typeof o!="object")return o;const l={};for(const[a,u]of Object.entries(o))l[a]=i(u);return l}function s(o){if(Array.isArray(o))return e.createElement(e.Fragment,null,...o.map(s));if(o===null||typeof o!="object"||!Dt.isTag(o))return o;const{name:l,attributes:{class:a,...u}={},children:c=[]}=o;return a&&(u.className=a),e.createElement(n(l,t),Object.keys(u).length==0?null:i(u),...c.map(s))}return s(r)}function zk(r,e){return typeof r!="string"?"Fragment":r[0]!==r[0].toUpperCase()?r:e instanceof Function?e(r):e[r]}function uu(r){return r.map(ul).join(", ")}function vo(r){return r==null||typeof r!="object"?JSON.stringify(r):Array.isArray(r)?`[${r.map(t=>vo(t)).join(", ")}]`:r.$$mdtype==="Tag"?ul(r):typeof r!="object"?JSON.stringify(r):`{${Object.entries(r).map(([t,n])=>[JSON.stringify(t),vo(n)].join(": ")).join(", ")}}`}function ul(r){if(Array.isArray(r))return`React.createElement(React.Fragment, null, ${uu(r)})`;if(r===null||typeof r!="object"||!Dt.isTag(r))return JSON.stringify(r);const{name:e,attributes:{class:t,...n}={},children:i=[]}=r;return t&&(n.className=t),`React.createElement(
118
118
  tagName(${JSON.stringify(e)}, components),
119
- ${Object.keys(n).length==0?"null":bo(n)},
120
- ${au(i)})`}function Ok(r,{resolveTagName:e=Mk}={}){if(e.name!=="tagName")throw new Error("resolveTagName must be named tagName");return`
119
+ ${Object.keys(n).length==0?"null":vo(n)},
120
+ ${uu(i)})`}function qk(r,{resolveTagName:e=zk}={}){if(e.name!=="tagName")throw new Error("resolveTagName must be named tagName");return`
121
121
  (({components = {}} = {}) => {
122
122
  ${e}
123
- return ${al(r)};
123
+ return ${ul(r)};
124
124
  })
125
- `}var Nk={html:ti,react:Tk,reactStatic:Ok},Ik=class{validate(r,e){const{partials:t={}}=e;return t[r]?[]:[{id:"attribute-value-invalid",level:"error",message:`Partial \`${r}\` not found. The 'file' attribute must be set in \`config.partials\``}]}},Bk={inline:!1,selfClosing:!0,attributes:{file:{type:Ik,render:!1,required:!0},variables:{type:Object,render:!1}},transform(r,e){const{partials:t={}}=e,{file:n,variables:i}=r.attributes,s=t[n];if(!s)return null;const o={...e,variables:{...e.variables,...i,"$$partial:filename":n}},l=a=>a.resolve(o).transformChildren(o);return Array.isArray(s)?s.flatMap(l):l(s)}},Fk={children:["table"],inline:!1},Rk={attributes:{primary:{type:String,required:!0}}},qd={else:jb,if:Vb,partial:Bk,slot:Rk,table:Fk},$k=ds(Nd()),xi=ds(Ed());function Vd(r,e,t){try{const{type:n,meta:i,nesting:s=0}=(0,xi.parse)(e,{Variable:fs,Function:hs}),o=r.push(n,"",s);return o.info=e,o.meta=i,r.delimiters||(r.delimiters=[]),o}catch(n){if(!(n instanceof xi.SyntaxError))throw n;const{message:i,location:{start:s,end:o}}=n,l=t?{start:{offset:s.offset+t},end:{offset:o.offset+t}}:null,a=r.push("error","",0);return a.meta={error:{message:i,location:l}},a}}function Pk(r,e,t,n){const i=r.bMarks[e]+r.tShift[e],s=r.eMarks[e];if(!r.src.startsWith(Re,i))return!1;const o=On(r.src,i),l=r.src.slice(0,s).trim().length;if(!o||o<l-Et.length)return!1;const a=i+Re.length,u=r.src.slice(a,o).trim(),c=r.src.slice(i,o+Et.length).split(`
126
- `).length;if(u[0]==="$")return!1;if(n)return!0;const d=Vd(r,u,a);return d.map=[e,e+c],r.line+=c,!0}function Lk(r,e){if(!r.src.startsWith(Re,r.pos))return!1;const t=On(r.src,r.pos);if(!t)return!1;const n=r.src.slice(r.pos+Re.length,t);return e||Vd(r,n.trim()),r.pos=t+Et.length,!0}function zk(r){var t,n;let e;for(e of r.tokens)if(e.type==="fence"){if(e.info.includes(Re)){const i=e.info.indexOf(Re),s=On(e.info,i),o=e.info.slice(i+Re.length,s);try{const{meta:l}=(0,xi.parse)(o.trim(),{Variable:fs,Function:hs});e.meta=l}catch(l){if(!(l instanceof xi.SyntaxError))throw l;e.errors||(e.errors=[]),e.errors.push({id:"fence-tag-error",level:"error",message:`Syntax error in fence tag: ${l.message}`})}}(n=(t=e==null?void 0:e.meta)==null?void 0:t.attributes)!=null&&n.find(i=>i.name==="process"&&!i.value)||(e.children=Bd(e.content,e.map[0]))}}function qk(r){r.block.ruler.before("paragraph","annotations",Pk,{alt:["paragraph","blockquote"]}),r.inline.ruler.push("containers",Lk),r.core.ruler.push("annotations",zk)}var jd="---";function Hd(r,e){return r.src.slice(r.bMarks[e],r.eMarks[e]).trim()}function Vk(r,e){for(let t=1;t<e;t++)if(Hd(r,t)===jd)return t}function jk(r,e,t,n){if(e!=0||Hd(r,0)!=jd)return!1;const i=Vk(r,t);if(!i)return!1;if(n)return!0;const s=r.push("frontmatter","",0);return s.content=r.src.slice(r.eMarks[0],r.bMarks[i]).trim(),s.map=[0,i],s.hidden=!0,r.line=i+1,!0}function Hk(r){r.block.ruler.before("hr","frontmatter",jk)}var Ci="<!--",ko="-->";function Uk(r,e,t,n){const i=r.bMarks[e]+r.tShift[e];if(!r.src.startsWith(Ci,i))return!1;const s=r.src.indexOf(ko,i);if(s===-1)return!1;if(n)return!0;const o=r.src.slice(i+Ci.length,s),l=o.split(`
127
- `).length,a=r.push("comment","",0);return a.content=o.trim(),a.map=[e,e+l],r.line+=l,!0}function Wk(r,e){if(!r.src.startsWith(Ci,r.pos))return!1;const t=r.src.indexOf(ko,r.pos);if(t===-1)return!1;if(e)return!0;const n=r.src.slice(r.pos+Ci.length,t),i=r.push("comment","",0);return i.content=n.trim(),r.pos=t+ko.length,!0}function Kk(r){r.block.ruler.before("table","comment",Uk,{alt:["paragraph"]}),r.inline.ruler.push("comment",Wk)}var Jk="The 'href' format cannot contain Markdoc tag or variable. URLs must be static strings.";function Gk(r){const e=r;e.errors||(e.errors=[]),e.errors.push({id:"href-format-invalid",level:"error",message:Jk})}function Zk(r,e){let t;for(t of r.tokens)t.type!=="inline"||typeof t.content!="string"||Tb(t.content,e.validatedProtocols)&&Gk(t)}function Yk(r,e){r.core.ruler.push("link_url_validation",t=>Zk(t,e))}var Ud=class{constructor(r={}){this.parser=new $k.default(r),this.parser.use(qk,"annotations",{}),this.parser.use(Hk,"frontmatter",{}),this.parser.disable(["lheading","code"]),r.allowComments&&this.parser.use(Kk,"comments",{}),r.allowLinkValidation&&this.parser.use(Yk,r.linkValidationOptions??{validatedProtocols:["http","https"]})}tokenize(r){return this.parser.parse(r.toString(),{})}},Qk={String,Number,Array,Object,Boolean};function ul(r,e,t,n){var i,s;if(!r)return!0;if(Xe.isFunction(e)&&((i=t.validation)!=null&&i.validateFunctions)){const o=(s=t.functions)==null?void 0:s[e.name];return o!=null&&o.returns?Array.isArray(o.returns)?o.returns.find(l=>l===r)!==void 0:o.returns===r:!0}if(Xe.isAst(e))return!0;if(Array.isArray(r))return r.some(o=>ul(o,e,t,n));if(typeof r=="string"&&(r=Qk[r]),typeof r=="function"){const o=new r;if(o.validate)return o.validate(e,t,n)}return e!=null&&e.constructor===r}function cl(r){return typeof r=="string"?r:Array.isArray(r)?r.map(cl).join(" | "):r.name}function Xk(r,e){var i,s;const t=(i=e.functions)==null?void 0:i[r.name],n=[];if(!t)return[{id:"function-undefined",level:"critical",message:`Undefined function: '${r.name}'`}];if(t.validate&&n.push(...t.validate(r,e)),t.parameters)for(const[o,l]of Object.entries(r.parameters)){const a=(s=t.parameters)==null?void 0:s[o];if(!a){n.push({id:"parameter-undefined",level:"error",message:`Invalid parameter: '${o}'`});continue}if(!(Xe.isAst(l)&&!Xe.isFunction(l))&&a.type){const u=ul(a.type,l,e,o);u===!1?n.push({id:"parameter-type-invalid",level:"error",message:`Parameter '${o}' of '${r.name}' must be type of '${cl(a.type)}'`}):Array.isArray(u)&&n.push(...u)}}for(const[o,{required:l}]of Object.entries(t.parameters??{}))l&&r.parameters[o]===void 0&&n.push({id:"parameter-missing-required",level:"error",message:`Missing required parameter: '${o}'`});return n}function ev(r,e){return r.length<=e?JSON.stringify(r):`[${r.slice(0,e).map(n=>JSON.stringify(n)).join(",")}, ... ${r.length-e} more]`}function Wd(r,e){var s,o;const t=r.findSchema(e),n=[...r.errors||[]];if(!t)return n.push({id:r.tag?"tag-undefined":"node-undefined",level:"critical",message:r.tag?`Undefined tag: '${r.tag}'`:`Undefined node: '${r.type}'`}),n;t.inline!=null&&r.inline!==t.inline&&n.push({id:"tag-placement-invalid",level:"critical",message:`'${r.tag}' tag should be ${t.inline?"inline":"block"}`}),t.selfClosing&&r.children.length>0&&n.push({id:"tag-selfclosing-has-children",level:"critical",message:`'${r.tag}' tag should be self-closing`});const i={...sl,...t.attributes};for(const l of Object.keys(r.slots))((s=t.slots)==null?void 0:s[l])||n.push({id:"slot-undefined",level:"error",message:`Invalid slot: '${l}'`});for(let[l,a]of Object.entries(r.attributes)){const u=i[l];if(!u){n.push({id:"attribute-undefined",level:"error",message:`Invalid attribute: '${l}'`});continue}let{type:c,matches:d,errorLevel:f}=u;if(Xe.isAst(a))if(Xe.isFunction(a)&&((o=e.validation)!=null&&o.validateFunctions))n.push(...Xk(a,e));else if(Xe.isVariable(a)&&e.variables){let h=!1,m=e.variables;for(const p of a.path){if(!Object.prototype.hasOwnProperty.call(m,p)){h=!0;break}m=m[p]}h&&n.push({id:"variable-undefined",level:"error",message:`Undefined variable: '${a.path.join(".")}'`})}else continue;if(a=a,c){const h=ul(c,a,e,l);h===!1&&n.push({id:"attribute-type-invalid",level:f||"error",message:`Attribute '${l}' must be type of '${cl(c)}'`}),Array.isArray(h)&&n.push(...h)}if(typeof d=="function"&&(d=d(e)),Array.isArray(d)&&!d.includes(a)&&n.push({id:"attribute-value-invalid",level:f||"error",message:`Attribute '${l}' must match one of ${ev(d,8)}. Got '${a}' instead.`}),d instanceof RegExp&&!d.test(a)&&n.push({id:"attribute-value-invalid",level:f||"error",message:`Attribute '${l}' must match ${d}. Got '${a}' instead.`}),typeof u.validate=="function"){const h=u.validate(a,e,l);Array.isArray(h)&&n.push(...h)}}for(const[l,{required:a}]of Object.entries(i))a&&r.attributes[l]===void 0&&n.push({id:"attribute-missing-required",level:"error",message:`Missing required attribute: '${l}'`});if(t.slots)for(const[l,{required:a}]of Object.entries(t.slots))a&&r.slots[l]===void 0&&n.push({id:"slot-missing-required",level:"error",message:`Missing required slot: '${l}'`});for(const{type:l}of r.children)t.children&&l!=="error"&&!t.children.includes(l)&&n.push({id:"child-invalid",level:"warning",message:`Can't nest '${l}' in '${r.tag||r.type}'`});if(t.validate){const l=t.validate(r,e);if(xr(l))return l.then(a=>n.concat(a));n.push(...l)}return n}function*Kd(r,e=[]){yield[r,e];for(const t of[...Object.values(r.slots),...r.children])yield*Kd(t,[...e,r])}function tv(r){var t,n;const e=r.location;return e!=null&&typeof((t=e.start)==null?void 0:t.line)=="number"&&typeof((n=e.end)==null?void 0:n.line)=="number"&&(e.file===void 0||typeof e.file=="string")}function uu(r,e){var t;return tv(e)?{type:r.type,lines:[e.location.start.line,e.location.end.line],location:{file:(t=r.location)==null?void 0:t.file,...e.location},error:e}:{type:r.type,lines:r.lines,location:r.location,error:e}}function rv(r,e){const t=[...Kd(r)].map(([n,i])=>{const s={...e,validation:{...e.validation,parents:i}},o=Wd(n,s);return xr(o)?o.then(l=>l.map(a=>uu(n,a))):o.map(l=>uu(n,l))});return t.some(xr)?Promise.all(t).then(n=>n.flat()):t.flat()}var nv=new Ud;function Jd(r={}){return{...r,tags:{...qd,...r.tags},nodes:{...ll,...r.nodes},functions:{...Pd,...r.functions}}}function cu(r,e){return typeof r=="string"&&(r=nv.tokenize(r)),Qb(r,e)}function Gd(r,e){return Array.isArray(r)?r.flatMap(t=>t.resolve(e)):r.resolve(e)}function du(r,e){const t=Jd(e),n=Gd(r,t);return Array.isArray(n)?n.flatMap(i=>i.transform(t)):n.transform(t)}function fu(r,e){const t=Jd(e);return rv(r,t)}function iv(r,e={},...t){return{name:r,attributes:e,children:t}}var me,sv=(me=class{constructor(e){this.parse=cu,this.resolve=t=>Gd(t,this.config),this.transform=t=>du(t,this.config),this.validate=t=>fu(t,this.config),this.config=e}},me.nodes=ll,me.tags=qd,me.functions=Pd,me.globalAttributes=sl,me.renderers=Nk,me.transforms=Ld,me.Ast=Xe,me.Tag=Dt,me.Tokenizer=Ud,me.parseTags=Bd,me.transformer=Qr,me.validator=Wd,me.parse=cu,me.transform=du,me.validate=fu,me.createElement=iv,me.truthy=Nn,me.format=vi,me);function ov(r){return r.replace(/([\\`*_[\]<])/g,"\\$1").replace(/^(\s*)([#>-])/gm,"$1\\$2").replace(/^(\s*\d+)\./gm,"$1\\.")}function lv(r,e=[]){var i;let t=r;e.some(s=>s.type==="code")&&(t=`\`${t}\``),e.some(s=>s.type==="bold")&&(t=`**${t}**`),e.some(s=>s.type==="italic")&&(t=`_${t}_`),e.some(s=>s.type==="strike")&&(t=`~~${t}~~`);const n=e.find(s=>s.type==="link");if(n){const s=String(((i=n.attrs)==null?void 0:i.href)??"");t=`[${t}](${s})`}return t}function hu(r=[]){return r.map(e=>{var n;if(e.type==="hardBreak")return`\\
128
- `;if(e.type!=="text")return"";const t=((n=e.marks)==null?void 0:n.some(i=>i.type==="code"))??!1;return lv(t?e.text??"":ov(e.text??""),e.marks)}).join("")}function pu(r,e,t){return r.split(`
125
+ `}var Vk={html:ni,react:Lk,reactStatic:qk},jk=class{validate(r,e){const{partials:t={}}=e;return t[r]?[]:[{id:"attribute-value-invalid",level:"error",message:`Partial \`${r}\` not found. The 'file' attribute must be set in \`config.partials\``}]}},Hk={inline:!1,selfClosing:!0,attributes:{file:{type:jk,render:!1,required:!0},variables:{type:Object,render:!1}},transform(r,e){const{partials:t={}}=e,{file:n,variables:i}=r.attributes,s=t[n];if(!s)return null;const o={...e,variables:{...e.variables,...i,"$$partial:filename":n}},l=a=>a.resolve(o).transformChildren(o);return Array.isArray(s)?s.flatMap(l):l(s)}},Uk={children:["table"],inline:!1},Wk={attributes:{primary:{type:String,required:!0}}},jd={else:Xb,if:Qb,partial:Hk,slot:Wk,table:Uk},Kk=fs(Bd()),Ci=fs(Dd());function Hd(r,e,t){try{const{type:n,meta:i,nesting:s=0}=(0,Ci.parse)(e,{Variable:hs,Function:ps}),o=r.push(n,"",s);return o.info=e,o.meta=i,r.delimiters||(r.delimiters=[]),o}catch(n){if(!(n instanceof Ci.SyntaxError))throw n;const{message:i,location:{start:s,end:o}}=n,l=t?{start:{offset:s.offset+t},end:{offset:o.offset+t}}:null,a=r.push("error","",0);return a.meta={error:{message:i,location:l}},a}}function Jk(r,e,t,n){const i=r.bMarks[e]+r.tShift[e],s=r.eMarks[e];if(!r.src.startsWith(Re,i))return!1;const o=In(r.src,i),l=r.src.slice(0,s).trim().length;if(!o||o<l-Et.length)return!1;const a=i+Re.length,u=r.src.slice(a,o).trim(),c=r.src.slice(i,o+Et.length).split(`
126
+ `).length;if(u[0]==="$")return!1;if(n)return!0;const d=Hd(r,u,a);return d.map=[e,e+c],r.line+=c,!0}function Gk(r,e){if(!r.src.startsWith(Re,r.pos))return!1;const t=In(r.src,r.pos);if(!t)return!1;const n=r.src.slice(r.pos+Re.length,t);return e||Hd(r,n.trim()),r.pos=t+Et.length,!0}function Zk(r){var t,n;let e;for(e of r.tokens)if(e.type==="fence"){if(e.info.includes(Re)){const i=e.info.indexOf(Re),s=In(e.info,i),o=e.info.slice(i+Re.length,s);try{const{meta:l}=(0,Ci.parse)(o.trim(),{Variable:hs,Function:ps});e.meta=l}catch(l){if(!(l instanceof Ci.SyntaxError))throw l;e.errors||(e.errors=[]),e.errors.push({id:"fence-tag-error",level:"error",message:`Syntax error in fence tag: ${l.message}`})}}(n=(t=e==null?void 0:e.meta)==null?void 0:t.attributes)!=null&&n.find(i=>i.name==="process"&&!i.value)||(e.children=Rd(e.content,e.map[0]))}}function Yk(r){r.block.ruler.before("paragraph","annotations",Jk,{alt:["paragraph","blockquote"]}),r.inline.ruler.push("containers",Gk),r.core.ruler.push("annotations",Zk)}var Ud="---";function Wd(r,e){return r.src.slice(r.bMarks[e],r.eMarks[e]).trim()}function Qk(r,e){for(let t=1;t<e;t++)if(Wd(r,t)===Ud)return t}function Xk(r,e,t,n){if(e!=0||Wd(r,0)!=Ud)return!1;const i=Qk(r,t);if(!i)return!1;if(n)return!0;const s=r.push("frontmatter","",0);return s.content=r.src.slice(r.eMarks[0],r.bMarks[i]).trim(),s.map=[0,i],s.hidden=!0,r.line=i+1,!0}function ev(r){r.block.ruler.before("hr","frontmatter",Xk)}var Ai="<!--",xo="-->";function tv(r,e,t,n){const i=r.bMarks[e]+r.tShift[e];if(!r.src.startsWith(Ai,i))return!1;const s=r.src.indexOf(xo,i);if(s===-1)return!1;if(n)return!0;const o=r.src.slice(i+Ai.length,s),l=o.split(`
127
+ `).length,a=r.push("comment","",0);return a.content=o.trim(),a.map=[e,e+l],r.line+=l,!0}function rv(r,e){if(!r.src.startsWith(Ai,r.pos))return!1;const t=r.src.indexOf(xo,r.pos);if(t===-1)return!1;if(e)return!0;const n=r.src.slice(r.pos+Ai.length,t),i=r.push("comment","",0);return i.content=n.trim(),r.pos=t+xo.length,!0}function nv(r){r.block.ruler.before("table","comment",tv,{alt:["paragraph"]}),r.inline.ruler.push("comment",rv)}var iv="The 'href' format cannot contain Markdoc tag or variable. URLs must be static strings.";function sv(r){const e=r;e.errors||(e.errors=[]),e.errors.push({id:"href-format-invalid",level:"error",message:iv})}function ov(r,e){let t;for(t of r.tokens)t.type!=="inline"||typeof t.content!="string"||Lb(t.content,e.validatedProtocols)&&sv(t)}function lv(r,e){r.core.ruler.push("link_url_validation",t=>ov(t,e))}var Kd=class{constructor(r={}){this.parser=new Kk.default(r),this.parser.use(Yk,"annotations",{}),this.parser.use(ev,"frontmatter",{}),this.parser.disable(["lheading","code"]),r.allowComments&&this.parser.use(nv,"comments",{}),r.allowLinkValidation&&this.parser.use(lv,r.linkValidationOptions??{validatedProtocols:["http","https"]})}tokenize(r){return this.parser.parse(r.toString(),{})}},av={String,Number,Array,Object,Boolean};function cl(r,e,t,n){var i,s;if(!r)return!0;if(Xe.isFunction(e)&&((i=t.validation)!=null&&i.validateFunctions)){const o=(s=t.functions)==null?void 0:s[e.name];return o!=null&&o.returns?Array.isArray(o.returns)?o.returns.find(l=>l===r)!==void 0:o.returns===r:!0}if(Xe.isAst(e))return!0;if(Array.isArray(r))return r.some(o=>cl(o,e,t,n));if(typeof r=="string"&&(r=av[r]),typeof r=="function"){const o=new r;if(o.validate)return o.validate(e,t,n)}return e!=null&&e.constructor===r}function dl(r){return typeof r=="string"?r:Array.isArray(r)?r.map(dl).join(" | "):r.name}function uv(r,e){var i,s;const t=(i=e.functions)==null?void 0:i[r.name],n=[];if(!t)return[{id:"function-undefined",level:"critical",message:`Undefined function: '${r.name}'`}];if(t.validate&&n.push(...t.validate(r,e)),t.parameters)for(const[o,l]of Object.entries(r.parameters)){const a=(s=t.parameters)==null?void 0:s[o];if(!a){n.push({id:"parameter-undefined",level:"error",message:`Invalid parameter: '${o}'`});continue}if(!(Xe.isAst(l)&&!Xe.isFunction(l))&&a.type){const u=cl(a.type,l,e,o);u===!1?n.push({id:"parameter-type-invalid",level:"error",message:`Parameter '${o}' of '${r.name}' must be type of '${dl(a.type)}'`}):Array.isArray(u)&&n.push(...u)}}for(const[o,{required:l}]of Object.entries(t.parameters??{}))l&&r.parameters[o]===void 0&&n.push({id:"parameter-missing-required",level:"error",message:`Missing required parameter: '${o}'`});return n}function cv(r,e){return r.length<=e?JSON.stringify(r):`[${r.slice(0,e).map(n=>JSON.stringify(n)).join(",")}, ... ${r.length-e} more]`}function Jd(r,e){var s,o;const t=r.findSchema(e),n=[...r.errors||[]];if(!t)return n.push({id:r.tag?"tag-undefined":"node-undefined",level:"critical",message:r.tag?`Undefined tag: '${r.tag}'`:`Undefined node: '${r.type}'`}),n;t.inline!=null&&r.inline!==t.inline&&n.push({id:"tag-placement-invalid",level:"critical",message:`'${r.tag}' tag should be ${t.inline?"inline":"block"}`}),t.selfClosing&&r.children.length>0&&n.push({id:"tag-selfclosing-has-children",level:"critical",message:`'${r.tag}' tag should be self-closing`});const i={...ol,...t.attributes};for(const l of Object.keys(r.slots))((s=t.slots)==null?void 0:s[l])||n.push({id:"slot-undefined",level:"error",message:`Invalid slot: '${l}'`});for(let[l,a]of Object.entries(r.attributes)){const u=i[l];if(!u){n.push({id:"attribute-undefined",level:"error",message:`Invalid attribute: '${l}'`});continue}let{type:c,matches:d,errorLevel:f}=u;if(Xe.isAst(a))if(Xe.isFunction(a)&&((o=e.validation)!=null&&o.validateFunctions))n.push(...uv(a,e));else if(Xe.isVariable(a)&&e.variables){let h=!1,m=e.variables;for(const p of a.path){if(!Object.prototype.hasOwnProperty.call(m,p)){h=!0;break}m=m[p]}h&&n.push({id:"variable-undefined",level:"error",message:`Undefined variable: '${a.path.join(".")}'`})}else continue;if(a=a,c){const h=cl(c,a,e,l);h===!1&&n.push({id:"attribute-type-invalid",level:f||"error",message:`Attribute '${l}' must be type of '${dl(c)}'`}),Array.isArray(h)&&n.push(...h)}if(typeof d=="function"&&(d=d(e)),Array.isArray(d)&&!d.includes(a)&&n.push({id:"attribute-value-invalid",level:f||"error",message:`Attribute '${l}' must match one of ${cv(d,8)}. Got '${a}' instead.`}),d instanceof RegExp&&!d.test(a)&&n.push({id:"attribute-value-invalid",level:f||"error",message:`Attribute '${l}' must match ${d}. Got '${a}' instead.`}),typeof u.validate=="function"){const h=u.validate(a,e,l);Array.isArray(h)&&n.push(...h)}}for(const[l,{required:a}]of Object.entries(i))a&&r.attributes[l]===void 0&&n.push({id:"attribute-missing-required",level:"error",message:`Missing required attribute: '${l}'`});if(t.slots)for(const[l,{required:a}]of Object.entries(t.slots))a&&r.slots[l]===void 0&&n.push({id:"slot-missing-required",level:"error",message:`Missing required slot: '${l}'`});for(const{type:l}of r.children)t.children&&l!=="error"&&!t.children.includes(l)&&n.push({id:"child-invalid",level:"warning",message:`Can't nest '${l}' in '${r.tag||r.type}'`});if(t.validate){const l=t.validate(r,e);if(Cr(l))return l.then(a=>n.concat(a));n.push(...l)}return n}function*Gd(r,e=[]){yield[r,e];for(const t of[...Object.values(r.slots),...r.children])yield*Gd(t,[...e,r])}function dv(r){var t,n;const e=r.location;return e!=null&&typeof((t=e.start)==null?void 0:t.line)=="number"&&typeof((n=e.end)==null?void 0:n.line)=="number"&&(e.file===void 0||typeof e.file=="string")}function cu(r,e){var t;return dv(e)?{type:r.type,lines:[e.location.start.line,e.location.end.line],location:{file:(t=r.location)==null?void 0:t.file,...e.location},error:e}:{type:r.type,lines:r.lines,location:r.location,error:e}}function fv(r,e){const t=[...Gd(r)].map(([n,i])=>{const s={...e,validation:{...e.validation,parents:i}},o=Jd(n,s);return Cr(o)?o.then(l=>l.map(a=>cu(n,a))):o.map(l=>cu(n,l))});return t.some(Cr)?Promise.all(t).then(n=>n.flat()):t.flat()}var hv=new Kd;function Zd(r={}){return{...r,tags:{...jd,...r.tags},nodes:{...al,...r.nodes},functions:{...zd,...r.functions}}}function du(r,e){return typeof r=="string"&&(r=hv.tokenize(r)),ak(r,e)}function Yd(r,e){return Array.isArray(r)?r.flatMap(t=>t.resolve(e)):r.resolve(e)}function fu(r,e){const t=Zd(e),n=Yd(r,t);return Array.isArray(n)?n.flatMap(i=>i.transform(t)):n.transform(t)}function hu(r,e){const t=Zd(e);return fv(r,t)}function pv(r,e={},...t){return{name:r,attributes:e,children:t}}var ge,Qd=(ge=class{constructor(e){this.parse=du,this.resolve=t=>Yd(t,this.config),this.transform=t=>fu(t,this.config),this.validate=t=>hu(t,this.config),this.config=e}},ge.nodes=al,ge.tags=jd,ge.functions=zd,ge.globalAttributes=ol,ge.renderers=Vk,ge.transforms=qd,ge.Ast=Xe,ge.Tag=Dt,ge.Tokenizer=Kd,ge.parseTags=Rd,ge.transformer=Xr,ge.validator=Jd,ge.parse=du,ge.transform=fu,ge.validate=hu,ge.createElement=pv,ge.truthy=Bn,ge.format=xi,ge);function mv(r){return r.replace(/([\\`*_[\]<])/g,"\\$1").replace(/^(\s*)([#>-])/gm,"$1\\$2").replace(/^(\s*\d+)\./gm,"$1\\.")}function gv(r,e=[]){var i;let t=r;e.some(s=>s.type==="code")&&(t=`\`${t}\``),e.some(s=>s.type==="bold")&&(t=`**${t}**`),e.some(s=>s.type==="italic")&&(t=`_${t}_`),e.some(s=>s.type==="strike")&&(t=`~~${t}~~`);const n=e.find(s=>s.type==="link");if(n){const s=String(((i=n.attrs)==null?void 0:i.href)??"");t=`[${t}](${s})`}return t}function pu(r=[]){return r.map(e=>{var n;if(e.type==="hardBreak")return`\\
128
+ `;if(e.type!=="text")return"";const t=((n=e.marks)==null?void 0:n.some(i=>i.type==="code"))??!1;return gv(t?e.text??"":mv(e.text??""),e.marks)}).join("")}function mu(r,e,t){return r.split(`
129
129
  `).map((n,i)=>(i===0?e:t)+n).join(`
130
- `).replace(/[ \t]+$/gm,"")}function ri(r=[]){return r.map(e=>av(e)).filter(e=>e!=="").join(`
130
+ `).replace(/[ \t]+$/gm,"")}function ii(r=[]){return r.map(e=>bv(e)).filter(e=>e!=="").join(`
131
131
 
132
- `)}function av(r){var e,t,n,i;switch(r.type){case"paragraph":return hu(r.content);case"heading":{const s=Number(((e=r.attrs)==null?void 0:e.level)??2);return`${"#".repeat(Math.min(Math.max(s,1),6))} ${hu(r.content)}`}case"blockquote":return pu(ri(r.content),"> ","> ");case"horizontalRule":return"---";case"codeBlock":{const s=String(((t=r.attrs)==null?void 0:t.language)??""),o=((n=r.content)==null?void 0:n.map(l=>l.text??"").join(""))??"";return`\`\`\`${s}
132
+ `)}function yv(r){const e=ii(r);return e.startsWith("---")?`***${e.slice(3)}`:e}function bv(r){var e,t,n,i;switch(r.type){case"paragraph":return pu(r.content);case"heading":{const s=Number(((e=r.attrs)==null?void 0:e.level)??2);return`${"#".repeat(Math.min(Math.max(s,1),6))} ${pu(r.content)}`}case"blockquote":return mu(ii(r.content),"> ","> ");case"horizontalRule":return"---";case"codeBlock":{const s=String(((t=r.attrs)==null?void 0:t.language)??""),o=((n=r.content)==null?void 0:n.map(l=>l.text??"").join(""))??"";return`\`\`\`${s}
133
133
  ${o}
134
- \`\`\``}case"bulletList":case"orderedList":{const s=r.type==="orderedList",o=Number(((i=r.attrs)==null?void 0:i.start)??1);return(r.content??[]).map((l,a)=>{const u=s?`${o+a}. `:"- ";return pu(ri(l.content),u," ".repeat(u.length))}).join(`
135
- `)}default:return r.content?ri(r.content):""}}function mu(r){var t;if(!((t=r==null?void 0:r.content)!=null&&t.length))return"";const e=ri(r.content).trim();return e===""?"":`${e}
136
- `}function gu(r,e){return(r??"").trim()===(e??"").trim()}const uv={strong:"bold",em:"italic",s:"strike"};function $r(r,e){const t=[];for(const n of r){if(n.type==="text"){const s=String(n.attributes.content??"");s!==""&&t.push({type:"text",text:s,...e.length?{marks:e}:{}});continue}if(n.type==="softbreak"){t.push({type:"text",text:" ",...e.length?{marks:e}:{}});continue}if(n.type==="hardbreak"){t.push({type:"hardBreak"});continue}if(n.type==="code"){const s=String(n.attributes.content??"");s!==""&&t.push({type:"text",text:s,marks:[...e,{type:"code"}]});continue}if(n.type==="link"){t.push(...$r(n.children,[...e,{type:"link",attrs:{href:String(n.attributes.href??"")}}]));continue}const i=uv[n.type];if(i){t.push(...$r(n.children,[...e,{type:i}]));continue}t.push(...$r(n.children,e))}return t}function Xr(r){const e=[];for(const t of r)switch(t.type){case"inline":e.push({type:"paragraph",content:$r(t.children,[])});break;case"paragraph":{const n=$r(t.children.flatMap(i=>i.type==="inline"?i.children:[i]),[]);e.push({type:"paragraph",...n.length?{content:n}:{}});break}case"heading":{const n=$r(t.children.flatMap(i=>i.type==="inline"?i.children:[i]),[]);e.push({type:"heading",attrs:{level:Number(t.attributes.level??2)},...n.length?{content:n}:{}});break}case"blockquote":e.push({type:"blockquote",content:Xr(t.children)});break;case"hr":e.push({type:"horizontalRule"});break;case"fence":e.push({type:"codeBlock",attrs:{language:String(t.attributes.language??"")||null},content:[{type:"text",text:String(t.attributes.content??"").trimEnd()}]});break;case"list":{const n=t.attributes.ordered===!0;e.push({type:n?"orderedList":"bulletList",content:t.children.filter(i=>i.type==="item").map(i=>({type:"listItem",content:Xr(i.children)}))});break}case"item":e.push({type:"listItem",content:Xr(t.children)});break;default:e.push(...Xr(t.children))}return e}function yu(r){if(!(r!=null&&r.trim()))return{type:"doc",content:[{type:"paragraph"}]};const e=Xr(sv.parse(r).children);return{type:"doc",content:e.length?e:[{type:"paragraph"}]}}const cv="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",dv="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",vo="numeric",xo="ascii",Co="alpha",on="asciinumeric",en="alphanumeric",Ao="domain",Zd="emoji",fv="scheme",hv="slashscheme",Rs="whitespace";function pv(r,e){return r in e||(e[r]=[]),e[r]}function pr(r,e,t){e[vo]&&(e[on]=!0,e[en]=!0),e[xo]&&(e[on]=!0,e[Co]=!0),e[on]&&(e[en]=!0),e[Co]&&(e[en]=!0),e[en]&&(e[Ao]=!0),e[Zd]&&(e[Ao]=!0);for(const n in e){const i=pv(n,t);i.indexOf(r)<0&&i.push(r)}}function mv(r,e){const t={};for(const n in e)e[n].indexOf(r)>=0&&(t[n]=!0);return t}function Ze(r=null){this.j={},this.jr=[],this.jd=null,this.t=r}Ze.groups={};Ze.prototype={accepts(){return!!this.t},go(r){const e=this,t=e.j[r];if(t)return t;for(let n=0;n<e.jr.length;n++){const i=e.jr[n][0],s=e.jr[n][1];if(s&&i.test(r))return s}return e.jd},has(r,e=!1){return e?r in this.j:!!this.go(r)},ta(r,e,t,n){for(let i=0;i<r.length;i++)this.tt(r[i],e,t,n)},tr(r,e,t,n){n=n||Ze.groups;let i;return e&&e.j?i=e:(i=new Ze(e),t&&n&&pr(e,t,n)),this.jr.push([r,i]),i},ts(r,e,t,n){let i=this;const s=r.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(r[o]);return i.tt(r[s-1],e,t,n)},tt(r,e,t,n){n=n||Ze.groups;const i=this;if(e&&e.j)return i.j[r]=e,e;const s=e;let o,l=i.go(r);if(l?(o=new Ze,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new Ze,s){if(n)if(o.t&&typeof o.t=="string"){const a=Object.assign(mv(o.t,n),t);pr(s,a,n)}else t&&pr(s,t,n);o.t=s}return i.j[r]=o,o}};const ne=(r,e,t,n,i)=>r.ta(e,t,n,i),ke=(r,e,t,n,i)=>r.tr(e,t,n,i),bu=(r,e,t,n,i)=>r.ts(e,t,n,i),L=(r,e,t,n,i)=>r.tt(e,t,n,i),It="WORD",wo="UWORD",Yd="ASCIINUMERICAL",Qd="ALPHANUMERICAL",wn="LOCALHOST",Eo="TLD",So="UTLD",ni="SCHEME",Ir="SLASH_SCHEME",dl="NUM",Do="WS",fl="NL",ln="OPENBRACE",an="CLOSEBRACE",Ai="OPENBRACKET",wi="CLOSEBRACKET",Ei="OPENPAREN",Si="CLOSEPAREN",Di="OPENANGLEBRACKET",_i="CLOSEANGLEBRACKET",Ti="FULLWIDTHLEFTPAREN",Mi="FULLWIDTHRIGHTPAREN",Oi="LEFTCORNERBRACKET",Ni="RIGHTCORNERBRACKET",Ii="LEFTWHITECORNERBRACKET",Bi="RIGHTWHITECORNERBRACKET",Fi="FULLWIDTHLESSTHAN",Ri="FULLWIDTHGREATERTHAN",$i="AMPERSAND",Pi="APOSTROPHE",Li="ASTERISK",Wt="AT",zi="BACKSLASH",qi="BACKTICK",Vi="CARET",mr="COLON",hl="COMMA",ji="DOLLAR",xt="DOT",Hi="EQUALS",pl="EXCLAMATION",st="HYPHEN",un="PERCENT",Ui="PIPE",Wi="PLUS",Ki="POUND",cn="QUERY",ml="QUOTE",Xd="FULLWIDTHMIDDLEDOT",gl="SEMI",Ct="SLASH",dn="TILDE",Ji="UNDERSCORE",ef="EMOJI",Gi="SYM";var tf=Object.freeze({__proto__:null,ALPHANUMERICAL:Qd,AMPERSAND:$i,APOSTROPHE:Pi,ASCIINUMERICAL:Yd,ASTERISK:Li,AT:Wt,BACKSLASH:zi,BACKTICK:qi,CARET:Vi,CLOSEANGLEBRACKET:_i,CLOSEBRACE:an,CLOSEBRACKET:wi,CLOSEPAREN:Si,COLON:mr,COMMA:hl,DOLLAR:ji,DOT:xt,EMOJI:ef,EQUALS:Hi,EXCLAMATION:pl,FULLWIDTHGREATERTHAN:Ri,FULLWIDTHLEFTPAREN:Ti,FULLWIDTHLESSTHAN:Fi,FULLWIDTHMIDDLEDOT:Xd,FULLWIDTHRIGHTPAREN:Mi,HYPHEN:st,LEFTCORNERBRACKET:Oi,LEFTWHITECORNERBRACKET:Ii,LOCALHOST:wn,NL:fl,NUM:dl,OPENANGLEBRACKET:Di,OPENBRACE:ln,OPENBRACKET:Ai,OPENPAREN:Ei,PERCENT:un,PIPE:Ui,PLUS:Wi,POUND:Ki,QUERY:cn,QUOTE:ml,RIGHTCORNERBRACKET:Ni,RIGHTWHITECORNERBRACKET:Bi,SCHEME:ni,SEMI:gl,SLASH:Ct,SLASH_SCHEME:Ir,SYM:Gi,TILDE:dn,TLD:Eo,UNDERSCORE:Ji,UTLD:So,UWORD:wo,WORD:It,WS:Do});const Ot=/[a-z]/,Jr=new RegExp("\\p{L}","u"),$s=new RegExp("\\p{Emoji}","u"),Nt=/\d/,Ps=/\s/,ku="\r",Ls=`
137
- `,gv="️",yv="‍",zs="";let Jn=null,Gn=null;function bv(r=[]){const e={};Ze.groups=e;const t=new Ze;Jn==null&&(Jn=vu(cv)),Gn==null&&(Gn=vu(dv)),L(t,"'",Pi),L(t,"{",ln),L(t,"}",an),L(t,"[",Ai),L(t,"]",wi),L(t,"(",Ei),L(t,")",Si),L(t,"<",Di),L(t,">",_i),L(t,"(",Ti),L(t,")",Mi),L(t,"「",Oi),L(t,"」",Ni),L(t,"『",Ii),L(t,"』",Bi),L(t,"<",Fi),L(t,">",Ri),L(t,"&",$i),L(t,"*",Li),L(t,"@",Wt),L(t,"`",qi),L(t,"^",Vi),L(t,":",mr),L(t,",",hl),L(t,"$",ji),L(t,".",xt),L(t,"=",Hi),L(t,"!",pl),L(t,"-",st),L(t,"%",un),L(t,"|",Ui),L(t,"+",Wi),L(t,"#",Ki),L(t,"?",cn),L(t,'"',ml),L(t,"/",Ct),L(t,";",gl),L(t,"~",dn),L(t,"_",Ji),L(t,"\\",zi),L(t,"・",Xd);const n=ke(t,Nt,dl,{[vo]:!0});ke(n,Nt,n);const i=ke(n,Ot,Yd,{[on]:!0}),s=ke(n,Jr,Qd,{[en]:!0}),o=ke(t,Ot,It,{[xo]:!0});ke(o,Nt,i),ke(o,Ot,o),ke(i,Nt,i),ke(i,Ot,i);const l=ke(t,Jr,wo,{[Co]:!0});ke(l,Ot),ke(l,Nt,s),ke(l,Jr,l),ke(s,Nt,s),ke(s,Ot),ke(s,Jr,s);const a=L(t,Ls,fl,{[Rs]:!0}),u=L(t,ku,Do,{[Rs]:!0}),c=ke(t,Ps,Do,{[Rs]:!0});L(t,zs,c),L(u,Ls,a),L(u,zs,c),ke(u,Ps,c),L(c,ku),L(c,Ls),ke(c,Ps,c),L(c,zs,c);const d=ke(t,$s,ef,{[Zd]:!0});L(d,"#"),ke(d,$s,d),L(d,gv,d);const f=L(d,yv);L(f,"#"),ke(f,$s,d);const h=[[Ot,o],[Nt,i]],m=[[Ot,null],[Jr,l],[Nt,s]];for(let p=0;p<Jn.length;p++)jt(t,Jn[p],Eo,It,h);for(let p=0;p<Gn.length;p++)jt(t,Gn[p],So,wo,m);pr(Eo,{tld:!0,ascii:!0},e),pr(So,{utld:!0,alpha:!0},e),jt(t,"file",ni,It,h),jt(t,"mailto",ni,It,h),jt(t,"http",Ir,It,h),jt(t,"https",Ir,It,h),jt(t,"ftp",Ir,It,h),jt(t,"ftps",Ir,It,h),pr(ni,{scheme:!0,ascii:!0},e),pr(Ir,{slashscheme:!0,ascii:!0},e),r=r.sort((p,g)=>p[0]>g[0]?1:-1);for(let p=0;p<r.length;p++){const g=r[p][0],x=r[p][1]?{[fv]:!0}:{[hv]:!0};g.indexOf("-")>=0?x[Ao]=!0:Ot.test(g)?Nt.test(g)?x[on]=!0:x[xo]=!0:x[vo]=!0,bu(t,g,g,x)}return bu(t,"localhost",wn,{ascii:!0}),t.jd=new Ze(Gi),{start:t,tokens:Object.assign({groups:e},tf)}}function rf(r,e){const t=kv(e.replace(/[A-Z]/g,l=>l.toLowerCase())),n=t.length,i=[];let s=0,o=0;for(;o<n;){let l=r,a=null,u=0,c=null,d=-1,f=-1;for(;o<n&&(a=l.go(t[o]));)l=a,l.accepts()?(d=0,f=0,c=l):d>=0&&(d+=t[o].length,f++),u+=t[o].length,s+=t[o].length,o++;s-=d,o-=f,u-=d,i.push({t:c.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function kv(r){const e=[],t=r.length;let n=0;for(;n<t;){let i=r.charCodeAt(n),s,o=i<55296||i>56319||n+1===t||(s=r.charCodeAt(n+1))<56320||s>57343?r[n]:r.slice(n,n+2);e.push(o),n+=o.length}return e}function jt(r,e,t,n,i){let s;const o=e.length;for(let l=0;l<o-1;l++){const a=e[l];r.j[a]?s=r.j[a]:(s=new Ze(n),s.jr=i.slice(),r.j[a]=s),r=s}return s=new Ze(t),s.jr=i.slice(),r.j[e[o-1]]=s,s}function vu(r){const e=[],t=[];let n=0,i="0123456789";for(;n<r.length;){let s=0;for(;i.indexOf(r[n+s])>=0;)s++;if(s>0){e.push(t.join(""));for(let o=parseInt(r.substring(n,n+s),10);o>0;o--)t.pop();n+=s}else t.push(r[n]),n++}return e}const En={defaultProtocol:"http",events:null,format:xu,formatHref:xu,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function yl(r,e=null){let t=Object.assign({},En);r&&(t=Object.assign(t,r instanceof yl?r.o:r));const n=t.ignoreTags,i=[];for(let s=0;s<n.length;s++)i.push(n[s].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}yl.prototype={o:En,ignoreTags:[],defaultRender(r){return r},check(r){return this.get("validate",r.toString(),r)},get(r,e,t){const n=e!=null;let i=this.o[r];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:En[r],typeof i=="function"&&n&&(i=i(e,t))):typeof i=="function"&&n&&(i=i(e,t.t,t)),i)},getObj(r,e,t){let n=this.o[r];return typeof n=="function"&&e!=null&&(n=n(e,t.t,t)),n},render(r){const e=r.render(this);return(this.get("render",null,r)||this.defaultRender)(e,r.t,r)}};function xu(r){return r}function nf(r,e){this.t="token",this.v=r,this.tk=e}nf.prototype={isLink:!1,toString(){return this.v},toHref(r){return this.toString()},toFormattedString(r){const e=this.toString(),t=r.get("truncate",e,this),n=r.get("format",e,this);return t&&n.length>t?n.substring(0,t)+"…":n},toFormattedHref(r){return r.get("formatHref",this.toHref(r.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(r=En.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(r),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(r){return{type:this.t,value:this.toFormattedString(r),isLink:this.isLink,href:this.toFormattedHref(r),start:this.startIndex(),end:this.endIndex()}},validate(r){return r.get("validate",this.toString(),this)},render(r){const e=this,t=this.toHref(r.get("defaultProtocol")),n=r.get("formatHref",t,this),i=r.get("tagName",t,e),s=this.toFormattedString(r),o={},l=r.get("className",t,e),a=r.get("target",t,e),u=r.get("rel",t,e),c=r.getObj("attributes",t,e),d=r.getObj("events",t,e);return o.href=n,l&&(o.class=l),a&&(o.target=a),u&&(o.rel=u),c&&Object.assign(o,c),{tagName:i,attributes:o,content:s,eventListeners:d}}};function ps(r,e){class t extends nf{constructor(i,s){super(i,s),this.t=r}}for(const n in e)t.prototype[n]=e[n];return t.t=r,t}const vv=ps("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Cu=ps("text"),xv=ps("nl"),Zn=ps("url",{isLink:!0,toHref(r=En.defaultProtocol){return this.hasProtocol()?this.v:`${r}://${this.v}`},hasProtocol(){const r=this.tk;return r.length>=2&&r[0].t!==wn&&r[1].t===mr}}),it=r=>new Ze(r);function Cv({groups:r}){const e=r.domain.concat([$i,Li,Wt,zi,qi,Vi,ji,Hi,st,dl,un,Ui,Wi,Ki,Ct,Gi,dn,Ji]),t=[Pi,mr,hl,xt,pl,un,cn,ml,gl,Di,_i,ln,an,wi,Ai,Ei,Si,Ti,Mi,Oi,Ni,Ii,Bi,Fi,Ri],n=[$i,Pi,Li,zi,qi,Vi,ji,Hi,st,ln,an,un,Ui,Wi,Ki,cn,Ct,Gi,dn,Ji],i=it(),s=L(i,dn);ne(s,n,s),ne(s,r.domain,s);const o=it(),l=it(),a=it();ne(i,r.domain,o),ne(i,r.scheme,l),ne(i,r.slashscheme,a),ne(o,n,s),ne(o,r.domain,o);const u=L(o,Wt);L(s,Wt,u),L(l,Wt,u),L(a,Wt,u);const c=L(s,xt);ne(c,n,s),ne(c,r.domain,s);const d=it();ne(u,r.domain,d),ne(d,r.domain,d);const f=L(d,xt);ne(f,r.domain,d);const h=it(vv);ne(f,r.tld,h),ne(f,r.utld,h),L(u,wn,h);const m=L(d,st);L(m,st,m),ne(m,r.domain,d),ne(h,r.domain,d),L(h,xt,f),L(h,st,m);const p=L(o,st),g=L(o,xt);L(p,st,p),ne(p,r.domain,o),ne(g,n,s),ne(g,r.domain,o);const y=it(Zn);ne(g,r.tld,y),ne(g,r.utld,y),ne(y,r.domain,o),ne(y,n,s),L(y,xt,g),L(y,st,p),L(y,Wt,u);const x=L(y,mr),k=it(Zn);ne(x,r.numeric,k);const A=it(Zn),v=it();ne(A,e,A),ne(A,t,v),ne(v,e,A),ne(v,t,v),L(y,Ct,A),L(k,Ct,A);const S=L(l,mr),D=L(a,mr),_=L(D,Ct),$=L(_,Ct);ne(l,r.domain,o),L(l,xt,g),L(l,st,p),ne(a,r.domain,o),L(a,xt,g),L(a,st,p),ne(S,r.domain,A),L(S,Ct,A),L(S,cn,A),ne($,r.domain,A),ne($,e,A),L($,Ct,A);const T=[[ln,an],[Ai,wi],[Ei,Si],[Di,_i],[Ti,Mi],[Oi,Ni],[Ii,Bi],[Fi,Ri]];for(let I=0;I<T.length;I++){const[O,q]=T[I],B=L(A,O);L(v,O,B);const F=it(Zn);ne(B,e,F);const V=it();ne(B,t,V),L(B,q,A),ne(F,e,F),ne(F,t,V),ne(V,e,F),ne(V,t,V),L(F,q,A),L(V,q,A)}return L(i,wn,y),L(i,fl,xv),{start:i,tokens:tf}}function Av(r,e,t){let n=t.length,i=0,s=[],o=[];for(;i<n;){let l=r,a=null,u=null,c=0,d=null,f=-1;for(;i<n&&!(a=l.go(t[i].t));)o.push(t[i++]);for(;i<n&&(u=a||l.go(t[i].t));)a=null,l=u,l.accepts()?(f=0,d=l):f>=0&&f++,i++,c++;if(f<0)i-=c,i<n&&(o.push(t[i]),i++);else{o.length>0&&(s.push(qs(Cu,e,o)),o=[]),i-=f,c-=f;const h=d.t,m=t.slice(i-c,i);s.push(qs(h,e,m))}}return o.length>0&&s.push(qs(Cu,e,o)),s}function qs(r,e,t){const n=t[0].s,i=t[t.length-1].e,s=e.slice(n,i);return new r(s,t)}const wv=typeof console<"u"&&console&&console.warn||(()=>{}),Ev="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",he={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Sv(){return Ze.groups={},he.scanner=null,he.parser=null,he.tokenQueue=[],he.pluginQueue=[],he.customSchemes=[],he.initialized=!1,he}function Au(r,e=!1){if(he.initialized&&wv(`linkifyjs: already initialized - will not register custom scheme "${r}" ${Ev}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(r))throw new Error(`linkifyjs: incorrect scheme format.
134
+ \`\`\``}case"bulletList":case"orderedList":{const s=r.type==="orderedList",o=Number(((i=r.attrs)==null?void 0:i.start)??1);return(r.content??[]).map((l,a)=>{const u=s?`${o+a}. `:"- ";return mu(ii(l.content),u," ".repeat(u.length))}).join(`
135
+ `)}default:return r.content?ii(r.content):""}}function gu(r){var t;if(!((t=r==null?void 0:r.content)!=null&&t.length))return"";const e=yv(r.content).trim();return e===""?"":`${e}
136
+ `}function yu(r,e){return(r??"").trim()===(e??"").trim()}const kv={strong:"bold",em:"italic",s:"strike"};function $r(r,e){const t=[];for(const n of r){if(n.type==="text"){const s=String(n.attributes.content??"");s!==""&&t.push({type:"text",text:s,...e.length?{marks:e}:{}});continue}if(n.type==="softbreak"){t.push({type:"text",text:" ",...e.length?{marks:e}:{}});continue}if(n.type==="hardbreak"){t.push({type:"hardBreak"});continue}if(n.type==="code"){const s=String(n.attributes.content??"");s!==""&&t.push({type:"text",text:s,marks:[...e,{type:"code"}]});continue}if(n.type==="link"){t.push(...$r(n.children,[...e,{type:"link",attrs:{href:String(n.attributes.href??"")}}]));continue}const i=kv[n.type];if(i){t.push(...$r(n.children,[...e,{type:i}]));continue}t.push(...$r(n.children,e))}return t}function en(r){const e=[];for(const t of r)switch(t.type){case"inline":e.push({type:"paragraph",content:$r(t.children,[])});break;case"paragraph":{const n=$r(t.children.flatMap(i=>i.type==="inline"?i.children:[i]),[]);e.push({type:"paragraph",...n.length?{content:n}:{}});break}case"heading":{const n=$r(t.children.flatMap(i=>i.type==="inline"?i.children:[i]),[]);e.push({type:"heading",attrs:{level:Number(t.attributes.level??2)},...n.length?{content:n}:{}});break}case"blockquote":e.push({type:"blockquote",content:en(t.children)});break;case"hr":e.push({type:"horizontalRule"});break;case"fence":e.push({type:"codeBlock",attrs:{language:String(t.attributes.language??"")||null},content:[{type:"text",text:String(t.attributes.content??"").trimEnd()}]});break;case"list":{const n=t.attributes.ordered===!0,i=Number(t.attributes.start??1);e.push({type:n?"orderedList":"bulletList",...n&&i!==1?{attrs:{start:i}}:{},content:t.children.filter(s=>s.type==="item").map(s=>({type:"listItem",content:en(s.children)}))});break}case"item":e.push({type:"listItem",content:en(t.children)});break;default:e.push(...en(t.children))}return e}const vv=new Set(["document","paragraph","inline","text","softbreak","hardbreak","strong","em","s","code","link","heading","blockquote","hr","fence","list","item"]),xv=new Set(["table","thead","tbody","tr","th","td"]),Cv={image:"an image",html:"HTML",comment:"a comment"};function Av(r){if(!(r!=null&&r.trim()))return[];const e=new Set,t=n=>{n.type==="document"&&n.attributes.frontmatter&&e.add("front matter"),n.type==="text"&&typeof n.attributes.content!="string"&&e.add("a variable such as {% $name %}"),n.type==="tag"?e.add(`a {% ${n.tag??""} %} tag`):xv.has(n.type)?e.add("a table"):vv.has(n.type)?n.type==="link"&&n.attributes.title&&e.add("a link title"):e.add(Cv[n.type]??`a "${n.type}" node`),n.annotations.length>0&&e.add("an attribute such as {% .class %}"),n.errors.length>0&&e.add("Markdoc that does not parse");for(const i of n.children)t(i)};return t(Qd.parse(r)),[...e]}function $s(r){if(!(r!=null&&r.trim()))return{type:"doc",content:[{type:"paragraph"}]};const e=en(Qd.parse(r).children);return{type:"doc",content:e.length?e:[{type:"paragraph"}]}}const wv="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Ev="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Co="numeric",Ao="ascii",wo="alpha",an="asciinumeric",tn="alphanumeric",Eo="domain",Xd="emoji",Sv="scheme",Dv="slashscheme",Ps="whitespace";function _v(r,e){return r in e||(e[r]=[]),e[r]}function mr(r,e,t){e[Co]&&(e[an]=!0,e[tn]=!0),e[Ao]&&(e[an]=!0,e[wo]=!0),e[an]&&(e[tn]=!0),e[wo]&&(e[tn]=!0),e[tn]&&(e[Eo]=!0),e[Xd]&&(e[Eo]=!0);for(const n in e){const i=_v(n,t);i.indexOf(r)<0&&i.push(r)}}function Tv(r,e){const t={};for(const n in e)e[n].indexOf(r)>=0&&(t[n]=!0);return t}function Ze(r=null){this.j={},this.jr=[],this.jd=null,this.t=r}Ze.groups={};Ze.prototype={accepts(){return!!this.t},go(r){const e=this,t=e.j[r];if(t)return t;for(let n=0;n<e.jr.length;n++){const i=e.jr[n][0],s=e.jr[n][1];if(s&&i.test(r))return s}return e.jd},has(r,e=!1){return e?r in this.j:!!this.go(r)},ta(r,e,t,n){for(let i=0;i<r.length;i++)this.tt(r[i],e,t,n)},tr(r,e,t,n){n=n||Ze.groups;let i;return e&&e.j?i=e:(i=new Ze(e),t&&n&&mr(e,t,n)),this.jr.push([r,i]),i},ts(r,e,t,n){let i=this;const s=r.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(r[o]);return i.tt(r[s-1],e,t,n)},tt(r,e,t,n){n=n||Ze.groups;const i=this;if(e&&e.j)return i.j[r]=e,e;const s=e;let o,l=i.go(r);if(l?(o=new Ze,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new Ze,s){if(n)if(o.t&&typeof o.t=="string"){const a=Object.assign(Tv(o.t,n),t);mr(s,a,n)}else t&&mr(s,t,n);o.t=s}return i.j[r]=o,o}};const ne=(r,e,t,n,i)=>r.ta(e,t,n,i),ke=(r,e,t,n,i)=>r.tr(e,t,n,i),bu=(r,e,t,n,i)=>r.ts(e,t,n,i),L=(r,e,t,n,i)=>r.tt(e,t,n,i),It="WORD",So="UWORD",ef="ASCIINUMERICAL",tf="ALPHANUMERICAL",Sn="LOCALHOST",Do="TLD",_o="UTLD",si="SCHEME",Br="SLASH_SCHEME",fl="NUM",To="WS",hl="NL",un="OPENBRACE",cn="CLOSEBRACE",wi="OPENBRACKET",Ei="CLOSEBRACKET",Si="OPENPAREN",Di="CLOSEPAREN",_i="OPENANGLEBRACKET",Ti="CLOSEANGLEBRACKET",Mi="FULLWIDTHLEFTPAREN",Oi="FULLWIDTHRIGHTPAREN",Ni="LEFTCORNERBRACKET",Ii="RIGHTCORNERBRACKET",Bi="LEFTWHITECORNERBRACKET",Fi="RIGHTWHITECORNERBRACKET",Ri="FULLWIDTHLESSTHAN",$i="FULLWIDTHGREATERTHAN",Pi="AMPERSAND",Li="APOSTROPHE",zi="ASTERISK",Wt="AT",qi="BACKSLASH",Vi="BACKTICK",ji="CARET",gr="COLON",pl="COMMA",Hi="DOLLAR",xt="DOT",Ui="EQUALS",ml="EXCLAMATION",st="HYPHEN",dn="PERCENT",Wi="PIPE",Ki="PLUS",Ji="POUND",fn="QUERY",gl="QUOTE",rf="FULLWIDTHMIDDLEDOT",yl="SEMI",Ct="SLASH",hn="TILDE",Gi="UNDERSCORE",nf="EMOJI",Zi="SYM";var sf=Object.freeze({__proto__:null,ALPHANUMERICAL:tf,AMPERSAND:Pi,APOSTROPHE:Li,ASCIINUMERICAL:ef,ASTERISK:zi,AT:Wt,BACKSLASH:qi,BACKTICK:Vi,CARET:ji,CLOSEANGLEBRACKET:Ti,CLOSEBRACE:cn,CLOSEBRACKET:Ei,CLOSEPAREN:Di,COLON:gr,COMMA:pl,DOLLAR:Hi,DOT:xt,EMOJI:nf,EQUALS:Ui,EXCLAMATION:ml,FULLWIDTHGREATERTHAN:$i,FULLWIDTHLEFTPAREN:Mi,FULLWIDTHLESSTHAN:Ri,FULLWIDTHMIDDLEDOT:rf,FULLWIDTHRIGHTPAREN:Oi,HYPHEN:st,LEFTCORNERBRACKET:Ni,LEFTWHITECORNERBRACKET:Bi,LOCALHOST:Sn,NL:hl,NUM:fl,OPENANGLEBRACKET:_i,OPENBRACE:un,OPENBRACKET:wi,OPENPAREN:Si,PERCENT:dn,PIPE:Wi,PLUS:Ki,POUND:Ji,QUERY:fn,QUOTE:gl,RIGHTCORNERBRACKET:Ii,RIGHTWHITECORNERBRACKET:Fi,SCHEME:si,SEMI:yl,SLASH:Ct,SLASH_SCHEME:Br,SYM:Zi,TILDE:hn,TLD:Do,UNDERSCORE:Gi,UTLD:_o,UWORD:So,WORD:It,WS:To});const Ot=/[a-z]/,Gr=new RegExp("\\p{L}","u"),Ls=new RegExp("\\p{Emoji}","u"),Nt=/\d/,zs=/\s/,ku="\r",qs=`
137
+ `,Mv="️",Ov="‍",Vs="";let Zn=null,Yn=null;function Nv(r=[]){const e={};Ze.groups=e;const t=new Ze;Zn==null&&(Zn=vu(wv)),Yn==null&&(Yn=vu(Ev)),L(t,"'",Li),L(t,"{",un),L(t,"}",cn),L(t,"[",wi),L(t,"]",Ei),L(t,"(",Si),L(t,")",Di),L(t,"<",_i),L(t,">",Ti),L(t,"(",Mi),L(t,")",Oi),L(t,"「",Ni),L(t,"」",Ii),L(t,"『",Bi),L(t,"』",Fi),L(t,"<",Ri),L(t,">",$i),L(t,"&",Pi),L(t,"*",zi),L(t,"@",Wt),L(t,"`",Vi),L(t,"^",ji),L(t,":",gr),L(t,",",pl),L(t,"$",Hi),L(t,".",xt),L(t,"=",Ui),L(t,"!",ml),L(t,"-",st),L(t,"%",dn),L(t,"|",Wi),L(t,"+",Ki),L(t,"#",Ji),L(t,"?",fn),L(t,'"',gl),L(t,"/",Ct),L(t,";",yl),L(t,"~",hn),L(t,"_",Gi),L(t,"\\",qi),L(t,"・",rf);const n=ke(t,Nt,fl,{[Co]:!0});ke(n,Nt,n);const i=ke(n,Ot,ef,{[an]:!0}),s=ke(n,Gr,tf,{[tn]:!0}),o=ke(t,Ot,It,{[Ao]:!0});ke(o,Nt,i),ke(o,Ot,o),ke(i,Nt,i),ke(i,Ot,i);const l=ke(t,Gr,So,{[wo]:!0});ke(l,Ot),ke(l,Nt,s),ke(l,Gr,l),ke(s,Nt,s),ke(s,Ot),ke(s,Gr,s);const a=L(t,qs,hl,{[Ps]:!0}),u=L(t,ku,To,{[Ps]:!0}),c=ke(t,zs,To,{[Ps]:!0});L(t,Vs,c),L(u,qs,a),L(u,Vs,c),ke(u,zs,c),L(c,ku),L(c,qs),ke(c,zs,c),L(c,Vs,c);const d=ke(t,Ls,nf,{[Xd]:!0});L(d,"#"),ke(d,Ls,d),L(d,Mv,d);const f=L(d,Ov);L(f,"#"),ke(f,Ls,d);const h=[[Ot,o],[Nt,i]],m=[[Ot,null],[Gr,l],[Nt,s]];for(let p=0;p<Zn.length;p++)jt(t,Zn[p],Do,It,h);for(let p=0;p<Yn.length;p++)jt(t,Yn[p],_o,So,m);mr(Do,{tld:!0,ascii:!0},e),mr(_o,{utld:!0,alpha:!0},e),jt(t,"file",si,It,h),jt(t,"mailto",si,It,h),jt(t,"http",Br,It,h),jt(t,"https",Br,It,h),jt(t,"ftp",Br,It,h),jt(t,"ftps",Br,It,h),mr(si,{scheme:!0,ascii:!0},e),mr(Br,{slashscheme:!0,ascii:!0},e),r=r.sort((p,g)=>p[0]>g[0]?1:-1);for(let p=0;p<r.length;p++){const g=r[p][0],E=r[p][1]?{[Sv]:!0}:{[Dv]:!0};g.indexOf("-")>=0?E[Eo]=!0:Ot.test(g)?Nt.test(g)?E[an]=!0:E[Ao]=!0:E[Co]=!0,bu(t,g,g,E)}return bu(t,"localhost",Sn,{ascii:!0}),t.jd=new Ze(Zi),{start:t,tokens:Object.assign({groups:e},sf)}}function of(r,e){const t=Iv(e.replace(/[A-Z]/g,l=>l.toLowerCase())),n=t.length,i=[];let s=0,o=0;for(;o<n;){let l=r,a=null,u=0,c=null,d=-1,f=-1;for(;o<n&&(a=l.go(t[o]));)l=a,l.accepts()?(d=0,f=0,c=l):d>=0&&(d+=t[o].length,f++),u+=t[o].length,s+=t[o].length,o++;s-=d,o-=f,u-=d,i.push({t:c.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function Iv(r){const e=[],t=r.length;let n=0;for(;n<t;){let i=r.charCodeAt(n),s,o=i<55296||i>56319||n+1===t||(s=r.charCodeAt(n+1))<56320||s>57343?r[n]:r.slice(n,n+2);e.push(o),n+=o.length}return e}function jt(r,e,t,n,i){let s;const o=e.length;for(let l=0;l<o-1;l++){const a=e[l];r.j[a]?s=r.j[a]:(s=new Ze(n),s.jr=i.slice(),r.j[a]=s),r=s}return s=new Ze(t),s.jr=i.slice(),r.j[e[o-1]]=s,s}function vu(r){const e=[],t=[];let n=0,i="0123456789";for(;n<r.length;){let s=0;for(;i.indexOf(r[n+s])>=0;)s++;if(s>0){e.push(t.join(""));for(let o=parseInt(r.substring(n,n+s),10);o>0;o--)t.pop();n+=s}else t.push(r[n]),n++}return e}const Dn={defaultProtocol:"http",events:null,format:xu,formatHref:xu,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function bl(r,e=null){let t=Object.assign({},Dn);r&&(t=Object.assign(t,r instanceof bl?r.o:r));const n=t.ignoreTags,i=[];for(let s=0;s<n.length;s++)i.push(n[s].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}bl.prototype={o:Dn,ignoreTags:[],defaultRender(r){return r},check(r){return this.get("validate",r.toString(),r)},get(r,e,t){const n=e!=null;let i=this.o[r];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:Dn[r],typeof i=="function"&&n&&(i=i(e,t))):typeof i=="function"&&n&&(i=i(e,t.t,t)),i)},getObj(r,e,t){let n=this.o[r];return typeof n=="function"&&e!=null&&(n=n(e,t.t,t)),n},render(r){const e=r.render(this);return(this.get("render",null,r)||this.defaultRender)(e,r.t,r)}};function xu(r){return r}function lf(r,e){this.t="token",this.v=r,this.tk=e}lf.prototype={isLink:!1,toString(){return this.v},toHref(r){return this.toString()},toFormattedString(r){const e=this.toString(),t=r.get("truncate",e,this),n=r.get("format",e,this);return t&&n.length>t?n.substring(0,t)+"…":n},toFormattedHref(r){return r.get("formatHref",this.toHref(r.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(r=Dn.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(r),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(r){return{type:this.t,value:this.toFormattedString(r),isLink:this.isLink,href:this.toFormattedHref(r),start:this.startIndex(),end:this.endIndex()}},validate(r){return r.get("validate",this.toString(),this)},render(r){const e=this,t=this.toHref(r.get("defaultProtocol")),n=r.get("formatHref",t,this),i=r.get("tagName",t,e),s=this.toFormattedString(r),o={},l=r.get("className",t,e),a=r.get("target",t,e),u=r.get("rel",t,e),c=r.getObj("attributes",t,e),d=r.getObj("events",t,e);return o.href=n,l&&(o.class=l),a&&(o.target=a),u&&(o.rel=u),c&&Object.assign(o,c),{tagName:i,attributes:o,content:s,eventListeners:d}}};function ms(r,e){class t extends lf{constructor(i,s){super(i,s),this.t=r}}for(const n in e)t.prototype[n]=e[n];return t.t=r,t}const Bv=ms("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Cu=ms("text"),Fv=ms("nl"),Qn=ms("url",{isLink:!0,toHref(r=Dn.defaultProtocol){return this.hasProtocol()?this.v:`${r}://${this.v}`},hasProtocol(){const r=this.tk;return r.length>=2&&r[0].t!==Sn&&r[1].t===gr}}),it=r=>new Ze(r);function Rv({groups:r}){const e=r.domain.concat([Pi,zi,Wt,qi,Vi,ji,Hi,Ui,st,fl,dn,Wi,Ki,Ji,Ct,Zi,hn,Gi]),t=[Li,gr,pl,xt,ml,dn,fn,gl,yl,_i,Ti,un,cn,Ei,wi,Si,Di,Mi,Oi,Ni,Ii,Bi,Fi,Ri,$i],n=[Pi,Li,zi,qi,Vi,ji,Hi,Ui,st,un,cn,dn,Wi,Ki,Ji,fn,Ct,Zi,hn,Gi],i=it(),s=L(i,hn);ne(s,n,s),ne(s,r.domain,s);const o=it(),l=it(),a=it();ne(i,r.domain,o),ne(i,r.scheme,l),ne(i,r.slashscheme,a),ne(o,n,s),ne(o,r.domain,o);const u=L(o,Wt);L(s,Wt,u),L(l,Wt,u),L(a,Wt,u);const c=L(s,xt);ne(c,n,s),ne(c,r.domain,s);const d=it();ne(u,r.domain,d),ne(d,r.domain,d);const f=L(d,xt);ne(f,r.domain,d);const h=it(Bv);ne(f,r.tld,h),ne(f,r.utld,h),L(u,Sn,h);const m=L(d,st);L(m,st,m),ne(m,r.domain,d),ne(h,r.domain,d),L(h,xt,f),L(h,st,m);const p=L(o,st),g=L(o,xt);L(p,st,p),ne(p,r.domain,o),ne(g,n,s),ne(g,r.domain,o);const b=it(Qn);ne(g,r.tld,b),ne(g,r.utld,b),ne(b,r.domain,o),ne(b,n,s),L(b,xt,g),L(b,st,p),L(b,Wt,u);const E=L(b,gr),v=it(Qn);ne(E,r.numeric,v);const D=it(Qn),x=it();ne(D,e,D),ne(D,t,x),ne(x,e,D),ne(x,t,x),L(b,Ct,D),L(v,Ct,D);const k=L(l,gr),C=L(a,gr),w=L(C,Ct),I=L(w,Ct);ne(l,r.domain,o),L(l,xt,g),L(l,st,p),ne(a,r.domain,o),L(a,xt,g),L(a,st,p),ne(k,r.domain,D),L(k,Ct,D),L(k,fn,D),ne(I,r.domain,D),ne(I,e,D),L(I,Ct,D);const T=[[un,cn],[wi,Ei],[Si,Di],[_i,Ti],[Mi,Oi],[Ni,Ii],[Bi,Fi],[Ri,$i]];for(let B=0;B<T.length;B++){const[O,q]=T[B],F=L(D,O);L(x,O,F);const R=it(Qn);ne(F,e,R);const j=it();ne(F,t,j),L(F,q,D),ne(R,e,R),ne(R,t,j),ne(j,e,R),ne(j,t,j),L(R,q,D),L(j,q,D)}return L(i,Sn,b),L(i,hl,Fv),{start:i,tokens:sf}}function $v(r,e,t){let n=t.length,i=0,s=[],o=[];for(;i<n;){let l=r,a=null,u=null,c=0,d=null,f=-1;for(;i<n&&!(a=l.go(t[i].t));)o.push(t[i++]);for(;i<n&&(u=a||l.go(t[i].t));)a=null,l=u,l.accepts()?(f=0,d=l):f>=0&&f++,i++,c++;if(f<0)i-=c,i<n&&(o.push(t[i]),i++);else{o.length>0&&(s.push(js(Cu,e,o)),o=[]),i-=f,c-=f;const h=d.t,m=t.slice(i-c,i);s.push(js(h,e,m))}}return o.length>0&&s.push(js(Cu,e,o)),s}function js(r,e,t){const n=t[0].s,i=t[t.length-1].e,s=e.slice(n,i);return new r(s,t)}const Pv=typeof console<"u"&&console&&console.warn||(()=>{}),Lv="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",pe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function zv(){return Ze.groups={},pe.scanner=null,pe.parser=null,pe.tokenQueue=[],pe.pluginQueue=[],pe.customSchemes=[],pe.initialized=!1,pe}function Au(r,e=!1){if(pe.initialized&&Pv(`linkifyjs: already initialized - will not register custom scheme "${r}" ${Lv}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(r))throw new Error(`linkifyjs: incorrect scheme format.
138
138
  1. Must only contain digits, lowercase ASCII letters or "-"
139
139
  2. Cannot start or end with "-"
140
- 3. "-" cannot repeat`);he.customSchemes.push([r,e])}function Dv(){he.scanner=bv(he.customSchemes);for(let r=0;r<he.tokenQueue.length;r++)he.tokenQueue[r][1]({scanner:he.scanner});he.parser=Cv(he.scanner.tokens);for(let r=0;r<he.pluginQueue.length;r++)he.pluginQueue[r][1]({scanner:he.scanner,parser:he.parser});return he.initialized=!0,he}function bl(r){return he.initialized||Dv(),Av(he.parser.start,r,rf(he.scanner.start,r))}bl.scan=rf;function sf(r,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const n=new yl(t),i=bl(r),s=[];for(let o=0;o<i.length;o++){const l=i[o];l.isLink&&(!e||l.t===e)&&n.check(l)&&s.push(l.toFormattedObject(n))}return s}const kl="[\0-   ᠎ -\u2029  ]",_v=new RegExp(kl),Tv=new RegExp(`${kl}$`),Mv=new RegExp(kl,"g");function Ov(r){return r.length===1?r[0].isLink:r.length===3&&r[1].isLink?["()","[]"].includes(r[0].value+r[2].value):!1}function Nv(r){return new Le({key:new nt("autolink"),appendTransaction:(e,t,n)=>{const i=e.some(u=>u.docChanged)&&!t.doc.eq(n.doc),s=e.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=n,l=S1(t.doc,[...e]);if(B1(l).forEach(({newRange:u})=>{const c=_1(n.doc,u,h=>h.isTextblock);let d,f;if(c.length>1)d=c[0],f=n.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(c.length){const h=n.doc.textBetween(u.from,u.to," "," ");if(!Tv.test(h))return;d=c[0],f=n.doc.textBetween(d.pos,u.to,void 0," ")}if(d&&f){const h=f.split(_v).filter(Boolean);if(h.length<=0)return!1;const m=h[h.length-1],p=d.pos+f.lastIndexOf(m);if(!m)return!1;const g=bl(m).map(y=>y.toObject(r.defaultProtocol));if(!Ov(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:p+y.start+1,to:p+y.end+1})).filter(y=>n.schema.marks.code?!n.doc.rangeHasMark(y.from,y.to,n.schema.marks.code):!0).filter(y=>r.validate(y.value)).filter(y=>r.shouldAutoLink(y.value)).forEach(y=>{Qo(y.from,y.to,n.doc).some(x=>x.mark.type===r.type)||o.addMark(y.from,y.to,r.type.create({href:y.href}))})}}),!!o.steps.length)return o}})}function Iv(r){return new Le({key:new nt("handleClickLink"),props:{handleClick:(e,t,n)=>{var i,s;if(n.button!==0||!e.editable)return!1;let o=n.target;const l=[];for(;o.nodeName!=="DIV";)l.push(o),o=o.parentNode;if(!l.find(f=>f.nodeName==="A"))return!1;const a=Cd(e.state,r.type.name),u=n.target,c=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:a.href,d=(s=u==null?void 0:u.target)!==null&&s!==void 0?s:a.target;return u&&c?(window.open(c,d),!0):!1}}})}function Bv(r){return new Le({key:new nt("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:s}=i,{empty:o}=s;if(o)return!1;let l="";n.content.forEach(u=>{l+=u.textContent});const a=sf(l,{defaultProtocol:r.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!a?!1:r.editor.commands.setMark(r.type,{href:a.href})}}})}function ar(r,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&t.push(i)}),!r||r.replace(Mv,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Fv=qt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(r=>{if(typeof r=="string"){Au(r);return}Au(r.scheme,r.optionalSlashes)})},onDestroy(){Sv()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(r,e)=>!!ar(r,e.protocols),validate:r=>!!r,shouldAutoLink:r=>!!r}},addAttributes(){return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:r=>{const e=r.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!ar(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:r}){return this.options.isAllowedUri(r.href,{defaultValidate:e=>!!ar(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",$e(this.options.HTMLAttributes,r),0]:["a",$e(this.options.HTMLAttributes,{...r,href:""}),0]},addCommands(){return{setLink:r=>({chain:e})=>{const{href:t}=r;return this.options.isAllowedUri(t,{defaultValidate:n=>!!ar(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,r).setMeta("preventAutolink",!0).run():!1},toggleLink:r=>({chain:e})=>{const{href:t}=r;return this.options.isAllowedUri(t,{defaultValidate:n=>!!ar(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,r,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:r})=>r().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Sr({find:r=>{const e=[];if(r){const{protocols:t,defaultProtocol:n}=this.options,i=sf(r).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!ar(o,t),protocols:t,defaultProtocol:n}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:r=>{var e;return{href:(e=r.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const r=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&r.push(Nv({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!ar(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&r.push(Iv({type:this.type})),this.options.linkOnPaste&&r.push(Bv({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),r}}),Rv=/^\s*>\s$/,$v=bt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:r}){return["blockquote",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setBlockquote:()=>({commands:r})=>r.wrapIn(this.name),toggleBlockquote:()=>({commands:r})=>r.toggleWrap(this.name),unsetBlockquote:()=>({commands:r})=>r.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Cn({find:Rv,type:this.type})]}}),Pv=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Lv=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,zv=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,qv=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Vv=qt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:r=>r.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:r=>r.type.name===this.name},{style:"font-weight",getAttrs:r=>/^(bold(er)?|[5-9]\d{2,})$/.test(r)&&null}]},renderHTML({HTMLAttributes:r}){return["strong",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setBold:()=>({commands:r})=>r.setMark(this.name),toggleBold:()=>({commands:r})=>r.toggleMark(this.name),unsetBold:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[jr({find:Pv,type:this.type}),jr({find:zv,type:this.type})]},addPasteRules(){return[Sr({find:Lv,type:this.type}),Sr({find:qv,type:this.type})]}}),jv="listItem",wu="textStyle",Eu=/^\s*([-+*])\s$/,Hv=bt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:r}){return["ul",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleBulletList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(jv,this.editor.getAttributes(wu)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let r=Cn({find:Eu,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(r=Cn({find:Eu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(wu),editor:this.editor})),[r]}}),Uv=/(^|[^`])`([^`]+)`(?!`)/,Wv=/(^|[^`])`([^`]+)`(?!`)/g,Kv=qt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:r}){return["code",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setCode:()=>({commands:r})=>r.setMark(this.name),toggleCode:()=>({commands:r})=>r.toggleMark(this.name),unsetCode:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[jr({find:Uv,type:this.type})]},addPasteRules(){return[Sr({find:Wv,type:this.type})]}}),Jv=/^```([a-z]+)?[\s\n]$/,Gv=/^~~~([a-z]+)?[\s\n]$/,Zv=bt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:r=>{var e;const{languageClassPrefix:t}=this.options,s=[...((e=r.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:r,HTMLAttributes:e}){return["pre",$e(this.options.HTMLAttributes,e),["code",{class:r.attrs.language?this.options.languageClassPrefix+r.attrs.language:null},0]]},addCommands(){return{setCodeBlock:r=>({commands:e})=>e.setNode(this.name,r),toggleCodeBlock:r=>({commands:e})=>e.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:r,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!r||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:r})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=r,{selection:t}=e,{$from:n,empty:i}=t;if(!i||n.parent.type!==this.type)return!1;const s=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith(`
140
+ 3. "-" cannot repeat`);pe.customSchemes.push([r,e])}function qv(){pe.scanner=Nv(pe.customSchemes);for(let r=0;r<pe.tokenQueue.length;r++)pe.tokenQueue[r][1]({scanner:pe.scanner});pe.parser=Rv(pe.scanner.tokens);for(let r=0;r<pe.pluginQueue.length;r++)pe.pluginQueue[r][1]({scanner:pe.scanner,parser:pe.parser});return pe.initialized=!0,pe}function kl(r){return pe.initialized||qv(),$v(pe.parser.start,r,of(pe.scanner.start,r))}kl.scan=of;function af(r,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const n=new bl(t),i=kl(r),s=[];for(let o=0;o<i.length;o++){const l=i[o];l.isLink&&(!e||l.t===e)&&n.check(l)&&s.push(l.toFormattedObject(n))}return s}const vl="[\0-   ᠎ -\u2029  ]",Vv=new RegExp(vl),jv=new RegExp(`${vl}$`),Hv=new RegExp(vl,"g");function Uv(r){return r.length===1?r[0].isLink:r.length===3&&r[1].isLink?["()","[]"].includes(r[0].value+r[2].value):!1}function Wv(r){return new Le({key:new nt("autolink"),appendTransaction:(e,t,n)=>{const i=e.some(u=>u.docChanged)&&!t.doc.eq(n.doc),s=e.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=n,l=F1(t.doc,[...e]);if(H1(l).forEach(({newRange:u})=>{const c=$1(n.doc,u,h=>h.isTextblock);let d,f;if(c.length>1)d=c[0],f=n.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(c.length){const h=n.doc.textBetween(u.from,u.to," "," ");if(!jv.test(h))return;d=c[0],f=n.doc.textBetween(d.pos,u.to,void 0," ")}if(d&&f){const h=f.split(Vv).filter(Boolean);if(h.length<=0)return!1;const m=h[h.length-1],p=d.pos+f.lastIndexOf(m);if(!m)return!1;const g=kl(m).map(b=>b.toObject(r.defaultProtocol));if(!Uv(g))return!1;g.filter(b=>b.isLink).map(b=>({...b,from:p+b.start+1,to:p+b.end+1})).filter(b=>n.schema.marks.code?!n.doc.rangeHasMark(b.from,b.to,n.schema.marks.code):!0).filter(b=>r.validate(b.value)).filter(b=>r.shouldAutoLink(b.value)).forEach(b=>{Xo(b.from,b.to,n.doc).some(E=>E.mark.type===r.type)||o.addMark(b.from,b.to,r.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function Kv(r){return new Le({key:new nt("handleClickLink"),props:{handleClick:(e,t,n)=>{var i,s;if(n.button!==0||!e.editable)return!1;let o=n.target;const l=[];for(;o.nodeName!=="DIV";)l.push(o),o=o.parentNode;if(!l.find(f=>f.nodeName==="A"))return!1;const a=wd(e.state,r.type.name),u=n.target,c=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:a.href,d=(s=u==null?void 0:u.target)!==null&&s!==void 0?s:a.target;return u&&c?(window.open(c,d),!0):!1}}})}function Jv(r){return new Le({key:new nt("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:s}=i,{empty:o}=s;if(o)return!1;let l="";n.content.forEach(u=>{l+=u.textContent});const a=af(l,{defaultProtocol:r.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!a?!1:r.editor.commands.setMark(r.type,{href:a.href})}}})}function ar(r,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&t.push(i)}),!r||r.replace(Hv,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Gv=qt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(r=>{if(typeof r=="string"){Au(r);return}Au(r.scheme,r.optionalSlashes)})},onDestroy(){zv()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(r,e)=>!!ar(r,e.protocols),validate:r=>!!r,shouldAutoLink:r=>!!r}},addAttributes(){return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:r=>{const e=r.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!ar(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:r}){return this.options.isAllowedUri(r.href,{defaultValidate:e=>!!ar(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",$e(this.options.HTMLAttributes,r),0]:["a",$e(this.options.HTMLAttributes,{...r,href:""}),0]},addCommands(){return{setLink:r=>({chain:e})=>{const{href:t}=r;return this.options.isAllowedUri(t,{defaultValidate:n=>!!ar(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,r).setMeta("preventAutolink",!0).run():!1},toggleLink:r=>({chain:e})=>{const{href:t}=r;return this.options.isAllowedUri(t,{defaultValidate:n=>!!ar(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,r,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:r})=>r().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Dr({find:r=>{const e=[];if(r){const{protocols:t,defaultProtocol:n}=this.options,i=af(r).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!ar(o,t),protocols:t,defaultProtocol:n}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:r=>{var e;return{href:(e=r.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const r=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&r.push(Wv({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!ar(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&r.push(Kv({type:this.type})),this.options.linkOnPaste&&r.push(Jv({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),r}}),Zv=/^\s*>\s$/,Yv=bt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:r}){return["blockquote",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setBlockquote:()=>({commands:r})=>r.wrapIn(this.name),toggleBlockquote:()=>({commands:r})=>r.toggleWrap(this.name),unsetBlockquote:()=>({commands:r})=>r.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[wn({find:Zv,type:this.type})]}}),Qv=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Xv=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ex=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,tx=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,rx=qt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:r=>r.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:r=>r.type.name===this.name},{style:"font-weight",getAttrs:r=>/^(bold(er)?|[5-9]\d{2,})$/.test(r)&&null}]},renderHTML({HTMLAttributes:r}){return["strong",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setBold:()=>({commands:r})=>r.setMark(this.name),toggleBold:()=>({commands:r})=>r.toggleMark(this.name),unsetBold:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Hr({find:Qv,type:this.type}),Hr({find:ex,type:this.type})]},addPasteRules(){return[Dr({find:Xv,type:this.type}),Dr({find:tx,type:this.type})]}}),nx="listItem",wu="textStyle",Eu=/^\s*([-+*])\s$/,ix=bt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:r}){return["ul",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleBulletList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(nx,this.editor.getAttributes(wu)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let r=wn({find:Eu,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(r=wn({find:Eu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(wu),editor:this.editor})),[r]}}),sx=/(^|[^`])`([^`]+)`(?!`)/,ox=/(^|[^`])`([^`]+)`(?!`)/g,lx=qt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:r}){return["code",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setCode:()=>({commands:r})=>r.setMark(this.name),toggleCode:()=>({commands:r})=>r.toggleMark(this.name),unsetCode:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Hr({find:sx,type:this.type})]},addPasteRules(){return[Dr({find:ox,type:this.type})]}}),ax=/^```([a-z]+)?[\s\n]$/,ux=/^~~~([a-z]+)?[\s\n]$/,cx=bt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:r=>{var e;const{languageClassPrefix:t}=this.options,s=[...((e=r.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:r,HTMLAttributes:e}){return["pre",$e(this.options.HTMLAttributes,e),["code",{class:r.attrs.language?this.options.languageClassPrefix+r.attrs.language:null},0]]},addCommands(){return{setCodeBlock:r=>({commands:e})=>e.setNode(this.name,r),toggleCodeBlock:r=>({commands:e})=>e.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:r,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!r||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:r})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=r,{selection:t}=e,{$from:n,empty:i}=t;if(!i||n.parent.type!==this.type)return!1;const s=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith(`
141
141
 
142
- `);return!s||!o?!1:r.chain().command(({tr:l})=>(l.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:r})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=r,{selection:t,doc:n}=e,{$from:i,empty:s}=t;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:n.nodeAt(l)?r.commands.command(({tr:u})=>(u.setSelection(te.near(n.resolve(l))),!0)):r.commands.exitCode()}}},addInputRules(){return[ho({find:Jv,type:this.type,getAttributes:r=>({language:r[1]})}),ho({find:Gv,type:this.type,getAttributes:r=>({language:r[1]})})]},addProseMirrorPlugins(){return[new Le({key:new nt("codeBlockVSCodeHandler"),props:{handlePaste:(r,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,s=i==null?void 0:i.mode;if(!t||!s)return!1;const{tr:o,schema:l}=r.state,a=l.text(t.replace(/\r\n?/g,`
143
- `));return o.replaceSelectionWith(this.type.create({language:s},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(Q.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),r.dispatch(o),!0}}})]}}),Yv=bt.create({name:"doc",topNode:!0,content:"block+"});function Qv(r={}){return new Le({view(e){return new Xv(e,r)}})}class Xv{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let n=this.computeTarget(this.lastDragEvent);n==this.cursorPos?this.updateOverlay():this.setCursor(n)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(t){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let m=h.getBoundingClientRect(),p=d?m.bottom:m.top;d&&f&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;n={left:m.left,right:m.right,top:p-g,bottom:p+g}}}}if(!n){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;n={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let u,c;if(!a||a==document.body&&getComputedStyle(a).position=="static")u=-pageXOffset,c=-pageYOffset;else{let d=a.getBoundingClientRect(),f=d.width/a.offsetWidth,h=d.height/a.offsetHeight;u=d.left-a.scrollLeft*f,c=d.top-a.scrollTop*h}this.element.style.left=(n.left-u)/o+"px",this.element.style.top=(n.top-c)/l+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(!t||s)return null;let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=ac(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const ex=We.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Qv(this.options)]}});class ve extends te{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return ve.valid(n)?new ve(n):te.near(n)}content(){return H.empty}eq(e){return e instanceof ve&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ve(e.resolve(t.pos))}getBookmark(){return new vl(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!tx(e)||!rx(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&ve.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)<l.childCount:e.index(o)>0){s=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let a=e.doc.resolve(i);if(ve.valid(a))return a}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!G.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let l=e.doc.resolve(i);if(ve.valid(l))return l}return null}}}ve.prototype.visible=!1;ve.findFrom=ve.findGapCursorFrom;te.jsonID("gapcursor",ve);class vl{constructor(e){this.pos=e}map(e){return new vl(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ve.valid(t)?new ve(t):te.near(t)}}function of(r){return r.isAtom||r.spec.isolating||r.spec.createGapCursor}function tx(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||of(i.type))return!0;if(i.inlineContent)return!1}}return!0}function rx(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||of(i.type))return!0;if(i.inlineContent)return!1}}return!0}function nx(){return new Le({props:{decorations:lx,createSelectionBetween(r,e,t){return e.pos==t.pos&&ve.valid(t)?new ve(t):null},handleClick:sx,handleKeyDown:ix,handleDOMEvents:{beforeinput:ox}}})}const ix=Xc({ArrowLeft:Yn("horiz",-1),ArrowRight:Yn("horiz",1),ArrowUp:Yn("vert",-1),ArrowDown:Yn("vert",1)});function Yn(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof Q){if(!s.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=n.doc.resolve(e>0?l.after():l.before())}let u=ve.findGapCursorFrom(l,e,a);return u?(i&&i(n.tr.setSelection(new ve(u))),!0):!1}}function sx(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!ve.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&G.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new ve(n))),!0)}function ox(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof ve))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=R.empty;for(let o=n.length-1;o>=0;o--)i=R.from(n[o].createAndFill(null,i));let s=r.state.tr.replace(t.pos,t.pos,new H(i,0,0));return s.setSelection(Q.near(s.doc.resolve(t.pos+1))),r.dispatch(s),!1}function lx(r){if(!(r.selection instanceof ve))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ee.create(r.doc,[at.widget(r.selection.head,e,{key:"gapcursor"})])}const ax=We.create({name:"gapCursor",addProseMirrorPlugins(){return[nx()]},extendNodeSchema(r){var e;const t={name:r.name,options:r.options,storage:r.storage};return{allowGapCursor:(e=ie(J(r,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),ux=bt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:r}){return["br",$e(this.options.HTMLAttributes,r)]},renderText(){return`
144
- `},addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=n.extensionManager,a=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&a&&o){const d=a.filter(f=>l.includes(f.type.name));u.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),cx=bt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:e}){return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,$e(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.setNode(this.name,r):!1,toggleHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.toggleNode(this.name,"paragraph",r):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((r,e)=>({...r,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(r=>ho({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}});var Zi=200,_e=function(){};_e.prototype.append=function(e){return e.length?(e=_e.from(e),!this.length&&e||e.length<Zi&&this.leafAppend(e)||this.length<Zi&&e.leafPrepend(this)||this.appendInner(e)):this};_e.prototype.prepend=function(e){return e.length?_e.from(e).append(this):this};_e.prototype.appendInner=function(e){return new dx(this,e)};_e.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?_e.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};_e.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};_e.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)};_e.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i};_e.from=function(e){return e instanceof _e?e:e&&e.length?new lf(e):_e.empty};var lf=(function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,l){for(var a=s;a<o;a++)if(i(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,l){for(var a=s-1;a>=o;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Zi)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Zi)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(_e);_e.empty=new lf([]);var dx=(function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,o){var l=this.left.length;if(i<l&&this.left.forEachInner(n,i,Math.min(s,l),o)===!1||s>l&&this.right.forEachInner(n,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(n,i-l,Math.max(s,l)-l,o+l)===!1||s<l&&this.left.forEachInvertedInner(n,Math.min(i,l),s,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(_e);const fx=500;class pt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,l,a,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(n,f+1),s=i.maps.length),s--,c.push(d);return}if(i){c.push(new At(d.map));let h=d.step.map(i.slice(s)),m;h&&o.maybeStep(h).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],u.push(new At(m,void 0,void 0,u.length+c.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(d.step);if(d.selection)return l=i?d.selection.map(i.slice(s)):d.selection,a=new pt(this.items.slice(0,n).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,n,i){let s=[],o=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),f=new At(e.mapping.maps[c],d,t),h;(h=a&&a.merge(f))&&(f=h,c?s.pop():l=l.slice(0,l.length-1)),s.push(f),t&&(o++,t=void 0),i||(a=f)}let u=o-n.depth;return u>px&&(l=hx(l,u),o-=u),new pt(l.append(s),o)}remapping(e,t){let n=new mn;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new pt(this.items.append(e.map(t=>new At(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=t;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;o=Math.min(o,h);let m=s.maps[h];if(f.step){let p=e.steps[h].invert(e.docs[h]),g=f.selection&&f.selection.map(s.slice(a+1,h));g&&l++,n.push(new At(m,p,g))}else n.push(new At(m))},i);let u=[];for(let f=t;f<o;f++)u.push(new At(s.maps[f]));let c=this.items.slice(0,i).append(u).append(n),d=new pt(c,l);return d.emptyItemCount()>fx&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,l)=>{if(l>=e)i.push(o),o.selection&&s++;else if(o.step){let a=o.step.map(t.slice(n)),u=a&&a.getMap();if(n--,u&&t.appendMap(u,n),a){let c=o.selection&&o.selection.map(t.slice(n));c&&s++;let d=new At(u.invert(),a,c),f,h=i.length-1;(f=i.length&&i[h].merge(d))?i[h]=f:i.push(d)}}else o.map&&n--},this.items.length,0),new pt(_e.from(i.reverse()),s)}}pt.empty=new pt(_e.empty,0);function hx(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class At{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new At(t.getMap().invert(),t,this.selection)}}}class Kt{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const px=20;function mx(r,e,t,n){let i=t.getMeta(Cr),s;if(i)return i.historyState;t.getMeta(bx)&&(r=new Kt(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(Cr))return o.getMeta(Cr).redo?new Kt(r.done.addTransform(t,void 0,n,ii(e)),r.undone,Su(t.mapping.maps),r.prevTime,r.prevComposition):new Kt(r.done,r.undone.addTransform(t,void 0,n,ii(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=r.prevTime==0||!o&&r.prevComposition!=l&&(r.prevTime<(t.time||0)-n.newGroupDelay||!gx(t,r.prevRanges)),u=o?Vs(r.prevRanges,t.mapping):Su(t.mapping.maps);return new Kt(r.done.addTransform(t,a?e.selection.getBookmark():void 0,n,ii(e)),pt.empty,u,t.time,l??r.prevComposition)}else return(s=t.getMeta("rebased"))?new Kt(r.done.rebased(t,s),r.undone.rebased(t,s),Vs(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new Kt(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),Vs(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function gx(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function Su(r){let e=[];for(let t=r.length-1;t>=0&&e.length==0;t--)r[t].forEach((n,i,s,o)=>e.push(s,o));return e}function Vs(r,e){if(!r)return null;let t=[];for(let n=0;n<r.length;n+=2){let i=e.map(r[n],1),s=e.map(r[n+1],-1);i<=s&&t.push(i,s)}return t}function yx(r,e,t){let n=ii(e),i=Cr.get(e).spec.config,s=(t?r.undone:r.done).popEvent(e,n);if(!s)return null;let o=s.selection.resolve(s.transform.doc),l=(t?r.done:r.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),a=new Kt(t?l:s.remaining,t?s.remaining:l,null,0,-1);return s.transform.setSelection(o).setMeta(Cr,{redo:t,historyState:a})}let js=!1,Du=null;function ii(r){let e=r.plugins;if(Du!=e){js=!1,Du=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){js=!0;break}}return js}const Cr=new nt("history"),bx=new nt("closeHistory");function kx(r={}){return r={depth:r.depth||100,newGroupDelay:r.newGroupDelay||500},new Le({key:Cr,state:{init(){return new Kt(pt.empty,pt.empty,null,0,-1)},apply(e,t,n){return mx(t,n,e,r)}},config:r,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?uf:n=="historyRedo"?cf:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function af(r,e){return(t,n)=>{let i=Cr.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let s=yx(i,t,r);s&&n(e?s.scrollIntoView():s)}return!0}}const uf=af(!1,!0),cf=af(!0,!0),vx=We.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>uf(r,e),redo:()=>({state:r,dispatch:e})=>cf(r,e)}},addProseMirrorPlugins(){return[kx(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),xx=bt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:r}){return["hr",$e(this.options.HTMLAttributes,r)]},addCommands(){return{setHorizontalRule:()=>({chain:r,state:e})=>{if(!my(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$from:n,$to:i}=t,s=r();return n.parentOffset===0?s.insertContentAt({from:Math.max(n.pos-1,0),to:i.pos},{type:this.name}):R1(t)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:o,dispatch:l})=>{var a;if(l){const{$to:u}=o.selection,c=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?o.setSelection(Q.create(o.doc,u.pos+1)):u.nodeAfter.isBlock?o.setSelection(G.create(o.doc,u.pos)):o.setSelection(Q.create(o.doc,u.pos));else{const d=(a=u.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(o.insert(c,d),o.setSelection(Q.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[py({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Cx=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Ax=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,wx=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Ex=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Sx=qt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:r=>r.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:r=>r.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:r}){return["em",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setItalic:()=>({commands:r})=>r.setMark(this.name),toggleItalic:()=>({commands:r})=>r.toggleMark(this.name),unsetItalic:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[jr({find:Cx,type:this.type}),jr({find:wx,type:this.type})]},addPasteRules(){return[Sr({find:Ax,type:this.type}),Sr({find:Ex,type:this.type})]}}),Dx=bt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",$e(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),_x="listItem",_u="textStyle",Tu=/^(\d+)\.\s$/,Tx=bt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:r=>r.hasAttribute("start")?parseInt(r.getAttribute("start")||"",10):1},type:{default:null,parseHTML:r=>r.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:r}){const{start:e,...t}=r;return e===1?["ol",$e(this.options.HTMLAttributes,t),0]:["ol",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleOrderedList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(_x,this.editor.getAttributes(_u)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let r=Cn({find:Tu,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(r=Cn({find:Tu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(_u)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[r]}}),Mx=bt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:r}){return["p",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setParagraph:()=>({commands:r})=>r.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Ox=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Nx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Ix=qt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:r=>r.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["s",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setStrike:()=>({commands:r})=>r.setMark(this.name),toggleStrike:()=>({commands:r})=>r.toggleMark(this.name),unsetStrike:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[jr({find:Ox,type:this.type})]},addPasteRules(){return[Sr({find:Nx,type:this.type})]}}),Bx=bt.create({name:"text",group:"inline"}),Fx=We.create({name:"starterKit",addExtensions(){const r=[];return this.options.bold!==!1&&r.push(Vv.configure(this.options.bold)),this.options.blockquote!==!1&&r.push($v.configure(this.options.blockquote)),this.options.bulletList!==!1&&r.push(Hv.configure(this.options.bulletList)),this.options.code!==!1&&r.push(Kv.configure(this.options.code)),this.options.codeBlock!==!1&&r.push(Zv.configure(this.options.codeBlock)),this.options.document!==!1&&r.push(Yv.configure(this.options.document)),this.options.dropcursor!==!1&&r.push(ex.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&r.push(ax.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&r.push(ux.configure(this.options.hardBreak)),this.options.heading!==!1&&r.push(cx.configure(this.options.heading)),this.options.history!==!1&&r.push(vx.configure(this.options.history)),this.options.horizontalRule!==!1&&r.push(xx.configure(this.options.horizontalRule)),this.options.italic!==!1&&r.push(Sx.configure(this.options.italic)),this.options.listItem!==!1&&r.push(Dx.configure(this.options.listItem)),this.options.orderedList!==!1&&r.push(Tx.configure(this.options.orderedList)),this.options.paragraph!==!1&&r.push(Mx.configure(this.options.paragraph)),this.options.strike!==!1&&r.push(Ix.configure(this.options.strike)),this.options.text!==!1&&r.push(Bx.configure(this.options.text)),r}});function Rx(r){const e=t=>r.includes(t);return[Fx.configure({heading:e("heading")?{levels:[2,3]}:!1,bulletList:e("bulletList")?{}:!1,orderedList:e("orderedList")?{}:!1,blockquote:e("blockquote")?{}:!1,horizontalRule:e("horizontalRule")?{}:!1,strike:e("strike")?{}:!1}),...e("link")?[Fv.configure({openOnClick:!1,autolink:!0,protocols:["http","https","mailto","tel"],HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}})]:[]]}const $x=["aria-label"],Px=["title","aria-label","aria-pressed","disabled","onClick"],Lx=Pe({__name:"RichTextField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=["bold","italic","heading","bulletList","orderedList","link"],f=ee(()=>i.value.toolbar??d),h=y=>f.value.includes(y),m=by({content:yu(typeof t.modelValue=="string"?t.modelValue:""),editable:!(t.disabled||i.value.readonly),injectCSS:!1,extensions:Rx(f.value),editorProps:{attributes:{id:s,role:"textbox","aria-multiline":"true","aria-label":o.value}},onUpdate({editor:y}){const x=y.isEmpty?null:mu(y.getJSON()),k=typeof t.modelValue=="string"?t.modelValue:null;gu(x,k)||n("update:modelValue",x)}});si(()=>t.modelValue,y=>{const x=m.value;if(!x||x.isFocused)return;const k=typeof y=="string"?y:"",A=x.isEmpty?"":mu(x.getJSON());gu(k,A)||x.commands.setContent(yu(k),!1)}),si(()=>t.disabled,y=>{var x;return(x=m.value)==null?void 0:x.setEditable(!(y||i.value.readonly))}),Yi(()=>{var y;return(y=m.value)==null?void 0:y.destroy()});function p(){const y=m.value;if(!y)return;const x=y.getAttributes("link").href,k=window.prompt("Link address",x??"https://");if(k!==null){if(k===""){y.chain().focus().extendMarkRange("link").unsetLink().run();return}if(!/^(https?:|mailto:|tel:|\/)/i.test(k)){window.alert("Links must start with http://, https://, mailto:, tel: or /");return}y.chain().focus().extendMarkRange("link").setLink({href:k}).run()}}const g=ee(()=>{const y=m.value;return y?[{feature:"bold",label:"Bold",glyph:"B",isActive:()=>y.isActive("bold"),run:()=>y.chain().focus().toggleBold().run()},{feature:"italic",label:"Italic",glyph:"I",isActive:()=>y.isActive("italic"),run:()=>y.chain().focus().toggleItalic().run()},{feature:"strike",label:"Strikethrough",glyph:"S",isActive:()=>y.isActive("strike"),run:()=>y.chain().focus().toggleStrike().run()},{feature:"heading",label:"Heading",glyph:"H2",isActive:()=>y.isActive("heading",{level:2}),run:()=>y.chain().focus().toggleHeading({level:2}).run()},{feature:"heading",label:"Subheading",glyph:"H3",isActive:()=>y.isActive("heading",{level:3}),run:()=>y.chain().focus().toggleHeading({level:3}).run()},{feature:"bulletList",label:"Bulleted list",glyph:"•",isActive:()=>y.isActive("bulletList"),run:()=>y.chain().focus().toggleBulletList().run()},{feature:"orderedList",label:"Numbered list",glyph:"1.",isActive:()=>y.isActive("orderedList"),run:()=>y.chain().focus().toggleOrderedList().run()},{feature:"blockquote",label:"Quote",glyph:"❝",isActive:()=>y.isActive("blockquote"),run:()=>y.chain().focus().toggleBlockquote().run()},{feature:"link",label:"Link",glyph:"🔗",isActive:()=>y.isActive("link"),run:p},{feature:"horizontalRule",label:"Divider",glyph:"—",isActive:()=>!1,run:()=>y.chain().focus().setHorizontalRule().run()}].filter(k=>h(k.feature)):[]});return(y,x)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[j("div",{class:Ae(["rich-text overflow-hidden rounded-sm border bg-surface focus-within:ring-2 focus-within:ring-ink/10",N(l)?"border-danger":"border-line focus-within:border-ink"])},[j("div",{class:"flex flex-wrap items-center gap-0.5 border-b border-line bg-canvas/60 px-1.5 py-1",role:"toolbar","aria-label":`${N(o)} formatting`},[(z(!0),W(Ye,null,ut(g.value,k=>(z(),W("button",{key:k.label,type:"button",title:k.label,"aria-label":k.label,"aria-pressed":k.isActive(),disabled:r.disabled||i.value.readonly,class:Ae(["h-7 min-w-7 rounded px-1.5 text-xs font-semibold transition",k.isActive()?"bg-ink text-surface":"text-muted hover:bg-raised hover:text-ink"]),onClick:A=>k.run()},Y(k.glyph),11,Px))),128))],8,$x),Rt(N(yy),{editor:N(m),"aria-describedby":N(a)},null,8,["editor","aria-describedby"])],2)]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),zx=["aria-describedby"],qx={class:"sr-only"},Vx=["checked","disabled","onChange"],jx=["id","value","required","disabled","aria-invalid","aria-describedby"],Hx={value:""},Ux=["value"],Wx=Pe({__name:"SelectField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=ee(()=>Array.isArray(t.modelValue)?t.modelValue:typeof t.modelValue=="string"?[t.modelValue]:[]);function f(h){const m=d.value.includes(h)?d.value.filter(p=>p!==h):[...d.value,h];n("update:modelValue",m)}return(h,m)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[i.value.multiple?(z(),W("fieldset",{key:0,class:"space-y-1.5","aria-describedby":N(a)},[j("legend",qx,Y(N(o)),1),(z(!0),W(Ye,null,ut(i.value.options,p=>(z(),W("label",{key:p.value,class:"flex cursor-pointer items-center gap-2.5 rounded-sm border border-line bg-raised px-3 py-2 text-sm hover:bg-canvas"},[j("input",{type:"checkbox",checked:d.value.includes(p.value),disabled:r.disabled||i.value.readonly,class:"h-4 w-4 rounded-sm border-line text-accent focus:ring-ink/20",onChange:g=>f(p.value)},null,40,Vx),_o(" "+Y(p.label),1)]))),128))],8,zx)):(z(),W("select",{key:1,id:N(s),value:d.value[0]??"",required:i.value.required,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:Ae(["input",N(l)&&"input-invalid"]),onChange:m[0]||(m[0]=p=>n("update:modelValue",p.target.value||null))},[j("option",Hx,Y(i.value.required?"Choose…":"Not set"),1),(z(!0),W(Ye,null,ut(i.value.options,p=>(z(),W("option",{key:p.value,value:p.value},Y(p.label),9,Ux))),128))],42,jx))]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),Kx={class:"flex items-stretch"},Jx=["id","value","maxlength","disabled","aria-invalid","aria-describedby"],Gx=["disabled"],Zx={key:0,class:"field-hint"},Yx=Pe({__name:"SlugField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{},source:{},collection:{},exceptSlug:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=ee(()=>typeof t.modelValue=="string"?t.modelValue:""),f=je(d.value!=="");let h;si(()=>t.source,g=>{if(!(f.value||!i.value.from||!t.collection)){if(!(g!=null&&g.trim())){n("update:modelValue",null);return}clearTimeout(h),h=setTimeout(async()=>{try{const{slug:y}=await gr.entries.suggestSlug(t.collection,g,t.exceptSlug);f.value||n("update:modelValue",y||null)}catch{}},300)}});function m(g){f.value=!0;const y=g.target.value;n("update:modelValue",y===""?null:y)}function p(){var g;f.value=!1,n("update:modelValue",null),(g=t.source)!=null&&g.trim()&&t.collection&&gr.entries.suggestSlug(t.collection,t.source,t.exceptSlug).then(({slug:y})=>n("update:modelValue",y||null))}return(g,y)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[j("div",Kx,[y[0]||(y[0]=j("span",{class:"inline-flex select-none items-center rounded-l-sm border border-r-0 border-line bg-canvas px-3 font-mono text-sm text-muted","aria-hidden":"true"}," / ",-1)),j("input",{id:N(s),type:"text",value:d.value,maxlength:i.value.maxLength??96,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:Ae(["input rounded-l-none font-mono text-[13px]",N(l)&&"input-invalid"]),spellcheck:"false",autocomplete:"off",onInput:m},null,42,Jx),f.value&&i.value.from?(z(),W("button",{key:0,type:"button",class:"btn-ghost ml-2 shrink-0 whitespace-nowrap",disabled:r.disabled,onClick:p}," Reset ",8,Gx)):ge("",!0)]),!f.value&&i.value.from?(z(),W("p",Zx," Generated from the "+Y(i.value.from)+". Edit it to set your own. ",1)):ge("",!0)]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),Qx=["id","type","value","placeholder","maxlength","required","disabled","aria-invalid","aria-describedby"],Xx={key:0,class:"mt-1 text-right text-xs text-muted"},Hs=Pe({__name:"TextField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=ee(()=>i.value.kind==="email"?"email":i.value.kind==="url"?"url":"text"),f=ee(()=>typeof t.modelValue=="string"?t.modelValue:""),h=ee(()=>"maxLength"in i.value?i.value.maxLength??null:null),m=ee(()=>h.value!==null&&f.value.length>h.value*.7);function p(g){const y=g.target.value;n("update:modelValue",y===""?null:y)}return(g,y)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[j("input",{id:N(s),type:d.value,value:f.value,placeholder:"placeholder"in i.value?i.value.placeholder:void 0,maxlength:h.value??void 0,required:i.value.required,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:Ae(["input",N(l)&&"input-invalid"]),autocomplete:"off",onInput:p},null,42,Qx),m.value?(z(),W("p",Xx,Y(f.value.length)+" / "+Y(h.value),1)):ge("",!0)]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),eC=["id","value","rows","placeholder","maxlength","required","disabled","aria-invalid","aria-describedby"],tC={key:0,class:"mt-1 text-right text-xs text-muted"},rC=Pe({__name:"TextareaField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=ee(()=>typeof t.modelValue=="string"?t.modelValue:""),f=ee(()=>i.value.maxLength!==void 0&&d.value.length>i.value.maxLength*.7);function h(m){const p=m.target.value;n("update:modelValue",p===""?null:p)}return(m,p)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[j("textarea",{id:N(s),value:d.value,rows:i.value.rows??4,placeholder:i.value.placeholder,maxlength:i.value.maxLength,required:i.value.required,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:Ae(["input resize-y",N(l)&&"input-invalid"]),onInput:h},null,42,eC),f.value?(z(),W("p",tC,Y(d.value.length)+" / "+Y(i.value.maxLength),1)):ge("",!0)]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),nC={text:Hs,textarea:rC,richText:Lx,number:im,boolean:Wh,date:yp,email:Hs,url:Hs,slug:Yx,select:Wx,object:Vl(()=>jl(()=>import("./ObjectField--_IMDLHp.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),repeater:Vl(()=>jl(()=>import("./RepeaterField-CRo8CLz6.js"),__vite__mapDeps([7,1,2,3,4,8,6,5]))),relation:pm,media:em,color:ip,coordinates:hp},iC={key:0,class:"rounded-md border border-line bg-subtle px-3 py-2 text-xs text-muted"},Mu=Pe({__name:"FieldRenderer",props:{field:{},path:{},modelValue:{},issues:{},disabled:{type:Boolean},collection:{},entrySlug:{},source:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>nC[t.field.kind]),s=ee(()=>t.field.kind==="slug"?{source:t.source,collection:t.collection,exceptSlug:t.entrySlug}:{});return(o,l)=>!i.value&&!r.field.hidden?(z(),W("p",iC,Y(r.field.label??r.path)+': the field type "'+Y(r.field.kind)+'" needs a newer version of Mica. ',1)):r.field.hidden?ge("",!0):(z(),rt(Oh(i.value),Mh({key:1,field:r.field,path:r.path,issues:r.issues,disabled:r.disabled,"model-value":r.modelValue},s.value,{"onUpdate:modelValue":l[0]||(l[0]=a=>n("update:modelValue",a))}),null,16,["field","path","issues","disabled","model-value"]))}}),sC={class:"space-y-6"},oC={key:0,class:"card p-4 sm:p-5"},lC={class:"px-1 font-mono text-[11px] font-medium uppercase tracking-[.08em] text-muted"},aC={class:"mt-3 grid grid-cols-12 gap-x-4 gap-y-5"},uC={key:1,class:"grid grid-cols-12 gap-x-4 gap-y-5"},gC=Pe({__name:"FieldList",props:{fields:{},modelValue:{},path:{},issues:{},disabled:{type:Boolean},collection:{},entrySlug:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=ee(()=>{const a=[];for(const[u,c]of Object.entries(t.fields)){if(c.hidden)continue;const d=c.group??null,f=a.at(-1);f&&f.name===d?f.entries.push({key:u,field:c}):a.push({name:d,entries:[{key:u,field:c}]})}return a}),s=a=>t.path?`${t.path}.${a}`:a;function o(a,u){n("update:modelValue",{...t.modelValue,[a]:u})}function l(a){if(a.kind!=="slug"||!a.from)return null;const u=t.modelValue[a.from];return typeof u=="string"?u:null}return(a,u)=>(z(),W("div",sC,[(z(!0),W(Ye,null,ut(i.value,(c,d)=>(z(),W(Ye,{key:`${c.name??"ungrouped"}-${d}`},[c.name?(z(),W("fieldset",oC,[j("legend",lC,Y(c.name),1),j("div",aC,[(z(!0),W(Ye,null,ut(c.entries,f=>(z(),W("div",{key:f.key,class:Ae(N(Hl)(f.field))},[Rt(Mu,{field:f.field,path:s(f.key),"model-value":r.modelValue[f.key],issues:r.issues,disabled:r.disabled,collection:r.collection,"entry-slug":r.entrySlug,source:l(f.field),"onUpdate:modelValue":h=>o(f.key,h)},null,8,["field","path","model-value","issues","disabled","collection","entry-slug","source","onUpdate:modelValue"])],2))),128))])])):(z(),W("div",uC,[(z(!0),W(Ye,null,ut(c.entries,f=>(z(),W("div",{key:f.key,class:Ae(N(Hl)(f.field))},[Rt(Mu,{field:f.field,path:s(f.key),"model-value":r.modelValue[f.key],issues:r.issues,disabled:r.disabled,collection:r.collection,"entry-slug":r.entrySlug,source:l(f.field),"onUpdate:modelValue":h=>o(f.key,h)},null,8,["field","path","model-value","issues","disabled","collection","entry-slug","source","onUpdate:modelValue"])],2))),128))]))],64))),128))]))}}),cC="You have unsaved changes. Leave without saving?";function yC(r){const e=je(Us(r.value)),t=je(!0),n=ee(()=>t.value&&Us(r.value)!==e.value);function i(){e.value=Us(r.value)}function s(){t.value=!1}function o(a){n.value&&a.preventDefault()}To(()=>window.addEventListener("beforeunload",o)),Nh(()=>window.removeEventListener("beforeunload",o));const l=()=>!n.value||window.confirm(cC);return Ih(l),Bh(l),{dirty:n,markClean:i,release:s}}function Us(r){return JSON.stringify(r,(e,t)=>{if(t===null||typeof t!="object"||Array.isArray(t))return t;const n=t,i={};for(const s of Object.keys(n).sort())i[s]=n[s];return i})}export{gC as _,Lh as d,yC as u,Ul as w};
145
- //# sourceMappingURL=useUnsavedChanges-FKPfUHdo.js.map
142
+ `);return!s||!o?!1:r.chain().command(({tr:l})=>(l.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:r})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=r,{selection:t,doc:n}=e,{$from:i,empty:s}=t;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:n.nodeAt(l)?r.commands.command(({tr:u})=>(u.setSelection(te.near(n.resolve(l))),!0)):r.commands.exitCode()}}},addInputRules(){return[mo({find:ax,type:this.type,getAttributes:r=>({language:r[1]})}),mo({find:ux,type:this.type,getAttributes:r=>({language:r[1]})})]},addProseMirrorPlugins(){return[new Le({key:new nt("codeBlockVSCodeHandler"),props:{handlePaste:(r,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,s=i==null?void 0:i.mode;if(!t||!s)return!1;const{tr:o,schema:l}=r.state,a=l.text(t.replace(/\r\n?/g,`
143
+ `));return o.replaceSelectionWith(this.type.create({language:s},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(Q.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),r.dispatch(o),!0}}})]}}),dx=bt.create({name:"doc",topNode:!0,content:"block+"});function fx(r={}){return new Le({view(e){return new hx(e,r)}})}class hx{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let n=this.computeTarget(this.lastDragEvent);n==this.cursorPos?this.updateOverlay():this.setCursor(n)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(t){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let m=h.getBoundingClientRect(),p=d?m.bottom:m.top;d&&f&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;n={left:m.left,right:m.right,top:p-g,bottom:p+g}}}}if(!n){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;n={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let u,c;if(!a||a==document.body&&getComputedStyle(a).position=="static")u=-pageXOffset,c=-pageYOffset;else{let d=a.getBoundingClientRect(),f=d.width/a.offsetWidth,h=d.height/a.offsetHeight;u=d.left-a.scrollLeft*f,c=d.top-a.scrollTop*h}this.element.style.left=(n.left-u)/o+"px",this.element.style.top=(n.top-c)/l+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(!t||s)return null;let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=uc(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const px=We.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[fx(this.options)]}});class ve extends te{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return ve.valid(n)?new ve(n):te.near(n)}content(){return U.empty}eq(e){return e instanceof ve&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ve(e.resolve(t.pos))}getBookmark(){return new xl(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!mx(e)||!gx(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&ve.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)<l.childCount:e.index(o)>0){s=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let a=e.doc.resolve(i);if(ve.valid(a))return a}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!G.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let l=e.doc.resolve(i);if(ve.valid(l))return l}return null}}}ve.prototype.visible=!1;ve.findFrom=ve.findGapCursorFrom;te.jsonID("gapcursor",ve);class xl{constructor(e){this.pos=e}map(e){return new xl(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ve.valid(t)?new ve(t):te.near(t)}}function uf(r){return r.isAtom||r.spec.isolating||r.spec.createGapCursor}function mx(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||uf(i.type))return!0;if(i.inlineContent)return!1}}return!0}function gx(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||uf(i.type))return!0;if(i.inlineContent)return!1}}return!0}function yx(){return new Le({props:{decorations:xx,createSelectionBetween(r,e,t){return e.pos==t.pos&&ve.valid(t)?new ve(t):null},handleClick:kx,handleKeyDown:bx,handleDOMEvents:{beforeinput:vx}}})}const bx=ed({ArrowLeft:Xn("horiz",-1),ArrowRight:Xn("horiz",1),ArrowUp:Xn("vert",-1),ArrowDown:Xn("vert",1)});function Xn(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof Q){if(!s.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=n.doc.resolve(e>0?l.after():l.before())}let u=ve.findGapCursorFrom(l,e,a);return u?(i&&i(n.tr.setSelection(new ve(u))),!0):!1}}function kx(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!ve.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&G.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new ve(n))),!0)}function vx(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof ve))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=$.empty;for(let o=n.length-1;o>=0;o--)i=$.from(n[o].createAndFill(null,i));let s=r.state.tr.replace(t.pos,t.pos,new U(i,0,0));return s.setSelection(Q.near(s.doc.resolve(t.pos+1))),r.dispatch(s),!1}function xx(r){if(!(r.selection instanceof ve))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ee.create(r.doc,[at.widget(r.selection.head,e,{key:"gapcursor"})])}const Cx=We.create({name:"gapCursor",addProseMirrorPlugins(){return[yx()]},extendNodeSchema(r){var e;const t={name:r.name,options:r.options,storage:r.storage};return{allowGapCursor:(e=ie(J(r,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),Ax=bt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:r}){return["br",$e(this.options.HTMLAttributes,r)]},renderText(){return`
144
+ `},addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=n.extensionManager,a=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&a&&o){const d=a.filter(f=>l.includes(f.type.name));u.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),wx=bt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:e}){return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,$e(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.setNode(this.name,r):!1,toggleHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.toggleNode(this.name,"paragraph",r):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((r,e)=>({...r,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(r=>mo({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}});var Yi=200,_e=function(){};_e.prototype.append=function(e){return e.length?(e=_e.from(e),!this.length&&e||e.length<Yi&&this.leafAppend(e)||this.length<Yi&&e.leafPrepend(this)||this.appendInner(e)):this};_e.prototype.prepend=function(e){return e.length?_e.from(e).append(this):this};_e.prototype.appendInner=function(e){return new Ex(this,e)};_e.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?_e.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};_e.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};_e.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)};_e.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i};_e.from=function(e){return e instanceof _e?e:e&&e.length?new cf(e):_e.empty};var cf=(function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,l){for(var a=s;a<o;a++)if(i(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,l){for(var a=s-1;a>=o;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Yi)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Yi)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(_e);_e.empty=new cf([]);var Ex=(function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,o){var l=this.left.length;if(i<l&&this.left.forEachInner(n,i,Math.min(s,l),o)===!1||s>l&&this.right.forEachInner(n,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(n,i-l,Math.max(s,l)-l,o+l)===!1||s<l&&this.left.forEachInvertedInner(n,Math.min(i,l),s,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(_e);const Sx=500;class pt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,l,a,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(n,f+1),s=i.maps.length),s--,c.push(d);return}if(i){c.push(new At(d.map));let h=d.step.map(i.slice(s)),m;h&&o.maybeStep(h).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],u.push(new At(m,void 0,void 0,u.length+c.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(d.step);if(d.selection)return l=i?d.selection.map(i.slice(s)):d.selection,a=new pt(this.items.slice(0,n).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,n,i){let s=[],o=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),f=new At(e.mapping.maps[c],d,t),h;(h=a&&a.merge(f))&&(f=h,c?s.pop():l=l.slice(0,l.length-1)),s.push(f),t&&(o++,t=void 0),i||(a=f)}let u=o-n.depth;return u>_x&&(l=Dx(l,u),o-=u),new pt(l.append(s),o)}remapping(e,t){let n=new yn;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new pt(this.items.append(e.map(t=>new At(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=t;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;o=Math.min(o,h);let m=s.maps[h];if(f.step){let p=e.steps[h].invert(e.docs[h]),g=f.selection&&f.selection.map(s.slice(a+1,h));g&&l++,n.push(new At(m,p,g))}else n.push(new At(m))},i);let u=[];for(let f=t;f<o;f++)u.push(new At(s.maps[f]));let c=this.items.slice(0,i).append(u).append(n),d=new pt(c,l);return d.emptyItemCount()>Sx&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,l)=>{if(l>=e)i.push(o),o.selection&&s++;else if(o.step){let a=o.step.map(t.slice(n)),u=a&&a.getMap();if(n--,u&&t.appendMap(u,n),a){let c=o.selection&&o.selection.map(t.slice(n));c&&s++;let d=new At(u.invert(),a,c),f,h=i.length-1;(f=i.length&&i[h].merge(d))?i[h]=f:i.push(d)}}else o.map&&n--},this.items.length,0),new pt(_e.from(i.reverse()),s)}}pt.empty=new pt(_e.empty,0);function Dx(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class At{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new At(t.getMap().invert(),t,this.selection)}}}class Kt{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const _x=20;function Tx(r,e,t,n){let i=t.getMeta(Ar),s;if(i)return i.historyState;t.getMeta(Nx)&&(r=new Kt(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(Ar))return o.getMeta(Ar).redo?new Kt(r.done.addTransform(t,void 0,n,oi(e)),r.undone,Su(t.mapping.maps),r.prevTime,r.prevComposition):new Kt(r.done,r.undone.addTransform(t,void 0,n,oi(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=r.prevTime==0||!o&&r.prevComposition!=l&&(r.prevTime<(t.time||0)-n.newGroupDelay||!Mx(t,r.prevRanges)),u=o?Hs(r.prevRanges,t.mapping):Su(t.mapping.maps);return new Kt(r.done.addTransform(t,a?e.selection.getBookmark():void 0,n,oi(e)),pt.empty,u,t.time,l??r.prevComposition)}else return(s=t.getMeta("rebased"))?new Kt(r.done.rebased(t,s),r.undone.rebased(t,s),Hs(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new Kt(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),Hs(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function Mx(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function Su(r){let e=[];for(let t=r.length-1;t>=0&&e.length==0;t--)r[t].forEach((n,i,s,o)=>e.push(s,o));return e}function Hs(r,e){if(!r)return null;let t=[];for(let n=0;n<r.length;n+=2){let i=e.map(r[n],1),s=e.map(r[n+1],-1);i<=s&&t.push(i,s)}return t}function Ox(r,e,t){let n=oi(e),i=Ar.get(e).spec.config,s=(t?r.undone:r.done).popEvent(e,n);if(!s)return null;let o=s.selection.resolve(s.transform.doc),l=(t?r.done:r.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),a=new Kt(t?l:s.remaining,t?s.remaining:l,null,0,-1);return s.transform.setSelection(o).setMeta(Ar,{redo:t,historyState:a})}let Us=!1,Du=null;function oi(r){let e=r.plugins;if(Du!=e){Us=!1,Du=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Us=!0;break}}return Us}const Ar=new nt("history"),Nx=new nt("closeHistory");function Ix(r={}){return r={depth:r.depth||100,newGroupDelay:r.newGroupDelay||500},new Le({key:Ar,state:{init(){return new Kt(pt.empty,pt.empty,null,0,-1)},apply(e,t,n){return Tx(t,n,e,r)}},config:r,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?ff:n=="historyRedo"?hf:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function df(r,e){return(t,n)=>{let i=Ar.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let s=Ox(i,t,r);s&&n(e?s.scrollIntoView():s)}return!0}}const ff=df(!1,!0),hf=df(!0,!0),Bx=We.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>ff(r,e),redo:()=>({state:r,dispatch:e})=>hf(r,e)}},addProseMirrorPlugins(){return[Ix(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Fx=bt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:r}){return["hr",$e(this.options.HTMLAttributes,r)]},addCommands(){return{setHorizontalRule:()=>({chain:r,state:e})=>{if(!Ey(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$from:n,$to:i}=t,s=r();return n.parentOffset===0?s.insertContentAt({from:Math.max(n.pos-1,0),to:i.pos},{type:this.name}):W1(t)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:o,dispatch:l})=>{var a;if(l){const{$to:u}=o.selection,c=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?o.setSelection(Q.create(o.doc,u.pos+1)):u.nodeAfter.isBlock?o.setSelection(G.create(o.doc,u.pos)):o.setSelection(Q.create(o.doc,u.pos));else{const d=(a=u.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(o.insert(c,d),o.setSelection(Q.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[wy({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Rx=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,$x=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Px=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Lx=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,zx=qt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:r=>r.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:r=>r.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:r}){return["em",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setItalic:()=>({commands:r})=>r.setMark(this.name),toggleItalic:()=>({commands:r})=>r.toggleMark(this.name),unsetItalic:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Hr({find:Rx,type:this.type}),Hr({find:Px,type:this.type})]},addPasteRules(){return[Dr({find:$x,type:this.type}),Dr({find:Lx,type:this.type})]}}),qx=bt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",$e(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Vx="listItem",_u="textStyle",Tu=/^(\d+)\.\s$/,jx=bt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:r=>r.hasAttribute("start")?parseInt(r.getAttribute("start")||"",10):1},type:{default:null,parseHTML:r=>r.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:r}){const{start:e,...t}=r;return e===1?["ol",$e(this.options.HTMLAttributes,t),0]:["ol",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleOrderedList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Vx,this.editor.getAttributes(_u)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let r=wn({find:Tu,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(r=wn({find:Tu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(_u)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[r]}}),Hx=bt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:r}){return["p",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setParagraph:()=>({commands:r})=>r.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Ux=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Wx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Kx=qt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:r=>r.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["s",$e(this.options.HTMLAttributes,r),0]},addCommands(){return{setStrike:()=>({commands:r})=>r.setMark(this.name),toggleStrike:()=>({commands:r})=>r.toggleMark(this.name),unsetStrike:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Hr({find:Ux,type:this.type})]},addPasteRules(){return[Dr({find:Wx,type:this.type})]}}),Jx=bt.create({name:"text",group:"inline"}),Gx=We.create({name:"starterKit",addExtensions(){const r=[];return this.options.bold!==!1&&r.push(rx.configure(this.options.bold)),this.options.blockquote!==!1&&r.push(Yv.configure(this.options.blockquote)),this.options.bulletList!==!1&&r.push(ix.configure(this.options.bulletList)),this.options.code!==!1&&r.push(lx.configure(this.options.code)),this.options.codeBlock!==!1&&r.push(cx.configure(this.options.codeBlock)),this.options.document!==!1&&r.push(dx.configure(this.options.document)),this.options.dropcursor!==!1&&r.push(px.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&r.push(Cx.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&r.push(Ax.configure(this.options.hardBreak)),this.options.heading!==!1&&r.push(wx.configure(this.options.heading)),this.options.history!==!1&&r.push(Bx.configure(this.options.history)),this.options.horizontalRule!==!1&&r.push(Fx.configure(this.options.horizontalRule)),this.options.italic!==!1&&r.push(zx.configure(this.options.italic)),this.options.listItem!==!1&&r.push(qx.configure(this.options.listItem)),this.options.orderedList!==!1&&r.push(jx.configure(this.options.orderedList)),this.options.paragraph!==!1&&r.push(Hx.configure(this.options.paragraph)),this.options.strike!==!1&&r.push(Kx.configure(this.options.strike)),this.options.text!==!1&&r.push(Jx.configure(this.options.text)),r}});function pf(r=[]){return[Gx.configure({heading:{levels:[1,2,3,4,5,6]}}),Gv.configure({openOnClick:!1,autolink:r.includes("link"),protocols:["http","https","mailto","tel"],HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}})]}function Mu(r){return["code","codeBlock",...r]}const Zx=L1(pf()),Yx={key:0,class:"rounded-sm border border-line bg-canvas/60"},Qx={class:"border-b border-line px-3 py-2 text-sm",role:"status"},Xx=["id","aria-label","aria-describedby"],eC=["aria-label"],tC=["title","aria-label","aria-pressed","disabled","onClick"],rC=Pe({__name:"RichTextField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=["bold","italic","heading","bulletList","orderedList","link"],f=X(()=>i.value.toolbar??d),h=k=>f.value.includes(k),m=X(()=>typeof t.modelValue=="string"?t.modelValue:""),p=X(()=>Av(m.value)),g=X(()=>{if(p.value.length>0)return null;try{return Zx.nodeFromJSON($s(m.value)),null}catch(k){return`The editor could not load this text (${k.message}).`}}),b=X(()=>p.value.length>0?`This text contains ${E(p.value)}, which the editor cannot show.`:g.value);function E(k){return k.length<2?k[0]??"":`${k.slice(0,-1).join(", ")} and ${k.at(-1)}`}const v=_y({content:b.value?"":$s(m.value),editable:!(t.disabled||i.value.readonly||b.value),injectCSS:!1,extensions:pf(f.value),enableInputRules:Mu(f.value),enablePasteRules:Mu(f.value),editorProps:{attributes:{id:s,role:"textbox","aria-multiline":"true","aria-label":o.value}},onUpdate({editor:k}){if(b.value)return;const C=k.isEmpty?null:gu(k.getJSON()),w=typeof t.modelValue=="string"?t.modelValue:null;yu(C,w)||n("update:modelValue",C)}});rn(()=>t.modelValue,k=>{const C=v.value;if(!C||C.isFocused||b.value)return;const w=typeof k=="string"?k:"",I=C.isEmpty?"":gu(C.getJSON());yu(w,I)||C.commands.setContent($s(w),!1)}),rn(()=>t.disabled,k=>{var C;return(C=v.value)==null?void 0:C.setEditable(!(k||i.value.readonly||b.value))}),rn(b,k=>{var C;return(C=v.value)==null?void 0:C.setEditable(!(t.disabled||i.value.readonly||k))}),Qi(()=>{var k;return(k=v.value)==null?void 0:k.destroy()});function D(){const k=v.value;if(!k)return;const C=k.getAttributes("link").href,w=window.prompt("Link address",C??"https://");if(w!==null){if(w===""){k.chain().focus().extendMarkRange("link").unsetLink().run();return}if(!/^(https?:|mailto:|tel:|\/)/i.test(w)){window.alert("Links must start with http://, https://, mailto:, tel: or /");return}k.chain().focus().extendMarkRange("link").setLink({href:w}).run()}}const x=X(()=>{const k=v.value;return k?[{feature:"bold",label:"Bold",glyph:"B",isActive:()=>k.isActive("bold"),run:()=>k.chain().focus().toggleBold().run()},{feature:"italic",label:"Italic",glyph:"I",isActive:()=>k.isActive("italic"),run:()=>k.chain().focus().toggleItalic().run()},{feature:"strike",label:"Strikethrough",glyph:"S",isActive:()=>k.isActive("strike"),run:()=>k.chain().focus().toggleStrike().run()},{feature:"heading",label:"Heading",glyph:"H2",isActive:()=>k.isActive("heading",{level:2}),run:()=>k.chain().focus().toggleHeading({level:2}).run()},{feature:"heading",label:"Subheading",glyph:"H3",isActive:()=>k.isActive("heading",{level:3}),run:()=>k.chain().focus().toggleHeading({level:3}).run()},{feature:"bulletList",label:"Bulleted list",glyph:"•",isActive:()=>k.isActive("bulletList"),run:()=>k.chain().focus().toggleBulletList().run()},{feature:"orderedList",label:"Numbered list",glyph:"1.",isActive:()=>k.isActive("orderedList"),run:()=>k.chain().focus().toggleOrderedList().run()},{feature:"blockquote",label:"Quote",glyph:"❝",isActive:()=>k.isActive("blockquote"),run:()=>k.chain().focus().toggleBlockquote().run()},{feature:"link",label:"Link",glyph:"🔗",isActive:()=>k.isActive("link"),run:D},{feature:"horizontalRule",label:"Divider",glyph:"—",isActive:()=>!1,run:()=>k.chain().focus().setHorizontalRule().run()}].filter(w=>h(w.feature)):[]});return(k,C)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[b.value?(z(),H("div",Yx,[V("p",Qx,[Lr(Z(b.value)+" To keep it, it is read-only here. Change it in the ",1),C[0]||(C[0]=V("code",null,".mdoc",-1)),C[1]||(C[1]=Lr(" file in the repository. ",-1))]),V("pre",{id:N(s),class:"max-h-96 overflow-auto px-3 py-2 text-xs whitespace-pre-wrap","aria-label":N(o),"aria-describedby":N(a)},Z(m.value),9,Xx)])):(z(),H("div",{key:1,class:xe(["rich-text overflow-hidden rounded-sm border bg-surface focus-within:ring-2 focus-within:ring-ink/10",N(l)?"border-danger":"border-line focus-within:border-ink"])},[V("div",{class:"flex flex-wrap items-center gap-0.5 border-b border-line bg-canvas/60 px-1.5 py-1",role:"toolbar","aria-label":`${N(o)} formatting`},[(z(!0),H(Ye,null,ut(x.value,w=>(z(),H("button",{key:w.label,type:"button",title:w.label,"aria-label":w.label,"aria-pressed":w.isActive(),disabled:r.disabled||i.value.readonly,class:xe(["h-7 min-w-7 rounded px-1.5 text-xs font-semibold transition",w.isActive()?"bg-ink text-surface":"text-muted hover:bg-raised hover:text-ink"]),onClick:I=>w.run()},Z(w.glyph),11,tC))),128))],8,eC),Rt(N(Dy),{editor:N(v),"aria-describedby":N(a)},null,8,["editor","aria-describedby"])],2))]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),nC=["aria-describedby"],iC={class:"sr-only"},sC=["checked","disabled","onChange"],oC=["id","value","required","disabled","aria-invalid","aria-describedby"],lC={value:""},aC=["value"],uC=Pe({__name:"SelectField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=X(()=>Array.isArray(t.modelValue)?t.modelValue:typeof t.modelValue=="string"?[t.modelValue]:[]);function f(h){const m=d.value.includes(h)?d.value.filter(p=>p!==h):[...d.value,h];n("update:modelValue",m)}return(h,m)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[i.value.multiple?(z(),H("fieldset",{key:0,class:"space-y-1.5","aria-describedby":N(a)},[V("legend",iC,Z(N(o)),1),(z(!0),H(Ye,null,ut(i.value.options,p=>(z(),H("label",{key:p.value,class:"flex cursor-pointer items-center gap-2.5 rounded-sm border border-line bg-raised px-3 py-2 text-sm hover:bg-canvas"},[V("input",{type:"checkbox",checked:d.value.includes(p.value),disabled:r.disabled||i.value.readonly,class:"h-4 w-4 rounded-sm border-line text-accent focus:ring-ink/20",onChange:g=>f(p.value)},null,40,sC),Lr(" "+Z(p.label),1)]))),128))],8,nC)):(z(),H("select",{key:1,id:N(s),value:d.value[0]??"",required:i.value.required,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:xe(["input",N(l)&&"input-invalid"]),onChange:m[0]||(m[0]=p=>n("update:modelValue",p.target.value||null))},[V("option",lC,Z(i.value.required?"Choose…":"Not set"),1),(z(!0),H(Ye,null,ut(i.value.options,p=>(z(),H("option",{key:p.value,value:p.value},Z(p.label),9,aC))),128))],42,oC))]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),cC={class:"flex items-stretch"},dC=["id","value","maxlength","disabled","aria-invalid","aria-describedby"],fC=["disabled"],hC={key:0,class:"field-hint"},pC=Pe({__name:"SlugField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{},source:{},collection:{},exceptSlug:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=X(()=>typeof t.modelValue=="string"?t.modelValue:""),f=je(d.value!=="");let h;rn(()=>t.source,g=>{if(!(f.value||!i.value.from||!t.collection)){if(!(g!=null&&g.trim())){n("update:modelValue",null);return}clearTimeout(h),h=setTimeout(async()=>{try{const{slug:b}=await yr.entries.suggestSlug(t.collection,g,t.exceptSlug);f.value||n("update:modelValue",b||null)}catch{}},300)}});function m(g){f.value=!0;const b=g.target.value;n("update:modelValue",b===""?null:b)}function p(){var g;f.value=!1,n("update:modelValue",null),(g=t.source)!=null&&g.trim()&&t.collection&&yr.entries.suggestSlug(t.collection,t.source,t.exceptSlug).then(({slug:b})=>n("update:modelValue",b||null))}return(g,b)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[V("div",cC,[b[0]||(b[0]=V("span",{class:"inline-flex select-none items-center rounded-l-sm border border-r-0 border-line bg-canvas px-3 font-mono text-sm text-muted","aria-hidden":"true"}," / ",-1)),V("input",{id:N(s),type:"text",value:d.value,maxlength:i.value.maxLength??96,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:xe(["input rounded-l-none font-mono text-[13px]",N(l)&&"input-invalid"]),spellcheck:"false",autocomplete:"off",onInput:m},null,42,dC),f.value&&i.value.from?(z(),H("button",{key:0,type:"button",class:"btn-ghost ml-2 shrink-0 whitespace-nowrap",disabled:r.disabled,onClick:p}," Reset ",8,fC)):fe("",!0)]),!f.value&&i.value.from?(z(),H("p",hC," Generated from the "+Z(i.value.from)+". Edit it to set your own. ",1)):fe("",!0)]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),mC=["id","type","value","placeholder","maxlength","required","disabled","aria-invalid","aria-describedby"],gC={key:0,class:"mt-1 text-right text-xs text-muted"},Ws=Pe({__name:"TextField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=X(()=>i.value.kind==="email"?"email":i.value.kind==="url"?"url":"text"),f=X(()=>typeof t.modelValue=="string"?t.modelValue:""),h=X(()=>"maxLength"in i.value?i.value.maxLength??null:null),m=X(()=>h.value!==null&&f.value.length>h.value*.7);function p(g){const b=g.target.value;n("update:modelValue",b===""?null:b)}return(g,b)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[V("input",{id:N(s),type:d.value,value:f.value,placeholder:"placeholder"in i.value?i.value.placeholder:void 0,maxlength:h.value??void 0,required:i.value.required,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:xe(["input",N(l)&&"input-invalid"]),autocomplete:"off",onInput:p},null,42,mC),m.value?(z(),H("p",gC,Z(f.value.length)+" / "+Z(h.value),1)):fe("",!0)]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),yC=["id","value","rows","placeholder","maxlength","required","disabled","aria-invalid","aria-describedby"],bC={key:0,class:"mt-1 text-right text-xs text-muted"},kC=Pe({__name:"TextareaField",props:{field:{},path:{},issues:{},disabled:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>t.field),{inputId:s,label:o,error:l,describedBy:a,hintId:u,errorId:c}=ft(t),d=X(()=>typeof t.modelValue=="string"?t.modelValue:""),f=X(()=>i.value.maxLength!==void 0&&d.value.length>i.value.maxLength*.7);function h(m){const p=m.target.value;n("update:modelValue",p===""?null:p)}return(m,p)=>(z(),rt(yt,{"input-id":N(s),label:N(o),description:i.value.description,required:i.value.required,error:N(l),"hint-id":N(u),"error-id":N(c)},{default:gt(()=>[V("textarea",{id:N(s),value:d.value,rows:i.value.rows??4,placeholder:i.value.placeholder,maxlength:i.value.maxLength,required:i.value.required,disabled:r.disabled||i.value.readonly,"aria-invalid":N(l)?"true":void 0,"aria-describedby":N(a),class:xe(["input resize-y",N(l)&&"input-invalid"]),onInput:h},null,42,yC),f.value?(z(),H("p",bC,Z(d.value.length)+" / "+Z(i.value.maxLength),1)):fe("",!0)]),_:1},8,["input-id","label","description","required","error","hint-id","error-id"]))}}),vC={text:Ws,textarea:kC,richText:rC,number:pm,boolean:Zh,date:xp,email:Ws,url:Ws,slug:pC,select:uC,object:jl(()=>Hl(()=>import("./ObjectField-BHoHeIbi.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),repeater:jl(()=>Hl(()=>import("./RepeaterField-CgFHog9l.js"),__vite__mapDeps([7,1,2,3,4,8,6,5]))),relation:wm,media:cm,color:ap,coordinates:yp},xC={key:0,class:"rounded-md border border-line bg-subtle px-3 py-2 text-xs text-muted"},Ou=Pe({__name:"FieldRenderer",props:{field:{},path:{},modelValue:{},issues:{},disabled:{type:Boolean},collection:{},entrySlug:{},source:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>vC[t.field.kind]),s=X(()=>t.field.kind==="slug"?{source:t.source,collection:t.collection,exceptSlug:t.entrySlug}:{});return(o,l)=>!i.value&&!r.field.hidden?(z(),H("p",xC,Z(r.field.label??r.path)+': the field type "'+Z(r.field.kind)+'" needs a newer version of Mica. ',1)):r.field.hidden?fe("",!0):(z(),rt(Fh(i.value),Bh({key:1,field:r.field,path:r.path,issues:r.issues,disabled:r.disabled,"model-value":r.modelValue},s.value,{"onUpdate:modelValue":l[0]||(l[0]=a=>n("update:modelValue",a))}),null,16,["field","path","issues","disabled","model-value"]))}}),CC={class:"space-y-6"},AC={key:0,class:"card p-4 sm:p-5"},wC={class:"px-1 font-mono text-[11px] font-medium uppercase tracking-[.08em] text-muted"},EC={class:"mt-3 grid grid-cols-12 gap-x-4 gap-y-5"},SC={key:1,class:"grid grid-cols-12 gap-x-4 gap-y-5"},IC=Pe({__name:"FieldList",props:{fields:{},modelValue:{},path:{},issues:{},disabled:{type:Boolean},collection:{},entrySlug:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=X(()=>{const a=[];for(const[u,c]of Object.entries(t.fields)){if(c.hidden)continue;const d=c.group??null,f=a.at(-1);f&&f.name===d?f.entries.push({key:u,field:c}):a.push({name:d,entries:[{key:u,field:c}]})}return a}),s=a=>t.path?`${t.path}.${a}`:a;function o(a,u){n("update:modelValue",{...t.modelValue,[a]:u})}function l(a){if(a.kind!=="slug"||!a.from)return null;const u=t.modelValue[a.from];return typeof u=="string"?u:null}return(a,u)=>(z(),H("div",CC,[(z(!0),H(Ye,null,ut(i.value,(c,d)=>(z(),H(Ye,{key:`${c.name??"ungrouped"}-${d}`},[c.name?(z(),H("fieldset",AC,[V("legend",wC,Z(c.name),1),V("div",EC,[(z(!0),H(Ye,null,ut(c.entries,f=>(z(),H("div",{key:f.key,class:xe(N(Ul)(f.field))},[Rt(Ou,{field:f.field,path:s(f.key),"model-value":r.modelValue[f.key],issues:r.issues,disabled:r.disabled,collection:r.collection,"entry-slug":r.entrySlug,source:l(f.field),"onUpdate:modelValue":h=>o(f.key,h)},null,8,["field","path","model-value","issues","disabled","collection","entry-slug","source","onUpdate:modelValue"])],2))),128))])])):(z(),H("div",SC,[(z(!0),H(Ye,null,ut(c.entries,f=>(z(),H("div",{key:f.key,class:xe(N(Ul)(f.field))},[Rt(Ou,{field:f.field,path:s(f.key),"model-value":r.modelValue[f.key],issues:r.issues,disabled:r.disabled,collection:r.collection,"entry-slug":r.entrySlug,source:l(f.field),"onUpdate:modelValue":h=>o(f.key,h)},null,8,["field","path","model-value","issues","disabled","collection","entry-slug","source","onUpdate:modelValue"])],2))),128))]))],64))),128))]))}}),DC="You have unsaved changes. Leave without saving?";function BC(r){const e=je(Ks(r.value)),t=je(!0),n=X(()=>t.value&&Ks(r.value)!==e.value);function i(){e.value=Ks(r.value)}function s(){t.value=!1}function o(a){n.value&&a.preventDefault()}Mo(()=>window.addEventListener("beforeunload",o)),Rh(()=>window.removeEventListener("beforeunload",o));const l=()=>!n.value||window.confirm(DC);return $h(l),Ph(l),{dirty:n,markClean:i,release:s}}function Ks(r){return JSON.stringify(r,(e,t)=>{if(t===null||typeof t!="object"||Array.isArray(t))return t;const n=t,i={};for(const s of Object.keys(n).sort())i[s]=n[s];return i})}export{IC as _,jh as d,BC as u,Wl as w};
145
+ //# sourceMappingURL=useUnsavedChanges-C4vyxObi.js.map