@cmgfi/clear-ds 1.2.7 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),x=require("react"),qt=require("react-dom"),ip="_wrapper_soper_7",op="_disabled_soper_15",lp="_input_soper_21",ap="_box_soper_35",cp="_sm_soper_50",dp="_checkmark_soper_54",up="_dash_soper_58",hp="_label_soper_61",fp="_md_soper_66",pp="_lg_soper_82",mp="_indeterminate_soper_118",gp="_invalid_soper_154",bp="_helperText_soper_217",yp="_errorText_soper_225 _helperText_soper_217",wt={wrapper:ip,disabled:op,input:lp,box:ap,sm:cp,checkmark:dp,dash:up,label:hp,md:fp,lg:pp,indeterminate:mp,invalid:gp,helperText:bp,errorText:yp},Gn=x.forwardRef(({label:t,indeterminate:e=!1,invalid:n=!1,helperText:r,size:s="md",disabled:i=!1,id:o,className:l,...a},c)=>{const u=x.useRef(null),h=c??u;x.useEffect(()=>{h.current&&(h.current.indeterminate=e)},[e,h]);const f=[wt.wrapper,wt[s],i?wt.disabled:"",n?wt.invalid:"",e?wt.indeterminate:"",l??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:f,htmlFor:o,children:[d.jsx("input",{ref:h,type:"checkbox",id:o,disabled:i,className:wt.input,"aria-invalid":n||void 0,...a}),d.jsxs("span",{className:wt.box,"aria-hidden":"true",children:[d.jsx("svg",{className:wt.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})}),d.jsx("span",{className:wt.dash})]}),t&&d.jsx("span",{className:wt.label,children:t})]}),r&&d.jsx("span",{className:n?wt.errorText:wt.helperText,children:r})]})});Gn.displayName="Checkbox";const xp="_root_k9kb0_9",vp="_labelRow_k9kb0_19",_p="_labelText_k9kb0_25",kp="_requiredMark_k9kb0_31",wp="_inputWrap_k9kb0_39",Cp="_sm_k9kb0_53",Sp="_nativeInput_k9kb0_60",Np="_md_k9kb0_65",Ap="_lg_k9kb0_77",Tp="_iconSlot_k9kb0_113",Ep="_iconSlotSuffix_k9kb0_125",Mp="_disabled_k9kb0_131",jp="_invalid_k9kb0_146",Ip="_helperText_k9kb0_195",pt={root:xp,labelRow:vp,labelText:_p,requiredMark:kp,inputWrap:wp,sm:Cp,nativeInput:Sp,md:Np,lg:Ap,iconSlot:Tp,iconSlotSuffix:Ep,disabled:Mp,invalid:jp,helperText:Ip};let Dp=0;const gs=x.forwardRef(({label:t,required:e=!1,helperText:n,invalid:r=!1,size:s="md",prefixIcon:i,suffixIcon:o,disabled:l=!1,id:a,className:c,...u},h)=>{const f=a??`inputtext-${++Dp}`,p=[pt.root,pt[s],r?pt.invalid:"",l?pt.disabled:"",c??""].filter(Boolean).join(" ");return d.jsxs("div",{className:p,children:[t&&d.jsxs("label",{className:pt.labelRow,htmlFor:f,children:[d.jsx("span",{className:pt.labelText,children:t}),e&&d.jsx("span",{className:pt.requiredMark,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:pt.inputWrap,children:[i&&d.jsx("span",{className:pt.iconSlot,"aria-hidden":"true",children:i}),d.jsx("input",{ref:h,id:f,disabled:l,required:e,"aria-invalid":r||void 0,"aria-describedby":n?`${f}-helper`:void 0,className:pt.nativeInput,...u}),o&&d.jsx("span",{className:`${pt.iconSlot} ${pt.iconSlotSuffix}`,"aria-hidden":"true",children:o})]}),n&&d.jsx("span",{id:`${f}-helper`,className:pt.helperText,children:n})]})});gs.displayName="InputText";const Op="_listbox_fb69z_9",Lp="_invalid_fb69z_22",Rp="_listboxDisabled_fb69z_27",Bp="_header_fb69z_33",$p="_labelRow_fb69z_42",Pp="_label_fb69z_42",zp="_required_fb69z_55",Fp="_inputWrap_fb69z_63",Hp="_filterInput_fb69z_79",Wp="_iconSearch_fb69z_105",Vp="_iconButton_fb69z_121",Up="_helperText_fb69z_146",qp="_errorText_fb69z_153 _helperText_fb69z_146",Kp="_list_fb69z_9",Gp="_option_fb69z_169",Jp="_optionGroupItem_fb69z_184",Yp="_optionDisabled_fb69z_189",Qp="_optionHighlight_fb69z_200",Xp="_optionLabel_fb69z_212",Zp="_optionLabelDisabled_fb69z_220",em="_groupHeader_fb69z_226",tm="_checkbox_fb69z_238",nm="_checkboxChecked_fb69z_253",rm="_checkboxDisabled_fb69z_259",sm="_checkmark_fb69z_265",im="_checkmarkDisabled_fb69z_277",be={listbox:Op,invalid:Lp,listboxDisabled:Rp,header:Bp,labelRow:$p,label:Pp,required:zp,inputWrap:Fp,filterInput:Hp,iconSearch:Wp,iconButton:Vp,helperText:Up,errorText:qp,list:Kp,option:Gp,optionGroupItem:Jp,optionDisabled:Yp,optionHighlight:Qp,optionLabel:Xp,optionLabelDisabled:Zp,groupHeader:em,checkbox:tm,checkboxChecked:nm,checkboxDisabled:rm,checkmark:sm,checkmarkDisabled:im};function om(t){return t.length>0&&"items"in t[0]}const wd=x.forwardRef(({options:t,value:e,onChange:n,multiple:r=!1,filter:s=!1,filterPlaceholder:i="Search…",label:o,required:l=!1,helperText:a,invalid:c=!1,disabled:u=!1,className:h,style:f},p)=>{const m=x.useId(),g=`${m}-filter`,b=`${m}-helper`,[y,v]=x.useState(""),_=x.useMemo(()=>e==null?[]:Array.isArray(e)?e:[e],[e]),w=om(t);function k(T){return!s||!y?!0:T.toLowerCase().includes(y.toLowerCase())}function S(T){if(!u)if(r){const $=_.includes(T)?_.filter(R=>R!==T):[..._,T];n==null||n($)}else n==null||n(_[0]===T?null:T)}function C(T,$=!1){if(!k(T.label))return null;const R=_.includes(T.value),L=u||T.disabled,U=[be.option,R?be.optionHighlight:"",L?be.optionDisabled:"",$?be.optionGroupItem:""].filter(Boolean).join(" "),V=R&&L;return d.jsxs("div",{role:"option","aria-selected":R,"aria-disabled":L||void 0,className:U,onClick:()=>!L&&S(T.value),tabIndex:L?-1:0,onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),L||S(T.value))},children:[r&&d.jsx("span",{"aria-hidden":"true",className:[be.checkbox,R&&!L?be.checkboxChecked:"",L?be.checkboxDisabled:""].filter(Boolean).join(" "),children:R&&d.jsx("svg",{className:V?`${be.checkmark} ${be.checkmarkDisabled}`:be.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})}),d.jsx("span",{className:L?`${be.optionLabel} ${be.optionLabelDisabled}`:be.optionLabel,children:T.label})]},T.value)}function D(){return w?t.map(T=>{const $=T.items.map(R=>C(R,!0)).filter(Boolean);return $.length===0?null:d.jsxs("div",{children:[d.jsx("div",{className:be.groupHeader,children:T.label}),$]},T.label)}):t.map(T=>C(T))}const B=[be.listbox,c?be.invalid:"",u?be.listboxDisabled:"",h??""].filter(Boolean).join(" "),N=s||!!(o||a);return d.jsxs("div",{ref:p,className:B,style:f,children:[N&&d.jsxs("div",{className:be.header,children:[o&&d.jsxs("div",{className:be.labelRow,children:[d.jsx("label",{className:be.label,htmlFor:g,children:o}),l&&d.jsx("span",{className:be.required,"aria-hidden":"true",children:"*"})]}),s&&d.jsxs("div",{className:be.inputWrap,children:[d.jsx("input",{id:g,type:"text",className:be.filterInput,placeholder:i,value:y,onChange:T=>v(T.target.value),disabled:u,required:l,"aria-invalid":c||void 0,"aria-describedby":a?b:void 0}),y?d.jsx("button",{type:"button",className:be.iconButton,onClick:()=>v(""),"aria-label":"Clear filter",tabIndex:-1,disabled:u,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M5 5L9 9M9 5L5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}):d.jsx("span",{className:be.iconSearch,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})]}),a&&d.jsx("span",{id:b,className:c?be.errorText:be.helperText,children:a})]}),d.jsx("div",{role:"listbox","aria-multiselectable":r||void 0,"aria-disabled":u||void 0,className:be.list,children:D()})]})});wd.displayName="ListBox";const lm="_wrapper_1o7x9_7",am="_disabled_1o7x9_15",cm="_input_1o7x9_21",dm="_circle_1o7x9_35",um="_sm_1o7x9_50",hm="_dot_1o7x9_54",fm="_label_1o7x9_58",pm="_md_1o7x9_63",mm="_lg_1o7x9_76",gm="_invalid_1o7x9_151",bm="_helperText_1o7x9_175",ym="_errorText_1o7x9_183 _helperText_1o7x9_175",zt={wrapper:lm,disabled:am,input:cm,circle:dm,sm:um,dot:hm,label:fm,md:pm,lg:mm,invalid:gm,helperText:bm,errorText:ym},Cd=x.forwardRef(({label:t,invalid:e=!1,helperText:n,size:r="md",disabled:s=!1,id:i,className:o,...l},a)=>{const c=x.useRef(null),u=a??c,h=[zt.wrapper,zt[r],s?zt.disabled:"",e?zt.invalid:"",o??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:h,htmlFor:i,children:[d.jsx("input",{ref:u,type:"radio",id:i,disabled:s,className:zt.input,"aria-invalid":e||void 0,...l}),d.jsx("span",{className:zt.circle,"aria-hidden":"true",children:d.jsx("span",{className:zt.dot})}),t&&d.jsx("span",{className:zt.label,children:t})]}),n&&d.jsx("span",{className:e?zt.errorText:zt.helperText,children:n})]})});Cd.displayName="RadioButton";const xm="_chip_1c1ks_1",vm="_dismissible_1c1ks_21",_m="_label_1c1ks_33",km="_dismiss_1c1ks_21",ks={chip:xm,dismissible:vm,label:_m,dismiss:km},wm={"red-darkest":{bg:"var(--red-800)",text:"var(--red-100)"},"red-dark":{bg:"var(--red-200)",text:"var(--red-900)"},"red-light":{bg:"var(--red-100)",text:"var(--red-800)"},"yellow-darkest":{bg:"var(--yellow-800)",text:"var(--yellow-50)"},"yellow-dark":{bg:"var(--yellow-300)",text:"var(--yellow-800)"},"yellow-light":{bg:"var(--yellow-100)",text:"var(--yellow-900)"},"green-darkest":{bg:"var(--green-800)",text:"var(--green-50)"},"green-dark":{bg:"var(--green-300)",text:"var(--green-800)"},"green-light":{bg:"var(--green-100)",text:"var(--green-800)"},"blue-darkest":{bg:"var(--blue-800)",text:"var(--blue-50)"},"blue-dark":{bg:"var(--blue-300)",text:"var(--blue-900)"},"blue-light":{bg:"var(--blue-100)",text:"var(--blue-900)"},"navy-darkest":{bg:"var(--navy-700)",text:"var(--navy-50)"},"navy-dark":{bg:"var(--navy-400)",text:"var(--navy-50)"},"navy-light":{bg:"var(--navy-100)",text:"var(--navy-800)"}};function Gs({label:t,color:e,dismissible:n=!0,onDismiss:r,style:s,forceFocus:i}){const o=wm[e],l={"--c-bg":o.bg,"--c-text":o.text,...i?{boxShadow:"var(--focus-ring)",outline:"none"}:void 0,...s};return d.jsxs("span",{className:`${ks.chip}${n?` ${ks.dismissible}`:""}`,style:l,children:[d.jsx("span",{className:ks.label,children:t}),n&&d.jsx("button",{type:"button",className:ks.dismiss,onClick:r,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Gs.displayName="MiscChip";const Cm="_root_18i15_10",Sm="_rootDisabled_18i15_18",Nm="_field_18i15_24",Am="_labelRow_18i15_32",Tm="_label_18i15_32",Em="_required_18i15_44",Mm="_trigger_18i15_52",jm="_triggerOpen_18i15_69",Im="_triggerInvalid_18i15_74",Dm="_triggerDisabled_18i15_79",Om="_sm_18i15_90",Lm="_lg_18i15_91",Rm="_triggerContent_18i15_95",Bm="_placeholder_18i15_105",$m="_md_18i15_112",Pm="_chips_18i15_117",zm="_chevron_18i15_127",Fm="_helperText_18i15_148",Hm="_errorText_18i15_155 _helperText_18i15_148",Wm="_dropdown_18i15_162",Vm="_dropdownHeader_18i15_177",Um="_hiddenInput_18i15_188",qm="_selectAllWrap_18i15_200",Km="_cbBox_18i15_215",Gm="_cbChecked_18i15_229",Jm="_cbIndeterminate_18i15_234",Ym="_cbCheckmark_18i15_239",Qm="_cbDash_18i15_250",Xm="_searchWrap_18i15_259",Zm="_searchIcon_18i15_272",eg="_searchInput_18i15_286",tg="_searchClear_18i15_302",ng="_optionList_18i15_322",rg="_option_18i15_322",sg="_optionDisabled_18i15_347",ig="_optionHighlight_18i15_357",og="_optionCb_18i15_372",lg="_optionCbChecked_18i15_386",ag="_optionCbCheckmark_18i15_391",cg="_optionLabel_18i15_404",dg="_optionLabelHighlight_18i15_413",ug="_optionChipWrap_18i15_419",hg="_footer_18i15_428",fg="_noResults_18i15_440",Z={root:Cm,rootDisabled:Sm,field:Nm,labelRow:Am,label:Tm,required:Em,trigger:Mm,triggerOpen:jm,triggerInvalid:Im,triggerDisabled:Dm,sm:Om,lg:Lm,triggerContent:Rm,placeholder:Bm,md:$m,chips:Pm,chevron:zm,helperText:Fm,errorText:Hm,dropdown:Wm,dropdownHeader:Vm,hiddenInput:Um,selectAllWrap:qm,cbBox:Km,cbChecked:Gm,cbIndeterminate:Jm,cbCheckmark:Ym,cbDash:Qm,searchWrap:Xm,searchIcon:Zm,searchInput:eg,searchClear:tg,optionList:ng,option:rg,optionDisabled:sg,optionHighlight:ig,optionCb:og,optionCbChecked:lg,optionCbCheckmark:ag,optionLabel:cg,optionLabelHighlight:dg,optionChipWrap:ug,footer:hg,noResults:fg},Sd=x.forwardRef(({options:t,value:e,onChange:n,placeholder:r="Select options…",label:s,required:i=!1,helperText:o,invalid:l=!1,disabled:a=!1,filter:c=!0,filterPlaceholder:u="Search…",showSelectAll:h=!0,size:f="md",footer:p,className:m,style:g},b)=>{const y=x.useId(),v=`${y}-dropdown`,_=`${y}-trigger`,w=`${y}-helper`,[k,S]=x.useState(!1),[C,D]=x.useState(""),B=x.useRef(null),N=x.useRef(null),T=A=>{B.current=A,typeof b=="function"?b(A):b&&(b.current=A)},$=e??[],R=x.useMemo(()=>t.filter(A=>!A.disabled),[t]),L=R.length>0&&R.every(A=>$.includes(A.value)),V=!!R.some(A=>$.includes(A.value))&&!L;x.useEffect(()=>{if(!k)return;function A(q){var re;(re=B.current)!=null&&re.contains(q.target)||(S(!1),D(""))}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[k]),x.useEffect(()=>{N.current&&(N.current.indeterminate=V)},[V]),x.useEffect(()=>{if(!k)return;function A(q){q.key==="Escape"&&(S(!1),D(""))}return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[k]);const M=x.useMemo(()=>{if(!c||!C)return t;const A=C.toLowerCase();return t.filter(q=>q.label.toLowerCase().includes(A))},[t,c,C]);function P(){a||S(A=>(A&&D(""),!A))}function H(A){const q=$.includes(A)?$.filter(re=>re!==A):[...$,A];n==null||n(q)}function oe(A){n==null||n($.filter(q=>q!==A))}function ae(){const A=R.map(q=>q.value);L?n==null||n($.filter(q=>!A.includes(q))):n==null||n([...new Set([...$,...A])])}function Ae(A){A.key==="Enter"||A.key===" "?(A.preventDefault(),P()):A.key==="Escape"?(S(!1),D("")):A.key==="ArrowDown"&&!k&&(A.preventDefault(),S(!0))}const Ie=[Z.root,Z[f],a?Z.rootDisabled:"",m??""].filter(Boolean).join(" "),Be=[Z.trigger,k?Z.triggerOpen:"",l?Z.triggerInvalid:"",a?Z.triggerDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:T,className:Ie,style:g,children:[d.jsxs("div",{className:Z.field,children:[s&&d.jsxs("div",{className:Z.labelRow,children:[d.jsx("label",{className:Z.label,htmlFor:_,children:s}),i&&d.jsx("span",{className:Z.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{id:_,role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":v,"aria-required":i||void 0,"aria-invalid":l||void 0,"aria-describedby":o?w:void 0,"aria-disabled":a||void 0,tabIndex:a?-1:0,className:Be,onClick:P,onKeyDown:Ae,children:[d.jsx("span",{className:Z.triggerContent,children:$.length===0?d.jsx("span",{className:Z.placeholder,children:r}):d.jsx("span",{className:Z.chips,children:$.map(A=>{var re;const q=t.find(xe=>xe.value===A);return q?d.jsx("span",{onMouseDown:xe=>xe.stopPropagation(),onClick:xe=>xe.stopPropagation(),children:d.jsx(Gs,{label:q.label,color:((re=q.chip)==null?void 0:re.color)??"blue-light",dismissible:!a,onDismiss:()=>oe(A)})},A):null})})}),d.jsx("span",{className:Z.chevron,"aria-hidden":"true",children:d.jsx("svg",{viewBox:"0 0 14 8",fill:"none",children:d.jsx("path",{d:"M1 1l6 6 6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),o&&d.jsx("span",{id:w,className:l?Z.errorText:Z.helperText,children:o})]}),k&&d.jsxs("div",{id:v,role:"listbox","aria-multiselectable":"true",className:Z.dropdown,children:[d.jsxs("div",{className:Z.dropdownHeader,children:[h&&d.jsxs("span",{className:Z.selectAllWrap,onClick:ae,"aria-label":"Select all",role:"checkbox","aria-checked":L?!0:V?"mixed":!1,tabIndex:0,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),ae())},children:[d.jsx("input",{ref:N,type:"checkbox",className:Z.hiddenInput,checked:L,onChange:ae}),d.jsxs("span",{"aria-hidden":"true",className:[Z.cbBox,L?Z.cbChecked:"",V?Z.cbIndeterminate:""].filter(Boolean).join(" "),children:[L&&d.jsx("svg",{className:Z.cbCheckmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})}),V&&d.jsx("span",{className:Z.cbDash})]})]}),c&&d.jsxs("div",{className:Z.searchWrap,children:[d.jsx("span",{className:Z.searchIcon,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsx("input",{type:"text",className:Z.searchInput,placeholder:u,value:C,onChange:A=>D(A.target.value),"aria-label":"Filter options",autoComplete:"off"}),C&&d.jsx("button",{type:"button",className:Z.searchClear,onClick:()=>D(""),"aria-label":"Clear filter",tabIndex:-1,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 5l4 4M9 5l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]}),d.jsx("div",{className:Z.optionList,children:M.length===0?d.jsx("div",{className:Z.noResults,children:"No results"}):M.map(A=>{const q=$.includes(A.value),re=A.disabled,xe=[Z.option,q?Z.optionHighlight:"",re?Z.optionDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{role:"option","aria-selected":q,"aria-disabled":re||void 0,className:xe,onClick:()=>!re&&H(A.value),tabIndex:re?-1:0,onKeyDown:$e=>{($e.key==="Enter"||$e.key===" ")&&!re&&($e.preventDefault(),H(A.value))},children:[d.jsx("span",{"aria-hidden":"true",className:[Z.optionCb,q?Z.optionCbChecked:""].filter(Boolean).join(" "),children:q&&d.jsx("svg",{className:Z.optionCbCheckmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})}),A.chip?d.jsx("span",{className:Z.optionChipWrap,children:d.jsx(Gs,{label:A.label,color:A.chip.color,dismissible:!1})}):d.jsx("span",{className:q?`${Z.optionLabel} ${Z.optionLabelHighlight}`:Z.optionLabel,children:A.label})]},A.value)})}),p&&d.jsx("div",{className:Z.footer,children:p})]})]})});Sd.displayName="MultiSelect";const pg="_root_1t9zz_10",mg="_rootDisabled_1t9zz_18",gg="_field_1t9zz_24",bg="_labelRow_1t9zz_32",yg="_label_1t9zz_32",xg="_required_1t9zz_44",vg="_trigger_1t9zz_52",_g="_triggerOpen_1t9zz_68",kg="_triggerDisabled_1t9zz_68",wg="_triggerInvalid_1t9zz_68",Cg="_lg_1t9zz_91",Sg="_triggerContent_1t9zz_95",Ng="_placeholder_1t9zz_101",Ag="_triggerValue_1t9zz_113",Tg="_sm_1t9zz_138",Eg="_md_1t9zz_140",Mg="_chevron_1t9zz_147",jg="_chevronInvalid_1t9zz_167",Ig="_chevronDisabled_1t9zz_172",Dg="_leadingIcon_1t9zz_178",Og="_helperText_1t9zz_196",Lg="_errorText_1t9zz_203 _helperText_1t9zz_196",Rg="_dropdown_1t9zz_210",Bg="_filterHeader_1t9zz_225",$g="_searchWrap_1t9zz_230",Pg="_searchIcon_1t9zz_241",zg="_searchInput_1t9zz_255",Fg="_searchClear_1t9zz_271",Hg="_optionList_1t9zz_291",Wg="_option_1t9zz_291",Vg="_optionDisabled_1t9zz_315",Ug="_optionHighlight_1t9zz_326",qg="_optionLabel_1t9zz_337",Kg="_optionLabelHighlight_1t9zz_345",Gg="_noResults_1t9zz_351",ue={root:pg,rootDisabled:mg,field:gg,labelRow:bg,label:yg,required:xg,trigger:vg,triggerOpen:_g,triggerDisabled:kg,triggerInvalid:wg,lg:Cg,triggerContent:Sg,placeholder:Ng,triggerValue:Ag,sm:Tg,md:Eg,chevron:Mg,chevronInvalid:jg,chevronDisabled:Ig,leadingIcon:Dg,helperText:Og,errorText:Lg,dropdown:Rg,filterHeader:Bg,searchWrap:$g,searchIcon:Pg,searchInput:zg,searchClear:Fg,optionList:Hg,option:Wg,optionDisabled:Vg,optionHighlight:Ug,optionLabel:qg,optionLabelHighlight:Kg,noResults:Gg},Jg=d.jsx("i",{className:"pi pi-search"}),pr=x.forwardRef(({options:t,value:e,onChange:n,placeholder:r="Select…",label:s,required:i=!1,helperText:o,invalid:l=!1,disabled:a=!1,filter:c=!1,filterPlaceholder:u="Search…",size:h="md",leadingIcon:f,className:p,style:m},g)=>{const b=x.useId(),y=`${b}-dropdown`,v=`${b}-trigger`,_=`${b}-helper`,[w,k]=x.useState(!1),[S,C]=x.useState(""),D=x.useRef(null),B=x.useRef(null),N=x.useRef(null),[T,$]=x.useState(null),R=A=>{D.current=A,typeof g=="function"?g(A):g&&(g.current=A)},L=t.find(A=>A.value===e)??null;x.useEffect(()=>{if(!w)return;function A(q){var xe,$e;const re=q.target;!((xe=D.current)!=null&&xe.contains(re))&&!(($e=N.current)!=null&&$e.contains(re))&&(k(!1),C(""))}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[w]),x.useEffect(()=>{if(!w)return;function A(){var re;const q=(re=B.current)==null?void 0:re.getBoundingClientRect();q&&$({top:q.bottom+2,left:q.left,width:q.width})}return A(),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),()=>{window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A)}},[w]),x.useEffect(()=>{if(!w)return;function A(q){q.key==="Escape"&&(k(!1),C(""))}return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[w]);const U=x.useRef(!1);x.useLayoutEffect(()=>{var q;if(!w){U.current=!1;return}if(!T||U.current)return;const A=(q=N.current)==null?void 0:q.querySelector('[role="option"][aria-selected="true"]');A&&(A.scrollIntoView({block:"start"}),U.current=!0)},[w,T]);const V=x.useMemo(()=>{if(!c||!S)return t;const A=S.toLowerCase();return t.filter(q=>q.label.toLowerCase().includes(A))},[t,c,S]);function M(){a||k(A=>(A&&C(""),!A))}function P(A){n==null||n(A),k(!1),C("")}function H(A){A.key==="Enter"||A.key===" "?(A.preventDefault(),M()):A.key==="Escape"?(k(!1),C("")):A.key==="ArrowDown"&&!w&&(A.preventDefault(),k(!0))}const oe=!!L,ae=f===!0?Jg:f||null,Ae=[ue.root,ue[h],a?ue.rootDisabled:"",p??""].filter(Boolean).join(" "),Ie=[ue.trigger,w?ue.triggerOpen:"",l?ue.triggerInvalid:"",a?ue.triggerDisabled:"",oe&&!l&&!a?ue.triggerFilled:""].filter(Boolean).join(" "),Be=[ue.chevron,l?ue.chevronInvalid:"",a?ue.chevronDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:R,className:Ae,style:m,children:[d.jsxs("div",{className:ue.field,children:[s&&d.jsxs("div",{className:ue.labelRow,children:[d.jsx("label",{className:ue.label,htmlFor:v,children:s}),i&&d.jsx("span",{className:ue.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{ref:B,id:v,role:"combobox","aria-haspopup":"listbox","aria-expanded":w,"aria-controls":y,"aria-required":i||void 0,"aria-invalid":l||void 0,"aria-describedby":o?_:void 0,"aria-disabled":a||void 0,tabIndex:a?-1:0,className:Ie,onClick:M,onKeyDown:H,children:[ae&&d.jsx("span",{className:ue.leadingIcon,"aria-hidden":"true",children:ae}),d.jsx("span",{className:ue.triggerContent,children:L?d.jsx("span",{className:ue.triggerValue,children:L.label}):d.jsx("span",{className:ue.placeholder,children:r})}),d.jsx("span",{className:Be,"aria-hidden":"true",children:d.jsx("svg",{viewBox:"0 0 14 8",fill:"none",children:d.jsx("path",{d:"M1 1l6 6 6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),o&&d.jsx("span",{id:_,className:l?ue.errorText:ue.helperText,children:o})]}),w&&T&&qt.createPortal(d.jsxs("div",{ref:N,"data-popover-root":"",id:y,role:"listbox",className:ue.dropdown,style:{top:T.top,left:T.left,width:T.width},children:[c&&d.jsx("div",{className:ue.filterHeader,children:d.jsxs("div",{className:ue.searchWrap,children:[d.jsx("span",{className:ue.searchIcon,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsx("input",{type:"text",className:ue.searchInput,placeholder:u,value:S,onChange:A=>C(A.target.value),"aria-label":"Filter options",autoComplete:"off"}),S&&d.jsx("button",{type:"button",className:ue.searchClear,onClick:()=>C(""),"aria-label":"Clear filter",tabIndex:-1,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 5l4 4M9 5l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}),d.jsx("div",{className:ue.optionList,children:V.length===0?d.jsx("div",{className:ue.noResults,children:"No results"}):V.map(A=>{const q=A.value===e,re=A.disabled,xe=[ue.option,q?ue.optionHighlight:"",re?ue.optionDisabled:""].filter(Boolean).join(" ");return d.jsx("div",{role:"option","aria-selected":q,"aria-disabled":re||void 0,className:xe,onClick:()=>!re&&P(A.value),tabIndex:re?-1:0,onKeyDown:$e=>{($e.key==="Enter"||$e.key===" ")&&!re&&($e.preventDefault(),P(A.value))},children:d.jsx("span",{className:q?`${ue.optionLabel} ${ue.optionLabelHighlight}`:ue.optionLabel,children:A.label})},A.value)})})]}),document.body)]})});pr.displayName="Select";const Yg="_btn_1wdnr_7",Qg="_disabled_1wdnr_21",Xg="_sm_1wdnr_27",Zg="_md_1wdnr_33",eb="_lg_1wdnr_39",tb="_icon_1wdnr_47",nb="_primary_1wdnr_59",rb="_secondary_1wdnr_68",sb="_ghost_1wdnr_78",ib="_danger_1wdnr_87",Ar={btn:Yg,disabled:Qg,sm:Xg,md:Zg,lg:eb,icon:tb,primary:nb,secondary:rb,ghost:sb,danger:ib},ob="_wrapper_wreg1_4",lb="_tooltip_wreg1_17",ab="_placement_top_wreg1_59",cb="_placement_bottom_wreg1_69",db="_placement_left_wreg1_79",ub="_placement_right_wreg1_89",so={wrapper:ob,tooltip:lb,placement_top:ab,placement_bottom:cb,placement_left:db,placement_right:ub},ws=8,Cs=44;function er({content:t,children:e,placement:n="top",delay:r=200,disabled:s=!1,maxWidth:i=140,className:o}){const[l,a]=x.useState(null),c=x.useRef(null),u=x.useRef(null),h=x.useId(),f=l!==null,p=x.useCallback(()=>{const y=c.current;if(!y)return null;const v=y.getBoundingClientRect(),_=window.innerWidth,w=window.innerHeight;let k=n;k==="top"&&v.top<Cs?k="bottom":k==="bottom"&&w-v.bottom<Cs?k="top":k==="left"&&v.left<Cs?k="right":k==="right"&&_-v.right<Cs&&(k="left");const S=v.left+v.width/2,C=v.top+v.height/2;switch(k){case"bottom":return{top:v.bottom+ws,left:S,transform:"translate(-50%, 0)",placement:k};case"left":return{top:C,left:v.left-ws,transform:"translate(-100%, -50%)",placement:k};case"right":return{top:C,left:v.right+ws,transform:"translate(0, -50%)",placement:k};case"top":default:return{top:v.top-ws,left:S,transform:"translate(-50%, -100%)",placement:k}}},[n]),m=()=>{s||(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>a(p()),r))},g=()=>{u.current&&clearTimeout(u.current),a(null)};x.useLayoutEffect(()=>{if(!f)return;const y=()=>a(p()),v={capture:!0,passive:!0};return window.addEventListener("scroll",y,v),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,v),window.removeEventListener("resize",y)}},[f,p]),x.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const b=[so.tooltip,so[`placement_${(l==null?void 0:l.placement)??n}`],o??""].filter(Boolean).join(" ");return d.jsxs("span",{ref:c,className:so.wrapper,onMouseEnter:m,onMouseLeave:g,onFocus:m,onBlur:g,children:[d.jsx("span",{"aria-describedby":f?h:void 0,children:e}),f&&l&&typeof document<"u"&&qt.createPortal(d.jsx("div",{id:h,role:"tooltip",className:b,style:{maxWidth:i,top:l.top,left:l.left,transform:l.transform},"aria-hidden":!1,children:t}),document.body)]})}er.displayName="Tooltip";const ut=x.forwardRef(({icon:t,variant:e="primary",size:n="md",className:r,disabled:s,tooltipPlacement:i="top","aria-label":o,...l},a)=>{const c=[Ar.btn,Ar[e],Ar[n],s?Ar.disabled:"",r??""].filter(Boolean).join(" ");return d.jsx(er,{content:o,placement:i,children:d.jsx("button",{ref:a,className:c,disabled:s,"aria-label":o,...l,children:d.jsx("span",{className:Ar.icon,"aria-hidden":"true",children:t})})})});ut.displayName="IconButton";const hb="_root_k08lc_10",fb="_field_k08lc_20",pb="_labelRow_k08lc_28",mb="_label_k08lc_28",gb="_required_k08lc_40",bb="_inputWrap_k08lc_48",yb="_inputWrapDisabled_k08lc_60",xb="_inputWrapInvalid_k08lc_60",vb="_inputWrapOpen_k08lc_65",_b="_input_k08lc_48",kb="_calIconBtn_k08lc_102",wb="_helperText_k08lc_128",Cb="_errorText_k08lc_135 _helperText_k08lc_128",Sb="_calendar_k08lc_144",Nb="_calHeader_k08lc_161",Ab="_titleGroup_k08lc_171",Tb="_titleBtn_k08lc_178",Eb="_titleText_k08lc_196",Mb="_dayView_k08lc_207",jb="_weekRow_k08lc_212",Ib="_weekRowWithWk_k08lc_217",Db="_weekdayCell_k08lc_223",Ob="_wkLabel_k08lc_233",Lb="_cell_k08lc_239",Rb="_wkCell_k08lc_252",Bb="_cellDisabled_k08lc_262",$b="_dayCircle_k08lc_262",Pb="_cellOutside_k08lc_277",zb="_cellSelected_k08lc_292",Fb="_cellToday_k08lc_297",Hb="_dayCircleSelected_k08lc_320",Wb="_dayCircleToday_k08lc_326",Vb="_monthGrid_k08lc_335",Ub="_monthCell_k08lc_342",qb="_monthCellSelected_k08lc_356",Kb="_yearGrid_k08lc_373",Gb="_yearCell_k08lc_380",Jb="_yearCellSelected_k08lc_394",Yb="_footer_k08lc_411",Qb="_clearBtn_k08lc_421",Xb="_todayBtn_k08lc_442",Y={root:hb,field:fb,labelRow:pb,label:mb,required:gb,inputWrap:bb,inputWrapDisabled:yb,inputWrapInvalid:xb,inputWrapOpen:vb,input:_b,calIconBtn:kb,helperText:wb,errorText:Cb,calendar:Sb,calHeader:Nb,titleGroup:Ab,titleBtn:Tb,titleText:Eb,dayView:Mb,weekRow:jb,weekRowWithWk:Ib,weekdayCell:Db,wkLabel:Ob,cell:Lb,wkCell:Rb,cellDisabled:Bb,dayCircle:$b,cellOutside:Pb,cellSelected:zb,cellToday:Fb,dayCircleSelected:Hb,dayCircleToday:Wb,monthGrid:Vb,monthCell:Ub,monthCellSelected:qb,yearGrid:Kb,yearCell:Gb,yearCellSelected:Jb,footer:Yb,clearBtn:Qb,todayBtn:Xb},Zb=["Su","Mo","Tu","We","Th","Fr","Sa"],Sa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ss(t){const e=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${e}/${n}/${t.getFullYear()}`}function Na(t){const e=t.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(!e)return null;const n=parseInt(e[1],10)-1,r=parseInt(e[2],10),s=parseInt(e[3],10);if(n<0||n>11||r<1||r>31||s<1e3)return null;const i=new Date(s,n,r);return i.getFullYear()!==s||i.getMonth()!==n||i.getDate()!==r?null:i}function Tr(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Ns(t,e,n){if(e){const r=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t<r)return!0}if(n){const r=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(t>r)return!0}return!1}function ey(t,e){const n=new Date(t,e,1),r=new Date(t,e+1,0),s=new Date(n);s.setDate(s.getDate()-s.getDay());const i=new Date(r);i.setDate(i.getDate()+(6-i.getDay()));const o=[],l=new Date(s);for(;l<=i;){const a=[];for(let c=0;c<7;c++)a.push(new Date(l)),l.setDate(l.getDate()+1);o.push(a)}return o}function ty(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const n=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)}function io(t){return Math.floor(t/8)*8}const ny=()=>d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{x:"1",y:"2.5",width:"12",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M1 6h12",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),ry=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),sy=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Nl=x.forwardRef(({value:t,onChange:e,label:n,required:r=!1,helperText:s,invalid:i=!1,disabled:o=!1,placeholder:l="MM/DD/YYYY",minDate:a,maxDate:c,showWeekNumbers:u=!0,id:h,className:f,style:p},m)=>{const g=x.useId(),b=h??`${g}-input`,y=`${g}-helper`,[v,_]=x.useState(!1),[w,k]=x.useState("day"),[S,C]=x.useState(()=>(t==null?void 0:t.getFullYear())??new Date().getFullYear()),[D,B]=x.useState(()=>(t==null?void 0:t.getMonth())??new Date().getMonth()),[N,T]=x.useState(()=>t?Ss(t):""),$=x.useRef(null),R=x.useRef(null),L=x.useRef(null),U=x.useRef(null),[V,M]=x.useState(null),P=O=>{$.current=O,typeof m=="function"?m(O):m&&(m.current=O)},H=new Date;H.setHours(0,0,0,0),x.useEffect(()=>{const O=t?Ss(t):"";R.current!==document.activeElement&&T(O),t&&(C(t.getFullYear()),B(t.getMonth()))},[t]),x.useEffect(()=>{if(!v)return;function O(X){var _e,_t;const pe=X.target;!((_e=$.current)!=null&&_e.contains(pe))&&!((_t=U.current)!=null&&_t.contains(pe))&&ae()}return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[v]),x.useEffect(()=>{if(!v)return;function O(){var pe;const X=(pe=L.current)==null?void 0:pe.getBoundingClientRect();X&&M({top:X.bottom+4,left:X.left})}return O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O)}},[v]),x.useEffect(()=>{if(!v)return;function O(X){X.key==="Escape"&&ae()}return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[v]);function oe(){o||_(O=>(O||k("day"),!0))}function ae(){_(!1),k("day")}function Ae(){w==="day"?D===0?(B(11),C(O=>O-1)):B(O=>O-1):C(w==="month"?O=>O-1:O=>io(O)-8)}function Ie(){w==="day"?D===11?(B(0),C(O=>O+1)):B(O=>O+1):C(w==="month"?O=>O+1:O=>io(O)+8)}function Be(O){Ns(O,a,c)||((O.getMonth()!==D||O.getFullYear()!==S)&&(B(O.getMonth()),C(O.getFullYear())),e==null||e(O),T(Ss(O)),ae())}function A(O){B(O),k("day")}function q(O){C(O),k("month")}function re(){const O=new Date;O.setHours(0,0,0,0),!Ns(O,a,c)&&(e==null||e(O),T(Ss(O)),C(O.getFullYear()),B(O.getMonth()),ae())}function xe(){e==null||e(null),T("")}function $e(O){const X=O.target.value;if(T(X),X===""){e==null||e(null);return}const pe=Na(X);pe&&(C(pe.getFullYear()),B(pe.getMonth()),e==null||e(pe))}function Bt(O){if(O.key==="Enter"){const X=Na(N);X&&(e==null||e(X),ae())}}function Dt(O,X){const pe=[Y.cell],_e=Tr(O,H),_t=t?Tr(O,t):!1,ft=Ns(O,a,c);return X||pe.push(Y.cellOutside),ft&&pe.push(Y.cellDisabled),_t?pe.push(Y.cellSelected):_e&&pe.push(Y.cellToday),pe.filter(Boolean).join(" ")}function rr(O){const X=[Y.dayCircle],pe=t?Tr(O,t):!1,_e=Tr(O,H);return pe?X.push(Y.dayCircleSelected):_e&&X.push(Y.dayCircleToday),X.join(" ")}function cn(O){const X=[Y.monthCell];return t&&t.getMonth()===O&&t.getFullYear()===S&&X.push(Y.monthCellSelected),X.join(" ")}function $t(O){const X=[Y.yearCell];return t&&t.getFullYear()===O&&X.push(Y.yearCellSelected),X.join(" ")}const Pt=ey(S,D),Gt=io(S),wr=Array.from({length:8},(O,X)=>Gt+X),sr=()=>w==="day"?d.jsxs("div",{className:Y.titleGroup,children:[d.jsx("button",{type:"button",className:Y.titleBtn,onClick:()=>k("month"),children:Sa[D]}),d.jsx("button",{type:"button",className:Y.titleBtn,onClick:()=>k("year"),children:S})]}):w==="month"?d.jsx("span",{className:Y.titleText,children:S}):d.jsxs("span",{className:Y.titleText,children:[Gt," – ",Gt+7]}),Cr=[Y.inputWrap,v?Y.inputWrapOpen:"",i?Y.inputWrapInvalid:"",o?Y.inputWrapDisabled:""].filter(Boolean).join(" "),G=[Y.root,f??""].filter(Boolean).join(" ");return d.jsxs("div",{ref:P,className:G,style:p,children:[d.jsxs("div",{className:Y.field,children:[n&&d.jsxs("div",{className:Y.labelRow,children:[d.jsx("label",{className:Y.label,htmlFor:b,children:n}),r&&d.jsx("span",{className:Y.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{ref:L,className:Cr,children:[d.jsx("input",{ref:R,id:b,type:"text",className:Y.input,value:N,placeholder:l,disabled:o,required:r,"aria-invalid":i||void 0,"aria-describedby":s?y:void 0,onChange:$e,onFocus:oe,onKeyDown:Bt,autoComplete:"off"}),d.jsx("button",{type:"button",className:Y.calIconBtn,onClick:()=>v?ae():oe(),tabIndex:-1,"aria-label":v?"Close calendar":"Open calendar",disabled:o,children:d.jsx(ny,{})})]}),s&&d.jsx("span",{id:y,className:i?Y.errorText:Y.helperText,children:s})]}),v&&V&&qt.createPortal(d.jsxs("div",{ref:U,"data-popover-root":"",className:Y.calendar,style:{top:V.top,left:V.left},role:"dialog","aria-label":"Date picker",children:[d.jsxs("div",{className:Y.calHeader,children:[d.jsx(ut,{icon:d.jsx(ry,{}),variant:"ghost",size:"sm",onClick:Ae,"aria-label":"Previous"}),sr(),d.jsx(ut,{icon:d.jsx(sy,{}),variant:"ghost",size:"sm",onClick:Ie,"aria-label":"Next"})]}),w==="day"&&d.jsxs("div",{className:Y.dayView,children:[d.jsxs("div",{className:u?Y.weekRowWithWk:Y.weekRow,children:[u&&d.jsx("div",{className:`${Y.weekdayCell} ${Y.wkLabel}`,children:"Wk"}),Zb.map(O=>d.jsx("div",{className:Y.weekdayCell,children:O},O))]}),Pt.map((O,X)=>{const pe=_e=>_e.getMonth()===D&&_e.getFullYear()===S;return d.jsxs("div",{className:u?Y.weekRowWithWk:Y.weekRow,children:[u&&d.jsx("div",{className:`${Y.cell} ${Y.wkCell}`,children:ty(O[0])}),O.map((_e,_t)=>{const ft=Ns(_e,a,c);return d.jsx("div",{className:Dt(_e,pe(_e)),onClick:()=>!ft&&Be(_e),role:"button",tabIndex:ft?-1:0,"aria-label":_e.toDateString(),"aria-pressed":t?Tr(_e,t):!1,"aria-disabled":ft||void 0,onKeyDown:Jt=>{(Jt.key==="Enter"||Jt.key===" ")&&!ft&&(Jt.preventDefault(),Be(_e))},children:d.jsx("div",{className:rr(_e),children:_e.getDate()})},_t)})]},X)})]}),w==="month"&&d.jsx("div",{className:Y.monthGrid,children:Sa.map((O,X)=>d.jsx("div",{className:cn(X),onClick:()=>A(X),role:"button",tabIndex:0,onKeyDown:pe=>{(pe.key==="Enter"||pe.key===" ")&&(pe.preventDefault(),A(X))},children:O},O))}),w==="year"&&d.jsx("div",{className:Y.yearGrid,children:wr.map(O=>d.jsx("div",{className:$t(O),onClick:()=>q(O),role:"button",tabIndex:0,onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),q(O))},children:O},O))}),w==="day"&&d.jsxs("div",{className:Y.footer,children:[d.jsx("button",{type:"button",className:Y.clearBtn,onClick:xe,children:"Clear"}),d.jsx("button",{type:"button",className:Y.todayBtn,onClick:re,children:"Today"})]})]}),document.body)]})});Nl.displayName="DatePicker";const iy="_calendar_1smvj_7",oy="_plain_1smvj_20",ly="_calHeader_1smvj_29",ay="_titleGroup_1smvj_38",cy="_titleBtn_1smvj_45",dy="_titleText_1smvj_63",uy="_dayView_1smvj_74",hy="_weekRow_1smvj_79",fy="_weekRowWithWk_1smvj_84",py="_weekdayCell_1smvj_90",my="_wkLabel_1smvj_100",gy="_cell_1smvj_106",by="_wkCell_1smvj_119",yy="_cellDisabled_1smvj_129",xy="_dayCircle_1smvj_129",vy="_cellOutside_1smvj_144",_y="_cellSelected_1smvj_159",ky="_cellToday_1smvj_163",wy="_dayCircleSelected_1smvj_185",Cy="_dayCircleToday_1smvj_191",Sy="_monthGrid_1smvj_200",Ny="_monthCell_1smvj_207",Ay="_monthCellSelected_1smvj_221",Ty="_yearGrid_1smvj_238",Ey="_yearCell_1smvj_245",My="_yearCellSelected_1smvj_259",he={calendar:iy,plain:oy,calHeader:ly,titleGroup:ay,titleBtn:cy,titleText:dy,dayView:uy,weekRow:hy,weekRowWithWk:fy,weekdayCell:py,wkLabel:my,cell:gy,wkCell:by,cellDisabled:yy,dayCircle:xy,cellOutside:vy,cellSelected:_y,cellToday:ky,dayCircleSelected:wy,dayCircleToday:Cy,monthGrid:Sy,monthCell:Ny,monthCellSelected:Ay,yearGrid:Ty,yearCell:Ey,yearCellSelected:My},jy=["Su","Mo","Tu","We","Th","Fr","Sa"],Aa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Er(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function oo(t,e,n){if(e){const r=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t<r)return!0}if(n){const r=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(t>r)return!0}return!1}function Iy(t,e){const n=new Date(t,e,1),r=new Date(t,e+1,0),s=new Date(n);s.setDate(s.getDate()-s.getDay());const i=new Date(r);i.setDate(i.getDate()+(6-i.getDay()));const o=[],l=new Date(s);for(;l<=i;){const a=[];for(let c=0;c<7;c++)a.push(new Date(l)),l.setDate(l.getDate()+1);o.push(a)}return o}function Dy(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const n=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)}function lo(t){return Math.floor(t/8)*8}const Oy=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ly=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Nd=x.forwardRef(({value:t,onChange:e,minDate:n,maxDate:r,showWeekNumbers:s=!1,variant:i="card",defaultMonth:o,id:l,className:a,style:c},u)=>{const h=t??o??new Date,[f,p]=x.useState("day"),[m,g]=x.useState(h.getFullYear()),[b,y]=x.useState(h.getMonth()),v=new Date;v.setHours(0,0,0,0),x.useEffect(()=>{t&&(g(t.getFullYear()),y(t.getMonth()))},[t]);function _(){f==="day"?b===0?(y(11),g(M=>M-1)):y(M=>M-1):g(f==="month"?M=>M-1:M=>lo(M)-8)}function w(){f==="day"?b===11?(y(0),g(M=>M+1)):y(M=>M+1):g(f==="month"?M=>M+1:M=>lo(M)+8)}function k(M){oo(M,n,r)||((M.getMonth()!==b||M.getFullYear()!==m)&&(y(M.getMonth()),g(M.getFullYear())),e==null||e(M))}function S(M){y(M),p("day")}function C(M){g(M),p("month")}function D(M,P){const H=[he.cell],oe=Er(M,v),ae=t?Er(M,t):!1,Ae=oo(M,n,r);return P||H.push(he.cellOutside),Ae&&H.push(he.cellDisabled),ae?H.push(he.cellSelected):oe&&H.push(he.cellToday),H.filter(Boolean).join(" ")}function B(M){const P=[he.dayCircle],H=t?Er(M,t):!1,oe=Er(M,v);return H?P.push(he.dayCircleSelected):oe&&P.push(he.dayCircleToday),P.join(" ")}function N(M){const P=[he.monthCell];return t&&t.getMonth()===M&&t.getFullYear()===m&&P.push(he.monthCellSelected),P.join(" ")}function T(M){const P=[he.yearCell];return t&&t.getFullYear()===M&&P.push(he.yearCellSelected),P.join(" ")}const $=Iy(m,b),R=lo(m),L=Array.from({length:8},(M,P)=>R+P),U=()=>f==="day"?d.jsxs("div",{className:he.titleGroup,children:[d.jsx("button",{type:"button",className:he.titleBtn,onClick:()=>p("month"),children:Aa[b]}),d.jsx("button",{type:"button",className:he.titleBtn,onClick:()=>p("year"),children:m})]}):f==="month"?d.jsx("span",{className:he.titleText,children:m}):d.jsxs("span",{className:he.titleText,children:[R," – ",R+7]}),V=[he.calendar,i==="plain"?he.plain:"",a].filter(Boolean).join(" ");return d.jsxs("div",{ref:u,id:l,className:V,style:c,role:"group","aria-label":"Calendar",children:[d.jsxs("div",{className:he.calHeader,children:[d.jsx(ut,{icon:d.jsx(Oy,{}),variant:"ghost",size:"sm",onClick:_,"aria-label":"Previous"}),U(),d.jsx(ut,{icon:d.jsx(Ly,{}),variant:"ghost",size:"sm",onClick:w,"aria-label":"Next"})]}),f==="day"&&d.jsxs("div",{className:he.dayView,children:[d.jsxs("div",{className:s?he.weekRowWithWk:he.weekRow,children:[s&&d.jsx("div",{className:`${he.weekdayCell} ${he.wkLabel}`,children:"Wk"}),jy.map(M=>d.jsx("div",{className:he.weekdayCell,children:M},M))]}),$.map((M,P)=>{const H=oe=>oe.getMonth()===b&&oe.getFullYear()===m;return d.jsxs("div",{className:s?he.weekRowWithWk:he.weekRow,children:[s&&d.jsx("div",{className:`${he.cell} ${he.wkCell}`,children:Dy(M[0])}),M.map((oe,ae)=>{const Ae=oo(oe,n,r);return d.jsx("div",{className:D(oe,H(oe)),onClick:()=>!Ae&&k(oe),role:"button",tabIndex:Ae?-1:0,"aria-label":oe.toDateString(),"aria-pressed":t?Er(oe,t):!1,"aria-disabled":Ae||void 0,onKeyDown:Ie=>{(Ie.key==="Enter"||Ie.key===" ")&&!Ae&&(Ie.preventDefault(),k(oe))},children:d.jsx("div",{className:B(oe),children:oe.getDate()})},ae)})]},P)})]}),f==="month"&&d.jsx("div",{className:he.monthGrid,children:Aa.map((M,P)=>d.jsx("div",{className:N(P),onClick:()=>S(P),role:"button",tabIndex:0,onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),S(P))},children:M},M))}),f==="year"&&d.jsx("div",{className:he.yearGrid,children:L.map(M=>d.jsx("div",{className:T(M),onClick:()=>C(M),role:"button",tabIndex:0,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),C(M))},children:M},M))})]})});Nd.displayName="Calendar";const Ry="_root_2twxf_9",By="_labelRow_2twxf_18",$y="_label_2twxf_18",Py="_required_2twxf_30",zy="_group_2twxf_41",Fy="_btn_2twxf_50",Hy="_btnSelected_2twxf_76",Wy="_btnDisabled_2twxf_76",Vy="_count_2twxf_109",Uy="_badge_2twxf_117",qy="_btnLabel_2twxf_132",Ky="_optionIcon_2twxf_136",Gy="_splitButton_2twxf_148",Jy="_splitButtonDisabled_2twxf_157",Yy="_splitMain_2twxf_163",Qy="_placeholder_2twxf_193",Xy="_splitChevron_2twxf_199",Zy="_chevronIcon_2twxf_219",e1="_dropdown_2twxf_228",t1="_dropdownRow_2twxf_244",n1="_dropdownRowSelected_2twxf_259",r1="_dropdownLabelSelected_2twxf_273",s1="_sizeSm_2twxf_282",i1="_sizeMd_2twxf_289",o1="_sizeLg_2twxf_296",ne={root:Ry,labelRow:By,label:$y,required:Py,group:zy,btn:Fy,btnSelected:Hy,btnDisabled:Wy,count:Vy,badge:Uy,btnLabel:qy,optionIcon:Ky,splitButton:Gy,splitButtonDisabled:Jy,splitMain:Yy,placeholder:Qy,splitChevron:Xy,chevronIcon:Zy,dropdown:e1,dropdownRow:t1,dropdownRowSelected:n1,dropdownLabelSelected:r1,sizeSm:s1,sizeMd:i1,sizeLg:o1};function ao({opt:t,labelClassName:e,countClassName:n,badgeClassName:r,iconClassName:s}){return d.jsxs(d.Fragment,{children:[t.icon&&d.jsx("span",{className:s,"aria-hidden":"true",children:t.icon}),d.jsx("span",{className:e,children:t.label}),t.count!==void 0&&d.jsx("span",{className:n,children:t.count}),t.badge&&d.jsx("span",{className:r,style:{backgroundColor:t.badge.color},"aria-label":`${t.badge.value}`,children:t.badge.value})]})}const Al=x.forwardRef(({options:t,value:e,onChange:n,variant:r="group",size:s="md",label:i,required:o=!1,disabled:l=!1,placeholder:a="Select…",className:c,style:u},h)=>{const f=x.useId(),[p,m]=x.useState(!1),g=x.useRef(null),b=k=>{g.current=k,typeof h=="function"?h(k):h&&(h.current=k)};x.useEffect(()=>{if(!p)return;function k(S){var C;(C=g.current)!=null&&C.contains(S.target)||m(!1)}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[p]),x.useEffect(()=>{if(!p)return;function k(S){S.key==="Escape"&&m(!1)}return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[p]);const y=t.find(k=>k.value===e)??null;function v(k){l||(n==null||n(k),m(!1))}const _=s==="sm"?ne.sizeSm:s==="lg"?ne.sizeLg:ne.sizeMd,w=[ne.root,_,c??""].filter(Boolean).join(" ");return r==="group"?d.jsxs("div",{ref:b,className:w,style:u,children:[i&&d.jsxs("div",{className:ne.labelRow,children:[d.jsx("span",{className:ne.label,children:i}),o&&d.jsx("span",{className:ne.required,"aria-hidden":"true",children:"*"})]}),d.jsx("div",{className:ne.group,role:"group","aria-label":i??"Select button group","aria-disabled":l||void 0,children:t.map((k,S)=>{const C=S===0,D=S===t.length-1,B=k.value===e,N=t.length===1?ne.btnSingle:C?ne.btnLeft:D?ne.btnRight:ne.btnMiddle,T=[ne.btn,N,B?ne.btnSelected:"",l?ne.btnDisabled:""].filter(Boolean).join(" ");return d.jsx("button",{id:`${f}-${k.value}`,type:"button",className:T,onClick:()=>v(k.value),"aria-pressed":B,disabled:l,children:d.jsx(ao,{opt:k,labelClassName:ne.btnLabel,countClassName:ne.count,badgeClassName:ne.badge,iconClassName:ne.optionIcon})},k.value)})})]}):d.jsxs("div",{ref:b,className:w,style:u,children:[i&&d.jsxs("div",{className:ne.labelRow,children:[d.jsx("span",{className:ne.label,children:i}),o&&d.jsx("span",{className:ne.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:[ne.splitButton,l?ne.splitButtonDisabled:""].filter(Boolean).join(" "),"aria-disabled":l||void 0,children:[d.jsx("button",{type:"button",className:ne.splitMain,onClick:()=>!l&&m(k=>!k),"aria-haspopup":"listbox","aria-expanded":p,disabled:l,children:y?d.jsx(ao,{opt:y,labelClassName:ne.btnLabel,countClassName:ne.count,badgeClassName:ne.badge,iconClassName:ne.optionIcon}):d.jsx("span",{className:ne.placeholder,children:a})}),d.jsx("button",{type:"button",className:ne.splitChevron,onClick:()=>!l&&m(k=>!k),"aria-label":p?"Close options":"Open options",tabIndex:-1,disabled:l,children:d.jsx("span",{className:ne.chevronIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})}),p&&d.jsx("div",{role:"listbox","aria-label":i??"Options",className:ne.dropdown,children:t.map(k=>{const S=k.value===e,C=[ne.dropdownRow,S?ne.dropdownRowSelected:""].filter(Boolean).join(" ");return d.jsx("div",{role:"option","aria-selected":S,className:C,onClick:()=>v(k.value),tabIndex:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),v(k.value))},children:d.jsx(ao,{opt:k,labelClassName:S?`${ne.btnLabel} ${ne.dropdownLabelSelected}`:ne.btnLabel,countClassName:ne.count,badgeClassName:ne.badge,iconClassName:ne.optionIcon})},k.value)})})]})]})});Al.displayName="SelectButton";const l1="_root_1rs6v_8",a1="_labelRow_1rs6v_17",c1="_label_1rs6v_17",d1="_required_1rs6v_29",u1="_outer_1rs6v_37",h1="_inner_1rs6v_46",f1="_innerDisabled_1rs6v_57",p1="_innerInvalid_1rs6v_57",m1="_leadingIcon_1rs6v_95",g1="_innerWithLeadingIcon_1rs6v_105",b1="_textareaWithLeadingIcon_1rs6v_110",y1="_textarea_1rs6v_110",x1="_textareaAutoGrow_1rs6v_148",v1="_bottomRow_1rs6v_156",_1="_helperText_1rs6v_165",k1="_errorText_1rs6v_172 _helperText_1rs6v_165",w1="_counter_1rs6v_179",C1="_innerWithCounter_1rs6v_190",S1="_textareaWithInnerCounter_1rs6v_195",N1="_counterInside_1rs6v_200 _counter_1rs6v_179",Pe={root:l1,labelRow:a1,label:c1,required:d1,outer:u1,inner:h1,innerDisabled:f1,innerInvalid:p1,leadingIcon:m1,innerWithLeadingIcon:g1,textareaWithLeadingIcon:b1,textarea:y1,textareaAutoGrow:x1,bottomRow:v1,helperText:_1,errorText:k1,counter:w1,innerWithCounter:C1,textareaWithInnerCounter:S1,counterInside:N1},A1=d.jsx("i",{className:"pi pi-pencil"}),Ad=x.forwardRef(({label:t,showLabel:e=!0,required:n=!1,helperText:r,invalid:s=!1,rows:i=3,autoGrow:o=!1,disabled:l=!1,maxLength:a,counterPlacement:c="outside",leadingIcon:u,id:h,className:f,style:p,value:m,defaultValue:g,onChange:b,...y},v)=>{const _=x.useId(),w=h??`${_}-textarea`,k=`${_}-helper`,S=x.useRef(null),C=v??S,[D,B]=x.useState(()=>m!==void 0?String(m??"").length:g!==void 0?String(g??"").length:0);x.useEffect(()=>{m!==void 0&&B(String(m??"").length)},[m]),x.useEffect(()=>{if(!o||!C.current)return;const M=C.current;M.style.height="auto",M.style.height=`${M.scrollHeight}px`},[o,m,D,C]);function N(M){B(M.target.value.length),b==null||b(M)}const T=a!==void 0,$=c==="inside",R=u===!0?A1:u||null,L=Pe.outer,U=[Pe.inner,s?Pe.innerInvalid:"",l?Pe.innerDisabled:"",$&&T?Pe.innerWithCounter:"",R?Pe.innerWithLeadingIcon:""].filter(Boolean).join(" "),V=[Pe.textarea,o?Pe.textareaAutoGrow:"",$&&T?Pe.textareaWithInnerCounter:"",R?Pe.textareaWithLeadingIcon:""].filter(Boolean).join(" ");return d.jsxs("div",{className:[Pe.root,f??""].filter(Boolean).join(" "),style:p,children:[t&&e&&d.jsxs("div",{className:Pe.labelRow,children:[d.jsx("label",{className:Pe.label,htmlFor:w,children:t}),n&&d.jsx("span",{className:Pe.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:L,children:[d.jsxs("div",{className:U,children:[R&&d.jsx("span",{className:Pe.leadingIcon,"aria-hidden":"true",children:R}),d.jsx("textarea",{ref:C,id:w,rows:o?void 0:i,maxLength:a,disabled:l,required:n,"aria-invalid":s||void 0,"aria-label":!e&&t?t:void 0,"aria-describedby":[r?k:"",T?`${_}-counter`:""].filter(Boolean).join(" ")||void 0,className:V,value:m,defaultValue:g,onChange:N,...y}),$&&T&&d.jsxs("span",{id:`${_}-counter`,className:Pe.counterInside,"aria-live":"polite",children:[D,"/",a]})]}),(r||!$&&T)&&d.jsxs("div",{className:Pe.bottomRow,children:[r?d.jsx("span",{id:k,className:s?Pe.errorText:Pe.helperText,children:r}):d.jsx("span",{}),!$&&T&&d.jsxs("span",{id:`${_}-counter`,className:Pe.counter,"aria-live":"polite",children:[D,"/",a]})]})]})]})});Ad.displayName="TextArea";var Ko={exports:{}},co={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),x=require("react"),qt=require("react-dom"),lp="_wrapper_soper_7",ap="_disabled_soper_15",cp="_input_soper_21",dp="_box_soper_35",up="_sm_soper_50",hp="_checkmark_soper_54",fp="_dash_soper_58",pp="_label_soper_61",mp="_md_soper_66",gp="_lg_soper_82",bp="_indeterminate_soper_118",yp="_invalid_soper_154",xp="_helperText_soper_217",_p="_errorText_soper_225 _helperText_soper_217",kt={wrapper:lp,disabled:ap,input:cp,box:dp,sm:up,checkmark:hp,dash:fp,label:pp,md:mp,lg:gp,indeterminate:bp,invalid:yp,helperText:xp,errorText:_p},Gn=x.forwardRef(({label:t,indeterminate:e=!1,invalid:n=!1,helperText:r,size:s="md",disabled:i=!1,id:o,className:l,...a},c)=>{const u=x.useRef(null),h=c??u;x.useEffect(()=>{h.current&&(h.current.indeterminate=e)},[e,h]);const f=[kt.wrapper,kt[s],i?kt.disabled:"",n?kt.invalid:"",e?kt.indeterminate:"",l??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:f,htmlFor:o,children:[d.jsx("input",{ref:h,type:"checkbox",id:o,disabled:i,className:kt.input,"aria-invalid":n||void 0,...a}),d.jsxs("span",{className:kt.box,"aria-hidden":"true",children:[d.jsx("svg",{className:kt.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})}),d.jsx("span",{className:kt.dash})]}),t&&d.jsx("span",{className:kt.label,children:t})]}),r&&d.jsx("span",{className:n?kt.errorText:kt.helperText,children:r})]})});Gn.displayName="Checkbox";const vp="_root_k9kb0_9",kp="_labelRow_k9kb0_19",wp="_labelText_k9kb0_25",Cp="_requiredMark_k9kb0_31",Sp="_inputWrap_k9kb0_39",Np="_sm_k9kb0_53",Ap="_nativeInput_k9kb0_60",Tp="_md_k9kb0_65",Ep="_lg_k9kb0_77",Mp="_iconSlot_k9kb0_113",jp="_iconSlotSuffix_k9kb0_125",Ip="_disabled_k9kb0_131",Dp="_invalid_k9kb0_146",Op="_helperText_k9kb0_195",pt={root:vp,labelRow:kp,labelText:wp,requiredMark:Cp,inputWrap:Sp,sm:Np,nativeInput:Ap,md:Tp,lg:Ep,iconSlot:Mp,iconSlotSuffix:jp,disabled:Ip,invalid:Dp,helperText:Op};let Lp=0;const bs=x.forwardRef(({label:t,required:e=!1,helperText:n,invalid:r=!1,size:s="md",prefixIcon:i,suffixIcon:o,disabled:l=!1,id:a,className:c,...u},h)=>{const f=a??`inputtext-${++Lp}`,p=[pt.root,pt[s],r?pt.invalid:"",l?pt.disabled:"",c??""].filter(Boolean).join(" ");return d.jsxs("div",{className:p,children:[t&&d.jsxs("label",{className:pt.labelRow,htmlFor:f,children:[d.jsx("span",{className:pt.labelText,children:t}),e&&d.jsx("span",{className:pt.requiredMark,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:pt.inputWrap,children:[i&&d.jsx("span",{className:pt.iconSlot,"aria-hidden":"true",children:i}),d.jsx("input",{ref:h,id:f,disabled:l,required:e,"aria-invalid":r||void 0,"aria-describedby":n?`${f}-helper`:void 0,className:pt.nativeInput,...u}),o&&d.jsx("span",{className:`${pt.iconSlot} ${pt.iconSlotSuffix}`,"aria-hidden":"true",children:o})]}),n&&d.jsx("span",{id:`${f}-helper`,className:pt.helperText,children:n})]})});bs.displayName="InputText";const Rp="_listbox_fb69z_9",Bp="_invalid_fb69z_22",$p="_listboxDisabled_fb69z_27",Pp="_header_fb69z_33",zp="_labelRow_fb69z_42",Fp="_label_fb69z_42",Hp="_required_fb69z_55",Wp="_inputWrap_fb69z_63",Vp="_filterInput_fb69z_79",Up="_iconSearch_fb69z_105",qp="_iconButton_fb69z_121",Kp="_helperText_fb69z_146",Gp="_errorText_fb69z_153 _helperText_fb69z_146",Jp="_list_fb69z_9",Yp="_option_fb69z_169",Qp="_optionGroupItem_fb69z_184",Xp="_optionDisabled_fb69z_189",Zp="_optionHighlight_fb69z_200",em="_optionLabel_fb69z_212",tm="_optionLabelDisabled_fb69z_220",nm="_groupHeader_fb69z_226",rm="_checkbox_fb69z_238",sm="_checkboxChecked_fb69z_253",im="_checkboxDisabled_fb69z_259",om="_checkmark_fb69z_265",lm="_checkmarkDisabled_fb69z_277",be={listbox:Rp,invalid:Bp,listboxDisabled:$p,header:Pp,labelRow:zp,label:Fp,required:Hp,inputWrap:Wp,filterInput:Vp,iconSearch:Up,iconButton:qp,helperText:Kp,errorText:Gp,list:Jp,option:Yp,optionGroupItem:Qp,optionDisabled:Xp,optionHighlight:Zp,optionLabel:em,optionLabelDisabled:tm,groupHeader:nm,checkbox:rm,checkboxChecked:sm,checkboxDisabled:im,checkmark:om,checkmarkDisabled:lm};function am(t){return t.length>0&&"items"in t[0]}const Sd=x.forwardRef(({options:t,value:e,onChange:n,multiple:r=!1,filter:s=!1,filterPlaceholder:i="Search…",label:o,required:l=!1,helperText:a,invalid:c=!1,disabled:u=!1,className:h,style:f},p)=>{const m=x.useId(),g=`${m}-filter`,b=`${m}-helper`,[y,_]=x.useState(""),v=x.useMemo(()=>e==null?[]:Array.isArray(e)?e:[e],[e]),w=am(t);function k(T){return!s||!y?!0:T.toLowerCase().includes(y.toLowerCase())}function S(T){if(!u)if(r){const $=v.includes(T)?v.filter(R=>R!==T):[...v,T];n==null||n($)}else n==null||n(v[0]===T?null:T)}function C(T,$=!1){if(!k(T.label))return null;const R=v.includes(T.value),L=u||T.disabled,U=[be.option,R?be.optionHighlight:"",L?be.optionDisabled:"",$?be.optionGroupItem:""].filter(Boolean).join(" "),V=R&&L;return d.jsxs("div",{role:"option","aria-selected":R,"aria-disabled":L||void 0,className:U,onClick:()=>!L&&S(T.value),tabIndex:L?-1:0,onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),L||S(T.value))},children:[r&&d.jsx("span",{"aria-hidden":"true",className:[be.checkbox,R&&!L?be.checkboxChecked:"",L?be.checkboxDisabled:""].filter(Boolean).join(" "),children:R&&d.jsx("svg",{className:V?`${be.checkmark} ${be.checkmarkDisabled}`:be.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})}),d.jsx("span",{className:L?`${be.optionLabel} ${be.optionLabelDisabled}`:be.optionLabel,children:T.label})]},T.value)}function D(){return w?t.map(T=>{const $=T.items.map(R=>C(R,!0)).filter(Boolean);return $.length===0?null:d.jsxs("div",{children:[d.jsx("div",{className:be.groupHeader,children:T.label}),$]},T.label)}):t.map(T=>C(T))}const B=[be.listbox,c?be.invalid:"",u?be.listboxDisabled:"",h??""].filter(Boolean).join(" "),N=s||!!(o||a);return d.jsxs("div",{ref:p,className:B,style:f,children:[N&&d.jsxs("div",{className:be.header,children:[o&&d.jsxs("div",{className:be.labelRow,children:[d.jsx("label",{className:be.label,htmlFor:g,children:o}),l&&d.jsx("span",{className:be.required,"aria-hidden":"true",children:"*"})]}),s&&d.jsxs("div",{className:be.inputWrap,children:[d.jsx("input",{id:g,type:"text",className:be.filterInput,placeholder:i,value:y,onChange:T=>_(T.target.value),disabled:u,required:l,"aria-invalid":c||void 0,"aria-describedby":a?b:void 0}),y?d.jsx("button",{type:"button",className:be.iconButton,onClick:()=>_(""),"aria-label":"Clear filter",tabIndex:-1,disabled:u,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M5 5L9 9M9 5L5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}):d.jsx("span",{className:be.iconSearch,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})]}),a&&d.jsx("span",{id:b,className:c?be.errorText:be.helperText,children:a})]}),d.jsx("div",{role:"listbox","aria-multiselectable":r||void 0,"aria-disabled":u||void 0,className:be.list,children:D()})]})});Sd.displayName="ListBox";const cm="_wrapper_1o7x9_7",dm="_disabled_1o7x9_15",um="_input_1o7x9_21",hm="_circle_1o7x9_35",fm="_sm_1o7x9_50",pm="_dot_1o7x9_54",mm="_label_1o7x9_58",gm="_md_1o7x9_63",bm="_lg_1o7x9_76",ym="_invalid_1o7x9_151",xm="_helperText_1o7x9_175",_m="_errorText_1o7x9_183 _helperText_1o7x9_175",zt={wrapper:cm,disabled:dm,input:um,circle:hm,sm:fm,dot:pm,label:mm,md:gm,lg:bm,invalid:ym,helperText:xm,errorText:_m},Nd=x.forwardRef(({label:t,invalid:e=!1,helperText:n,size:r="md",disabled:s=!1,id:i,className:o,...l},a)=>{const c=x.useRef(null),u=a??c,h=[zt.wrapper,zt[r],s?zt.disabled:"",e?zt.invalid:"",o??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:h,htmlFor:i,children:[d.jsx("input",{ref:u,type:"radio",id:i,disabled:s,className:zt.input,"aria-invalid":e||void 0,...l}),d.jsx("span",{className:zt.circle,"aria-hidden":"true",children:d.jsx("span",{className:zt.dot})}),t&&d.jsx("span",{className:zt.label,children:t})]}),n&&d.jsx("span",{className:e?zt.errorText:zt.helperText,children:n})]})});Nd.displayName="RadioButton";const vm="_chip_1c1ks_1",km="_dismissible_1c1ks_21",wm="_label_1c1ks_33",Cm="_dismiss_1c1ks_21",ws={chip:vm,dismissible:km,label:wm,dismiss:Cm},Sm={"red-darkest":{bg:"var(--red-800)",text:"var(--red-100)"},"red-dark":{bg:"var(--red-200)",text:"var(--red-900)"},"red-light":{bg:"var(--red-100)",text:"var(--red-800)"},"yellow-darkest":{bg:"var(--yellow-800)",text:"var(--yellow-50)"},"yellow-dark":{bg:"var(--yellow-300)",text:"var(--yellow-800)"},"yellow-light":{bg:"var(--yellow-100)",text:"var(--yellow-900)"},"green-darkest":{bg:"var(--green-800)",text:"var(--green-50)"},"green-dark":{bg:"var(--green-300)",text:"var(--green-800)"},"green-light":{bg:"var(--green-100)",text:"var(--green-800)"},"blue-darkest":{bg:"var(--blue-800)",text:"var(--blue-50)"},"blue-dark":{bg:"var(--blue-300)",text:"var(--blue-900)"},"blue-light":{bg:"var(--blue-100)",text:"var(--blue-900)"},"navy-darkest":{bg:"var(--navy-700)",text:"var(--navy-50)"},"navy-dark":{bg:"var(--navy-400)",text:"var(--navy-50)"},"navy-light":{bg:"var(--navy-100)",text:"var(--navy-800)"}};function Ys({label:t,color:e,dismissible:n=!0,onDismiss:r,style:s,forceFocus:i}){const o=Sm[e],l={"--c-bg":o.bg,"--c-text":o.text,...i?{boxShadow:"var(--focus-ring)",outline:"none"}:void 0,...s};return d.jsxs("span",{className:`${ws.chip}${n?` ${ws.dismissible}`:""}`,style:l,children:[d.jsx("span",{className:ws.label,children:t}),n&&d.jsx("button",{type:"button",className:ws.dismiss,onClick:r,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Ys.displayName="MiscChip";const Nm="_root_18i15_10",Am="_rootDisabled_18i15_18",Tm="_field_18i15_24",Em="_labelRow_18i15_32",Mm="_label_18i15_32",jm="_required_18i15_44",Im="_trigger_18i15_52",Dm="_triggerOpen_18i15_69",Om="_triggerInvalid_18i15_74",Lm="_triggerDisabled_18i15_79",Rm="_sm_18i15_90",Bm="_lg_18i15_91",$m="_triggerContent_18i15_95",Pm="_placeholder_18i15_105",zm="_md_18i15_112",Fm="_chips_18i15_117",Hm="_chevron_18i15_127",Wm="_helperText_18i15_148",Vm="_errorText_18i15_155 _helperText_18i15_148",Um="_dropdown_18i15_162",qm="_dropdownHeader_18i15_177",Km="_hiddenInput_18i15_188",Gm="_selectAllWrap_18i15_200",Jm="_cbBox_18i15_215",Ym="_cbChecked_18i15_229",Qm="_cbIndeterminate_18i15_234",Xm="_cbCheckmark_18i15_239",Zm="_cbDash_18i15_250",eg="_searchWrap_18i15_259",tg="_searchIcon_18i15_272",ng="_searchInput_18i15_286",rg="_searchClear_18i15_302",sg="_optionList_18i15_322",ig="_option_18i15_322",og="_optionDisabled_18i15_347",lg="_optionHighlight_18i15_357",ag="_optionCb_18i15_372",cg="_optionCbChecked_18i15_386",dg="_optionCbCheckmark_18i15_391",ug="_optionLabel_18i15_404",hg="_optionLabelHighlight_18i15_413",fg="_optionChipWrap_18i15_419",pg="_footer_18i15_428",mg="_noResults_18i15_440",Z={root:Nm,rootDisabled:Am,field:Tm,labelRow:Em,label:Mm,required:jm,trigger:Im,triggerOpen:Dm,triggerInvalid:Om,triggerDisabled:Lm,sm:Rm,lg:Bm,triggerContent:$m,placeholder:Pm,md:zm,chips:Fm,chevron:Hm,helperText:Wm,errorText:Vm,dropdown:Um,dropdownHeader:qm,hiddenInput:Km,selectAllWrap:Gm,cbBox:Jm,cbChecked:Ym,cbIndeterminate:Qm,cbCheckmark:Xm,cbDash:Zm,searchWrap:eg,searchIcon:tg,searchInput:ng,searchClear:rg,optionList:sg,option:ig,optionDisabled:og,optionHighlight:lg,optionCb:ag,optionCbChecked:cg,optionCbCheckmark:dg,optionLabel:ug,optionLabelHighlight:hg,optionChipWrap:fg,footer:pg,noResults:mg},Ad=x.forwardRef(({options:t,value:e,onChange:n,placeholder:r="Select options…",label:s,required:i=!1,helperText:o,invalid:l=!1,disabled:a=!1,filter:c=!0,filterPlaceholder:u="Search…",showSelectAll:h=!0,size:f="md",footer:p,className:m,style:g},b)=>{const y=x.useId(),_=`${y}-dropdown`,v=`${y}-trigger`,w=`${y}-helper`,[k,S]=x.useState(!1),[C,D]=x.useState(""),B=x.useRef(null),N=x.useRef(null),T=A=>{B.current=A,typeof b=="function"?b(A):b&&(b.current=A)},$=e??[],R=x.useMemo(()=>t.filter(A=>!A.disabled),[t]),L=R.length>0&&R.every(A=>$.includes(A.value)),V=!!R.some(A=>$.includes(A.value))&&!L;x.useEffect(()=>{if(!k)return;function A(q){var ne;(ne=B.current)!=null&&ne.contains(q.target)||(S(!1),D(""))}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[k]),x.useEffect(()=>{N.current&&(N.current.indeterminate=V)},[V]),x.useEffect(()=>{if(!k)return;function A(q){q.key==="Escape"&&(S(!1),D(""))}return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[k]);const M=x.useMemo(()=>{if(!c||!C)return t;const A=C.toLowerCase();return t.filter(q=>q.label.toLowerCase().includes(A))},[t,c,C]);function P(){a||S(A=>(A&&D(""),!A))}function H(A){const q=$.includes(A)?$.filter(ne=>ne!==A):[...$,A];n==null||n(q)}function ie(A){n==null||n($.filter(q=>q!==A))}function le(){const A=R.map(q=>q.value);L?n==null||n($.filter(q=>!A.includes(q))):n==null||n([...new Set([...$,...A])])}function Ae(A){A.key==="Enter"||A.key===" "?(A.preventDefault(),P()):A.key==="Escape"?(S(!1),D("")):A.key==="ArrowDown"&&!k&&(A.preventDefault(),S(!0))}const Ie=[Z.root,Z[f],a?Z.rootDisabled:"",m??""].filter(Boolean).join(" "),Be=[Z.trigger,k?Z.triggerOpen:"",l?Z.triggerInvalid:"",a?Z.triggerDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:T,className:Ie,style:g,children:[d.jsxs("div",{className:Z.field,children:[s&&d.jsxs("div",{className:Z.labelRow,children:[d.jsx("label",{className:Z.label,htmlFor:v,children:s}),i&&d.jsx("span",{className:Z.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{id:v,role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":_,"aria-required":i||void 0,"aria-invalid":l||void 0,"aria-describedby":o?w:void 0,"aria-disabled":a||void 0,tabIndex:a?-1:0,className:Be,onClick:P,onKeyDown:Ae,children:[d.jsx("span",{className:Z.triggerContent,children:$.length===0?d.jsx("span",{className:Z.placeholder,children:r}):d.jsx("span",{className:Z.chips,children:$.map(A=>{var ne;const q=t.find(xe=>xe.value===A);return q?d.jsx("span",{onMouseDown:xe=>xe.stopPropagation(),onClick:xe=>xe.stopPropagation(),children:d.jsx(Ys,{label:q.label,color:((ne=q.chip)==null?void 0:ne.color)??"blue-light",dismissible:!a,onDismiss:()=>ie(A)})},A):null})})}),d.jsx("span",{className:Z.chevron,"aria-hidden":"true",children:d.jsx("svg",{viewBox:"0 0 14 8",fill:"none",children:d.jsx("path",{d:"M1 1l6 6 6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),o&&d.jsx("span",{id:w,className:l?Z.errorText:Z.helperText,children:o})]}),k&&d.jsxs("div",{id:_,role:"listbox","aria-multiselectable":"true",className:Z.dropdown,children:[d.jsxs("div",{className:Z.dropdownHeader,children:[h&&d.jsxs("span",{className:Z.selectAllWrap,onClick:le,"aria-label":"Select all",role:"checkbox","aria-checked":L?!0:V?"mixed":!1,tabIndex:0,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),le())},children:[d.jsx("input",{ref:N,type:"checkbox",className:Z.hiddenInput,checked:L,onChange:le}),d.jsxs("span",{"aria-hidden":"true",className:[Z.cbBox,L?Z.cbChecked:"",V?Z.cbIndeterminate:""].filter(Boolean).join(" "),children:[L&&d.jsx("svg",{className:Z.cbCheckmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})}),V&&d.jsx("span",{className:Z.cbDash})]})]}),c&&d.jsxs("div",{className:Z.searchWrap,children:[d.jsx("span",{className:Z.searchIcon,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsx("input",{type:"text",className:Z.searchInput,placeholder:u,value:C,onChange:A=>D(A.target.value),"aria-label":"Filter options",autoComplete:"off"}),C&&d.jsx("button",{type:"button",className:Z.searchClear,onClick:()=>D(""),"aria-label":"Clear filter",tabIndex:-1,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 5l4 4M9 5l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]}),d.jsx("div",{className:Z.optionList,children:M.length===0?d.jsx("div",{className:Z.noResults,children:"No results"}):M.map(A=>{const q=$.includes(A.value),ne=A.disabled,xe=[Z.option,q?Z.optionHighlight:"",ne?Z.optionDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{role:"option","aria-selected":q,"aria-disabled":ne||void 0,className:xe,onClick:()=>!ne&&H(A.value),tabIndex:ne?-1:0,onKeyDown:$e=>{($e.key==="Enter"||$e.key===" ")&&!ne&&($e.preventDefault(),H(A.value))},children:[d.jsx("span",{"aria-hidden":"true",className:[Z.optionCb,q?Z.optionCbChecked:""].filter(Boolean).join(" "),children:q&&d.jsx("svg",{className:Z.optionCbCheckmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})}),A.chip?d.jsx("span",{className:Z.optionChipWrap,children:d.jsx(Ys,{label:A.label,color:A.chip.color,dismissible:!1})}):d.jsx("span",{className:q?`${Z.optionLabel} ${Z.optionLabelHighlight}`:Z.optionLabel,children:A.label})]},A.value)})}),p&&d.jsx("div",{className:Z.footer,children:p})]})]})});Ad.displayName="MultiSelect";const gg="_root_1t9zz_10",bg="_rootDisabled_1t9zz_18",yg="_field_1t9zz_24",xg="_labelRow_1t9zz_32",_g="_label_1t9zz_32",vg="_required_1t9zz_44",kg="_trigger_1t9zz_52",wg="_triggerOpen_1t9zz_68",Cg="_triggerDisabled_1t9zz_68",Sg="_triggerInvalid_1t9zz_68",Ng="_lg_1t9zz_91",Ag="_triggerContent_1t9zz_95",Tg="_placeholder_1t9zz_101",Eg="_triggerValue_1t9zz_113",Mg="_sm_1t9zz_138",jg="_md_1t9zz_140",Ig="_chevron_1t9zz_147",Dg="_chevronInvalid_1t9zz_167",Og="_chevronDisabled_1t9zz_172",Lg="_leadingIcon_1t9zz_178",Rg="_helperText_1t9zz_196",Bg="_errorText_1t9zz_203 _helperText_1t9zz_196",$g="_dropdown_1t9zz_210",Pg="_filterHeader_1t9zz_225",zg="_searchWrap_1t9zz_230",Fg="_searchIcon_1t9zz_241",Hg="_searchInput_1t9zz_255",Wg="_searchClear_1t9zz_271",Vg="_optionList_1t9zz_291",Ug="_option_1t9zz_291",qg="_optionDisabled_1t9zz_315",Kg="_optionHighlight_1t9zz_326",Gg="_optionLabel_1t9zz_337",Jg="_optionLabelHighlight_1t9zz_345",Yg="_noResults_1t9zz_351",ue={root:gg,rootDisabled:bg,field:yg,labelRow:xg,label:_g,required:vg,trigger:kg,triggerOpen:wg,triggerDisabled:Cg,triggerInvalid:Sg,lg:Ng,triggerContent:Ag,placeholder:Tg,triggerValue:Eg,sm:Mg,md:jg,chevron:Ig,chevronInvalid:Dg,chevronDisabled:Og,leadingIcon:Lg,helperText:Rg,errorText:Bg,dropdown:$g,filterHeader:Pg,searchWrap:zg,searchIcon:Fg,searchInput:Hg,searchClear:Wg,optionList:Vg,option:Ug,optionDisabled:qg,optionHighlight:Kg,optionLabel:Gg,optionLabelHighlight:Jg,noResults:Yg},Qg=d.jsx("i",{className:"pi pi-search"}),pr=x.forwardRef(({options:t,value:e,onChange:n,placeholder:r="Select…",label:s,required:i=!1,helperText:o,invalid:l=!1,disabled:a=!1,filter:c=!1,filterPlaceholder:u="Search…",size:h="md",leadingIcon:f,className:p,style:m},g)=>{const b=x.useId(),y=`${b}-dropdown`,_=`${b}-trigger`,v=`${b}-helper`,[w,k]=x.useState(!1),[S,C]=x.useState(""),D=x.useRef(null),B=x.useRef(null),N=x.useRef(null),[T,$]=x.useState(null),R=A=>{D.current=A,typeof g=="function"?g(A):g&&(g.current=A)},L=t.find(A=>A.value===e)??null;x.useEffect(()=>{if(!w)return;function A(q){var xe,$e;const ne=q.target;!((xe=D.current)!=null&&xe.contains(ne))&&!(($e=N.current)!=null&&$e.contains(ne))&&(k(!1),C(""))}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[w]),x.useEffect(()=>{if(!w)return;function A(){var ne;const q=(ne=B.current)==null?void 0:ne.getBoundingClientRect();q&&$({top:q.bottom+2,left:q.left,width:q.width})}return A(),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),()=>{window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A)}},[w]),x.useEffect(()=>{if(!w)return;function A(q){q.key==="Escape"&&(k(!1),C(""))}return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[w]);const U=x.useRef(!1);x.useLayoutEffect(()=>{var q;if(!w){U.current=!1;return}if(!T||U.current)return;const A=(q=N.current)==null?void 0:q.querySelector('[role="option"][aria-selected="true"]');A&&(A.scrollIntoView({block:"start"}),U.current=!0)},[w,T]);const V=x.useMemo(()=>{if(!c||!S)return t;const A=S.toLowerCase();return t.filter(q=>q.label.toLowerCase().includes(A))},[t,c,S]);function M(){a||k(A=>(A&&C(""),!A))}function P(A){n==null||n(A),k(!1),C("")}function H(A){A.key==="Enter"||A.key===" "?(A.preventDefault(),M()):A.key==="Escape"?(k(!1),C("")):A.key==="ArrowDown"&&!w&&(A.preventDefault(),k(!0))}const ie=!!L,le=f===!0?Qg:f||null,Ae=[ue.root,ue[h],a?ue.rootDisabled:"",p??""].filter(Boolean).join(" "),Ie=[ue.trigger,w?ue.triggerOpen:"",l?ue.triggerInvalid:"",a?ue.triggerDisabled:"",ie&&!l&&!a?ue.triggerFilled:""].filter(Boolean).join(" "),Be=[ue.chevron,l?ue.chevronInvalid:"",a?ue.chevronDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:R,className:Ae,style:m,children:[d.jsxs("div",{className:ue.field,children:[s&&d.jsxs("div",{className:ue.labelRow,children:[d.jsx("label",{className:ue.label,htmlFor:_,children:s}),i&&d.jsx("span",{className:ue.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{ref:B,id:_,role:"combobox","aria-haspopup":"listbox","aria-expanded":w,"aria-controls":y,"aria-required":i||void 0,"aria-invalid":l||void 0,"aria-describedby":o?v:void 0,"aria-disabled":a||void 0,tabIndex:a?-1:0,className:Ie,onClick:M,onKeyDown:H,children:[le&&d.jsx("span",{className:ue.leadingIcon,"aria-hidden":"true",children:le}),d.jsx("span",{className:ue.triggerContent,children:L?d.jsx("span",{className:ue.triggerValue,children:L.label}):d.jsx("span",{className:ue.placeholder,children:r})}),d.jsx("span",{className:Be,"aria-hidden":"true",children:d.jsx("svg",{viewBox:"0 0 14 8",fill:"none",children:d.jsx("path",{d:"M1 1l6 6 6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),o&&d.jsx("span",{id:v,className:l?ue.errorText:ue.helperText,children:o})]}),w&&T&&qt.createPortal(d.jsxs("div",{ref:N,"data-popover-root":"",id:y,role:"listbox",className:ue.dropdown,style:{top:T.top,left:T.left,width:T.width},children:[c&&d.jsx("div",{className:ue.filterHeader,children:d.jsxs("div",{className:ue.searchWrap,children:[d.jsx("span",{className:ue.searchIcon,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsx("input",{type:"text",className:ue.searchInput,placeholder:u,value:S,onChange:A=>C(A.target.value),"aria-label":"Filter options",autoComplete:"off"}),S&&d.jsx("button",{type:"button",className:ue.searchClear,onClick:()=>C(""),"aria-label":"Clear filter",tabIndex:-1,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 5l4 4M9 5l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}),d.jsx("div",{className:ue.optionList,children:V.length===0?d.jsx("div",{className:ue.noResults,children:"No results"}):V.map(A=>{const q=A.value===e,ne=A.disabled,xe=[ue.option,q?ue.optionHighlight:"",ne?ue.optionDisabled:""].filter(Boolean).join(" ");return d.jsx("div",{role:"option","aria-selected":q,"aria-disabled":ne||void 0,className:xe,onClick:()=>!ne&&P(A.value),tabIndex:ne?-1:0,onKeyDown:$e=>{($e.key==="Enter"||$e.key===" ")&&!ne&&($e.preventDefault(),P(A.value))},children:d.jsx("span",{className:q?`${ue.optionLabel} ${ue.optionLabelHighlight}`:ue.optionLabel,children:A.label})},A.value)})})]}),document.body)]})});pr.displayName="Select";const Xg="_btn_1wdnr_7",Zg="_disabled_1wdnr_21",eb="_sm_1wdnr_27",tb="_md_1wdnr_33",nb="_lg_1wdnr_39",rb="_icon_1wdnr_47",sb="_primary_1wdnr_59",ib="_secondary_1wdnr_68",ob="_ghost_1wdnr_78",lb="_danger_1wdnr_87",Tr={btn:Xg,disabled:Zg,sm:eb,md:tb,lg:nb,icon:rb,primary:sb,secondary:ib,ghost:ob,danger:lb},ab="_wrapper_wreg1_4",cb="_tooltip_wreg1_17",db="_placement_top_wreg1_59",ub="_placement_bottom_wreg1_69",hb="_placement_left_wreg1_79",fb="_placement_right_wreg1_89",oo={wrapper:ab,tooltip:cb,placement_top:db,placement_bottom:ub,placement_left:hb,placement_right:fb},Cs=8,Ss=44;function er({content:t,children:e,placement:n="top",delay:r=200,disabled:s=!1,maxWidth:i=140,className:o}){const[l,a]=x.useState(null),c=x.useRef(null),u=x.useRef(null),h=x.useId(),f=l!==null,p=x.useCallback(()=>{const y=c.current;if(!y)return null;const _=y.getBoundingClientRect(),v=window.innerWidth,w=window.innerHeight;let k=n;k==="top"&&_.top<Ss?k="bottom":k==="bottom"&&w-_.bottom<Ss?k="top":k==="left"&&_.left<Ss?k="right":k==="right"&&v-_.right<Ss&&(k="left");const S=_.left+_.width/2,C=_.top+_.height/2;switch(k){case"bottom":return{top:_.bottom+Cs,left:S,transform:"translate(-50%, 0)",placement:k};case"left":return{top:C,left:_.left-Cs,transform:"translate(-100%, -50%)",placement:k};case"right":return{top:C,left:_.right+Cs,transform:"translate(0, -50%)",placement:k};case"top":default:return{top:_.top-Cs,left:S,transform:"translate(-50%, -100%)",placement:k}}},[n]),m=()=>{s||(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>a(p()),r))},g=()=>{u.current&&clearTimeout(u.current),a(null)};x.useLayoutEffect(()=>{if(!f)return;const y=()=>a(p()),_={capture:!0,passive:!0};return window.addEventListener("scroll",y,_),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,_),window.removeEventListener("resize",y)}},[f,p]),x.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const b=[oo.tooltip,oo[`placement_${(l==null?void 0:l.placement)??n}`],o??""].filter(Boolean).join(" ");return d.jsxs("span",{ref:c,className:oo.wrapper,onMouseEnter:m,onMouseLeave:g,onFocus:m,onBlur:g,children:[d.jsx("span",{"aria-describedby":f?h:void 0,children:e}),f&&l&&typeof document<"u"&&qt.createPortal(d.jsx("div",{id:h,role:"tooltip",className:b,style:{maxWidth:i,top:l.top,left:l.left,transform:l.transform},"aria-hidden":!1,children:t}),document.body)]})}er.displayName="Tooltip";const ut=x.forwardRef(({icon:t,variant:e="primary",size:n="md",className:r,disabled:s,tooltipPlacement:i="top","aria-label":o,...l},a)=>{const c=[Tr.btn,Tr[e],Tr[n],s?Tr.disabled:"",r??""].filter(Boolean).join(" ");return d.jsx(er,{content:o,placement:i,children:d.jsx("button",{ref:a,className:c,disabled:s,"aria-label":o,...l,children:d.jsx("span",{className:Tr.icon,"aria-hidden":"true",children:t})})})});ut.displayName="IconButton";const pb="_root_k08lc_10",mb="_field_k08lc_20",gb="_labelRow_k08lc_28",bb="_label_k08lc_28",yb="_required_k08lc_40",xb="_inputWrap_k08lc_48",_b="_inputWrapDisabled_k08lc_60",vb="_inputWrapInvalid_k08lc_60",kb="_inputWrapOpen_k08lc_65",wb="_input_k08lc_48",Cb="_calIconBtn_k08lc_102",Sb="_helperText_k08lc_128",Nb="_errorText_k08lc_135 _helperText_k08lc_128",Ab="_calendar_k08lc_144",Tb="_calHeader_k08lc_161",Eb="_titleGroup_k08lc_171",Mb="_titleBtn_k08lc_178",jb="_titleText_k08lc_196",Ib="_dayView_k08lc_207",Db="_weekRow_k08lc_212",Ob="_weekRowWithWk_k08lc_217",Lb="_weekdayCell_k08lc_223",Rb="_wkLabel_k08lc_233",Bb="_cell_k08lc_239",$b="_wkCell_k08lc_252",Pb="_cellDisabled_k08lc_262",zb="_dayCircle_k08lc_262",Fb="_cellOutside_k08lc_277",Hb="_cellSelected_k08lc_292",Wb="_cellToday_k08lc_297",Vb="_dayCircleSelected_k08lc_320",Ub="_dayCircleToday_k08lc_326",qb="_monthGrid_k08lc_335",Kb="_monthCell_k08lc_342",Gb="_monthCellSelected_k08lc_356",Jb="_yearGrid_k08lc_373",Yb="_yearCell_k08lc_380",Qb="_yearCellSelected_k08lc_394",Xb="_footer_k08lc_411",Zb="_clearBtn_k08lc_421",ey="_todayBtn_k08lc_442",Y={root:pb,field:mb,labelRow:gb,label:bb,required:yb,inputWrap:xb,inputWrapDisabled:_b,inputWrapInvalid:vb,inputWrapOpen:kb,input:wb,calIconBtn:Cb,helperText:Sb,errorText:Nb,calendar:Ab,calHeader:Tb,titleGroup:Eb,titleBtn:Mb,titleText:jb,dayView:Ib,weekRow:Db,weekRowWithWk:Ob,weekdayCell:Lb,wkLabel:Rb,cell:Bb,wkCell:$b,cellDisabled:Pb,dayCircle:zb,cellOutside:Fb,cellSelected:Hb,cellToday:Wb,dayCircleSelected:Vb,dayCircleToday:Ub,monthGrid:qb,monthCell:Kb,monthCellSelected:Gb,yearGrid:Jb,yearCell:Yb,yearCellSelected:Qb,footer:Xb,clearBtn:Zb,todayBtn:ey},ty=["Su","Mo","Tu","We","Th","Fr","Sa"],Aa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ns(t){const e=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${e}/${n}/${t.getFullYear()}`}function Ta(t){const e=t.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(!e)return null;const n=parseInt(e[1],10)-1,r=parseInt(e[2],10),s=parseInt(e[3],10);if(n<0||n>11||r<1||r>31||s<1e3)return null;const i=new Date(s,n,r);return i.getFullYear()!==s||i.getMonth()!==n||i.getDate()!==r?null:i}function Er(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function As(t,e,n){if(e){const r=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t<r)return!0}if(n){const r=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(t>r)return!0}return!1}function ny(t,e){const n=new Date(t,e,1),r=new Date(t,e+1,0),s=new Date(n);s.setDate(s.getDate()-s.getDay());const i=new Date(r);i.setDate(i.getDate()+(6-i.getDay()));const o=[],l=new Date(s);for(;l<=i;){const a=[];for(let c=0;c<7;c++)a.push(new Date(l)),l.setDate(l.getDate()+1);o.push(a)}return o}function ry(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const n=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)}function lo(t){return Math.floor(t/8)*8}const sy=()=>d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{x:"1",y:"2.5",width:"12",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M1 6h12",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),iy=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),oy=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Tl=x.forwardRef(({value:t,onChange:e,label:n,required:r=!1,helperText:s,invalid:i=!1,disabled:o=!1,placeholder:l="MM/DD/YYYY",minDate:a,maxDate:c,showWeekNumbers:u=!0,id:h,className:f,style:p},m)=>{const g=x.useId(),b=h??`${g}-input`,y=`${g}-helper`,[_,v]=x.useState(!1),[w,k]=x.useState("day"),[S,C]=x.useState(()=>(t==null?void 0:t.getFullYear())??new Date().getFullYear()),[D,B]=x.useState(()=>(t==null?void 0:t.getMonth())??new Date().getMonth()),[N,T]=x.useState(()=>t?Ns(t):""),$=x.useRef(null),R=x.useRef(null),L=x.useRef(null),U=x.useRef(null),[V,M]=x.useState(null),P=O=>{$.current=O,typeof m=="function"?m(O):m&&(m.current=O)},H=new Date;H.setHours(0,0,0,0),x.useEffect(()=>{const O=t?Ns(t):"";R.current!==document.activeElement&&T(O),t&&(C(t.getFullYear()),B(t.getMonth()))},[t]),x.useEffect(()=>{if(!_)return;function O(X){var ve,_t;const pe=X.target;!((ve=$.current)!=null&&ve.contains(pe))&&!((_t=U.current)!=null&&_t.contains(pe))&&le()}return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[_]),x.useEffect(()=>{if(!_)return;function O(){var pe;const X=(pe=L.current)==null?void 0:pe.getBoundingClientRect();X&&M({top:X.bottom+4,left:X.left})}return O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O)}},[_]),x.useEffect(()=>{if(!_)return;function O(X){X.key==="Escape"&&le()}return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[_]);function ie(){o||v(O=>(O||k("day"),!0))}function le(){v(!1),k("day")}function Ae(){w==="day"?D===0?(B(11),C(O=>O-1)):B(O=>O-1):C(w==="month"?O=>O-1:O=>lo(O)-8)}function Ie(){w==="day"?D===11?(B(0),C(O=>O+1)):B(O=>O+1):C(w==="month"?O=>O+1:O=>lo(O)+8)}function Be(O){As(O,a,c)||((O.getMonth()!==D||O.getFullYear()!==S)&&(B(O.getMonth()),C(O.getFullYear())),e==null||e(O),T(Ns(O)),le())}function A(O){B(O),k("day")}function q(O){C(O),k("month")}function ne(){const O=new Date;O.setHours(0,0,0,0),!As(O,a,c)&&(e==null||e(O),T(Ns(O)),C(O.getFullYear()),B(O.getMonth()),le())}function xe(){e==null||e(null),T("")}function $e(O){const X=O.target.value;if(T(X),X===""){e==null||e(null);return}const pe=Ta(X);pe&&(C(pe.getFullYear()),B(pe.getMonth()),e==null||e(pe))}function Bt(O){if(O.key==="Enter"){const X=Ta(N);X&&(e==null||e(X),le())}}function Dt(O,X){const pe=[Y.cell],ve=Er(O,H),_t=t?Er(O,t):!1,ft=As(O,a,c);return X||pe.push(Y.cellOutside),ft&&pe.push(Y.cellDisabled),_t?pe.push(Y.cellSelected):ve&&pe.push(Y.cellToday),pe.filter(Boolean).join(" ")}function rr(O){const X=[Y.dayCircle],pe=t?Er(O,t):!1,ve=Er(O,H);return pe?X.push(Y.dayCircleSelected):ve&&X.push(Y.dayCircleToday),X.join(" ")}function an(O){const X=[Y.monthCell];return t&&t.getMonth()===O&&t.getFullYear()===S&&X.push(Y.monthCellSelected),X.join(" ")}function $t(O){const X=[Y.yearCell];return t&&t.getFullYear()===O&&X.push(Y.yearCellSelected),X.join(" ")}const Pt=ny(S,D),Gt=lo(S),Cr=Array.from({length:8},(O,X)=>Gt+X),sr=()=>w==="day"?d.jsxs("div",{className:Y.titleGroup,children:[d.jsx("button",{type:"button",className:Y.titleBtn,onClick:()=>k("month"),children:Aa[D]}),d.jsx("button",{type:"button",className:Y.titleBtn,onClick:()=>k("year"),children:S})]}):w==="month"?d.jsx("span",{className:Y.titleText,children:S}):d.jsxs("span",{className:Y.titleText,children:[Gt," – ",Gt+7]}),Sr=[Y.inputWrap,_?Y.inputWrapOpen:"",i?Y.inputWrapInvalid:"",o?Y.inputWrapDisabled:""].filter(Boolean).join(" "),G=[Y.root,f??""].filter(Boolean).join(" ");return d.jsxs("div",{ref:P,className:G,style:p,children:[d.jsxs("div",{className:Y.field,children:[n&&d.jsxs("div",{className:Y.labelRow,children:[d.jsx("label",{className:Y.label,htmlFor:b,children:n}),r&&d.jsx("span",{className:Y.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{ref:L,className:Sr,children:[d.jsx("input",{ref:R,id:b,type:"text",className:Y.input,value:N,placeholder:l,disabled:o,required:r,"aria-invalid":i||void 0,"aria-describedby":s?y:void 0,onChange:$e,onFocus:ie,onKeyDown:Bt,autoComplete:"off"}),d.jsx("button",{type:"button",className:Y.calIconBtn,onClick:()=>_?le():ie(),tabIndex:-1,"aria-label":_?"Close calendar":"Open calendar",disabled:o,children:d.jsx(sy,{})})]}),s&&d.jsx("span",{id:y,className:i?Y.errorText:Y.helperText,children:s})]}),_&&V&&qt.createPortal(d.jsxs("div",{ref:U,"data-popover-root":"",className:Y.calendar,style:{top:V.top,left:V.left},role:"dialog","aria-label":"Date picker",children:[d.jsxs("div",{className:Y.calHeader,children:[d.jsx(ut,{icon:d.jsx(iy,{}),variant:"ghost",size:"sm",onClick:Ae,"aria-label":"Previous"}),sr(),d.jsx(ut,{icon:d.jsx(oy,{}),variant:"ghost",size:"sm",onClick:Ie,"aria-label":"Next"})]}),w==="day"&&d.jsxs("div",{className:Y.dayView,children:[d.jsxs("div",{className:u?Y.weekRowWithWk:Y.weekRow,children:[u&&d.jsx("div",{className:`${Y.weekdayCell} ${Y.wkLabel}`,children:"Wk"}),ty.map(O=>d.jsx("div",{className:Y.weekdayCell,children:O},O))]}),Pt.map((O,X)=>{const pe=ve=>ve.getMonth()===D&&ve.getFullYear()===S;return d.jsxs("div",{className:u?Y.weekRowWithWk:Y.weekRow,children:[u&&d.jsx("div",{className:`${Y.cell} ${Y.wkCell}`,children:ry(O[0])}),O.map((ve,_t)=>{const ft=As(ve,a,c);return d.jsx("div",{className:Dt(ve,pe(ve)),onClick:()=>!ft&&Be(ve),role:"button",tabIndex:ft?-1:0,"aria-label":ve.toDateString(),"aria-pressed":t?Er(ve,t):!1,"aria-disabled":ft||void 0,onKeyDown:Jt=>{(Jt.key==="Enter"||Jt.key===" ")&&!ft&&(Jt.preventDefault(),Be(ve))},children:d.jsx("div",{className:rr(ve),children:ve.getDate()})},_t)})]},X)})]}),w==="month"&&d.jsx("div",{className:Y.monthGrid,children:Aa.map((O,X)=>d.jsx("div",{className:an(X),onClick:()=>A(X),role:"button",tabIndex:0,onKeyDown:pe=>{(pe.key==="Enter"||pe.key===" ")&&(pe.preventDefault(),A(X))},children:O},O))}),w==="year"&&d.jsx("div",{className:Y.yearGrid,children:Cr.map(O=>d.jsx("div",{className:$t(O),onClick:()=>q(O),role:"button",tabIndex:0,onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),q(O))},children:O},O))}),w==="day"&&d.jsxs("div",{className:Y.footer,children:[d.jsx("button",{type:"button",className:Y.clearBtn,onClick:xe,children:"Clear"}),d.jsx("button",{type:"button",className:Y.todayBtn,onClick:ne,children:"Today"})]})]}),document.body)]})});Tl.displayName="DatePicker";const ly="_calendar_1smvj_7",ay="_plain_1smvj_20",cy="_calHeader_1smvj_29",dy="_titleGroup_1smvj_38",uy="_titleBtn_1smvj_45",hy="_titleText_1smvj_63",fy="_dayView_1smvj_74",py="_weekRow_1smvj_79",my="_weekRowWithWk_1smvj_84",gy="_weekdayCell_1smvj_90",by="_wkLabel_1smvj_100",yy="_cell_1smvj_106",xy="_wkCell_1smvj_119",_y="_cellDisabled_1smvj_129",vy="_dayCircle_1smvj_129",ky="_cellOutside_1smvj_144",wy="_cellSelected_1smvj_159",Cy="_cellToday_1smvj_163",Sy="_dayCircleSelected_1smvj_185",Ny="_dayCircleToday_1smvj_191",Ay="_monthGrid_1smvj_200",Ty="_monthCell_1smvj_207",Ey="_monthCellSelected_1smvj_221",My="_yearGrid_1smvj_238",jy="_yearCell_1smvj_245",Iy="_yearCellSelected_1smvj_259",he={calendar:ly,plain:ay,calHeader:cy,titleGroup:dy,titleBtn:uy,titleText:hy,dayView:fy,weekRow:py,weekRowWithWk:my,weekdayCell:gy,wkLabel:by,cell:yy,wkCell:xy,cellDisabled:_y,dayCircle:vy,cellOutside:ky,cellSelected:wy,cellToday:Cy,dayCircleSelected:Sy,dayCircleToday:Ny,monthGrid:Ay,monthCell:Ty,monthCellSelected:Ey,yearGrid:My,yearCell:jy,yearCellSelected:Iy},Dy=["Su","Mo","Tu","We","Th","Fr","Sa"],Ea=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Mr(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function ao(t,e,n){if(e){const r=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t<r)return!0}if(n){const r=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(t>r)return!0}return!1}function Oy(t,e){const n=new Date(t,e,1),r=new Date(t,e+1,0),s=new Date(n);s.setDate(s.getDate()-s.getDay());const i=new Date(r);i.setDate(i.getDate()+(6-i.getDay()));const o=[],l=new Date(s);for(;l<=i;){const a=[];for(let c=0;c<7;c++)a.push(new Date(l)),l.setDate(l.getDate()+1);o.push(a)}return o}function Ly(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const n=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)}function co(t){return Math.floor(t/8)*8}const Ry=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),By=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Td=x.forwardRef(({value:t,onChange:e,minDate:n,maxDate:r,showWeekNumbers:s=!1,variant:i="card",defaultMonth:o,id:l,className:a,style:c},u)=>{const h=t??o??new Date,[f,p]=x.useState("day"),[m,g]=x.useState(h.getFullYear()),[b,y]=x.useState(h.getMonth()),_=new Date;_.setHours(0,0,0,0),x.useEffect(()=>{t&&(g(t.getFullYear()),y(t.getMonth()))},[t]);function v(){f==="day"?b===0?(y(11),g(M=>M-1)):y(M=>M-1):g(f==="month"?M=>M-1:M=>co(M)-8)}function w(){f==="day"?b===11?(y(0),g(M=>M+1)):y(M=>M+1):g(f==="month"?M=>M+1:M=>co(M)+8)}function k(M){ao(M,n,r)||((M.getMonth()!==b||M.getFullYear()!==m)&&(y(M.getMonth()),g(M.getFullYear())),e==null||e(M))}function S(M){y(M),p("day")}function C(M){g(M),p("month")}function D(M,P){const H=[he.cell],ie=Mr(M,_),le=t?Mr(M,t):!1,Ae=ao(M,n,r);return P||H.push(he.cellOutside),Ae&&H.push(he.cellDisabled),le?H.push(he.cellSelected):ie&&H.push(he.cellToday),H.filter(Boolean).join(" ")}function B(M){const P=[he.dayCircle],H=t?Mr(M,t):!1,ie=Mr(M,_);return H?P.push(he.dayCircleSelected):ie&&P.push(he.dayCircleToday),P.join(" ")}function N(M){const P=[he.monthCell];return t&&t.getMonth()===M&&t.getFullYear()===m&&P.push(he.monthCellSelected),P.join(" ")}function T(M){const P=[he.yearCell];return t&&t.getFullYear()===M&&P.push(he.yearCellSelected),P.join(" ")}const $=Oy(m,b),R=co(m),L=Array.from({length:8},(M,P)=>R+P),U=()=>f==="day"?d.jsxs("div",{className:he.titleGroup,children:[d.jsx("button",{type:"button",className:he.titleBtn,onClick:()=>p("month"),children:Ea[b]}),d.jsx("button",{type:"button",className:he.titleBtn,onClick:()=>p("year"),children:m})]}):f==="month"?d.jsx("span",{className:he.titleText,children:m}):d.jsxs("span",{className:he.titleText,children:[R," – ",R+7]}),V=[he.calendar,i==="plain"?he.plain:"",a].filter(Boolean).join(" ");return d.jsxs("div",{ref:u,id:l,className:V,style:c,role:"group","aria-label":"Calendar",children:[d.jsxs("div",{className:he.calHeader,children:[d.jsx(ut,{icon:d.jsx(Ry,{}),variant:"ghost",size:"sm",onClick:v,"aria-label":"Previous"}),U(),d.jsx(ut,{icon:d.jsx(By,{}),variant:"ghost",size:"sm",onClick:w,"aria-label":"Next"})]}),f==="day"&&d.jsxs("div",{className:he.dayView,children:[d.jsxs("div",{className:s?he.weekRowWithWk:he.weekRow,children:[s&&d.jsx("div",{className:`${he.weekdayCell} ${he.wkLabel}`,children:"Wk"}),Dy.map(M=>d.jsx("div",{className:he.weekdayCell,children:M},M))]}),$.map((M,P)=>{const H=ie=>ie.getMonth()===b&&ie.getFullYear()===m;return d.jsxs("div",{className:s?he.weekRowWithWk:he.weekRow,children:[s&&d.jsx("div",{className:`${he.cell} ${he.wkCell}`,children:Ly(M[0])}),M.map((ie,le)=>{const Ae=ao(ie,n,r);return d.jsx("div",{className:D(ie,H(ie)),onClick:()=>!Ae&&k(ie),role:"button",tabIndex:Ae?-1:0,"aria-label":ie.toDateString(),"aria-pressed":t?Mr(ie,t):!1,"aria-disabled":Ae||void 0,onKeyDown:Ie=>{(Ie.key==="Enter"||Ie.key===" ")&&!Ae&&(Ie.preventDefault(),k(ie))},children:d.jsx("div",{className:B(ie),children:ie.getDate()})},le)})]},P)})]}),f==="month"&&d.jsx("div",{className:he.monthGrid,children:Ea.map((M,P)=>d.jsx("div",{className:N(P),onClick:()=>S(P),role:"button",tabIndex:0,onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),S(P))},children:M},M))}),f==="year"&&d.jsx("div",{className:he.yearGrid,children:L.map(M=>d.jsx("div",{className:T(M),onClick:()=>C(M),role:"button",tabIndex:0,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),C(M))},children:M},M))})]})});Td.displayName="Calendar";const $y="_root_1eg8k_9",Py="_labelRow_1eg8k_18",zy="_label_1eg8k_18",Fy="_required_1eg8k_30",Hy="_group_1eg8k_41",Wy="_btn_1eg8k_50",Vy="_btnSelected_1eg8k_76",Uy="_btnDisabled_1eg8k_76",qy="_count_1eg8k_109",Ky="_btnLabel_1eg8k_118",Gy="_optionIcon_1eg8k_122",Jy="_splitButton_1eg8k_134",Yy="_splitButtonDisabled_1eg8k_143",Qy="_splitMain_1eg8k_149",Xy="_placeholder_1eg8k_179",Zy="_splitChevron_1eg8k_185",e1="_chevronIcon_1eg8k_205",t1="_dropdown_1eg8k_214",n1="_dropdownRow_1eg8k_230",r1="_dropdownRowSelected_1eg8k_245",s1="_dropdownLabelSelected_1eg8k_259",i1="_sizeSm_1eg8k_268",o1="_sizeMd_1eg8k_275",l1="_sizeLg_1eg8k_282",ae={root:$y,labelRow:Py,label:zy,required:Fy,group:Hy,btn:Wy,btnSelected:Vy,btnDisabled:Uy,count:qy,btnLabel:Ky,optionIcon:Gy,splitButton:Jy,splitButtonDisabled:Yy,splitMain:Qy,placeholder:Xy,splitChevron:Zy,chevronIcon:e1,dropdown:t1,dropdownRow:n1,dropdownRowSelected:r1,dropdownLabelSelected:s1,sizeSm:i1,sizeMd:o1,sizeLg:l1},a1="_badge_1nnlp_1",c1="_xs_1nnlp_19",d1="_normal_1nnlp_24",u1="_large_1nnlp_29",h1="_dot_1nnlp_36",f1="_secondary_1nnlp_42",p1="_success_1nnlp_47",m1="_info_1nnlp_52",g1="_warning_1nnlp_57",b1="_danger_1nnlp_62",y1="_contrast_1nnlp_67",Ts={badge:a1,xs:c1,normal:d1,large:u1,dot:h1,secondary:f1,success:p1,info:m1,warning:g1,danger:b1,contrast:y1},vr=x.forwardRef(({value:t,severity:e="secondary",size:n="normal",className:r,...s},i)=>{const o=n==="xs"||t===void 0||t===null||t==="",l=[Ts.badge,Ts[e],Ts[n],o?Ts.dot:"",r].filter(Boolean).join(" ");return d.jsx("span",{ref:i,className:l,...s,children:!o&&t})});vr.displayName="Badge";function uo({opt:t,labelClassName:e,countClassName:n,iconClassName:r}){return d.jsxs(d.Fragment,{children:[t.icon&&d.jsx("span",{className:r,"aria-hidden":"true",children:t.icon}),d.jsx("span",{className:e,children:t.label}),t.count!==void 0&&d.jsx("span",{className:n,children:t.count}),t.badge&&d.jsx(vr,{value:t.badge.value,severity:"danger",size:"normal",style:{"--c-bg":t.badge.color},"aria-label":`${t.badge.value}`})]})}const El=x.forwardRef(({options:t,value:e,onChange:n,variant:r="group",size:s="md",label:i,required:o=!1,disabled:l=!1,placeholder:a="Select…",className:c,style:u},h)=>{const f=x.useId(),[p,m]=x.useState(!1),g=x.useRef(null),b=k=>{g.current=k,typeof h=="function"?h(k):h&&(h.current=k)};x.useEffect(()=>{if(!p)return;function k(S){var C;(C=g.current)!=null&&C.contains(S.target)||m(!1)}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[p]),x.useEffect(()=>{if(!p)return;function k(S){S.key==="Escape"&&m(!1)}return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[p]);const y=t.find(k=>k.value===e)??null;function _(k){l||(n==null||n(k),m(!1))}const v=s==="sm"?ae.sizeSm:s==="lg"?ae.sizeLg:ae.sizeMd,w=[ae.root,v,c??""].filter(Boolean).join(" ");return r==="group"?d.jsxs("div",{ref:b,className:w,style:u,children:[i&&d.jsxs("div",{className:ae.labelRow,children:[d.jsx("span",{className:ae.label,children:i}),o&&d.jsx("span",{className:ae.required,"aria-hidden":"true",children:"*"})]}),d.jsx("div",{className:ae.group,role:"group","aria-label":i??"Select button group","aria-disabled":l||void 0,children:t.map((k,S)=>{const C=S===0,D=S===t.length-1,B=k.value===e,N=t.length===1?ae.btnSingle:C?ae.btnLeft:D?ae.btnRight:ae.btnMiddle,T=[ae.btn,N,B?ae.btnSelected:"",l?ae.btnDisabled:""].filter(Boolean).join(" ");return d.jsx("button",{id:`${f}-${k.value}`,type:"button",className:T,onClick:()=>_(k.value),"aria-pressed":B,disabled:l,children:d.jsx(uo,{opt:k,labelClassName:ae.btnLabel,countClassName:ae.count,iconClassName:ae.optionIcon})},k.value)})})]}):d.jsxs("div",{ref:b,className:w,style:u,children:[i&&d.jsxs("div",{className:ae.labelRow,children:[d.jsx("span",{className:ae.label,children:i}),o&&d.jsx("span",{className:ae.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:[ae.splitButton,l?ae.splitButtonDisabled:""].filter(Boolean).join(" "),"aria-disabled":l||void 0,children:[d.jsx("button",{type:"button",className:ae.splitMain,onClick:()=>!l&&m(k=>!k),"aria-haspopup":"listbox","aria-expanded":p,disabled:l,children:y?d.jsx(uo,{opt:y,labelClassName:ae.btnLabel,countClassName:ae.count,iconClassName:ae.optionIcon}):d.jsx("span",{className:ae.placeholder,children:a})}),d.jsx("button",{type:"button",className:ae.splitChevron,onClick:()=>!l&&m(k=>!k),"aria-label":p?"Close options":"Open options",tabIndex:-1,disabled:l,children:d.jsx("span",{className:ae.chevronIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})}),p&&d.jsx("div",{role:"listbox","aria-label":i??"Options",className:ae.dropdown,children:t.map(k=>{const S=k.value===e,C=[ae.dropdownRow,S?ae.dropdownRowSelected:""].filter(Boolean).join(" ");return d.jsx("div",{role:"option","aria-selected":S,className:C,onClick:()=>_(k.value),tabIndex:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),_(k.value))},children:d.jsx(uo,{opt:k,labelClassName:S?`${ae.btnLabel} ${ae.dropdownLabelSelected}`:ae.btnLabel,countClassName:ae.count,iconClassName:ae.optionIcon})},k.value)})})]})]})});El.displayName="SelectButton";const x1="_root_1rs6v_8",_1="_labelRow_1rs6v_17",v1="_label_1rs6v_17",k1="_required_1rs6v_29",w1="_outer_1rs6v_37",C1="_inner_1rs6v_46",S1="_innerDisabled_1rs6v_57",N1="_innerInvalid_1rs6v_57",A1="_leadingIcon_1rs6v_95",T1="_innerWithLeadingIcon_1rs6v_105",E1="_textareaWithLeadingIcon_1rs6v_110",M1="_textarea_1rs6v_110",j1="_textareaAutoGrow_1rs6v_148",I1="_bottomRow_1rs6v_156",D1="_helperText_1rs6v_165",O1="_errorText_1rs6v_172 _helperText_1rs6v_165",L1="_counter_1rs6v_179",R1="_innerWithCounter_1rs6v_190",B1="_textareaWithInnerCounter_1rs6v_195",$1="_counterInside_1rs6v_200 _counter_1rs6v_179",Pe={root:x1,labelRow:_1,label:v1,required:k1,outer:w1,inner:C1,innerDisabled:S1,innerInvalid:N1,leadingIcon:A1,innerWithLeadingIcon:T1,textareaWithLeadingIcon:E1,textarea:M1,textareaAutoGrow:j1,bottomRow:I1,helperText:D1,errorText:O1,counter:L1,innerWithCounter:R1,textareaWithInnerCounter:B1,counterInside:$1},P1=d.jsx("i",{className:"pi pi-pencil"}),Ed=x.forwardRef(({label:t,showLabel:e=!0,required:n=!1,helperText:r,invalid:s=!1,rows:i=3,autoGrow:o=!1,disabled:l=!1,maxLength:a,counterPlacement:c="outside",leadingIcon:u,id:h,className:f,style:p,value:m,defaultValue:g,onChange:b,...y},_)=>{const v=x.useId(),w=h??`${v}-textarea`,k=`${v}-helper`,S=x.useRef(null),C=_??S,[D,B]=x.useState(()=>m!==void 0?String(m??"").length:g!==void 0?String(g??"").length:0);x.useEffect(()=>{m!==void 0&&B(String(m??"").length)},[m]),x.useEffect(()=>{if(!o||!C.current)return;const M=C.current;M.style.height="auto",M.style.height=`${M.scrollHeight}px`},[o,m,D,C]);function N(M){B(M.target.value.length),b==null||b(M)}const T=a!==void 0,$=c==="inside",R=u===!0?P1:u||null,L=Pe.outer,U=[Pe.inner,s?Pe.innerInvalid:"",l?Pe.innerDisabled:"",$&&T?Pe.innerWithCounter:"",R?Pe.innerWithLeadingIcon:""].filter(Boolean).join(" "),V=[Pe.textarea,o?Pe.textareaAutoGrow:"",$&&T?Pe.textareaWithInnerCounter:"",R?Pe.textareaWithLeadingIcon:""].filter(Boolean).join(" ");return d.jsxs("div",{className:[Pe.root,f??""].filter(Boolean).join(" "),style:p,children:[t&&e&&d.jsxs("div",{className:Pe.labelRow,children:[d.jsx("label",{className:Pe.label,htmlFor:w,children:t}),n&&d.jsx("span",{className:Pe.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:L,children:[d.jsxs("div",{className:U,children:[R&&d.jsx("span",{className:Pe.leadingIcon,"aria-hidden":"true",children:R}),d.jsx("textarea",{ref:C,id:w,rows:o?void 0:i,maxLength:a,disabled:l,required:n,"aria-invalid":s||void 0,"aria-label":!e&&t?t:void 0,"aria-describedby":[r?k:"",T?`${v}-counter`:""].filter(Boolean).join(" ")||void 0,className:V,value:m,defaultValue:g,onChange:N,...y}),$&&T&&d.jsxs("span",{id:`${v}-counter`,className:Pe.counterInside,"aria-live":"polite",children:[D,"/",a]})]}),(r||!$&&T)&&d.jsxs("div",{className:Pe.bottomRow,children:[r?d.jsx("span",{id:k,className:s?Pe.errorText:Pe.helperText,children:r}):d.jsx("span",{}),!$&&T&&d.jsxs("span",{id:`${v}-counter`,className:Pe.counter,"aria-live":"polite",children:[D,"/",a]})]})]})]})});Ed.displayName="TextArea";var Jo={exports:{}},ho={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ta;function T1(){if(Ta)return co;Ta=1;var t=x;function e(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,s=t.useEffect,i=t.useLayoutEffect,o=t.useDebugValue;function l(h,f){var p=f(),m=r({inst:{value:p,getSnapshot:f}}),g=m[0].inst,b=m[1];return i(function(){g.value=p,g.getSnapshot=f,a(g)&&b({inst:g})},[h,p,f]),s(function(){return a(g)&&b({inst:g}),h(function(){a(g)&&b({inst:g})})},[h]),o(p),p}function a(h){var f=h.getSnapshot;h=h.value;try{var p=f();return!n(h,p)}catch{return!0}}function c(h,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return co.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,co}var uo={};/**
9
+ */var Ma;function z1(){if(Ma)return ho;Ma=1;var t=x;function e(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,s=t.useEffect,i=t.useLayoutEffect,o=t.useDebugValue;function l(h,f){var p=f(),m=r({inst:{value:p,getSnapshot:f}}),g=m[0].inst,b=m[1];return i(function(){g.value=p,g.getSnapshot=f,a(g)&&b({inst:g})},[h,p,f]),s(function(){return a(g)&&b({inst:g}),h(function(){a(g)&&b({inst:g})})},[h]),o(p),p}function a(h){var f=h.getSnapshot;h=h.value;try{var p=f();return!n(h,p)}catch{return!0}}function c(h,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return ho.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,ho}var fo={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim.development.js
12
12
  *
@@ -14,19 +14,19 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ea;function E1(){return Ea||(Ea=1,process.env.NODE_ENV!=="production"&&function(){function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}function e(p,m){u||s.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=m();if(!h){var b=m();i(g,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}b=o({inst:{value:g,getSnapshot:m}});var y=b[0].inst,v=b[1];return a(function(){y.value=g,y.getSnapshot=m,n(y)&&v({inst:y})},[p,g,m]),l(function(){return n(y)&&v({inst:y}),p(function(){n(y)&&v({inst:y})})},[p]),c(g),g}function n(p){var m=p.getSnapshot;p=p.value;try{var g=m();return!i(p,g)}catch{return!0}}function r(p,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=x,i=typeof Object.is=="function"?Object.is:t,o=s.useState,l=s.useEffect,a=s.useLayoutEffect,c=s.useDebugValue,u=!1,h=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;uo.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),uo}process.env.NODE_ENV==="production"?Ko.exports=T1():Ko.exports=E1();var Pi=Ko.exports;function Ge(t){this.content=t}Ge.prototype={constructor:Ge,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,s=r.find(t),i=r.content.slice();return s==-1?i.push(n||t,e):(i[s+1]=e,n&&(i[s]=n)),new Ge(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ge(n)},addToStart:function(t,e){return new Ge([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ge(n)},addBefore:function(t,e,n){var r=this.remove(e),s=r.content.slice(),i=r.find(t);return s.splice(i==-1?s.length:i,0,e,n),new Ge(s)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ge.from(t),t.size?new Ge(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ge.from(t),t.size?new Ge(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ge.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ge.from=function(t){if(t instanceof Ge)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ge(e)};function Td(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),i=e.child(r);if(s==i){n+=s.nodeSize;continue}if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)n++;return n}if(s.content.size||i.content.size){let o=Td(s.content,i.content,n+1);if(o!=null)return o}n+=s.nodeSize}}function Ed(t,e,n,r){for(let s=t.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:n,b:r};let o=t.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(o.content.size||l.content.size){let c=Ed(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}class j{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,s=0,i){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let i="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new j(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],s=0;if(n>e)for(let i=0,o=0;o<n;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),s+=l.nodeSize),o=a}return new j(r,s)}cutByIndex(e,n){return e==n?j.empty:e==0&&n==this.content.length?this:new j(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new j(s,i)}addToStart(e){return new j([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new j(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];e(s,r,n),r+=s.nodeSize}}findDiffStart(e,n=0){return Td(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ed(this,e,n,r)}findIndex(e){if(e==0)return As(0,e);if(e==this.size)return As(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),i=r+s.nodeSize;if(i>=e)return i==e?As(n+1,i):As(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return j.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return j.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return j.empty;let n,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(n||(n=e.slice(0,s)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new j(n||e,r)}static from(e){if(!e)return j.empty;if(e instanceof j)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new j([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}j.empty=new j([],0);const ho={index:0,offset:0};function As(t,e){return ho.index=t,ho.offset=e,ho}function Js(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Js(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Js(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ve=class Go{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Js(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Go.none;if(e instanceof Go)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};ve.none=[];class Ys extends Error{}class F{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=jd(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new F(r,this.openStart,this.openEnd)}removeBetween(e,n){return new F(Md(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return F.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new F(j.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new F(e,r,s)}}F.empty=new F(j.empty,0,0);function Md(t,e,n){let{index:r,offset:s}=t.findIndex(e),i=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(s==e||i.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Md(i.content,e-s-1,n-s-1)))}function jd(t,e,n,r,s,i){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=jd(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?s-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function M1(t,e,n){if(n.openStart>t.depth)throw new Ys("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ys("Inconsistent open depths");return Id(t,e,n,0)}function Id(t,e,n,r){let s=t.index(r),i=t.node(r);if(s==e.index(r)&&r<t.depth-n.openStart){let o=Id(t,e,n,r+1);return i.copy(i.content.replaceChild(s,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return Vn(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=j1(n,t);return Vn(i,Od(t,o,l,e,r))}else return Vn(i,Qs(t,e,r))}function Dd(t,e){if(!e.type.compatibleContent(t.type))throw new Ys("Cannot join "+e.type.name+" onto "+t.type.name)}function Jo(t,e,n){let r=t.node(n);return Dd(r,e.node(n)),r}function Wn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Vr(t,e,n,r){let s=(e||t).node(n),i=0,o=e?e.index(n):s.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Wn(t.nodeAfter,r),i++));for(let l=i;l<o;l++)Wn(s.child(l),r);e&&e.depth==n&&e.textOffset&&Wn(e.nodeBefore,r)}function Vn(t,e){return t.type.checkContent(e),t.copy(e)}function Od(t,e,n,r,s){let i=t.depth>s&&Jo(t,e,s+1),o=r.depth>s&&Jo(n,r,s+1),l=[];return Vr(null,t,s,l),i&&o&&e.index(s)==n.index(s)?(Dd(i,o),Wn(Vn(i,Od(t,e,n,r,s+1)),l)):(i&&Wn(Vn(i,Qs(t,e,s+1)),l),Vr(e,n,s,l),o&&Wn(Vn(o,Qs(n,r,s+1)),l)),Vr(r,null,s,l),new j(l)}function Qs(t,e,n){let r=[];if(Vr(null,t,n,r),t.depth>n){let s=Jo(t,e,n+1);Wn(Vn(s,Qs(t,e,n+1)),r)}return Vr(e,null,n,r),new j(r)}function j1(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)s=e.node(i).copy(j.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class ts{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(n);return r?e.child(n).cut(r):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ve.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),s=e.maybeChild(n);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Xs(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,i=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new ts(n,r,i)}static resolveCached(e,n){let r=Ma.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==n)return o}else Ma.set(e,r=new I1);let s=r.elts[r.i]=ts.resolve(e,n);return r.i=(r.i+1)%D1,s}}class I1{constructor(){this.elts=[],this.i=0}}const D1=12,Ma=new WeakMap;class Xs{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const O1=Object.create(null);class Mt{constructor(e,n,r,s=ve.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||j.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,s=0){this.content.nodesBetween(e,n,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,s){return this.content.textBetween(e,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Js(this.attrs,n||e.defaultAttrs||O1)&&ve.sameSet(this.marks,r||ve.none)}copy(e=null){return e==this.content?this:new Mt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Mt(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return F.empty;let s=this.resolve(e),i=this.resolve(n),o=r?0:s.sharedDepth(n),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new F(c,s.depth-o,i.depth-o)}replace(e,n,r){return M1(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(s==e||n.isText)return n;e-=s+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(e){return ts.resolveCached(this,e)}resolveNoCache(e){return ts.resolve(this,e)}rangeHasMark(e,n,r){let s=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}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()+")"),Ld(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=j.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,n);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=ve.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ve.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let s=j.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Mt.prototype.text=void 0;class Zs extends Mt{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ld(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Zs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Zs(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ld(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Jn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new L1(e,n);if(r.next==null)return Jn.empty;let s=Rd(r);r.next&&r.err("Unexpected trailing text");let i=H1(F1(s));return W1(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let s=this;for(let i=n;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return j.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:h}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(h)==-1){s.push(h);let f=i(h,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),n[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 n(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
18
- `)}}Jn.empty=new Jn(!0);class L1{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Rd(t){let e=[];do e.push(R1(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function R1(t){let e=[];do e.push(B1(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function B1(t){let e=z1(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=$1(t,e);else break;return e}function ja(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function $1(t,e){let n=ja(t),r=n;return t.eat(",")&&(t.next!="}"?r=ja(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function P1(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let s=[];for(let i in n){let o=n[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function z1(t){if(t.eat("(")){let e=Rd(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=P1(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function F1(t){let e=[[]];return s(i(t,0),n()),e;function n(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=n())}else if(o.type=="star"){let a=n();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=n();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=n();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=n();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Bd(t,e){return e-t}function Ia(t,e){let n=[];return r(e),n.sort(Bd);function r(s){let i=t[s];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&n.indexOf(a)==-1&&r(a)}}}function H1(t){let e=Object.create(null);return n(Ia(t,0));function n(r){let s=[];r.forEach(o=>{t[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Ia(t,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Jn(r.indexOf(t.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Bd);i.next.push({type:s[o][0],next:e[l.join(",")]||n(l)})}return i}}function W1(t,e){for(let n=0,r=[t];n<r.length;n++){let s=r[n],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function $d(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Pd(t,e){let n=Object.create(null);for(let r in t){let s=e&&e[r];if(s===void 0){let i=t[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=s}return n}function zd(t,e,n,r){for(let s in e)if(!(s in t))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${s}`);for(let s in t){let i=t[s];i.validate&&i.validate(e[s])}}function Fd(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new U1(t,r,e[r]);return n}let Da=class Hd{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Fd(e,r.attrs),this.defaultAttrs=$d(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Jn.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:Pd(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Mt(this,this.computeAttrs(e),j.from(n),ve.setFrom(r))}createChecked(e=null,n,r){return n=j.from(n),this.checkContent(n),new Mt(this,this.computeAttrs(e),n,ve.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=j.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore(j.empty,!0);return i?new Mt(this,e,n.append(i),ve.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){zd(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ve.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,o)=>r[i]=new Hd(i,n,o));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function V1(t,e,n){let r=n.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class U1{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?V1(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class zi{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=Fd(e,s.attrs),this.excluded=null;let i=$d(this.attrs);this.instance=i?new ve(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ve(this,Pd(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new zi(i,s++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){zd(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Wd{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=Ge.from(e.nodes),n.marks=Ge.from(e.marks||{}),this.nodes=Da.compile(this.spec.nodes,this),this.marks=zi.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Jn.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?Oa(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Oa(this,o.split(" "))}this.nodeFromJSON=s=>Mt.fromJSON(this,s),this.markFromJSON=s=>ve.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Da){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,s)}text(e,n){let r=this.nodes.text;return new Zs(r,r.defaultAttrs,e,ve.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Oa(t,e){let n=[];for(let r=0;r<e.length;r++){let s=e[r],i=t.marks[s],o=i;if(i)n.push(i);else for(let l in t.marks){let a=t.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&n.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function q1(t){return t.tag!=null}function K1(t){return t.style!=null}class vn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(q1(s))this.tags.push(s);else if(K1(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new Ra(this,n,!1);return r.addAll(e,ve.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Ra(this,n,!0);return r.addAll(e,ve.none,n.from,n.to),F.maxOpen(r.finish())}matchTag(e,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Y1(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,n,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(o.getAttrs){let a=o.getAttrs(n);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let n=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<i)break}n.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Ba(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Ba(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new vn(e,vn.schemaRules(e)))}}const Vd={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},G1={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ud={ol:!0,ul:!0},ns=1,Yo=2,Ur=4;function La(t,e,n){return e!=null?(e?ns:0)|(e==="full"?Yo:0):t&&t.whitespace=="pre"?ns|Yo:n&~Ur}class Ts{constructor(e,n,r,s,i,o){this.type=e,this.attrs=n,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=ve.none,this.match=i||(o&Ur?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(j.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ns)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let n=j.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Vd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ra{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,i,o=La(null,n.preserveWhitespace,0)|(r?Ur:0);s?i=new Ts(s.type,s.attrs,ve.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new Ts(null,null,ve.none,!0,null,o):i=new Ts(e.schema.topNodeType,null,ve.none,!0,null,o),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,s=this.top,i=s.options&Yo?"full":this.localPreserveWS||(s.options&ns)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
19
- `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(o.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;Ud.hasOwnProperty(o)&&this.parser.normalizeLists&&J1(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:G1.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);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 c,u=this.needsBlock;if(Vd.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let h=a&&a.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
20
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,s){let i,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,n.attrs||null,r,n.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,n,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,n);this.findAtPoint(e,i)}findPlace(e,n,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)n=this.enterInner(s[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let s=this.findPlace(e,n,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=ve.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):$a(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,s){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,s)),i}enterInner(e,n,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=La(e,i,o.options);o.options&Ur&&o.content.length==0&&(l|=Ur);let a=ve.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):$a(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Ts(e,n,a,s,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ns)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function J1(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ud.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Y1(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ba(t){let e={};for(let n in t)e[n]=t[n];return e}function $a(t,e){let n=e.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(t))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class tr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Es(n).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,n);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return Es(n).createTextNode(e.text);let{dom:r,contentDOM:s}=Ws(Es(n),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,s)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let s=this.marks[e.type.name];return s&&Ws(Es(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return typeof n=="string"?{dom:e.createTextNode(n)}:Ws(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new tr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Pa(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Pa(e.marks)}}function Pa(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Es(t){return t.document||window.document}const za=new WeakMap;function Q1(t){let e=za.get(t);return e===void 0&&za.set(t,e=X1(t)),e}function X1(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)n(r[s]);else for(let s in r)n(r[s])}return n(t),e}function Ws(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Q1(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(n=s.slice(0,o),s=s.slice(o+1));let l,a=n?t.createElementNS(n,s):t.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let h in c)if(c[h]!=null){let f=h.indexOf(" ");f>0?a.setAttributeNS(h.slice(0,f),h.slice(f+1),c[h]):h=="style"&&a.style?a.style.cssText=c[h]:a.setAttribute(h,c[h])}}for(let h=u;h<e.length;h++){let f=e[h];if(f===0){if(h<e.length-1||h>u)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(t.createTextNode(f));else{let{dom:p,contentDOM:m}=Ws(t,f,n,r);if(a.appendChild(p),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const qd=65535,Kd=Math.pow(2,16);function Z1(t,e){return t+e*Kd}function Fa(t){return t&qd}function ex(t){return(t-(t&qd))/Kd}const Gd=1,Jd=2,Vs=4,Yd=8;class Qo{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Yd)>0}get deletedBefore(){return(this.delInfo&(Gd|Vs))>0}get deletedAfter(){return(this.delInfo&(Jd|Vs))>0}get deletedAcross(){return(this.delInfo&Vs)>0}}class xt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&xt.empty)return xt.empty}recover(e){let n=0,r=Fa(e);if(!this.inverted)for(let s=0;s<r;s++)n+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+n+ex(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let s=0,i=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?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],h=a+c;if(e<=h){let f=c?e==a?-1:e==h?1:n:n,p=a+s+(f<0?0:u);if(r)return p;let m=e==(n<0?a:h)?null:Z1(l/3,e-a),g=e==a?Jd:e==h?Gd:Vs;return(n<0?e!=a:e!=h)&&(g|=Yd),new Qo(p,g,m)}s+=u-c}return r?e+s:new Qo(e+s,0,null)}touches(e,n){let r=0,s=Fa(n),i=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?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+n],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new xt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?xt.empty:new xt(e<0?[0,-e,0]:[0,0,e])}}xt.empty=new xt([]);class rs{constructor(e,n,r=0,s=e?e.length:0){this.mirror=n,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new rs(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let s=e.getMirror(n);this.appendMap(e._maps[n],s!=null&&s<n?r+s:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let e=new rs;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Qo(e,s,null)}}const fo=Object.create(null);class rt{getMap(){return xt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=fo[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in fo)throw new RangeError("Duplicate use of step JSON ID "+e);return fo[e]=n,n.prototype.jsonID=e,n}}class Fe{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Fe(e,null)}static fail(e){return new Fe(null,e)}static fromReplace(e,n,r,s){try{return Fe.ok(e.replace(n,r,s))}catch(i){if(i instanceof Ys)return Fe.fail(i.message);throw i}}}function Tl(t,e,n){let r=[];for(let s=0;s<t.childCount;s++){let i=t.child(s);i.content.size&&(i=i.copy(Tl(i.content,e,i))),i.isInline&&(i=e(i,n,s)),r.push(i)}return j.fromArray(r)}class bn extends rt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new F(Tl(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),n.openStart,n.openEnd);return Fe.fromReplace(e,this.from,this.to,i)}invert(){return new Lt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new bn(n.pos,r.pos,this.mark)}merge(e){return e instanceof bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new bn(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("addMark",bn);class Lt extends rt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new F(Tl(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return Fe.fromReplace(e,this.from,this.to,r)}invert(){return new bn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Lt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Lt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Lt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Lt(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("removeMark",Lt);class yn extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new F(j.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(r))return new yn(this.pos,n.marks[s]);return new yn(this.pos,this.mark)}}return new Yn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new yn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new yn(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("addNodeMark",yn);class Yn extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new F(j.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new yn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Yn(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Yn(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("removeNodeMark",Yn);class ze extends rt{constructor(e,n,r,s=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=s}apply(e){return this.structure&&Xo(e,this.from,this.to)?Fe.fail("Structure replace would overwrite content"):Fe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new xt([this.from,this.to-this.from,this.slice.size])}invert(e){return new ze(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&ze.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new ze(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ze)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?F.empty:new F(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ze(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?F.empty:new F(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ze(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ze(n.from,n.to,F.fromJSON(e,n.slice),!!n.structure)}}ze.MAP_BIAS=1;rt.jsonID("replace",ze);class Ue extends rt{constructor(e,n,r,s,i,o,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Xo(e,this.from,this.gapFrom)||Xo(e,this.gapTo,this.to)))return Fe.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Fe.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Fe.fromReplace(e,this.from,this.to,r):Fe.fail("Content does not fit in gap")}getMap(){return new xt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ue(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||s<n.pos||i>r.pos?null:new Ue(n.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ue(n.from,n.to,n.gapFrom,n.gapTo,F.fromJSON(e,n.slice),n.insert,!!n.structure)}}rt.jsonID("replaceAround",Ue);function Xo(t,e,n){let r=t.resolve(e),s=n-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function tx(t,e,n,r){let s=[],i=[],o,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let h=a.marks;if(!r.isInSet(h)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+a.nodeSize,n),m=r.addToSet(h);for(let g=0;g<h.length;g++)h[g].isInSet(m)||(o&&o.to==f&&o.mark.eq(h[g])?o.to=p:s.push(o=new Lt(f,p,h[g])));l&&l.to==f?l.to=p:i.push(l=new bn(f,p,r))}}),s.forEach(a=>t.step(a)),i.forEach(a=>t.step(a))}function nx(t,e,n,r){let s=[],i=0;t.doc.nodesBetween(e,n,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof zi){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,n);for(let u=0;u<a.length;u++){let h=a[u],f;for(let p=0;p<s.length;p++){let m=s[p];m.step==i-1&&h.eq(s[p].style)&&(f=m)}f?(f.to=c,f.step=i):s.push({style:h,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>t.step(new Lt(o.from,o.to,o.style)))}function El(t,e,n,r=n.contentMatch,s=!0){let i=t.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,h=r.matchType(c.type);if(!h)o.push(new ze(l,u,F.empty));else{r=h;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new Lt(l,u,c.marks[f]));if(s&&c.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,m;for(;f=p.exec(c.text);)m||(m=new F(j.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new ze(l+f.index,l+f.index+f[0].length,m))}}l=u}if(!r.validEnd){let a=r.fillBefore(j.empty,!0);t.replace(l,l,new F(a,0,0))}for(let a=o.length-1;a>=0;a--)t.step(o[a])}function rx(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function _r(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,s=0,i=0;;--r){let o=t.$from.node(r),l=t.$from.index(r)+s,a=t.$to.indexAfter(r)-i;if(r<t.depth&&o.canReplace(l,a,n))return r;if(r==0||o.type.spec.isolating||!rx(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function sx(t,e,n){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=j.empty,h=0;for(let m=i,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=j.from(r.node(m).copy(u)),h++):a--;let f=j.empty,p=0;for(let m=i,g=!1;m>n;m--)g||s.after(m+1)<s.end(m)?(g=!0,f=j.from(s.node(m).copy(f)),p++):c++;t.step(new Ue(a,c,o,l,new F(u.append(f),h,p),u.size-h,!0))}function Ml(t,e,n=null,r=t){let s=ix(t,e),i=s&&ox(r,e);return i?s.map(Ha).concat({type:e,attrs:n}).concat(i.map(Ha)):null}function Ha(t){return{type:t,attrs:null}}function ix(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return n.canReplaceWith(r,s,o)?i:null}function ox(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:o}function lx(t,e,n){let r=j.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let l=n[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=j.from(n[o].type.create(n[o].attrs,r))}let s=e.start,i=e.end;t.step(new Ue(s,i,s,i,new F(r,0,0),n.length,!0))}function ax(t,e,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&cx(t.doc,t.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?c=!1:!p&&m&&(c=!0)}c===!1&&Xd(t,o,l,i),El(t,t.mapping.slice(i).map(l,1),r,void 0,c===null);let u=t.mapping.slice(i),h=u.map(l,1),f=u.map(l+o.nodeSize,1);return t.step(new Ue(h,f,h+1,f-1,new F(j.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&Qd(t,o,l,i),!1}})}function Qd(t,e,n,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=t.mapping.slice(r).map(n+1+i+o.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Xd(t,e,n,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text(`
21
- `))}})}function cx(t,e,n){let r=t.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function dx(t,e,n,r,s){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let o=n.create(r,null,s||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,o);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ue(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new F(j.from(o),0,0),1,!0))}function on(t,e,n=1,r){let s=t.resolve(e),i=s.depth-n,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let c=s.depth-1,u=n-2;c>i;c--,u--){let h=s.node(c),f=s.index(c);if(h.type.spec.isolating)return!1;let p=h.content.cutByIndex(f,h.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||h;if(!h.canReplace(f+1,h.childCount)||!g.type.validContent(p))return!1}let l=s.indexAfter(i),a=r&&r[0];return s.node(i).canReplaceWith(l,l,a?a.type:s.node(i+1).type)}function ux(t,e,n=1,r){let s=t.doc.resolve(e),i=j.empty,o=j.empty;for(let l=s.depth,a=s.depth-n,c=n-1;l>a;l--,c--){i=j.from(s.node(l).copy(i));let u=r&&r[c];o=j.from(u?u.type.create(u.attrs,o):s.node(l).copy(o))}t.step(new ze(e,e,new F(i.append(o),n,n),!0))}function An(t,e){let n=t.resolve(e),r=n.index();return Zd(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function hx(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let s=0;s<e.childCount;s++){let i=e.child(s),o=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function Zd(t,e){return!!(t&&e&&!t.isLeaf&&hx(t,e))}function Fi(t,e,n=-1){let r=t.resolve(e);for(let s=r.depth;;s--){let i,o,l=r.index(s);if(s==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(s+1),l++,o=r.node(s).maybeChild(l)):(i=r.node(s).maybeChild(l-1),o=r.node(s+1)),i&&!i.isTextblock&&Zd(i,o)&&r.node(s).canReplace(l,l+1))return e;if(s==0)break;e=n<0?r.before(s):r.after(s)}}function fx(t,e,n){let r=null,{linebreakReplacement:s}=t.doc.type.schema,i=t.doc.resolve(e-n),o=i.node().type;if(s&&o.inlineContent){let u=o.whitespace=="pre",h=!!o.contentMatch.matchType(s);u&&!h?r=!1:!u&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Xd(t,u.node(),u.before(),l)}o.inlineContent&&El(t,e+n-1,o,i.node().contentMatchAt(i.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new ze(c,a.map(e+n,-1),F.empty,!0)),r===!0){let u=t.doc.resolve(c);Qd(t,u.node(),u.before(),t.steps.length)}return t}function px(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,n))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,n))return r.after(s+1);if(i<r.node(s).childCount)return null}return null}function eu(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let s=n.content;for(let i=0;i<n.openStart;i++)s=s.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let o=r.depth;o>=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,a=r.index(o)+(l>0?1:0),c=r.node(o),u=!1;if(i==1)u=c.canReplace(a,a,s);else{let h=c.contentMatchAt(a).findWrapping(s.firstChild.type);u=h&&c.canReplaceWith(a,a,h[0])}if(u)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function Hi(t,e,n=e,r=F.empty){if(e==n&&!r.size)return null;let s=t.resolve(e),i=t.resolve(n);return tu(s,i,r)?new ze(e,n,r):new mx(s,i,r).fit()}function tu(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class mx{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=j.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=j.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let i=this.placed,o=r.depth,l=s.depth;for(;o&&l&&i.childCount==1;)i=i.firstChild.content,o--,l--;let a=new F(i,o,l);return e>-1?new Ue(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new ze(r.pos,s.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,s=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(s=0),i.type.spec.isolating&&s<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=po(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let o=s.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,h=null;if(n==1&&(o?c.matchType(o.type)||(h=c.fillBefore(j.from(o),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:h};if(n==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=po(e,n);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new F(e,n+1,Math.max(r,s.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=po(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new F(Pr(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new F(Pr(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let o=this.unplaced,l=r?r.content:o.content,a=o.openStart-e,c=0,u=[],{match:h,type:f}=this.frontier[n];if(s){for(let g=0;g<s.childCount;g++)u.push(s.child(g));h=h.matchFragment(s)}let p=l.size+e-(o.content.size-o.openEnd);for(;c<l.childCount;){let g=l.child(c),b=h.matchType(g.type);if(!b)break;c++,(c>1||a==0||g.content.size)&&(h=b,u.push(nu(g.mark(f.allowedMarks(g.marks)),c==1?a:0,c==l.childCount?p:-1)))}let m=c==l.childCount;m||(p=-1),this.placed=zr(this.placed,n,j.from(u)),this.frontier[n].match=h,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=l;g<p;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?F.empty:new F(Pr(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new F(Pr(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!mo(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,s=this.$to.after(r);for(;r>1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=mo(e,n,s,r,i);if(o){for(let l=n-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=mo(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:o,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=zr(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let s=e.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,n=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=zr(this.placed,this.depth,j.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(j.empty,!0);n.childCount&&(this.placed=zr(this.placed,this.frontier.length,n))}}function Pr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Pr(t.firstChild.content,e-1,n)))}function zr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(zr(t.lastChild.content,e-1,n)))}function po(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function nu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,nu(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(j.empty,!0)))),t.copy(r)}function mo(t,e,n,r,s){let i=t.node(e),o=s?t.indexAfter(e):t.index(e);if(o==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,o);return l&&!gx(n,i.content,o)?l:null}function gx(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function bx(t){return t.spec.defining||t.spec.definingForContent}function yx(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let s=t.doc.resolve(e),i=t.doc.resolve(n);if(tu(s,i,r))return t.step(new ze(e,n,r));let o=su(s,i);o[o.length-1]==0&&o.pop();let l=-(s.depth+1);o.unshift(l);for(let f=s.depth,p=s.pos-1;f>0;f--,p--){let m=s.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(f)>-1?l=f:s.before(f)==p&&o.splice(1,0,-f)}let a=o.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let m=f.firstChild;if(c.push(m),p==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let p=c[f],m=bx(p.type);if(m&&!p.sameMarkup(s.node(Math.abs(l)-1)))u=f;else if(m||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),m=c[p];if(m)for(let g=0;g<o.length;g++){let b=o[(g+a)%o.length],y=!0;b<0&&(y=!1,b=-b);let v=s.node(b-1),_=s.index(b-1);if(v.canReplaceWith(_,_,m.type,m.marks))return t.replace(s.before(b),y?i.after(b):n,new F(ru(r.content,0,r.openStart,p),p,r.openEnd))}}let h=t.steps.length;for(let f=o.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>h));f--){let p=o[f];p<0||(e=s.before(p),n=i.after(p))}}function ru(t,e,n,r,s){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(ru(i.content,e+1,n,r,i)))}if(e>r){let i=s.contentMatchAt(0),o=i.fillBefore(t).append(t);t=o.append(i.matchFragment(o).fillBefore(j.empty,!0))}return t}function xx(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let s=px(t.doc,e,r.type);s!=null&&(e=n=s)}t.replaceRange(e,n,new F(j.from(r),0,0))}function vx(t,e,n){let r=t.doc.resolve(e),s=t.doc.resolve(n);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let o=r.sharedDepth(n),l=!1;for(let a=r.depth;a>o;a--)r.node(a).type.spec.isolating&&(l=!0);for(let a=s.depth;a>o;a--)s.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=r.depth;a>0&&e==r.start(a);a--)e=r.before(a);for(let a=s.depth;a>0&&n==s.start(a);a--)n=s.before(a);r=t.doc.resolve(e),s=t.doc.resolve(n)}}let i=su(r,s);for(let o=0;o<i.length;o++){let l=i[o],a=o==i.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),s.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),s.indexAfter(l-1))))return t.delete(r.before(l),s.after(l))}for(let o=1;o<=r.depth&&o<=s.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&s.end(o)-n!=s.depth-o&&r.start(o-1)==s.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),s.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function su(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let s=r;s>=0;s--){let i=t.start(s);if(i<t.pos-(t.depth-s)||e.end(s)>e.pos+(e.depth-s)||t.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(i==e.start(s)||s==t.depth&&s==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==i-1)&&n.push(s)}return n}class hr extends rt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let s=n.type.create(r,null,n.marks);return Fe.fromReplace(e,this.pos,this.pos+1,new F(j.from(s),0,n.isLeaf?0:1))}getMap(){return xt.empty}invert(e){return new hr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new hr(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new hr(n.pos,n.attr,n.value)}}rt.jsonID("attr",hr);class ss extends rt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let s in e.attrs)n[s]=e.attrs[s];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Fe.ok(r)}getMap(){return xt.empty}invert(e){return new ss(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ss(n.attr,n.value)}}rt.jsonID("docAttr",ss);let mr=class extends Error{};mr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};mr.prototype=Object.create(Error.prototype);mr.prototype.constructor=mr;mr.prototype.name="TransformError";class iu{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new rs}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new mr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let s=this.mapping.maps[r];r&&(e=s.map(e,1),n=s.map(n,-1)),s.forEach((i,o,l,a)=>{e=Math.min(e,l),n=Math.max(n,a)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=F.empty){let s=Hi(this.doc,e,n,r);return s&&this.step(s),this}replaceWith(e,n,r){return this.replace(e,n,new F(j.from(r),0,0))}delete(e,n){return this.replace(e,n,F.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return yx(this,e,n,r),this}replaceRangeWith(e,n,r){return xx(this,e,n,r),this}deleteRange(e,n){return vx(this,e,n),this}lift(e,n){return sx(this,e,n),this}join(e,n=1){return fx(this,e,n),this}wrap(e,n){return lx(this,e,n),this}setBlockType(e,n=e,r,s=null){return ax(this,e,n,r,s),this}setNodeMarkup(e,n,r=null,s){return dx(this,e,n,r,s),this}setNodeAttribute(e,n,r){return this.step(new hr(e,n,r)),this}setDocAttribute(e,n){return this.step(new ss(e,n)),this}addNodeMark(e,n){return this.step(new yn(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof ve)n.isInSet(r.marks)&&this.step(new Yn(e,n));else{let s=r.marks,i,o=[];for(;i=n.isInSet(s);)o.push(new Yn(e,i)),s=i.removeFromSet(s);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,n=1,r){return ux(this,e,n,r),this}addMark(e,n,r){return tx(this,e,n,r),this}removeMark(e,n,r){return nx(this,e,n,r),this}clearIncompatible(e,n,r){return El(this,e,n,r),this}}const go=Object.create(null);class ie{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new _x(e.min(n),e.max(n))]}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 n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=F.empty){let r=n.content.lastChild,s=null;for(let l=0;l<n.openEnd;l++)s=r,r=r.lastChild;let i=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:c}=o[l],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(c.pos),l?F.empty:n),l==0&&Ua(e,i,(r?r.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,s=this.ranges;for(let i=0;i<s.length;i++){let{$from:o,$to:l}=s[i],a=e.mapping.slice(r),c=a.map(o.pos),u=a.map(l.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),Ua(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let s=e.parent.inlineContent?new Q(e):ar(e.node(0),e.parent,e.pos,e.index(),n,r);if(s)return s;for(let i=e.depth-1;i>=0;i--){let o=n<0?ar(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):ar(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new vt(e.node(0))}static atStart(e){return ar(e,e,0,0,1)||new vt(e)}static atEnd(e){return ar(e,e,e.content.size,e.childCount,-1)||new vt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=go[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in go)throw new RangeError("Duplicate use of selection JSON ID "+e);return go[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Q.between(this.$anchor,this.$head).getBookmark()}}ie.prototype.visible=!0;class _x{constructor(e,n){this.$from=e,this.$to=n}}let Wa=!1;function Va(t){!Wa&&!t.parent.inlineContent&&(Wa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Q extends ie{constructor(e,n=e){Va(e),Va(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ie.near(r);let s=e.resolve(n.map(this.anchor));return new Q(s.parent.inlineContent?s:r,r)}replace(e,n=F.empty){if(super.replace(e,n),n==F.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Q&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Wi(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Q(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let s=e.resolve(n);return new this(s,r==n?s:e.resolve(r))}static between(e,n,r){let s=e.pos-n.pos;if((!r||s)&&(r=s>=0?1:-1),!n.parent.inlineContent){let i=ie.findFrom(n,r,!0)||ie.findFrom(n,-r,!0);if(i)n=i.$head;else return ie.near(n,r)}return e.parent.inlineContent||(s==0?e=n:(e=(ie.findFrom(e,-r,!0)||ie.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=s<0&&(e=n))),new Q(e,n)}}ie.jsonID("text",Q);class Wi{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Wi(e.map(this.anchor),e.map(this.head))}resolve(e){return Q.between(e.resolve(this.anchor),e.resolve(this.head))}}class J extends ie{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:s}=n.mapResult(this.anchor),i=e.resolve(s);return r?ie.near(i):new J(i)}content(){return new F(j.from(this.node),0,0)}eq(e){return e instanceof J&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new jl(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new J(e.resolve(n.anchor))}static create(e,n){return new J(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}J.prototype.visible=!1;ie.jsonID("node",J);class jl{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Wi(r,r):new jl(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&J.isSelectable(r)?new J(n):ie.near(n)}}class vt extends ie{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=F.empty){if(n==F.empty){e.delete(0,e.doc.content.size);let r=ie.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new vt(e)}map(e){return new vt(e)}eq(e){return e instanceof vt}getBookmark(){return kx}}ie.jsonID("all",vt);const kx={map(){return this},resolve(t){return new vt(t)}};function ar(t,e,n,r,s,i=!1){if(e.inlineContent)return Q.create(t,n);for(let o=r-(s>0?0:1);s>0?o<e.childCount:o>=0;o+=s){let l=e.child(o);if(l.isAtom){if(!i&&J.isSelectable(l))return J.create(t,n-(s<0?l.nodeSize:0))}else{let a=ar(t,l,n+s,s<0?l.childCount:0,s,i);if(a)return a}n+=l.nodeSize*s}return null}function Ua(t,e,n){let r=t.steps.length-1;if(r<e)return;let s=t.steps[r];if(!(s instanceof ze||s instanceof Ue))return;let i=t.mapping.maps[r],o;i.forEach((l,a,c,u)=>{o==null&&(o=u)}),t.setSelection(ie.near(t.doc.resolve(o),n))}const qa=1,Ms=2,Ka=4;class wx extends iu{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|qa)&~Ms,this.storedMarks=null,this}get selectionSet(){return(this.updated&qa)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ms,this}ensureMarks(e){return ve.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&Ms)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ms,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ve.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let s=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let o=this.doc.resolve(n);i=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,s.text(e,i)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(ie.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,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|=Ka,this}get scrolledIntoView(){return(this.updated&Ka)>0}}function Ga(t,e){return!e||!t?t:t.bind(e)}class Fr{constructor(e,n,r){this.name=e,this.init=Ga(n.init,r),this.apply=Ga(n.apply,r)}}const Cx=[new Fr("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Fr("selection",{init(t,e){return t.selection||ie.atStart(e.doc)},apply(t){return t.selection}}),new Fr("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Fr("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class bo{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Cx.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Fr(r.key,r.spec.state,r))})}}class ur{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,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let s=this.config.plugins[r];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),s=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let a=s?s[o].n:0,c=s?s[o].state:this,u=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,c,r);if(u&&r.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!s){s=[];for(let h=0;h<this.config.plugins.length;h++)s.push(h<o?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}s&&(s[o]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ur(this.config),r=this.config.fields;for(let s=0;s<r.length;s++){let i=r[s];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new wx(this)}static create(e){let n=new bo(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ur(n);for(let s=0;s<n.fields.length;s++)r[n.fields[s].name]=n.fields[s].init(e,r);return r}reconfigure(e){let n=new bo(this.schema,e.plugins),r=n.fields,s=new ur(n);for(let i=0;i<r.length;i++){let o=r[i].name;s[o]=this.hasOwnProperty(o)?this[o]:r[i].init(e,s)}return s}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],i=s.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(s,this[s.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new bo(e.schema,e.plugins),i=new ur(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=Mt.fromJSON(e.schema,n.doc);else if(o.name=="selection")i.selection=ie.fromJSON(i.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){i[o.name]=c.fromJSON.call(a,e,n[l],i);return}}i[o.name]=o.init(e,i)}}),i}}function ou(t,e,n){for(let r in t){let s=t[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=ou(s,e,{})),n[r]=s}return n}class Ne{constructor(e){this.spec=e,this.props={},e.props&&ou(e.props,this,this.props),this.key=e.key?e.key.key:lu("plugin")}getState(e){return e[this.key]}}const yo=Object.create(null);function lu(t){return t in yo?t+"$"+ ++yo[t]:(yo[t]=0,t+"$")}class Re{constructor(e="key"){this.key=lu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const au=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function cu(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const du=(t,e,n)=>{let r=cu(t,n);if(!r)return!1;let s=Il(r);if(!s){let o=r.blockRange(),l=o&&_r(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)}let i=s.nodeBefore;if(xu(t,s,e,-1))return!0;if(r.parent.content.size==0&&(gr(i,"end")||J.isSelectable(i)))for(let o=r.depth;;o--){let l=Hi(t.doc,r.before(o),r.after(o),F.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection(gr(i,"end")?ie.findFrom(a.doc.resolve(a.mapping.map(s.pos,-1)),-1):J.create(a.doc,s.pos-i.nodeSize)),e(a.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},Sx=(t,e,n)=>{let r=cu(t,n);if(!r)return!1;let s=Il(r);return s?uu(t,s,e):!1},Nx=(t,e,n)=>{let r=fu(t,n);if(!r)return!1;let s=Dl(r);return s?uu(t,s,e):!1};function uu(t,e,n){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let u=s.lastChild;if(!u)return!1;s=u}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=Hi(t.doc,i,a,F.empty);if(!c||c.from!=i||c instanceof ze&&c.slice.size>=a-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(Q.create(u.doc,i)),n(u.scrollIntoView())}return!0}function gr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const hu=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Il(r)}let o=i&&i.nodeBefore;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function Il(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function fu(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const pu=(t,e,n)=>{let r=fu(t,n);if(!r)return!1;let s=Dl(r);if(!s)return!1;let i=s.nodeAfter;if(xu(t,s,e,1))return!0;if(r.parent.content.size==0&&(gr(i,"start")||J.isSelectable(i))){let o=Hi(t.doc,r.before(),r.after(),F.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(gr(i,"start")?ie.findFrom(l.doc.resolve(l.mapping.map(s.pos)),1):J.create(l.doc,l.mapping.map(s.pos))),e(l.scrollIntoView())}return!0}}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos,s.pos+i.nodeSize).scrollIntoView()),!0):!1},mu=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Dl(r)}let o=i&&i.nodeAfter;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos)).scrollIntoView()),!0)};function Dl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Ax=(t,e)=>{let n=t.selection,r=n instanceof J,s;if(r){if(n.node.isTextblock||!An(t.doc,n.from))return!1;s=n.from}else if(s=Fi(t.doc,n.from,-1),s==null)return!1;if(e){let i=t.tr.join(s);r&&i.setSelection(J.create(i.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},Tx=(t,e)=>{let n=t.selection,r;if(n instanceof J){if(n.node.isTextblock||!An(t.doc,n.to))return!1;r=n.to}else if(r=Fi(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Ex=(t,e)=>{let{$from:n,$to:r}=t.selection,s=n.blockRange(r),i=s&&_r(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)},gu=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
22
- `).scrollIntoView()),!0)};function Ol(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Mx=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let s=n.node(-1),i=n.indexAfter(-1),o=Ol(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,o.createAndFill());a.setSelection(ie.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},bu=(t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof vt||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=Ol(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,l=t.tr.insert(o,i.createAndFill());l.setSelection(Q.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},yu=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(on(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&_r(r);return s==null?!1:(e&&e(t.tr.lift(r,s).scrollIntoView()),!0)};function jx(t){return(e,n)=>{let{$from:r,$to:s}=e.selection;if(e.selection instanceof J&&e.selection.node.isBlock)return!r.parentOffset||!on(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],o,l,a=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){a=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),l=Ol(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),i.unshift(a&&l?{type:l}:null),o=p;break}else{if(p==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof Q||e.selection instanceof vt)&&u.deleteSelection();let h=u.mapping.map(r.pos),f=on(u.doc,h,i.length,i);if(f||(i[0]=l?{type:l}:null,f=on(u.doc,h,i.length,i)),!f)return!1;if(u.split(h,i.length,i),!a&&c&&r.node(o).type!=l){let p=u.mapping.map(r.before(o)),m=u.doc.resolve(p);l&&r.node(o-1).canReplaceWith(m.index(),m.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(o)),l)}return n&&n(u.scrollIntoView()),!0}}const Ix=jx(),Dx=(t,e)=>{let{$from:n,to:r}=t.selection,s,i=n.sharedDepth(r);return i==0?!1:(s=n.before(i),e&&e(t.tr.setSelection(J.create(t.doc,s))),!0)};function Ox(t,e,n){let r=e.nodeBefore,s=e.nodeAfter,i=e.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(s.isTextblock||An(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function xu(t,e,n,r){let s=e.nodeBefore,i=e.nodeAfter,o,l,a=s.type.spec.isolating||i.type.spec.isolating;if(!a&&Ox(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(l=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&l.matchType(o[0]||i.type).validEnd){if(n){let p=e.pos+i.nodeSize,m=j.empty;for(let y=o.length-1;y>=0;y--)m=j.from(o[y].create(null,m));m=j.from(s.copy(m));let g=t.tr.step(new Ue(e.pos-1,p,e.pos,p,new F(m,1,0),o.length,!0)),b=g.doc.resolve(p+2*o.length);b.nodeAfter&&b.nodeAfter.type==s.type&&An(g.doc,b.pos)&&g.join(b.pos),n(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&a?null:ie.findFrom(e,1),h=u&&u.$from.blockRange(u.$to),f=h&&_r(h);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(h,f).scrollIntoView()),!0;if(c&&gr(i,"start",!0)&&gr(s,"end")){let p=s,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=i,b=1;for(;!g.isTextblock;g=g.firstChild)b++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let y=j.empty;for(let _=m.length-1;_>=0;_--)y=j.from(m[_].copy(y));let v=t.tr.step(new Ue(e.pos-m.length,e.pos+i.nodeSize,e.pos+b,e.pos+i.nodeSize-b,new F(y,m.length,0),0,!0));n(v.scrollIntoView())}return!0}}return!1}function vu(t){return function(e,n){let r=e.selection,s=t<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(n&&n(e.tr.setSelection(Q.create(e.doc,t<0?s.start(i):s.end(i)))),!0):!1}}const Lx=vu(-1),Rx=vu(1);function Bx(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i),l=o&&Ml(o,t,e);return l?(r&&r(n.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Ja(t,e=null){return function(n,r){let s=!1;for(let i=0;i<n.selection.ranges.length&&!s;i++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(o,l,(a,c)=>{if(s)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)s=!0;else{let u=n.doc.resolve(c),h=u.index();s=u.parent.canReplaceWith(h,h+1,t)}})}if(!s)return!1;if(r){let i=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[o];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}function Ll(...t){return function(e,n,r){for(let s=0;s<t.length;s++)if(t[s](e,n,r))return!0;return!1}}Ll(au,du,hu);Ll(au,pu,mu);Ll(gu,bu,yu,Ix);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function $x(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i);if(!o)return!1;let l=r?n.tr:null;return Px(l,o,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function Px(t,e,n,r=null){let s=!1,i=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);i=new Xs(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new Xs(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let l=Ml(i,n,r,e);return l?(t&&zx(t,e,l,s,n),!0):!1}function zx(t,e,n,r,s){let i=j.empty;for(let u=n.length-1;u>=0;u--)i=j.from(n[u].type.create(n[u].attrs,i));t.step(new Ue(e.start-(r?2:0),e.end,e.start,e.end,new F(i,0,0),n.length,!0));let o=0;for(let u=0;u<n.length;u++)n[u].type==s&&(o=u+1);let l=n.length-o,a=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,h=e.endIndex,f=!0;u<h;u++,f=!1)!f&&on(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return t}function Fx(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,o=>o.childCount>0&&o.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?Hx(e,n,t,i):Wx(e,n,i):!0:!1}}function Hx(t,e,n,r){let s=t.tr,i=r.end,o=r.$to.end(r.depth);i<o&&(s.step(new Ue(i-1,o,i,o,new F(j.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Xs(s.doc.resolve(r.$from.pos),s.doc.resolve(o),r.depth));const l=_r(r);if(l==null)return!1;s.lift(r,l);let a=s.doc.resolve(s.mapping.map(i,-1)-1);return An(s.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&s.join(a.pos),e(s.scrollIntoView()),!0}function Wx(t,e,n){let r=t.tr,s=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=s.child(m).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(n.start),o=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==s.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?j.empty:j.from(s))))return!1;let h=i.pos,f=h+o.nodeSize;return r.step(new Ue(h-(l?1:0),f+(a?1:0),h+1,f-1,new F((l?j.empty:j.from(s.copy(j.empty))).append(a?j.empty:j.from(s.copy(j.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Vx(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let l=i.parent,a=l.child(o-1);if(a.type!=t)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,u=j.from(c?t.create():null),h=new F(j.from(t.create(null,j.from(l.type.create(null,u)))),c?3:1,0),f=i.start,p=i.end;n(e.tr.step(new Ue(f-(c?3:1),p,f,p,h,1,!0)).scrollIntoView())}return!0}}const Je=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},br=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Zo=null;const nn=function(t,e,n){let r=Zo||(Zo=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Ux=function(){Zo=null},Qn=function(t,e,n,r){return n&&(Ya(t,e,n,r,-1)||Ya(t,e,n,r,1))},qx=/^(img|br|input|textarea|hr)$/i;function Ya(t,e,n,r,s){for(var i;;){if(t==n&&e==r)return!0;if(e==(s<0?0:Et(t))){let o=t.parentNode;if(!o||o.nodeType!=1||bs(t)||qx.test(t.nodeName)||t.contentEditable=="false")return!1;e=Je(t)+(s<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else t=o,e=s<0?Et(t):0}else return!1}}function Et(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Kx(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Et(t)}else if(t.parentNode&&!bs(t))e=Je(t),t=t.parentNode;else return null}}function Gx(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!bs(t))e=Je(t)+1,t=t.parentNode;else return null}}function Jx(t,e,n){for(let r=e==0,s=e==Et(t);r||s;){if(t==n)return!0;let i=Je(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,s=s&&i==Et(t)}}function bs(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Vi=function(t){return t.focusNode&&Qn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Rn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Yx(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Qx(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Et(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Et(r.startContainer),r.startOffset)}}}const Vt=typeof navigator<"u"?navigator:null,Qa=typeof document<"u"?document:null,Tn=Vt&&Vt.userAgent||"",el=/Edge\/(\d+)/.exec(Tn),_u=/MSIE \d/.exec(Tn),tl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Tn),ht=!!(_u||tl||el),_n=_u?document.documentMode:tl?+tl[1]:el?+el[1]:0,jt=!ht&&/gecko\/(\d+)/i.test(Tn);jt&&+(/Firefox\/(\d+)/.exec(Tn)||[0,0])[1];const nl=!ht&&/Chrome\/(\d+)/.exec(Tn),Qe=!!nl,ku=nl?+nl[1]:0,nt=!ht&&!!Vt&&/Apple Computer/.test(Vt.vendor),yr=nt&&(/Mobile\/\w+/.test(Tn)||!!Vt&&Vt.maxTouchPoints>2),Tt=yr||(Vt?/Mac/.test(Vt.platform):!1),wu=Vt?/Win/.test(Vt.platform):!1,sn=/Android \d/.test(Tn),ys=!!Qa&&"webkitFontSmoothing"in Qa.documentElement.style,Xx=ys?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Zx(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Yt(t,e){return typeof t=="number"?t:t[e]}function e0(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Xa(t,e,n){let r=t.someProp("scrollThreshold")||0,s=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=br(o);continue}let l=o,a=l==i.body,c=a?Zx(i):e0(l),u=0,h=0;if(e.top<c.top+Yt(r,"top")?h=-(c.top-e.top+Yt(s,"top")):e.bottom>c.bottom-Yt(r,"bottom")&&(h=e.bottom-e.top>c.bottom-c.top?e.top+Yt(s,"top")-c.top:e.bottom-c.bottom+Yt(s,"bottom")),e.left<c.left+Yt(r,"left")?u=-(c.left-e.left+Yt(s,"left")):e.right>c.right-Yt(r,"right")&&(u=e.right-c.right+Yt(s,"right")),u||h)if(a)i.defaultView.scrollBy(u,h);else{let p=l.scrollLeft,m=l.scrollTop;h&&(l.scrollTop+=h),u&&(l.scrollLeft+=u);let g=l.scrollLeft-p,b=l.scrollTop-m;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}let f=a?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:br(o)}}function t0(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,s;for(let i=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let l=t.root.elementFromPoint(i,o);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,s=a.top;break}}return{refDOM:r,refTop:s,stack:Cu(t.dom)}}function Cu(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=br(r));return e}function n0({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Su(n,r==0?0:r-e)}function Su(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:s,left:i}=t[n];r.scrollTop!=s+e&&(r.scrollTop=s+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let or=null;function r0(t){if(t.setActive)return t.setActive();if(or)return t.focus(or);let e=Cu(t);t.focus(or==null?{get preventScroll(){return or={preventScroll:!0},!0}}:void 0),or||(or=!1,Su(e,0))}function Nu(t,e){let n,r=2e8,s,i=0,o=e.top,l=e.top,a,c;for(let u=t.firstChild,h=0;u;u=u.nextSibling,h++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=nn(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let m=f[p];if(m.top<=o&&m.bottom>=l){o=Math.max(m.bottom,o),l=Math.min(m.top,l);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,s=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(i=h+(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=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=h+1)}}return!n&&a&&(n=a,s=c,r=0),n&&n.nodeType==3?s0(n,s):!n||r&&n.nodeType==1?{node:t,offset:i}:Nu(n,s)}function s0(t,e){let n=t.nodeValue.length,r=document.createRange(),s;for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=hn(r,1);if(o.top!=o.bottom&&Rl(e,o)){s={node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),s||{node:t,offset:0}}function Rl(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function i0(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function o0(t,e,n){let{node:r,offset:s}=Nu(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();i=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,s,i)}function l0(t,e,n,r){let s=-1;for(let i=e,o=!1;i!=t.dom;){let l=t.docView.nearestDesc(i,!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>r.left||a.top>r.top?s=l.posBefore:(!o&&a.right<r.left||a.bottom<r.top)&&(s=l.posAfter),o=!0),!l.contentDOM&&s<0&&!l.node.isText))return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;i=l.dom.parentNode}return s>-1?s:t.docView.posFromDOM(e,n,-1)}function Au(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let s=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=s;;){let o=t.childNodes[i];if(o.nodeType==1){let l=o.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(Rl(e,c))return Au(o,e,c)}}if((i=(i+1)%r)==s)break}return t}function a0(t,e){let n=t.dom.ownerDocument,r,s=0,i=Qx(n,e.left,e.top);i&&({node:r,offset:s}=i);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=t.dom.getBoundingClientRect();if(!Rl(e,c)||(o=Au(t.dom,e,c),!o))return null}if(nt)for(let c=o;r&&c;c=br(c))c.draggable&&(r=void 0);if(o=i0(o,e),r){if(jt&&r.nodeType==1&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let u=r.childNodes[s],h;u.nodeName=="IMG"&&(h=u.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&s++}let c;ys&&s&&r.nodeType==1&&(c=r.childNodes[s-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&s--,r==t.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(l=l0(t,r,s,e))}l==null&&(l=o0(t,o,e));let a=t.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Za(t){return t.top<t.bottom||t.left<t.right}function hn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Za(r))return r}return Array.prototype.find.call(n,Za)||t.getBoundingClientRect()}const c0=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Tu(t,e,n){let{node:r,offset:s,atom:i}=t.docView.domFromPos(e,n<0?-1:1),o=ys||jt;if(r.nodeType==3)if(o&&(c0.test(r.nodeValue)||(n<0?!s:s==r.nodeValue.length))){let a=hn(nn(r,s,s),n);if(jt&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let c=hn(nn(r,s-1,s-1),-1);if(c.top==a.top){let u=hn(nn(r,s,s+1),-1);if(u.top!=a.top)return Mr(u,u.left<c.left)}}return a}else{let a=s,c=s,u=n<0?1:-1;return n<0&&!s?(c++,u=-1):n>=0&&s==r.nodeValue.length?(a--,u=1):n<0?a--:c++,Mr(hn(nn(r,a,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==Et(r))){let a=r.childNodes[s-1];if(a.nodeType==1)return xo(a.getBoundingClientRect(),!1)}if(i==null&&s<Et(r)){let a=r.childNodes[s];if(a.nodeType==1)return xo(a.getBoundingClientRect(),!0)}return xo(r.getBoundingClientRect(),n>=0)}if(i==null&&s&&(n<0||s==Et(r))){let a=r.childNodes[s-1],c=a.nodeType==3?nn(a,Et(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Mr(hn(c,1),!1)}if(i==null&&s<Et(r)){let a=r.childNodes[s];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?nn(a,0,o?0:1):a.nodeType==1?a:null:null;if(c)return Mr(hn(c,-1),!0)}return Mr(hn(r.nodeType==3?nn(r):r,-n),n>=0)}function Mr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function xo(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Eu(t,e,n){let r=t.state,s=t.root.activeElement;r!=e&&t.updateState(e),s!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),s!=t.dom&&s&&s.focus()}}function d0(t,e,n){let r=e.selection,s=n=="up"?r.$from:r.$to;return Eu(t,e,()=>{let{node:i}=t.docView.domFromPos(s.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let o=Tu(t,s.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=nn(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(n=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const u0=/[\u0590-\u08ac]/;function h0(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,l=t.domSelection();return l?!u0.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?i:o:Eu(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:h}=t.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),b=m&&!p.contains(m.nodeType==1?m:m.parentNode)||a==m&&c==g;try{l.collapse(u,h),a&&(a!=u||c!=h)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),b}):r.pos==r.start()||r.pos==r.end()}let ec=null,tc=null,nc=!1;function f0(t,e,n){return ec==e&&tc==n?nc:(ec=e,tc=n,nc=n=="up"||n=="down"?d0(t,e,n):h0(t,e,n))}const It=0,rc=1,Bn=2,Ut=3;class xs{constructor(e,n,r,s){this.parent=e,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=It,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].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 n=0,r=this.posAtStart;;n++){let s=this.children[n];if(s==e)return r;r+=s.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,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,o;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}else{let i,o;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(o):this.posAtEnd}let s;if(e==this.dom&&this.contentDOM)s=n>Je(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,s=e;s;s=s.parentNode){let i=this.getDesc(s),o;if(i&&(!n||i.node))if(r&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let s=this.children[n],i=r+s.size;if(r==e&&i!=r){for(;!s.border&&s.children.length;)for(let o=0;o<s.children.length;o++){let l=s.children[o];if(l.size){s=l;break}}return s}if(e<i)return s.descAt(e-r-s.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,s=0;for(let i=0;r<this.children.length;r++){let o=this.children[r],l=i+o.size;if(l>e||o instanceof ju){s=e-i;break}i=l}if(s)return this.children[r].domFromPos(s-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Mu&&i.side>=0;r--);if(n<=0){let i,o=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,o=!1);return i&&n&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Je(i.dom)+1:0}}else{let i,o=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,o=!1);return i&&o&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Je(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,i=-1;for(let o=r,l=0;;l++){let a=this.children[l],c=o+a.size;if(s==-1&&e<=c){let u=o+a.border;if(e>=u&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,u);e=o;for(let h=l;h>0;h--){let f=this.children[h-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){s=Je(f.dom)+1;break}e-=f.size}s==-1&&(s=0)}if(s>-1&&(c>n||l==this.children.length-1)){n=c;for(let u=l+1;u<this.children.length;u++){let h=this.children[u];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=Je(h.dom);break}n+=h.size}i==-1&&(i=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:n,fromOffset:s,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,s=!1){let i=Math.min(e,n),o=Math.max(e,n);for(let p=0,m=0;p<this.children.length;p++){let g=this.children[p],b=m+g.size;if(i>m&&o<b)return g.setSelection(e-m-g.border,n-m-g.border,r,s);m=b}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),h=!1;if((jt||nt)&&e==n){let{node:p,offset:m}=l;if(p.nodeType==3){if(h=!!(m&&p.nodeValue[m-1]==`
23
- `),h&&m==p.nodeValue.length)for(let g=p,b;g;g=g.parentNode){if(b=g.nextSibling){b.nodeName=="BR"&&(l=a={node:b.parentNode,offset:Je(b)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=p.childNodes[m-1];h=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(jt&&u.focusNode&&u.focusNode!=a.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(s=!0)}if(!(s||h&&nt)&&Qn(l.node,l.offset,u.anchorNode,u.anchorOffset)&&Qn(a.node,a.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(h&&jt)){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let m=l;l=a,a=m}let p=document.createRange();p.setEnd(a.node,a.offset),p.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,s=0;s<this.children.length;s++){let i=this.children[s],o=r+i.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let l=r+i.border,a=o-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==o?Bn:rc,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ut:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Bn:Ut}r=o}this.dirty=Bn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Bn:rc;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Mu extends xs{constructor(e,n,r,s){let i,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==It&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(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 p0 extends xs{constructor(e,n,r,s){super(e,[],n,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Xn extends xs{constructor(e,n,r,s,i){super(e,[],r,s),this.mark=n,this.spec=i}static create(e,n,r,s){let i=s.nodeViews[n.type.name],o=i&&i(n,s,r);return(!o||!o.dom)&&(o=tr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Xn(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Ut||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ut&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=It){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=It}}slice(e,n,r){let s=Xn.create(this.parent,this.mark,!0,r),i=this.children,o=this.size;n<o&&(i=sl(i,n,o,r)),e>0&&(i=sl(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=s;return s.children=i,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class kn extends xs{constructor(e,n,r,s,i,o,l,a,c){super(e,[],i,o),this.node=n,this.outerDeco=r,this.innerDeco=s,this.nodeDOM=l}static create(e,n,r,s,i,o){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},r,s),u=c&&c.dom,h=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:h}=tr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Ou(u,r,n),c?a=new m0(e,n,r,s,u,h||null,f,c,i,o+1):n.isText?new Ui(e,n,r,s,u,f,i):new kn(e,n,r,s,u,h||null,f,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>j.empty)}return e}matchesNode(e,n,r){return this.dirty==It&&e.eq(this.node)&&ei(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,s=n,i=e.composing?this.localCompositionInfo(e,n):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new b0(this,o&&o.node,e);v0(this.node,this.innerDeco,(c,u,h)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e,u):c.type.side>=0&&!h&&a.syncToMarks(u==this.node.childCount?ve.none:this.node.child(u).marks,r,e,u),a.placeWidget(c,e,s)},(c,u,h,f)=>{a.syncToMarks(c.marks,r,e,f);let p;a.findNodeMatch(c,u,h,f)||l&&e.state.selection.from>s&&e.state.selection.to<s+c.nodeSize&&(p=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(c,u,h,p,e)||a.updateNextNode(c,u,h,e,f,s)||a.addNode(c,u,h,e,s),s+=c.nodeSize}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Bn)&&(o&&this.protectLocalComposition(e,o),Iu(this.contentDOM,this.children,e),yr&&_0(this.dom))}localCompositionInfo(e,n){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof Q)||r<n||s>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,l=k0(this.node.content,o,r-n,s-n);return l<0?null:{node:i,pos:l,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:s}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new p0(this,i,n,s);e.input.compositionNodes.push(o),this.children=sl(this.children,r,r+s.length,e,o)}update(e,n,r,s){return this.dirty==Ut||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,s),!0)}updateInner(e,n,r,s){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=It}updateOuterDeco(e){if(ei(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Du(this.dom,this.nodeDOM,rl(this.outerDeco,this.node,n),rl(e,this.node,n)),this.dom!=r&&(r.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 sc(t,e,n,r,s){Ou(r,e,t);let i=new kn(void 0,t,e,n,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class Ui extends kn{constructor(e,n,r,s,i,o,l){super(e,n,r,s,i,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,s){return this.dirty==Ut||this.dirty!=It&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=It||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=It,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let s=this.node.cut(e,n),i=document.createTextNode(s.text);return new Ui(this.parent,s,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Ut)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ju extends xs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==It&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class m0 extends kn{constructor(e,n,r,s,i,o,l,a,c,u){super(e,n,r,s,i,o,l,c,u),this.spec=a}update(e,n,r,s){if(this.dirty==Ut)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,s){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,s)}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 Iu(t,e,n){let r=t.firstChild,s=!1;for(let i=0;i<e.length;i++){let o=e[i],l=o.dom;if(l.parentNode==t){for(;l!=r;)r=ic(r),s=!0;r=r.nextSibling}else s=!0,t.insertBefore(l,r);if(o instanceof Xn){let a=r?r.previousSibling:t.lastChild;Iu(o.contentDOM,o.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=ic(r),s=!0;s&&n.trackWrites==t&&(n.trackWrites=null)}const qr=function(t){t&&(this.nodeName=t)};qr.prototype=Object.create(null);const $n=[new qr];function rl(t,e,n){if(t.length==0)return $n;let r=n?$n[0]:new qr,s=[r];for(let i=0;i<t.length;i++){let o=t[i].type.attrs;if(o){o.nodeName&&s.push(r=new qr(o.nodeName));for(let l in o){let a=o[l];a!=null&&(n&&s.length==1&&s.push(r=new qr(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return s}function Du(t,e,n,r){if(n==$n&&r==$n)return e;let s=e;for(let i=0;i<r.length;i++){let o=r[i],l=n[i];if(i){let a;l&&l.nodeName==o.nodeName&&s!=t&&(a=s.parentNode)&&a.nodeName.toLowerCase()==o.nodeName||(a=document.createElement(o.nodeName),a.pmIsDeco=!0,a.appendChild(s),l=$n[0]),s=a}g0(s,l||$n[0],o)}return s}function g0(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],s=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)s.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<s.length;i++)r.indexOf(s[i])==-1&&t.classList.add(s[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=r.exec(e.style);)t.style.removeProperty(s[1])}n.style&&(t.style.cssText+=n.style)}}function Ou(t,e,n){return Du(t,t,$n,rl(e,n,t.nodeType!=1))}function ei(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function ic(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class b0{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=y0(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,s){let i=0,o=this.stack.length>>1,l=Math.min(o,e.length);for(;i<l&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=It,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,c=this.top.children.length;s<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let u=this.index;u<c;u++){let h=this.top.children[u];if(h.matchesMark(e[o])&&!this.isLocked(h.dom)){a=u;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let u=Xn.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))i=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 c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=l;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,s,i){let o=this.top.children[s];return o.dirty==Ut&&o.dom==o.contentDOM&&(o.dirty=Bn),o.update(e,n,r,i)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==r)return s}return-1}e=n}}updateNextNode(e,n,r,s,i,o){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof kn){let c=this.preMatch.matched.get(a);if(c!=null&&c!=i)return!1;let u=a.dom,h,f=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=Ut&&ei(n,a.outerDeco));if(!f&&a.update(e,n,r,s))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(h=this.recreateWrapper(a,e,n,r,s,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Bn,h.updateChildren(s,o+1),h.dirty=It),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,s,i,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!ei(r,e.outerDeco)||!s.eq(e.innerDeco))return null;let l=kn.create(this.top,n,r,s,i,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,n,r,s,i){let o=kn.create(this.top,e,n,r,s,i);o.contentDOM&&o.updateChildren(s,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(e)&&(e==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let i=new Mu(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Xn;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ui)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((nt||Qe)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let s=new ju(this.top,[],r,null);n!=this.top?n.children.push(s):n.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function y0(t,e){let n=e,r=n.children.length,s=t.childCount,i=new Map,o=[];e:for(;s>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof Xn)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(s-1))break;--s,i.set(l,s),o.push(l)}}return{index:s,matched:i,matches:o.reverse()}}function x0(t,e){return t.type.side-e.type.side}function v0(t,e,n,r){let s=e.locals(t),i=0;if(s.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,s,e.forChild(i,u),c),i+=u.nodeSize}return}let o=0,l=[],a=null;for(let c=0;;){let u,h;for(;o<s.length&&s[o].to==i;){let b=s[o++];b.widget&&(u?(h||(h=[u])).push(b):u=b)}if(u)if(h){h.sort(x0);for(let b=0;b<h.length;b++)n(h[b],c,!!a)}else n(u,c,!!a);let f,p;if(a)p=-1,f=a,a=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let b=0;b<l.length;b++)l[b].to<=i&&l.splice(b--,1);for(;o<s.length&&s[o].from<=i&&s[o].to>i;)l.push(s[o++]);let m=i+f.nodeSize;if(f.isText){let b=m;o<s.length&&s[o].from<b&&(b=s[o].from);for(let y=0;y<l.length;y++)l[y].to<b&&(b=l[y].to);b<m&&(a=f.cut(b-i),f=f.cut(0,b-i),m=b,p=-1)}else for(;o<s.length&&s[o].to<m;)o++;let g=f.isInline&&!f.isLeaf?l.filter(b=>!b.inline):l.slice();r(f,g,e.forChild(i,f),p),i=m}}function _0(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function k0(t,e,n,r){for(let s=0,i=0;s<t.childCount&&i<=r;){let o=t.child(s++),l=i;if(i+=o.nodeSize,!o.isText)continue;let a=o.text;for(;s<t.childCount;){let c=t.child(s++);if(i+=c.nodeSize,!c.isText)break;a+=c.text}if(i>=n){if(i>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function sl(t,e,n,r,s){let i=[];for(let o=0,l=0;o<t.length;o++){let a=t[o],c=l,u=l+=a.size;c>=n||u<=e?i.push(a):(c<e&&i.push(a.slice(0,e-c,r)),s&&(i.push(s),s=void 0),u>n&&i.push(a.slice(n-c,a.size,r)))}return i}function Bl(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let s=t.docView.nearestDesc(n.focusNode),i=s&&s.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let l=r.resolve(o),a,c;if(Vi(n)){for(a=o;s&&!s.node;)s=s.parent;let h=s.node;if(s&&h.isAtom&&J.isSelectable(h)&&s.parent&&!(h.isInline&&Jx(n.focusNode,n.focusOffset,s.dom))){let f=s.posBefore;c=new J(o==f?l:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,f=o;for(let p=0;p<n.rangeCount;p++){let m=n.getRangeAt(p);h=Math.min(h,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(h<0)return null;[a,o]=f==t.state.selection.anchor?[f,h]:[h,f],l=r.resolve(o)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let h=e=="pointer"||t.state.selection.head<l.pos&&!i?1:-1;c=$l(t,u,l,h)}return c}function Lu(t){return t.editable?t.hasFocus():Bu(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function ln(t,e=!1){let n=t.state.selection;if(Ru(t,n),!!Lu(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Qe){let r=t.domSelectionRange(),s=t.domObserver.currentSelection;if(r.anchorNode&&s.anchorNode&&Qn(r.anchorNode,r.anchorOffset,s.anchorNode,s.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)C0(t);else{let{anchor:r,head:s}=n,i,o;oc&&!(n instanceof Q)&&(n.$from.parent.inlineContent||(i=lc(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=lc(t,n.to))),t.docView.setSelection(r,s,t,e),oc&&(i&&ac(i),o&&ac(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&w0(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const oc=nt||Qe&&ku<63;function lc(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),s=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(nt&&s&&s.contentEditable=="false")return vo(s);if((!s||s.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(s)return vo(s);if(i)return vo(i)}}function vo(t){return t.contentEditable="true",nt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function ac(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function w0(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,s=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=s)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Lu(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function C0(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Je(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&ht&&_n<=11&&(n.disabled=!0,n.disabled=!1)}function Ru(t,e){if(e instanceof J){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(cc(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else cc(t)}function cc(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function $l(t,e,n,r){return t.someProp("createSelectionBetween",s=>s(t,e,n))||Q.between(e,n,r)}function dc(t){return t.editable&&!t.hasFocus()?!1:Bu(t)}function Bu(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function S0(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Qn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function il(t,e){let{$anchor:n,$head:r}=t.selection,s=e>0?n.max(r):n.min(r),i=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return i&&ie.findFrom(i,e)}function fn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function uc(t,e,n){let r=t.state.selection;if(r instanceof Q)if(n.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return fn(t,new Q(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=il(t.state,e);return s&&s instanceof J?fn(t,s):!1}else if(!(Tt&&n.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let l=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=t.docView.descAt(l))&&!o.contentDOM?J.isSelectable(i)?fn(t,new J(e<0?t.state.doc.resolve(s.pos-i.nodeSize):s)):ys?fn(t,new Q(t.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return fn(t,new Q(e>0?r.$to:r.$from));{let s=il(t.state,e);return s?fn(t,s):!1}}}function ti(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Kr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function lr(t,e){return e<0?N0(t):A0(t)}function N0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s,i,o=!1;for(jt&&n.nodeType==1&&r<ti(n)&&Kr(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Kr(l,-1))s=n,i=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if($u(n))break;{let l=n.previousSibling;for(;l&&Kr(l,-1);)s=n.parentNode,i=Je(l),l=l.previousSibling;if(l)n=l,r=ti(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?ol(t,n,r):s&&ol(t,s,i)}function A0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s=ti(n),i,o;for(;;)if(r<s){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Kr(l,1))i=n,o=++r;else break}else{if($u(n))break;{let l=n.nextSibling;for(;l&&Kr(l,1);)i=l.parentNode,o=Je(l)+1,l=l.nextSibling;if(l)n=l,r=0,s=ti(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}i&&ol(t,i,o)}function $u(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function T0(t,e){for(;t&&e==t.childNodes.length&&!bs(t);)e=Je(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function E0(t,e){for(;t&&!e&&!bs(t);)e=Je(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function ol(t,e,n){if(e.nodeType!=3){let i,o;(o=T0(e,n))?(e=o,n=0):(i=E0(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Vi(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:s}=t;setTimeout(()=>{t.state==s&&ln(t)},50)}function hc(t,e){let n=t.state.doc.resolve(e);if(!(Qe||wu)&&n.parent.inlineContent){let s=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left<s.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function fc(t,e,n){let r=t.state.selection;if(r instanceof Q&&!r.empty||n.indexOf("s")>-1||Tt&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=il(t.state,e);if(o&&o instanceof J)return fn(t,o)}if(!s.parent.inlineContent){let o=e<0?s:i,l=r instanceof vt?ie.near(o,e):ie.findFrom(o,e);return l?fn(t,l):!1}return!1}function pc(t,e){if(!(t.state.selection instanceof Q))return!0;let{$head:n,$anchor:r,empty:s}=t.state.selection;if(!n.sameParent(r))return!0;if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let o=t.state.tr;return e<0?o.delete(n.pos-i.nodeSize,n.pos):o.delete(n.pos,n.pos+i.nodeSize),t.dispatch(o),!0}return!1}function mc(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function M0(t){if(!nt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;mc(t,r,"true"),setTimeout(()=>mc(t,r,"false"),20)}return!1}function j0(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function I0(t,e){let n=e.keyCode,r=j0(e);if(n==8||Tt&&n==72&&r=="c")return pc(t,-1)||lr(t,-1);if(n==46&&!e.shiftKey||Tt&&n==68&&r=="c")return pc(t,1)||lr(t,1);if(n==13||n==27)return!0;if(n==37||Tt&&n==66&&r=="c"){let s=n==37?hc(t,t.state.selection.from)=="ltr"?-1:1:-1;return uc(t,s,r)||lr(t,s)}else if(n==39||Tt&&n==70&&r=="c"){let s=n==39?hc(t,t.state.selection.from)=="ltr"?1:-1:1;return uc(t,s,r)||lr(t,s)}else{if(n==38||Tt&&n==80&&r=="c")return fc(t,-1,r)||lr(t,-1);if(n==40||Tt&&n==78&&r=="c")return M0(t)||fc(t,1,r)||lr(t,1);if(r==(Tt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Pl(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=t.someProp("clipboardSerializer")||tr.fromSchema(t.state.schema),l=Vu(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let c=a.firstChild,u,h=0;for(;c&&c.nodeType==1&&(u=Wu[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=l.createElement(u[p]);for(;a.firstChild;)m.appendChild(a.firstChild);a.appendChild(m),h++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
24
-
25
- `);return{dom:a,text:f,slice:e}}function Pu(t,e,n,r,s){let i=s.parent.type.spec.code,o,l;if(!n&&!e)return null;let a=!!e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return l=new F(j.from(t.state.schema.text(e.replace(/\r\n?/g,`
26
- `))),0,0),t.someProp("transformPasted",f=>{l=f(l,t,!0)}),l;let h=t.someProp("clipboardTextParser",f=>f(e,s,r,t));if(h)l=h;else{let f=s.marks(),{schema:p}=t.state,m=tr.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=o.appendChild(document.createElement("p"));g&&b.appendChild(m.serializeNode(p.text(g,f)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=R0(n),ys&&B0(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let h=+u[3];h>0;h--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||vn.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!D0.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=$0(gc(l,+u[1],+u[2]),u[4]);else if(l=F.maxOpen(O0(l.content,s),!0),l.openStart||l.openEnd){let h=0,f=0;for(let p=l.content.firstChild;h<l.openStart&&!p.type.spec.isolating;h++,p=p.firstChild);for(let p=l.content.lastChild;f<l.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);l=gc(l,h,f)}return t.someProp("transformPasted",h=>{l=h(l,t,a)}),l}const D0=/^(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 O0(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let s=e.node(n).contentMatchAt(e.index(n)),i,o=[];if(t.forEach(l=>{if(!o)return;let a=s.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&i.length&&Fu(a,i,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=Hu(o[o.length-1],i.length));let u=zu(l,a);o.push(u),s=s.matchType(u.type),i=a}}),o)return j.from(o)}return t}function zu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,j.from(t));return t}function Fu(t,e,n,r,s){if(s<t.length&&s<e.length&&t[s]==e[s]){let i=Fu(t,e,n,r.lastChild,s+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(s==t.length-1?n.type:t[s+1]))return r.copy(r.content.append(j.from(zu(n,t,s+1))))}}function Hu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Hu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(j.empty,!0);return t.copy(n.append(r))}function ll(t,e,n,r,s,i){let o=e<0?t.firstChild:t.lastChild,l=o.content;return t.childCount>1&&(i=0),s<r-1&&(l=ll(l,e,n,r,s+1,i)),s>=n&&(l=e<0?o.contentMatchAt(0).fillBefore(l,i<=s).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(j.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(l))}function gc(t,e,n){return e<t.openStart&&(t=new F(ll(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new F(ll(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Wu={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let bc=null;function Vu(){return bc||(bc=document.implementation.createHTMLDocument("title"))}let _o=null;function L0(t){let e=window.trustedTypes;return e?(_o||(_o=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),_o.createHTML(t)):t}function R0(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Vu().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),s;if((s=r&&Wu[r[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=L0(t),s)for(let i=0;i<s.length;i++)n=n.querySelector(s[i])||n;return n}function B0(t){let e=t.querySelectorAll(Qe?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function $0(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:s,openStart:i,openEnd:o}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;s=j.from(a.create(r[l+1],s)),i++,o++}return new F(s,i,o)}const it={},ot={},P0={touchstart:!0,touchmove:!0};class z0{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 F0(t){for(let e in it){let n=it[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{W0(t,r)&&!zl(t,r)&&(t.editable||!(r.type in ot))&&n(t,r)},P0[e]?{passive:!0}:void 0)}nt&&t.dom.addEventListener("input",()=>null),al(t)}function xn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function H0(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function al(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>zl(t,r))})}function zl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function W0(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function V0(t,e){!zl(t,e)&&it[e.type]&&(t.editable||!(e.type in ot))&&it[e.type](t,e)}ot.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!qu(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(sn&&Qe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),yr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",s=>s(t,Rn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||I0(t,n)?n.preventDefault():xn(t,"key")};ot.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ot.keypress=(t,e)=>{let n=e;if(qu(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Tt&&n.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Q)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,s,i))&&t.dispatch(i()),n.preventDefault()}};function qi(t){return{left:t.clientX,top:t.clientY}}function U0(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Fl(t,e,n,r,s){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(t.someProp(e,l=>o>i.depth?l(t,n,i.nodeAfter,i.before(o),s,!0):l(t,n,i.node(o),i.before(o),s,!1)))return!0;return!1}function fr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function q0(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(fr(t,new J(n)),!0):!1}function K0(t,e){if(e==-1)return!1;let n=t.state.selection,r,s;n instanceof J&&(r=n.node);let i=t.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o);if(J.isSelectable(l)){r&&n.$from.depth>0&&o>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?s=i.before(n.$from.depth):s=i.before(o);break}}return s!=null?(fr(t,J.create(t.state.doc,s)),!0):!1}function G0(t,e,n,r,s){return Fl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(s?K0(t,n):q0(t,n))}function J0(t,e,n,r){return Fl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",s=>s(t,e,r))}function Y0(t,e,n,r){return Fl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",s=>s(t,e,r))||Q0(t,n,r)}function Q0(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(fr(t,Q.create(r,0,r.content.size)),!0):!1;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),l=s.before(i);if(o.inlineContent)fr(t,Q.create(r,l+1,l+1+o.content.size));else if(J.isSelectable(o))fr(t,J.create(r,l));else continue;return!0}}function Hl(t){return ni(t)}const Uu=Tt?"metaKey":"ctrlKey";it.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Hl(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&U0(n,t.input.lastClick)&&!n[Uu]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i,button:n.button};let o=t.posAtCoords(qi(n));o&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new X0(t,o,n,!!r)):(i=="doubleClick"?J0:Y0)(t,o.pos,o.inside,n)?n.preventDefault():xn(t,"pointer"))};class X0{constructor(e,n,r,s){this.view=e,this.pos=n,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Uu],this.allowDefault=r.shiftKey;let i,o;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),o=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,o=u.depth?u.before():0}const l=s?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof J&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&jt&&!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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),xn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),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(()=>ln(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(qi(e))),this.updateAllowDefault(e),this.allowDefault||!n?xn(this.view,"pointer"):G0(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||nt&&this.mightDrag&&!this.mightDrag.node.isAtom||Qe&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(fr(this.view,ie.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):xn(this.view,"pointer")}move(e){this.updateAllowDefault(e),xn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}it.touchstart=t=>{t.input.lastTouch=Date.now(),Hl(t),xn(t,"pointer")};it.touchmove=t=>{t.input.lastTouch=Date.now(),xn(t,"pointer")};it.contextmenu=t=>Hl(t);function qu(t,e){return t.composing?!0:nt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Z0=sn?5e3:-1;ot.compositionstart=ot.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Q&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Qe&&wu&&ev(t)))t.markCursor=t.state.storedMarks||n.marks(),ni(t,!0),t.markCursor=null;else if(ni(t,!e.selection.empty),jt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let l=t.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}t.input.composing=!0}Ku(t,Z0)};function ev(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}ot.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Ku(t,20))};function Ku(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ni(t),e))}function Gu(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=nv());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function tv(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Kx(e.focusNode,e.focusOffset),r=Gx(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let s=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function nv(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function ni(t,e=!1){if(!(sn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Gu(t),e||t.docView&&t.docView.dirty){let n=Bl(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function rv(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const is=ht&&_n<15||yr&&Xx<604;it.copy=ot.cut=(t,e)=>{let n=e,r=t.state.selection,s=n.type=="cut";if(r.empty)return;let i=is?null:n.clipboardData,o=r.content(),{dom:l,text:a}=Pl(t,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):rv(t,l),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function sv(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function iv(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ls(t,r.value,null,s,e):ls(t,r.textContent,r.innerHTML,s,e)},50)}function ls(t,e,n,r,s){let i=Pu(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,s,i||F.empty)))return!0;if(!i)return!1;let o=sv(i),l=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(i);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ju(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ot.paste=(t,e)=>{let n=e;if(t.composing&&!sn)return;let r=is?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ls(t,Ju(r),r.getData("text/html"),s,n)?n.preventDefault():iv(t,n)};class Yu{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const ov=Tt?"altKey":"ctrlKey";function Qu(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[ov]}it.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let s=t.state.selection,i=s.empty?null:t.posAtCoords(qi(n)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof J?s.to-1:s.to))){if(r&&r.mightDrag)o=J.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=J.create(t.state.doc,h.posBefore))}}let l=(o||t.state.selection).content(),{dom:a,text:c,slice:u}=Pl(t,l);(!n.dataTransfer.files.length||!Qe||ku>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(is?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",is||n.dataTransfer.setData("text/plain",c),t.dragging=new Yu(u,Qu(t,n),o)};it.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ot.dragover=ot.dragenter=(t,e)=>e.preventDefault();ot.drop=(t,e)=>{try{lv(t,e,t.dragging)}finally{t.dragging=null}};function lv(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(qi(e));if(!r)return;let s=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",p=>{i=p(i,t,!1)}):i=Pu(t,Ju(e.dataTransfer),is?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&Qu(t,e));if(t.someProp("handleDrop",p=>p(t,e,i||F.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?eu(t.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let a=t.state.tr;if(o){let{node:p}=n;p?p.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=a.doc;if(u?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(h))return;let f=a.doc.resolve(c);if(u&&J.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new J(f));else{let p=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((m,g,b,y)=>p=y),a.setSelection($l(t,f,a.doc.resolve(p)))}t.focus(),t.dispatch(a.setMeta("uiEvent","drop"))}it.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&ln(t)},20))};it.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};it.beforeinput=(t,e)=>{if(Qe&&sn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,Rn(8,"Backspace")))))return;let{$cursor:s}=t.state.selection;s&&s.pos>0&&t.dispatch(t.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let t in ot)it[t]=ot[t];function as(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class ri{constructor(e,n){this.toDOM=e,this.spec=n||Un,this.side=this.spec.side||0}map(e,n,r,s){let{pos:i,deleted:o}=e.mapResult(n.from+s,this.side<0?-1:1);return o?null:new tt(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ri&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&as(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class wn{constructor(e,n){this.attrs=e,this.spec=n||Un}map(e,n,r,s){let i=e.map(n.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new tt(i,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof wn&&as(this.attrs,e.attrs)&&as(this.spec,e.spec)}static is(e){return e.type instanceof wn}destroy(){}}class Wl{constructor(e,n){this.attrs=e,this.spec=n||Un}map(e,n,r,s){let i=e.mapResult(n.from+s,1);if(i.deleted)return null;let o=e.mapResult(n.to+s,-1);return o.deleted||o.pos<=i.pos?null:new tt(i.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:s}=e.content.findIndex(n.from),i;return s==n.from&&!(i=e.child(r)).isText&&s+i.nodeSize==n.to}eq(e){return this==e||e instanceof Wl&&as(this.attrs,e.attrs)&&as(this.spec,e.spec)}destroy(){}}class tt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new tt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new tt(e,e,new ri(n,r))}static inline(e,n,r,s){return new tt(e,n,new wn(r,s))}static node(e,n,r,s){return new tt(e,n,new Wl(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof wn}get widget(){return this.type instanceof ri}}const cr=[],Un={};class Se{constructor(e,n){this.local=e.length?e:cr,this.children=n.length?n:cr}static create(e,n){return n.length?si(n,e,0,Un):et}find(e,n,r){let s=[];return this.findInner(e??0,n??1e9,s,0,r),s}findInner(e,n,r,s,i){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=n&&l.to>=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+s,l.to+s))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,n-l,r,s+l,i)}}map(e,n,r){return this==et||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Un)}mapInner(e,n,r,s,i){let o;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,s);a&&a.type.valid(n,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?av(this.children,o||[],e,n,r,s,i):o?new Se(o.sort(qn),cr):et}add(e,n){return n.length?this==et?Se.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let s,i=0;e.forEach((l,a)=>{let c=a+r,u;if(u=Zu(n,l,c)){for(s||(s=this.children.slice());i<s.length&&s[i]<a;)i+=3;s[i]==a?s[i+2]=s[i+2].addInner(l,u,c+1):s.splice(i,0,a,a+l.nodeSize,si(u,l,c+1,Un)),i+=3}});let o=Xu(i?eh(n):n,-r);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new Se(o.length?this.local.concat(o).sort(qn):this.local,s||this.children)}remove(e){return e.length==0||this==et?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,s=this.local;for(let i=0;i<r.length;i+=3){let o,l=r[i]+n,a=r[i+1]+n;for(let u=0,h;u<e.length;u++)(h=e[u])&&h.from>l&&h.to<a&&(e[u]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(o,l+1);c!=et?r[i+2]=c:(r.splice(i,3),i-=3)}if(s.length){for(let i=0,o;i<e.length;i++)if(o=e[i])for(let l=0;l<s.length;l++)s[l].eq(o,n)&&(s==this.local&&(s=this.local.slice()),s.splice(l--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new Se(s,r):et}forChild(e,n){if(this==et)return this;if(n.isLeaf)return Se.empty;let r,s;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,o=i+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<o&&a.to>i&&a.type instanceof wn){let c=Math.max(i,a.from)-i,u=Math.min(o,a.to)-i;c<u&&(s||(s=[])).push(a.copy(c,u))}}if(s){let l=new Se(s.sort(qn),cr);return r?new gn([l,r]):l}return r||et}eq(e){if(this==e)return!0;if(!(e instanceof Se)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Vl(this.localsInner(e))}localsInner(e){if(this==et)return cr;if(e.inlineContent||!this.local.some(wn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof wn||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Se.empty=new Se([],[]);Se.removeOverlap=Vl;const et=Se.empty;class gn{constructor(e){this.members=e}map(e,n){const r=this.members.map(s=>s.map(e,n,Un));return gn.from(r)}forChild(e,n){if(n.isLeaf)return Se.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,n);i!=et&&(i instanceof gn?r=r.concat(i.members):r.push(i))}return gn.from(r)}eq(e){if(!(e instanceof gn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let s=0;s<this.members.length;s++){let i=this.members[s].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let o=0;o<i.length;o++)n.push(i[o])}}return n?Vl(r?n:n.sort(qn)):cr}static from(e){switch(e.length){case 0:return et;case 1:return e[0];default:return new gn(e.every(n=>n instanceof Se)?e:e.reduce((n,r)=>n.concat(r instanceof Se?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function av(t,e,n,r,s,i,o){let l=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let h=0;n.maps[c].forEach((f,p,m,g)=>{let b=g-m-(p-f);for(let y=0;y<l.length;y+=3){let v=l[y+1];if(v<0||f>v+u-h)continue;let _=l[y]+u-h;p>=_?l[y+1]=f<=_?-2:-1:f>=u&&b&&(l[y]+=b,l[y+1]+=b)}h+=b}),u=n.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=n.map(t[c]+i),h=u-s;if(h<0||h>=r.content.size){a=!0;continue}let f=n.map(t[c+1]+i,-1),p=f-s,{index:m,offset:g}=r.content.findIndex(h),b=r.maybeChild(m);if(b&&g==h&&g+b.nodeSize==p){let y=l[c+2].mapInner(n,b,u+1,t[c]+i+1,o);y!=et?(l[c]=h,l[c+1]=p,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=cv(l,t,e,n,s,i,o),u=si(c,r,0,o);e=u.local;for(let h=0;h<l.length;h+=3)l[h+1]<0&&(l.splice(h,3),h-=3);for(let h=0,f=0;h<u.children.length;h+=3){let p=u.children[h];for(;f<l.length&&l[f]<p;)f+=3;l.splice(f,0,u.children[h],u.children[h+1],u.children[h+2])}}return new Se(e.sort(qn),l)}function Xu(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let s=t[r];n.push(new tt(s.from+e,s.to+e,s.type))}return n}function cv(t,e,n,r,s,i,o){function l(a,c){for(let u=0;u<a.local.length;u++){let h=a.local[u].map(r,s,c);h?n.push(h):o.onRemove&&o.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+i+1);return n}function Zu(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,s=null;for(let i=0,o;i<t.length;i++)(o=t[i])&&o.from>n&&o.to<r&&((s||(s=[])).push(o),t[i]=null);return s}function eh(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function si(t,e,n,r){let s=[],i=!1;e.forEach((l,a)=>{let c=Zu(t,l,a+n);if(c){i=!0;let u=si(c,l,n+a+1,r);u!=et&&s.push(a,a+l.nodeSize,u)}});let o=Xu(i?eh(t):t,-n).sort(qn);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(r.onRemove&&r.onRemove(o[l].spec),o.splice(l--,1));return o.length||s.length?new Se(o,s):et}function qn(t,e){return t.from-e.from||t.to-e.to}function Vl(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let s=n+1;s<e.length;s++){let i=e[s];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[s]=i.copy(i.from,r.to),yc(e,s+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),yc(e,s,r.copy(i.from,r.to)));break}}}return e}function yc(t,e,n){for(;e<t.length&&qn(n,t[e])>0;)e++;t.splice(e,0,n)}function ko(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=et&&e.push(r)}),t.cursorWrapper&&e.push(Se.create(t.state.doc,[t.cursorWrapper.deco])),gn.from(e)}const dv={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},uv=ht&&_n<=11;class hv{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 fv{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new hv,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;s<r.length;s++)this.queue.push(r[s]);ht&&_n<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():nt&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),uv&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,dv)),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 n=0;n<e.length;n++)this.queue.push(e[n]);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(dc(this.view)){if(this.suppressingSelectionUpdates)return ln(this.view);if(ht&&_n<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Qn(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 n=new Set,r;for(let i=e.focusNode;i;i=br(i))n.add(i);for(let i=e.anchorNode;i;i=br(i))if(n.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))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 n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&dc(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,l=!1,a=[];if(e.editable)for(let u=0;u<n.length;u++){let h=this.registerMutation(n[u],a);h&&(i=i<0?h.from:Math.min(h.from,i),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(l=!0))}if(a.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let u of a)if(u.nodeName=="BR"&&u.parentNode){let h=u.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){u.parentNode.removeChild(u);break}h=h.firstChild}}}else if(jt&&a.length){let u=a.filter(h=>h.nodeName=="BR");if(u.length==2){let[h,f]=u;h.parentNode&&h.parentNode.parentNode==f.parentNode?f.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&p.nodeName=="LI"&&(!h||gv(e,h)!=p)&&f.remove()}}}let c=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Vi(r)&&(c=Bl(e))&&c.eq(ie.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ln(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||s)&&(i>-1&&(e.docView.markDirty(i,o),pv(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,bv(e,a)),this.handleDOMChange(i,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||ln(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let h=e.addedNodes[u];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let s=e.previousSibling,i=e.nextSibling;if(ht&&_n<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:h,nextSibling:f}=e.addedNodes[u];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let o=s&&s.parentNode==e.target?Je(s)+1:0,l=r.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?Je(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let xc=new WeakMap,vc=!1;function pv(t){if(!xc.has(t)&&(xc.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=jt,vc)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."),vc=!0}}function _c(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Qn(o.node,o.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function mv(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return _c(t,s)}let n;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?_c(t,n):null}function gv(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function bv(t,e){var n;let{focusNode:r,focusOffset:s}=t.domSelectionRange();for(let i of e)if(((n=i.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=i.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(i,l.firstChild),r==i&&t.domSelection().collapse(i,s)}else i.parentNode.removeChild(i)}}function yv(t,e,n){let{node:r,fromOffset:s,toOffset:i,from:o,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),c,u=a.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:a.anchorOffset}],Vi(a)||c.push({node:a.focusNode,offset:a.focusOffset})),Qe&&t.input.lastKeyCode===8)for(let b=i;b>s;b--){let y=r.childNodes[b-1],v=y.pmViewDesc;if(y.nodeName=="BR"&&!v){i=b;break}if(!v||v.size)break}let h=t.state.doc,f=t.someProp("domParser")||vn.fromSchema(t.state.schema),p=h.resolve(o),m=null,g=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:xv,context:p});if(c&&c[0].pos!=null){let b=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=b),m={anchor:b+o,head:y+o}}return{doc:g,sel:m,from:o,to:l}}function xv(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(nt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||nt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const vv=/^(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 _v(t,e,n,r,s){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,D=Bl(t,C);if(D&&!t.state.selection.eq(D)){if(Qe&&sn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",N=>N(t,Rn(13,"Enter"))))return;let B=t.state.tr.setSelection(D);C=="pointer"?B.setMeta("pointer",!0):C=="key"&&B.scrollIntoView(),i&&B.setMeta("composition",i),t.dispatch(B)}return}let o=t.state.doc.resolve(e),l=o.sharedDepth(n);e=o.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,c=yv(t,e,n),u=t.state.doc,h=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=Cv(h.content,c.doc.content,c.from,f,p);if(m&&t.input.domChangeCount++,(yr&&t.input.lastIOSEnter>Date.now()-225||sn)&&s.some(C=>C.nodeType==1&&!vv.test(C.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",C=>C(t,Rn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&a instanceof Q&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let C=kc(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let D=t.state.tr.setSelection(C);i&&D.setMeta("composition",i),t.dispatch(D)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof Q&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),ht&&_n<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),b=c.doc.resolveNoCache(m.endB-c.from),y=u.resolve(m.start),v=g.sameParent(b)&&g.parent.inlineContent&&y.end()>=m.endA;if((yr&&t.input.lastIOSEnter>Date.now()-225&&(!v||s.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!v&&g.pos<c.doc.content.size&&(!g.sameParent(b)||!g.parent.inlineContent)&&g.pos<b.pos&&!/\S/.test(c.doc.textBetween(g.pos,b.pos,"","")))&&t.someProp("handleKeyDown",C=>C(t,Rn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&wv(u,m.start,m.endA,g,b)&&t.someProp("handleKeyDown",C=>C(t,Rn(8,"Backspace")))){sn&&Qe&&t.domObserver.suppressSelectionUpdates();return}Qe&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),sn&&!v&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,b=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,Rn(13,"Enter"))})},20));let _=m.start,w=m.endA,k=C=>{let D=C||t.state.tr.replace(_,w,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let B=kc(t,D.doc,c.sel);B&&!(Qe&&t.composing&&B.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(B.head==_||B.head==D.mapping.map(w)-1)||ht&&B.empty&&B.head==_)&&D.setSelection(B)}return i&&D.setMeta("composition",i),D.scrollIntoView()},S;if(v)if(g.pos==b.pos){ht&&_n<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>ln(t),20));let C=k(t.state.tr.delete(_,w)),D=u.resolve(m.start).marksAcross(u.resolve(m.endA));D&&C.ensureMarks(D),t.dispatch(C)}else if(m.endA==m.endB&&(S=kv(g.parent.content.cut(g.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let C=k(t.state.tr);S.type=="add"?C.addMark(_,w,S.mark):C.removeMark(_,w,S.mark),t.dispatch(C)}else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let C=g.parent.textBetween(g.parentOffset,b.parentOffset),D=()=>k(t.state.tr.insertText(C,_,w));t.someProp("handleTextInput",B=>B(t,_,w,C,D))||t.dispatch(D())}else t.dispatch(k());else t.dispatch(k())}function kc(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:$l(t,e.resolve(n.anchor),e.resolve(n.head))}function kv(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,s=n,i=r,o,l,a;for(let u=0;u<r.length;u++)s=r[u].removeFromSet(s);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(s.length==1&&i.length==0)l=s[0],o="add",a=u=>u.mark(l.addToSet(u.marks));else if(s.length==0&&i.length==1)l=i[0],o="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(a(e.child(u)));if(j.from(c).eq(t))return{mark:l,type:o}}function wv(t,e,n,r,s){if(n-e<=s.pos-r.pos||wo(r,!0,!1)<s.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let l=i.nodeAfter;return l!=null&&n==e+l.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let o=t.resolve(wo(i,!0,!0));return!o.parent.isTextblock||o.pos>n||wo(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function wo(t,e,n){let r=t.depth,s=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,s++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function Cv(t,e,n,r,s){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:o,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(s=="end"){let a=Math.max(0,i-Math.min(o,l));r-=o+a-i}if(o<i&&t.size<e.size){let a=r<=i&&r>=o?i-r:0;i-=a,i&&i<e.size&&wc(e.textBetween(i-1,i+1))&&(i+=a?1:-1),l=i+(l-o),o=i}else if(l<i){let a=r<=i&&r>=l?i-r:0;i-=a,i&&i<t.size&&wc(t.textBetween(i-1,i+1))&&(i+=a?1:-1),o=i+(o-l),l=i}return{start:i,endA:o,endB:l}}function wc(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class th{constructor(e,n){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 z0,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Tc),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=Nc(this),Sc(this),this.nodeViews=Ac(this),this.docView=sc(this.state.doc,Cc(this),ko(this),this.dom,this),this.domObserver=new fv(this,(r,s,i,o)=>_v(this,r,s,i,o)),this.domObserver.start(),F0(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&al(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Tc),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let s=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Gu(this),o=!0),this.state=e;let l=s.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=Ac(this);Nv(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&al(this),this.editable=Nc(this),Sc(this);let a=ko(this),c=Cc(this),u=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,c,a);(h||!e.selection.eq(s.selection))&&(o=!0);let f=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&t0(this);if(o){this.domObserver.stop();let p=h&&(ht||Qe)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&Sv(s.selection,e.selection);if(h){let m=Qe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=tv(this)),(i||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=sc(e.doc,c,a,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&S0(this))?ln(this,p):(Ru(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&n0(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Xa(this,n.getBoundingClientRect(),e)}else Xa(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 n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,s=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)s=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(s=i)}this.dragging=new Yu(e.slice,e.move,s<0?void 0:J.create(this.state.doc,s))}someProp(e,n){let r=this._props&&this._props[e],s;if(r!=null&&(s=n?n(r):r))return s;for(let o=0;o<this.directPlugins.length;o++){let l=this.directPlugins[o].props[e];if(l!=null&&(s=n?n(l):l))return s}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let l=i[o].props[e];if(l!=null&&(s=n?n(l):l))return s}}hasFocus(){if(ht){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&&r0(this.dom),ln(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return a0(this,e)}coordsAtPos(e,n=1){return Tu(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let s=this.docView.posFromDOM(e,n,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,n){return f0(this,n||this.state,e)}pasteHTML(e,n){return ls(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ls(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Pl(this,e)}destroy(){this.docView&&(H0(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ko(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Ux())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return V0(this,e)}domSelectionRange(){let e=this.domSelection();return e?nt&&this.root.nodeType===11&&Yx(this.dom.ownerDocument)==this.dom&&mv(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}th.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Cc(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[tt.node(0,t.state.doc.content.size,e)]}function Sc(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:tt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Nc(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Sv(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Ac(t){let e=Object.create(null);function n(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Nv(t,e){let n=0,r=0;for(let s in t){if(t[s]!=e[s])return!0;n++}for(let s in e)r++;return n!=r}function Tc(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Cn={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:"'"},ii={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Av=typeof navigator<"u"&&/Mac/.test(navigator.platform),Tv=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ye=0;Ye<10;Ye++)Cn[48+Ye]=Cn[96+Ye]=String(Ye);for(var Ye=1;Ye<=24;Ye++)Cn[Ye+111]="F"+Ye;for(var Ye=65;Ye<=90;Ye++)Cn[Ye]=String.fromCharCode(Ye+32),ii[Ye]=String.fromCharCode(Ye);for(var Co in Cn)ii.hasOwnProperty(Co)||(ii[Co]=Cn[Co]);function Ev(t){var e=Av&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Tv&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ii:Cn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Mv=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),jv=typeof navigator<"u"&&/Win/.test(navigator.platform);function Iv(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,s,i,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))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))Mv?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),o&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function Dv(t){let e=Object.create(null);for(let n in t)e[Iv(n)]=t[n];return e}function So(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Ov(t){return new Ne({props:{handleKeyDown:nh(t)}})}function nh(t){let e=Dv(t);return function(n,r){let s=Ev(r),i,o=e[So(s,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let l=e[So(s,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(jv&&r.ctrlKey&&r.altKey)&&(i=Cn[r.keyCode])&&i!=s){let l=e[So(i,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var Lv=Object.defineProperty,Ul=(t,e)=>{for(var n in e)Lv(t,n,{get:e[n],enumerable:!0})};function Ki(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:s}=n,{storedMarks:i}=n;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 i},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,i=n.storedMarks,n}}}var Gi=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:s}=n,i=this.buildProps(s);return Object.fromEntries(Object.entries(t).map(([o,l])=>[o,(...c)=>{const u=l(...c)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o=[],l=!!t,a=t||s.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(a),o.every(h=>h===!0)),u={...Object.fromEntries(Object.entries(n).map(([h,f])=>[h,(...m)=>{const g=this.buildProps(a,e),b=f(...m)(g);return o.push(b),u}])),run:c};return u}createCan(t){const{rawCommands:e,state:n}=this,r=!1,s=t||n.tr,i=this.buildProps(s,r);return{...Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>a(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o={tr:t,editor:r,view:i,state:Ki({state:s,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,a])=>[l,(...c)=>a(...c)(o)]))}};return o}},rh={};Ul(rh,{blur:()=>Rv,clearContent:()=>Bv,clearNodes:()=>$v,command:()=>Pv,createParagraphNear:()=>zv,cut:()=>Fv,deleteCurrentNode:()=>Hv,deleteNode:()=>Wv,deleteRange:()=>Vv,deleteSelection:()=>Kv,enter:()=>Gv,exitCode:()=>Jv,extendMarkRange:()=>Yv,first:()=>Qv,focus:()=>Zv,forEach:()=>e_,insertContent:()=>t_,insertContentAt:()=>s_,joinBackward:()=>l_,joinDown:()=>o_,joinForward:()=>a_,joinItemBackward:()=>c_,joinItemForward:()=>d_,joinTextblockBackward:()=>u_,joinTextblockForward:()=>h_,joinUp:()=>i_,keyboardShortcut:()=>p_,lift:()=>m_,liftEmptyBlock:()=>g_,liftListItem:()=>b_,newlineInCode:()=>y_,resetAttributes:()=>x_,scrollIntoView:()=>v_,selectAll:()=>__,selectNodeBackward:()=>k_,selectNodeForward:()=>w_,selectParentNode:()=>C_,selectTextblockEnd:()=>S_,selectTextblockStart:()=>N_,setContent:()=>A_,setMark:()=>G_,setMeta:()=>J_,setNode:()=>Y_,setNodeSelection:()=>Q_,setTextDirection:()=>X_,setTextSelection:()=>Z_,sinkListItem:()=>ek,splitBlock:()=>tk,splitListItem:()=>nk,toggleList:()=>sk,toggleMark:()=>ik,toggleNode:()=>ok,toggleWrap:()=>lk,undoInputRule:()=>ak,unsetAllMarks:()=>ck,unsetMark:()=>dk,unsetTextDirection:()=>uk,updateAttributes:()=>hk,wrapIn:()=>fk,wrapInList:()=>pk});var Rv=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Bv=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),$v=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:s}=r;return n&&s.forEach(({$from:i,$to:o})=>{t.doc.nodesBetween(i.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,h=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),p=h.blockRange(f);if(!p)return;const m=_r(p);if(l.type.isTextblock){const{defaultType:g}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},Pv=t=>e=>t(e),zv=()=>({state:t,dispatch:e})=>bu(t,e),Fv=(t,e)=>({editor:n,tr:r})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,i.content),r.setSelection(new Q(r.doc.resolve(Math.max(o-1,0)))),!0},Hv=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const s=t.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(e){const l=s.before(i),a=s.after(i);t.delete(l,a).scrollIntoView()}return!0}return!1};function He(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var Wv=t=>({tr:e,state:n,dispatch:r})=>{const s=He(t,n.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s){if(r){const a=i.before(o),c=i.after(o);e.delete(a,c).scrollIntoView()}return!0}return!1},Vv=t=>({tr:e,dispatch:n})=>{const{from:r,to:s}=t;return n&&e.delete(r,s),!0},Uv=t=>t.content?/^text(\*|\+)/.test(t.content):!1,Ec=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos<t.end())return t.pos;const r=e.nodes[t.parent.type.name].spec;return Uv(r)?n==="left"?t.start()-1:t.end()+1:t.pos},qv=(t,e,n)=>{const r=Ec(t,n,"left"),s=Ec(e,n,"right");return{from:r,to:s}},Kv=()=>({state:t,dispatch:e})=>{const{$from:n,$to:r}=t.selection;if(t.selection.empty)return!1;const{from:s,to:i}=qv(n,r,t.schema);return e&&(t.tr.deleteRange(s,i).scrollIntoView(),e(t.tr)),!0},Gv=()=>({commands:t})=>t.keyboardShortcut("Enter"),Jv=()=>({state:t,dispatch:e})=>Mx(t,e);function ql(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function oi(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>n.strict?e[s]===t[s]:ql(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function sh(t,e,n={}){return t.find(r=>r.type===e&&oi(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function Mc(t,e,n={}){return!!sh(t,e,n)}function Kl(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===e))return;if(!n){const c=r.node.marks.find(u=>u.type===e);c&&(n=c.attrs)}if(!sh([...r.node.marks],e,n))return;let i=r.index,o=t.start()+r.offset,l=i+1,a=o+r.node.nodeSize;for(;i>0&&Mc([...t.parent.child(i-1).marks],e,n);)i-=1,o-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&Mc([...t.parent.child(l).marks],e,n);)a+=t.parent.child(l).nodeSize,l+=1;return{from:o,to:a}}function an(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var Yv=(t,e)=>({tr:n,state:r,dispatch:s})=>{const i=an(t,r.schema),{doc:o,selection:l}=n,{$from:a,from:c,to:u}=l;if(s){const h=Kl(a,i,e);if(h&&h.from<=c&&h.to>=u){const f=Q.create(o,h.from,h.to);n.setSelection(f)}}return!0},Qv=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function ih(t){return t instanceof Q}function Pn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function oh(t,e=null){if(!e)return null;const n=ie.atStart(t),r=ie.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const s=n.from,i=r.to;return e==="all"?Q.create(t,Pn(0,s,i),Pn(t.content.size,s,i)):Q.create(t,Pn(e,s,i),Pn(e,s,i))}function jc(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function li(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Xv(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Zv=(t=null,e={})=>({editor:n,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(li()||jc())&&r.dom.focus(),Xv()&&!li()&&!jc()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(i&&t===null&&!ih(n.state.selection))return o(),!0;const l=oh(s.doc,t)||n.state.selection,a=n.state.selection.eq(l);return i&&(a||s.setSelection(l),a&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},e_=(t,e)=>n=>t.every((r,s)=>e(r,{...n,index:s})),t_=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),lh=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&lh(r)}return t};function js(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return lh(n)}function cs(t,e,n){if(t instanceof Mt||t instanceof j)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,s=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return j.fromArray(t.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),cs("",e,n)}if(s){if(n.errorOnInvalidContent){let o=!1,l="";const a=new Wd({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:c=>(o=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?vn.fromSchema(a).parseSlice(js(t),n.parseOptions):vn.fromSchema(a).parse(js(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=vn.fromSchema(e);return n.slice?i.parseSlice(js(t),n.parseOptions).content:i.parse(js(t),n.parseOptions)}return cs("",e,n)}function n_(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof ze||s instanceof Ue))return;const i=t.mapping.maps[r];let o=0;i.forEach((l,a,c,u)=>{o===0&&(o=u)}),t.setSelection(ie.near(t.doc.resolve(o),n))}var r_=t=>!("type"in t),s_=(t,e,n)=>({tr:r,dispatch:s,editor:i})=>{var o;if(s){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const a=b=>{i.emit("contentError",{editor:i,error:b,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{cs(e,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(b){a(b)}try{l=cs(e,i.schema,{parseOptions:c,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(b){return a(b),!1}let{from:u,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0;if((r_(l)?l:[l]).forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,p=p?b.isBlock:!1}),u===h&&p){const{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,h+=1)}let g;if(f){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof j){let b="";e.forEach(y=>{y.text&&(b+=y.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,h)}else{g=l;const b=r.doc.resolve(u),y=b.node(),v=b.parentOffset===0,_=y.isText||y.isTextblock,w=y.content.size>0;v&&_&&w&&p&&(u=Math.max(0,u-1)),r.replaceWith(u,h,g)}n.updateSelection&&n_(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},i_=()=>({state:t,dispatch:e})=>Ax(t,e),o_=()=>({state:t,dispatch:e})=>Tx(t,e),l_=()=>({state:t,dispatch:e})=>du(t,e),a_=()=>({state:t,dispatch:e})=>pu(t,e),c_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Fi(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},d_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Fi(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},u_=()=>({state:t,dispatch:e})=>Sx(t,e),h_=()=>({state:t,dispatch:e})=>Nx(t,e);function ah(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function f_(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,s,i,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))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))li()||ah()?o=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}var p_=t=>({editor:e,view:n,tr:r,dispatch:s})=>{const i=f_(t).split(/-(?!$)/),o=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&s&&r.maybeStep(u)}),!0};function Sn(t,e,n={}){const{from:r,to:s,empty:i}=t.selection,o=e?He(e,t.schema):null,l=[];t.doc.nodesBetween(r,s,(h,f)=>{if(h.isText)return;const p=Math.max(r,f),m=Math.min(s,f+h.nodeSize);l.push({node:h,from:p,to:m})});const a=s-r,c=l.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>oi(h.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((h,f)=>h+f.to-f.from,0)>=a}var m_=(t,e={})=>({state:n,dispatch:r})=>{const s=He(t,n.schema);return Sn(n,s,e)?Ex(n,r):!1},g_=()=>({state:t,dispatch:e})=>yu(t,e),b_=t=>({state:e,dispatch:n})=>{const r=He(t,e.schema);return Fx(r)(e,n)},y_=()=>({state:t,dispatch:e})=>gu(t,e);function Ji(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Ic(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,s)=>(n.includes(s)||(r[s]=t[s]),r),{})}var x_=(t,e)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const l=Ji(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(i=He(t,r.schema)),l==="mark"&&(o=an(t,r.schema));let a=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,h)=>{i&&i===u.type&&(a=!0,s&&n.setNodeMarkup(h,void 0,Ic(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&(a=!0,s&&n.addMark(h,h+u.nodeSize,o.create(Ic(f.attrs,e))))})})}),a},v_=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),__=()=>({tr:t,dispatch:e})=>{if(e){const n=new vt(t.doc);t.setSelection(n)}return!0},k_=()=>({state:t,dispatch:e})=>hu(t,e),w_=()=>({state:t,dispatch:e})=>mu(t,e),C_=()=>({state:t,dispatch:e})=>Dx(t,e),S_=()=>({state:t,dispatch:e})=>Rx(t,e),N_=()=>({state:t,dispatch:e})=>Lx(t,e);function cl(t,e,n={},r={}){return cs(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var A_=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:l})=>{const{doc:a}=i;if(r.preserveWhitespace!=="full"){const c=cl(t,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});return o&&i.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!n),!0}return o&&i.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},t,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function ch(t,e){const n=an(e,t.schema),{from:r,to:s,empty:i}=t.selection,o=[];i?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,s,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function dh(t,e){const n=new iu(t);return e.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function T_(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function E_(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function M_(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Yi(t){return e=>M_(e.$from,t)}function K(t,e,n){return t.config[e]===void 0&&t.parent?K(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?K(t.parent,e,n):null}):t.config[e]}function Gl(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=K(e,"addExtensions",n);return r?[e,...Gl(r())]:e}).flat(10)}function Jl(t,e){const n=tr.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}function uh(t){return typeof t=="function"}function me(t,e=void 0,...n){return uh(t)?e?t.bind(e)(...n):t(...n):t}function j_(t={}){return Object.keys(t).length===0&&t.constructor===Object}function xr(t){const e=t.filter(s=>s.type==="extension"),n=t.filter(s=>s.type==="node"),r=t.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function hh(t){const e=[],{nodeExtensions:n,markExtensions:r}=xr(t),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(c=>c.name!=="text").map(c=>c.name),l=r.map(c=>c.name),a=[...o,...l];return t.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage,extensions:s},h=K(c,"addGlobalAttributes",u);if(!h)return;h().forEach(p=>{let m;Array.isArray(p.types)?m=p.types:p.types==="*"?m=a:p.types==="nodes"?m=o:p.types==="marks"?m=l:m=[],m.forEach(g=>{Object.entries(p.attributes).forEach(([b,y])=>{e.push({type:g,name:b,attribute:{...i,...y}})})})})}),s.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage},h=K(c,"addAttributes",u);if(!h)return;const f=h();Object.entries(f).forEach(([p,m])=>{const g={...i,...m};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:c.name,name:p,attribute:g})})}),e}function I_(t){const e=[];let n="",r=!1,s=!1,i=0;const o=t.length;for(let l=0;l<o;l+=1){const a=t[l];if(a==="'"&&!s){r=!r,n+=a;continue}if(a==='"'&&!r){s=!s,n+=a;continue}if(!r&&!s){if(a==="("){i+=1,n+=a;continue}if(a===")"&&i>0){i-=1,n+=a;continue}if(a===";"&&i===0){e.push(n),n="";continue}}n+=a}return n&&e.push(n),e}function Dc(t){const e=[],n=I_(t||""),r=n.length;for(let s=0;s<r;s+=1){const i=n[s],o=i.indexOf(":");if(o===-1)continue;const l=i.slice(0,o).trim(),a=i.slice(o+1).trim();l&&a&&e.push([l,a])}return e}function ye(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([s,i])=>{if(!r[s]){r[s]=i;return}if(s==="class"){const l=i?String(i).split(" "):[],a=r[s]?r[s].split(" "):[],c=l.filter(u=>!a.includes(u));r[s]=[...a,...c].join(" ")}else if(s==="style"){const l=new Map([...Dc(r[s]),...Dc(i)]);r[s]=Array.from(l.entries()).map(([a,c])=>`${a}: ${c}`).join("; ")}else r[s]=i}),r},{})}function ds(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ye(n,r),{})}function D_(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Oc(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const s=e.reduce((i,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(n):D_(n.getAttribute(o.name));return l==null?i:{...i,[o.name]:l}},{});return{...r,...s}}}}function Lc(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&j_(n)?!1:n!=null))}function Rc(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function O_(t,e){var n;const r=hh(t),{nodeExtensions:s,markExtensions:i}=xr(t),o=(n=s.find(c=>K(c,"topNode")))==null?void 0:n.name,l=Object.fromEntries(s.map(c=>{const u=r.filter(y=>y.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,v)=>{const _=K(v,"extendNodeSchema",h);return{...y,..._?_(c):{}}},{}),p=Lc({...f,content:me(K(c,"content",h)),marks:me(K(c,"marks",h)),group:me(K(c,"group",h)),inline:me(K(c,"inline",h)),atom:me(K(c,"atom",h)),selectable:me(K(c,"selectable",h)),draggable:me(K(c,"draggable",h)),code:me(K(c,"code",h)),whitespace:me(K(c,"whitespace",h)),linebreakReplacement:me(K(c,"linebreakReplacement",h)),defining:me(K(c,"defining",h)),isolating:me(K(c,"isolating",h)),attrs:Object.fromEntries(u.map(Rc))}),m=me(K(c,"parseHTML",h));m&&(p.parseDOM=m.map(y=>Oc(y,u)));const g=K(c,"renderHTML",h);g&&(p.toDOM=y=>g({node:y,HTMLAttributes:ds(y,u)}));const b=K(c,"renderText",h);return b&&(p.toText=b),[c.name,p]})),a=Object.fromEntries(i.map(c=>{const u=r.filter(b=>b.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((b,y)=>{const v=K(y,"extendMarkSchema",h);return{...b,...v?v(c):{}}},{}),p=Lc({...f,inclusive:me(K(c,"inclusive",h)),excludes:me(K(c,"excludes",h)),group:me(K(c,"group",h)),spanning:me(K(c,"spanning",h)),code:me(K(c,"code",h)),attrs:Object.fromEntries(u.map(Rc))}),m=me(K(c,"parseHTML",h));m&&(p.parseDOM=m.map(b=>Oc(b,u)));const g=K(c,"renderHTML",h);return g&&(p.toDOM=b=>g({mark:b,HTMLAttributes:ds(b,u)})),[c.name,p]}));return new Wd({topNode:o,nodes:l,marks:a})}function L_(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Gr(t){return t.sort((n,r)=>{const s=K(n,"priority")||100,i=K(r,"priority")||100;return s>i?-1:s<i?1:0})}function fh(t){const e=Gr(Gl(t)),n=L_(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function ph(t,e,n){const{from:r,to:s}=e,{blockSeparator:i=`
27
-
28
- `,textSerializers:o={}}=n||{};let l="";return t.nodesBetween(r,s,(a,c,u,h)=>{var f;a.isBlock&&c>r&&(l+=i);const p=o==null?void 0:o[a.type.name];if(p)return u&&(l+=p({node:a,pos:c,parent:u,index:h,range:e})),!1;a.isText&&(l+=(f=a==null?void 0:a.text)==null?void 0:f.slice(Math.max(r,c)-c,s-c))}),l}function R_(t,e){const n={from:0,to:t.content.size};return ph(t,n,e)}function mh(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function B_(t,e){const n=He(e,t.schema),{from:r,to:s}=t.selection,i=[];t.doc.nodesBetween(r,s,l=>{i.push(l)});const o=i.reverse().find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function gh(t,e){const n=Ji(typeof e=="string"?e:e.name,t.schema);return n==="node"?B_(t,e):n==="mark"?ch(t,e):{}}function $_(t,e=JSON.stringify){const n={};return t.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function P_(t){const e=$_(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,o)=>o!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function bh(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const c=e.slice(i).map(l,-1),u=e.slice(i).map(a),h=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:h,to:f},newRange:{from:c,to:u}})})}),P_(r)}function Yl(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=n.resolve(t),o=Kl(i,s.type);o&&r.push({mark:s,...o})}):n.nodesBetween(t,e,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(o=>({from:i,to:i+s.nodeSize,mark:o})))}),r}var z_=(t,e,n,r=20)=>{const s=t.doc.resolve(n);let i=r,o=null;for(;i>0&&o===null;){const l=s.node(i);(l==null?void 0:l.type.name)===e?o=l:i-=1}return[o,i]};function jr(t,e){return e.nodes[t]||e.marks[t]||null}function Us(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=t.find(i=>i.type===e&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}var F_=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,l)=>{var a,c;const u=((c=(a=s.type.spec).toText)==null?void 0:c.call(a,{node:s,pos:i,parent:o,index:l}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,r-i))}),n};function dl(t,e,n={}){const{empty:r,ranges:s}=t.selection,i=e?an(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>oi(h.attrs,n,{strict:!1}));let o=0;const l=[];if(s.forEach(({$from:h,$to:f})=>{const p=h.pos,m=f.pos;t.doc.nodesBetween(p,m,(g,b)=>{if(i&&g.inlineContent&&!g.type.allowsMarkType(i))return!1;if(!g.isText&&!g.marks.length)return;const y=Math.max(p,b),v=Math.min(m,b+g.nodeSize),_=v-y;o+=_,l.push(...g.marks.map(w=>({mark:w,from:y,to:v})))})}),o===0)return!1;const a=l.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>oi(h.mark.attrs,n,{strict:!1})).reduce((h,f)=>h+f.to-f.from,0),c=l.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,f)=>h+f.to-f.from,0);return(a>0?a+c:a)>=o}function H_(t,e,n={}){if(!e)return Sn(t,null,n)||dl(t,null,n);const r=Ji(e,t.schema);return r==="node"?Sn(t,e,n):r==="mark"?dl(t,e,n):!1}var W_=(t,e)=>{const{$from:n,$to:r,$anchor:s}=t.selection;if(e){const i=Yi(l=>l.type.name===e)(t.selection);if(!i)return!1;const o=t.doc.resolve(i.pos+1);return s.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},V_=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function Bc(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function No(t,e){const{nodeExtensions:n}=xr(e),r=n.find(o=>o.name===t);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},i=me(K(r,"group",s));return typeof i!="string"?!1:i.split(" ").includes("list")}function us(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let s=!0;return t.content.forEach(i=>{s!==!1&&(us(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function yh(t){return t instanceof J}var xh=class vh{constructor(e){this.position=e}static fromJSON(e){return new vh(e.position)}toJSON(){return{position:this.position}}};function U_(t,e){const n=e.mapping.mapResult(t.position);return{position:new xh(n.pos),mapResult:n}}function q_(t){return new xh(t)}function K_(t,e,n){var r;const{selection:s}=e;let i=null;if(ih(s)&&(i=s.$cursor),i){const l=(r=t.storedMarks)!=null?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(c=>c.type.excludes(n)))}const{ranges:o}=s;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,a.pos,(u,h,f)=>{if(c)return!1;if(u.isInline){const p=!f||f.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=p&&m}return!c}),c})}var G_=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:l}=i,a=an(t,r.schema);if(s)if(o){const c=ch(r,a);n.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(u,h,(f,p)=>{const m=Math.max(p,u),g=Math.min(p+f.nodeSize,h);f.marks.find(y=>y.type===a)?f.marks.forEach(y=>{a===y.type&&n.addMark(m,g,a.create({...y.attrs,...e}))}):n.addMark(m,g,a.create(e))})});return K_(r,n,a)},J_=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Y_=(t,e={})=>({state:n,dispatch:r,chain:s})=>{const i=He(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:l})=>Ja(i,{...o,...e})(n)?!0:l.clearNodes()).command(({state:l})=>Ja(i,{...o,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Q_=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,s=Pn(t,0,r.content.size),i=J.create(r,s);e.setSelection(i)}return!0},X_=(t,e)=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=r;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=i.from,l=i.to),s&&n.doc.nodesBetween(o,l,(a,c)=>{a.isText||n.setNodeMarkup(c,void 0,{...a.attrs,dir:t})}),!0},Z_=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:s,to:i}=typeof t=="number"?{from:t,to:t}:t,o=Q.atStart(r).from,l=Q.atEnd(r).to,a=Pn(s,o,l),c=Pn(i,o,l),u=Q.create(r,a,c);e.setSelection(u)}return!0},ek=t=>({state:e,dispatch:n})=>{const r=He(t,e.schema);return Vx(r)(e,n)};function $c(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(s=>e==null?void 0:e.includes(s.type.name));t.tr.ensureMarks(r)}}var tk=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:l,$to:a}=i,c=s.extensionManager.attributes,u=Us(c,l.node().type.name,l.node().attrs);if(i instanceof J&&i.node.isBlock)return!l.parentOffset||!on(o,l.pos)?!1:(r&&(t&&$c(n,s.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const h=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:T_(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=h&&f?[{type:f,attrs:u}]:void 0,m=on(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!m&&on(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(i instanceof Q&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,p),f&&!h&&!l.parentOffset&&l.parent.type!==f)){const g=e.mapping.map(l.before()),b=e.doc.resolve(g);l.node(-1).canReplaceWith(b.index(),b.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}t&&$c(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return m},nk=(t,e={})=>({tr:n,state:r,dispatch:s,editor:i})=>{var o;const l=He(t,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const h=a.node(-1);if(h.type!==l)return!1;const f=i.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(s){let y=j.empty;const v=a.index(-1)?1:a.index(-2)?2:3;for(let D=a.depth-v;D>=a.depth-3;D-=1)y=j.from(a.node(D).copy(y));const _=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,w={...Us(f,a.node().type.name,a.node().attrs),...e},k=((o=l.contentMatch.defaultType)==null?void 0:o.createAndFill(w))||void 0;y=y.append(j.from(l.createAndFill(null,k)||void 0));const S=a.before(a.depth-(v-1));n.replace(S,a.after(-_),new F(y,4-v,0));let C=-1;n.doc.nodesBetween(S,n.doc.content.size,(D,B)=>{if(C>-1)return!1;D.isTextblock&&D.content.size===0&&(C=B+1)}),C>-1&&n.setSelection(Q.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const p=c.pos===a.end()?h.contentMatchAt(0).defaultType:null,m={...Us(f,h.type.name,h.attrs),...e},g={...Us(f,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,c.pos);const b=p?[{type:l,attrs:m},{type:p,attrs:g}]:[{type:l,attrs:m}];if(!on(n.doc,a.pos,2))return!1;if(s){const{selection:y,storedMarks:v}=r,{splittableMarks:_}=i.extensionManager,w=v||y.$to.parentOffset&&y.$from.marks();if(n.split(a.pos,2,b).scrollIntoView(),!w||!s)return!0;const k=w.filter(S=>_.includes(S.type.name));n.ensureMarks(k)}return!0},Ao=(t,e)=>{const n=Yi(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&An(t.doc,n.pos)&&t.join(n.pos),!0},To=(t,e)=>{const n=Yi(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&An(t.doc,r)&&t.join(r),!0};function rk(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),s=e.resolve(n.nodeSize-1);return Q.between(r,s)}var sk=(t,e,n,r={})=>({editor:s,tr:i,state:o,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:h,splittableMarks:f}=s.extensionManager,p=He(t,o.schema),m=He(e,o.schema),{selection:g,storedMarks:b}=o,{$from:y,$to:v}=g,_=y.blockRange(v),w=b||g.$to.parentOffset&&g.$from.marks();if(!_)return!1;const k=Yi(R=>No(R.type.name,h))(g),S=g.from===0&&g.to===o.doc.content.size,C=o.doc.content.content,D=C.length===1?C[0]:null,B=S&&D&&No(D.type.name,h)?{node:D,pos:0}:null,N=k??B,T=!!k&&_.depth>=1&&_.depth-k.depth<=1,$=!!B;if((T||$)&&N){if(N.node.type===p)return S&&$?a().command(({tr:R,dispatch:L})=>{const U=rk(R);return U?(R.setSelection(U),L&&L(R),!0):!1}).liftListItem(m).run():c.liftListItem(m);if(No(N.node.type.name,h)&&p.validContent(N.node.content))return a().command(()=>(i.setNodeMarkup(N.pos,p),!0)).command(()=>Ao(i,p)).command(()=>To(i,p)).run()}return!n||!w||!l?a().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>Ao(i,p)).command(()=>To(i,p)).run():a().command(()=>{const R=u().wrapInList(p,r),L=w.filter(U=>f.includes(U.type.name));return i.ensureMarks(L),R?!0:c.clearNodes()}).wrapInList(p,r).command(()=>Ao(i,p)).command(()=>To(i,p)).run()},ik=(t,e={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=an(t,r.schema);return dl(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},ok=(t,e,n={})=>({state:r,commands:s})=>{const i=He(t,r.schema),o=He(e,r.schema),l=Sn(r,i,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?s.setNode(o,a):s.setNode(i,{...a,...n})},lk=(t,e={})=>({state:n,commands:r})=>{const s=He(t,n.schema);return Sn(n,s,e)?r.lift(s):r.wrapIn(s,e)},ak=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let i;if(s.spec.isInputRules&&(i=s.getState(t))){if(e){const o=t.tr,l=i.transform;for(let a=l.steps.length-1;a>=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(i.text){const a=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,a))}else o.delete(i.from,i.to)}return!0}}return!1},ck=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:s}=n;return r||e&&s.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},dk=(t,e={})=>({tr:n,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=n,a=an(t,r.schema),{$from:c,empty:u,ranges:h}=l;if(!s)return!0;if(u&&o){let{from:f,to:p}=l;const m=(i=c.marks().find(b=>b.type===a))==null?void 0:i.attrs,g=Kl(c,a,m);g&&(f=g.from,p=g.to),n.removeMark(f,p,a)}else h.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},uk=t=>({tr:e,state:n,dispatch:r})=>{const{selection:s}=n;let i,o;return typeof t=="number"?(i=t,o=t):t&&"from"in t&&"to"in t?(i=t.from,o=t.to):(i=s.from,o=s.to),r&&e.doc.nodesBetween(i,o,(l,a)=>{if(l.isText)return;const c={...l.attrs};delete c.dir,e.setNodeMarkup(a,void 0,c)}),!0},hk=(t,e={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const l=Ji(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(i=He(t,r.schema)),l==="mark"&&(o=an(t,r.schema));let a=!1;return n.selection.ranges.forEach(c=>{const u=c.$from.pos,h=c.$to.pos;let f,p,m,g;n.selection.empty?r.doc.nodesBetween(u,h,(b,y)=>{i&&i===b.type&&(a=!0,m=Math.max(y,u),g=Math.min(y+b.nodeSize,h),f=y,p=b)}):r.doc.nodesBetween(u,h,(b,y)=>{y<u&&i&&i===b.type&&(a=!0,m=Math.max(y,u),g=Math.min(y+b.nodeSize,h),f=y,p=b),y>=u&&y<=h&&(i&&i===b.type&&(a=!0,s&&n.setNodeMarkup(y,void 0,{...b.attrs,...e})),o&&b.marks.length&&b.marks.forEach(v=>{if(o===v.type&&(a=!0,s)){const _=Math.max(y,u),w=Math.min(y+b.nodeSize,h);n.addMark(_,w,o.create({...v.attrs,...e}))}}))}),p&&(f!==void 0&&s&&n.setNodeMarkup(f,void 0,{...p.attrs,...e}),o&&p.marks.length&&p.marks.forEach(b=>{o===b.type&&s&&n.addMark(m,g,o.create({...b.attrs,...e}))}))}),a},fk=(t,e={})=>({state:n,dispatch:r})=>{const s=He(t,n.schema);return Bx(s,e)(n,r)},pk=(t,e={})=>({state:n,dispatch:r})=>{const s=He(t,n.schema);return $x(s,e)(n,r)},mk=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Qi=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},gk=(t,e)=>{if(ql(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Is(t){var e;const{editor:n,from:r,to:s,text:i,rules:o,plugin:l}=t,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const h=F_(c)+i;return o.forEach(f=>{if(u)return;const p=gk(h,f.find);if(!p)return;const m=a.state.tr,g=Ki({state:a.state,transaction:m}),b={from:r-(p[0].length-i.length),to:s},{commands:y,chain:v,can:_}=new Gi({editor:n,state:g});f.handler({state:g,range:b,match:p,commands:y,chain:v,can:_})===null||!m.steps.length||(f.undoable&&m.setMeta(l,{transform:m,from:r,to:s,text:i}),a.dispatch(m),u=!0)}),u}function bk(t){const{editor:e,rules:n}=t,r=new Ne({state:{init(){return null},apply(s,i,o){const l=s.getMeta(r);if(l)return l;const a=s.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=Jl(j.from(u),o.schema);const{from:h}=a,f=h+u.length;Is({editor:e,from:h,to:f,text:u,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,l){return Is({editor:e,from:i,to:o,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&Is({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?Is({editor:e,from:o.pos,to:o.pos,text:`
29
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function yk(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ds(t){return yk(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function _h(t,e){const n={...t};return Ds(t)&&Ds(e)&&Object.keys(e).forEach(r=>{Ds(e[r])&&Ds(t[r])?n[r]=_h(t[r],e[r]):n[r]=e[r]}),n}var Ql=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...me(K(this,"addOptions",{name:this.name}))}}get storage(){return{...me(K(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>_h(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Kt=class kh extends Ql{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new kh(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const a=o.find(c=>(c==null?void 0:c.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function xk(t){return typeof t=="number"}var vk=class{constructor(t){this.find=t.find,this.handler=t.handler}},_k=(t,e,n)=>{if(ql(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=t,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function kk(t){const{editor:e,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:l}=t,{commands:a,chain:c,can:u}=new Gi({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,s,(p,m)=>{var g,b,y,v,_;if((b=(g=p.type)==null?void 0:g.spec)!=null&&b.code||!(p.isText||p.isTextblock||p.isInline))return;const w=(_=(v=(y=p.content)==null?void 0:y.size)!=null?v:p.nodeSize)!=null?_:0,k=Math.max(r,m),S=Math.min(s,m+w);if(k>=S)return;const C=p.isText?p.text||"":p.textBetween(k-m,S-m,void 0,"");_k(C,i.find,o).forEach(B=>{if(B.index===void 0)return;const N=k+B.index+1,T=N+B[0].length,$={from:n.tr.mapping.map(N),to:n.tr.mapping.map(T)},R=i.handler({state:n,range:$,match:B,commands:a,chain:c,can:u,pasteEvent:o,dropEvent:l});h.push(R)})}),h.every(p=>p!==null)}var Os=null,wk=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function Ck(t){const{editor:e,rules:n}=t;let r=null,s=!1,i=!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:u,from:h,to:f,rule:p,pasteEvt:m})=>{const g=u.tr,b=Ki({state:u,transaction:g});if(!(!kk({editor:e,state:b,from:Math.max(h-1,0),to:f.b-1,rule:p,pasteEvent:m,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new Ne({view(h){const f=m=>{var g;r=(g=h.dom.parentElement)!=null&&g.contains(m.target)?h.dom.parentElement:null,r&&(Os=e)},p=()=>{Os&&(Os=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(h,f)=>{if(i=r===h.dom.parentElement,l=f,!i){const p=Os;p!=null&&p.isEditable&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(h,f)=>{var p;const m=(p=f.clipboardData)==null?void 0:p.getData("text/html");return o=f,s=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(h,f,p)=>{const m=h[0],g=m.getMeta("uiEvent")==="paste"&&!s,b=m.getMeta("uiEvent")==="drop"&&!i,y=m.getMeta("applyPasteRules"),v=!!y;if(!g&&!b&&!v)return;if(v){let{text:k}=y;typeof k=="string"?k=k:k=Jl(j.from(k),p.schema);const{from:S}=y,C=S+k.length,D=wk(k);return a({rule:u,state:p,from:S,to:{b:C},pasteEvt:D})}const _=f.doc.content.findDiffStart(p.doc.content),w=f.doc.content.findDiffEnd(p.doc.content);if(!(!xk(_)||!w||_===w.b))return a({rule:u,state:p,from:_,to:w,pasteEvt:o})}}))}var Xi=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=fh(t),this.schema=O_(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:jr(e.name,this.schema)},r=K(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Gr([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:jr(r.name,this.schema)},i=[],o=K(r,"addKeyboardShortcuts",s);let l={};if(r.type==="mark"&&K(r,"exitable",s)&&(l.ArrowRight=()=>Kt.handleExit({editor:t,mark:r})),o){const f=Object.fromEntries(Object.entries(o()).map(([p,m])=>[p,()=>m({editor:t})]));l={...l,...f}}const a=Ov(l);i.push(a);const c=K(r,"addInputRules",s);if(Bc(r,t.options.enableInputRules)&&c){const f=c();if(f&&f.length){const p=bk({editor:t,rules:f}),m=Array.isArray(p)?p:[p];i.push(...m)}}const u=K(r,"addPasteRules",s);if(Bc(r,t.options.enablePasteRules)&&u){const f=u();if(f&&f.length){const p=Ck({editor:t,rules:f});i.push(...p)}}const h=K(r,"addProseMirrorPlugins",s);if(h){const f=h();i.push(...f)}return i})}get attributes(){return hh(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=xr(this.extensions);return Object.fromEntries(e.filter(n=>!!K(n,"addNodeView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:He(n.name,this.schema)},i=K(n,"addNodeView",s);if(!i)return[];const o=i();if(!o)return[];const l=(a,c,u,h,f)=>{const p=ds(a,r);return o({node:a,view:c,getPos:u,decorations:h,innerDecorations:f,editor:t,extension:n,HTMLAttributes:p})};return[n.name,l]}))}dispatchTransaction(t){const{editor:e}=this;return Gr([...this.extensions].reverse()).reduceRight((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:jr(s.name,this.schema)},o=K(s,"dispatchTransaction",i);return o?l=>{o.call(i,{transaction:l,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return Gr([...this.extensions]).reduce((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:jr(s.name,this.schema)},o=K(s,"transformPastedHTML",i);return o?(l,a)=>{const c=r(l,a);return o.call(i,c)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=xr(this.extensions);return Object.fromEntries(e.filter(n=>!!K(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:an(n.name,this.schema)},i=K(n,"addMarkView",s);if(!i)return[];const o=(l,a,c)=>{const u=ds(l,r);return i()({mark:l,view:a,inline:c,editor:t,extension:n,HTMLAttributes:u,updateAttributes:h=>{zk(l,t,h)}})};return[n.name,o]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const n=e.parent;n.child===e&&(n.child=null),e=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:jr(e.name,this.schema)};e.type==="mark"&&((n=me(K(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const s=K(e,"onBeforeCreate",r),i=K(e,"onCreate",r),o=K(e,"onUpdate",r),l=K(e,"onSelectionUpdate",r),a=K(e,"onTransaction",r),c=K(e,"onFocus",r),u=K(e,"onBlur",r),h=K(e,"onDestroy",r);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),h&&this.editor.on("destroy",h)})}};Xi.resolve=fh;Xi.sort=Gr;Xi.flatten=Gl;var Sk={};Ul(Sk,{ClipboardTextSerializer:()=>Ch,Commands:()=>Sh,Delete:()=>Nh,Drop:()=>Ah,Editable:()=>Th,FocusEvents:()=>Mh,Keymap:()=>jh,Paste:()=>Ih,Tabindex:()=>Dh,TextDirection:()=>Oh,focusEventsPluginKey:()=>Eh});var je=class wh extends Ql{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new wh(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Ch=je.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ne({key:new Re("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:s}=e,{ranges:i}=s,o=Math.min(...i.map(u=>u.$from.pos)),l=Math.max(...i.map(u=>u.$to.pos)),a=mh(n);return ph(r,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Sh=je.create({name:"commands",addCommands(){return{...rh}}}),Nh=je.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,s;const i=()=>{var o,l,a,c;if((c=(a=(l=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,t))!=null?c:t.getMeta("y-sync$"))return;const u=dh(t.before,[t,...e]);bh(u).forEach(p=>{u.mapping.mapResult(p.oldRange.from).deletedAfter&&u.mapping.mapResult(p.oldRange.to).deletedBefore&&u.before.nodesBetween(p.oldRange.from,p.oldRange.to,(m,g)=>{const b=g+m.nodeSize-2,y=p.oldRange.from<=g&&b<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:g,to:b,newFrom:u.mapping.map(g),newTo:u.mapping.map(b),deletedRange:p.oldRange,newRange:p.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:u})})});const f=u.mapping;u.steps.forEach((p,m)=>{var g,b;if(p instanceof Lt){const y=f.slice(m).map(p.from,-1),v=f.slice(m).map(p.to),_=f.invert().map(y,-1),w=f.invert().map(v),k=y>0?(g=u.doc.nodeAt(y-1))==null?void 0:g.marks.some(C=>C.eq(p.mark)):!1,S=(b=u.doc.nodeAt(v))==null?void 0:b.marks.some(C=>C.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:_,to:w},newRange:{from:y,to:v},partial:!!(S||k),editor:this.editor,transaction:t,combinedTransform:u})}})};(s=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||s?setTimeout(i,0):i()}}),Ah=je.create({name:"drop",addProseMirrorPlugins(){return[new Ne({key:new Re("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Th=je.create({name:"editable",addProseMirrorPlugins(){return[new Ne({key:new Re("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Eh=new Re("focusEvents"),Mh=je.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ne({key:Eh,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),jh=je.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:h}=a,{pos:f,parent:p}=h,m=h.parent.isTextblock&&f>0?l.doc.resolve(f-1):h,g=m.parent.type.spec.isolating,b=h.pos-h.parentOffset,y=g&&m.parent.childCount===1?b===h.pos:ie.atStart(c).from===f;return!u||!p.type.isTextblock||p.textContent.length||!y||y&&h.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()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"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 li()||ah()?i:s},addProseMirrorPlugins(){return[new Ne({key:new Re("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),s=t.some(g=>g.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:l}=e.selection,a=ie.atStart(e.doc).from,c=ie.atEnd(e.doc).to;if(i||!(o===a&&l===c)||!us(n.doc))return;const f=n.tr,p=Ki({state:n,transaction:f}),{commands:m}=new Gi({editor:this.editor,state:p});if(m.clearNodes(),!!f.steps.length)return f}})]}}),Ih=je.create({name:"paste",addProseMirrorPlugins(){return[new Ne({key:new Re("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Dh=je.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Ne({key:new Re("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),Oh=je.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=xr(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Ne({key:new Re("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),Nk=class Hr{constructor(e,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=s}get name(){return this.node.type.name}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:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=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}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},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),n=this.resolvedPos.doc.resolve(e);return new Hr(n,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 Hr(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 Hr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,o=n.isInline,l=this.pos+r+(i?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!s&&!o&&a.depth<=this.depth)return;const c=new Hr(a,this.editor,s,s||o?n:null);s&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(n).length>0){const i=s.node.attrs,o=Object.keys(n);for(let l=0;l<o.length;l+=1){const a=o[l];if(i[a]!==n[a])break}}else r=s;s=s.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const i=Object.keys(n);return this.children.forEach(o=>{r&&s.length>0||(o.node.type.name===e&&i.every(a=>n[a]===o.node.attrs[a])&&s.push(o),!(r&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,n,r))))}),s}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},Ak=`.ProseMirror {
17
+ */var ja;function F1(){return ja||(ja=1,process.env.NODE_ENV!=="production"&&function(){function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}function e(p,m){u||s.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=m();if(!h){var b=m();i(g,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}b=o({inst:{value:g,getSnapshot:m}});var y=b[0].inst,_=b[1];return a(function(){y.value=g,y.getSnapshot=m,n(y)&&_({inst:y})},[p,g,m]),l(function(){return n(y)&&_({inst:y}),p(function(){n(y)&&_({inst:y})})},[p]),c(g),g}function n(p){var m=p.getSnapshot;p=p.value;try{var g=m();return!i(p,g)}catch{return!0}}function r(p,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=x,i=typeof Object.is=="function"?Object.is:t,o=s.useState,l=s.useEffect,a=s.useLayoutEffect,c=s.useDebugValue,u=!1,h=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;fo.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),fo}process.env.NODE_ENV==="production"?Jo.exports=z1():Jo.exports=F1();var Fi=Jo.exports;function Ge(t){this.content=t}Ge.prototype={constructor:Ge,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,s=r.find(t),i=r.content.slice();return s==-1?i.push(n||t,e):(i[s+1]=e,n&&(i[s]=n)),new Ge(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ge(n)},addToStart:function(t,e){return new Ge([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ge(n)},addBefore:function(t,e,n){var r=this.remove(e),s=r.content.slice(),i=r.find(t);return s.splice(i==-1?s.length:i,0,e,n),new Ge(s)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ge.from(t),t.size?new Ge(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ge.from(t),t.size?new Ge(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ge.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ge.from=function(t){if(t instanceof Ge)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ge(e)};function Md(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),i=e.child(r);if(s==i){n+=s.nodeSize;continue}if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)n++;return n}if(s.content.size||i.content.size){let o=Md(s.content,i.content,n+1);if(o!=null)return o}n+=s.nodeSize}}function jd(t,e,n,r){for(let s=t.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:n,b:r};let o=t.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(o.content.size||l.content.size){let c=jd(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}class j{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,s=0,i){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let i="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new j(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],s=0;if(n>e)for(let i=0,o=0;o<n;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),s+=l.nodeSize),o=a}return new j(r,s)}cutByIndex(e,n){return e==n?j.empty:e==0&&n==this.content.length?this:new j(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new j(s,i)}addToStart(e){return new j([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new j(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];e(s,r,n),r+=s.nodeSize}}findDiffStart(e,n=0){return Md(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return jd(this,e,n,r)}findIndex(e){if(e==0)return Es(0,e);if(e==this.size)return Es(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),i=r+s.nodeSize;if(i>=e)return i==e?Es(n+1,i):Es(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return j.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return j.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return j.empty;let n,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(n||(n=e.slice(0,s)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new j(n||e,r)}static from(e){if(!e)return j.empty;if(e instanceof j)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new j([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}j.empty=new j([],0);const po={index:0,offset:0};function Es(t,e){return po.index=t,po.offset=e,po}function Qs(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Qs(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Qs(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let _e=class Yo{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qs(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Yo.none;if(e instanceof Yo)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};_e.none=[];class Xs extends Error{}class F{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Dd(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new F(r,this.openStart,this.openEnd)}removeBetween(e,n){return new F(Id(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return F.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new F(j.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new F(e,r,s)}}F.empty=new F(j.empty,0,0);function Id(t,e,n){let{index:r,offset:s}=t.findIndex(e),i=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(s==e||i.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Id(i.content,e-s-1,n-s-1)))}function Dd(t,e,n,r,s,i){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=Dd(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?s-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function H1(t,e,n){if(n.openStart>t.depth)throw new Xs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Xs("Inconsistent open depths");return Od(t,e,n,0)}function Od(t,e,n,r){let s=t.index(r),i=t.node(r);if(s==e.index(r)&&r<t.depth-n.openStart){let o=Od(t,e,n,r+1);return i.copy(i.content.replaceChild(s,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return Vn(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=W1(n,t);return Vn(i,Rd(t,o,l,e,r))}else return Vn(i,Zs(t,e,r))}function Ld(t,e){if(!e.type.compatibleContent(t.type))throw new Xs("Cannot join "+e.type.name+" onto "+t.type.name)}function Qo(t,e,n){let r=t.node(n);return Ld(r,e.node(n)),r}function Wn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ur(t,e,n,r){let s=(e||t).node(n),i=0,o=e?e.index(n):s.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Wn(t.nodeAfter,r),i++));for(let l=i;l<o;l++)Wn(s.child(l),r);e&&e.depth==n&&e.textOffset&&Wn(e.nodeBefore,r)}function Vn(t,e){return t.type.checkContent(e),t.copy(e)}function Rd(t,e,n,r,s){let i=t.depth>s&&Qo(t,e,s+1),o=r.depth>s&&Qo(n,r,s+1),l=[];return Ur(null,t,s,l),i&&o&&e.index(s)==n.index(s)?(Ld(i,o),Wn(Vn(i,Rd(t,e,n,r,s+1)),l)):(i&&Wn(Vn(i,Zs(t,e,s+1)),l),Ur(e,n,s,l),o&&Wn(Vn(o,Zs(n,r,s+1)),l)),Ur(r,null,s,l),new j(l)}function Zs(t,e,n){let r=[];if(Ur(null,t,n,r),t.depth>n){let s=Qo(t,e,n+1);Wn(Vn(s,Zs(t,e,n+1)),r)}return Ur(e,null,n,r),new j(r)}function W1(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)s=e.node(i).copy(j.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class ns{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(n);return r?e.child(n).cut(r):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return _e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),s=e.maybeChild(n);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ei(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,i=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new ns(n,r,i)}static resolveCached(e,n){let r=Ia.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==n)return o}else Ia.set(e,r=new V1);let s=r.elts[r.i]=ns.resolve(e,n);return r.i=(r.i+1)%U1,s}}class V1{constructor(){this.elts=[],this.i=0}}const U1=12,Ia=new WeakMap;class ei{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const q1=Object.create(null);class Mt{constructor(e,n,r,s=_e.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||j.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,s=0){this.content.nodesBetween(e,n,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,s){return this.content.textBetween(e,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Qs(this.attrs,n||e.defaultAttrs||q1)&&_e.sameSet(this.marks,r||_e.none)}copy(e=null){return e==this.content?this:new Mt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Mt(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return F.empty;let s=this.resolve(e),i=this.resolve(n),o=r?0:s.sharedDepth(n),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new F(c,s.depth-o,i.depth-o)}replace(e,n,r){return H1(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(s==e||n.isText)return n;e-=s+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(e){return ns.resolveCached(this,e)}resolveNoCache(e){return ns.resolve(this,e)}rangeHasMark(e,n,r){let s=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}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()+")"),Bd(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=j.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,n);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=_e.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!_e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let s=j.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Mt.prototype.text=void 0;class ti extends Mt{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Bd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ti(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ti(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Bd(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Jn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new K1(e,n);if(r.next==null)return Jn.empty;let s=$d(r);r.next&&r.err("Unexpected trailing text");let i=ex(Z1(s));return tx(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let s=this;for(let i=n;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return j.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:h}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(h)==-1){s.push(h);let f=i(h,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),n[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 n(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
18
+ `)}}Jn.empty=new Jn(!0);class K1{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function $d(t){let e=[];do e.push(G1(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function G1(t){let e=[];do e.push(J1(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function J1(t){let e=X1(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Y1(t,e);else break;return e}function Da(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Y1(t,e){let n=Da(t),r=n;return t.eat(",")&&(t.next!="}"?r=Da(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Q1(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let s=[];for(let i in n){let o=n[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function X1(t){if(t.eat("(")){let e=$d(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Q1(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Z1(t){let e=[[]];return s(i(t,0),n()),e;function n(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=n())}else if(o.type=="star"){let a=n();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=n();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=n();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=n();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Pd(t,e){return e-t}function Oa(t,e){let n=[];return r(e),n.sort(Pd);function r(s){let i=t[s];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&n.indexOf(a)==-1&&r(a)}}}function ex(t){let e=Object.create(null);return n(Oa(t,0));function n(r){let s=[];r.forEach(o=>{t[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Oa(t,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Jn(r.indexOf(t.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Pd);i.next.push({type:s[o][0],next:e[l.join(",")]||n(l)})}return i}}function tx(t,e){for(let n=0,r=[t];n<r.length;n++){let s=r[n],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function zd(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Fd(t,e){let n=Object.create(null);for(let r in t){let s=e&&e[r];if(s===void 0){let i=t[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=s}return n}function Hd(t,e,n,r){for(let s in e)if(!(s in t))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${s}`);for(let s in t){let i=t[s];i.validate&&i.validate(e[s])}}function Wd(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new rx(t,r,e[r]);return n}let La=class Vd{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Wd(e,r.attrs),this.defaultAttrs=zd(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Jn.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:Fd(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Mt(this,this.computeAttrs(e),j.from(n),_e.setFrom(r))}createChecked(e=null,n,r){return n=j.from(n),this.checkContent(n),new Mt(this,this.computeAttrs(e),n,_e.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=j.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore(j.empty,!0);return i?new Mt(this,e,n.append(i),_e.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Hd(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:_e.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,o)=>r[i]=new Vd(i,n,o));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function nx(t,e,n){let r=n.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class rx{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?nx(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Hi{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=Wd(e,s.attrs),this.excluded=null;let i=zd(this.attrs);this.instance=i?new _e(this,i):null}create(e=null){return!e&&this.instance?this.instance:new _e(this,Fd(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new Hi(i,s++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Hd(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Ud{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=Ge.from(e.nodes),n.marks=Ge.from(e.marks||{}),this.nodes=La.compile(this.spec.nodes,this),this.marks=Hi.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Jn.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?Ra(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Ra(this,o.split(" "))}this.nodeFromJSON=s=>Mt.fromJSON(this,s),this.markFromJSON=s=>_e.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof La){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,s)}text(e,n){let r=this.nodes.text;return new ti(r,r.defaultAttrs,e,_e.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Ra(t,e){let n=[];for(let r=0;r<e.length;r++){let s=e[r],i=t.marks[s],o=i;if(i)n.push(i);else for(let l in t.marks){let a=t.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&n.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function sx(t){return t.tag!=null}function ix(t){return t.style!=null}class _n{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(sx(s))this.tags.push(s);else if(ix(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new $a(this,n,!1);return r.addAll(e,_e.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new $a(this,n,!0);return r.addAll(e,_e.none,n.from,n.to),F.maxOpen(r.finish())}matchTag(e,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(ax(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,n,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(o.getAttrs){let a=o.getAttrs(n);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let n=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<i)break}n.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Pa(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Pa(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new _n(e,_n.schemaRules(e)))}}const qd={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ox={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Kd={ol:!0,ul:!0},rs=1,Xo=2,qr=4;function Ba(t,e,n){return e!=null?(e?rs:0)|(e==="full"?Xo:0):t&&t.whitespace=="pre"?rs|Xo:n&~qr}class Ms{constructor(e,n,r,s,i,o){this.type=e,this.attrs=n,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=_e.none,this.match=i||(o&qr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(j.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&rs)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let n=j.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!qd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class $a{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,i,o=Ba(null,n.preserveWhitespace,0)|(r?qr:0);s?i=new Ms(s.type,s.attrs,_e.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new Ms(null,null,_e.none,!0,null,o):i=new Ms(e.schema.topNodeType,null,_e.none,!0,null,o),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,s=this.top,i=s.options&Xo?"full":this.localPreserveWS||(s.options&rs)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
19
+ `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(o.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;Kd.hasOwnProperty(o)&&this.parser.normalizeLists&&lx(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:ox.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);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 c,u=this.needsBlock;if(qd.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let h=a&&a.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
20
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,s){let i,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,n.attrs||null,r,n.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,n,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,n);this.findAtPoint(e,i)}findPlace(e,n,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)n=this.enterInner(s[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let s=this.findPlace(e,n,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=_e.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):za(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,s){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,s)),i}enterInner(e,n,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Ba(e,i,o.options);o.options&qr&&o.content.length==0&&(l|=qr);let a=_e.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):za(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Ms(e,n,a,s,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=rs)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function lx(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Kd.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function ax(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Pa(t){let e={};for(let n in t)e[n]=t[n];return e}function za(t,e){let n=e.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(t))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class tr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=js(n).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,n);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return js(n).createTextNode(e.text);let{dom:r,contentDOM:s}=Us(js(n),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,s)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let s=this.marks[e.type.name];return s&&Us(js(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return typeof n=="string"?{dom:e.createTextNode(n)}:Us(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new tr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Fa(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Fa(e.marks)}}function Fa(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function js(t){return t.document||window.document}const Ha=new WeakMap;function cx(t){let e=Ha.get(t);return e===void 0&&Ha.set(t,e=dx(t)),e}function dx(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)n(r[s]);else for(let s in r)n(r[s])}return n(t),e}function Us(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=cx(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(n=s.slice(0,o),s=s.slice(o+1));let l,a=n?t.createElementNS(n,s):t.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let h in c)if(c[h]!=null){let f=h.indexOf(" ");f>0?a.setAttributeNS(h.slice(0,f),h.slice(f+1),c[h]):h=="style"&&a.style?a.style.cssText=c[h]:a.setAttribute(h,c[h])}}for(let h=u;h<e.length;h++){let f=e[h];if(f===0){if(h<e.length-1||h>u)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(t.createTextNode(f));else{let{dom:p,contentDOM:m}=Us(t,f,n,r);if(a.appendChild(p),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const Gd=65535,Jd=Math.pow(2,16);function ux(t,e){return t+e*Jd}function Wa(t){return t&Gd}function hx(t){return(t-(t&Gd))/Jd}const Yd=1,Qd=2,qs=4,Xd=8;class Zo{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Xd)>0}get deletedBefore(){return(this.delInfo&(Yd|qs))>0}get deletedAfter(){return(this.delInfo&(Qd|qs))>0}get deletedAcross(){return(this.delInfo&qs)>0}}class yt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&yt.empty)return yt.empty}recover(e){let n=0,r=Wa(e);if(!this.inverted)for(let s=0;s<r;s++)n+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+n+hx(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let s=0,i=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?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],h=a+c;if(e<=h){let f=c?e==a?-1:e==h?1:n:n,p=a+s+(f<0?0:u);if(r)return p;let m=e==(n<0?a:h)?null:ux(l/3,e-a),g=e==a?Qd:e==h?Yd:qs;return(n<0?e!=a:e!=h)&&(g|=Xd),new Zo(p,g,m)}s+=u-c}return r?e+s:new Zo(e+s,0,null)}touches(e,n){let r=0,s=Wa(n),i=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?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+n],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new yt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?yt.empty:new yt(e<0?[0,-e,0]:[0,0,e])}}yt.empty=new yt([]);class ss{constructor(e,n,r=0,s=e?e.length:0){this.mirror=n,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new ss(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let s=e.getMirror(n);this.appendMap(e._maps[n],s!=null&&s<n?r+s:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let e=new ss;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Zo(e,s,null)}}const mo=Object.create(null);class rt{getMap(){return yt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=mo[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in mo)throw new RangeError("Duplicate use of step JSON ID "+e);return mo[e]=n,n.prototype.jsonID=e,n}}class Fe{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Fe(e,null)}static fail(e){return new Fe(null,e)}static fromReplace(e,n,r,s){try{return Fe.ok(e.replace(n,r,s))}catch(i){if(i instanceof Xs)return Fe.fail(i.message);throw i}}}function Ml(t,e,n){let r=[];for(let s=0;s<t.childCount;s++){let i=t.child(s);i.content.size&&(i=i.copy(Ml(i.content,e,i))),i.isInline&&(i=e(i,n,s)),r.push(i)}return j.fromArray(r)}class bn extends rt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new F(Ml(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),n.openStart,n.openEnd);return Fe.fromReplace(e,this.from,this.to,i)}invert(){return new Lt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new bn(n.pos,r.pos,this.mark)}merge(e){return e instanceof bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new bn(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("addMark",bn);class Lt extends rt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new F(Ml(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return Fe.fromReplace(e,this.from,this.to,r)}invert(){return new bn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Lt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Lt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Lt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Lt(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("removeMark",Lt);class yn extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new F(j.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(r))return new yn(this.pos,n.marks[s]);return new yn(this.pos,this.mark)}}return new Yn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new yn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new yn(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("addNodeMark",yn);class Yn extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new F(j.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new yn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Yn(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Yn(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("removeNodeMark",Yn);class ze extends rt{constructor(e,n,r,s=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=s}apply(e){return this.structure&&el(e,this.from,this.to)?Fe.fail("Structure replace would overwrite content"):Fe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new yt([this.from,this.to-this.from,this.slice.size])}invert(e){return new ze(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&ze.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new ze(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ze)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?F.empty:new F(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ze(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?F.empty:new F(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ze(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ze(n.from,n.to,F.fromJSON(e,n.slice),!!n.structure)}}ze.MAP_BIAS=1;rt.jsonID("replace",ze);class Ue extends rt{constructor(e,n,r,s,i,o,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(el(e,this.from,this.gapFrom)||el(e,this.gapTo,this.to)))return Fe.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Fe.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Fe.fromReplace(e,this.from,this.to,r):Fe.fail("Content does not fit in gap")}getMap(){return new yt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ue(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||s<n.pos||i>r.pos?null:new Ue(n.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ue(n.from,n.to,n.gapFrom,n.gapTo,F.fromJSON(e,n.slice),n.insert,!!n.structure)}}rt.jsonID("replaceAround",Ue);function el(t,e,n){let r=t.resolve(e),s=n-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function fx(t,e,n,r){let s=[],i=[],o,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let h=a.marks;if(!r.isInSet(h)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+a.nodeSize,n),m=r.addToSet(h);for(let g=0;g<h.length;g++)h[g].isInSet(m)||(o&&o.to==f&&o.mark.eq(h[g])?o.to=p:s.push(o=new Lt(f,p,h[g])));l&&l.to==f?l.to=p:i.push(l=new bn(f,p,r))}}),s.forEach(a=>t.step(a)),i.forEach(a=>t.step(a))}function px(t,e,n,r){let s=[],i=0;t.doc.nodesBetween(e,n,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof Hi){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,n);for(let u=0;u<a.length;u++){let h=a[u],f;for(let p=0;p<s.length;p++){let m=s[p];m.step==i-1&&h.eq(s[p].style)&&(f=m)}f?(f.to=c,f.step=i):s.push({style:h,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>t.step(new Lt(o.from,o.to,o.style)))}function jl(t,e,n,r=n.contentMatch,s=!0){let i=t.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,h=r.matchType(c.type);if(!h)o.push(new ze(l,u,F.empty));else{r=h;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new Lt(l,u,c.marks[f]));if(s&&c.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,m;for(;f=p.exec(c.text);)m||(m=new F(j.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new ze(l+f.index,l+f.index+f[0].length,m))}}l=u}if(!r.validEnd){let a=r.fillBefore(j.empty,!0);t.replace(l,l,new F(a,0,0))}for(let a=o.length-1;a>=0;a--)t.step(o[a])}function mx(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function kr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,s=0,i=0;;--r){let o=t.$from.node(r),l=t.$from.index(r)+s,a=t.$to.indexAfter(r)-i;if(r<t.depth&&o.canReplace(l,a,n))return r;if(r==0||o.type.spec.isolating||!mx(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function gx(t,e,n){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=j.empty,h=0;for(let m=i,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=j.from(r.node(m).copy(u)),h++):a--;let f=j.empty,p=0;for(let m=i,g=!1;m>n;m--)g||s.after(m+1)<s.end(m)?(g=!0,f=j.from(s.node(m).copy(f)),p++):c++;t.step(new Ue(a,c,o,l,new F(u.append(f),h,p),u.size-h,!0))}function Il(t,e,n=null,r=t){let s=bx(t,e),i=s&&yx(r,e);return i?s.map(Va).concat({type:e,attrs:n}).concat(i.map(Va)):null}function Va(t){return{type:t,attrs:null}}function bx(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return n.canReplaceWith(r,s,o)?i:null}function yx(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:o}function xx(t,e,n){let r=j.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let l=n[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=j.from(n[o].type.create(n[o].attrs,r))}let s=e.start,i=e.end;t.step(new Ue(s,i,s,i,new F(r,0,0),n.length,!0))}function _x(t,e,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&vx(t.doc,t.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?c=!1:!p&&m&&(c=!0)}c===!1&&eu(t,o,l,i),jl(t,t.mapping.slice(i).map(l,1),r,void 0,c===null);let u=t.mapping.slice(i),h=u.map(l,1),f=u.map(l+o.nodeSize,1);return t.step(new Ue(h,f,h+1,f-1,new F(j.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&Zd(t,o,l,i),!1}})}function Zd(t,e,n,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=t.mapping.slice(r).map(n+1+i+o.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function eu(t,e,n,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text(`
21
+ `))}})}function vx(t,e,n){let r=t.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function kx(t,e,n,r,s){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let o=n.create(r,null,s||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,o);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ue(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new F(j.from(o),0,0),1,!0))}function sn(t,e,n=1,r){let s=t.resolve(e),i=s.depth-n,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let c=s.depth-1,u=n-2;c>i;c--,u--){let h=s.node(c),f=s.index(c);if(h.type.spec.isolating)return!1;let p=h.content.cutByIndex(f,h.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||h;if(!h.canReplace(f+1,h.childCount)||!g.type.validContent(p))return!1}let l=s.indexAfter(i),a=r&&r[0];return s.node(i).canReplaceWith(l,l,a?a.type:s.node(i+1).type)}function wx(t,e,n=1,r){let s=t.doc.resolve(e),i=j.empty,o=j.empty;for(let l=s.depth,a=s.depth-n,c=n-1;l>a;l--,c--){i=j.from(s.node(l).copy(i));let u=r&&r[c];o=j.from(u?u.type.create(u.attrs,o):s.node(l).copy(o))}t.step(new ze(e,e,new F(i.append(o),n,n),!0))}function An(t,e){let n=t.resolve(e),r=n.index();return tu(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Cx(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let s=0;s<e.childCount;s++){let i=e.child(s),o=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function tu(t,e){return!!(t&&e&&!t.isLeaf&&Cx(t,e))}function Wi(t,e,n=-1){let r=t.resolve(e);for(let s=r.depth;;s--){let i,o,l=r.index(s);if(s==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(s+1),l++,o=r.node(s).maybeChild(l)):(i=r.node(s).maybeChild(l-1),o=r.node(s+1)),i&&!i.isTextblock&&tu(i,o)&&r.node(s).canReplace(l,l+1))return e;if(s==0)break;e=n<0?r.before(s):r.after(s)}}function Sx(t,e,n){let r=null,{linebreakReplacement:s}=t.doc.type.schema,i=t.doc.resolve(e-n),o=i.node().type;if(s&&o.inlineContent){let u=o.whitespace=="pre",h=!!o.contentMatch.matchType(s);u&&!h?r=!1:!u&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);eu(t,u.node(),u.before(),l)}o.inlineContent&&jl(t,e+n-1,o,i.node().contentMatchAt(i.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new ze(c,a.map(e+n,-1),F.empty,!0)),r===!0){let u=t.doc.resolve(c);Zd(t,u.node(),u.before(),t.steps.length)}return t}function Nx(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,n))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,n))return r.after(s+1);if(i<r.node(s).childCount)return null}return null}function nu(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let s=n.content;for(let i=0;i<n.openStart;i++)s=s.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let o=r.depth;o>=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,a=r.index(o)+(l>0?1:0),c=r.node(o),u=!1;if(i==1)u=c.canReplace(a,a,s);else{let h=c.contentMatchAt(a).findWrapping(s.firstChild.type);u=h&&c.canReplaceWith(a,a,h[0])}if(u)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function Vi(t,e,n=e,r=F.empty){if(e==n&&!r.size)return null;let s=t.resolve(e),i=t.resolve(n);return ru(s,i,r)?new ze(e,n,r):new Ax(s,i,r).fit()}function ru(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Ax{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=j.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=j.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let i=this.placed,o=r.depth,l=s.depth;for(;o&&l&&i.childCount==1;)i=i.firstChild.content,o--,l--;let a=new F(i,o,l);return e>-1?new Ue(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new ze(r.pos,s.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,s=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(s=0),i.type.spec.isolating&&s<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=go(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let o=s.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,h=null;if(n==1&&(o?c.matchType(o.type)||(h=c.fillBefore(j.from(o),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:h};if(n==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=go(e,n);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new F(e,n+1,Math.max(r,s.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=go(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new F(zr(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new F(zr(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let o=this.unplaced,l=r?r.content:o.content,a=o.openStart-e,c=0,u=[],{match:h,type:f}=this.frontier[n];if(s){for(let g=0;g<s.childCount;g++)u.push(s.child(g));h=h.matchFragment(s)}let p=l.size+e-(o.content.size-o.openEnd);for(;c<l.childCount;){let g=l.child(c),b=h.matchType(g.type);if(!b)break;c++,(c>1||a==0||g.content.size)&&(h=b,u.push(su(g.mark(f.allowedMarks(g.marks)),c==1?a:0,c==l.childCount?p:-1)))}let m=c==l.childCount;m||(p=-1),this.placed=Fr(this.placed,n,j.from(u)),this.frontier[n].match=h,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=l;g<p;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?F.empty:new F(zr(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new F(zr(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!bo(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,s=this.$to.after(r);for(;r>1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=bo(e,n,s,r,i);if(o){for(let l=n-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=bo(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:o,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Fr(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let s=e.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,n=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=Fr(this.placed,this.depth,j.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(j.empty,!0);n.childCount&&(this.placed=Fr(this.placed,this.frontier.length,n))}}function zr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(zr(t.firstChild.content,e-1,n)))}function Fr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Fr(t.lastChild.content,e-1,n)))}function go(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function su(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,su(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(j.empty,!0)))),t.copy(r)}function bo(t,e,n,r,s){let i=t.node(e),o=s?t.indexAfter(e):t.index(e);if(o==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,o);return l&&!Tx(n,i.content,o)?l:null}function Tx(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Ex(t){return t.spec.defining||t.spec.definingForContent}function Mx(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let s=t.doc.resolve(e),i=t.doc.resolve(n);if(ru(s,i,r))return t.step(new ze(e,n,r));let o=ou(s,i);o[o.length-1]==0&&o.pop();let l=-(s.depth+1);o.unshift(l);for(let f=s.depth,p=s.pos-1;f>0;f--,p--){let m=s.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(f)>-1?l=f:s.before(f)==p&&o.splice(1,0,-f)}let a=o.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let m=f.firstChild;if(c.push(m),p==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let p=c[f],m=Ex(p.type);if(m&&!p.sameMarkup(s.node(Math.abs(l)-1)))u=f;else if(m||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),m=c[p];if(m)for(let g=0;g<o.length;g++){let b=o[(g+a)%o.length],y=!0;b<0&&(y=!1,b=-b);let _=s.node(b-1),v=s.index(b-1);if(_.canReplaceWith(v,v,m.type,m.marks))return t.replace(s.before(b),y?i.after(b):n,new F(iu(r.content,0,r.openStart,p),p,r.openEnd))}}let h=t.steps.length;for(let f=o.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>h));f--){let p=o[f];p<0||(e=s.before(p),n=i.after(p))}}function iu(t,e,n,r,s){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(iu(i.content,e+1,n,r,i)))}if(e>r){let i=s.contentMatchAt(0),o=i.fillBefore(t).append(t);t=o.append(i.matchFragment(o).fillBefore(j.empty,!0))}return t}function jx(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let s=Nx(t.doc,e,r.type);s!=null&&(e=n=s)}t.replaceRange(e,n,new F(j.from(r),0,0))}function Ix(t,e,n){let r=t.doc.resolve(e),s=t.doc.resolve(n);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let o=r.sharedDepth(n),l=!1;for(let a=r.depth;a>o;a--)r.node(a).type.spec.isolating&&(l=!0);for(let a=s.depth;a>o;a--)s.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=r.depth;a>0&&e==r.start(a);a--)e=r.before(a);for(let a=s.depth;a>0&&n==s.start(a);a--)n=s.before(a);r=t.doc.resolve(e),s=t.doc.resolve(n)}}let i=ou(r,s);for(let o=0;o<i.length;o++){let l=i[o],a=o==i.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),s.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),s.indexAfter(l-1))))return t.delete(r.before(l),s.after(l))}for(let o=1;o<=r.depth&&o<=s.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&s.end(o)-n!=s.depth-o&&r.start(o-1)==s.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),s.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function ou(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let s=r;s>=0;s--){let i=t.start(s);if(i<t.pos-(t.depth-s)||e.end(s)>e.pos+(e.depth-s)||t.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(i==e.start(s)||s==t.depth&&s==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==i-1)&&n.push(s)}return n}class hr extends rt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let s=n.type.create(r,null,n.marks);return Fe.fromReplace(e,this.pos,this.pos+1,new F(j.from(s),0,n.isLeaf?0:1))}getMap(){return yt.empty}invert(e){return new hr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new hr(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new hr(n.pos,n.attr,n.value)}}rt.jsonID("attr",hr);class is extends rt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let s in e.attrs)n[s]=e.attrs[s];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Fe.ok(r)}getMap(){return yt.empty}invert(e){return new is(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new is(n.attr,n.value)}}rt.jsonID("docAttr",is);let mr=class extends Error{};mr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};mr.prototype=Object.create(Error.prototype);mr.prototype.constructor=mr;mr.prototype.name="TransformError";class lu{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ss}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new mr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let s=this.mapping.maps[r];r&&(e=s.map(e,1),n=s.map(n,-1)),s.forEach((i,o,l,a)=>{e=Math.min(e,l),n=Math.max(n,a)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=F.empty){let s=Vi(this.doc,e,n,r);return s&&this.step(s),this}replaceWith(e,n,r){return this.replace(e,n,new F(j.from(r),0,0))}delete(e,n){return this.replace(e,n,F.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Mx(this,e,n,r),this}replaceRangeWith(e,n,r){return jx(this,e,n,r),this}deleteRange(e,n){return Ix(this,e,n),this}lift(e,n){return gx(this,e,n),this}join(e,n=1){return Sx(this,e,n),this}wrap(e,n){return xx(this,e,n),this}setBlockType(e,n=e,r,s=null){return _x(this,e,n,r,s),this}setNodeMarkup(e,n,r=null,s){return kx(this,e,n,r,s),this}setNodeAttribute(e,n,r){return this.step(new hr(e,n,r)),this}setDocAttribute(e,n){return this.step(new is(e,n)),this}addNodeMark(e,n){return this.step(new yn(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof _e)n.isInSet(r.marks)&&this.step(new Yn(e,n));else{let s=r.marks,i,o=[];for(;i=n.isInSet(s);)o.push(new Yn(e,i)),s=i.removeFromSet(s);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,n=1,r){return wx(this,e,n,r),this}addMark(e,n,r){return fx(this,e,n,r),this}removeMark(e,n,r){return px(this,e,n,r),this}clearIncompatible(e,n,r){return jl(this,e,n,r),this}}const yo=Object.create(null);class se{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Dx(e.min(n),e.max(n))]}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 n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=F.empty){let r=n.content.lastChild,s=null;for(let l=0;l<n.openEnd;l++)s=r,r=r.lastChild;let i=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:c}=o[l],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(c.pos),l?F.empty:n),l==0&&Ka(e,i,(r?r.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,s=this.ranges;for(let i=0;i<s.length;i++){let{$from:o,$to:l}=s[i],a=e.mapping.slice(r),c=a.map(o.pos),u=a.map(l.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),Ka(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let s=e.parent.inlineContent?new Q(e):ar(e.node(0),e.parent,e.pos,e.index(),n,r);if(s)return s;for(let i=e.depth-1;i>=0;i--){let o=n<0?ar(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):ar(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new xt(e.node(0))}static atStart(e){return ar(e,e,0,0,1)||new xt(e)}static atEnd(e){return ar(e,e,e.content.size,e.childCount,-1)||new xt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=yo[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in yo)throw new RangeError("Duplicate use of selection JSON ID "+e);return yo[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Q.between(this.$anchor,this.$head).getBookmark()}}se.prototype.visible=!0;class Dx{constructor(e,n){this.$from=e,this.$to=n}}let Ua=!1;function qa(t){!Ua&&!t.parent.inlineContent&&(Ua=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Q extends se{constructor(e,n=e){qa(e),qa(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return se.near(r);let s=e.resolve(n.map(this.anchor));return new Q(s.parent.inlineContent?s:r,r)}replace(e,n=F.empty){if(super.replace(e,n),n==F.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Q&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ui(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Q(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let s=e.resolve(n);return new this(s,r==n?s:e.resolve(r))}static between(e,n,r){let s=e.pos-n.pos;if((!r||s)&&(r=s>=0?1:-1),!n.parent.inlineContent){let i=se.findFrom(n,r,!0)||se.findFrom(n,-r,!0);if(i)n=i.$head;else return se.near(n,r)}return e.parent.inlineContent||(s==0?e=n:(e=(se.findFrom(e,-r,!0)||se.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=s<0&&(e=n))),new Q(e,n)}}se.jsonID("text",Q);class Ui{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ui(e.map(this.anchor),e.map(this.head))}resolve(e){return Q.between(e.resolve(this.anchor),e.resolve(this.head))}}class J extends se{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:s}=n.mapResult(this.anchor),i=e.resolve(s);return r?se.near(i):new J(i)}content(){return new F(j.from(this.node),0,0)}eq(e){return e instanceof J&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Dl(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new J(e.resolve(n.anchor))}static create(e,n){return new J(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}J.prototype.visible=!1;se.jsonID("node",J);class Dl{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ui(r,r):new Dl(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&J.isSelectable(r)?new J(n):se.near(n)}}class xt extends se{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=F.empty){if(n==F.empty){e.delete(0,e.doc.content.size);let r=se.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new xt(e)}map(e){return new xt(e)}eq(e){return e instanceof xt}getBookmark(){return Ox}}se.jsonID("all",xt);const Ox={map(){return this},resolve(t){return new xt(t)}};function ar(t,e,n,r,s,i=!1){if(e.inlineContent)return Q.create(t,n);for(let o=r-(s>0?0:1);s>0?o<e.childCount:o>=0;o+=s){let l=e.child(o);if(l.isAtom){if(!i&&J.isSelectable(l))return J.create(t,n-(s<0?l.nodeSize:0))}else{let a=ar(t,l,n+s,s<0?l.childCount:0,s,i);if(a)return a}n+=l.nodeSize*s}return null}function Ka(t,e,n){let r=t.steps.length-1;if(r<e)return;let s=t.steps[r];if(!(s instanceof ze||s instanceof Ue))return;let i=t.mapping.maps[r],o;i.forEach((l,a,c,u)=>{o==null&&(o=u)}),t.setSelection(se.near(t.doc.resolve(o),n))}const Ga=1,Is=2,Ja=4;class Lx extends lu{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|Ga)&~Is,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ga)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Is,this}ensureMarks(e){return _e.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&Is)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Is,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||_e.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let s=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let o=this.doc.resolve(n);i=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,s.text(e,i)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(se.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,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|=Ja,this}get scrolledIntoView(){return(this.updated&Ja)>0}}function Ya(t,e){return!e||!t?t:t.bind(e)}class Hr{constructor(e,n,r){this.name=e,this.init=Ya(n.init,r),this.apply=Ya(n.apply,r)}}const Rx=[new Hr("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Hr("selection",{init(t,e){return t.selection||se.atStart(e.doc)},apply(t){return t.selection}}),new Hr("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Hr("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class xo{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Rx.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Hr(r.key,r.spec.state,r))})}}class ur{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,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let s=this.config.plugins[r];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),s=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let a=s?s[o].n:0,c=s?s[o].state:this,u=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,c,r);if(u&&r.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!s){s=[];for(let h=0;h<this.config.plugins.length;h++)s.push(h<o?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}s&&(s[o]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ur(this.config),r=this.config.fields;for(let s=0;s<r.length;s++){let i=r[s];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new Lx(this)}static create(e){let n=new xo(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ur(n);for(let s=0;s<n.fields.length;s++)r[n.fields[s].name]=n.fields[s].init(e,r);return r}reconfigure(e){let n=new xo(this.schema,e.plugins),r=n.fields,s=new ur(n);for(let i=0;i<r.length;i++){let o=r[i].name;s[o]=this.hasOwnProperty(o)?this[o]:r[i].init(e,s)}return s}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],i=s.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(s,this[s.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new xo(e.schema,e.plugins),i=new ur(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=Mt.fromJSON(e.schema,n.doc);else if(o.name=="selection")i.selection=se.fromJSON(i.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){i[o.name]=c.fromJSON.call(a,e,n[l],i);return}}i[o.name]=o.init(e,i)}}),i}}function au(t,e,n){for(let r in t){let s=t[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=au(s,e,{})),n[r]=s}return n}class Ne{constructor(e){this.spec=e,this.props={},e.props&&au(e.props,this,this.props),this.key=e.key?e.key.key:cu("plugin")}getState(e){return e[this.key]}}const _o=Object.create(null);function cu(t){return t in _o?t+"$"+ ++_o[t]:(_o[t]=0,t+"$")}class Re{constructor(e="key"){this.key=cu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const du=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function uu(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const hu=(t,e,n)=>{let r=uu(t,n);if(!r)return!1;let s=Ol(r);if(!s){let o=r.blockRange(),l=o&&kr(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)}let i=s.nodeBefore;if(vu(t,s,e,-1))return!0;if(r.parent.content.size==0&&(gr(i,"end")||J.isSelectable(i)))for(let o=r.depth;;o--){let l=Vi(t.doc,r.before(o),r.after(o),F.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection(gr(i,"end")?se.findFrom(a.doc.resolve(a.mapping.map(s.pos,-1)),-1):J.create(a.doc,s.pos-i.nodeSize)),e(a.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},Bx=(t,e,n)=>{let r=uu(t,n);if(!r)return!1;let s=Ol(r);return s?fu(t,s,e):!1},$x=(t,e,n)=>{let r=mu(t,n);if(!r)return!1;let s=Ll(r);return s?fu(t,s,e):!1};function fu(t,e,n){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let u=s.lastChild;if(!u)return!1;s=u}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=Vi(t.doc,i,a,F.empty);if(!c||c.from!=i||c instanceof ze&&c.slice.size>=a-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(Q.create(u.doc,i)),n(u.scrollIntoView())}return!0}function gr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const pu=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Ol(r)}let o=i&&i.nodeBefore;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function Ol(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function mu(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const gu=(t,e,n)=>{let r=mu(t,n);if(!r)return!1;let s=Ll(r);if(!s)return!1;let i=s.nodeAfter;if(vu(t,s,e,1))return!0;if(r.parent.content.size==0&&(gr(i,"start")||J.isSelectable(i))){let o=Vi(t.doc,r.before(),r.after(),F.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(gr(i,"start")?se.findFrom(l.doc.resolve(l.mapping.map(s.pos)),1):J.create(l.doc,l.mapping.map(s.pos))),e(l.scrollIntoView())}return!0}}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos,s.pos+i.nodeSize).scrollIntoView()),!0):!1},bu=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Ll(r)}let o=i&&i.nodeAfter;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos)).scrollIntoView()),!0)};function Ll(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Px=(t,e)=>{let n=t.selection,r=n instanceof J,s;if(r){if(n.node.isTextblock||!An(t.doc,n.from))return!1;s=n.from}else if(s=Wi(t.doc,n.from,-1),s==null)return!1;if(e){let i=t.tr.join(s);r&&i.setSelection(J.create(i.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},zx=(t,e)=>{let n=t.selection,r;if(n instanceof J){if(n.node.isTextblock||!An(t.doc,n.to))return!1;r=n.to}else if(r=Wi(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Fx=(t,e)=>{let{$from:n,$to:r}=t.selection,s=n.blockRange(r),i=s&&kr(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)},yu=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
22
+ `).scrollIntoView()),!0)};function Rl(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Hx=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let s=n.node(-1),i=n.indexAfter(-1),o=Rl(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,o.createAndFill());a.setSelection(se.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},xu=(t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof xt||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=Rl(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,l=t.tr.insert(o,i.createAndFill());l.setSelection(Q.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},_u=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(sn(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&kr(r);return s==null?!1:(e&&e(t.tr.lift(r,s).scrollIntoView()),!0)};function Wx(t){return(e,n)=>{let{$from:r,$to:s}=e.selection;if(e.selection instanceof J&&e.selection.node.isBlock)return!r.parentOffset||!sn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],o,l,a=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){a=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),l=Rl(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),i.unshift(a&&l?{type:l}:null),o=p;break}else{if(p==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof Q||e.selection instanceof xt)&&u.deleteSelection();let h=u.mapping.map(r.pos),f=sn(u.doc,h,i.length,i);if(f||(i[0]=l?{type:l}:null,f=sn(u.doc,h,i.length,i)),!f)return!1;if(u.split(h,i.length,i),!a&&c&&r.node(o).type!=l){let p=u.mapping.map(r.before(o)),m=u.doc.resolve(p);l&&r.node(o-1).canReplaceWith(m.index(),m.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(o)),l)}return n&&n(u.scrollIntoView()),!0}}const Vx=Wx(),Ux=(t,e)=>{let{$from:n,to:r}=t.selection,s,i=n.sharedDepth(r);return i==0?!1:(s=n.before(i),e&&e(t.tr.setSelection(J.create(t.doc,s))),!0)};function qx(t,e,n){let r=e.nodeBefore,s=e.nodeAfter,i=e.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(s.isTextblock||An(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function vu(t,e,n,r){let s=e.nodeBefore,i=e.nodeAfter,o,l,a=s.type.spec.isolating||i.type.spec.isolating;if(!a&&qx(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(l=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&l.matchType(o[0]||i.type).validEnd){if(n){let p=e.pos+i.nodeSize,m=j.empty;for(let y=o.length-1;y>=0;y--)m=j.from(o[y].create(null,m));m=j.from(s.copy(m));let g=t.tr.step(new Ue(e.pos-1,p,e.pos,p,new F(m,1,0),o.length,!0)),b=g.doc.resolve(p+2*o.length);b.nodeAfter&&b.nodeAfter.type==s.type&&An(g.doc,b.pos)&&g.join(b.pos),n(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&a?null:se.findFrom(e,1),h=u&&u.$from.blockRange(u.$to),f=h&&kr(h);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(h,f).scrollIntoView()),!0;if(c&&gr(i,"start",!0)&&gr(s,"end")){let p=s,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=i,b=1;for(;!g.isTextblock;g=g.firstChild)b++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let y=j.empty;for(let v=m.length-1;v>=0;v--)y=j.from(m[v].copy(y));let _=t.tr.step(new Ue(e.pos-m.length,e.pos+i.nodeSize,e.pos+b,e.pos+i.nodeSize-b,new F(y,m.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function ku(t){return function(e,n){let r=e.selection,s=t<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(n&&n(e.tr.setSelection(Q.create(e.doc,t<0?s.start(i):s.end(i)))),!0):!1}}const Kx=ku(-1),Gx=ku(1);function Jx(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i),l=o&&Il(o,t,e);return l?(r&&r(n.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Qa(t,e=null){return function(n,r){let s=!1;for(let i=0;i<n.selection.ranges.length&&!s;i++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(o,l,(a,c)=>{if(s)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)s=!0;else{let u=n.doc.resolve(c),h=u.index();s=u.parent.canReplaceWith(h,h+1,t)}})}if(!s)return!1;if(r){let i=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[o];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}function Bl(...t){return function(e,n,r){for(let s=0;s<t.length;s++)if(t[s](e,n,r))return!0;return!1}}Bl(du,hu,pu);Bl(du,gu,bu);Bl(yu,xu,_u,Vx);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Yx(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i);if(!o)return!1;let l=r?n.tr:null;return Qx(l,o,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function Qx(t,e,n,r=null){let s=!1,i=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);i=new ei(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new ei(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let l=Il(i,n,r,e);return l?(t&&Xx(t,e,l,s,n),!0):!1}function Xx(t,e,n,r,s){let i=j.empty;for(let u=n.length-1;u>=0;u--)i=j.from(n[u].type.create(n[u].attrs,i));t.step(new Ue(e.start-(r?2:0),e.end,e.start,e.end,new F(i,0,0),n.length,!0));let o=0;for(let u=0;u<n.length;u++)n[u].type==s&&(o=u+1);let l=n.length-o,a=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,h=e.endIndex,f=!0;u<h;u++,f=!1)!f&&sn(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return t}function Zx(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,o=>o.childCount>0&&o.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?e0(e,n,t,i):t0(e,n,i):!0:!1}}function e0(t,e,n,r){let s=t.tr,i=r.end,o=r.$to.end(r.depth);i<o&&(s.step(new Ue(i-1,o,i,o,new F(j.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ei(s.doc.resolve(r.$from.pos),s.doc.resolve(o),r.depth));const l=kr(r);if(l==null)return!1;s.lift(r,l);let a=s.doc.resolve(s.mapping.map(i,-1)-1);return An(s.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&s.join(a.pos),e(s.scrollIntoView()),!0}function t0(t,e,n){let r=t.tr,s=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=s.child(m).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(n.start),o=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==s.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?j.empty:j.from(s))))return!1;let h=i.pos,f=h+o.nodeSize;return r.step(new Ue(h-(l?1:0),f+(a?1:0),h+1,f-1,new F((l?j.empty:j.from(s.copy(j.empty))).append(a?j.empty:j.from(s.copy(j.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function n0(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let l=i.parent,a=l.child(o-1);if(a.type!=t)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,u=j.from(c?t.create():null),h=new F(j.from(t.create(null,j.from(l.type.create(null,u)))),c?3:1,0),f=i.start,p=i.end;n(e.tr.step(new Ue(f-(c?3:1),p,f,p,h,1,!0)).scrollIntoView())}return!0}}const Je=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},br=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let tl=null;const tn=function(t,e,n){let r=tl||(tl=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},r0=function(){tl=null},Qn=function(t,e,n,r){return n&&(Xa(t,e,n,r,-1)||Xa(t,e,n,r,1))},s0=/^(img|br|input|textarea|hr)$/i;function Xa(t,e,n,r,s){for(var i;;){if(t==n&&e==r)return!0;if(e==(s<0?0:Et(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ys(t)||s0.test(t.nodeName)||t.contentEditable=="false")return!1;e=Je(t)+(s<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else t=o,e=s<0?Et(t):0}else return!1}}function Et(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function i0(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Et(t)}else if(t.parentNode&&!ys(t))e=Je(t),t=t.parentNode;else return null}}function o0(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!ys(t))e=Je(t)+1,t=t.parentNode;else return null}}function l0(t,e,n){for(let r=e==0,s=e==Et(t);r||s;){if(t==n)return!0;let i=Je(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,s=s&&i==Et(t)}}function ys(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const qi=function(t){return t.focusNode&&Qn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Rn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function a0(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function c0(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Et(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Et(r.startContainer),r.startOffset)}}}const Vt=typeof navigator<"u"?navigator:null,Za=typeof document<"u"?document:null,Tn=Vt&&Vt.userAgent||"",nl=/Edge\/(\d+)/.exec(Tn),wu=/MSIE \d/.exec(Tn),rl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Tn),ht=!!(wu||rl||nl),vn=wu?document.documentMode:rl?+rl[1]:nl?+nl[1]:0,jt=!ht&&/gecko\/(\d+)/i.test(Tn);jt&&+(/Firefox\/(\d+)/.exec(Tn)||[0,0])[1];const sl=!ht&&/Chrome\/(\d+)/.exec(Tn),Qe=!!sl,Cu=sl?+sl[1]:0,nt=!ht&&!!Vt&&/Apple Computer/.test(Vt.vendor),yr=nt&&(/Mobile\/\w+/.test(Tn)||!!Vt&&Vt.maxTouchPoints>2),Tt=yr||(Vt?/Mac/.test(Vt.platform):!1),Su=Vt?/Win/.test(Vt.platform):!1,rn=/Android \d/.test(Tn),xs=!!Za&&"webkitFontSmoothing"in Za.documentElement.style,d0=xs?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function u0(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Yt(t,e){return typeof t=="number"?t:t[e]}function h0(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function ec(t,e,n){let r=t.someProp("scrollThreshold")||0,s=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=br(o);continue}let l=o,a=l==i.body,c=a?u0(i):h0(l),u=0,h=0;if(e.top<c.top+Yt(r,"top")?h=-(c.top-e.top+Yt(s,"top")):e.bottom>c.bottom-Yt(r,"bottom")&&(h=e.bottom-e.top>c.bottom-c.top?e.top+Yt(s,"top")-c.top:e.bottom-c.bottom+Yt(s,"bottom")),e.left<c.left+Yt(r,"left")?u=-(c.left-e.left+Yt(s,"left")):e.right>c.right-Yt(r,"right")&&(u=e.right-c.right+Yt(s,"right")),u||h)if(a)i.defaultView.scrollBy(u,h);else{let p=l.scrollLeft,m=l.scrollTop;h&&(l.scrollTop+=h),u&&(l.scrollLeft+=u);let g=l.scrollLeft-p,b=l.scrollTop-m;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}let f=a?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:br(o)}}function f0(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,s;for(let i=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let l=t.root.elementFromPoint(i,o);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,s=a.top;break}}return{refDOM:r,refTop:s,stack:Nu(t.dom)}}function Nu(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=br(r));return e}function p0({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Au(n,r==0?0:r-e)}function Au(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:s,left:i}=t[n];r.scrollTop!=s+e&&(r.scrollTop=s+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let or=null;function m0(t){if(t.setActive)return t.setActive();if(or)return t.focus(or);let e=Nu(t);t.focus(or==null?{get preventScroll(){return or={preventScroll:!0},!0}}:void 0),or||(or=!1,Au(e,0))}function Tu(t,e){let n,r=2e8,s,i=0,o=e.top,l=e.top,a,c;for(let u=t.firstChild,h=0;u;u=u.nextSibling,h++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=tn(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let m=f[p];if(m.top<=o&&m.bottom>=l){o=Math.max(m.bottom,o),l=Math.min(m.top,l);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,s=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(i=h+(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=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=h+1)}}return!n&&a&&(n=a,s=c,r=0),n&&n.nodeType==3?g0(n,s):!n||r&&n.nodeType==1?{node:t,offset:i}:Tu(n,s)}function g0(t,e){let n=t.nodeValue.length,r=document.createRange(),s;for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=hn(r,1);if(o.top!=o.bottom&&$l(e,o)){s={node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),s||{node:t,offset:0}}function $l(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function b0(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function y0(t,e,n){let{node:r,offset:s}=Tu(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();i=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,s,i)}function x0(t,e,n,r){let s=-1;for(let i=e,o=!1;i!=t.dom;){let l=t.docView.nearestDesc(i,!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>r.left||a.top>r.top?s=l.posBefore:(!o&&a.right<r.left||a.bottom<r.top)&&(s=l.posAfter),o=!0),!l.contentDOM&&s<0&&!l.node.isText))return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;i=l.dom.parentNode}return s>-1?s:t.docView.posFromDOM(e,n,-1)}function Eu(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let s=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=s;;){let o=t.childNodes[i];if(o.nodeType==1){let l=o.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if($l(e,c))return Eu(o,e,c)}}if((i=(i+1)%r)==s)break}return t}function _0(t,e){let n=t.dom.ownerDocument,r,s=0,i=c0(n,e.left,e.top);i&&({node:r,offset:s}=i);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=t.dom.getBoundingClientRect();if(!$l(e,c)||(o=Eu(t.dom,e,c),!o))return null}if(nt)for(let c=o;r&&c;c=br(c))c.draggable&&(r=void 0);if(o=b0(o,e),r){if(jt&&r.nodeType==1&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let u=r.childNodes[s],h;u.nodeName=="IMG"&&(h=u.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&s++}let c;xs&&s&&r.nodeType==1&&(c=r.childNodes[s-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&s--,r==t.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(l=x0(t,r,s,e))}l==null&&(l=y0(t,o,e));let a=t.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function tc(t){return t.top<t.bottom||t.left<t.right}function hn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(tc(r))return r}return Array.prototype.find.call(n,tc)||t.getBoundingClientRect()}const v0=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Mu(t,e,n){let{node:r,offset:s,atom:i}=t.docView.domFromPos(e,n<0?-1:1),o=xs||jt;if(r.nodeType==3)if(o&&(v0.test(r.nodeValue)||(n<0?!s:s==r.nodeValue.length))){let a=hn(tn(r,s,s),n);if(jt&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let c=hn(tn(r,s-1,s-1),-1);if(c.top==a.top){let u=hn(tn(r,s,s+1),-1);if(u.top!=a.top)return jr(u,u.left<c.left)}}return a}else{let a=s,c=s,u=n<0?1:-1;return n<0&&!s?(c++,u=-1):n>=0&&s==r.nodeValue.length?(a--,u=1):n<0?a--:c++,jr(hn(tn(r,a,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==Et(r))){let a=r.childNodes[s-1];if(a.nodeType==1)return vo(a.getBoundingClientRect(),!1)}if(i==null&&s<Et(r)){let a=r.childNodes[s];if(a.nodeType==1)return vo(a.getBoundingClientRect(),!0)}return vo(r.getBoundingClientRect(),n>=0)}if(i==null&&s&&(n<0||s==Et(r))){let a=r.childNodes[s-1],c=a.nodeType==3?tn(a,Et(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return jr(hn(c,1),!1)}if(i==null&&s<Et(r)){let a=r.childNodes[s];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?tn(a,0,o?0:1):a.nodeType==1?a:null:null;if(c)return jr(hn(c,-1),!0)}return jr(hn(r.nodeType==3?tn(r):r,-n),n>=0)}function jr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function vo(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function ju(t,e,n){let r=t.state,s=t.root.activeElement;r!=e&&t.updateState(e),s!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),s!=t.dom&&s&&s.focus()}}function k0(t,e,n){let r=e.selection,s=n=="up"?r.$from:r.$to;return ju(t,e,()=>{let{node:i}=t.docView.domFromPos(s.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let o=Mu(t,s.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=tn(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(n=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const w0=/[\u0590-\u08ac]/;function C0(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,l=t.domSelection();return l?!w0.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?i:o:ju(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:h}=t.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),b=m&&!p.contains(m.nodeType==1?m:m.parentNode)||a==m&&c==g;try{l.collapse(u,h),a&&(a!=u||c!=h)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),b}):r.pos==r.start()||r.pos==r.end()}let nc=null,rc=null,sc=!1;function S0(t,e,n){return nc==e&&rc==n?sc:(nc=e,rc=n,sc=n=="up"||n=="down"?k0(t,e,n):C0(t,e,n))}const It=0,ic=1,Bn=2,Ut=3;class _s{constructor(e,n,r,s){this.parent=e,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=It,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].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 n=0,r=this.posAtStart;;n++){let s=this.children[n];if(s==e)return r;r+=s.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,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,o;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}else{let i,o;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(o):this.posAtEnd}let s;if(e==this.dom&&this.contentDOM)s=n>Je(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,s=e;s;s=s.parentNode){let i=this.getDesc(s),o;if(i&&(!n||i.node))if(r&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let s=this.children[n],i=r+s.size;if(r==e&&i!=r){for(;!s.border&&s.children.length;)for(let o=0;o<s.children.length;o++){let l=s.children[o];if(l.size){s=l;break}}return s}if(e<i)return s.descAt(e-r-s.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,s=0;for(let i=0;r<this.children.length;r++){let o=this.children[r],l=i+o.size;if(l>e||o instanceof Du){s=e-i;break}i=l}if(s)return this.children[r].domFromPos(s-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Iu&&i.side>=0;r--);if(n<=0){let i,o=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,o=!1);return i&&n&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Je(i.dom)+1:0}}else{let i,o=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,o=!1);return i&&o&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Je(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,i=-1;for(let o=r,l=0;;l++){let a=this.children[l],c=o+a.size;if(s==-1&&e<=c){let u=o+a.border;if(e>=u&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,u);e=o;for(let h=l;h>0;h--){let f=this.children[h-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){s=Je(f.dom)+1;break}e-=f.size}s==-1&&(s=0)}if(s>-1&&(c>n||l==this.children.length-1)){n=c;for(let u=l+1;u<this.children.length;u++){let h=this.children[u];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=Je(h.dom);break}n+=h.size}i==-1&&(i=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:n,fromOffset:s,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,s=!1){let i=Math.min(e,n),o=Math.max(e,n);for(let p=0,m=0;p<this.children.length;p++){let g=this.children[p],b=m+g.size;if(i>m&&o<b)return g.setSelection(e-m-g.border,n-m-g.border,r,s);m=b}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),h=!1;if((jt||nt)&&e==n){let{node:p,offset:m}=l;if(p.nodeType==3){if(h=!!(m&&p.nodeValue[m-1]==`
23
+ `),h&&m==p.nodeValue.length)for(let g=p,b;g;g=g.parentNode){if(b=g.nextSibling){b.nodeName=="BR"&&(l=a={node:b.parentNode,offset:Je(b)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=p.childNodes[m-1];h=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(jt&&u.focusNode&&u.focusNode!=a.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(s=!0)}if(!(s||h&&nt)&&Qn(l.node,l.offset,u.anchorNode,u.anchorOffset)&&Qn(a.node,a.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(h&&jt)){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let m=l;l=a,a=m}let p=document.createRange();p.setEnd(a.node,a.offset),p.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,s=0;s<this.children.length;s++){let i=this.children[s],o=r+i.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let l=r+i.border,a=o-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==o?Bn:ic,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ut:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Bn:Ut}r=o}this.dirty=Bn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Bn:ic;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Iu extends _s{constructor(e,n,r,s){let i,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==It&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(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 N0 extends _s{constructor(e,n,r,s){super(e,[],n,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Xn extends _s{constructor(e,n,r,s,i){super(e,[],r,s),this.mark=n,this.spec=i}static create(e,n,r,s){let i=s.nodeViews[n.type.name],o=i&&i(n,s,r);return(!o||!o.dom)&&(o=tr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Xn(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Ut||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ut&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=It){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=It}}slice(e,n,r){let s=Xn.create(this.parent,this.mark,!0,r),i=this.children,o=this.size;n<o&&(i=ol(i,n,o,r)),e>0&&(i=ol(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=s;return s.children=i,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class kn extends _s{constructor(e,n,r,s,i,o,l,a,c){super(e,[],i,o),this.node=n,this.outerDeco=r,this.innerDeco=s,this.nodeDOM=l}static create(e,n,r,s,i,o){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},r,s),u=c&&c.dom,h=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:h}=tr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Ru(u,r,n),c?a=new A0(e,n,r,s,u,h||null,f,c,i,o+1):n.isText?new Ki(e,n,r,s,u,f,i):new kn(e,n,r,s,u,h||null,f,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>j.empty)}return e}matchesNode(e,n,r){return this.dirty==It&&e.eq(this.node)&&ni(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,s=n,i=e.composing?this.localCompositionInfo(e,n):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new E0(this,o&&o.node,e);I0(this.node,this.innerDeco,(c,u,h)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e,u):c.type.side>=0&&!h&&a.syncToMarks(u==this.node.childCount?_e.none:this.node.child(u).marks,r,e,u),a.placeWidget(c,e,s)},(c,u,h,f)=>{a.syncToMarks(c.marks,r,e,f);let p;a.findNodeMatch(c,u,h,f)||l&&e.state.selection.from>s&&e.state.selection.to<s+c.nodeSize&&(p=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(c,u,h,p,e)||a.updateNextNode(c,u,h,e,f,s)||a.addNode(c,u,h,e,s),s+=c.nodeSize}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Bn)&&(o&&this.protectLocalComposition(e,o),Ou(this.contentDOM,this.children,e),yr&&D0(this.dom))}localCompositionInfo(e,n){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof Q)||r<n||s>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,l=O0(this.node.content,o,r-n,s-n);return l<0?null:{node:i,pos:l,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:s}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new N0(this,i,n,s);e.input.compositionNodes.push(o),this.children=ol(this.children,r,r+s.length,e,o)}update(e,n,r,s){return this.dirty==Ut||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,s),!0)}updateInner(e,n,r,s){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=It}updateOuterDeco(e){if(ni(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Lu(this.dom,this.nodeDOM,il(this.outerDeco,this.node,n),il(e,this.node,n)),this.dom!=r&&(r.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 oc(t,e,n,r,s){Ru(r,e,t);let i=new kn(void 0,t,e,n,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class Ki extends kn{constructor(e,n,r,s,i,o,l){super(e,n,r,s,i,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,s){return this.dirty==Ut||this.dirty!=It&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=It||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=It,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let s=this.node.cut(e,n),i=document.createTextNode(s.text);return new Ki(this.parent,s,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Ut)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Du extends _s{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==It&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class A0 extends kn{constructor(e,n,r,s,i,o,l,a,c,u){super(e,n,r,s,i,o,l,c,u),this.spec=a}update(e,n,r,s){if(this.dirty==Ut)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,s){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,s)}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 Ou(t,e,n){let r=t.firstChild,s=!1;for(let i=0;i<e.length;i++){let o=e[i],l=o.dom;if(l.parentNode==t){for(;l!=r;)r=lc(r),s=!0;r=r.nextSibling}else s=!0,t.insertBefore(l,r);if(o instanceof Xn){let a=r?r.previousSibling:t.lastChild;Ou(o.contentDOM,o.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=lc(r),s=!0;s&&n.trackWrites==t&&(n.trackWrites=null)}const Kr=function(t){t&&(this.nodeName=t)};Kr.prototype=Object.create(null);const $n=[new Kr];function il(t,e,n){if(t.length==0)return $n;let r=n?$n[0]:new Kr,s=[r];for(let i=0;i<t.length;i++){let o=t[i].type.attrs;if(o){o.nodeName&&s.push(r=new Kr(o.nodeName));for(let l in o){let a=o[l];a!=null&&(n&&s.length==1&&s.push(r=new Kr(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return s}function Lu(t,e,n,r){if(n==$n&&r==$n)return e;let s=e;for(let i=0;i<r.length;i++){let o=r[i],l=n[i];if(i){let a;l&&l.nodeName==o.nodeName&&s!=t&&(a=s.parentNode)&&a.nodeName.toLowerCase()==o.nodeName||(a=document.createElement(o.nodeName),a.pmIsDeco=!0,a.appendChild(s),l=$n[0]),s=a}T0(s,l||$n[0],o)}return s}function T0(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],s=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)s.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<s.length;i++)r.indexOf(s[i])==-1&&t.classList.add(s[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=r.exec(e.style);)t.style.removeProperty(s[1])}n.style&&(t.style.cssText+=n.style)}}function Ru(t,e,n){return Lu(t,t,$n,il(e,n,t.nodeType!=1))}function ni(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function lc(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class E0{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=M0(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,s){let i=0,o=this.stack.length>>1,l=Math.min(o,e.length);for(;i<l&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=It,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,c=this.top.children.length;s<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let u=this.index;u<c;u++){let h=this.top.children[u];if(h.matchesMark(e[o])&&!this.isLocked(h.dom)){a=u;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let u=Xn.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))i=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 c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=l;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,s,i){let o=this.top.children[s];return o.dirty==Ut&&o.dom==o.contentDOM&&(o.dirty=Bn),o.update(e,n,r,i)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==r)return s}return-1}e=n}}updateNextNode(e,n,r,s,i,o){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof kn){let c=this.preMatch.matched.get(a);if(c!=null&&c!=i)return!1;let u=a.dom,h,f=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=Ut&&ni(n,a.outerDeco));if(!f&&a.update(e,n,r,s))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(h=this.recreateWrapper(a,e,n,r,s,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Bn,h.updateChildren(s,o+1),h.dirty=It),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,s,i,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!ni(r,e.outerDeco)||!s.eq(e.innerDeco))return null;let l=kn.create(this.top,n,r,s,i,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,n,r,s,i){let o=kn.create(this.top,e,n,r,s,i);o.contentDOM&&o.updateChildren(s,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(e)&&(e==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let i=new Iu(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Xn;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ki)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((nt||Qe)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let s=new Du(this.top,[],r,null);n!=this.top?n.children.push(s):n.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function M0(t,e){let n=e,r=n.children.length,s=t.childCount,i=new Map,o=[];e:for(;s>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof Xn)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(s-1))break;--s,i.set(l,s),o.push(l)}}return{index:s,matched:i,matches:o.reverse()}}function j0(t,e){return t.type.side-e.type.side}function I0(t,e,n,r){let s=e.locals(t),i=0;if(s.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,s,e.forChild(i,u),c),i+=u.nodeSize}return}let o=0,l=[],a=null;for(let c=0;;){let u,h;for(;o<s.length&&s[o].to==i;){let b=s[o++];b.widget&&(u?(h||(h=[u])).push(b):u=b)}if(u)if(h){h.sort(j0);for(let b=0;b<h.length;b++)n(h[b],c,!!a)}else n(u,c,!!a);let f,p;if(a)p=-1,f=a,a=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let b=0;b<l.length;b++)l[b].to<=i&&l.splice(b--,1);for(;o<s.length&&s[o].from<=i&&s[o].to>i;)l.push(s[o++]);let m=i+f.nodeSize;if(f.isText){let b=m;o<s.length&&s[o].from<b&&(b=s[o].from);for(let y=0;y<l.length;y++)l[y].to<b&&(b=l[y].to);b<m&&(a=f.cut(b-i),f=f.cut(0,b-i),m=b,p=-1)}else for(;o<s.length&&s[o].to<m;)o++;let g=f.isInline&&!f.isLeaf?l.filter(b=>!b.inline):l.slice();r(f,g,e.forChild(i,f),p),i=m}}function D0(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function O0(t,e,n,r){for(let s=0,i=0;s<t.childCount&&i<=r;){let o=t.child(s++),l=i;if(i+=o.nodeSize,!o.isText)continue;let a=o.text;for(;s<t.childCount;){let c=t.child(s++);if(i+=c.nodeSize,!c.isText)break;a+=c.text}if(i>=n){if(i>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function ol(t,e,n,r,s){let i=[];for(let o=0,l=0;o<t.length;o++){let a=t[o],c=l,u=l+=a.size;c>=n||u<=e?i.push(a):(c<e&&i.push(a.slice(0,e-c,r)),s&&(i.push(s),s=void 0),u>n&&i.push(a.slice(n-c,a.size,r)))}return i}function Pl(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let s=t.docView.nearestDesc(n.focusNode),i=s&&s.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let l=r.resolve(o),a,c;if(qi(n)){for(a=o;s&&!s.node;)s=s.parent;let h=s.node;if(s&&h.isAtom&&J.isSelectable(h)&&s.parent&&!(h.isInline&&l0(n.focusNode,n.focusOffset,s.dom))){let f=s.posBefore;c=new J(o==f?l:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,f=o;for(let p=0;p<n.rangeCount;p++){let m=n.getRangeAt(p);h=Math.min(h,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(h<0)return null;[a,o]=f==t.state.selection.anchor?[f,h]:[h,f],l=r.resolve(o)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let h=e=="pointer"||t.state.selection.head<l.pos&&!i?1:-1;c=zl(t,u,l,h)}return c}function Bu(t){return t.editable?t.hasFocus():Pu(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function on(t,e=!1){let n=t.state.selection;if($u(t,n),!!Bu(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Qe){let r=t.domSelectionRange(),s=t.domObserver.currentSelection;if(r.anchorNode&&s.anchorNode&&Qn(r.anchorNode,r.anchorOffset,s.anchorNode,s.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)R0(t);else{let{anchor:r,head:s}=n,i,o;ac&&!(n instanceof Q)&&(n.$from.parent.inlineContent||(i=cc(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=cc(t,n.to))),t.docView.setSelection(r,s,t,e),ac&&(i&&dc(i),o&&dc(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&L0(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const ac=nt||Qe&&Cu<63;function cc(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),s=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(nt&&s&&s.contentEditable=="false")return ko(s);if((!s||s.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(s)return ko(s);if(i)return ko(i)}}function ko(t){return t.contentEditable="true",nt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function dc(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function L0(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,s=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=s)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Bu(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function R0(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Je(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&ht&&vn<=11&&(n.disabled=!0,n.disabled=!1)}function $u(t,e){if(e instanceof J){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(uc(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else uc(t)}function uc(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function zl(t,e,n,r){return t.someProp("createSelectionBetween",s=>s(t,e,n))||Q.between(e,n,r)}function hc(t){return t.editable&&!t.hasFocus()?!1:Pu(t)}function Pu(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function B0(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Qn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function ll(t,e){let{$anchor:n,$head:r}=t.selection,s=e>0?n.max(r):n.min(r),i=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return i&&se.findFrom(i,e)}function fn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function fc(t,e,n){let r=t.state.selection;if(r instanceof Q)if(n.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return fn(t,new Q(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=ll(t.state,e);return s&&s instanceof J?fn(t,s):!1}else if(!(Tt&&n.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let l=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=t.docView.descAt(l))&&!o.contentDOM?J.isSelectable(i)?fn(t,new J(e<0?t.state.doc.resolve(s.pos-i.nodeSize):s)):xs?fn(t,new Q(t.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return fn(t,new Q(e>0?r.$to:r.$from));{let s=ll(t.state,e);return s?fn(t,s):!1}}}function ri(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Gr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function lr(t,e){return e<0?$0(t):P0(t)}function $0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s,i,o=!1;for(jt&&n.nodeType==1&&r<ri(n)&&Gr(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Gr(l,-1))s=n,i=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(zu(n))break;{let l=n.previousSibling;for(;l&&Gr(l,-1);)s=n.parentNode,i=Je(l),l=l.previousSibling;if(l)n=l,r=ri(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?al(t,n,r):s&&al(t,s,i)}function P0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s=ri(n),i,o;for(;;)if(r<s){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Gr(l,1))i=n,o=++r;else break}else{if(zu(n))break;{let l=n.nextSibling;for(;l&&Gr(l,1);)i=l.parentNode,o=Je(l)+1,l=l.nextSibling;if(l)n=l,r=0,s=ri(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}i&&al(t,i,o)}function zu(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function z0(t,e){for(;t&&e==t.childNodes.length&&!ys(t);)e=Je(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function F0(t,e){for(;t&&!e&&!ys(t);)e=Je(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function al(t,e,n){if(e.nodeType!=3){let i,o;(o=z0(e,n))?(e=o,n=0):(i=F0(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(qi(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:s}=t;setTimeout(()=>{t.state==s&&on(t)},50)}function pc(t,e){let n=t.state.doc.resolve(e);if(!(Qe||Su)&&n.parent.inlineContent){let s=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left<s.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function mc(t,e,n){let r=t.state.selection;if(r instanceof Q&&!r.empty||n.indexOf("s")>-1||Tt&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=ll(t.state,e);if(o&&o instanceof J)return fn(t,o)}if(!s.parent.inlineContent){let o=e<0?s:i,l=r instanceof xt?se.near(o,e):se.findFrom(o,e);return l?fn(t,l):!1}return!1}function gc(t,e){if(!(t.state.selection instanceof Q))return!0;let{$head:n,$anchor:r,empty:s}=t.state.selection;if(!n.sameParent(r))return!0;if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let o=t.state.tr;return e<0?o.delete(n.pos-i.nodeSize,n.pos):o.delete(n.pos,n.pos+i.nodeSize),t.dispatch(o),!0}return!1}function bc(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function H0(t){if(!nt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;bc(t,r,"true"),setTimeout(()=>bc(t,r,"false"),20)}return!1}function W0(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function V0(t,e){let n=e.keyCode,r=W0(e);if(n==8||Tt&&n==72&&r=="c")return gc(t,-1)||lr(t,-1);if(n==46&&!e.shiftKey||Tt&&n==68&&r=="c")return gc(t,1)||lr(t,1);if(n==13||n==27)return!0;if(n==37||Tt&&n==66&&r=="c"){let s=n==37?pc(t,t.state.selection.from)=="ltr"?-1:1:-1;return fc(t,s,r)||lr(t,s)}else if(n==39||Tt&&n==70&&r=="c"){let s=n==39?pc(t,t.state.selection.from)=="ltr"?1:-1:1;return fc(t,s,r)||lr(t,s)}else{if(n==38||Tt&&n==80&&r=="c")return mc(t,-1,r)||lr(t,-1);if(n==40||Tt&&n==78&&r=="c")return H0(t)||mc(t,1,r)||lr(t,1);if(r==(Tt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Fl(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=t.someProp("clipboardSerializer")||tr.fromSchema(t.state.schema),l=qu(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let c=a.firstChild,u,h=0;for(;c&&c.nodeType==1&&(u=Uu[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=l.createElement(u[p]);for(;a.firstChild;)m.appendChild(a.firstChild);a.appendChild(m),h++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
24
+
25
+ `);return{dom:a,text:f,slice:e}}function Fu(t,e,n,r,s){let i=s.parent.type.spec.code,o,l;if(!n&&!e)return null;let a=!!e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return l=new F(j.from(t.state.schema.text(e.replace(/\r\n?/g,`
26
+ `))),0,0),t.someProp("transformPasted",f=>{l=f(l,t,!0)}),l;let h=t.someProp("clipboardTextParser",f=>f(e,s,r,t));if(h)l=h;else{let f=s.marks(),{schema:p}=t.state,m=tr.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=o.appendChild(document.createElement("p"));g&&b.appendChild(m.serializeNode(p.text(g,f)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=G0(n),xs&&J0(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let h=+u[3];h>0;h--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||_n.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!U0.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=Y0(yc(l,+u[1],+u[2]),u[4]);else if(l=F.maxOpen(q0(l.content,s),!0),l.openStart||l.openEnd){let h=0,f=0;for(let p=l.content.firstChild;h<l.openStart&&!p.type.spec.isolating;h++,p=p.firstChild);for(let p=l.content.lastChild;f<l.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);l=yc(l,h,f)}return t.someProp("transformPasted",h=>{l=h(l,t,a)}),l}const U0=/^(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 q0(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let s=e.node(n).contentMatchAt(e.index(n)),i,o=[];if(t.forEach(l=>{if(!o)return;let a=s.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&i.length&&Wu(a,i,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=Vu(o[o.length-1],i.length));let u=Hu(l,a);o.push(u),s=s.matchType(u.type),i=a}}),o)return j.from(o)}return t}function Hu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,j.from(t));return t}function Wu(t,e,n,r,s){if(s<t.length&&s<e.length&&t[s]==e[s]){let i=Wu(t,e,n,r.lastChild,s+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(s==t.length-1?n.type:t[s+1]))return r.copy(r.content.append(j.from(Hu(n,t,s+1))))}}function Vu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Vu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(j.empty,!0);return t.copy(n.append(r))}function cl(t,e,n,r,s,i){let o=e<0?t.firstChild:t.lastChild,l=o.content;return t.childCount>1&&(i=0),s<r-1&&(l=cl(l,e,n,r,s+1,i)),s>=n&&(l=e<0?o.contentMatchAt(0).fillBefore(l,i<=s).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(j.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(l))}function yc(t,e,n){return e<t.openStart&&(t=new F(cl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new F(cl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Uu={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let xc=null;function qu(){return xc||(xc=document.implementation.createHTMLDocument("title"))}let wo=null;function K0(t){let e=window.trustedTypes;return e?(wo||(wo=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),wo.createHTML(t)):t}function G0(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=qu().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),s;if((s=r&&Uu[r[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=K0(t),s)for(let i=0;i<s.length;i++)n=n.querySelector(s[i])||n;return n}function J0(t){let e=t.querySelectorAll(Qe?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function Y0(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:s,openStart:i,openEnd:o}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;s=j.from(a.create(r[l+1],s)),i++,o++}return new F(s,i,o)}const it={},ot={},Q0={touchstart:!0,touchmove:!0};class X0{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 Z0(t){for(let e in it){let n=it[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{t_(t,r)&&!Hl(t,r)&&(t.editable||!(r.type in ot))&&n(t,r)},Q0[e]?{passive:!0}:void 0)}nt&&t.dom.addEventListener("input",()=>null),dl(t)}function xn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function e_(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function dl(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Hl(t,r))})}function Hl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function t_(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function n_(t,e){!Hl(t,e)&&it[e.type]&&(t.editable||!(e.type in ot))&&it[e.type](t,e)}ot.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Gu(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(rn&&Qe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),yr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",s=>s(t,Rn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||V0(t,n)?n.preventDefault():xn(t,"key")};ot.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ot.keypress=(t,e)=>{let n=e;if(Gu(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Tt&&n.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Q)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,s,i))&&t.dispatch(i()),n.preventDefault()}};function Gi(t){return{left:t.clientX,top:t.clientY}}function r_(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Wl(t,e,n,r,s){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(t.someProp(e,l=>o>i.depth?l(t,n,i.nodeAfter,i.before(o),s,!0):l(t,n,i.node(o),i.before(o),s,!1)))return!0;return!1}function fr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function s_(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(fr(t,new J(n)),!0):!1}function i_(t,e){if(e==-1)return!1;let n=t.state.selection,r,s;n instanceof J&&(r=n.node);let i=t.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o);if(J.isSelectable(l)){r&&n.$from.depth>0&&o>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?s=i.before(n.$from.depth):s=i.before(o);break}}return s!=null?(fr(t,J.create(t.state.doc,s)),!0):!1}function o_(t,e,n,r,s){return Wl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(s?i_(t,n):s_(t,n))}function l_(t,e,n,r){return Wl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",s=>s(t,e,r))}function a_(t,e,n,r){return Wl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",s=>s(t,e,r))||c_(t,n,r)}function c_(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(fr(t,Q.create(r,0,r.content.size)),!0):!1;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),l=s.before(i);if(o.inlineContent)fr(t,Q.create(r,l+1,l+1+o.content.size));else if(J.isSelectable(o))fr(t,J.create(r,l));else continue;return!0}}function Vl(t){return si(t)}const Ku=Tt?"metaKey":"ctrlKey";it.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Vl(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&r_(n,t.input.lastClick)&&!n[Ku]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i,button:n.button};let o=t.posAtCoords(Gi(n));o&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new d_(t,o,n,!!r)):(i=="doubleClick"?l_:a_)(t,o.pos,o.inside,n)?n.preventDefault():xn(t,"pointer"))};class d_{constructor(e,n,r,s){this.view=e,this.pos=n,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Ku],this.allowDefault=r.shiftKey;let i,o;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),o=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,o=u.depth?u.before():0}const l=s?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof J&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&jt&&!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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),xn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),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(()=>on(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Gi(e))),this.updateAllowDefault(e),this.allowDefault||!n?xn(this.view,"pointer"):o_(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||nt&&this.mightDrag&&!this.mightDrag.node.isAtom||Qe&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(fr(this.view,se.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):xn(this.view,"pointer")}move(e){this.updateAllowDefault(e),xn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}it.touchstart=t=>{t.input.lastTouch=Date.now(),Vl(t),xn(t,"pointer")};it.touchmove=t=>{t.input.lastTouch=Date.now(),xn(t,"pointer")};it.contextmenu=t=>Vl(t);function Gu(t,e){return t.composing?!0:nt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const u_=rn?5e3:-1;ot.compositionstart=ot.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Q&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Qe&&Su&&h_(t)))t.markCursor=t.state.storedMarks||n.marks(),si(t,!0),t.markCursor=null;else if(si(t,!e.selection.empty),jt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let l=t.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}t.input.composing=!0}Ju(t,u_)};function h_(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}ot.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Ju(t,20))};function Ju(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>si(t),e))}function Yu(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=p_());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function f_(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=i0(e.focusNode,e.focusOffset),r=o0(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let s=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function p_(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function si(t,e=!1){if(!(rn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Yu(t),e||t.docView&&t.docView.dirty){let n=Pl(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function m_(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const ls=ht&&vn<15||yr&&d0<604;it.copy=ot.cut=(t,e)=>{let n=e,r=t.state.selection,s=n.type=="cut";if(r.empty)return;let i=ls?null:n.clipboardData,o=r.content(),{dom:l,text:a}=Fl(t,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):m_(t,l),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function g_(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function b_(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?as(t,r.value,null,s,e):as(t,r.textContent,r.innerHTML,s,e)},50)}function as(t,e,n,r,s){let i=Fu(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,s,i||F.empty)))return!0;if(!i)return!1;let o=g_(i),l=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(i);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Qu(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ot.paste=(t,e)=>{let n=e;if(t.composing&&!rn)return;let r=ls?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&as(t,Qu(r),r.getData("text/html"),s,n)?n.preventDefault():b_(t,n)};class Xu{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const y_=Tt?"altKey":"ctrlKey";function Zu(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[y_]}it.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let s=t.state.selection,i=s.empty?null:t.posAtCoords(Gi(n)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof J?s.to-1:s.to))){if(r&&r.mightDrag)o=J.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=J.create(t.state.doc,h.posBefore))}}let l=(o||t.state.selection).content(),{dom:a,text:c,slice:u}=Fl(t,l);(!n.dataTransfer.files.length||!Qe||Cu>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ls?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",ls||n.dataTransfer.setData("text/plain",c),t.dragging=new Xu(u,Zu(t,n),o)};it.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ot.dragover=ot.dragenter=(t,e)=>e.preventDefault();ot.drop=(t,e)=>{try{x_(t,e,t.dragging)}finally{t.dragging=null}};function x_(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Gi(e));if(!r)return;let s=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",p=>{i=p(i,t,!1)}):i=Fu(t,Qu(e.dataTransfer),ls?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&Zu(t,e));if(t.someProp("handleDrop",p=>p(t,e,i||F.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?nu(t.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let a=t.state.tr;if(o){let{node:p}=n;p?p.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=a.doc;if(u?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(h))return;let f=a.doc.resolve(c);if(u&&J.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new J(f));else{let p=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((m,g,b,y)=>p=y),a.setSelection(zl(t,f,a.doc.resolve(p)))}t.focus(),t.dispatch(a.setMeta("uiEvent","drop"))}it.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&on(t)},20))};it.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};it.beforeinput=(t,e)=>{if(Qe&&rn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,Rn(8,"Backspace")))))return;let{$cursor:s}=t.state.selection;s&&s.pos>0&&t.dispatch(t.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let t in ot)it[t]=ot[t];function cs(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class ii{constructor(e,n){this.toDOM=e,this.spec=n||Un,this.side=this.spec.side||0}map(e,n,r,s){let{pos:i,deleted:o}=e.mapResult(n.from+s,this.side<0?-1:1);return o?null:new tt(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ii&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&cs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class wn{constructor(e,n){this.attrs=e,this.spec=n||Un}map(e,n,r,s){let i=e.map(n.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new tt(i,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof wn&&cs(this.attrs,e.attrs)&&cs(this.spec,e.spec)}static is(e){return e.type instanceof wn}destroy(){}}class Ul{constructor(e,n){this.attrs=e,this.spec=n||Un}map(e,n,r,s){let i=e.mapResult(n.from+s,1);if(i.deleted)return null;let o=e.mapResult(n.to+s,-1);return o.deleted||o.pos<=i.pos?null:new tt(i.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:s}=e.content.findIndex(n.from),i;return s==n.from&&!(i=e.child(r)).isText&&s+i.nodeSize==n.to}eq(e){return this==e||e instanceof Ul&&cs(this.attrs,e.attrs)&&cs(this.spec,e.spec)}destroy(){}}class tt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new tt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new tt(e,e,new ii(n,r))}static inline(e,n,r,s){return new tt(e,n,new wn(r,s))}static node(e,n,r,s){return new tt(e,n,new Ul(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof wn}get widget(){return this.type instanceof ii}}const cr=[],Un={};class Se{constructor(e,n){this.local=e.length?e:cr,this.children=n.length?n:cr}static create(e,n){return n.length?oi(n,e,0,Un):et}find(e,n,r){let s=[];return this.findInner(e??0,n??1e9,s,0,r),s}findInner(e,n,r,s,i){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=n&&l.to>=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+s,l.to+s))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,n-l,r,s+l,i)}}map(e,n,r){return this==et||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Un)}mapInner(e,n,r,s,i){let o;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,s);a&&a.type.valid(n,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?__(this.children,o||[],e,n,r,s,i):o?new Se(o.sort(qn),cr):et}add(e,n){return n.length?this==et?Se.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let s,i=0;e.forEach((l,a)=>{let c=a+r,u;if(u=th(n,l,c)){for(s||(s=this.children.slice());i<s.length&&s[i]<a;)i+=3;s[i]==a?s[i+2]=s[i+2].addInner(l,u,c+1):s.splice(i,0,a,a+l.nodeSize,oi(u,l,c+1,Un)),i+=3}});let o=eh(i?nh(n):n,-r);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new Se(o.length?this.local.concat(o).sort(qn):this.local,s||this.children)}remove(e){return e.length==0||this==et?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,s=this.local;for(let i=0;i<r.length;i+=3){let o,l=r[i]+n,a=r[i+1]+n;for(let u=0,h;u<e.length;u++)(h=e[u])&&h.from>l&&h.to<a&&(e[u]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(o,l+1);c!=et?r[i+2]=c:(r.splice(i,3),i-=3)}if(s.length){for(let i=0,o;i<e.length;i++)if(o=e[i])for(let l=0;l<s.length;l++)s[l].eq(o,n)&&(s==this.local&&(s=this.local.slice()),s.splice(l--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new Se(s,r):et}forChild(e,n){if(this==et)return this;if(n.isLeaf)return Se.empty;let r,s;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,o=i+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<o&&a.to>i&&a.type instanceof wn){let c=Math.max(i,a.from)-i,u=Math.min(o,a.to)-i;c<u&&(s||(s=[])).push(a.copy(c,u))}}if(s){let l=new Se(s.sort(qn),cr);return r?new gn([l,r]):l}return r||et}eq(e){if(this==e)return!0;if(!(e instanceof Se)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return ql(this.localsInner(e))}localsInner(e){if(this==et)return cr;if(e.inlineContent||!this.local.some(wn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof wn||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Se.empty=new Se([],[]);Se.removeOverlap=ql;const et=Se.empty;class gn{constructor(e){this.members=e}map(e,n){const r=this.members.map(s=>s.map(e,n,Un));return gn.from(r)}forChild(e,n){if(n.isLeaf)return Se.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,n);i!=et&&(i instanceof gn?r=r.concat(i.members):r.push(i))}return gn.from(r)}eq(e){if(!(e instanceof gn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let s=0;s<this.members.length;s++){let i=this.members[s].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let o=0;o<i.length;o++)n.push(i[o])}}return n?ql(r?n:n.sort(qn)):cr}static from(e){switch(e.length){case 0:return et;case 1:return e[0];default:return new gn(e.every(n=>n instanceof Se)?e:e.reduce((n,r)=>n.concat(r instanceof Se?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function __(t,e,n,r,s,i,o){let l=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let h=0;n.maps[c].forEach((f,p,m,g)=>{let b=g-m-(p-f);for(let y=0;y<l.length;y+=3){let _=l[y+1];if(_<0||f>_+u-h)continue;let v=l[y]+u-h;p>=v?l[y+1]=f<=v?-2:-1:f>=u&&b&&(l[y]+=b,l[y+1]+=b)}h+=b}),u=n.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=n.map(t[c]+i),h=u-s;if(h<0||h>=r.content.size){a=!0;continue}let f=n.map(t[c+1]+i,-1),p=f-s,{index:m,offset:g}=r.content.findIndex(h),b=r.maybeChild(m);if(b&&g==h&&g+b.nodeSize==p){let y=l[c+2].mapInner(n,b,u+1,t[c]+i+1,o);y!=et?(l[c]=h,l[c+1]=p,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=v_(l,t,e,n,s,i,o),u=oi(c,r,0,o);e=u.local;for(let h=0;h<l.length;h+=3)l[h+1]<0&&(l.splice(h,3),h-=3);for(let h=0,f=0;h<u.children.length;h+=3){let p=u.children[h];for(;f<l.length&&l[f]<p;)f+=3;l.splice(f,0,u.children[h],u.children[h+1],u.children[h+2])}}return new Se(e.sort(qn),l)}function eh(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let s=t[r];n.push(new tt(s.from+e,s.to+e,s.type))}return n}function v_(t,e,n,r,s,i,o){function l(a,c){for(let u=0;u<a.local.length;u++){let h=a.local[u].map(r,s,c);h?n.push(h):o.onRemove&&o.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+i+1);return n}function th(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,s=null;for(let i=0,o;i<t.length;i++)(o=t[i])&&o.from>n&&o.to<r&&((s||(s=[])).push(o),t[i]=null);return s}function nh(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function oi(t,e,n,r){let s=[],i=!1;e.forEach((l,a)=>{let c=th(t,l,a+n);if(c){i=!0;let u=oi(c,l,n+a+1,r);u!=et&&s.push(a,a+l.nodeSize,u)}});let o=eh(i?nh(t):t,-n).sort(qn);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(r.onRemove&&r.onRemove(o[l].spec),o.splice(l--,1));return o.length||s.length?new Se(o,s):et}function qn(t,e){return t.from-e.from||t.to-e.to}function ql(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let s=n+1;s<e.length;s++){let i=e[s];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[s]=i.copy(i.from,r.to),_c(e,s+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),_c(e,s,r.copy(i.from,r.to)));break}}}return e}function _c(t,e,n){for(;e<t.length&&qn(n,t[e])>0;)e++;t.splice(e,0,n)}function Co(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=et&&e.push(r)}),t.cursorWrapper&&e.push(Se.create(t.state.doc,[t.cursorWrapper.deco])),gn.from(e)}const k_={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},w_=ht&&vn<=11;class C_{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 S_{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new C_,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;s<r.length;s++)this.queue.push(r[s]);ht&&vn<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():nt&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),w_&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,k_)),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 n=0;n<e.length;n++)this.queue.push(e[n]);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(hc(this.view)){if(this.suppressingSelectionUpdates)return on(this.view);if(ht&&vn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Qn(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 n=new Set,r;for(let i=e.focusNode;i;i=br(i))n.add(i);for(let i=e.anchorNode;i;i=br(i))if(n.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))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 n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&hc(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,l=!1,a=[];if(e.editable)for(let u=0;u<n.length;u++){let h=this.registerMutation(n[u],a);h&&(i=i<0?h.from:Math.min(h.from,i),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(l=!0))}if(a.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let u of a)if(u.nodeName=="BR"&&u.parentNode){let h=u.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){u.parentNode.removeChild(u);break}h=h.firstChild}}}else if(jt&&a.length){let u=a.filter(h=>h.nodeName=="BR");if(u.length==2){let[h,f]=u;h.parentNode&&h.parentNode.parentNode==f.parentNode?f.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&p.nodeName=="LI"&&(!h||T_(e,h)!=p)&&f.remove()}}}let c=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&qi(r)&&(c=Pl(e))&&c.eq(se.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,on(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||s)&&(i>-1&&(e.docView.markDirty(i,o),N_(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,E_(e,a)),this.handleDOMChange(i,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||on(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let h=e.addedNodes[u];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let s=e.previousSibling,i=e.nextSibling;if(ht&&vn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:h,nextSibling:f}=e.addedNodes[u];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let o=s&&s.parentNode==e.target?Je(s)+1:0,l=r.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?Je(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let vc=new WeakMap,kc=!1;function N_(t){if(!vc.has(t)&&(vc.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=jt,kc)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."),kc=!0}}function wc(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Qn(o.node,o.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function A_(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return wc(t,s)}let n;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?wc(t,n):null}function T_(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function E_(t,e){var n;let{focusNode:r,focusOffset:s}=t.domSelectionRange();for(let i of e)if(((n=i.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=i.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(i,l.firstChild),r==i&&t.domSelection().collapse(i,s)}else i.parentNode.removeChild(i)}}function M_(t,e,n){let{node:r,fromOffset:s,toOffset:i,from:o,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),c,u=a.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:a.anchorOffset}],qi(a)||c.push({node:a.focusNode,offset:a.focusOffset})),Qe&&t.input.lastKeyCode===8)for(let b=i;b>s;b--){let y=r.childNodes[b-1],_=y.pmViewDesc;if(y.nodeName=="BR"&&!_){i=b;break}if(!_||_.size)break}let h=t.state.doc,f=t.someProp("domParser")||_n.fromSchema(t.state.schema),p=h.resolve(o),m=null,g=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:j_,context:p});if(c&&c[0].pos!=null){let b=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=b),m={anchor:b+o,head:y+o}}return{doc:g,sel:m,from:o,to:l}}function j_(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(nt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||nt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const I_=/^(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 D_(t,e,n,r,s){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,D=Pl(t,C);if(D&&!t.state.selection.eq(D)){if(Qe&&rn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",N=>N(t,Rn(13,"Enter"))))return;let B=t.state.tr.setSelection(D);C=="pointer"?B.setMeta("pointer",!0):C=="key"&&B.scrollIntoView(),i&&B.setMeta("composition",i),t.dispatch(B)}return}let o=t.state.doc.resolve(e),l=o.sharedDepth(n);e=o.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,c=M_(t,e,n),u=t.state.doc,h=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=R_(h.content,c.doc.content,c.from,f,p);if(m&&t.input.domChangeCount++,(yr&&t.input.lastIOSEnter>Date.now()-225||rn)&&s.some(C=>C.nodeType==1&&!I_.test(C.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",C=>C(t,Rn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&a instanceof Q&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let C=Cc(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let D=t.state.tr.setSelection(C);i&&D.setMeta("composition",i),t.dispatch(D)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof Q&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),ht&&vn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),b=c.doc.resolveNoCache(m.endB-c.from),y=u.resolve(m.start),_=g.sameParent(b)&&g.parent.inlineContent&&y.end()>=m.endA;if((yr&&t.input.lastIOSEnter>Date.now()-225&&(!_||s.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!_&&g.pos<c.doc.content.size&&(!g.sameParent(b)||!g.parent.inlineContent)&&g.pos<b.pos&&!/\S/.test(c.doc.textBetween(g.pos,b.pos,"","")))&&t.someProp("handleKeyDown",C=>C(t,Rn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&L_(u,m.start,m.endA,g,b)&&t.someProp("handleKeyDown",C=>C(t,Rn(8,"Backspace")))){rn&&Qe&&t.domObserver.suppressSelectionUpdates();return}Qe&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),rn&&!_&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,b=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,Rn(13,"Enter"))})},20));let v=m.start,w=m.endA,k=C=>{let D=C||t.state.tr.replace(v,w,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let B=Cc(t,D.doc,c.sel);B&&!(Qe&&t.composing&&B.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(B.head==v||B.head==D.mapping.map(w)-1)||ht&&B.empty&&B.head==v)&&D.setSelection(B)}return i&&D.setMeta("composition",i),D.scrollIntoView()},S;if(_)if(g.pos==b.pos){ht&&vn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>on(t),20));let C=k(t.state.tr.delete(v,w)),D=u.resolve(m.start).marksAcross(u.resolve(m.endA));D&&C.ensureMarks(D),t.dispatch(C)}else if(m.endA==m.endB&&(S=O_(g.parent.content.cut(g.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let C=k(t.state.tr);S.type=="add"?C.addMark(v,w,S.mark):C.removeMark(v,w,S.mark),t.dispatch(C)}else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let C=g.parent.textBetween(g.parentOffset,b.parentOffset),D=()=>k(t.state.tr.insertText(C,v,w));t.someProp("handleTextInput",B=>B(t,v,w,C,D))||t.dispatch(D())}else t.dispatch(k());else t.dispatch(k())}function Cc(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:zl(t,e.resolve(n.anchor),e.resolve(n.head))}function O_(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,s=n,i=r,o,l,a;for(let u=0;u<r.length;u++)s=r[u].removeFromSet(s);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(s.length==1&&i.length==0)l=s[0],o="add",a=u=>u.mark(l.addToSet(u.marks));else if(s.length==0&&i.length==1)l=i[0],o="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(a(e.child(u)));if(j.from(c).eq(t))return{mark:l,type:o}}function L_(t,e,n,r,s){if(n-e<=s.pos-r.pos||So(r,!0,!1)<s.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let l=i.nodeAfter;return l!=null&&n==e+l.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let o=t.resolve(So(i,!0,!0));return!o.parent.isTextblock||o.pos>n||So(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function So(t,e,n){let r=t.depth,s=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,s++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function R_(t,e,n,r,s){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:o,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(s=="end"){let a=Math.max(0,i-Math.min(o,l));r-=o+a-i}if(o<i&&t.size<e.size){let a=r<=i&&r>=o?i-r:0;i-=a,i&&i<e.size&&Sc(e.textBetween(i-1,i+1))&&(i+=a?1:-1),l=i+(l-o),o=i}else if(l<i){let a=r<=i&&r>=l?i-r:0;i-=a,i&&i<t.size&&Sc(t.textBetween(i-1,i+1))&&(i+=a?1:-1),o=i+(o-l),l=i}return{start:i,endA:o,endB:l}}function Sc(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class rh{constructor(e,n){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 X0,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Mc),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=Tc(this),Ac(this),this.nodeViews=Ec(this),this.docView=oc(this.state.doc,Nc(this),Co(this),this.dom,this),this.domObserver=new S_(this,(r,s,i,o)=>D_(this,r,s,i,o)),this.domObserver.start(),Z0(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&dl(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Mc),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let s=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Yu(this),o=!0),this.state=e;let l=s.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=Ec(this);$_(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&dl(this),this.editable=Tc(this),Ac(this);let a=Co(this),c=Nc(this),u=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,c,a);(h||!e.selection.eq(s.selection))&&(o=!0);let f=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&f0(this);if(o){this.domObserver.stop();let p=h&&(ht||Qe)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&B_(s.selection,e.selection);if(h){let m=Qe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=f_(this)),(i||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=oc(e.doc,c,a,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&B0(this))?on(this,p):($u(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&p0(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&ec(this,n.getBoundingClientRect(),e)}else ec(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 n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,s=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)s=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(s=i)}this.dragging=new Xu(e.slice,e.move,s<0?void 0:J.create(this.state.doc,s))}someProp(e,n){let r=this._props&&this._props[e],s;if(r!=null&&(s=n?n(r):r))return s;for(let o=0;o<this.directPlugins.length;o++){let l=this.directPlugins[o].props[e];if(l!=null&&(s=n?n(l):l))return s}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let l=i[o].props[e];if(l!=null&&(s=n?n(l):l))return s}}hasFocus(){if(ht){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&&m0(this.dom),on(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return _0(this,e)}coordsAtPos(e,n=1){return Mu(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let s=this.docView.posFromDOM(e,n,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,n){return S0(this,n||this.state,e)}pasteHTML(e,n){return as(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return as(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Fl(this,e)}destroy(){this.docView&&(e_(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Co(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,r0())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return n_(this,e)}domSelectionRange(){let e=this.domSelection();return e?nt&&this.root.nodeType===11&&a0(this.dom.ownerDocument)==this.dom&&A_(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}rh.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Nc(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[tt.node(0,t.state.doc.content.size,e)]}function Ac(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:tt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Tc(t){return!t.someProp("editable",e=>e(t.state)===!1)}function B_(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Ec(t){let e=Object.create(null);function n(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function $_(t,e){let n=0,r=0;for(let s in t){if(t[s]!=e[s])return!0;n++}for(let s in e)r++;return n!=r}function Mc(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Cn={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:"'"},li={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},P_=typeof navigator<"u"&&/Mac/.test(navigator.platform),z_=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ye=0;Ye<10;Ye++)Cn[48+Ye]=Cn[96+Ye]=String(Ye);for(var Ye=1;Ye<=24;Ye++)Cn[Ye+111]="F"+Ye;for(var Ye=65;Ye<=90;Ye++)Cn[Ye]=String.fromCharCode(Ye+32),li[Ye]=String.fromCharCode(Ye);for(var No in Cn)li.hasOwnProperty(No)||(li[No]=Cn[No]);function F_(t){var e=P_&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||z_&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?li:Cn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const H_=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),W_=typeof navigator<"u"&&/Win/.test(navigator.platform);function V_(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,s,i,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))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))H_?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),o&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function U_(t){let e=Object.create(null);for(let n in t)e[V_(n)]=t[n];return e}function Ao(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function q_(t){return new Ne({props:{handleKeyDown:sh(t)}})}function sh(t){let e=U_(t);return function(n,r){let s=F_(r),i,o=e[Ao(s,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let l=e[Ao(s,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(W_&&r.ctrlKey&&r.altKey)&&(i=Cn[r.keyCode])&&i!=s){let l=e[Ao(i,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var K_=Object.defineProperty,Kl=(t,e)=>{for(var n in e)K_(t,n,{get:e[n],enumerable:!0})};function Ji(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:s}=n,{storedMarks:i}=n;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 i},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,i=n.storedMarks,n}}}var Yi=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:s}=n,i=this.buildProps(s);return Object.fromEntries(Object.entries(t).map(([o,l])=>[o,(...c)=>{const u=l(...c)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o=[],l=!!t,a=t||s.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(a),o.every(h=>h===!0)),u={...Object.fromEntries(Object.entries(n).map(([h,f])=>[h,(...m)=>{const g=this.buildProps(a,e),b=f(...m)(g);return o.push(b),u}])),run:c};return u}createCan(t){const{rawCommands:e,state:n}=this,r=!1,s=t||n.tr,i=this.buildProps(s,r);return{...Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>a(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o={tr:t,editor:r,view:i,state:Ji({state:s,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,a])=>[l,(...c)=>a(...c)(o)]))}};return o}},ih={};Kl(ih,{blur:()=>G_,clearContent:()=>J_,clearNodes:()=>Y_,command:()=>Q_,createParagraphNear:()=>X_,cut:()=>Z_,deleteCurrentNode:()=>ev,deleteNode:()=>tv,deleteRange:()=>nv,deleteSelection:()=>iv,enter:()=>ov,exitCode:()=>lv,extendMarkRange:()=>av,first:()=>cv,focus:()=>uv,forEach:()=>hv,insertContent:()=>fv,insertContentAt:()=>gv,joinBackward:()=>xv,joinDown:()=>yv,joinForward:()=>_v,joinItemBackward:()=>vv,joinItemForward:()=>kv,joinTextblockBackward:()=>wv,joinTextblockForward:()=>Cv,joinUp:()=>bv,keyboardShortcut:()=>Nv,lift:()=>Av,liftEmptyBlock:()=>Tv,liftListItem:()=>Ev,newlineInCode:()=>Mv,resetAttributes:()=>jv,scrollIntoView:()=>Iv,selectAll:()=>Dv,selectNodeBackward:()=>Ov,selectNodeForward:()=>Lv,selectParentNode:()=>Rv,selectTextblockEnd:()=>Bv,selectTextblockStart:()=>$v,setContent:()=>Pv,setMark:()=>ok,setMeta:()=>lk,setNode:()=>ak,setNodeSelection:()=>ck,setTextDirection:()=>dk,setTextSelection:()=>uk,sinkListItem:()=>hk,splitBlock:()=>fk,splitListItem:()=>pk,toggleList:()=>gk,toggleMark:()=>bk,toggleNode:()=>yk,toggleWrap:()=>xk,undoInputRule:()=>_k,unsetAllMarks:()=>vk,unsetMark:()=>kk,unsetTextDirection:()=>wk,updateAttributes:()=>Ck,wrapIn:()=>Sk,wrapInList:()=>Nk});var G_=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),J_=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Y_=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:s}=r;return n&&s.forEach(({$from:i,$to:o})=>{t.doc.nodesBetween(i.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,h=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),p=h.blockRange(f);if(!p)return;const m=kr(p);if(l.type.isTextblock){const{defaultType:g}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},Q_=t=>e=>t(e),X_=()=>({state:t,dispatch:e})=>xu(t,e),Z_=(t,e)=>({editor:n,tr:r})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,i.content),r.setSelection(new Q(r.doc.resolve(Math.max(o-1,0)))),!0},ev=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const s=t.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(e){const l=s.before(i),a=s.after(i);t.delete(l,a).scrollIntoView()}return!0}return!1};function He(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var tv=t=>({tr:e,state:n,dispatch:r})=>{const s=He(t,n.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s){if(r){const a=i.before(o),c=i.after(o);e.delete(a,c).scrollIntoView()}return!0}return!1},nv=t=>({tr:e,dispatch:n})=>{const{from:r,to:s}=t;return n&&e.delete(r,s),!0},rv=t=>t.content?/^text(\*|\+)/.test(t.content):!1,jc=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos<t.end())return t.pos;const r=e.nodes[t.parent.type.name].spec;return rv(r)?n==="left"?t.start()-1:t.end()+1:t.pos},sv=(t,e,n)=>{const r=jc(t,n,"left"),s=jc(e,n,"right");return{from:r,to:s}},iv=()=>({state:t,dispatch:e})=>{const{$from:n,$to:r}=t.selection;if(t.selection.empty)return!1;const{from:s,to:i}=sv(n,r,t.schema);return e&&(t.tr.deleteRange(s,i).scrollIntoView(),e(t.tr)),!0},ov=()=>({commands:t})=>t.keyboardShortcut("Enter"),lv=()=>({state:t,dispatch:e})=>Hx(t,e);function Gl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function ai(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>n.strict?e[s]===t[s]:Gl(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function oh(t,e,n={}){return t.find(r=>r.type===e&&ai(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function Ic(t,e,n={}){return!!oh(t,e,n)}function Jl(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===e))return;if(!n){const c=r.node.marks.find(u=>u.type===e);c&&(n=c.attrs)}if(!oh([...r.node.marks],e,n))return;let i=r.index,o=t.start()+r.offset,l=i+1,a=o+r.node.nodeSize;for(;i>0&&Ic([...t.parent.child(i-1).marks],e,n);)i-=1,o-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&Ic([...t.parent.child(l).marks],e,n);)a+=t.parent.child(l).nodeSize,l+=1;return{from:o,to:a}}function ln(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var av=(t,e)=>({tr:n,state:r,dispatch:s})=>{const i=ln(t,r.schema),{doc:o,selection:l}=n,{$from:a,from:c,to:u}=l;if(s){const h=Jl(a,i,e);if(h&&h.from<=c&&h.to>=u){const f=Q.create(o,h.from,h.to);n.setSelection(f)}}return!0},cv=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function lh(t){return t instanceof Q}function Pn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function ah(t,e=null){if(!e)return null;const n=se.atStart(t),r=se.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const s=n.from,i=r.to;return e==="all"?Q.create(t,Pn(0,s,i),Pn(t.content.size,s,i)):Q.create(t,Pn(e,s,i),Pn(e,s,i))}function Dc(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function ci(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function dv(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var uv=(t=null,e={})=>({editor:n,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(ci()||Dc())&&r.dom.focus(),dv()&&!ci()&&!Dc()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(i&&t===null&&!lh(n.state.selection))return o(),!0;const l=ah(s.doc,t)||n.state.selection,a=n.state.selection.eq(l);return i&&(a||s.setSelection(l),a&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},hv=(t,e)=>n=>t.every((r,s)=>e(r,{...n,index:s})),fv=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),ch=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&ch(r)}return t};function Ds(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return ch(n)}function ds(t,e,n){if(t instanceof Mt||t instanceof j)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,s=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return j.fromArray(t.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),ds("",e,n)}if(s){if(n.errorOnInvalidContent){let o=!1,l="";const a=new Ud({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:c=>(o=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?_n.fromSchema(a).parseSlice(Ds(t),n.parseOptions):_n.fromSchema(a).parse(Ds(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=_n.fromSchema(e);return n.slice?i.parseSlice(Ds(t),n.parseOptions).content:i.parse(Ds(t),n.parseOptions)}return ds("",e,n)}function pv(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof ze||s instanceof Ue))return;const i=t.mapping.maps[r];let o=0;i.forEach((l,a,c,u)=>{o===0&&(o=u)}),t.setSelection(se.near(t.doc.resolve(o),n))}var mv=t=>!("type"in t),gv=(t,e,n)=>({tr:r,dispatch:s,editor:i})=>{var o;if(s){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const a=b=>{i.emit("contentError",{editor:i,error:b,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{ds(e,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(b){a(b)}try{l=ds(e,i.schema,{parseOptions:c,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(b){return a(b),!1}let{from:u,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0;if((mv(l)?l:[l]).forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,p=p?b.isBlock:!1}),u===h&&p){const{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,h+=1)}let g;if(f){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof j){let b="";e.forEach(y=>{y.text&&(b+=y.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,h)}else{g=l;const b=r.doc.resolve(u),y=b.node(),_=b.parentOffset===0,v=y.isText||y.isTextblock,w=y.content.size>0;_&&v&&w&&p&&(u=Math.max(0,u-1)),r.replaceWith(u,h,g)}n.updateSelection&&pv(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},bv=()=>({state:t,dispatch:e})=>Px(t,e),yv=()=>({state:t,dispatch:e})=>zx(t,e),xv=()=>({state:t,dispatch:e})=>hu(t,e),_v=()=>({state:t,dispatch:e})=>gu(t,e),vv=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Wi(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},kv=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Wi(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},wv=()=>({state:t,dispatch:e})=>Bx(t,e),Cv=()=>({state:t,dispatch:e})=>$x(t,e);function dh(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Sv(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,s,i,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))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))ci()||dh()?o=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}var Nv=t=>({editor:e,view:n,tr:r,dispatch:s})=>{const i=Sv(t).split(/-(?!$)/),o=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&s&&r.maybeStep(u)}),!0};function Sn(t,e,n={}){const{from:r,to:s,empty:i}=t.selection,o=e?He(e,t.schema):null,l=[];t.doc.nodesBetween(r,s,(h,f)=>{if(h.isText)return;const p=Math.max(r,f),m=Math.min(s,f+h.nodeSize);l.push({node:h,from:p,to:m})});const a=s-r,c=l.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>ai(h.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((h,f)=>h+f.to-f.from,0)>=a}var Av=(t,e={})=>({state:n,dispatch:r})=>{const s=He(t,n.schema);return Sn(n,s,e)?Fx(n,r):!1},Tv=()=>({state:t,dispatch:e})=>_u(t,e),Ev=t=>({state:e,dispatch:n})=>{const r=He(t,e.schema);return Zx(r)(e,n)},Mv=()=>({state:t,dispatch:e})=>yu(t,e);function Qi(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Oc(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,s)=>(n.includes(s)||(r[s]=t[s]),r),{})}var jv=(t,e)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const l=Qi(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(i=He(t,r.schema)),l==="mark"&&(o=ln(t,r.schema));let a=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,h)=>{i&&i===u.type&&(a=!0,s&&n.setNodeMarkup(h,void 0,Oc(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&(a=!0,s&&n.addMark(h,h+u.nodeSize,o.create(Oc(f.attrs,e))))})})}),a},Iv=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Dv=()=>({tr:t,dispatch:e})=>{if(e){const n=new xt(t.doc);t.setSelection(n)}return!0},Ov=()=>({state:t,dispatch:e})=>pu(t,e),Lv=()=>({state:t,dispatch:e})=>bu(t,e),Rv=()=>({state:t,dispatch:e})=>Ux(t,e),Bv=()=>({state:t,dispatch:e})=>Gx(t,e),$v=()=>({state:t,dispatch:e})=>Kx(t,e);function ul(t,e,n={},r={}){return ds(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Pv=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:l})=>{const{doc:a}=i;if(r.preserveWhitespace!=="full"){const c=ul(t,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});return o&&i.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!n),!0}return o&&i.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},t,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function uh(t,e){const n=ln(e,t.schema),{from:r,to:s,empty:i}=t.selection,o=[];i?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,s,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function hh(t,e){const n=new lu(t);return e.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function zv(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Fv(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function Hv(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Xi(t){return e=>Hv(e.$from,t)}function K(t,e,n){return t.config[e]===void 0&&t.parent?K(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?K(t.parent,e,n):null}):t.config[e]}function Yl(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=K(e,"addExtensions",n);return r?[e,...Yl(r())]:e}).flat(10)}function Ql(t,e){const n=tr.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}function fh(t){return typeof t=="function"}function me(t,e=void 0,...n){return fh(t)?e?t.bind(e)(...n):t(...n):t}function Wv(t={}){return Object.keys(t).length===0&&t.constructor===Object}function xr(t){const e=t.filter(s=>s.type==="extension"),n=t.filter(s=>s.type==="node"),r=t.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function ph(t){const e=[],{nodeExtensions:n,markExtensions:r}=xr(t),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(c=>c.name!=="text").map(c=>c.name),l=r.map(c=>c.name),a=[...o,...l];return t.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage,extensions:s},h=K(c,"addGlobalAttributes",u);if(!h)return;h().forEach(p=>{let m;Array.isArray(p.types)?m=p.types:p.types==="*"?m=a:p.types==="nodes"?m=o:p.types==="marks"?m=l:m=[],m.forEach(g=>{Object.entries(p.attributes).forEach(([b,y])=>{e.push({type:g,name:b,attribute:{...i,...y}})})})})}),s.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage},h=K(c,"addAttributes",u);if(!h)return;const f=h();Object.entries(f).forEach(([p,m])=>{const g={...i,...m};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:c.name,name:p,attribute:g})})}),e}function Vv(t){const e=[];let n="",r=!1,s=!1,i=0;const o=t.length;for(let l=0;l<o;l+=1){const a=t[l];if(a==="'"&&!s){r=!r,n+=a;continue}if(a==='"'&&!r){s=!s,n+=a;continue}if(!r&&!s){if(a==="("){i+=1,n+=a;continue}if(a===")"&&i>0){i-=1,n+=a;continue}if(a===";"&&i===0){e.push(n),n="";continue}}n+=a}return n&&e.push(n),e}function Lc(t){const e=[],n=Vv(t||""),r=n.length;for(let s=0;s<r;s+=1){const i=n[s],o=i.indexOf(":");if(o===-1)continue;const l=i.slice(0,o).trim(),a=i.slice(o+1).trim();l&&a&&e.push([l,a])}return e}function ye(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([s,i])=>{if(!r[s]){r[s]=i;return}if(s==="class"){const l=i?String(i).split(" "):[],a=r[s]?r[s].split(" "):[],c=l.filter(u=>!a.includes(u));r[s]=[...a,...c].join(" ")}else if(s==="style"){const l=new Map([...Lc(r[s]),...Lc(i)]);r[s]=Array.from(l.entries()).map(([a,c])=>`${a}: ${c}`).join("; ")}else r[s]=i}),r},{})}function us(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ye(n,r),{})}function Uv(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Rc(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const s=e.reduce((i,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(n):Uv(n.getAttribute(o.name));return l==null?i:{...i,[o.name]:l}},{});return{...r,...s}}}}function Bc(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Wv(n)?!1:n!=null))}function $c(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function qv(t,e){var n;const r=ph(t),{nodeExtensions:s,markExtensions:i}=xr(t),o=(n=s.find(c=>K(c,"topNode")))==null?void 0:n.name,l=Object.fromEntries(s.map(c=>{const u=r.filter(y=>y.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,_)=>{const v=K(_,"extendNodeSchema",h);return{...y,...v?v(c):{}}},{}),p=Bc({...f,content:me(K(c,"content",h)),marks:me(K(c,"marks",h)),group:me(K(c,"group",h)),inline:me(K(c,"inline",h)),atom:me(K(c,"atom",h)),selectable:me(K(c,"selectable",h)),draggable:me(K(c,"draggable",h)),code:me(K(c,"code",h)),whitespace:me(K(c,"whitespace",h)),linebreakReplacement:me(K(c,"linebreakReplacement",h)),defining:me(K(c,"defining",h)),isolating:me(K(c,"isolating",h)),attrs:Object.fromEntries(u.map($c))}),m=me(K(c,"parseHTML",h));m&&(p.parseDOM=m.map(y=>Rc(y,u)));const g=K(c,"renderHTML",h);g&&(p.toDOM=y=>g({node:y,HTMLAttributes:us(y,u)}));const b=K(c,"renderText",h);return b&&(p.toText=b),[c.name,p]})),a=Object.fromEntries(i.map(c=>{const u=r.filter(b=>b.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((b,y)=>{const _=K(y,"extendMarkSchema",h);return{...b,..._?_(c):{}}},{}),p=Bc({...f,inclusive:me(K(c,"inclusive",h)),excludes:me(K(c,"excludes",h)),group:me(K(c,"group",h)),spanning:me(K(c,"spanning",h)),code:me(K(c,"code",h)),attrs:Object.fromEntries(u.map($c))}),m=me(K(c,"parseHTML",h));m&&(p.parseDOM=m.map(b=>Rc(b,u)));const g=K(c,"renderHTML",h);return g&&(p.toDOM=b=>g({mark:b,HTMLAttributes:us(b,u)})),[c.name,p]}));return new Ud({topNode:o,nodes:l,marks:a})}function Kv(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Jr(t){return t.sort((n,r)=>{const s=K(n,"priority")||100,i=K(r,"priority")||100;return s>i?-1:s<i?1:0})}function mh(t){const e=Jr(Yl(t)),n=Kv(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function gh(t,e,n){const{from:r,to:s}=e,{blockSeparator:i=`
27
+
28
+ `,textSerializers:o={}}=n||{};let l="";return t.nodesBetween(r,s,(a,c,u,h)=>{var f;a.isBlock&&c>r&&(l+=i);const p=o==null?void 0:o[a.type.name];if(p)return u&&(l+=p({node:a,pos:c,parent:u,index:h,range:e})),!1;a.isText&&(l+=(f=a==null?void 0:a.text)==null?void 0:f.slice(Math.max(r,c)-c,s-c))}),l}function Gv(t,e){const n={from:0,to:t.content.size};return gh(t,n,e)}function bh(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function Jv(t,e){const n=He(e,t.schema),{from:r,to:s}=t.selection,i=[];t.doc.nodesBetween(r,s,l=>{i.push(l)});const o=i.reverse().find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function yh(t,e){const n=Qi(typeof e=="string"?e:e.name,t.schema);return n==="node"?Jv(t,e):n==="mark"?uh(t,e):{}}function Yv(t,e=JSON.stringify){const n={};return t.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function Qv(t){const e=Yv(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,o)=>o!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function xh(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const c=e.slice(i).map(l,-1),u=e.slice(i).map(a),h=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:h,to:f},newRange:{from:c,to:u}})})}),Qv(r)}function Xl(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=n.resolve(t),o=Jl(i,s.type);o&&r.push({mark:s,...o})}):n.nodesBetween(t,e,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(o=>({from:i,to:i+s.nodeSize,mark:o})))}),r}var Xv=(t,e,n,r=20)=>{const s=t.doc.resolve(n);let i=r,o=null;for(;i>0&&o===null;){const l=s.node(i);(l==null?void 0:l.type.name)===e?o=l:i-=1}return[o,i]};function Ir(t,e){return e.nodes[t]||e.marks[t]||null}function Ks(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=t.find(i=>i.type===e&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}var Zv=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,l)=>{var a,c;const u=((c=(a=s.type.spec).toText)==null?void 0:c.call(a,{node:s,pos:i,parent:o,index:l}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,r-i))}),n};function hl(t,e,n={}){const{empty:r,ranges:s}=t.selection,i=e?ln(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>ai(h.attrs,n,{strict:!1}));let o=0;const l=[];if(s.forEach(({$from:h,$to:f})=>{const p=h.pos,m=f.pos;t.doc.nodesBetween(p,m,(g,b)=>{if(i&&g.inlineContent&&!g.type.allowsMarkType(i))return!1;if(!g.isText&&!g.marks.length)return;const y=Math.max(p,b),_=Math.min(m,b+g.nodeSize),v=_-y;o+=v,l.push(...g.marks.map(w=>({mark:w,from:y,to:_})))})}),o===0)return!1;const a=l.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>ai(h.mark.attrs,n,{strict:!1})).reduce((h,f)=>h+f.to-f.from,0),c=l.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,f)=>h+f.to-f.from,0);return(a>0?a+c:a)>=o}function ek(t,e,n={}){if(!e)return Sn(t,null,n)||hl(t,null,n);const r=Qi(e,t.schema);return r==="node"?Sn(t,e,n):r==="mark"?hl(t,e,n):!1}var tk=(t,e)=>{const{$from:n,$to:r,$anchor:s}=t.selection;if(e){const i=Xi(l=>l.type.name===e)(t.selection);if(!i)return!1;const o=t.doc.resolve(i.pos+1);return s.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},nk=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function Pc(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function To(t,e){const{nodeExtensions:n}=xr(e),r=n.find(o=>o.name===t);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},i=me(K(r,"group",s));return typeof i!="string"?!1:i.split(" ").includes("list")}function hs(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let s=!0;return t.content.forEach(i=>{s!==!1&&(hs(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function _h(t){return t instanceof J}var vh=class kh{constructor(e){this.position=e}static fromJSON(e){return new kh(e.position)}toJSON(){return{position:this.position}}};function rk(t,e){const n=e.mapping.mapResult(t.position);return{position:new vh(n.pos),mapResult:n}}function sk(t){return new vh(t)}function ik(t,e,n){var r;const{selection:s}=e;let i=null;if(lh(s)&&(i=s.$cursor),i){const l=(r=t.storedMarks)!=null?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(c=>c.type.excludes(n)))}const{ranges:o}=s;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,a.pos,(u,h,f)=>{if(c)return!1;if(u.isInline){const p=!f||f.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=p&&m}return!c}),c})}var ok=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:l}=i,a=ln(t,r.schema);if(s)if(o){const c=uh(r,a);n.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(u,h,(f,p)=>{const m=Math.max(p,u),g=Math.min(p+f.nodeSize,h);f.marks.find(y=>y.type===a)?f.marks.forEach(y=>{a===y.type&&n.addMark(m,g,a.create({...y.attrs,...e}))}):n.addMark(m,g,a.create(e))})});return ik(r,n,a)},lk=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),ak=(t,e={})=>({state:n,dispatch:r,chain:s})=>{const i=He(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:l})=>Qa(i,{...o,...e})(n)?!0:l.clearNodes()).command(({state:l})=>Qa(i,{...o,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ck=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,s=Pn(t,0,r.content.size),i=J.create(r,s);e.setSelection(i)}return!0},dk=(t,e)=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=r;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=i.from,l=i.to),s&&n.doc.nodesBetween(o,l,(a,c)=>{a.isText||n.setNodeMarkup(c,void 0,{...a.attrs,dir:t})}),!0},uk=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:s,to:i}=typeof t=="number"?{from:t,to:t}:t,o=Q.atStart(r).from,l=Q.atEnd(r).to,a=Pn(s,o,l),c=Pn(i,o,l),u=Q.create(r,a,c);e.setSelection(u)}return!0},hk=t=>({state:e,dispatch:n})=>{const r=He(t,e.schema);return n0(r)(e,n)};function zc(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(s=>e==null?void 0:e.includes(s.type.name));t.tr.ensureMarks(r)}}var fk=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:l,$to:a}=i,c=s.extensionManager.attributes,u=Ks(c,l.node().type.name,l.node().attrs);if(i instanceof J&&i.node.isBlock)return!l.parentOffset||!sn(o,l.pos)?!1:(r&&(t&&zc(n,s.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const h=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:zv(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=h&&f?[{type:f,attrs:u}]:void 0,m=sn(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!m&&sn(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(i instanceof Q&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,p),f&&!h&&!l.parentOffset&&l.parent.type!==f)){const g=e.mapping.map(l.before()),b=e.doc.resolve(g);l.node(-1).canReplaceWith(b.index(),b.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}t&&zc(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return m},pk=(t,e={})=>({tr:n,state:r,dispatch:s,editor:i})=>{var o;const l=He(t,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const h=a.node(-1);if(h.type!==l)return!1;const f=i.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(s){let y=j.empty;const _=a.index(-1)?1:a.index(-2)?2:3;for(let D=a.depth-_;D>=a.depth-3;D-=1)y=j.from(a.node(D).copy(y));const v=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,w={...Ks(f,a.node().type.name,a.node().attrs),...e},k=((o=l.contentMatch.defaultType)==null?void 0:o.createAndFill(w))||void 0;y=y.append(j.from(l.createAndFill(null,k)||void 0));const S=a.before(a.depth-(_-1));n.replace(S,a.after(-v),new F(y,4-_,0));let C=-1;n.doc.nodesBetween(S,n.doc.content.size,(D,B)=>{if(C>-1)return!1;D.isTextblock&&D.content.size===0&&(C=B+1)}),C>-1&&n.setSelection(Q.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const p=c.pos===a.end()?h.contentMatchAt(0).defaultType:null,m={...Ks(f,h.type.name,h.attrs),...e},g={...Ks(f,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,c.pos);const b=p?[{type:l,attrs:m},{type:p,attrs:g}]:[{type:l,attrs:m}];if(!sn(n.doc,a.pos,2))return!1;if(s){const{selection:y,storedMarks:_}=r,{splittableMarks:v}=i.extensionManager,w=_||y.$to.parentOffset&&y.$from.marks();if(n.split(a.pos,2,b).scrollIntoView(),!w||!s)return!0;const k=w.filter(S=>v.includes(S.type.name));n.ensureMarks(k)}return!0},Eo=(t,e)=>{const n=Xi(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&An(t.doc,n.pos)&&t.join(n.pos),!0},Mo=(t,e)=>{const n=Xi(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&An(t.doc,r)&&t.join(r),!0};function mk(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),s=e.resolve(n.nodeSize-1);return Q.between(r,s)}var gk=(t,e,n,r={})=>({editor:s,tr:i,state:o,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:h,splittableMarks:f}=s.extensionManager,p=He(t,o.schema),m=He(e,o.schema),{selection:g,storedMarks:b}=o,{$from:y,$to:_}=g,v=y.blockRange(_),w=b||g.$to.parentOffset&&g.$from.marks();if(!v)return!1;const k=Xi(R=>To(R.type.name,h))(g),S=g.from===0&&g.to===o.doc.content.size,C=o.doc.content.content,D=C.length===1?C[0]:null,B=S&&D&&To(D.type.name,h)?{node:D,pos:0}:null,N=k??B,T=!!k&&v.depth>=1&&v.depth-k.depth<=1,$=!!B;if((T||$)&&N){if(N.node.type===p)return S&&$?a().command(({tr:R,dispatch:L})=>{const U=mk(R);return U?(R.setSelection(U),L&&L(R),!0):!1}).liftListItem(m).run():c.liftListItem(m);if(To(N.node.type.name,h)&&p.validContent(N.node.content))return a().command(()=>(i.setNodeMarkup(N.pos,p),!0)).command(()=>Eo(i,p)).command(()=>Mo(i,p)).run()}return!n||!w||!l?a().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>Eo(i,p)).command(()=>Mo(i,p)).run():a().command(()=>{const R=u().wrapInList(p,r),L=w.filter(U=>f.includes(U.type.name));return i.ensureMarks(L),R?!0:c.clearNodes()}).wrapInList(p,r).command(()=>Eo(i,p)).command(()=>Mo(i,p)).run()},bk=(t,e={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=ln(t,r.schema);return hl(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},yk=(t,e,n={})=>({state:r,commands:s})=>{const i=He(t,r.schema),o=He(e,r.schema),l=Sn(r,i,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?s.setNode(o,a):s.setNode(i,{...a,...n})},xk=(t,e={})=>({state:n,commands:r})=>{const s=He(t,n.schema);return Sn(n,s,e)?r.lift(s):r.wrapIn(s,e)},_k=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let i;if(s.spec.isInputRules&&(i=s.getState(t))){if(e){const o=t.tr,l=i.transform;for(let a=l.steps.length-1;a>=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(i.text){const a=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,a))}else o.delete(i.from,i.to)}return!0}}return!1},vk=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:s}=n;return r||e&&s.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},kk=(t,e={})=>({tr:n,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=n,a=ln(t,r.schema),{$from:c,empty:u,ranges:h}=l;if(!s)return!0;if(u&&o){let{from:f,to:p}=l;const m=(i=c.marks().find(b=>b.type===a))==null?void 0:i.attrs,g=Jl(c,a,m);g&&(f=g.from,p=g.to),n.removeMark(f,p,a)}else h.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},wk=t=>({tr:e,state:n,dispatch:r})=>{const{selection:s}=n;let i,o;return typeof t=="number"?(i=t,o=t):t&&"from"in t&&"to"in t?(i=t.from,o=t.to):(i=s.from,o=s.to),r&&e.doc.nodesBetween(i,o,(l,a)=>{if(l.isText)return;const c={...l.attrs};delete c.dir,e.setNodeMarkup(a,void 0,c)}),!0},Ck=(t,e={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const l=Qi(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(i=He(t,r.schema)),l==="mark"&&(o=ln(t,r.schema));let a=!1;return n.selection.ranges.forEach(c=>{const u=c.$from.pos,h=c.$to.pos;let f,p,m,g;n.selection.empty?r.doc.nodesBetween(u,h,(b,y)=>{i&&i===b.type&&(a=!0,m=Math.max(y,u),g=Math.min(y+b.nodeSize,h),f=y,p=b)}):r.doc.nodesBetween(u,h,(b,y)=>{y<u&&i&&i===b.type&&(a=!0,m=Math.max(y,u),g=Math.min(y+b.nodeSize,h),f=y,p=b),y>=u&&y<=h&&(i&&i===b.type&&(a=!0,s&&n.setNodeMarkup(y,void 0,{...b.attrs,...e})),o&&b.marks.length&&b.marks.forEach(_=>{if(o===_.type&&(a=!0,s)){const v=Math.max(y,u),w=Math.min(y+b.nodeSize,h);n.addMark(v,w,o.create({..._.attrs,...e}))}}))}),p&&(f!==void 0&&s&&n.setNodeMarkup(f,void 0,{...p.attrs,...e}),o&&p.marks.length&&p.marks.forEach(b=>{o===b.type&&s&&n.addMark(m,g,o.create({...b.attrs,...e}))}))}),a},Sk=(t,e={})=>({state:n,dispatch:r})=>{const s=He(t,n.schema);return Jx(s,e)(n,r)},Nk=(t,e={})=>({state:n,dispatch:r})=>{const s=He(t,n.schema);return Yx(s,e)(n,r)},Ak=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Zi=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},Tk=(t,e)=>{if(Gl(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Os(t){var e;const{editor:n,from:r,to:s,text:i,rules:o,plugin:l}=t,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const h=Zv(c)+i;return o.forEach(f=>{if(u)return;const p=Tk(h,f.find);if(!p)return;const m=a.state.tr,g=Ji({state:a.state,transaction:m}),b={from:r-(p[0].length-i.length),to:s},{commands:y,chain:_,can:v}=new Yi({editor:n,state:g});f.handler({state:g,range:b,match:p,commands:y,chain:_,can:v})===null||!m.steps.length||(f.undoable&&m.setMeta(l,{transform:m,from:r,to:s,text:i}),a.dispatch(m),u=!0)}),u}function Ek(t){const{editor:e,rules:n}=t,r=new Ne({state:{init(){return null},apply(s,i,o){const l=s.getMeta(r);if(l)return l;const a=s.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=Ql(j.from(u),o.schema);const{from:h}=a,f=h+u.length;Os({editor:e,from:h,to:f,text:u,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,l){return Os({editor:e,from:i,to:o,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&Os({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?Os({editor:e,from:o.pos,to:o.pos,text:`
29
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Mk(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ls(t){return Mk(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function wh(t,e){const n={...t};return Ls(t)&&Ls(e)&&Object.keys(e).forEach(r=>{Ls(e[r])&&Ls(t[r])?n[r]=wh(t[r],e[r]):n[r]=e[r]}),n}var Zl=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...me(K(this,"addOptions",{name:this.name}))}}get storage(){return{...me(K(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>wh(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Kt=class Ch extends Zl{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new Ch(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const a=o.find(c=>(c==null?void 0:c.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function jk(t){return typeof t=="number"}var Ik=class{constructor(t){this.find=t.find,this.handler=t.handler}},Dk=(t,e,n)=>{if(Gl(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=t,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function Ok(t){const{editor:e,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:l}=t,{commands:a,chain:c,can:u}=new Yi({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,s,(p,m)=>{var g,b,y,_,v;if((b=(g=p.type)==null?void 0:g.spec)!=null&&b.code||!(p.isText||p.isTextblock||p.isInline))return;const w=(v=(_=(y=p.content)==null?void 0:y.size)!=null?_:p.nodeSize)!=null?v:0,k=Math.max(r,m),S=Math.min(s,m+w);if(k>=S)return;const C=p.isText?p.text||"":p.textBetween(k-m,S-m,void 0,"");Dk(C,i.find,o).forEach(B=>{if(B.index===void 0)return;const N=k+B.index+1,T=N+B[0].length,$={from:n.tr.mapping.map(N),to:n.tr.mapping.map(T)},R=i.handler({state:n,range:$,match:B,commands:a,chain:c,can:u,pasteEvent:o,dropEvent:l});h.push(R)})}),h.every(p=>p!==null)}var Rs=null,Lk=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function Rk(t){const{editor:e,rules:n}=t;let r=null,s=!1,i=!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:u,from:h,to:f,rule:p,pasteEvt:m})=>{const g=u.tr,b=Ji({state:u,transaction:g});if(!(!Ok({editor:e,state:b,from:Math.max(h-1,0),to:f.b-1,rule:p,pasteEvent:m,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new Ne({view(h){const f=m=>{var g;r=(g=h.dom.parentElement)!=null&&g.contains(m.target)?h.dom.parentElement:null,r&&(Rs=e)},p=()=>{Rs&&(Rs=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(h,f)=>{if(i=r===h.dom.parentElement,l=f,!i){const p=Rs;p!=null&&p.isEditable&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(h,f)=>{var p;const m=(p=f.clipboardData)==null?void 0:p.getData("text/html");return o=f,s=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(h,f,p)=>{const m=h[0],g=m.getMeta("uiEvent")==="paste"&&!s,b=m.getMeta("uiEvent")==="drop"&&!i,y=m.getMeta("applyPasteRules"),_=!!y;if(!g&&!b&&!_)return;if(_){let{text:k}=y;typeof k=="string"?k=k:k=Ql(j.from(k),p.schema);const{from:S}=y,C=S+k.length,D=Lk(k);return a({rule:u,state:p,from:S,to:{b:C},pasteEvt:D})}const v=f.doc.content.findDiffStart(p.doc.content),w=f.doc.content.findDiffEnd(p.doc.content);if(!(!jk(v)||!w||v===w.b))return a({rule:u,state:p,from:v,to:w,pasteEvt:o})}}))}var eo=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=mh(t),this.schema=qv(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ir(e.name,this.schema)},r=K(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Jr([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Ir(r.name,this.schema)},i=[],o=K(r,"addKeyboardShortcuts",s);let l={};if(r.type==="mark"&&K(r,"exitable",s)&&(l.ArrowRight=()=>Kt.handleExit({editor:t,mark:r})),o){const f=Object.fromEntries(Object.entries(o()).map(([p,m])=>[p,()=>m({editor:t})]));l={...l,...f}}const a=q_(l);i.push(a);const c=K(r,"addInputRules",s);if(Pc(r,t.options.enableInputRules)&&c){const f=c();if(f&&f.length){const p=Ek({editor:t,rules:f}),m=Array.isArray(p)?p:[p];i.push(...m)}}const u=K(r,"addPasteRules",s);if(Pc(r,t.options.enablePasteRules)&&u){const f=u();if(f&&f.length){const p=Rk({editor:t,rules:f});i.push(...p)}}const h=K(r,"addProseMirrorPlugins",s);if(h){const f=h();i.push(...f)}return i})}get attributes(){return ph(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=xr(this.extensions);return Object.fromEntries(e.filter(n=>!!K(n,"addNodeView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:He(n.name,this.schema)},i=K(n,"addNodeView",s);if(!i)return[];const o=i();if(!o)return[];const l=(a,c,u,h,f)=>{const p=us(a,r);return o({node:a,view:c,getPos:u,decorations:h,innerDecorations:f,editor:t,extension:n,HTMLAttributes:p})};return[n.name,l]}))}dispatchTransaction(t){const{editor:e}=this;return Jr([...this.extensions].reverse()).reduceRight((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Ir(s.name,this.schema)},o=K(s,"dispatchTransaction",i);return o?l=>{o.call(i,{transaction:l,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return Jr([...this.extensions]).reduce((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Ir(s.name,this.schema)},o=K(s,"transformPastedHTML",i);return o?(l,a)=>{const c=r(l,a);return o.call(i,c)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=xr(this.extensions);return Object.fromEntries(e.filter(n=>!!K(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ln(n.name,this.schema)},i=K(n,"addMarkView",s);if(!i)return[];const o=(l,a,c)=>{const u=us(l,r);return i()({mark:l,view:a,inline:c,editor:t,extension:n,HTMLAttributes:u,updateAttributes:h=>{Xk(l,t,h)}})};return[n.name,o]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const n=e.parent;n.child===e&&(n.child=null),e=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ir(e.name,this.schema)};e.type==="mark"&&((n=me(K(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const s=K(e,"onBeforeCreate",r),i=K(e,"onCreate",r),o=K(e,"onUpdate",r),l=K(e,"onSelectionUpdate",r),a=K(e,"onTransaction",r),c=K(e,"onFocus",r),u=K(e,"onBlur",r),h=K(e,"onDestroy",r);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),h&&this.editor.on("destroy",h)})}};eo.resolve=mh;eo.sort=Jr;eo.flatten=Yl;var Bk={};Kl(Bk,{ClipboardTextSerializer:()=>Nh,Commands:()=>Ah,Delete:()=>Th,Drop:()=>Eh,Editable:()=>Mh,FocusEvents:()=>Ih,Keymap:()=>Dh,Paste:()=>Oh,Tabindex:()=>Lh,TextDirection:()=>Rh,focusEventsPluginKey:()=>jh});var je=class Sh extends Zl{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new Sh(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Nh=je.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ne({key:new Re("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:s}=e,{ranges:i}=s,o=Math.min(...i.map(u=>u.$from.pos)),l=Math.max(...i.map(u=>u.$to.pos)),a=bh(n);return gh(r,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Ah=je.create({name:"commands",addCommands(){return{...ih}}}),Th=je.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,s;const i=()=>{var o,l,a,c;if((c=(a=(l=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,t))!=null?c:t.getMeta("y-sync$"))return;const u=hh(t.before,[t,...e]);xh(u).forEach(p=>{u.mapping.mapResult(p.oldRange.from).deletedAfter&&u.mapping.mapResult(p.oldRange.to).deletedBefore&&u.before.nodesBetween(p.oldRange.from,p.oldRange.to,(m,g)=>{const b=g+m.nodeSize-2,y=p.oldRange.from<=g&&b<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:g,to:b,newFrom:u.mapping.map(g),newTo:u.mapping.map(b),deletedRange:p.oldRange,newRange:p.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:u})})});const f=u.mapping;u.steps.forEach((p,m)=>{var g,b;if(p instanceof Lt){const y=f.slice(m).map(p.from,-1),_=f.slice(m).map(p.to),v=f.invert().map(y,-1),w=f.invert().map(_),k=y>0?(g=u.doc.nodeAt(y-1))==null?void 0:g.marks.some(C=>C.eq(p.mark)):!1,S=(b=u.doc.nodeAt(_))==null?void 0:b.marks.some(C=>C.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:v,to:w},newRange:{from:y,to:_},partial:!!(S||k),editor:this.editor,transaction:t,combinedTransform:u})}})};(s=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||s?setTimeout(i,0):i()}}),Eh=je.create({name:"drop",addProseMirrorPlugins(){return[new Ne({key:new Re("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Mh=je.create({name:"editable",addProseMirrorPlugins(){return[new Ne({key:new Re("editable"),props:{editable:()=>this.editor.options.editable}})]}}),jh=new Re("focusEvents"),Ih=je.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ne({key:jh,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Dh=je.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:h}=a,{pos:f,parent:p}=h,m=h.parent.isTextblock&&f>0?l.doc.resolve(f-1):h,g=m.parent.type.spec.isolating,b=h.pos-h.parentOffset,y=g&&m.parent.childCount===1?b===h.pos:se.atStart(c).from===f;return!u||!p.type.isTextblock||p.textContent.length||!y||y&&h.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()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"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 ci()||dh()?i:s},addProseMirrorPlugins(){return[new Ne({key:new Re("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),s=t.some(g=>g.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:l}=e.selection,a=se.atStart(e.doc).from,c=se.atEnd(e.doc).to;if(i||!(o===a&&l===c)||!hs(n.doc))return;const f=n.tr,p=Ji({state:n,transaction:f}),{commands:m}=new Yi({editor:this.editor,state:p});if(m.clearNodes(),!!f.steps.length)return f}})]}}),Oh=je.create({name:"paste",addProseMirrorPlugins(){return[new Ne({key:new Re("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Lh=je.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Ne({key:new Re("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),Rh=je.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=xr(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Ne({key:new Re("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),$k=class Wr{constructor(e,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=s}get name(){return this.node.type.name}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:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=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}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},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),n=this.resolvedPos.doc.resolve(e);return new Wr(n,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 Wr(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 Wr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,o=n.isInline,l=this.pos+r+(i?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!s&&!o&&a.depth<=this.depth)return;const c=new Wr(a,this.editor,s,s||o?n:null);s&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(n).length>0){const i=s.node.attrs,o=Object.keys(n);for(let l=0;l<o.length;l+=1){const a=o[l];if(i[a]!==n[a])break}}else r=s;s=s.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const i=Object.keys(n);return this.children.forEach(o=>{r&&s.length>0||(o.node.type.name===e&&i.every(a=>n[a]===o.node.attrs[a])&&s.push(o),!(r&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,n,r))))}),s}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},Pk=`.ProseMirror {
30
30
  position: relative;
31
31
  }
32
32
 
@@ -96,26 +96,26 @@ img.ProseMirror-separator {
96
96
 
97
97
  .ProseMirror-focused .ProseMirror-gapcursor {
98
98
  display: block;
99
- }`;function Tk(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(s),s}var Ek=class extends mk{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:U_,createMappablePosition:q_},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),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:r,slice:s,moved:i})=>this.options.onDrop(r,s,i)),this.on("paste",({event:r,slice:s})=>this.options.onPaste(r,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=oh(e,this.options.autofocus);this.editorState=ur.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}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&&typeof document<"u"&&(this.css=Tk(Ak,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=uh(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;n=n.filter(o=>!o.key.startsWith(i))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e,n,r;const i=[...this.options.enableCoreExtensions?[Th,Ch.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Sh,Mh,jh,Dh.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),Ah,Ih,Nh,Oh.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new Xi(i,this)}createCommandManager(){this.commandManager=new Gi({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=cl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=cl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),s=n?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(i);this.editorView=new th(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:s,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),s=n.includes(t),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=o==null?void 0:o.getMeta("focus"),a=o==null?void 0:o.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:o}),a&&this.emit("blur",{editor:this,event:a.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return gh(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return H_(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Jl(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
99
+ }`;function zk(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(s),s}var Fk=class extends Ak{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:rk,createMappablePosition:sk},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),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:r,slice:s,moved:i})=>this.options.onDrop(r,s,i)),this.on("paste",({event:r,slice:s})=>this.options.onPaste(r,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=ah(e,this.options.autofocus);this.editorState=ur.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}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&&typeof document<"u"&&(this.css=zk(Pk,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=fh(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;n=n.filter(o=>!o.key.startsWith(i))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e,n,r;const i=[...this.options.enableCoreExtensions?[Mh,Nh.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Ah,Ih,Dh,Lh.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),Eh,Oh,Th,Rh.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new eo(i,this)}createCommandManager(){this.commandManager=new Yi({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=ul(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=ul(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),s=n?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(i);this.editorView=new rh(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:s,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),s=n.includes(t),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=o==null?void 0:o.getMeta("focus"),a=o==null?void 0:o.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:o}),a&&this.emit("blur",{editor:this,event:a.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return yh(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return ek(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Ql(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
100
100
 
101
- `,textSerializers:n={}}=t||{};return R_(this.state.doc,{blockSeparator:e,textSerializers:{...mh(this.schema),...n}})}get isEmpty(){return us(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText?e.nodeAfter:null;return new Nk(e,this,!1,n)}get $doc(){return this.$pos(0)}};function Zn(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=me(t.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=e,o=r[r.length-1],l=r[0];if(o){const a=l.search(/\S/),c=n.from+l.indexOf(o),u=c+o.length;if(Yl(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+a,c);const f=n.from+a+o.length;i.addMark(n.from+a,f,t.type.create(s||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function Lh(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=me(t.getAttributes,void 0,r)||{},{tr:i}=e,o=n.from;let l=n.to;const a=t.type.create(s);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>l?u=l:l=u+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,o+r[0].length-1),i.replaceWith(u,l,a)}else if(r[0]){const c=t.type.isInline?o:o-1;i.insert(c,t.type.create(s)).delete(i.mapping.map(o),i.mapping.map(l))}i.scrollIntoView()},undoable:t.undoable})}function ul(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=e.doc.resolve(n.from),i=me(t.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function vr(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r,chain:s})=>{const i=me(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),a=o.doc.resolve(n.from).blockRange(),c=a&&Ml(a,t.type,i);if(!c)return null;if(o.wrap(a,c),t.keepMarks&&t.editor){const{selection:h,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,m=f||h.$to.parentOffset&&h.$from.marks();if(m){const g=m.filter(b=>p.includes(b.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(h,i).run()}const u=o.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&An(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&o.join(n.from-1)},undoable:t.undoable})}var Mk=t=>"touches"in t,jk=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.clientX-this.startX,c=l.clientY-this.startY;this.handleResize(a,c)},this.handleTouchMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.touches[0];if(!a)return;const c=a.clientX-this.startX,u=a.clientY-this.startY;this.handleResize(c,u)},this.handleMouseUp=()=>{if(!this.isResizing)return;const l=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(l,a),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,s,i,o;this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(n=t.options)!=null&&n.max&&(this.maxSize=t.options.max),(r=t==null?void 0:t.options)!=null&&r.directions&&(this.directions=t.options.directions),(s=t.options)!=null&&s.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(i=t.options)!=null&&i.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(o=t.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!=null?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),s=e.includes("left"),i=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),s&&(t.style.left="0"),i&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,Mk(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:s}=this.calculateNewDimensions(this.activeHandle,t,e),i=this.applyConstraints(r,s,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,s=this.startHeight;const i=t.includes("right"),o=t.includes("left"),l=t.includes("bottom"),a=t.includes("top");return i?r=this.startWidth+e:o&&(r=this.startWidth-e),l?s=this.startHeight+n:a&&(s=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(i?e:-e)),(t==="top"||t==="bottom")&&(s=this.startHeight+(l?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,s,t):{width:r,height:s}}applyConstraints(t,e,n){var r,s,i,o;if(!n){let c=Math.max(this.minSize.width,t),u=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(c=Math.min(this.maxSize.width,c)),(s=this.maxSize)!=null&&s.height&&(u=Math.min(this.maxSize.height,u)),{width:c,height:u}}let l=t,a=e;return l<this.minSize.width&&(l=this.minSize.width,a=l/this.aspectRatio),a<this.minSize.height&&(a=this.minSize.height,l=a*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&l>this.maxSize.width&&(l=this.maxSize.width,a=l/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&a>this.maxSize.height&&(a=this.maxSize.height,l=a*this.aspectRatio),{width:l,height:a}}applyAspectRatio(t,e,n){const r=n==="left"||n==="right",s=n==="top"||n==="bottom";return r?{width:t,height:t/this.aspectRatio}:s?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function Ik(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof J){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(e))return!0;s-=1}return!1}function Dk(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ok(t,e){const n=t.getAttribute("style");if(!n)return null;const r=n.split(";").map(i=>i.trim()).filter(Boolean),s=e.toLowerCase();for(let i=r.length-1;i>=0;i-=1){const o=r[i],l=o.indexOf(":");if(l===-1)continue;if(o.slice(0,l).trim().toLowerCase()===s)return o.slice(l+1).trim()}return null}var Lk={};Ul(Lk,{createAtomBlockMarkdownSpec:()=>Rk,createBlockMarkdownSpec:()=>Bk,createInlineMarkdownSpec:()=>Rh,parseAttributes:()=>Xl,parseIndentedBlocks:()=>hl,renderNestedMarkdownContent:()=>ea,serializeAttributes:()=>Zl});function Xl(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(u=>u.trim().slice(1));e.class=c.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,c,u])=>{var h;const f=parseInt(((h=u.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),p=n[f];p&&(e[c]=p.slice(1,-1))});const a=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function Zl(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function Rk(t){const{nodeName:e,name:n,parseAttributes:r=Xl,serializeAttributes:s=Zl,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:l}=t,a=n||e,c=u=>{if(!l)return u;const h={};return l.forEach(f=>{f in u&&(h[f]=u[f])}),h};return{parseMarkdown:(u,h)=>{const f={...i,...u.attributes};return h.createNode(e,f,[])},markdownTokenizer:{name:e,level:"block",start(u){var h;const f=new RegExp(`^:::${a}(?:\\s|$)`,"m"),p=(h=u.match(f))==null?void 0:h.index;return p!==void 0?p:-1},tokenize(u,h,f){const p=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=u.match(p);if(!m)return;const g=m[1]||"",b=r(g);if(!o.find(v=>!(v in b)))return{type:e,raw:m[0],attributes:b}}},renderMarkdown:u=>{const h=c(u.attrs||{}),f=s(h),p=f?` {${f}}`:"";return`:::${a}${p} :::`}}}function Bk(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=Xl,serializeAttributes:i=Zl,defaultAttributes:o={},content:l="block",allowedAttributes:a}=t,c=n||e,u=h=>{if(!a)return h;const f={};return a.forEach(p=>{p in h&&(f[p]=h[p])}),f};return{parseMarkdown:(h,f)=>{let p;if(r){const g=r(h);p=typeof g=="string"?[{type:"text",text:g}]:g}else l==="block"?p=f.parseChildren(h.tokens||[]):p=f.parseInline(h.tokens||[]);const m={...o,...h.attributes};return f.createNode(e,m,p)},markdownTokenizer:{name:e,level:"block",start(h){var f;const p=new RegExp(`^:::${c}`,"m"),m=(f=h.match(p))==null?void 0:f.index;return m!==void 0?m:-1},tokenize(h,f,p){var m;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),b=h.match(g);if(!b)return;const[y,v=""]=b,_=s(v);let w=1;const k=y.length;let S="";const C=/^:::([\w-]*)(\s.*)?/gm,D=h.slice(k);for(C.lastIndex=0;;){const B=C.exec(D);if(B===null)break;const N=B.index,T=B[1];if(!((m=B[2])!=null&&m.endsWith(":::"))){if(T)w+=1;else if(w-=1,w===0){const $=D.slice(0,N);S=$.trim();const R=h.slice(0,k+N+B[0].length);let L=[];if(S)if(l==="block")for(L=p.blockTokens($),L.forEach(U=>{U.text&&(!U.tokens||U.tokens.length===0)&&(U.tokens=p.inlineTokens(U.text))});L.length>0;){const U=L[L.length-1];if(U.type==="paragraph"&&(!U.text||U.text.trim()===""))L.pop();else break}else L=p.inlineTokens(S);return{type:e,raw:R,attributes:_,content:S,tokens:L}}}}}},renderMarkdown:(h,f)=>{const p=u(h.attrs||{}),m=i(p),g=m?` {${m}}`:"",b=f.renderChildren(h.content||[],`
101
+ `,textSerializers:n={}}=t||{};return Gv(this.state.doc,{blockSeparator:e,textSerializers:{...bh(this.schema),...n}})}get isEmpty(){return hs(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText?e.nodeAfter:null;return new $k(e,this,!1,n)}get $doc(){return this.$pos(0)}};function Zn(t){return new Zi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=me(t.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=e,o=r[r.length-1],l=r[0];if(o){const a=l.search(/\S/),c=n.from+l.indexOf(o),u=c+o.length;if(Xl(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+a,c);const f=n.from+a+o.length;i.addMark(n.from+a,f,t.type.create(s||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function Bh(t){return new Zi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=me(t.getAttributes,void 0,r)||{},{tr:i}=e,o=n.from;let l=n.to;const a=t.type.create(s);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>l?u=l:l=u+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,o+r[0].length-1),i.replaceWith(u,l,a)}else if(r[0]){const c=t.type.isInline?o:o-1;i.insert(c,t.type.create(s)).delete(i.mapping.map(o),i.mapping.map(l))}i.scrollIntoView()},undoable:t.undoable})}function fl(t){return new Zi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=e.doc.resolve(n.from),i=me(t.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function _r(t){return new Zi({find:t.find,handler:({state:e,range:n,match:r,chain:s})=>{const i=me(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),a=o.doc.resolve(n.from).blockRange(),c=a&&Il(a,t.type,i);if(!c)return null;if(o.wrap(a,c),t.keepMarks&&t.editor){const{selection:h,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,m=f||h.$to.parentOffset&&h.$from.marks();if(m){const g=m.filter(b=>p.includes(b.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(h,i).run()}const u=o.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&An(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&o.join(n.from-1)},undoable:t.undoable})}var Hk=t=>"touches"in t,Wk=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.clientX-this.startX,c=l.clientY-this.startY;this.handleResize(a,c)},this.handleTouchMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.touches[0];if(!a)return;const c=a.clientX-this.startX,u=a.clientY-this.startY;this.handleResize(c,u)},this.handleMouseUp=()=>{if(!this.isResizing)return;const l=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(l,a),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,s,i,o;this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(n=t.options)!=null&&n.max&&(this.maxSize=t.options.max),(r=t==null?void 0:t.options)!=null&&r.directions&&(this.directions=t.options.directions),(s=t.options)!=null&&s.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(i=t.options)!=null&&i.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(o=t.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!=null?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),s=e.includes("left"),i=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),s&&(t.style.left="0"),i&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,Hk(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:s}=this.calculateNewDimensions(this.activeHandle,t,e),i=this.applyConstraints(r,s,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,s=this.startHeight;const i=t.includes("right"),o=t.includes("left"),l=t.includes("bottom"),a=t.includes("top");return i?r=this.startWidth+e:o&&(r=this.startWidth-e),l?s=this.startHeight+n:a&&(s=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(i?e:-e)),(t==="top"||t==="bottom")&&(s=this.startHeight+(l?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,s,t):{width:r,height:s}}applyConstraints(t,e,n){var r,s,i,o;if(!n){let c=Math.max(this.minSize.width,t),u=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(c=Math.min(this.maxSize.width,c)),(s=this.maxSize)!=null&&s.height&&(u=Math.min(this.maxSize.height,u)),{width:c,height:u}}let l=t,a=e;return l<this.minSize.width&&(l=this.minSize.width,a=l/this.aspectRatio),a<this.minSize.height&&(a=this.minSize.height,l=a*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&l>this.maxSize.width&&(l=this.maxSize.width,a=l/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&a>this.maxSize.height&&(a=this.maxSize.height,l=a*this.aspectRatio),{width:l,height:a}}applyAspectRatio(t,e,n){const r=n==="left"||n==="right",s=n==="top"||n==="bottom";return r?{width:t,height:t/this.aspectRatio}:s?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function Vk(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof J){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(e))return!0;s-=1}return!1}function Uk(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function qk(t,e){const n=t.getAttribute("style");if(!n)return null;const r=n.split(";").map(i=>i.trim()).filter(Boolean),s=e.toLowerCase();for(let i=r.length-1;i>=0;i-=1){const o=r[i],l=o.indexOf(":");if(l===-1)continue;if(o.slice(0,l).trim().toLowerCase()===s)return o.slice(l+1).trim()}return null}var Kk={};Kl(Kk,{createAtomBlockMarkdownSpec:()=>Gk,createBlockMarkdownSpec:()=>Jk,createInlineMarkdownSpec:()=>$h,parseAttributes:()=>ea,parseIndentedBlocks:()=>pl,renderNestedMarkdownContent:()=>na,serializeAttributes:()=>ta});function ea(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(u=>u.trim().slice(1));e.class=c.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,c,u])=>{var h;const f=parseInt(((h=u.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),p=n[f];p&&(e[c]=p.slice(1,-1))});const a=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function ta(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function Gk(t){const{nodeName:e,name:n,parseAttributes:r=ea,serializeAttributes:s=ta,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:l}=t,a=n||e,c=u=>{if(!l)return u;const h={};return l.forEach(f=>{f in u&&(h[f]=u[f])}),h};return{parseMarkdown:(u,h)=>{const f={...i,...u.attributes};return h.createNode(e,f,[])},markdownTokenizer:{name:e,level:"block",start(u){var h;const f=new RegExp(`^:::${a}(?:\\s|$)`,"m"),p=(h=u.match(f))==null?void 0:h.index;return p!==void 0?p:-1},tokenize(u,h,f){const p=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=u.match(p);if(!m)return;const g=m[1]||"",b=r(g);if(!o.find(_=>!(_ in b)))return{type:e,raw:m[0],attributes:b}}},renderMarkdown:u=>{const h=c(u.attrs||{}),f=s(h),p=f?` {${f}}`:"";return`:::${a}${p} :::`}}}function Jk(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=ea,serializeAttributes:i=ta,defaultAttributes:o={},content:l="block",allowedAttributes:a}=t,c=n||e,u=h=>{if(!a)return h;const f={};return a.forEach(p=>{p in h&&(f[p]=h[p])}),f};return{parseMarkdown:(h,f)=>{let p;if(r){const g=r(h);p=typeof g=="string"?[{type:"text",text:g}]:g}else l==="block"?p=f.parseChildren(h.tokens||[]):p=f.parseInline(h.tokens||[]);const m={...o,...h.attributes};return f.createNode(e,m,p)},markdownTokenizer:{name:e,level:"block",start(h){var f;const p=new RegExp(`^:::${c}`,"m"),m=(f=h.match(p))==null?void 0:f.index;return m!==void 0?m:-1},tokenize(h,f,p){var m;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),b=h.match(g);if(!b)return;const[y,_=""]=b,v=s(_);let w=1;const k=y.length;let S="";const C=/^:::([\w-]*)(\s.*)?/gm,D=h.slice(k);for(C.lastIndex=0;;){const B=C.exec(D);if(B===null)break;const N=B.index,T=B[1];if(!((m=B[2])!=null&&m.endsWith(":::"))){if(T)w+=1;else if(w-=1,w===0){const $=D.slice(0,N);S=$.trim();const R=h.slice(0,k+N+B[0].length);let L=[];if(S)if(l==="block")for(L=p.blockTokens($),L.forEach(U=>{U.text&&(!U.tokens||U.tokens.length===0)&&(U.tokens=p.inlineTokens(U.text))});L.length>0;){const U=L[L.length-1];if(U.type==="paragraph"&&(!U.text||U.text.trim()===""))L.pop();else break}else L=p.inlineTokens(S);return{type:e,raw:R,attributes:v,content:S,tokens:L}}}}}},renderMarkdown:(h,f)=>{const p=u(h.attrs||{}),m=i(p),g=m?` {${m}}`:"",b=f.renderChildren(h.content||[],`
102
102
 
103
103
  `);return`:::${c}${g}
104
104
 
105
105
  ${b}
106
106
 
107
- :::`}}}function $k(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,s,i,o]=r;e[s]=i||o,r=n.exec(t)}return e}function Pk(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function Rh(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=$k,serializeAttributes:i=Pk,defaultAttributes:o={},selfClosing:l=!1,allowedAttributes:a}=t,c=n||e,u=f=>{if(!a)return f;const p={};return a.forEach(m=>{const g=typeof m=="string"?m:m.name,b=typeof m=="string"?void 0:m.skipIfDefault;if(g in f){const y=f[g];if(b!==void 0&&y===b)return;p[g]=y}}),p},h=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,p)=>{const m={...o,...f.attributes};if(l)return p.createNode(e,m);const g=r?r(f):f.content||"";return g?p.createNode(e,m,[p.createTextNode(g)]):p.createNode(e,m,[])},markdownTokenizer:{name:e,level:"inline",start(f){const p=l?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),m=f.match(p),g=m==null?void 0:m.index;return g!==void 0?g:-1},tokenize(f,p,m){const g=l?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),b=f.match(g);if(!b)return;let y="",v="";if(l){const[,w]=b;v=w}else{const[,w,k]=b;v=w,y=k||""}const _=s(v.trim());return{type:e,raw:b[0],content:y.trim(),attributes:_}}},renderMarkdown:f=>{let p="";r?p=r(f):f.content&&f.content.length>0&&(p=f.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const m=u(f.attrs||{}),g=i(m),b=g?` ${g}`:"";return l?`[${c}${b}]`:`[${c}${b}]${p}[/${c}]`}}}function hl(t,e,n){var r,s,i,o;const l=t.split(`
107
+ :::`}}}function Yk(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,s,i,o]=r;e[s]=i||o,r=n.exec(t)}return e}function Qk(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function $h(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=Yk,serializeAttributes:i=Qk,defaultAttributes:o={},selfClosing:l=!1,allowedAttributes:a}=t,c=n||e,u=f=>{if(!a)return f;const p={};return a.forEach(m=>{const g=typeof m=="string"?m:m.name,b=typeof m=="string"?void 0:m.skipIfDefault;if(g in f){const y=f[g];if(b!==void 0&&y===b)return;p[g]=y}}),p},h=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,p)=>{const m={...o,...f.attributes};if(l)return p.createNode(e,m);const g=r?r(f):f.content||"";return g?p.createNode(e,m,[p.createTextNode(g)]):p.createNode(e,m,[])},markdownTokenizer:{name:e,level:"inline",start(f){const p=l?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),m=f.match(p),g=m==null?void 0:m.index;return g!==void 0?g:-1},tokenize(f,p,m){const g=l?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),b=f.match(g);if(!b)return;let y="",_="";if(l){const[,w]=b;_=w}else{const[,w,k]=b;_=w,y=k||""}const v=s(_.trim());return{type:e,raw:b[0],content:y.trim(),attributes:v}}},renderMarkdown:f=>{let p="";r?p=r(f):f.content&&f.content.length>0&&(p=f.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const m=u(f.attrs||{}),g=i(m),b=g?` ${g}`:"";return l?`[${c}${b}]`:`[${c}${b}]${p}[/${c}]`}}}function pl(t,e,n){var r,s,i,o;const l=t.split(`
108
108
  `),a=[];let c="",u=0;const h=e.baseIndentSize||2;for(;u<l.length;){const f=l[u],p=f.match(e.itemPattern);if(!p){if(a.length>0)break;if(f.trim()===""){u+=1,c=`${c}${f}
109
109
  `;continue}else return}const m=e.extractItemData(p),{indentLevel:g,mainContent:b}=m;c=`${c}${f}
110
110
  `;const y=[b];for(u+=1;u<l.length;){const k=l[u];if(k.trim()===""){const C=l.slice(u+1).findIndex(N=>N.trim()!=="");if(C===-1)break;if((((s=(r=l[u+1+C].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:s.length)||0)>g){y.push(k),c=`${c}${k}
111
111
  `,u+=1;continue}else break}if((((o=(i=k.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:o.length)||0)>g)y.push(k),c=`${c}${k}
112
- `,u+=1;else break}let v;const _=y.slice(1);if(_.length>0){const k=_.map(S=>S.slice(g+h)).join(`
113
- `);k.trim()&&(e.customNestedParser?v=e.customNestedParser(k):v=n.blockTokens(k))}const w=e.createToken(m,v);a.push(w)}if(a.length!==0)return{items:a,raw:c}}function ea(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const s=typeof n=="function"?n(r):n,[i,...o]=t.content,l=e.renderChildren([i]);let a=`${s}${l}`;return o&&o.length>0&&o.forEach((c,u)=>{var h,f;const p=(f=(h=e.renderChild)==null?void 0:h.call(e,c,u+1))!=null?f:e.renderChildren([c]);if(p!=null){const m=p.split(`
112
+ `,u+=1;else break}let _;const v=y.slice(1);if(v.length>0){const k=v.map(S=>S.slice(g+h)).join(`
113
+ `);k.trim()&&(e.customNestedParser?_=e.customNestedParser(k):_=n.blockTokens(k))}const w=e.createToken(m,_);a.push(w)}if(a.length!==0)return{items:a,raw:c}}function na(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const s=typeof n=="function"?n(r):n,[i,...o]=t.content,l=e.renderChildren([i]);let a=`${s}${l}`;return o&&o.length>0&&o.forEach((c,u)=>{var h,f;const p=(f=(h=e.renderChild)==null?void 0:h.call(e,c,u+1))!=null?f:e.renderChildren([c]);if(p!=null){const m=p.split(`
114
114
  `).map(g=>g?e.indent(g):e.indent("")).join(`
115
115
  `);a+=c.type==="paragraph"?`
116
116
 
117
117
  ${m}`:`
118
- ${m}`}}),a}function zk(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendants((l,a)=>{const c=i.mapping.map(a),u=i.mapping.map(a)+l.nodeSize;let h=null;if(l.marks.forEach(p=>{if(p!==o)return!1;h=p}),!h)return;let f=!1;if(Object.keys(n).forEach(p=>{n[p]!==h.attrs[p]&&(f=!0)}),f){const p=t.type.create({...t.attrs,...n});i.removeMark(c,u,t.type),i.addMark(c,u,p)}}),i.docChanged&&e.view.dispatch(i)}var lt=class Bh extends Ql{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new Bh(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Nn(t){return new vk({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:s})=>{const i=me(t.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:o}=e,l=r[r.length-1],a=r[0];let c=n.to;if(l){const u=a.search(/\S/),h=n.from+a.indexOf(l),f=h+l.length;if(Yl(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(y=>y===t.type&&y!==g.mark.type)).filter(g=>g.to>h).length)return null;f<n.to&&o.delete(f,n.to),h>n.from&&o.delete(n.from+u,h),c=n.from+u+l.length,o.addMark(n.from+u,c,t.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:Fk,getOwnPropertySymbols:Hk}=Object,{hasOwnProperty:Wk}=Object.prototype;function Eo(t,e){return function(r,s,i){return t(r,s,i)&&e(r,s,i)}}function Ls(t){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,s);const{cache:i}=s,o=i.get(n),l=i.get(r);if(o&&l)return o===r&&l===n;i.set(n,r),i.set(r,n);const a=t(n,r,s);return i.delete(n),i.delete(r),a}}function Vk(t){return t!=null?t[Symbol.toStringTag]:void 0}function Pc(t){return Fk(t).concat(Hk(t))}const Uk=Object.hasOwn||((t,e)=>Wk.call(t,e));function nr(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const qk="__v",Kk="__o",Gk="_owner",{getOwnPropertyDescriptor:zc,keys:Fc}=Object;function Jk(t,e){return t.byteLength===e.byteLength&&ai(new Uint8Array(t),new Uint8Array(e))}function Yk(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function Qk(t,e){return t.byteLength===e.byteLength&&ai(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Xk(t,e){return nr(t.getTime(),e.getTime())}function Zk(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function ew(t,e){return t===e}function Hc(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.entries();let o,l,a=0;for(;(o=i.next())&&!o.done;){const c=e.entries();let u=!1,h=0;for(;(l=c.next())&&!l.done;){if(s[h]){h++;continue}const f=o.value,p=l.value;if(n.equals(f[0],p[0],a,h,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){u=s[h]=!0;break}h++}if(!u)return!1;a++}return!0}const tw=nr;function nw(t,e,n){const r=Fc(t);let s=r.length;if(Fc(e).length!==s)return!1;for(;s-- >0;)if(!$h(t,e,n,r[s]))return!1;return!0}function Ir(t,e,n){const r=Pc(t);let s=r.length;if(Pc(e).length!==s)return!1;let i,o,l;for(;s-- >0;)if(i=r[s],!$h(t,e,n,i)||(o=zc(t,i),l=zc(e,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function rw(t,e){return nr(t.valueOf(),e.valueOf())}function sw(t,e){return t.source===e.source&&t.flags===e.flags}function Wc(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.values();let o,l;for(;(o=i.next())&&!o.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&n.equals(o.value,l.value,o.value,l.value,t,e,n)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function ai(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function iw(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function $h(t,e,n,r){return(r===Gk||r===Kk||r===qk)&&(t.$$typeof||e.$$typeof)?!0:Uk(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const ow="[object ArrayBuffer]",lw="[object Arguments]",aw="[object Boolean]",cw="[object DataView]",dw="[object Date]",uw="[object Error]",hw="[object Map]",fw="[object Number]",pw="[object Object]",mw="[object RegExp]",gw="[object Set]",bw="[object String]",yw={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},xw="[object URL]",vw=Object.prototype.toString;function _w({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(b,y,v){if(b===y)return!0;if(b==null||y==null)return!1;const _=typeof b;if(_!==typeof y)return!1;if(_!=="object")return _==="number"?l(b,y,v):_==="function"?i(b,y,v):!1;const w=b.constructor;if(w!==y.constructor)return!1;if(w===Object)return a(b,y,v);if(Array.isArray(b))return e(b,y,v);if(w===Date)return r(b,y,v);if(w===RegExp)return u(b,y,v);if(w===Map)return o(b,y,v);if(w===Set)return h(b,y,v);const k=vw.call(b);if(k===dw)return r(b,y,v);if(k===mw)return u(b,y,v);if(k===hw)return o(b,y,v);if(k===gw)return h(b,y,v);if(k===pw)return typeof b.then!="function"&&typeof y.then!="function"&&a(b,y,v);if(k===xw)return p(b,y,v);if(k===uw)return s(b,y,v);if(k===lw)return a(b,y,v);if(yw[k])return f(b,y,v);if(k===ow)return t(b,y,v);if(k===cw)return n(b,y,v);if(k===aw||k===fw||k===bw)return c(b,y,v);if(m){let S=m[k];if(!S){const C=Vk(b);C&&(S=m[C])}if(S)return S(b,y,v)}return!1}}function kw({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:Jk,areArraysEqual:n?Ir:Yk,areDataViewsEqual:Qk,areDatesEqual:Xk,areErrorsEqual:Zk,areFunctionsEqual:ew,areMapsEqual:n?Eo(Hc,Ir):Hc,areNumbersEqual:tw,areObjectsEqual:n?Ir:nw,arePrimitiveWrappersEqual:rw,areRegExpsEqual:sw,areSetsEqual:n?Eo(Wc,Ir):Wc,areTypedArraysEqual:n?Eo(ai,Ir):ai,areUrlsEqual:iw,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const s=Ls(r.areArraysEqual),i=Ls(r.areMapsEqual),o=Ls(r.areObjectsEqual),l=Ls(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:l})}return r}function ww(t){return function(e,n,r,s,i,o,l){return t(e,n,l)}}function Cw({circular:t,comparator:e,createState:n,equals:r,strict:s}){if(n)return function(l,a){const{cache:c=t?new WeakMap:void 0,meta:u}=n();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(t)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,i)}}const Sw=En();En({strict:!0});En({circular:!0});En({circular:!0,strict:!0});En({createInternalComparator:()=>nr});En({strict:!0,createInternalComparator:()=>nr});En({circular:!0,createInternalComparator:()=>nr});En({circular:!0,createInternalComparator:()=>nr,strict:!0});function En(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:s=!1}=t,i=kw(t),o=_w(i),l=n?n(o):ww(o);return Cw({circular:e,comparator:o,createState:r,equals:l,strict:s})}var fl={exports:{}},Mo={};/**
118
+ ${m}`}}),a}function Xk(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendants((l,a)=>{const c=i.mapping.map(a),u=i.mapping.map(a)+l.nodeSize;let h=null;if(l.marks.forEach(p=>{if(p!==o)return!1;h=p}),!h)return;let f=!1;if(Object.keys(n).forEach(p=>{n[p]!==h.attrs[p]&&(f=!0)}),f){const p=t.type.create({...t.attrs,...n});i.removeMark(c,u,t.type),i.addMark(c,u,p)}}),i.docChanged&&e.view.dispatch(i)}var lt=class Ph extends Zl{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new Ph(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Nn(t){return new Ik({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:s})=>{const i=me(t.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:o}=e,l=r[r.length-1],a=r[0];let c=n.to;if(l){const u=a.search(/\S/),h=n.from+a.indexOf(l),f=h+l.length;if(Xl(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(y=>y===t.type&&y!==g.mark.type)).filter(g=>g.to>h).length)return null;f<n.to&&o.delete(f,n.to),h>n.from&&o.delete(n.from+u,h),c=n.from+u+l.length,o.addMark(n.from+u,c,t.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:Zk,getOwnPropertySymbols:ew}=Object,{hasOwnProperty:tw}=Object.prototype;function jo(t,e){return function(r,s,i){return t(r,s,i)&&e(r,s,i)}}function Bs(t){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,s);const{cache:i}=s,o=i.get(n),l=i.get(r);if(o&&l)return o===r&&l===n;i.set(n,r),i.set(r,n);const a=t(n,r,s);return i.delete(n),i.delete(r),a}}function nw(t){return t!=null?t[Symbol.toStringTag]:void 0}function Fc(t){return Zk(t).concat(ew(t))}const rw=Object.hasOwn||((t,e)=>tw.call(t,e));function nr(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const sw="__v",iw="__o",ow="_owner",{getOwnPropertyDescriptor:Hc,keys:Wc}=Object;function lw(t,e){return t.byteLength===e.byteLength&&di(new Uint8Array(t),new Uint8Array(e))}function aw(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function cw(t,e){return t.byteLength===e.byteLength&&di(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function dw(t,e){return nr(t.getTime(),e.getTime())}function uw(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function hw(t,e){return t===e}function Vc(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.entries();let o,l,a=0;for(;(o=i.next())&&!o.done;){const c=e.entries();let u=!1,h=0;for(;(l=c.next())&&!l.done;){if(s[h]){h++;continue}const f=o.value,p=l.value;if(n.equals(f[0],p[0],a,h,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){u=s[h]=!0;break}h++}if(!u)return!1;a++}return!0}const fw=nr;function pw(t,e,n){const r=Wc(t);let s=r.length;if(Wc(e).length!==s)return!1;for(;s-- >0;)if(!zh(t,e,n,r[s]))return!1;return!0}function Dr(t,e,n){const r=Fc(t);let s=r.length;if(Fc(e).length!==s)return!1;let i,o,l;for(;s-- >0;)if(i=r[s],!zh(t,e,n,i)||(o=Hc(t,i),l=Hc(e,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function mw(t,e){return nr(t.valueOf(),e.valueOf())}function gw(t,e){return t.source===e.source&&t.flags===e.flags}function Uc(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.values();let o,l;for(;(o=i.next())&&!o.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&n.equals(o.value,l.value,o.value,l.value,t,e,n)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function di(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function bw(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function zh(t,e,n,r){return(r===ow||r===iw||r===sw)&&(t.$$typeof||e.$$typeof)?!0:rw(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const yw="[object ArrayBuffer]",xw="[object Arguments]",_w="[object Boolean]",vw="[object DataView]",kw="[object Date]",ww="[object Error]",Cw="[object Map]",Sw="[object Number]",Nw="[object Object]",Aw="[object RegExp]",Tw="[object Set]",Ew="[object String]",Mw={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},jw="[object URL]",Iw=Object.prototype.toString;function Dw({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(b,y,_){if(b===y)return!0;if(b==null||y==null)return!1;const v=typeof b;if(v!==typeof y)return!1;if(v!=="object")return v==="number"?l(b,y,_):v==="function"?i(b,y,_):!1;const w=b.constructor;if(w!==y.constructor)return!1;if(w===Object)return a(b,y,_);if(Array.isArray(b))return e(b,y,_);if(w===Date)return r(b,y,_);if(w===RegExp)return u(b,y,_);if(w===Map)return o(b,y,_);if(w===Set)return h(b,y,_);const k=Iw.call(b);if(k===kw)return r(b,y,_);if(k===Aw)return u(b,y,_);if(k===Cw)return o(b,y,_);if(k===Tw)return h(b,y,_);if(k===Nw)return typeof b.then!="function"&&typeof y.then!="function"&&a(b,y,_);if(k===jw)return p(b,y,_);if(k===ww)return s(b,y,_);if(k===xw)return a(b,y,_);if(Mw[k])return f(b,y,_);if(k===yw)return t(b,y,_);if(k===vw)return n(b,y,_);if(k===_w||k===Sw||k===Ew)return c(b,y,_);if(m){let S=m[k];if(!S){const C=nw(b);C&&(S=m[C])}if(S)return S(b,y,_)}return!1}}function Ow({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:lw,areArraysEqual:n?Dr:aw,areDataViewsEqual:cw,areDatesEqual:dw,areErrorsEqual:uw,areFunctionsEqual:hw,areMapsEqual:n?jo(Vc,Dr):Vc,areNumbersEqual:fw,areObjectsEqual:n?Dr:pw,arePrimitiveWrappersEqual:mw,areRegExpsEqual:gw,areSetsEqual:n?jo(Uc,Dr):Uc,areTypedArraysEqual:n?jo(di,Dr):di,areUrlsEqual:bw,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const s=Bs(r.areArraysEqual),i=Bs(r.areMapsEqual),o=Bs(r.areObjectsEqual),l=Bs(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:l})}return r}function Lw(t){return function(e,n,r,s,i,o,l){return t(e,n,l)}}function Rw({circular:t,comparator:e,createState:n,equals:r,strict:s}){if(n)return function(l,a){const{cache:c=t?new WeakMap:void 0,meta:u}=n();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(t)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,i)}}const Bw=En();En({strict:!0});En({circular:!0});En({circular:!0,strict:!0});En({createInternalComparator:()=>nr});En({strict:!0,createInternalComparator:()=>nr});En({circular:!0,createInternalComparator:()=>nr});En({circular:!0,createInternalComparator:()=>nr,strict:!0});function En(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:s=!1}=t,i=Ow(t),o=Dw(i),l=n?n(o):Lw(o);return Rw({circular:e,comparator:o,createState:r,equals:l,strict:s})}var ml={exports:{}},Io={};/**
119
119
  * @license React
120
120
  * use-sync-external-store-shim/with-selector.production.js
121
121
  *
@@ -123,7 +123,7 @@ ${m}`}}),a}function zk(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendan
123
123
  *
124
124
  * This source code is licensed under the MIT license found in the
125
125
  * LICENSE file in the root directory of this source tree.
126
- */var Vc;function Nw(){if(Vc)return Mo;Vc=1;var t=x,e=Pi;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,s=e.useSyncExternalStore,i=t.useRef,o=t.useEffect,l=t.useMemo,a=t.useDebugValue;return Mo.useSyncExternalStoreWithSelector=function(c,u,h,f,p){var m=i(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=l(function(){function y(S){if(!v){if(v=!0,_=S,S=f(S),p!==void 0&&g.hasValue){var C=g.value;if(p(C,S))return w=C}return w=S}if(C=w,r(_,S))return C;var D=f(S);return p!==void 0&&p(C,D)?(_=S,C):(_=S,w=D)}var v=!1,_,w,k=h===void 0?null:h;return[function(){return y(u())},k===null?void 0:function(){return y(k())}]},[u,h,f,p]);var b=s(c,m[0],m[1]);return o(function(){g.hasValue=!0,g.value=b},[b]),a(b),b},Mo}var jo={};/**
126
+ */var qc;function $w(){if(qc)return Io;qc=1;var t=x,e=Fi;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,s=e.useSyncExternalStore,i=t.useRef,o=t.useEffect,l=t.useMemo,a=t.useDebugValue;return Io.useSyncExternalStoreWithSelector=function(c,u,h,f,p){var m=i(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=l(function(){function y(S){if(!_){if(_=!0,v=S,S=f(S),p!==void 0&&g.hasValue){var C=g.value;if(p(C,S))return w=C}return w=S}if(C=w,r(v,S))return C;var D=f(S);return p!==void 0&&p(C,D)?(v=S,C):(v=S,w=D)}var _=!1,v,w,k=h===void 0?null:h;return[function(){return y(u())},k===null?void 0:function(){return y(k())}]},[u,h,f,p]);var b=s(c,m[0],m[1]);return o(function(){g.hasValue=!0,g.value=b},[b]),a(b),b},Io}var Do={};/**
127
127
  * @license React
128
128
  * use-sync-external-store-shim/with-selector.development.js
129
129
  *
@@ -131,45 +131,45 @@ ${m}`}}),a}function zk(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendan
131
131
  *
132
132
  * This source code is licensed under the MIT license found in the
133
133
  * LICENSE file in the root directory of this source tree.
134
- */var Uc;function Aw(){return Uc||(Uc=1,process.env.NODE_ENV!=="production"&&function(){function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=x,n=Pi,r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,o=e.useEffect,l=e.useMemo,a=e.useDebugValue;jo.useSyncExternalStoreWithSelector=function(c,u,h,f,p){var m=i(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=l(function(){function y(S){if(!v){if(v=!0,_=S,S=f(S),p!==void 0&&g.hasValue){var C=g.value;if(p(C,S))return w=C}return w=S}if(C=w,r(_,S))return C;var D=f(S);return p!==void 0&&p(C,D)?(_=S,C):(_=S,w=D)}var v=!1,_,w,k=h===void 0?null:h;return[function(){return y(u())},k===null?void 0:function(){return y(k())}]},[u,h,f,p]);var b=s(c,m[0],m[1]);return o(function(){g.hasValue=!0,g.value=b},[b]),a(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),jo}process.env.NODE_ENV==="production"?fl.exports=Nw():fl.exports=Aw();var Tw=fl.exports,Ew=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},Mw=({contentComponent:t})=>{const e=Pi.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return d.jsx(d.Fragment,{children:Object.values(e)})};function jw(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:qt.createPortal(r.reactElement,r.element,n)},t.forEach(s=>s())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(s=>s())}}}var Iw=class extends x.Component{constructor(t){super(t),this.editorContentRef=x.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=jw(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:Ew(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&d.jsx(Mw,{contentComponent:t.contentComponent})]})}},Dw=x.forwardRef((t,e)=>{const n=x.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return x.createElement(Iw,{key:n,innerRef:e,...t})}),Ph=x.memo(Dw),Ow=typeof window<"u"?x.useLayoutEffect:x.useEffect,Lw=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function Rw(t){var e;const[n]=x.useState(()=>new Lw(t.editor)),r=Tw.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:Sw);return Ow(()=>n.watch(t.editor),[t.editor,n]),x.useDebugValue(r),r}var qc=process.env.NODE_ENV!=="production",zh=typeof window>"u",Bw=zh||!!(typeof window<"u"&&window.next),$w=class Fh{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const e=this.options.current.immediatelyRender;let n=e??!0;return zh?(n&&qc&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):Bw&&e===void 0&&(n=!1,qc&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onBeforeCreate)==null?void 0:i.call(s,...r)},onBlur:(...r)=>{var s,i;return(i=(s=this.options.current).onBlur)==null?void 0:i.call(s,...r)},onCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onCreate)==null?void 0:i.call(s,...r)},onDestroy:(...r)=>{var s,i;return(i=(s=this.options.current).onDestroy)==null?void 0:i.call(s,...r)},onFocus:(...r)=>{var s,i;return(i=(s=this.options.current).onFocus)==null?void 0:i.call(s,...r)},onSelectionUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onSelectionUpdate)==null?void 0:i.call(s,...r)},onTransaction:(...r)=>{var s,i;return(i=(s=this.options.current).onTransaction)==null?void 0:i.call(s,...r)},onUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onUpdate)==null?void 0:i.call(s,...r)},onContentError:(...r)=>{var s,i;return(i=(s=this.options.current).onContentError)==null?void 0:i.call(s,...r)},onDrop:(...r)=>{var s,i;return(i=(s=this.options.current).onDrop)==null?void 0:i.call(s,...r)},onPaste:(...r)=>{var s,i;return(i=(s=this.options.current).onPaste)==null?void 0:i.call(s,...r)},onDelete:(...r)=>{var s,i;return(i=(s=this.options.current).onDelete)==null?void 0:i.call(s,...r)}};return new Ek(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((s,i)=>{var o;return s===((o=n.extensions)==null?void 0:o[i])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?Fh.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,s)=>r===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Pw(t={},e=[]){const n=x.useRef(t);n.current=t;const[r]=x.useState(()=>new $w(n)),s=Pi.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return x.useDebugValue(s),x.useEffect(r.onRender(e)),Rw({editor:s,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),s}var Hh=x.createContext({editor:null});Hh.Consumer;var zw=x.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Fw=()=>x.useContext(zw);x.forwardRef((t,e)=>{const{onDragStart:n}=Fw(),r=t.as||"div";return d.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function Kc(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function Gc(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.forward_ref)"||t.$$typeof.description==="react.forward_ref"))}function Hw(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.memo)"||t.$$typeof.description==="react.memo"))}function Ww(t){if(Kc(t)||Gc(t))return!0;if(Hw(t)){const e=t.type;if(e)return Kc(e)||Gc(e)}return!1}function Vw(){try{if(x.version)return parseInt(x.version.split(".")[0],10)>=19}catch{}return!1}var Uw=class{constructor(t,{editor:e,props:n={},as:r="div",className:s=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=e,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isEditorContentInitialized?qt.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var t;if(this.destroyed)return;const e=this.component,n=this.props,r=this.editor,s=Vw(),i=Ww(e),o={...n};o.ref&&!(s||i)&&delete o.ref,!o.ref&&(s||i)&&(o.ref=l=>{this.ref=l}),this.reactElement=d.jsx(e,{...o}),(t=r==null?void 0:r.contentComponent)==null||t.setRenderer(this.id,this)}updateProps(t={}){if(this.destroyed)return;let e=!1;const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const s=n[r];if(t[s]!==this.props[s]){e=!0;break}}e&&(this.props={...this.props,...t},this.render())}destroy(){var t;this.destroyed=!0;const e=this.editor;(t=e==null?void 0:e.contentComponent)==null||t.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(t){Object.keys(t).forEach(e=>{this.element.setAttribute(e,t[e])})}};x.createContext({markViewContentRef:()=>{}});var ta=x.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});ta.displayName="TiptapContext";var qw=()=>x.useContext(ta);function Wh({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const s=x.useMemo(()=>({editor:r}),[r]),i=x.useMemo(()=>({editor:r}),[r]);return d.jsx(Hh.Provider,{value:i,children:d.jsx(ta.Provider,{value:s,children:n})})}Wh.displayName="Tiptap";function Vh({...t}){const{editor:e}=qw();return d.jsx(Ph,{editor:e,...t})}Vh.displayName="Tiptap.Content";Object.assign(Wh,{Content:Vh});var ci=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},Kw=/^\s*>\s$/,Gw=lt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return ci("blockquote",{...ye(this.options.HTMLAttributes,t),children:ci("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((s,i)=>{var o,l;const u=((l=(o=e.renderChild)==null?void 0:o.call(e,s,i))!=null?l:e.renderChildren([s])).split(`
134
+ */var Kc;function Pw(){return Kc||(Kc=1,process.env.NODE_ENV!=="production"&&function(){function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=x,n=Fi,r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,o=e.useEffect,l=e.useMemo,a=e.useDebugValue;Do.useSyncExternalStoreWithSelector=function(c,u,h,f,p){var m=i(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=l(function(){function y(S){if(!_){if(_=!0,v=S,S=f(S),p!==void 0&&g.hasValue){var C=g.value;if(p(C,S))return w=C}return w=S}if(C=w,r(v,S))return C;var D=f(S);return p!==void 0&&p(C,D)?(v=S,C):(v=S,w=D)}var _=!1,v,w,k=h===void 0?null:h;return[function(){return y(u())},k===null?void 0:function(){return y(k())}]},[u,h,f,p]);var b=s(c,m[0],m[1]);return o(function(){g.hasValue=!0,g.value=b},[b]),a(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Do}process.env.NODE_ENV==="production"?ml.exports=$w():ml.exports=Pw();var zw=ml.exports,Fw=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},Hw=({contentComponent:t})=>{const e=Fi.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return d.jsx(d.Fragment,{children:Object.values(e)})};function Ww(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:qt.createPortal(r.reactElement,r.element,n)},t.forEach(s=>s())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(s=>s())}}}var Vw=class extends x.Component{constructor(t){super(t),this.editorContentRef=x.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=Ww(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:Fw(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&d.jsx(Hw,{contentComponent:t.contentComponent})]})}},Uw=x.forwardRef((t,e)=>{const n=x.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return x.createElement(Vw,{key:n,innerRef:e,...t})}),Fh=x.memo(Uw),qw=typeof window<"u"?x.useLayoutEffect:x.useEffect,Kw=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function Gw(t){var e;const[n]=x.useState(()=>new Kw(t.editor)),r=zw.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:Bw);return qw(()=>n.watch(t.editor),[t.editor,n]),x.useDebugValue(r),r}var Gc=process.env.NODE_ENV!=="production",Hh=typeof window>"u",Jw=Hh||!!(typeof window<"u"&&window.next),Yw=class Wh{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const e=this.options.current.immediatelyRender;let n=e??!0;return Hh?(n&&Gc&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):Jw&&e===void 0&&(n=!1,Gc&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onBeforeCreate)==null?void 0:i.call(s,...r)},onBlur:(...r)=>{var s,i;return(i=(s=this.options.current).onBlur)==null?void 0:i.call(s,...r)},onCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onCreate)==null?void 0:i.call(s,...r)},onDestroy:(...r)=>{var s,i;return(i=(s=this.options.current).onDestroy)==null?void 0:i.call(s,...r)},onFocus:(...r)=>{var s,i;return(i=(s=this.options.current).onFocus)==null?void 0:i.call(s,...r)},onSelectionUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onSelectionUpdate)==null?void 0:i.call(s,...r)},onTransaction:(...r)=>{var s,i;return(i=(s=this.options.current).onTransaction)==null?void 0:i.call(s,...r)},onUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onUpdate)==null?void 0:i.call(s,...r)},onContentError:(...r)=>{var s,i;return(i=(s=this.options.current).onContentError)==null?void 0:i.call(s,...r)},onDrop:(...r)=>{var s,i;return(i=(s=this.options.current).onDrop)==null?void 0:i.call(s,...r)},onPaste:(...r)=>{var s,i;return(i=(s=this.options.current).onPaste)==null?void 0:i.call(s,...r)},onDelete:(...r)=>{var s,i;return(i=(s=this.options.current).onDelete)==null?void 0:i.call(s,...r)}};return new Fk(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((s,i)=>{var o;return s===((o=n.extensions)==null?void 0:o[i])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?Wh.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,s)=>r===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Qw(t={},e=[]){const n=x.useRef(t);n.current=t;const[r]=x.useState(()=>new Yw(n)),s=Fi.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return x.useDebugValue(s),x.useEffect(r.onRender(e)),Gw({editor:s,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),s}var Vh=x.createContext({editor:null});Vh.Consumer;var Xw=x.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Zw=()=>x.useContext(Xw);x.forwardRef((t,e)=>{const{onDragStart:n}=Zw(),r=t.as||"div";return d.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function Jc(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function Yc(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.forward_ref)"||t.$$typeof.description==="react.forward_ref"))}function eC(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.memo)"||t.$$typeof.description==="react.memo"))}function tC(t){if(Jc(t)||Yc(t))return!0;if(eC(t)){const e=t.type;if(e)return Jc(e)||Yc(e)}return!1}function nC(){try{if(x.version)return parseInt(x.version.split(".")[0],10)>=19}catch{}return!1}var rC=class{constructor(t,{editor:e,props:n={},as:r="div",className:s=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=e,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isEditorContentInitialized?qt.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var t;if(this.destroyed)return;const e=this.component,n=this.props,r=this.editor,s=nC(),i=tC(e),o={...n};o.ref&&!(s||i)&&delete o.ref,!o.ref&&(s||i)&&(o.ref=l=>{this.ref=l}),this.reactElement=d.jsx(e,{...o}),(t=r==null?void 0:r.contentComponent)==null||t.setRenderer(this.id,this)}updateProps(t={}){if(this.destroyed)return;let e=!1;const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const s=n[r];if(t[s]!==this.props[s]){e=!0;break}}e&&(this.props={...this.props,...t},this.render())}destroy(){var t;this.destroyed=!0;const e=this.editor;(t=e==null?void 0:e.contentComponent)==null||t.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(t){Object.keys(t).forEach(e=>{this.element.setAttribute(e,t[e])})}};x.createContext({markViewContentRef:()=>{}});var ra=x.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});ra.displayName="TiptapContext";var sC=()=>x.useContext(ra);function Uh({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const s=x.useMemo(()=>({editor:r}),[r]),i=x.useMemo(()=>({editor:r}),[r]);return d.jsx(Vh.Provider,{value:i,children:d.jsx(ra.Provider,{value:s,children:n})})}Uh.displayName="Tiptap";function qh({...t}){const{editor:e}=sC();return d.jsx(Fh,{editor:e,...t})}qh.displayName="Tiptap.Content";Object.assign(Uh,{Content:qh});var ui=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},iC=/^\s*>\s$/,oC=lt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return ui("blockquote",{...ye(this.options.HTMLAttributes,t),children:ui("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((s,i)=>{var o,l;const u=((l=(o=e.renderChild)==null?void 0:o.call(e,s,i))!=null?l:e.renderChildren([s])).split(`
135
135
  `).map(h=>h.trim()===""?n:`${n} ${h}`);r.push(u.join(`
136
136
  `))}),r.join(`
137
137
  ${n}
138
- `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[vr({find:Kw,type:this.type})]}}),Jw=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Yw=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Qw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Xw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Zw=Kt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return ci("strong",{...ye(this.options.HTMLAttributes,t),children:ci("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Zn({find:Jw,type:this.type}),Zn({find:Qw,type:this.type})]},addPasteRules(){return[Nn({find:Yw,type:this.type}),Nn({find:Xw,type:this.type})]}}),eC=/(^|[^`])`([^`]+)`(?!`)$/,tC=/(^|[^`])`([^`]+)`(?!`)/g,nC=Kt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Zn({find:eC,type:this.type})]},addPasteRules(){return[Nn({find:tC,type:this.type})]}}),Io=4,rC=/^```([a-z]+)?[\s\n]$/,sC=/^~~~([a-z]+)?[\s\n]$/,iC=lt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Io,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const i=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ye(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const s=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${s}`,e.renderChildren(t.content),"```"].join(`
138
+ `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[_r({find:iC,type:this.type})]}}),lC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,aC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,cC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,dC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,uC=Kt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return ui("strong",{...ye(this.options.HTMLAttributes,t),children:ui("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Zn({find:lC,type:this.type}),Zn({find:cC,type:this.type})]},addPasteRules(){return[Nn({find:aC,type:this.type}),Nn({find:dC,type:this.type})]}}),hC=/(^|[^`])`([^`]+)`(?!`)$/,fC=/(^|[^`])`([^`]+)`(?!`)/g,pC=Kt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Zn({find:hC,type:this.type})]},addPasteRules(){return[Nn({find:fC,type:this.type})]}}),Oo=4,mC=/^```([a-z]+)?[\s\n]$/,gC=/^~~~([a-z]+)?[\s\n]$/,bC=lt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Oo,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const i=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ye(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const s=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${s}`,e.renderChildren(t.content),"```"].join(`
139
139
  `):r=`\`\`\`${s}
140
140
 
141
- \`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Io,{state:r}=t,{selection:s}=r,{$from:i,empty:o}=s;if(i.parent.type!==this.type)return!1;const l=" ".repeat(n);return o?t.commands.insertContent(l):t.commands.command(({tr:a})=>{const{from:c,to:u}=s,p=r.doc.textBetween(c,u,`
141
+ \`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Oo,{state:r}=t,{selection:s}=r,{$from:i,empty:o}=s;if(i.parent.type!==this.type)return!1;const l=" ".repeat(n);return o?t.commands.insertContent(l):t.commands.command(({tr:a})=>{const{from:c,to:u}=s,p=r.doc.textBetween(c,u,`
142
142
  `,`
143
143
  `).split(`
144
144
  `).map(m=>l+m).join(`
145
- `);return a.replaceWith(c,u,r.schema.text(p)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Io,{state:r}=t,{selection:s}=r,{$from:i,empty:o}=s;return i.parent.type!==this.type?!1:o?t.commands.command(({tr:l})=>{var a;const{pos:c}=i,u=i.start(),h=i.end(),p=r.doc.textBetween(u,h,`
145
+ `);return a.replaceWith(c,u,r.schema.text(p)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Oo,{state:r}=t,{selection:s}=r,{$from:i,empty:o}=s;return i.parent.type!==this.type?!1:o?t.commands.command(({tr:l})=>{var a;const{pos:c}=i,u=i.start(),h=i.end(),p=r.doc.textBetween(u,h,`
146
146
  `,`
147
147
  `).split(`
148
- `);let m=0,g=0;const b=c-u;for(let S=0;S<p.length;S+=1){if(g+p[S].length>=b){m=S;break}g+=p[S].length+1}const v=((a=p[m].match(/^ */))==null?void 0:a[0])||"",_=Math.min(v.length,n);if(_===0)return!0;let w=u;for(let S=0;S<m;S+=1)w+=p[S].length+1;return l.delete(w,w+_),c-w<=_&&l.setSelection(Q.create(l.doc,w)),!0}):t.commands.command(({tr:l})=>{const{from:a,to:c}=s,f=r.doc.textBetween(a,c,`
148
+ `);let m=0,g=0;const b=c-u;for(let S=0;S<p.length;S+=1){if(g+p[S].length>=b){m=S;break}g+=p[S].length+1}const _=((a=p[m].match(/^ */))==null?void 0:a[0])||"",v=Math.min(_.length,n);if(v===0)return!0;let w=u;for(let S=0;S<m;S+=1)w+=p[S].length+1;return l.delete(w,w+v),c-w<=v&&l.setSelection(Q.create(l.doc,w)),!0}):t.commands.command(({tr:l})=>{const{from:a,to:c}=s,f=r.doc.textBetween(a,c,`
149
149
  `,`
150
150
  `).split(`
151
151
  `).map(p=>{var m;const g=((m=p.match(/^ */))==null?void 0:m[0])||"",b=Math.min(g.length,n);return p.slice(b)}).join(`
152
152
  `);return l.replaceWith(a,c,r.schema.text(f)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
153
153
 
154
- `);return!i||!o?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const l=s.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:c})=>(c.setSelection(ie.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[ul({find:rC,type:this.type,getAttributes:t=>({language:t[1]})}),ul({find:sC,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ne({key:new Re("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;if(!n||!i)return!1;const{tr:o,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
155
- `));return o.replaceSelectionWith(this.type.create({language:i},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),t.dispatch(o),!0}}})]}}),oC=lt.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
154
+ `);return!i||!o?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const l=s.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:c})=>(c.setSelection(se.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[fl({find:mC,type:this.type,getAttributes:t=>({language:t[1]})}),fl({find:gC,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ne({key:new Re("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;if(!n||!i)return!1;const{tr:o,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
155
+ `));return o.replaceSelectionWith(this.type.create({language:i},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),t.dispatch(o),!0}}})]}}),yC=lt.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
156
156
 
157
- `):""}),lC=lt.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ye(this.options.HTMLAttributes,t)]},renderText(){return`
157
+ `):""}),xC=lt.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ye(this.options.HTMLAttributes,t)]},renderText(){return`
158
158
  `},renderMarkdown:()=>`
159
- `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=r.extensionManager,a=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&o){const h=a.filter(f=>l.includes(f.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),aC=lt.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(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ye(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,s="#".repeat(r);return t.content?`${s} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>ul({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),cC=lt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ye(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Ik(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,s=t();return yh(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:l})=>{if(l){const{$to:a}=o.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?o.setSelection(Q.create(o.doc,a.pos+1)):a.nodeAfter.isBlock?o.setSelection(J.create(o.doc,a.pos)):o.setSelection(Q.create(o.doc,a.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,h=u==null?void 0:u.create();h&&(o.insert(c,h),o.setSelection(Q.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Lh({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),dC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,uC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,hC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,fC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,pC=Kt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Zn({find:dC,type:this.type}),Zn({find:hC,type:this.type})]},addPasteRules(){return[Nn({find:uC,type:this.type}),Nn({find:fC,type:this.type})]}});const mC="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",gC="ελ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",pl="numeric",ml="ascii",gl="alpha",Jr="asciinumeric",Wr="alphanumeric",bl="domain",Uh="emoji",bC="scheme",yC="slashscheme",Do="whitespace";function xC(t,e){return t in e||(e[t]=[]),e[t]}function zn(t,e,n){e[pl]&&(e[Jr]=!0,e[Wr]=!0),e[ml]&&(e[Jr]=!0,e[gl]=!0),e[Jr]&&(e[Wr]=!0),e[gl]&&(e[Wr]=!0),e[Wr]&&(e[bl]=!0),e[Uh]&&(e[bl]=!0);for(const r in e){const s=xC(r,n);s.indexOf(t)<0&&s.push(t)}}function vC(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function dt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}dt.groups={};dt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const s=e.jr[r][0],i=e.jr[r][1];if(i&&s.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let s=0;s<t.length;s++)this.tt(t[s],e,n,r)},tr(t,e,n,r){r=r||dt.groups;let s;return e&&e.j?s=e:(s=new dt(e),n&&r&&zn(e,n,r)),this.jr.push([t,s]),s},ts(t,e,n,r){let s=this;const i=t.length;if(!i)return s;for(let o=0;o<i-1;o++)s=s.tt(t[o]);return s.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||dt.groups;const s=this;if(e&&e.j)return s.j[t]=e,e;const i=e;let o,l=s.go(t);if(l?(o=new dt,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new dt,i){if(r)if(o.t&&typeof o.t=="string"){const a=Object.assign(vC(o.t,r),n);zn(i,a,r)}else n&&zn(i,n,r);o.t=i}return s.j[t]=o,o}};const le=(t,e,n,r,s)=>t.ta(e,n,r,s),Ee=(t,e,n,r,s)=>t.tr(e,n,r,s),Jc=(t,e,n,r,s)=>t.ts(e,n,r,s),I=(t,e,n,r,s)=>t.tt(e,n,r,s),tn="WORD",yl="UWORD",qh="ASCIINUMERICAL",Kh="ALPHANUMERICAL",hs="LOCALHOST",xl="TLD",vl="UTLD",qs="SCHEME",dr="SLASH_SCHEME",na="NUM",_l="WS",ra="NL",Yr="OPENBRACE",Qr="CLOSEBRACE",di="OPENBRACKET",ui="CLOSEBRACKET",hi="OPENPAREN",fi="CLOSEPAREN",pi="OPENANGLEBRACKET",mi="CLOSEANGLEBRACKET",gi="FULLWIDTHLEFTPAREN",bi="FULLWIDTHRIGHTPAREN",yi="LEFTCORNERBRACKET",xi="RIGHTCORNERBRACKET",vi="LEFTWHITECORNERBRACKET",_i="RIGHTWHITECORNERBRACKET",ki="FULLWIDTHLESSTHAN",wi="FULLWIDTHGREATERTHAN",Ci="AMPERSAND",Si="APOSTROPHE",Ni="ASTERISK",pn="AT",Ai="BACKSLASH",Ti="BACKTICK",Ei="CARET",Fn="COLON",sa="COMMA",Mi="DOLLAR",Ft="DOT",ji="EQUALS",ia="EXCLAMATION",At="HYPHEN",Xr="PERCENT",Ii="PIPE",Di="PLUS",Oi="POUND",Zr="QUERY",oa="QUOTE",Gh="FULLWIDTHMIDDLEDOT",la="SEMI",Ht="SLASH",es="TILDE",Li="UNDERSCORE",Jh="EMOJI",Ri="SYM";var Yh=Object.freeze({__proto__:null,ALPHANUMERICAL:Kh,AMPERSAND:Ci,APOSTROPHE:Si,ASCIINUMERICAL:qh,ASTERISK:Ni,AT:pn,BACKSLASH:Ai,BACKTICK:Ti,CARET:Ei,CLOSEANGLEBRACKET:mi,CLOSEBRACE:Qr,CLOSEBRACKET:ui,CLOSEPAREN:fi,COLON:Fn,COMMA:sa,DOLLAR:Mi,DOT:Ft,EMOJI:Jh,EQUALS:ji,EXCLAMATION:ia,FULLWIDTHGREATERTHAN:wi,FULLWIDTHLEFTPAREN:gi,FULLWIDTHLESSTHAN:ki,FULLWIDTHMIDDLEDOT:Gh,FULLWIDTHRIGHTPAREN:bi,HYPHEN:At,LEFTCORNERBRACKET:yi,LEFTWHITECORNERBRACKET:vi,LOCALHOST:hs,NL:ra,NUM:na,OPENANGLEBRACKET:pi,OPENBRACE:Yr,OPENBRACKET:di,OPENPAREN:hi,PERCENT:Xr,PIPE:Ii,PLUS:Di,POUND:Oi,QUERY:Zr,QUOTE:oa,RIGHTCORNERBRACKET:xi,RIGHTWHITECORNERBRACKET:_i,SCHEME:qs,SEMI:la,SLASH:Ht,SLASH_SCHEME:dr,SYM:Ri,TILDE:es,TLD:xl,UNDERSCORE:Li,UTLD:vl,UWORD:yl,WORD:tn,WS:_l});const Qt=/[a-z]/,Dr=new RegExp("\\p{L}","u"),Oo=new RegExp("\\p{Emoji}","u"),Xt=/\d/,Lo=/\s/,Yc="\r",Ro=`
160
- `,_C="️",kC="‍",Bo="";let Rs=null,Bs=null;function wC(t=[]){const e={};dt.groups=e;const n=new dt;Rs==null&&(Rs=Qc(mC)),Bs==null&&(Bs=Qc(gC)),I(n,"'",Si),I(n,"{",Yr),I(n,"}",Qr),I(n,"[",di),I(n,"]",ui),I(n,"(",hi),I(n,")",fi),I(n,"<",pi),I(n,">",mi),I(n,"(",gi),I(n,")",bi),I(n,"「",yi),I(n,"」",xi),I(n,"『",vi),I(n,"』",_i),I(n,"<",ki),I(n,">",wi),I(n,"&",Ci),I(n,"*",Ni),I(n,"@",pn),I(n,"`",Ti),I(n,"^",Ei),I(n,":",Fn),I(n,",",sa),I(n,"$",Mi),I(n,".",Ft),I(n,"=",ji),I(n,"!",ia),I(n,"-",At),I(n,"%",Xr),I(n,"|",Ii),I(n,"+",Di),I(n,"#",Oi),I(n,"?",Zr),I(n,'"',oa),I(n,"/",Ht),I(n,";",la),I(n,"~",es),I(n,"_",Li),I(n,"\\",Ai),I(n,"・",Gh);const r=Ee(n,Xt,na,{[pl]:!0});Ee(r,Xt,r);const s=Ee(r,Qt,qh,{[Jr]:!0}),i=Ee(r,Dr,Kh,{[Wr]:!0}),o=Ee(n,Qt,tn,{[ml]:!0});Ee(o,Xt,s),Ee(o,Qt,o),Ee(s,Xt,s),Ee(s,Qt,s);const l=Ee(n,Dr,yl,{[gl]:!0});Ee(l,Qt),Ee(l,Xt,i),Ee(l,Dr,l),Ee(i,Xt,i),Ee(i,Qt),Ee(i,Dr,i);const a=I(n,Ro,ra,{[Do]:!0}),c=I(n,Yc,_l,{[Do]:!0}),u=Ee(n,Lo,_l,{[Do]:!0});I(n,Bo,u),I(c,Ro,a),I(c,Bo,u),Ee(c,Lo,u),I(u,Yc),I(u,Ro),Ee(u,Lo,u),I(u,Bo,u);const h=Ee(n,Oo,Jh,{[Uh]:!0});I(h,"#"),Ee(h,Oo,h),I(h,_C,h);const f=I(h,kC);I(f,"#"),Ee(f,Oo,h);const p=[[Qt,o],[Xt,s]],m=[[Qt,null],[Dr,l],[Xt,i]];for(let g=0;g<Rs.length;g++)un(n,Rs[g],xl,tn,p);for(let g=0;g<Bs.length;g++)un(n,Bs[g],vl,yl,m);zn(xl,{tld:!0,ascii:!0},e),zn(vl,{utld:!0,alpha:!0},e),un(n,"file",qs,tn,p),un(n,"mailto",qs,tn,p),un(n,"http",dr,tn,p),un(n,"https",dr,tn,p),un(n,"ftp",dr,tn,p),un(n,"ftps",dr,tn,p),zn(qs,{scheme:!0,ascii:!0},e),zn(dr,{slashscheme:!0,ascii:!0},e),t=t.sort((g,b)=>g[0]>b[0]?1:-1);for(let g=0;g<t.length;g++){const b=t[g][0],v=t[g][1]?{[bC]:!0}:{[yC]:!0};b.indexOf("-")>=0?v[bl]=!0:Qt.test(b)?Xt.test(b)?v[Jr]=!0:v[ml]=!0:v[pl]=!0,Jc(n,b,b,v)}return Jc(n,"localhost",hs,{ascii:!0}),n.jd=new dt(Ri),{start:n,tokens:Object.assign({groups:e},Yh)}}function Qh(t,e){const n=CC(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,s=[];let i=0,o=0;for(;o<r;){let l=t,a=null,c=0,u=null,h=-1,f=-1;for(;o<r&&(a=l.go(n[o]));)l=a,l.accepts()?(h=0,f=0,u=l):h>=0&&(h+=n[o].length,f++),c+=n[o].length,i+=n[o].length,o++;i-=h,o-=f,c-=h,s.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return s}function CC(t){const e=[],n=t.length;let r=0;for(;r<n;){let s=t.charCodeAt(r),i,o=s<55296||s>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function un(t,e,n,r,s){let i;const o=e.length;for(let l=0;l<o-1;l++){const a=e[l];t.j[a]?i=t.j[a]:(i=new dt(r),i.jr=s.slice(),t.j[a]=i),t=i}return i=new dt(n),i.jr=s.slice(),t.j[e[o-1]]=i,i}function Qc(t){const e=[],n=[];let r=0,s="0123456789";for(;r<t.length;){let i=0;for(;s.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+i),10);o>0;o--)n.pop();r+=i}else n.push(t[r]),r++}return e}const fs={defaultProtocol:"http",events:null,format:Xc,formatHref:Xc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function aa(t,e=null){let n=Object.assign({},fs);t&&(n=Object.assign(n,t instanceof aa?t.o:t));const r=n.ignoreTags,s=[];for(let i=0;i<r.length;i++)s.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=s}aa.prototype={o:fs,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let s=this.o[t];return s&&(typeof s=="object"?(s=n.t in s?s[n.t]:fs[t],typeof s=="function"&&r&&(s=s(e,n))):typeof s=="function"&&r&&(s=s(e,n.t,n)),s)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Xc(t){return t}function Xh(t,e){this.t="token",this.v=t,this.tk=e}Xh.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=fs.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),s=t.get("tagName",n,e),i=this.toFormattedString(t),o={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return o.href=r,l&&(o.class=l),a&&(o.target=a),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:s,attributes:o,content:i,eventListeners:h}}};function Zi(t,e){class n extends Xh{constructor(s,i){super(s,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const SC=Zi("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Zc=Zi("text"),NC=Zi("nl"),$s=Zi("url",{isLink:!0,toHref(t=fs.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==hs&&t[1].t===Fn}}),Ct=t=>new dt(t);function AC({groups:t}){const e=t.domain.concat([Ci,Ni,pn,Ai,Ti,Ei,Mi,ji,At,na,Xr,Ii,Di,Oi,Ht,Ri,es,Li]),n=[Si,Fn,sa,Ft,ia,Xr,Zr,oa,la,pi,mi,Yr,Qr,ui,di,hi,fi,gi,bi,yi,xi,vi,_i,ki,wi],r=[Ci,Si,Ni,Ai,Ti,Ei,Mi,ji,At,Yr,Qr,Xr,Ii,Di,Oi,Zr,Ht,Ri,es,Li],s=Ct(),i=I(s,es);le(i,r,i),le(i,t.domain,i);const o=Ct(),l=Ct(),a=Ct();le(s,t.domain,o),le(s,t.scheme,l),le(s,t.slashscheme,a),le(o,r,i),le(o,t.domain,o);const c=I(o,pn);I(i,pn,c),I(l,pn,c),I(a,pn,c);const u=I(i,Ft);le(u,r,i),le(u,t.domain,i);const h=Ct();le(c,t.domain,h),le(h,t.domain,h);const f=I(h,Ft);le(f,t.domain,h);const p=Ct(SC);le(f,t.tld,p),le(f,t.utld,p),I(c,hs,p);const m=I(h,At);I(m,At,m),le(m,t.domain,h),le(p,t.domain,h),I(p,Ft,f),I(p,At,m);const g=I(o,At),b=I(o,Ft);I(g,At,g),le(g,t.domain,o),le(b,r,i),le(b,t.domain,o);const y=Ct($s);le(b,t.tld,y),le(b,t.utld,y),le(y,t.domain,o),le(y,r,i),I(y,Ft,b),I(y,At,g),I(y,pn,c);const v=I(y,Fn),_=Ct($s);le(v,t.numeric,_);const w=Ct($s),k=Ct();le(w,e,w),le(w,n,k),le(k,e,w),le(k,n,k),I(y,Ht,w),I(_,Ht,w);const S=I(l,Fn),C=I(a,Fn),D=I(C,Ht),B=I(D,Ht);le(l,t.domain,o),I(l,Ft,b),I(l,At,g),le(a,t.domain,o),I(a,Ft,b),I(a,At,g),le(S,t.domain,w),I(S,Ht,w),I(S,Zr,w),le(B,t.domain,w),le(B,e,w),I(B,Ht,w);const N=[[Yr,Qr],[di,ui],[hi,fi],[pi,mi],[gi,bi],[yi,xi],[vi,_i],[ki,wi]];for(let T=0;T<N.length;T++){const[$,R]=N[T],L=I(w,$);I(k,$,L);const U=Ct($s);le(L,e,U);const V=Ct();le(L,n,V),I(L,R,w),le(U,e,U),le(U,n,V),le(V,e,U),le(V,n,V),I(U,R,w),I(V,R,w)}return I(s,hs,y),I(s,ra,NC),{start:s,tokens:Yh}}function TC(t,e,n){let r=n.length,s=0,i=[],o=[];for(;s<r;){let l=t,a=null,c=null,u=0,h=null,f=-1;for(;s<r&&!(a=l.go(n[s].t));)o.push(n[s++]);for(;s<r&&(c=a||l.go(n[s].t));)a=null,l=c,l.accepts()?(f=0,h=l):f>=0&&f++,s++,u++;if(f<0)s-=u,s<r&&(o.push(n[s]),s++);else{o.length>0&&(i.push($o(Zc,e,o)),o=[]),s-=f,u-=f;const p=h.t,m=n.slice(s-u,s);i.push($o(p,e,m))}}return o.length>0&&i.push($o(Zc,e,o)),i}function $o(t,e,n){const r=n[0].s,s=n[n.length-1].e,i=e.slice(r,s);return new t(i,n)}const EC=typeof console<"u"&&console&&console.warn||(()=>{}),MC="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ke={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function jC(){return dt.groups={},ke.scanner=null,ke.parser=null,ke.tokenQueue=[],ke.pluginQueue=[],ke.customSchemes=[],ke.initialized=!1,ke}function ed(t,e=!1){if(ke.initialized&&EC(`linkifyjs: already initialized - will not register custom scheme "${t}" ${MC}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
159
+ `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=r.extensionManager,a=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&o){const h=a.filter(f=>l.includes(f.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),_C=lt.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(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ye(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,s="#".repeat(r);return t.content?`${s} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>fl({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),vC=lt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ye(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Vk(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,s=t();return _h(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:l})=>{if(l){const{$to:a}=o.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?o.setSelection(Q.create(o.doc,a.pos+1)):a.nodeAfter.isBlock?o.setSelection(J.create(o.doc,a.pos)):o.setSelection(Q.create(o.doc,a.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,h=u==null?void 0:u.create();h&&(o.insert(c,h),o.setSelection(Q.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Bh({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),kC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,wC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,CC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,SC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,NC=Kt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Zn({find:kC,type:this.type}),Zn({find:CC,type:this.type})]},addPasteRules(){return[Nn({find:wC,type:this.type}),Nn({find:SC,type:this.type})]}});const AC="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",TC="ελ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",gl="numeric",bl="ascii",yl="alpha",Yr="asciinumeric",Vr="alphanumeric",xl="domain",Kh="emoji",EC="scheme",MC="slashscheme",Lo="whitespace";function jC(t,e){return t in e||(e[t]=[]),e[t]}function zn(t,e,n){e[gl]&&(e[Yr]=!0,e[Vr]=!0),e[bl]&&(e[Yr]=!0,e[yl]=!0),e[Yr]&&(e[Vr]=!0),e[yl]&&(e[Vr]=!0),e[Vr]&&(e[xl]=!0),e[Kh]&&(e[xl]=!0);for(const r in e){const s=jC(r,n);s.indexOf(t)<0&&s.push(t)}}function IC(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function dt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}dt.groups={};dt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const s=e.jr[r][0],i=e.jr[r][1];if(i&&s.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let s=0;s<t.length;s++)this.tt(t[s],e,n,r)},tr(t,e,n,r){r=r||dt.groups;let s;return e&&e.j?s=e:(s=new dt(e),n&&r&&zn(e,n,r)),this.jr.push([t,s]),s},ts(t,e,n,r){let s=this;const i=t.length;if(!i)return s;for(let o=0;o<i-1;o++)s=s.tt(t[o]);return s.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||dt.groups;const s=this;if(e&&e.j)return s.j[t]=e,e;const i=e;let o,l=s.go(t);if(l?(o=new dt,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new dt,i){if(r)if(o.t&&typeof o.t=="string"){const a=Object.assign(IC(o.t,r),n);zn(i,a,r)}else n&&zn(i,n,r);o.t=i}return s.j[t]=o,o}};const oe=(t,e,n,r,s)=>t.ta(e,n,r,s),Ee=(t,e,n,r,s)=>t.tr(e,n,r,s),Qc=(t,e,n,r,s)=>t.ts(e,n,r,s),I=(t,e,n,r,s)=>t.tt(e,n,r,s),en="WORD",_l="UWORD",Gh="ASCIINUMERICAL",Jh="ALPHANUMERICAL",fs="LOCALHOST",vl="TLD",kl="UTLD",Gs="SCHEME",dr="SLASH_SCHEME",sa="NUM",wl="WS",ia="NL",Qr="OPENBRACE",Xr="CLOSEBRACE",hi="OPENBRACKET",fi="CLOSEBRACKET",pi="OPENPAREN",mi="CLOSEPAREN",gi="OPENANGLEBRACKET",bi="CLOSEANGLEBRACKET",yi="FULLWIDTHLEFTPAREN",xi="FULLWIDTHRIGHTPAREN",_i="LEFTCORNERBRACKET",vi="RIGHTCORNERBRACKET",ki="LEFTWHITECORNERBRACKET",wi="RIGHTWHITECORNERBRACKET",Ci="FULLWIDTHLESSTHAN",Si="FULLWIDTHGREATERTHAN",Ni="AMPERSAND",Ai="APOSTROPHE",Ti="ASTERISK",pn="AT",Ei="BACKSLASH",Mi="BACKTICK",ji="CARET",Fn="COLON",oa="COMMA",Ii="DOLLAR",Ft="DOT",Di="EQUALS",la="EXCLAMATION",At="HYPHEN",Zr="PERCENT",Oi="PIPE",Li="PLUS",Ri="POUND",es="QUERY",aa="QUOTE",Yh="FULLWIDTHMIDDLEDOT",ca="SEMI",Ht="SLASH",ts="TILDE",Bi="UNDERSCORE",Qh="EMOJI",$i="SYM";var Xh=Object.freeze({__proto__:null,ALPHANUMERICAL:Jh,AMPERSAND:Ni,APOSTROPHE:Ai,ASCIINUMERICAL:Gh,ASTERISK:Ti,AT:pn,BACKSLASH:Ei,BACKTICK:Mi,CARET:ji,CLOSEANGLEBRACKET:bi,CLOSEBRACE:Xr,CLOSEBRACKET:fi,CLOSEPAREN:mi,COLON:Fn,COMMA:oa,DOLLAR:Ii,DOT:Ft,EMOJI:Qh,EQUALS:Di,EXCLAMATION:la,FULLWIDTHGREATERTHAN:Si,FULLWIDTHLEFTPAREN:yi,FULLWIDTHLESSTHAN:Ci,FULLWIDTHMIDDLEDOT:Yh,FULLWIDTHRIGHTPAREN:xi,HYPHEN:At,LEFTCORNERBRACKET:_i,LEFTWHITECORNERBRACKET:ki,LOCALHOST:fs,NL:ia,NUM:sa,OPENANGLEBRACKET:gi,OPENBRACE:Qr,OPENBRACKET:hi,OPENPAREN:pi,PERCENT:Zr,PIPE:Oi,PLUS:Li,POUND:Ri,QUERY:es,QUOTE:aa,RIGHTCORNERBRACKET:vi,RIGHTWHITECORNERBRACKET:wi,SCHEME:Gs,SEMI:ca,SLASH:Ht,SLASH_SCHEME:dr,SYM:$i,TILDE:ts,TLD:vl,UNDERSCORE:Bi,UTLD:kl,UWORD:_l,WORD:en,WS:wl});const Qt=/[a-z]/,Or=new RegExp("\\p{L}","u"),Ro=new RegExp("\\p{Emoji}","u"),Xt=/\d/,Bo=/\s/,Xc="\r",$o=`
160
+ `,DC="️",OC="‍",Po="";let $s=null,Ps=null;function LC(t=[]){const e={};dt.groups=e;const n=new dt;$s==null&&($s=Zc(AC)),Ps==null&&(Ps=Zc(TC)),I(n,"'",Ai),I(n,"{",Qr),I(n,"}",Xr),I(n,"[",hi),I(n,"]",fi),I(n,"(",pi),I(n,")",mi),I(n,"<",gi),I(n,">",bi),I(n,"(",yi),I(n,")",xi),I(n,"「",_i),I(n,"」",vi),I(n,"『",ki),I(n,"』",wi),I(n,"<",Ci),I(n,">",Si),I(n,"&",Ni),I(n,"*",Ti),I(n,"@",pn),I(n,"`",Mi),I(n,"^",ji),I(n,":",Fn),I(n,",",oa),I(n,"$",Ii),I(n,".",Ft),I(n,"=",Di),I(n,"!",la),I(n,"-",At),I(n,"%",Zr),I(n,"|",Oi),I(n,"+",Li),I(n,"#",Ri),I(n,"?",es),I(n,'"',aa),I(n,"/",Ht),I(n,";",ca),I(n,"~",ts),I(n,"_",Bi),I(n,"\\",Ei),I(n,"・",Yh);const r=Ee(n,Xt,sa,{[gl]:!0});Ee(r,Xt,r);const s=Ee(r,Qt,Gh,{[Yr]:!0}),i=Ee(r,Or,Jh,{[Vr]:!0}),o=Ee(n,Qt,en,{[bl]:!0});Ee(o,Xt,s),Ee(o,Qt,o),Ee(s,Xt,s),Ee(s,Qt,s);const l=Ee(n,Or,_l,{[yl]:!0});Ee(l,Qt),Ee(l,Xt,i),Ee(l,Or,l),Ee(i,Xt,i),Ee(i,Qt),Ee(i,Or,i);const a=I(n,$o,ia,{[Lo]:!0}),c=I(n,Xc,wl,{[Lo]:!0}),u=Ee(n,Bo,wl,{[Lo]:!0});I(n,Po,u),I(c,$o,a),I(c,Po,u),Ee(c,Bo,u),I(u,Xc),I(u,$o),Ee(u,Bo,u),I(u,Po,u);const h=Ee(n,Ro,Qh,{[Kh]:!0});I(h,"#"),Ee(h,Ro,h),I(h,DC,h);const f=I(h,OC);I(f,"#"),Ee(f,Ro,h);const p=[[Qt,o],[Xt,s]],m=[[Qt,null],[Or,l],[Xt,i]];for(let g=0;g<$s.length;g++)dn(n,$s[g],vl,en,p);for(let g=0;g<Ps.length;g++)dn(n,Ps[g],kl,_l,m);zn(vl,{tld:!0,ascii:!0},e),zn(kl,{utld:!0,alpha:!0},e),dn(n,"file",Gs,en,p),dn(n,"mailto",Gs,en,p),dn(n,"http",dr,en,p),dn(n,"https",dr,en,p),dn(n,"ftp",dr,en,p),dn(n,"ftps",dr,en,p),zn(Gs,{scheme:!0,ascii:!0},e),zn(dr,{slashscheme:!0,ascii:!0},e),t=t.sort((g,b)=>g[0]>b[0]?1:-1);for(let g=0;g<t.length;g++){const b=t[g][0],_=t[g][1]?{[EC]:!0}:{[MC]:!0};b.indexOf("-")>=0?_[xl]=!0:Qt.test(b)?Xt.test(b)?_[Yr]=!0:_[bl]=!0:_[gl]=!0,Qc(n,b,b,_)}return Qc(n,"localhost",fs,{ascii:!0}),n.jd=new dt($i),{start:n,tokens:Object.assign({groups:e},Xh)}}function Zh(t,e){const n=RC(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,s=[];let i=0,o=0;for(;o<r;){let l=t,a=null,c=0,u=null,h=-1,f=-1;for(;o<r&&(a=l.go(n[o]));)l=a,l.accepts()?(h=0,f=0,u=l):h>=0&&(h+=n[o].length,f++),c+=n[o].length,i+=n[o].length,o++;i-=h,o-=f,c-=h,s.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return s}function RC(t){const e=[],n=t.length;let r=0;for(;r<n;){let s=t.charCodeAt(r),i,o=s<55296||s>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function dn(t,e,n,r,s){let i;const o=e.length;for(let l=0;l<o-1;l++){const a=e[l];t.j[a]?i=t.j[a]:(i=new dt(r),i.jr=s.slice(),t.j[a]=i),t=i}return i=new dt(n),i.jr=s.slice(),t.j[e[o-1]]=i,i}function Zc(t){const e=[],n=[];let r=0,s="0123456789";for(;r<t.length;){let i=0;for(;s.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+i),10);o>0;o--)n.pop();r+=i}else n.push(t[r]),r++}return e}const ps={defaultProtocol:"http",events:null,format:ed,formatHref:ed,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function da(t,e=null){let n=Object.assign({},ps);t&&(n=Object.assign(n,t instanceof da?t.o:t));const r=n.ignoreTags,s=[];for(let i=0;i<r.length;i++)s.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=s}da.prototype={o:ps,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let s=this.o[t];return s&&(typeof s=="object"?(s=n.t in s?s[n.t]:ps[t],typeof s=="function"&&r&&(s=s(e,n))):typeof s=="function"&&r&&(s=s(e,n.t,n)),s)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function ed(t){return t}function ef(t,e){this.t="token",this.v=t,this.tk=e}ef.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=ps.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),s=t.get("tagName",n,e),i=this.toFormattedString(t),o={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return o.href=r,l&&(o.class=l),a&&(o.target=a),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:s,attributes:o,content:i,eventListeners:h}}};function to(t,e){class n extends ef{constructor(s,i){super(s,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const BC=to("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),td=to("text"),$C=to("nl"),zs=to("url",{isLink:!0,toHref(t=ps.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==fs&&t[1].t===Fn}}),wt=t=>new dt(t);function PC({groups:t}){const e=t.domain.concat([Ni,Ti,pn,Ei,Mi,ji,Ii,Di,At,sa,Zr,Oi,Li,Ri,Ht,$i,ts,Bi]),n=[Ai,Fn,oa,Ft,la,Zr,es,aa,ca,gi,bi,Qr,Xr,fi,hi,pi,mi,yi,xi,_i,vi,ki,wi,Ci,Si],r=[Ni,Ai,Ti,Ei,Mi,ji,Ii,Di,At,Qr,Xr,Zr,Oi,Li,Ri,es,Ht,$i,ts,Bi],s=wt(),i=I(s,ts);oe(i,r,i),oe(i,t.domain,i);const o=wt(),l=wt(),a=wt();oe(s,t.domain,o),oe(s,t.scheme,l),oe(s,t.slashscheme,a),oe(o,r,i),oe(o,t.domain,o);const c=I(o,pn);I(i,pn,c),I(l,pn,c),I(a,pn,c);const u=I(i,Ft);oe(u,r,i),oe(u,t.domain,i);const h=wt();oe(c,t.domain,h),oe(h,t.domain,h);const f=I(h,Ft);oe(f,t.domain,h);const p=wt(BC);oe(f,t.tld,p),oe(f,t.utld,p),I(c,fs,p);const m=I(h,At);I(m,At,m),oe(m,t.domain,h),oe(p,t.domain,h),I(p,Ft,f),I(p,At,m);const g=I(o,At),b=I(o,Ft);I(g,At,g),oe(g,t.domain,o),oe(b,r,i),oe(b,t.domain,o);const y=wt(zs);oe(b,t.tld,y),oe(b,t.utld,y),oe(y,t.domain,o),oe(y,r,i),I(y,Ft,b),I(y,At,g),I(y,pn,c);const _=I(y,Fn),v=wt(zs);oe(_,t.numeric,v);const w=wt(zs),k=wt();oe(w,e,w),oe(w,n,k),oe(k,e,w),oe(k,n,k),I(y,Ht,w),I(v,Ht,w);const S=I(l,Fn),C=I(a,Fn),D=I(C,Ht),B=I(D,Ht);oe(l,t.domain,o),I(l,Ft,b),I(l,At,g),oe(a,t.domain,o),I(a,Ft,b),I(a,At,g),oe(S,t.domain,w),I(S,Ht,w),I(S,es,w),oe(B,t.domain,w),oe(B,e,w),I(B,Ht,w);const N=[[Qr,Xr],[hi,fi],[pi,mi],[gi,bi],[yi,xi],[_i,vi],[ki,wi],[Ci,Si]];for(let T=0;T<N.length;T++){const[$,R]=N[T],L=I(w,$);I(k,$,L);const U=wt(zs);oe(L,e,U);const V=wt();oe(L,n,V),I(L,R,w),oe(U,e,U),oe(U,n,V),oe(V,e,U),oe(V,n,V),I(U,R,w),I(V,R,w)}return I(s,fs,y),I(s,ia,$C),{start:s,tokens:Xh}}function zC(t,e,n){let r=n.length,s=0,i=[],o=[];for(;s<r;){let l=t,a=null,c=null,u=0,h=null,f=-1;for(;s<r&&!(a=l.go(n[s].t));)o.push(n[s++]);for(;s<r&&(c=a||l.go(n[s].t));)a=null,l=c,l.accepts()?(f=0,h=l):f>=0&&f++,s++,u++;if(f<0)s-=u,s<r&&(o.push(n[s]),s++);else{o.length>0&&(i.push(zo(td,e,o)),o=[]),s-=f,u-=f;const p=h.t,m=n.slice(s-u,s);i.push(zo(p,e,m))}}return o.length>0&&i.push(zo(td,e,o)),i}function zo(t,e,n){const r=n[0].s,s=n[n.length-1].e,i=e.slice(r,s);return new t(i,n)}const FC=typeof console<"u"&&console&&console.warn||(()=>{}),HC="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ke={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function WC(){return dt.groups={},ke.scanner=null,ke.parser=null,ke.tokenQueue=[],ke.pluginQueue=[],ke.customSchemes=[],ke.initialized=!1,ke}function nd(t,e=!1){if(ke.initialized&&FC(`linkifyjs: already initialized - will not register custom scheme "${t}" ${HC}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
161
161
  1. Must only contain digits, lowercase ASCII letters or "-"
162
162
  2. Cannot start or end with "-"
163
- 3. "-" cannot repeat`);ke.customSchemes.push([t,e])}function IC(){ke.scanner=wC(ke.customSchemes);for(let t=0;t<ke.tokenQueue.length;t++)ke.tokenQueue[t][1]({scanner:ke.scanner});ke.parser=AC(ke.scanner.tokens);for(let t=0;t<ke.pluginQueue.length;t++)ke.pluginQueue[t][1]({scanner:ke.scanner,parser:ke.parser});return ke.initialized=!0,ke}function ca(t){return ke.initialized||IC(),TC(ke.parser.start,t,Qh(ke.scanner.start,t))}ca.scan=Qh;function Zh(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new aa(n),s=ca(t),i=[];for(let o=0;o<s.length;o++){const l=s[o];l.isLink&&(!e||l.t===e)&&r.check(l)&&i.push(l.toFormattedObject(r))}return i}var da="[\0-   ᠎ -\u2029  ]",DC=new RegExp(da),OC=new RegExp(`${da}$`),LC=new RegExp(da,"g");function RC(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function BC(t){return new Ne({key:new Re("autolink"),appendTransaction:(e,n,r)=>{const s=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,l=dh(n.doc,[...e]);if(bh(l).forEach(({newRange:c})=>{const u=E_(r.doc,c,p=>p.isTextblock);let h,f;if(u.length>1)h=u[0],f=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(u.length){const p=r.doc.textBetween(c.from,c.to," "," ");if(!OC.test(p))return;h=u[0],f=r.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&f){const p=f.split(DC).filter(Boolean);if(p.length<=0)return!1;const m=p[p.length-1],g=h.pos+f.lastIndexOf(m);if(!m)return!1;const b=ca(m).map(y=>y.toObject(t.defaultProtocol));if(!RC(b))return!1;b.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{Yl(y.from,y.to,r.doc).some(v=>v.mark.type===t.type)||o.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!o.steps.length)return o}})}function $C(t){return new Ne({key:new Re("handleClickLink"),props:{handleClick:(e,n,r)=>{var s,i;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const a=r.target;if(!a)return!1;const c=t.editor.view.dom;o=a.closest("a"),o&&!c.contains(o)&&(o=null)}if(!o)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const a=gh(e.state,t.type.name),c=(s=o.href)!=null?s:a.href,u=(i=o.target)!=null?i:a.target;c&&(window.open(c,u),l=!0)}return l}}})}function PC(t){return new Ne({key:new Re("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:s}=t,{state:i}=e,{selection:o}=i,{empty:l}=o;if(l)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const c=Zh(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!c||s!==void 0&&!s(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function jn(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&n.push(s)}),!t||t.replace(LC,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var ef=Kt.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(t=>{if(typeof t=="string"){ed(t);return}ed(t.scheme,t.optionalSlashes)})},onDestroy(){jC()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!jn(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const s=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(s)||!/\./.test(s))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!jn(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!jn(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ye(this.options.HTMLAttributes,t),0]:["a",ye(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,s,i;const o=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",l=(i=(s=t.attrs)==null?void 0:s.title)!=null?i:"",a=e.renderChildren(t);return l?`[${a}](${o} "${l}")`:`[${a}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!jn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!jn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Nn({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,s=Zh(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!jn(o,n),protocols:n,defaultProtocol:r}));s.length&&s.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(BC({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!jn(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push($C({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(PC({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),zC=ef,FC=Object.defineProperty,HC=(t,e)=>{for(var n in e)FC(t,n,{get:e[n],enumerable:!0})},WC="listItem",td="textStyle",nd=/^\s*([-+*])\s$/,tf=lt.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:t}){return["ul",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
164
- `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(WC,this.editor.getAttributes(td)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=vr({find:nd,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=vr({find:nd,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(td),editor:this.editor})),[t]}});function VC(t){var e,n;const r=(e=t.tokens)==null?void 0:e[0];return!!(t.text&&((n=t.tokens)==null?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===t.text)}function UC(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var nf=lt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let s=[];if(t.tokens&&t.tokens.length>0){if(VC(t))return{type:"listItem",content:[{type:"paragraph",content:UC(t.text||"",e)}]};if(t.tokens.some(o=>o.type==="paragraph"))s=r(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(s=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const a=t.tokens.slice(1),c=r(a);s.push(...c)}}else s=r(t.tokens)}}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(t,e,n)=>ea(t,e,r=>{var s,i;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((i=(s=r.meta)==null?void 0:s.parentAttrs)==null?void 0:i.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),qC={};HC(qC,{findListItemPos:()=>vs,getNextListDepth:()=>ua,handleBackspace:()=>kl,handleDelete:()=>wl,hasListBefore:()=>rf,hasListItemAfter:()=>KC,hasListItemBefore:()=>sf,listItemHasSubList:()=>of,nextListIsDeeper:()=>lf,nextListIsHigher:()=>af});var vs=(t,e)=>{const{$from:n}=e.selection,r=He(t,e.schema);let s=null,i=n.depth,o=n.pos,l=null;for(;i>0&&l===null;)s=n.node(i),s.type===r?l=i:(i-=1,o-=1);return l===null?null:{$pos:e.doc.resolve(o),depth:l}},ua=(t,e)=>{const n=vs(t,e);if(!n)return!1;const[,r]=z_(e,t,n.$pos.pos+4);return r},rf=(t,e,n)=>{const{$anchor:r}=t.selection,s=Math.max(0,r.pos-2),i=t.doc.resolve(s).node();return!(!i||!n.includes(i.type.name))},sf=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-2);return!(s.index()===0||((n=s.nodeBefore)==null?void 0:n.type.name)!==t)},of=(t,e,n)=>{if(!n)return!1;const r=He(t,e.schema);let s=!1;return n.descendants(i=>{i.type===r&&(s=!0)}),s},kl=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Sn(t.state,e)&&rf(t.state,e,n)){const{$anchor:l}=t.state.selection,a=t.state.doc.resolve(l.before()-1),c=[];a.node().descendants((f,p)=>{f.type.name===e&&c.push({node:f,pos:p})});const u=c.at(-1);if(!u)return!1;const h=t.state.doc.resolve(a.start()+u.pos+1);return t.chain().cut({from:l.start()-1,to:l.end()+1},h.end()).joinForward().run()}if(!Sn(t.state,e)||!V_(t.state))return!1;const r=vs(e,t.state);if(!r)return!1;const i=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=of(e,t.state,i);return sf(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},lf=(t,e)=>{const n=ua(t,e),r=vs(t,e);return!r||!n?!1:n>r.depth},af=(t,e)=>{const n=ua(t,e),r=vs(t,e);return!r||!n?!1:n<r.depth},wl=(t,e)=>{if(!Sn(t.state,e)||!W_(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:lf(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():af(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},KC=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-r.parentOffset-2);return!(s.index()===s.parent.childCount-1||((n=s.nodeAfter)==null?void 0:n.type.name)!==t)},cf=je.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&wl(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&wl(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&kl(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&kl(t,n,r)&&(e=!0)}),e}}}}),rd=/^(\s*)(\d+)\.\s+(.*)$/,GC=/^\s/;function JC(t){const e=t.trimStart();return/^[-+*]\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)||/^~~~/.test(e)}function YC(t){const e=[],n=[];let r=!1;return t.forEach(s=>{if(r){n.push(s);return}if(s.trim()===""){r=!0,n.push(s);return}if(e.length>0&&JC(s)){r=!0,n.push(s);return}e.push(s)}),{paragraphLines:e,blockLines:n}}function QC(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n],i=s.match(rd);if(!i)break;const[,o,l,a]=i,c=o.length,u=[a];let h=n+1;const f=[s];let p=!1;for(;h<t.length;){const m=t[h];if(m.match(rd))break;if(m.trim()==="")f.push(m),u.push(""),p=!0,h+=1;else if(m.match(GC))f.push(m),u.push(m.slice(c+2)),h+=1;else{if(p)break;f.push(m),u.push(m),h+=1}}e.push({indent:c,number:parseInt(l,10),content:u.join(`
163
+ 3. "-" cannot repeat`);ke.customSchemes.push([t,e])}function VC(){ke.scanner=LC(ke.customSchemes);for(let t=0;t<ke.tokenQueue.length;t++)ke.tokenQueue[t][1]({scanner:ke.scanner});ke.parser=PC(ke.scanner.tokens);for(let t=0;t<ke.pluginQueue.length;t++)ke.pluginQueue[t][1]({scanner:ke.scanner,parser:ke.parser});return ke.initialized=!0,ke}function ua(t){return ke.initialized||VC(),zC(ke.parser.start,t,Zh(ke.scanner.start,t))}ua.scan=Zh;function tf(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new da(n),s=ua(t),i=[];for(let o=0;o<s.length;o++){const l=s[o];l.isLink&&(!e||l.t===e)&&r.check(l)&&i.push(l.toFormattedObject(r))}return i}var ha="[\0-   ᠎ -\u2029  ]",UC=new RegExp(ha),qC=new RegExp(`${ha}$`),KC=new RegExp(ha,"g");function GC(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function JC(t){return new Ne({key:new Re("autolink"),appendTransaction:(e,n,r)=>{const s=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,l=hh(n.doc,[...e]);if(xh(l).forEach(({newRange:c})=>{const u=Fv(r.doc,c,p=>p.isTextblock);let h,f;if(u.length>1)h=u[0],f=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(u.length){const p=r.doc.textBetween(c.from,c.to," "," ");if(!qC.test(p))return;h=u[0],f=r.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&f){const p=f.split(UC).filter(Boolean);if(p.length<=0)return!1;const m=p[p.length-1],g=h.pos+f.lastIndexOf(m);if(!m)return!1;const b=ua(m).map(y=>y.toObject(t.defaultProtocol));if(!GC(b))return!1;b.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{Xl(y.from,y.to,r.doc).some(_=>_.mark.type===t.type)||o.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!o.steps.length)return o}})}function YC(t){return new Ne({key:new Re("handleClickLink"),props:{handleClick:(e,n,r)=>{var s,i;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const a=r.target;if(!a)return!1;const c=t.editor.view.dom;o=a.closest("a"),o&&!c.contains(o)&&(o=null)}if(!o)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const a=yh(e.state,t.type.name),c=(s=o.href)!=null?s:a.href,u=(i=o.target)!=null?i:a.target;c&&(window.open(c,u),l=!0)}return l}}})}function QC(t){return new Ne({key:new Re("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:s}=t,{state:i}=e,{selection:o}=i,{empty:l}=o;if(l)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const c=tf(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!c||s!==void 0&&!s(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function jn(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&n.push(s)}),!t||t.replace(KC,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var nf=Kt.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(t=>{if(typeof t=="string"){nd(t);return}nd(t.scheme,t.optionalSlashes)})},onDestroy(){WC()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!jn(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const s=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(s)||!/\./.test(s))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!jn(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!jn(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ye(this.options.HTMLAttributes,t),0]:["a",ye(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,s,i;const o=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",l=(i=(s=t.attrs)==null?void 0:s.title)!=null?i:"",a=e.renderChildren(t);return l?`[${a}](${o} "${l}")`:`[${a}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!jn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!jn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Nn({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,s=tf(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!jn(o,n),protocols:n,defaultProtocol:r}));s.length&&s.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(JC({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!jn(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(YC({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(QC({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),XC=nf,ZC=Object.defineProperty,eS=(t,e)=>{for(var n in e)ZC(t,n,{get:e[n],enumerable:!0})},tS="listItem",rd="textStyle",sd=/^\s*([-+*])\s$/,rf=lt.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:t}){return["ul",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
164
+ `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(tS,this.editor.getAttributes(rd)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=_r({find:sd,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=_r({find:sd,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(rd),editor:this.editor})),[t]}});function nS(t){var e,n;const r=(e=t.tokens)==null?void 0:e[0];return!!(t.text&&((n=t.tokens)==null?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===t.text)}function rS(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var sf=lt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let s=[];if(t.tokens&&t.tokens.length>0){if(nS(t))return{type:"listItem",content:[{type:"paragraph",content:rS(t.text||"",e)}]};if(t.tokens.some(o=>o.type==="paragraph"))s=r(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(s=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const a=t.tokens.slice(1),c=r(a);s.push(...c)}}else s=r(t.tokens)}}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(t,e,n)=>na(t,e,r=>{var s,i;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((i=(s=r.meta)==null?void 0:s.parentAttrs)==null?void 0:i.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),sS={};eS(sS,{findListItemPos:()=>vs,getNextListDepth:()=>fa,handleBackspace:()=>Cl,handleDelete:()=>Sl,hasListBefore:()=>of,hasListItemAfter:()=>iS,hasListItemBefore:()=>lf,listItemHasSubList:()=>af,nextListIsDeeper:()=>cf,nextListIsHigher:()=>df});var vs=(t,e)=>{const{$from:n}=e.selection,r=He(t,e.schema);let s=null,i=n.depth,o=n.pos,l=null;for(;i>0&&l===null;)s=n.node(i),s.type===r?l=i:(i-=1,o-=1);return l===null?null:{$pos:e.doc.resolve(o),depth:l}},fa=(t,e)=>{const n=vs(t,e);if(!n)return!1;const[,r]=Xv(e,t,n.$pos.pos+4);return r},of=(t,e,n)=>{const{$anchor:r}=t.selection,s=Math.max(0,r.pos-2),i=t.doc.resolve(s).node();return!(!i||!n.includes(i.type.name))},lf=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-2);return!(s.index()===0||((n=s.nodeBefore)==null?void 0:n.type.name)!==t)},af=(t,e,n)=>{if(!n)return!1;const r=He(t,e.schema);let s=!1;return n.descendants(i=>{i.type===r&&(s=!0)}),s},Cl=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Sn(t.state,e)&&of(t.state,e,n)){const{$anchor:l}=t.state.selection,a=t.state.doc.resolve(l.before()-1),c=[];a.node().descendants((f,p)=>{f.type.name===e&&c.push({node:f,pos:p})});const u=c.at(-1);if(!u)return!1;const h=t.state.doc.resolve(a.start()+u.pos+1);return t.chain().cut({from:l.start()-1,to:l.end()+1},h.end()).joinForward().run()}if(!Sn(t.state,e)||!nk(t.state))return!1;const r=vs(e,t.state);if(!r)return!1;const i=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=af(e,t.state,i);return lf(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},cf=(t,e)=>{const n=fa(t,e),r=vs(t,e);return!r||!n?!1:n>r.depth},df=(t,e)=>{const n=fa(t,e),r=vs(t,e);return!r||!n?!1:n<r.depth},Sl=(t,e)=>{if(!Sn(t.state,e)||!tk(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:cf(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():df(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},iS=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-r.parentOffset-2);return!(s.index()===s.parent.childCount-1||((n=s.nodeAfter)==null?void 0:n.type.name)!==t)},uf=je.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Sl(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Sl(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&Cl(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&Cl(t,n,r)&&(e=!0)}),e}}}}),id=/^(\s*)(\d+)\.\s+(.*)$/,oS=/^\s/;function lS(t){const e=t.trimStart();return/^[-+*]\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)||/^~~~/.test(e)}function aS(t){const e=[],n=[];let r=!1;return t.forEach(s=>{if(r){n.push(s);return}if(s.trim()===""){r=!0,n.push(s);return}if(e.length>0&&lS(s)){r=!0,n.push(s);return}e.push(s)}),{paragraphLines:e,blockLines:n}}function cS(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n],i=s.match(id);if(!i)break;const[,o,l,a]=i,c=o.length,u=[a];let h=n+1;const f=[s];let p=!1;for(;h<t.length;){const m=t[h];if(m.match(id))break;if(m.trim()==="")f.push(m),u.push(""),p=!0,h+=1;else if(m.match(oS))f.push(m),u.push(m.slice(c+2)),h+=1;else{if(p)break;f.push(m),u.push(m),h+=1}}e.push({indent:c,number:parseInt(l,10),content:u.join(`
165
165
  `).trim(),contentLines:u,raw:f.join(`
166
- `)}),r=h,n=h}return[e,r]}function df(t,e,n){const r=[];let s=0;for(;s<t.length;){const i=t[s];if(i.indent===e){const{paragraphLines:o,blockLines:l}=YC(i.contentLines),a=o.join(`
166
+ `)}),r=h,n=h}return[e,r]}function hf(t,e,n){const r=[];let s=0;for(;s<t.length;){const i=t[s];if(i.indent===e){const{paragraphLines:o,blockLines:l}=aS(i.contentLines),a=o.join(`
167
167
  `).trim(),c=[];a&&c.push({type:"paragraph",raw:a,tokens:n.inlineTokens(a)});const u=l.join(`
168
- `).trim();if(u){const p=n.blockTokens(u);c.push(...p)}let h=s+1;const f=[];for(;h<t.length&&t[h].indent>e;)f.push(t[h]),h+=1;if(f.length>0){const p=Math.min(...f.map(g=>g.indent)),m=df(f,p,n);c.push({type:"list",ordered:!0,start:f[0].number,items:m,raw:f.map(g=>g.raw).join(`
169
- `)})}r.push({type:"list_item",raw:i.raw,tokens:c}),s=h}else s+=1}return r}function XC(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")r.push(...e.parseChildren([s]));else if(s.type==="text"&&s.tokens){const i=e.parseChildren([s]);r.push({type:"paragraph",content:i})}else{const i=e.parseChildren([s]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var ZC="listItem",sd="textStyle",id=/^(\d+)\.\s$/,uf=lt.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:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ye(this.options.HTMLAttributes,n),0]:["ol",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?XC(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
168
+ `).trim();if(u){const p=n.blockTokens(u);c.push(...p)}let h=s+1;const f=[];for(;h<t.length&&t[h].indent>e;)f.push(t[h]),h+=1;if(f.length>0){const p=Math.min(...f.map(g=>g.indent)),m=hf(f,p,n);c.push({type:"list",ordered:!0,start:f[0].number,items:m,raw:f.map(g=>g.raw).join(`
169
+ `)})}r.push({type:"list_item",raw:i.raw,tokens:c}),s=h}else s+=1}return r}function dS(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")r.push(...e.parseChildren([s]));else if(s.type==="text"&&s.tokens){const i=e.parseChildren([s]);r.push({type:"paragraph",content:i})}else{const i=e.parseChildren([s]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var uS="listItem",od="textStyle",ld=/^(\d+)\.\s$/,ff=lt.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:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ye(this.options.HTMLAttributes,n),0]:["ol",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?dS(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
170
170
  `):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const s=t.split(`
171
- `),[i,o]=QC(s);if(i.length===0)return;const l=df(i,0,n);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:l,raw:s.slice(0,o).join(`
172
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ZC,this.editor.getAttributes(sd)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=vr({find:id,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=vr({find:id,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(sd)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),eS=/^\s*(\[([( |x])?\])\s$/,hf=lt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",ye(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const s=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return ea(t,e,s)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=h=>{var f,p;l.ariaLabel=((p=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:p.call(f,h,l.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};c(t),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const m=n();if(typeof m!="number")return!1;const g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g==null?void 0:g.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,f])=>{s.setAttribute(h,f)}),s.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,i.append(l,o),s.append(i,a),Object.entries(e).forEach(([h,f])=>{s.setAttribute(h,f)});let u=new Set(Object.keys(e));return{dom:s,contentDOM:a,update:h=>{if(h.type!==this.type)return!1;s.dataset.checked=h.attrs.checked,l.checked=h.attrs.checked,c(h);const f=r.extensionManager.attributes,p=ds(h,f),m=new Set(Object.keys(p)),g=this.options.HTMLAttributes;return u.forEach(b=>{m.has(b)||(b in g?s.setAttribute(b,g[b]):s.removeAttribute(b))}),Object.entries(p).forEach(([b,y])=>{y==null?b in g?s.setAttribute(b,g[b]):s.removeAttribute(b):s.setAttribute(b,y)}),u=m,!0}}}},addInputRules(){return[vr({find:eS,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),ff=lt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",ye(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
173
- `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=i=>{const o=hl(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(i)},s=hl(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});je.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(tf.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(nf.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(cf.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(uf.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(hf.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(ff.configure(this.options.taskList)),t}});var Ps="&nbsp;",Po=" ",tS=lt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ye(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===Ps||n[0].text===Ps||n[0].raw===Po||n[0].text===Po)&&r.length===1&&r[0].type==="text"&&(r[0].text===Ps||r[0].text===Po)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,s;if(!t)return"";const i=Array.isArray(t.content)?t.content:[];if(i.length===0){const o=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((s=n==null?void 0:n.previousNode)==null?void 0:s.type)==="paragraph"&&o.length===0?Ps:""}return e.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),nS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,rS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,sS=Kt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Zn({find:nS,type:this.type})]},addPasteRules(){return[Nn({find:rS,type:this.type})]}}),iS=lt.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),pf=Kt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ye(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),oS=pf;function lS(t={}){return new Ne({view(e){return new aS(e,t)}})}class aS{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):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),n=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,l=i.height/s.offsetHeight;if(n){let h=e.nodeBefore,f=e.nodeAfter;if(h||f){let p=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=h?m.bottom:m.top;h&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*l;r={left:m.left,right:m.right,top:g-b,bottom:g+b}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:h.left-f,right:h.left+f,top:h.top,bottom:h.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let h=a.getBoundingClientRect(),f=h.width/a.offsetWidth,p=h.height/a.offsetHeight;c=h.left-a.scrollLeft*f,u=h.top-a.scrollTop*p}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,e):s;if(n&&!i){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=eu(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Me extends ie{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Me.valid(r)?new Me(r):ie.near(r)}content(){return F.empty}eq(e){return e instanceof Me&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Me(e.resolve(n.pos))}getBookmark(){return new ha(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!cS(e)||!dS(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Me.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(n>0?e.indexAfter(o)<l.childCount:e.index(o)>0){i=l.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=n;let a=e.doc.resolve(s);if(Me.valid(a))return a}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!J.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let l=e.doc.resolve(s);if(Me.valid(l))return l}return null}}}Me.prototype.visible=!1;Me.findFrom=Me.findGapCursorFrom;ie.jsonID("gapcursor",Me);class ha{constructor(e){this.pos=e}map(e){return new ha(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Me.valid(n)?new Me(n):ie.near(n)}}function mf(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function cS(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||mf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function dS(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||mf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function uS(){return new Ne({props:{decorations:mS,createSelectionBetween(t,e,n){return e.pos==n.pos&&Me.valid(n)?new Me(n):null},handleClick:fS,handleKeyDown:hS,handleDOMEvents:{beforeinput:pS}}})}const hS=nh({ArrowLeft:zs("horiz",-1),ArrowRight:zs("horiz",1),ArrowUp:zs("vert",-1),ArrowDown:zs("vert",1)});function zs(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof Q){if(!i.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Me.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new Me(c))),!0):!1}}function fS(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Me.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&J.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Me(r))),!0)}function pS(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Me))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let s=j.empty;for(let o=r.length-1;o>=0;o--)s=j.from(r[o].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new F(s,0,0));return i.setSelection(Q.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function mS(t){if(!(t.selection instanceof Me))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Se.create(t.doc,[tt.widget(t.selection.head,e,{key:"gapcursor"})])}var Bi=200,qe=function(){};qe.prototype.append=function(e){return e.length?(e=qe.from(e),!this.length&&e||e.length<Bi&&this.leafAppend(e)||this.length<Bi&&e.leafPrepend(this)||this.appendInner(e)):this};qe.prototype.prepend=function(e){return e.length?qe.from(e).append(this):this};qe.prototype.appendInner=function(e){return new gS(this,e)};qe.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?qe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};qe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};qe.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};qe.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},n,r),s};qe.from=function(e){return e instanceof qe?e:e&&e.length?new gf(e):qe.empty};var gf=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,l){for(var a=i;a<o;a++)if(s(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,o,l){for(var a=i-1;a>=o;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=Bi)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=Bi)return new e(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qe);qe.empty=new gf([]);var gS=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,s,i,o){var l=this.left.length;if(s<l&&this.left.forEachInner(r,s,Math.min(i,l),o)===!1||i>l&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(i,l)-l,o+l)===!1||i<l&&this.left.forEachInvertedInner(r,Math.min(s,l),i,o)===!1)return!1},e.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(qe);const bS=500;class Ot{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,l,a,c=[],u=[];return this.items.forEach((h,f)=>{if(!h.step){s||(s=this.remapping(r,f+1),i=s.maps.length),i--,u.push(h);return}if(s){u.push(new Wt(h.map));let p=h.step.map(s.slice(i)),m;p&&o.maybeStep(p).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],c.push(new Wt(m,void 0,void 0,c.length+u.length))),i--,m&&s.appendMap(m,i)}else o.maybeStep(h.step);if(h.selection)return l=s?h.selection.map(s.slice(i)):h.selection,a=new Ot(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,n,r,s){let i=[],o=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let h=e.steps[u].invert(e.docs[u]),f=new Wt(e.mapping.maps[u],h,n),p;(p=a&&a.merge(f))&&(f=p,u?i.pop():l=l.slice(0,l.length-1)),i.push(f),n&&(o++,n=void 0),s||(a=f)}let c=o-r.depth;return c>xS&&(l=yS(l,c),o-=c),new Ot(l.append(i),o)}remapping(e,n){let r=new rs;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ot(this.items.append(e.map(n=>new Wt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},s);let a=n;this.items.forEach(f=>{let p=i.getMirror(--a);if(p==null)return;o=Math.min(o,p);let m=i.maps[p];if(f.step){let g=e.steps[p].invert(e.docs[p]),b=f.selection&&f.selection.map(i.slice(a+1,p));b&&l++,r.push(new Wt(m,g,b))}else r.push(new Wt(m))},s);let c=[];for(let f=n;f<o;f++)c.push(new Wt(i.maps[f]));let u=this.items.slice(0,s).append(c).append(r),h=new Ot(u,l);return h.emptyItemCount()>bS&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,s=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)s.push(o),o.selection&&i++;else if(o.step){let a=o.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let u=o.selection&&o.selection.map(n.slice(r));u&&i++;let h=new Wt(c.invert(),a,u),f,p=s.length-1;(f=s.length&&s[p].merge(h))?s[p]=f:s.push(h)}}else o.map&&r--},this.items.length,0),new Ot(qe.from(s.reverse()),i)}}Ot.empty=new Ot(qe.empty,0);function yS(t,e){let n;return t.forEach((r,s)=>{if(r.selection&&e--==0)return n=s,!1}),t.slice(n)}class Wt{constructor(e,n,r,s){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Wt(n.getMap().invert(),n,this.selection)}}}class mn{constructor(e,n,r,s,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const xS=20;function vS(t,e,n,r){let s=n.getMeta(Kn),i;if(s)return s.historyState;n.getMeta(wS)&&(t=new mn(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Kn))return o.getMeta(Kn).redo?new mn(t.done.addTransform(n,void 0,r,Ks(e)),t.undone,od(n.mapping.maps),t.prevTime,t.prevComposition):new mn(t.done,t.undone.addTransform(n,void 0,r,Ks(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!o&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!_S(n,t.prevRanges)),c=o?zo(t.prevRanges,n.mapping):od(n.mapping.maps);return new mn(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,Ks(e)),Ot.empty,c,n.time,l??t.prevComposition)}else return(i=n.getMeta("rebased"))?new mn(t.done.rebased(n,i),t.undone.rebased(n,i),zo(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new mn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),zo(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function _S(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&s>=e[i]&&(n=!0)}),n}function od(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,s,i,o)=>e.push(i,o));return e}function zo(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let s=e.map(t[r],1),i=e.map(t[r+1],-1);s<=i&&n.push(s,i)}return n}function kS(t,e,n){let r=Ks(e),s=Kn.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let o=i.selection.resolve(i.transform.doc),l=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),s,r),a=new mn(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(o).setMeta(Kn,{redo:n,historyState:a})}let Fo=!1,ld=null;function Ks(t){let e=t.plugins;if(ld!=e){Fo=!1,ld=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Fo=!0;break}}return Fo}const Kn=new Re("history"),wS=new Re("closeHistory");function CS(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ne({key:Kn,state:{init(){return new mn(Ot.empty,Ot.empty,null,0,-1)},apply(e,n,r){return vS(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,s=r=="historyUndo"?yf:r=="historyRedo"?xf:null;return!s||!e.editable?!1:(n.preventDefault(),s(e.state,e.dispatch))}}}})}function bf(t,e){return(n,r)=>{let s=Kn.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(r){let i=kS(s,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const yf=bf(!1,!0),xf=bf(!0,!0);je.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ne({key:new Re("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){t=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const l=o-s,a=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,a=i-r,c=l-a,u=l;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var SS=je.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[lS(this.options)]}});je.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ne({key:new Re("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!n||!r)return Se.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((a,c)=>{if(a.isText)return;if(!(s>=c&&s<=c+a.nodeSize-1))return!1;o+=1});let l=0;return t.descendants((a,c)=>{if(a.isText||!(s>=c&&s<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(tt.node(c,c+a.nodeSize,{class:this.options.className}))}),Se.create(t,i)}}})]}});var NS=je.create({name:"gapCursor",addProseMirrorPlugins(){return[uS()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=me(K(t,"allowGapCursor",n)))!=null?e:null}}}),vf="placeholder",ps=new Re("tiptap__placeholder"),ad=200;function cd(t){const{editor:e,placeholder:n,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=t,u=[a];return o&&u.push(c),tt.node(s,s+i.nodeSize,{class:u.join(" "),[r]:typeof n=="function"?n({editor:e,node:i,pos:s,hasAnchor:l}):n})}function AS({editor:t,options:e,dataAttribute:n,doc:r,selection:s}){var i,o;if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:a}=s,c=[],u=t.isEmpty,h={emptyEditor:e.emptyEditorClass,emptyNode:e.emptyNodeClass};if(e.showOnlyCurrent&&!e.includeChildren){const p=r.resolve(a),m=p.depth>0?p.node(1):p.nodeAfter,g=p.depth>0?p.before(1):a;if(m&&m.type.isTextblock&&us(m)){const b=a>=g&&a<=g+m.nodeSize;c.push(cd({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:b,placeholder:e.placeholder,classes:h,node:m,pos:g}))}}else{const p=ps.getState(t.state),m=(i=p==null?void 0:p.topPos)!=null?i:0,g=(o=p==null?void 0:p.bottomPos)!=null?o:r.content.size;r.nodesBetween(m,g,(b,y)=>{const v=a>=y&&a<=y+b.nodeSize,_=!b.isLeaf&&us(b);return b.type.isTextblock&&(v||!e.showOnlyCurrent)&&_&&c.push(cd({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:v,placeholder:e.placeholder,classes:h,node:b,pos:y})),e.includeChildren})}return Se.create(r,c)}function TS(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function ES(t){const e=getComputedStyle(t),n=`${e.overflow} ${e.overflowY} ${e.overflowX}`;return/auto|scroll|overlay/.test(n)}function MS(t){let e=t;for(;e;){if(ES(e))return e;const n=e.parentElement;if(!n){const r=e.getRootNode();if(r instanceof ShadowRoot){e=r.host;continue}return window}e=n}return window}function jS(t){return t===window?{top:0,bottom:window.innerHeight}:t.getBoundingClientRect()}function IS({doc:t,view:e,scrollContainer:n}){const r=e.dom.getBoundingClientRect(),s=n?jS(n):{top:0,bottom:window.innerHeight},i=Math.max(r.top,s.top)-ad,o=Math.min(r.bottom,s.bottom)+ad;if(i>=o)return{top:0,bottom:t.content.size};const a=getComputedStyle(e.dom).direction==="rtl"?Math.max(r.right-2,r.left+2):r.left+2,c=e.posAtCoords({left:a,top:i+2}),u=e.posAtCoords({left:a,top:o-2});return{top:c?c.pos:0,bottom:u?u.pos:t.content.size}}var DS={init(){return{topPos:null,bottomPos:null}},apply(t,e){const n=t.getMeta(ps);return n!=null&&n.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:t.docChanged?{topPos:e.topPos!==null?t.mapping.map(e.topPos):null,bottomPos:e.bottomPos!==null?t.mapping.map(e.bottomPos):null}:e}};function OS(t){const e=MS(t.dom),n=()=>{const l=IS({view:t,doc:t.state.doc,scrollContainer:e}),a=ps.getState(t.state);if((a==null?void 0:a.topPos)===l.top&&(a==null?void 0:a.bottomPos)===l.bottom)return;const c=t.state.tr.setMeta(ps,{positions:l});t.dispatch(c)};let r=null,s=0;const i=150,o=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;const l=performance.now();l-s>=i?(s=l,n()):o()}))};return e.addEventListener("scroll",o,{passive:!0}),n(),{update(l,a){t.state.doc.content.size!==a.doc.content.size&&o()},destroy:()=>{r!==null&&cancelAnimationFrame(r),e.removeEventListener("scroll",o)}}}function LS({editor:t,options:e}){const n=e.dataAttribute?`data-${TS(e.dataAttribute)}`:`data-${vf}`;return new Ne({key:ps,state:DS,view:OS,props:{decorations:({doc:r,selection:s})=>AS({editor:t,options:e,dataAttribute:n,doc:r,selection:s})}})}var RS=je.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:vf,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[LS({editor:this.editor,options:this.options})]}});je.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ne({key:new Re("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||yh(n.selection)||t.view.dragging?null:Se.create(n.doc,[tt.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});var BS="skipTrailingNode";function dd({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var $S=je.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Re(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new Ne({key:e,appendTransaction:(s,i,o)=>{const{doc:l,tr:a,schema:c}=o,u=e.getState(o),h=l.content.size,f=c.nodes[n];if(!s.some(p=>p.getMeta(BS))&&u)return a.insert(h,f.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!dd({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!dd({node:o,types:r})}}})]}}),PS=je.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>yf(t,e),redo:()=>({state:t,dispatch:e})=>xf(t,e)}},addProseMirrorPlugins(){return[CS(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()}}}),zS=je.create({name:"starterKit",addExtensions(){var t,e,n,r;const s=[];return this.options.bold!==!1&&s.push(Zw.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(Gw.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(tf.configure(this.options.bulletList)),this.options.code!==!1&&s.push(nC.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(iC.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(oC.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(SS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(NS.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(lC.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(aC.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(PS.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(cC.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(pC.configure(this.options.italic)),this.options.listItem!==!1&&s.push(nf.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(cf.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&s.push(ef.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(uf.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(tS.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(sS.configure(this.options.strike)),this.options.text!==!1&&s.push(iS.configure(this.options.text)),this.options.underline!==!1&&s.push(pf.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push($S.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),FS=zS,HS=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,WS=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,VS=Kt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||Ok(t,"background-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ye(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){const s=/^(==)([^=]+)(==)/.exec(t);if(s){const i=s[2].trim(),o=n.inlineTokens(i);return{type:"highlight",raw:s[0],text:i,tokens:o}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Zn({find:HS,type:this.type})]},addPasteRules(){return[Nn({find:WS,type:this.type})]}}),US=VS,qS=Kt.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),KS=qS,GS=Kt.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),JS=GS,YS=je.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),QS=YS,XS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,ZS=lt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ye(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,o;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",a=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",c=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return c?`![${a}](${l} "${c}")`:`![${a}](${l})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:l})=>{const a=document.createElement("img");Object.entries(o).forEach(([h,f])=>{if(f!=null)switch(h){case"width":case"height":break;default:a.setAttribute(h,f);break}}),a.src=o.src;const c=new jk({element:a,editor:l,node:s,getPos:i,onResize:(h,f)=>{a.style.width=`${h}px`,a.style.height=`${f}px`},onCommit:(h,f)=>{const p=i();p!==void 0&&this.editor.chain().setNodeSelection(p).updateAttributes(this.name,{width:h,height:f}).run()},onUpdate:(h,f,p)=>h.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),u=c.dom;return u.style.visibility="hidden",u.style.pointerEvents="none",a.onload=()=>{u.style.visibility="",u.style.pointerEvents=""},c}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Lh({find:XS,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),eN=ZS;function tN(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=t,a=r&&!s,c=Dk(n),u=new RegExp(`\\s${c}$`),h=o?"^":"",f=s?"":c,p=a?new RegExp(`${h}${c}.*?(?=\\s${f}|$)`,"gm"):new RegExp(`${h}(?:^)?${c}[^\\s${f}]*`,"gm"),m=((e=l.nodeBefore)==null?void 0:e.isText)&&l.nodeBefore.text;if(!m)return null;const g=l.pos-m.length,b=Array.from(m.matchAll(p)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const y=b.input.slice(Math.max(0,b.index-1),b.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!v)return null;const _=g+b.index;let w=_+b[0].length;return a&&u.test(m.slice(w-1,w+1))&&(b[0]+=" ",w+=1),_<l.pos&&w>=l.pos?{range:{from:_,to:w},query:b[0].slice(n.length),text:b[0]}:null}function nN(t){return t.docChanged?t.steps.some(e=>{const n=e.slice;if(!(n!=null&&n.content))return!1;const r=n.content.textBetween(0,n.content.size,`
174
- `);return/\s/.test(r)}):!1}var rN=new Re("suggestion");function sN({pluginKey:t=rN,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:a="suggestion",decorationContent:c="",decorationEmptyClass:u="is-empty",command:h=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=tN,shouldShow:b,shouldResetDismissed:y}){let v;const _=p==null?void 0:p(),w=r&&!s,k=()=>{const N=e.state.selection.$anchor.pos,T=e.view.coordsAtPos(N),{top:$,right:R,bottom:L,left:U}=T;try{return new DOMRect(U,$,R-U,L-$)}catch{return null}},S=(N,T)=>T?()=>{const $=t.getState(e.state),R=$==null?void 0:$.decorationId,L=N.dom.querySelector(`[data-decoration-id="${R}"]`);return(L==null?void 0:L.getBoundingClientRect())||null}:k,C=({match:N,dismissedRange:T,state:$,transaction:R})=>y!=null&&y({editor:e,state:$,range:T,match:N,transaction:R,allowSpaces:w})?!1:w?N.range.from===T.from:N.range.from===T.from&&!nN(R);function D(N,T){var $;try{const L=t.getState(N.state),U=L!=null&&L.decorationId?N.dom.querySelector(`[data-decoration-id="${L.decorationId}"]`):null,V={editor:e,range:(L==null?void 0:L.range)||{from:0,to:0},query:(L==null?void 0:L.query)||null,text:(L==null?void 0:L.text)||null,items:[],command:M=>h({editor:e,range:(L==null?void 0:L.range)||{from:0,to:0},props:M}),decorationNode:U,clientRect:S(N,U)};($=_==null?void 0:_.onExit)==null||$.call(_,V)}catch{}const R=N.state.tr.setMeta(T,{exit:!0});N.dispatch(R)}const B=new Ne({key:t,view(){return{update:async(N,T)=>{var $,R,L,U,V,M,P;const H=($=this.key)==null?void 0:$.getState(T),oe=(R=this.key)==null?void 0:R.getState(N.state),ae=H.active&&oe.active&&H.range.from!==oe.range.from,Ae=!H.active&&oe.active,Ie=H.active&&!oe.active,Be=!Ae&&!Ie&&H.query!==oe.query,A=Ae||ae&&Be,q=Be||ae,re=Ie||ae&&Be;if(!A&&!q&&!re)return;const xe=re&&!A?H:oe,$e=N.dom.querySelector(`[data-decoration-id="${xe.decorationId}"]`);v={editor:e,range:xe.range,query:xe.query,text:xe.text,items:[],command:Bt=>h({editor:e,range:xe.range,props:Bt}),decorationNode:$e,clientRect:S(N,$e)},A&&((L=_==null?void 0:_.onBeforeStart)==null||L.call(_,v)),q&&((U=_==null?void 0:_.onBeforeUpdate)==null||U.call(_,v)),(q||A)&&(v.items=await f({editor:e,query:xe.query})),re&&((V=_==null?void 0:_.onExit)==null||V.call(_,v)),q&&((M=_==null?void 0:_.onUpdate)==null||M.call(_,v)),A&&((P=_==null?void 0:_.onStart)==null||P.call(_,v))},destroy:()=>{var N;v&&((N=_==null?void 0:_.onExit)==null||N.call(_,v))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(N,T,$,R){const{isEditable:L}=e,{composing:U}=e.view,{selection:V}=N,{empty:M,from:P}=V,H={...T},oe=N.getMeta(t);if(oe&&oe.exit)return H.active=!1,H.decorationId=null,H.range={from:0,to:0},H.query=null,H.text=null,H.dismissedRange=T.active?{...T.range}:T.dismissedRange,H;if(H.composing=U,N.docChanged&&H.dismissedRange!==null&&(H.dismissedRange={from:N.mapping.map(H.dismissedRange.from),to:N.mapping.map(H.dismissedRange.to)}),L&&(M||e.view.composing)){(P<T.range.from||P>T.range.to)&&!U&&!T.composing&&(H.active=!1);const ae=g({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:V.$from}),Ae=`id_${Math.floor(Math.random()*4294967295)}`;ae&&m({editor:e,state:R,range:ae.range,isActive:T.active})&&(!b||b({editor:e,range:ae.range,query:ae.query,text:ae.text,transaction:N}))?(H.dismissedRange!==null&&!C({match:ae,dismissedRange:H.dismissedRange,state:R,transaction:N})&&(H.dismissedRange=null),H.dismissedRange===null?(H.active=!0,H.decorationId=T.decorationId?T.decorationId:Ae,H.range=ae.range,H.query=ae.query,H.text=ae.text):H.active=!1):(ae||(H.dismissedRange=null),H.active=!1)}else H.active=!1;return H.active||(H.decorationId=null,H.range={from:0,to:0},H.query=null,H.text=null),H}},props:{handleKeyDown(N,T){var $,R;const{active:L,range:U}=B.getState(N.state);if(!L)return!1;if(T.key==="Escape"||T.key==="Esc"){const M=B.getState(N.state);return($=_==null?void 0:_.onKeyDown)==null||$.call(_,{view:N,event:T,range:M.range}),D(N,t),!0}return((R=_==null?void 0:_.onKeyDown)==null?void 0:R.call(_,{view:N,event:T,range:U}))||!1},decorations(N){const{active:T,range:$,decorationId:R,query:L}=B.getState(N);if(!T)return null;const U=!(L!=null&&L.length),V=[a];return U&&V.push(u),Se.create(N.doc,[tt.inline($.from,$.to,{nodeName:l,class:V.join(" "),"data-decoration-id":R,"data-decoration-content":c})])}}});return B}function iN({editor:t,overrideSuggestionOptions:e,extensionName:n,char:r="@"}){const s=new Re;return{editor:t,char:r,pluginKey:s,command:({editor:i,range:o,props:l})=>{var a,c,u;const h=i.view.state.selection.$to.nodeAfter;((a=h==null?void 0:h.text)==null?void 0:a.startsWith(" "))&&(o.to+=1),i.chain().focus().insertContentAt(o,[{type:n,attrs:{...l,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(u=(c=i.view.dom.ownerDocument.defaultView)==null?void 0:c.getSelection())==null||u.collapseToEnd()},allow:({state:i,range:o})=>{const l=i.doc.resolve(o.from),a=i.schema.nodes[n];return!!l.parent.type.contentMatch.matchType(a)},...e}}function _f(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>iN({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function ud(t,e){const n=_f(t),r=n.find(s=>s.char===e);return r||(n.length?n[0]:null)}var oN=lt.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,r;return`${(n=e==null?void 0:e.char)!=null?n:"@"}${(r=t.attrs.label)!=null?r:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var r,s;return["span",ye(this.HTMLAttributes,t.HTMLAttributes),`${(r=n==null?void 0:n.char)!=null?r:"@"}${(s=e.attrs.label)!=null?s:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=ud(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ye({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const r={...this.options};r.HTMLAttributes=ye({"data-type":this.name},this.options.HTMLAttributes,e);const s=this.options.renderHTML({options:r,node:t,suggestion:n});return typeof s=="string"?["span",ye({"data-type":this.name},this.options.HTMLAttributes,e),s]:s},...Rh({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,s,i,o]=r,l=i??o;e[s==="char"?"mentionSuggestionChar":s]=l,r=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:ud(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:s,anchor:i}=r;if(!s)return!1;let o=new Mt,l=0;return e.doc.nodesBetween(i-1,i,(a,c)=>{if(a.type.name===this.name)return n=!0,o=a,l=c,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,l,l+o.nodeSize),n})}},addProseMirrorPlugins(){return _f(this).map(sN)}}),lN=oN;const aN="_dropdown_rtanl_1",cN="_item_rtanl_14",dN="_itemSelected_rtanl_32",uN="_empty_rtanl_37",Or={dropdown:aN,item:cN,itemSelected:dN,empty:uN},kf=x.forwardRef(({items:t,command:e},n)=>{const[r,s]=x.useState(0);return x.useEffect(()=>s(0),[t]),x.useImperativeHandle(n,()=>({onKeyDown(i){if(i.key==="ArrowUp")return t.length&&s(o=>(o+t.length-1)%t.length),!0;if(i.key==="ArrowDown")return t.length&&s(o=>(o+1)%t.length),!0;if(i.key==="Enter"){const o=t[r];return o&&e(o),!0}return!1}})),t.length?d.jsx("div",{className:Or.dropdown,children:t.map((i,o)=>d.jsx("button",{type:"button",className:[Or.item,o===r?Or.itemSelected:""].filter(Boolean).join(" "),onMouseEnter:()=>s(o),onClick:()=>e(i),children:i.label},i.id))}):d.jsx("div",{className:Or.dropdown,children:d.jsx("div",{className:Or.empty,children:"No results"})})});kf.displayName="MentionList";const hN="_root_8iz1d_7",fN="_labelRow_8iz1d_15",pN="_label_8iz1d_15",mN="_required_8iz1d_25",gN="_outer_8iz1d_32",bN="_inner_8iz1d_40",yN="_innerDisabled_8iz1d_50",xN="_innerInvalid_8iz1d_50",vN="_innerWithCounter_8iz1d_84",_N="_innerWithToolbar_8iz1d_89",kN="_toolbar_8iz1d_95",wN="_innerOnFocusMode_8iz1d_107",CN="_toolbarAbsolute_8iz1d_112",SN="_toolbarHidden_8iz1d_121",NN="_editorOnFocusTransition_8iz1d_127",AN="_toolbarBtn_8iz1d_132",TN="_toolbarBtnActive_8iz1d_157",EN="_labelBold_8iz1d_166",MN="_labelItalic_8iz1d_167",jN="_labelUnderline_8iz1d_168",IN="_labelStrike_8iz1d_169",DN="_labelHeading_8iz1d_170",ON="_labelSubscript_8iz1d_171",LN="_labelSuperscript_8iz1d_172",RN="_divider_8iz1d_175",BN="_urlBar_8iz1d_185",$N="_urlInput_8iz1d_193",PN="_urlConfirm_8iz1d_212",zN="_urlCancel_8iz1d_213",FN="_editor_8iz1d_127",HN="_editorWithInnerCounter_8iz1d_340",WN="_counter_8iz1d_351",VN="_counterInside_8iz1d_359",UN="_bottomRow_8iz1d_372",qN="_helperText_8iz1d_378",KN="_errorText_8iz1d_384 _helperText_8iz1d_378",se={root:hN,labelRow:fN,label:pN,required:mN,outer:gN,inner:bN,innerDisabled:yN,innerInvalid:xN,innerWithCounter:vN,innerWithToolbar:_N,toolbar:kN,innerOnFocusMode:wN,toolbarAbsolute:CN,toolbarHidden:SN,editorOnFocusTransition:NN,toolbarBtn:AN,toolbarBtnActive:TN,labelBold:EN,labelItalic:MN,labelUnderline:jN,labelStrike:IN,labelHeading:DN,labelSubscript:ON,labelSuperscript:LN,divider:RN,urlBar:BN,urlInput:$N,urlConfirm:PN,urlCancel:zN,editor:FN,editorWithInnerCounter:HN,counter:WN,counterInside:VN,bottomRow:UN,helperText:qN,errorText:KN};function Oe({label:t,active:e,onAction:n,disabled:r,children:s}){return d.jsx(er,{content:t,placement:"top",delay:300,children:d.jsx("button",{type:"button",className:[se.toolbarBtn,e?se.toolbarBtnActive:""].filter(Boolean).join(" "),onMouseDown:i=>{i.preventDefault(),n()},"aria-label":t,"aria-pressed":e,disabled:r,children:s})})}const GN=[{id:"1",label:"John Smith (Borrower)"},{id:"2",label:"Jane Doe (Co-Borrower)"},{id:"3",label:"Mike Johnson (Loan Officer)"},{id:"4",label:"Sarah Lee (Processor)"},{id:"5",label:"TitleCo Inc. (Title Company)"},{id:"6",label:"First National Bank (Lender)"},{id:"7",label:"Apex Appraisals (Appraiser)"}];function JN(t){return{items:async({query:e})=>{const n=t??GN,r=typeof n=="function"?await n(e):n,s=e.toLowerCase();return r.filter(i=>i.label.toLowerCase().includes(s)).slice(0,8)},render:()=>{let e=null,n=null;const r=s=>{const i=s.clientRect,o=i==null?void 0:i();o&&n&&(n.style.top=`${o.bottom+window.scrollY+4}px`,n.style.left=`${o.left+window.scrollX}px`)};return{onStart(s){n=document.createElement("div"),n.style.cssText="position:absolute;z-index:9999;",document.body.appendChild(n),e=new Uw(kf,{props:s,editor:s.editor}),n.appendChild(e.element),r(s)},onUpdate(s){e==null||e.updateProps(s),r(s)},onKeyDown({event:s}){var i;return((i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(s))??!1},onExit(){n==null||n.remove(),e==null||e.destroy(),n=null,e=null}}}}}const wf=x.forwardRef((t,e)=>{const{label:n,showLabel:r=!0,required:s,helperText:i,helperTextContent:o="Helper text",invalid:l,disabled:a,placeholder:c,defaultValue:u,onChange:h,maxLength:f,counterPlacement:p="outside",toolbarMode:m="always",showBold:g,showItalic:b,showUnderline:y,showStrike:v,showCode:_,showHighlight:w,showSubscript:k,showSuperscript:S,showHeading:C,headingLevels:D=[1,2,3],showBlockquote:B,showCodeBlock:N,showBulletList:T,showOrderedList:$,showTaskList:R,showHorizontalRule:L,showTextAlign:U,showLink:V,showImage:M,showMention:P,showUndo:H,showRedo:oe,mentionSuggestions:ae,className:Ae,style:Ie,...Be}=t,A=x.useId(),q=`${A}-helper`,re=!!i,[xe,$e]=x.useState(!1),[Bt,Dt]=x.useState(!1),[rr,cn]=x.useState(!1),[$t,Pt]=x.useState(""),Gt=x.useRef(null),wr=Bt||rr,[sr,Cr]=x.useState(0),G=Pw({extensions:[FS.configure({link:!1,underline:!1}),oS,US,KS,JS,ff,hf.configure({nested:!0}),QS.configure({types:["heading","paragraph"]}),zC.configure({openOnClick:!1}),eN,lN.configure({suggestion:JN(ae)}),RS.configure({placeholder:c??""})],content:u,editable:!a,onUpdate({editor:te}){h==null||h(te.getHTML()),Cr(te.getText().length)}});function O(){!G||!$t.trim()||(G.chain().focus().setLink({href:$t.trim()}).run(),Dt(!1),Pt(""))}function X(){!G||!$t.trim()||(G.chain().focus().setImage({src:$t.trim()}).run(),cn(!1),Pt(""))}function pe(){Dt(!1),cn(!1),Pt(""),G==null||G.commands.focus()}const _e=g||b||y||v||_||w||k||S,_t=C||B||N,ft=T||$||R||L,Jt=U,Sr=V||M||P,Nr=H||oe,dn=_e||_t||ft||Jt||Sr||Nr,E=m==="on-focus",W=dn&&E&&!xe,ce=[_e,_t,ft,Jt,Sr,Nr];function ee(te){return!!ce[te]&&ce.slice(te+1).some(Boolean)}const De=typeof f=="number",kt=p==="inside",_s=[se.inner,l?se.innerInvalid:"",a?se.innerDisabled:"",kt&&De?se.innerWithCounter:"",dn&&!E?se.innerWithToolbar:"",dn&&E?se.innerOnFocusMode:""].filter(Boolean).join(" "),to=[se.editor,kt&&De?se.editorWithInnerCounter:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:e,className:[se.root,Ae??""].filter(Boolean).join(" "),style:Ie,...Be,children:[n&&r&&d.jsxs("div",{className:se.labelRow,children:[d.jsx("label",{className:se.label,htmlFor:`${A}-editor`,children:n}),s&&d.jsx("span",{className:se.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:se.outer,children:[d.jsxs("div",{className:_s,onFocus:()=>$e(!0),onBlur:te=>{te.currentTarget.contains(te.relatedTarget)||$e(!1)},children:[dn&&G&&d.jsxs("div",{className:[se.toolbar,E?se.toolbarAbsolute:"",W?se.toolbarHidden:""].filter(Boolean).join(" "),role:"toolbar","aria-label":"Text formatting","aria-hidden":W||void 0,children:[_e&&d.jsxs(d.Fragment,{children:[g&&d.jsx(Oe,{label:"Bold",active:G.isActive("bold"),onAction:()=>G.chain().focus().toggleBold().run(),disabled:a,children:d.jsx("span",{className:se.labelBold,children:"B"})}),b&&d.jsx(Oe,{label:"Italic",active:G.isActive("italic"),onAction:()=>G.chain().focus().toggleItalic().run(),disabled:a,children:d.jsx("span",{className:se.labelItalic,children:"I"})}),y&&d.jsx(Oe,{label:"Underline",active:G.isActive("underline"),onAction:()=>G.chain().focus().toggleUnderline().run(),disabled:a,children:d.jsx("span",{className:se.labelUnderline,children:"U"})}),v&&d.jsx(Oe,{label:"Strikethrough",active:G.isActive("strike"),onAction:()=>G.chain().focus().toggleStrike().run(),disabled:a,children:d.jsx("span",{className:se.labelStrike,children:"S"})}),_&&d.jsx(Oe,{label:"Inline code",active:G.isActive("code"),onAction:()=>G.chain().focus().toggleCode().run(),disabled:a,children:d.jsx("i",{className:"pi pi-code","aria-hidden":"true"})}),w&&d.jsx(Oe,{label:"Highlight",active:G.isActive("highlight"),onAction:()=>G.chain().focus().toggleHighlight().run(),disabled:a,children:d.jsx("i",{className:"pi pi-pencil","aria-hidden":"true"})}),k&&d.jsx(Oe,{label:"Subscript",active:G.isActive("subscript"),onAction:()=>G.chain().focus().toggleSubscript().run(),disabled:a,children:d.jsx("span",{className:se.labelSubscript,children:"x₂"})}),S&&d.jsx(Oe,{label:"Superscript",active:G.isActive("superscript"),onAction:()=>G.chain().focus().toggleSuperscript().run(),disabled:a,children:d.jsx("span",{className:se.labelSuperscript,children:"x²"})})]}),ee(0)&&d.jsx("span",{className:se.divider}),_t&&d.jsxs(d.Fragment,{children:[C&&D.map(te=>d.jsx(Oe,{label:`Heading ${te}`,active:G.isActive("heading",{level:te}),onAction:()=>G.chain().focus().toggleHeading({level:te}).run(),disabled:a,children:d.jsxs("span",{className:se.labelHeading,children:["H",te]})},te)),B&&d.jsx(Oe,{label:"Blockquote",active:G.isActive("blockquote"),onAction:()=>G.chain().focus().toggleBlockquote().run(),disabled:a,children:d.jsx("i",{className:"pi pi-comment","aria-hidden":"true"})}),N&&d.jsx(Oe,{label:"Code block",active:G.isActive("codeBlock"),onAction:()=>G.chain().focus().toggleCodeBlock().run(),disabled:a,children:d.jsx("i",{className:"pi pi-code","aria-hidden":"true"})})]}),ee(1)&&d.jsx("span",{className:se.divider}),ft&&d.jsxs(d.Fragment,{children:[T&&d.jsx(Oe,{label:"Bullet list",active:G.isActive("bulletList"),onAction:()=>G.chain().focus().toggleBulletList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-list","aria-hidden":"true"})}),$&&d.jsx(Oe,{label:"Ordered list",active:G.isActive("orderedList"),onAction:()=>G.chain().focus().toggleOrderedList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-sort-amount-down-alt","aria-hidden":"true"})}),R&&d.jsx(Oe,{label:"Task list",active:G.isActive("taskList"),onAction:()=>G.chain().focus().toggleTaskList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-check-square","aria-hidden":"true"})}),L&&d.jsx(Oe,{label:"Horizontal rule",onAction:()=>G.chain().focus().setHorizontalRule().run(),disabled:a,children:d.jsx("i",{className:"pi pi-minus","aria-hidden":"true"})})]}),ee(2)&&d.jsx("span",{className:se.divider}),Jt&&U&&d.jsx(d.Fragment,{children:["left","center","right","justify"].map(te=>d.jsx(Oe,{label:`Align ${te}`,active:G.isActive({textAlign:te}),onAction:()=>G.chain().focus().setTextAlign(te).run(),disabled:a,children:d.jsx("i",{className:`pi pi-align-${te}`,"aria-hidden":"true"})},te))}),ee(3)&&d.jsx("span",{className:se.divider}),Sr&&d.jsxs(d.Fragment,{children:[V&&d.jsx(Oe,{label:"Link",active:G.isActive("link"),onAction:()=>{G.isActive("link")?G.chain().focus().unsetLink().run():(cn(!1),Dt(!0),Pt(""),requestAnimationFrame(()=>{var te;return(te=Gt.current)==null?void 0:te.focus()}))},disabled:a,children:d.jsx("i",{className:"pi pi-link","aria-hidden":"true"})}),M&&d.jsx(Oe,{label:"Image",onAction:()=>{Dt(!1),cn(!0),Pt(""),requestAnimationFrame(()=>{var te;return(te=Gt.current)==null?void 0:te.focus()})},disabled:a,children:d.jsx("i",{className:"pi pi-image","aria-hidden":"true"})}),P&&d.jsx(Oe,{label:"Mention",onAction:()=>G.chain().focus().insertContent("@").run(),disabled:a,children:d.jsx("i",{className:"pi pi-at","aria-hidden":"true"})})]}),ee(4)&&d.jsx("span",{className:se.divider}),Nr&&d.jsxs(d.Fragment,{children:[H&&d.jsx(Oe,{label:"Undo",onAction:()=>G.chain().focus().undo().run(),disabled:a||!G.can().undo(),children:d.jsx("i",{className:"pi pi-undo","aria-hidden":"true"})}),oe&&d.jsx(Oe,{label:"Redo",onAction:()=>G.chain().focus().redo().run(),disabled:a||!G.can().redo(),children:d.jsx("i",{className:"pi pi-refresh","aria-hidden":"true"})})]})]}),wr&&d.jsxs("div",{className:se.urlBar,children:[d.jsx("input",{ref:Gt,type:"url",className:se.urlInput,value:$t,onChange:te=>Pt(te.target.value),placeholder:Bt?"https://example.com":"Image URL…",onKeyDown:te=>{te.key==="Enter"&&(te.preventDefault(),Bt?O():X()),te.key==="Escape"&&pe()}}),d.jsx("button",{type:"button",className:se.urlConfirm,onMouseDown:te=>{te.preventDefault(),Bt?O():X()},children:d.jsx("i",{className:"pi pi-check","aria-hidden":"true"})}),d.jsx("button",{type:"button",className:se.urlCancel,onMouseDown:te=>{te.preventDefault(),pe()},children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]}),d.jsx("div",{id:`${A}-editor`,className:[to,E&&dn?se.editorOnFocusTransition:""].filter(Boolean).join(" "),style:E&&dn?{paddingTop:xe?48:9}:void 0,"aria-label":!r&&n?n:void 0,"aria-required":s||void 0,"aria-invalid":l||void 0,"aria-describedby":[re?q:"",De?`${A}-counter`:""].filter(Boolean).join(" ")||void 0,onClick:te=>{te.target===te.currentTarget&&(G==null||G.chain().focus("end").run())},children:d.jsx(Ph,{editor:G})}),kt&&De&&d.jsxs("span",{id:`${A}-counter`,className:se.counterInside,"aria-live":"polite",children:[sr,"/",f]})]}),(re||!kt&&De)&&d.jsxs("div",{className:se.bottomRow,children:[re?d.jsx("span",{id:q,className:l?se.errorText:se.helperText,children:o}):d.jsx("span",{}),!kt&&De&&d.jsxs("span",{id:`${A}-counter`,className:se.counter,"aria-live":"polite",children:[sr,"/",f]})]})]})]})});wf.displayName="RichTextEditor";const YN="_wrapper_17bsd_10",QN="_disabled_17bsd_18",XN="_input_17bsd_24",ZN="_track_17bsd_38",eA="_thumb_17bsd_53",tA="_labelText_17bsd_125",nA="_helperText_17bsd_139",In={wrapper:YN,disabled:QN,input:XN,track:ZN,thumb:eA,labelText:tA,helperText:nA},Cf=x.forwardRef(({label:t,helperText:e,disabled:n=!1,id:r,className:s,...i},o)=>{const l=x.useRef(null),a=o??l,c=[In.wrapper,n?In.disabled:"",s??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:c,htmlFor:r,children:[d.jsx("input",{ref:a,type:"checkbox",id:r,disabled:n,className:In.input,role:"switch",...i}),d.jsx("span",{className:In.track,"aria-hidden":"true",children:d.jsx("span",{className:In.thumb})}),t&&d.jsx("span",{className:In.labelText,children:t})]}),e&&d.jsx("span",{className:In.helperText,children:e})]})});Cf.displayName="ToggleSwitch";const rA="_btn_1pyug_10",sA="_disabled_1pyug_28",iA="_sm_1pyug_34",oA="_md_1pyug_40",lA="_lg_1pyug_46",aA="_primary_1pyug_56",cA="_secondary_1pyug_82",dA="_ghost_1pyug_110",uA="_danger_1pyug_133",hA="_link_1pyug_156",fA="_linkLabel_1pyug_181",pA="_icon_1pyug_189",mA="_badge_1pyug_204",Zt={btn:rA,disabled:sA,sm:iA,md:oA,lg:lA,primary:aA,secondary:cA,ghost:dA,danger:uA,link:hA,linkLabel:fA,icon:pA,badge:mA},Ve=x.forwardRef(({variant:t="primary",size:e="md",leadingIcon:n,trailingIcon:r,badge:s,children:i,className:o,disabled:l,...a},c)=>{const u=[Zt.btn,Zt[t],Zt[e],l?Zt.disabled:"",o??""].filter(Boolean).join(" ");return d.jsxs("button",{ref:c,className:u,disabled:l,...a,children:[n&&d.jsx("span",{className:Zt.icon,"aria-hidden":"true",children:n}),t==="link"?d.jsx("span",{className:Zt.linkLabel,children:i}):d.jsx("span",{className:Zt.label,children:i}),s!==void 0&&d.jsx("span",{className:Zt.badge,"aria-label":`${s} notifications`,children:s}),r&&d.jsx("span",{className:Zt.icon,"aria-hidden":"true",children:r})]})});Ve.displayName="Button";const gA="_root_1jl5o_6",bA="_btn_1jl5o_13",yA="_disabled_1jl5o_30",xA="_sm_1jl5o_35",vA="_md_1jl5o_36",_A="_lg_1jl5o_37",kA="_primary_1jl5o_40",wA="_btnOpen_1jl5o_44",CA="_secondary_1jl5o_46",SA="_ghost_1jl5o_52",NA="_danger_1jl5o_58",AA="_icon_1jl5o_65",TA="_chevron_1jl5o_73",EA="_dropdown_1jl5o_98",MA="_item_1jl5o_115",jA="_itemDisabled_1jl5o_130",IA="_itemIcon_1jl5o_143",DA="_divider_1jl5o_153",st={root:gA,btn:bA,disabled:yA,sm:xA,md:vA,lg:_A,primary:kA,btnOpen:wA,secondary:CA,ghost:SA,danger:NA,icon:AA,chevron:TA,dropdown:EA,item:MA,itemDisabled:jA,itemIcon:IA,divider:DA},$i=x.forwardRef(({label:t,items:e,onSelect:n,variant:r="primary",size:s="md",leadingIcon:i,disabled:o,className:l,style:a,...c},u)=>{const[h,f]=x.useState(!1),p=x.useRef(null),m=y=>{p.current=y,typeof u=="function"?u(y):u&&(u.current=y)};x.useEffect(()=>{if(!h)return;function y(v){var _;(_=p.current)!=null&&_.contains(v.target)||f(!1)}return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[h]),x.useEffect(()=>{if(!h)return;function y(v){v.key==="Escape"&&f(!1)}return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[h]);function g(y){y.disabled||(n==null||n(y.value),f(!1))}const b=[st.btn,st[r],st[s],h?st.btnOpen:"",o?st.disabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:m,className:[st.root,l??""].filter(Boolean).join(" "),style:a,children:[d.jsxs("button",{type:"button",className:b,disabled:o,onClick:()=>!o&&f(y=>!y),"aria-haspopup":"menu","aria-expanded":h,...c,children:[i&&d.jsx("span",{className:st.icon,"aria-hidden":"true",children:i}),d.jsx("span",{className:st.label,children:t}),d.jsx("span",{className:st.chevron,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})]}),h&&d.jsx("div",{role:"menu",className:st.dropdown,children:e.map((y,v)=>d.jsxs("div",{children:[y.divider&&d.jsx("div",{className:st.divider,role:"separator"}),d.jsxs("div",{role:"menuitem","aria-disabled":y.disabled||void 0,className:[st.item,y.disabled?st.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>g(y),tabIndex:y.disabled?-1:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&!y.disabled&&(_.preventDefault(),g(y))},children:[y.icon&&d.jsx("span",{className:st.itemIcon,"aria-hidden":"true",children:y.icon}),d.jsx("span",{className:st.itemLabel,children:y.label})]})]},y.value??v))})]})});$i.displayName="DropdownButton";const OA="_btn_12vzq_7",LA="_sm_12vzq_24",RA="_md_12vzq_30",BA="_lg_12vzq_36",$A="_disabled_12vzq_44",Ho={btn:OA,sm:LA,md:RA,lg:BA,disabled:$A},Rt=x.forwardRef(({"aria-label":t="Close",size:e="sm",className:n,disabled:r,...s},i)=>{const o=[Ho.btn,Ho[e],r?Ho.disabled:"",n??""].filter(Boolean).join(" ");return d.jsx(er,{content:t,placement:"top",children:d.jsx("button",{ref:i,type:"button","aria-label":t,className:o,disabled:r,...s,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})})});Rt.displayName="CloseButton";const PA="_root_1f5g5_9",zA="_main_1f5g5_17",FA="_disabled_1f5g5_38",HA="_primaryMain_1f5g5_47",WA="_secondaryMain_1f5g5_59",VA="_trigger_1f5g5_72",UA="_primaryTrigger_1f5g5_94",qA="_secondaryTrigger_1f5g5_105",KA="_chevron_1f5g5_117",GA="_triggerOpen_1f5g5_125",JA="_icon_1f5g5_131",YA="_mainSm_1f5g5_140",QA="_triggerSm_1f5g5_147",XA="_mainLg_1f5g5_152",ZA="_triggerLg_1f5g5_159",eT="_dropdown_1f5g5_187",tT="_item_1f5g5_202",nT="_itemDisabled_1f5g5_217",rT="_itemIcon_1f5g5_230",We={root:PA,main:zA,disabled:FA,primaryMain:HA,secondaryMain:WA,trigger:VA,primaryTrigger:UA,secondaryTrigger:qA,chevron:KA,triggerOpen:GA,icon:JA,mainSm:YA,triggerSm:QA,mainLg:XA,triggerLg:ZA,dropdown:eT,item:tT,itemDisabled:nT,itemIcon:rT},fa=x.forwardRef(({label:t,onAction:e,items:n,onSelect:r,variant:s="primary",size:i="md",leadingIcon:o,disabled:l=!1,triggerAriaLabel:a="More options",className:c,style:u},h)=>{const[f,p]=x.useState(!1),m=x.useRef(null),g=_=>{m.current=_,typeof h=="function"?h(_):h&&(h.current=_)};x.useEffect(()=>{if(!f)return;function _(w){var k;(k=m.current)!=null&&k.contains(w.target)||p(!1)}return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[f]),x.useEffect(()=>{if(!f)return;function _(w){w.key==="Escape"&&p(!1)}return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[f]);function b(_){_.disabled||(r==null||r(_.value),p(!1))}const y=[We.main,We[`${s}Main`],i==="sm"?We.mainSm:i==="lg"?We.mainLg:"",l?We.disabled:""].filter(Boolean).join(" "),v=[We.trigger,We[`${s}Trigger`],i==="sm"?We.triggerSm:i==="lg"?We.triggerLg:"",f?We.triggerOpen:"",l?We.disabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:g,className:[We.root,c??""].filter(Boolean).join(" "),style:u,children:[d.jsxs("button",{type:"button",className:y,onClick:()=>!l&&(e==null?void 0:e()),disabled:l,children:[o&&d.jsx("span",{className:We.icon,"aria-hidden":"true",children:o}),d.jsx("span",{className:We.label,children:t})]}),d.jsx(er,{content:a,placement:"top",children:d.jsx("button",{type:"button",className:v,onClick:()=>!l&&p(_=>!_),disabled:l,"aria-haspopup":"menu","aria-expanded":f,"aria-label":a,children:d.jsx("span",{className:We.chevron,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})})}),f&&d.jsx("div",{role:"menu",className:We.dropdown,children:n.map((_,w)=>d.jsxs("div",{role:"menuitem","aria-disabled":_.disabled||void 0,className:[We.item,_.disabled?We.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>b(_),tabIndex:_.disabled?-1:0,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&!_.disabled&&(k.preventDefault(),b(_))},children:[_.icon&&d.jsx("span",{className:We.itemIcon,"aria-hidden":"true",children:_.icon}),d.jsx("span",{children:_.label})]},_.value??w))})]})});fa.displayName="SplitButton";const sT="_container_1ieud_9",iT="_containerFull_1ieud_20",oT="_navBtn_1ieud_29",lT="_navBtnDisabled_1ieud_46",aT="_navBtnSelected_1ieud_56",cT="_navBtnContent_1ieud_79",dT="_pageNumber_1ieud_90",uT="_ellipsis_1ieud_100",hT="_reportText_1ieud_116",fT="_fullLeft_1ieud_129",pT="_fullRight_1ieud_135",mT="_rowsLabel_1ieud_141",gT="_entriesCount_1ieud_149",yt={container:sT,containerFull:iT,navBtn:oT,navBtnDisabled:lT,navBtnSelected:aT,navBtnContent:cT,pageNumber:dT,ellipsis:uT,reportText:hT,fullLeft:fT,fullRight:pT,rowsLabel:mT,entriesCount:gT};function bT(t,e,n){if(e<=n+2)return Array.from({length:e},(l,a)=>a+1);const r=Math.floor(n/2);let s=Math.max(1,t-r),i=Math.min(e,s+n-1);i-s<n-1&&(s=Math.max(1,i-n+1));const o=[];s>1&&(o.push(1),s>2&&o.push("..."));for(let l=s;l<=i;l++)o.push(l);return i<e&&(i<e-1&&o.push("..."),o.push(e)),o}const Sf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M10 3L6 7l4 4M5 3v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Nf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 3L5 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Af=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Tf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M4 3l4 4-4 4M9 3v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function rn({onClick:t,disabled:e,selected:n,"aria-label":r,children:s}){const i=[yt.navBtn,n?yt.navBtnSelected:"",e?yt.navBtnDisabled:""].filter(Boolean).join(" ");return d.jsx("button",{type:"button",className:i,onClick:t,disabled:e,"aria-label":r,"aria-current":n?"page":void 0,children:d.jsx("span",{className:yt.navBtnContent,children:s})})}function hd({currentPage:t,totalPages:e,pageLinkSize:n,onPage:r}){const s=bT(t,e,n);return d.jsxs(d.Fragment,{children:[d.jsx(rn,{onClick:()=>r(0),disabled:t===0,"aria-label":"First page",children:d.jsx(Sf,{})}),d.jsx(rn,{onClick:()=>r(t-1),disabled:t===0,"aria-label":"Previous page",children:d.jsx(Nf,{})}),s.map((i,o)=>i==="..."?d.jsx("span",{className:yt.ellipsis,children:"…"},`ellipsis-${o}`):d.jsx(rn,{onClick:()=>r(i-1),selected:i-1===t,"aria-label":`Page ${i}`,children:d.jsx("span",{className:yt.pageNumber,children:i})},i)),d.jsx(rn,{onClick:()=>r(t+1),disabled:t>=e-1,"aria-label":"Next page",children:d.jsx(Af,{})}),d.jsx(rn,{onClick:()=>r(e-1),disabled:t>=e-1,"aria-label":"Last page",children:d.jsx(Tf,{})})]})}const Ef=x.forwardRef(({totalRecords:t,first:e,rows:n,onPageChange:r,template:s="pages",rowsPerPageOptions:i=[10,25,50,100],pageLinkSize:o=5,className:l,style:a},c)=>{const u=Math.max(1,Math.ceil(t/n)),h=Math.floor(e/n);function f(v){const _=Math.max(0,Math.min(v,u-1));r({first:_*n,rows:n,page:_})}function p(v){r({first:0,rows:v,page:0})}const m=i.map(v=>({label:String(v),value:String(v)})),g=t===0?0:e+1,b=Math.min(e+n,t),y=[yt.container,s==="full"?yt.containerFull:"",l??""].filter(Boolean).join(" ");return s==="report"?d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsx(rn,{onClick:()=>f(0),disabled:h===0,"aria-label":"First page",children:d.jsx(Sf,{})}),d.jsx(rn,{onClick:()=>f(h-1),disabled:h===0,"aria-label":"Previous page",children:d.jsx(Nf,{})}),d.jsxs("span",{className:yt.reportText,children:["Showing ",g," to ",b," of ",t," entries"]}),d.jsx(rn,{onClick:()=>f(h+1),disabled:h>=u-1,"aria-label":"Next page",children:d.jsx(Af,{})}),d.jsx(rn,{onClick:()=>f(u-1),disabled:h>=u-1,"aria-label":"Last page",children:d.jsx(Tf,{})})]}):s==="full"?d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsxs("div",{className:yt.fullLeft,children:[d.jsx("span",{className:yt.rowsLabel,children:"Results per page:"}),d.jsx(pr,{options:m,value:String(n),onChange:v=>v&&p(Number(v)),size:"sm",style:{width:80}}),d.jsxs("span",{className:yt.entriesCount,children:[b-g+(t>0?1:0)," entries"]})]}),d.jsx("div",{className:yt.fullRight,children:d.jsx(hd,{currentPage:h,totalPages:u,pageLinkSize:o,onPage:f})})]}):d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsx(hd,{currentPage:h,totalPages:u,pageLinkSize:o,onPage:f}),d.jsx(pr,{options:m,value:String(n),onChange:v=>v&&p(Number(v)),size:"sm",style:{width:80}})]})});Ef.displayName="Paginator";const yT="_root_6qfeg_8",xT="_panel_6qfeg_17",vT="_panelHeader_6qfeg_31",_T="_filterWrap_6qfeg_47",kT="_filterIcon_6qfeg_55",wT="_filterInput_6qfeg_63",CT="_filterClear_6qfeg_79",ST="_list_6qfeg_98",NT="_item_6qfeg_110",AT="_itemDisabled_6qfeg_124",TT="_itemSelected_6qfeg_133",ET="_itemContent_6qfeg_148",MT="_itemIcon_6qfeg_156",jT="_itemLabel_6qfeg_162",IT="_checkbox_6qfeg_174",DT="_checkboxChecked_6qfeg_188",OT="_checkboxDisabled_6qfeg_193",LT="_checkmark_6qfeg_198",RT="_controls_6qfeg_211",BT="_ctrlBtn_6qfeg_223",$T="_ctrlBtnDisabled_6qfeg_248",Le={root:yT,panel:xT,panelHeader:vT,filterWrap:_T,filterIcon:kT,filterInput:wT,filterClear:CT,list:ST,item:NT,itemDisabled:AT,itemSelected:TT,itemContent:ET,itemIcon:MT,itemLabel:jT,checkbox:IT,checkboxChecked:DT,checkboxDisabled:OT,checkmark:LT,controls:RT,ctrlBtn:BT,ctrlBtnDisabled:$T},PT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),zT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M2 3l4 4-4 4M7 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),FT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 3L5 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),HT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M12 3L8 7l4 4M7 3L3 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),WT=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"5.5",cy:"5.5",r:"3.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M8.5 8.5L11 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),VT=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function UT({checked:t,disabled:e}){return d.jsx("span",{className:[Le.checkbox,t?Le.checkboxChecked:"",e?Le.checkboxDisabled:""].filter(Boolean).join(" "),"aria-hidden":"true",children:t&&d.jsx("svg",{className:Le.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})})}function Fs({onClick:t,disabled:e,"aria-label":n,children:r}){return d.jsx("button",{type:"button",className:[Le.ctrlBtn,e?Le.ctrlBtnDisabled:""].filter(Boolean).join(" "),onClick:t,disabled:e,"aria-label":n,children:r})}function fd({header:t,items:e,selectedIds:n,onToggle:r,itemTemplate:s,filter:i,filterValue:o,onFilterChange:l,filterPlaceholder:a="Filter...",showCheckbox:c=!0,ariaLabel:u}){const h=x.useMemo(()=>{if(!i||!o.trim())return e;const f=o.toLowerCase();return e.filter(p=>String(p.label??"").toLowerCase().includes(f))},[e,i,o]);return d.jsxs("div",{className:Le.panel,children:[t!=null&&d.jsx("div",{className:Le.panelHeader,children:t}),i&&d.jsxs("div",{className:Le.filterWrap,children:[d.jsx("span",{className:Le.filterIcon,children:d.jsx(WT,{})}),d.jsx("input",{type:"text",className:Le.filterInput,value:o,onChange:f=>l(f.target.value),placeholder:a,"aria-label":`Filter ${u}`}),o&&d.jsx("button",{type:"button",className:Le.filterClear,onClick:()=>l(""),"aria-label":"Clear filter",children:d.jsx(VT,{})})]}),d.jsx("ul",{className:Le.list,role:"listbox","aria-label":u,"aria-multiselectable":"true",children:h.map(f=>{const p=n.has(f.id);return d.jsxs("li",{role:"option","aria-selected":p,"aria-disabled":f.disabled||void 0,className:[Le.item,p?Le.itemSelected:"",f.disabled?Le.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>!f.disabled&&r(f.id),tabIndex:f.disabled?-1:0,onKeyDown:m=>{(m.key===" "||m.key==="Enter")&&!f.disabled&&(m.preventDefault(),r(f.id))},children:[c&&d.jsx(UT,{checked:p,disabled:f.disabled}),s?s(f):d.jsxs("span",{className:Le.itemContent,children:[f.icon&&d.jsx("i",{className:`${f.icon} ${Le.itemIcon}`,"aria-hidden":"true"}),d.jsx("span",{className:Le.itemLabel,children:f.label})]})]},f.id)})})]})}const Mf=x.forwardRef(({sourceItems:t,targetItems:e,onChange:n,sourceHeader:r,targetHeader:s,itemTemplate:i,filter:o=!1,sourceFilterPlaceholder:l,targetFilterPlaceholder:a,showMoveAll:c=!0,showCheckbox:u=!0,className:h,style:f},p)=>{const[m,g]=x.useState(new Set),[b,y]=x.useState(new Set),[v,_]=x.useState(""),[w,k]=x.useState("");function S(V){g(M=>{const P=new Set(M);return P.has(V)?P.delete(V):P.add(V),P})}function C(V){y(M=>{const P=new Set(M);return P.has(V)?P.delete(V):P.add(V),P})}function D(){const V=t.filter(P=>m.has(P.id)),M=t.filter(P=>!m.has(P.id));n({source:M,target:[...e,...V]}),g(new Set)}function B(){const V=t.filter(P=>!P.disabled),M=t.filter(P=>P.disabled);n({source:M,target:[...e,...V]}),g(new Set)}function N(){const V=e.filter(P=>b.has(P.id)),M=e.filter(P=>!b.has(P.id));n({source:[...t,...V],target:M}),y(new Set)}function T(){const V=e.filter(P=>!P.disabled),M=e.filter(P=>P.disabled);n({source:[...t,...V],target:M}),y(new Set)}const $=m.size>0,R=b.size>0,L=t.some(V=>!V.disabled),U=e.some(V=>!V.disabled);return d.jsxs("div",{ref:p,className:[Le.root,h??""].filter(Boolean).join(" "),style:f,children:[d.jsx(fd,{header:r,items:t,selectedIds:m,onToggle:S,itemTemplate:i,filter:o,filterValue:v,onFilterChange:_,filterPlaceholder:l,showCheckbox:u,ariaLabel:"Source list"}),d.jsxs("div",{className:Le.controls,role:"group","aria-label":"Move controls",children:[c&&d.jsx(Fs,{onClick:B,disabled:!L,"aria-label":"Move all to target",children:d.jsx(zT,{})}),d.jsx(Fs,{onClick:D,disabled:!$,"aria-label":"Move selected to target",children:d.jsx(PT,{})}),d.jsx(Fs,{onClick:N,disabled:!R,"aria-label":"Move selected to source",children:d.jsx(FT,{})}),c&&d.jsx(Fs,{onClick:T,disabled:!U,"aria-label":"Move all to source",children:d.jsx(HT,{})})]}),d.jsx(fd,{header:s,items:e,selectedIds:b,onToggle:C,itemTemplate:i,filter:o,filterValue:w,onFilterChange:k,filterPlaceholder:a,showCheckbox:u,ariaLabel:"Target list"})]})});Mf.displayName="Picklist";const qT="_card_jldrw_6",KT="_cardClickable_jldrw_17",GT="_cardDark_jldrw_37",JT="_body_jldrw_70",YT="_title_jldrw_74",QT="_subTitle_jldrw_78",XT="_content_jldrw_82",ZT="_caption_jldrw_99",eE="_footer_jldrw_133",en={card:qT,cardClickable:KT,cardDark:GT,body:JT,title:YT,subTitle:QT,content:XT,caption:ZT,footer:eE},jf=x.forwardRef(({title:t,subTitle:e,footer:n,children:r,tone:s="light",onClick:i,className:o,style:l},a)=>{const c=i!=null,u=t!=null||e!=null||r!=null;return d.jsx("div",{ref:a,className:[en.card,s==="dark"?en.cardDark:"",c?en.cardClickable:"",o??""].filter(Boolean).join(" "),style:l,onClick:i,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i==null||i(h))}:void 0,children:d.jsxs("div",{className:en.body,children:[u&&d.jsxs("div",{className:en.caption,children:[t!=null&&d.jsx("div",{className:en.title,children:t}),e!=null&&d.jsx("div",{className:en.subTitle,children:e}),r!=null&&d.jsx("div",{className:en.content,children:r})]}),n!=null&&d.jsx("div",{className:en.footer,children:n})]})})});jf.displayName="Card";const tE="_accordion_7a03y_6",nE="_item_7a03y_16",rE="_itemDisabled_7a03y_21",sE="_header_7a03y_28",iE="_titleGroup_7a03y_52",oE="_title_7a03y_52",lE="_badge_7a03y_71",aE="_headerRight_7a03y_90",cE="_headerAction_7a03y_97",dE="_chevron_7a03y_105",uE="_chevronOpen_7a03y_114",hE="_contentOuter_7a03y_120",fE="_contentOpen_7a03y_126",pE="_contentInner_7a03y_130",mE="_variant_simple_7a03y_139",gE="_contentBody_7a03y_164",bE="_variant_page_7a03y_173",yE="_variant_panel_7a03y_211",xE="_variant_flyout_7a03y_246",Ke={accordion:tE,item:nE,itemDisabled:rE,header:sE,titleGroup:iE,title:oE,badge:lE,headerRight:aE,headerAction:cE,chevron:dE,chevronOpen:uE,contentOuter:hE,contentOpen:fE,contentInner:pE,variant_simple:mE,contentBody:gE,variant_page:bE,variant_panel:yE,variant_flyout:xE},If=x.forwardRef(({items:t,variant:e="page",openIds:n,onChange:r,multiple:s=!1,className:i,style:o},l)=>{const a=c=>{const u=n.includes(c);r(s?u?n.filter(h=>h!==c):[...n,c]:u?[]:[c])};return d.jsx("div",{ref:l,className:[Ke.accordion,Ke[`variant_${e}`],i??""].filter(Boolean).join(" "),style:o,children:t.map(c=>{const u=n.includes(c.id),h=`accordion-header-${c.id}`,f=`accordion-panel-${c.id}`,p=(e==="panel"||e==="flyout")&&c.badge!=null,m=e==="panel"||e==="flyout";return d.jsxs("div",{className:[Ke.item,u?Ke.itemOpen:"",c.disabled?Ke.itemDisabled:""].filter(Boolean).join(" "),children:[d.jsxs("button",{id:h,className:Ke.header,"aria-expanded":u,"aria-controls":f,disabled:c.disabled,onClick:()=>a(c.id),children:[d.jsxs("span",{className:Ke.titleGroup,children:[d.jsx("span",{className:Ke.title,children:c.title}),p&&d.jsx("span",{className:Ke.badge,children:c.badge})]}),d.jsxs("span",{className:Ke.headerRight,children:[c.headerAction!=null&&d.jsx("span",{className:Ke.headerAction,onClick:g=>g.stopPropagation(),children:c.headerAction}),d.jsx("span",{className:[Ke.chevron,u?Ke.chevronOpen:""].join(" "),children:d.jsx("i",{className:m?"pi pi-angle-down":"pi pi-chevron-down"})})]})]}),d.jsx("div",{id:f,role:"region","aria-labelledby":h,className:[Ke.contentOuter,u?Ke.contentOpen:""].join(" "),children:d.jsx("div",{className:Ke.contentInner,children:d.jsx("div",{className:Ke.contentBody,children:c.content})})})]},c.id)})})});If.displayName="Accordion";const vE="_tabs_jiofg_6",_E="_tablist_jiofg_14",kE="_tab_jiofg_6",wE="_tabIcon_jiofg_51",CE="_tabLabel_jiofg_61",SE="_tabPipe_jiofg_67",NE="_tabCount_jiofg_77",AE="_tabDisabled_jiofg_86",TE="_tabActive_jiofg_86",EE="_panel_jiofg_117",ME="_nav_jiofg_128",jE="_pills_jiofg_138",mt={tabs:vE,tablist:_E,tab:kE,tabIcon:wE,tabLabel:CE,tabPipe:SE,tabCount:NE,tabDisabled:AE,tabActive:TE,panel:EE,nav:ME,pills:jE},Df=x.forwardRef(({tabs:t,activeTab:e,onChange:n,variant:r="panel",className:s,style:i},o)=>{const l=t.find(f=>f.id===e),a=r==="nav",c=r==="pills",u=r==="panel",h=a?"nav":"div";return d.jsxs(h,{ref:o,className:[mt.tabs,a?mt.nav:"",c?mt.pills:"",s??""].filter(Boolean).join(" "),style:i,children:[d.jsx("div",{className:mt.tablist,role:a?void 0:"tablist",children:t.map(f=>{const p=f.id===e,m=`tabpanel-${f.id}`,g=`tab-${f.id}`;return d.jsxs("button",{id:g,role:a?void 0:"tab","aria-selected":a?void 0:p,"aria-current":a&&p?"page":void 0,"aria-disabled":f.disabled,"aria-controls":u?m:void 0,disabled:f.disabled,className:[mt.tab,p?mt.tabActive:"",f.disabled?mt.tabDisabled:""].filter(Boolean).join(" "),onClick:()=>{f.disabled||n(f.id)},children:[f.icon!=null&&d.jsx("span",{className:mt.tabIcon,children:f.icon}),d.jsx("span",{className:mt.tabLabel,children:f.label}),f.icon2!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:mt.tabPipe,children:"|"}),d.jsx("span",{className:mt.tabIcon,children:f.icon2})]}),f.count!=null&&d.jsx("span",{className:mt.tabCount,children:f.count})]},f.id)})}),u&&l!=null&&l.content!=null&&d.jsx("div",{id:`tabpanel-${l.id}`,role:"tabpanel","aria-labelledby":`tab-${l.id}`,className:mt.panel,children:l.content})]})});Df.displayName="Tabs";const IE="_bannerTabs_1emwd_6",DE="_track_1emwd_15",OE="_card_1emwd_31",LE="_cardDisabled_1emwd_55",RE="_cardActive_1emwd_55",BE="_labelRow_1emwd_88",$E="_label_1emwd_88",PE="_labelSep_1emwd_103",zE="_lockIcon_1emwd_110",FE="_statusIndicator_1emwd_117",HE="_subtitle_1emwd_123",WE="_docs_1emwd_133",VE="_badgeGroups_1emwd_139",UE="_badgeGroupWrap_1emwd_146",qE="_badgeGroup_1emwd_139",KE="_badgeGroupPipe_1emwd_160",GE="_badge_1emwd_139",JE="_badgeShape_1emwd_182",YE="_badgeShapeCircle_1emwd_189",QE="_badgeShapeDiamond_1emwd_194",XE="_badgeNum_1emwd_202",ZE="_arrow_1emwd_239",eM="_arrowLeft_1emwd_270",tM="_arrowRight_1emwd_274",nM="_fadeMask_1emwd_280",fe={bannerTabs:IE,track:DE,card:OE,cardDisabled:LE,cardActive:RE,labelRow:BE,label:$E,labelSep:PE,lockIcon:zE,statusIndicator:FE,subtitle:HE,docs:WE,badgeGroups:VE,badgeGroupWrap:UE,badgeGroup:qE,badgeGroupPipe:KE,badge:GE,badgeShape:JE,badgeShapeCircle:YE,badgeShapeDiamond:QE,badgeNum:XE,arrow:ZE,arrowLeft:eM,arrowRight:tM,fadeMask:nM},rM={green:"#66BB5F",yellow:"#F5C664",red:"#E53935",gray:"transparent"},sM={green:"#66BB5F",yellow:"#F5C664",red:"#E53935",gray:"#94A3B8"};function pd({shape:t,color:e}){const n=rM[e],r=sM[e],s=9;return t==="dot"?d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,borderRadius:"50%",background:n,border:`1px solid ${r}`,flexShrink:0}}):t==="diamond"?d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,background:n,border:`1px solid ${r}`,transform:"rotate(45deg)",flexShrink:0}}):t==="square"?d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,background:n,border:`1px solid ${r}`,flexShrink:0}}):d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,borderRadius:"50%",background:"transparent",border:"1.5px solid #94A3B8",flexShrink:0}})}const iM=[{shape:"square",color:"var(--red-500, #EB1000)"},{shape:"diamond",color:"var(--yellow-500, #FBDE0B)"},{shape:"circle",color:"var(--green-300, #6FB864)"}],oM=[{shape:"square",color:"var(--teal-600, #138890)"},{shape:"square",color:"var(--green-600, #22A34A)"},{shape:"square",color:"var(--teal-500, #32A4AC)"}],lM="var(--surface-500, #ADB5BD)";function aM({shape:t,color:e,count:n,tooltip:r,diamondGroup0:s}){const i=n===0,o=i?lM:e,l=i?"var(--navy-900, #0D1117)":s?"var(--navy-800, #171D22)":"#ffffff";return d.jsxs("span",{className:fe.badge,"data-tooltip":r,children:[d.jsx("span",{className:[fe.badgeShape,t==="circle"?fe.badgeShapeCircle:"",t==="diamond"?fe.badgeShapeDiamond:""].filter(Boolean).join(" "),style:{background:o}}),d.jsx("span",{className:fe.badgeNum,style:{color:l},children:n})]})}const pa=x.forwardRef(({items:t,activeId:e,onChange:n,className:r,style:s},i)=>{const o=x.useRef(null),[l,a]=x.useState(!1),[c,u]=x.useState(!1),h=x.useCallback(()=>{const p=o.current;p!=null&&(a(p.scrollLeft>0),u(p.scrollLeft+p.clientWidth<p.scrollWidth-1))},[]);x.useEffect(()=>{const p=o.current;if(p==null)return;h(),p.addEventListener("scroll",h,{passive:!0});const m=new ResizeObserver(h);return m.observe(p),()=>{p.removeEventListener("scroll",h),m.disconnect()}},[h]);const f=p=>{var m;(m=o.current)==null||m.scrollBy({left:p==="left"?-200:200,behavior:"smooth"})};return d.jsxs("div",{ref:i,className:[fe.bannerTabs,r??""].filter(Boolean).join(" "),style:s,children:[l&&d.jsx("button",{className:[fe.arrow,fe.arrowLeft].join(" "),onClick:()=>f("left"),"aria-label":"Scroll left",tabIndex:-1,children:d.jsx("i",{className:"pi pi-chevron-left"})}),d.jsx("div",{className:fe.track,ref:o,children:t.map(p=>{const m=p.id===e;return d.jsxs("button",{className:[fe.card,m?fe.cardActive:"",p.disabled?fe.cardDisabled:""].filter(Boolean).join(" "),onClick:()=>{p.disabled||n(p.id)},disabled:p.disabled,"aria-pressed":m,"aria-disabled":p.disabled,children:[d.jsxs("div",{className:fe.labelRow,children:[d.jsx(pd,{shape:p.status.shape,color:p.status.color}),d.jsx("span",{className:fe.label,children:p.label}),p.subLabel!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:fe.labelSep,children:"/"}),p.subStatus!=null&&d.jsx(pd,{shape:p.subStatus.shape,color:p.subStatus.color}),d.jsx("span",{className:fe.label,children:p.subLabel})]}),p.locked&&d.jsx("i",{className:`pi pi-lock ${fe.lockIcon}`})]}),d.jsx("div",{className:fe.subtitle,children:p.subtitle}),p.badgeGroups!=null&&p.badgeGroups.length>0&&d.jsx("div",{className:fe.badgeGroups,children:p.badgeGroups.map((g,b)=>d.jsxs("div",{className:fe.badgeGroupWrap,children:[b>0&&d.jsx("span",{className:fe.badgeGroupPipe,children:"|"}),d.jsx("div",{className:fe.badgeGroup,children:g.badges.map((y,v)=>{const w=(b===0?iM:oM)[v]??{shape:"square",color:"var(--teal-600, #138890)"},k=y.shape??w.shape;return d.jsx(aM,{shape:k,color:y.color??w.color,count:y.count,tooltip:y.tooltip,diamondGroup0:b===0&&k==="diamond"},v)})})]},b))}),p.docs!=null&&d.jsx("div",{className:fe.docs,children:p.docs})]},p.id)})}),c&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:fe.fadeMask}),d.jsx("button",{className:[fe.arrow,fe.arrowRight].join(" "),onClick:()=>f("right"),"aria-label":"Scroll right",tabIndex:-1,children:d.jsx("i",{className:"pi pi-chevron-right"})})]})]})});pa.displayName="BannerTabs";const cM="_overlay_54tc7_3",dM="_overlayOpen_54tc7_17",uM="_drawer_54tc7_34",hM="_side_right_54tc7_44",fM="_side_left_54tc7_49",pM="_open_54tc7_54",mM="_header_54tc7_60",gM="_headerTitle_54tc7_69",bM="_title_54tc7_77",yM="_subtitle_54tc7_85",xM="_body_54tc7_95",vM="_footer_54tc7_105",_M="_footerShadow_54tc7_117",kM="_tertiaryGroup_54tc7_128",gt={overlay:cM,overlayOpen:dM,drawer:uM,side_right:hM,side_left:fM,open:pM,header:mM,headerTitle:gM,title:bM,subtitle:yM,body:xM,footer:vM,footerShadow:_M,tertiaryGroup:kM},Of=x.forwardRef(({isOpen:t,onClose:e,title:n,subtitle:r,children:s,primaryAction:i,secondaryAction:o,tertiaryActions:l,side:a="right",width:c=800,className:u,style:h},f)=>{const p=x.useRef(null),[m,g]=x.useState(!1);x.useEffect(()=>{if(!t)return;const _=w=>{w.key==="Escape"&&e()};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[t,e]);const b=x.useCallback(()=>{const _=p.current;if(!_){g(!1);return}const w=_.scrollHeight-_.scrollTop-_.clientHeight>2;g(w)},[]);x.useEffect(()=>{if(!t)return;const _=requestAnimationFrame(b),w=p.current;if(!w)return;w.addEventListener("scroll",b);const k=new ResizeObserver(b);return k.observe(w),()=>{cancelAnimationFrame(_),w.removeEventListener("scroll",b),k.disconnect()}},[t,b]);const y=[gt.drawer,gt[`side_${a}`],t?gt.open:"",u??""].filter(Boolean).join(" "),v=[gt.overlay,t?gt.overlayOpen:""].filter(Boolean).join(" ");return qt.createPortal(d.jsx("div",{className:v,"data-side":a,onClick:t?e:void 0,"aria-hidden":!t,children:d.jsxs("div",{ref:f,role:"dialog","aria-modal":"true","aria-label":n??"Drawer",className:y,style:{width:c,...h},onClick:_=>_.stopPropagation(),children:[d.jsxs("div",{className:gt.header,children:[d.jsxs("div",{className:gt.headerTitle,children:[n&&d.jsx("span",{className:gt.title,children:n}),r&&d.jsx("div",{className:gt.subtitle,children:r})]}),d.jsx(Rt,{"aria-label":"Close drawer",onClick:e})]}),d.jsx("div",{ref:p,className:gt.body,children:s}),d.jsxs("div",{className:gt.footer,children:[m&&d.jsx("div",{className:gt.footerShadow,"aria-hidden":"true"}),l&&l.length>0&&d.jsx("div",{className:gt.tertiaryGroup,children:l.map((_,w)=>d.jsx(Ve,{variant:"ghost",size:"md",onClick:_.onClick,disabled:_.disabled,children:_.label},w))}),o&&d.jsx(Ve,{variant:"secondary",size:"md",onClick:o.onClick,disabled:o.disabled,children:o.label}),d.jsx(Ve,{variant:"primary",size:"md",onClick:i.onClick,disabled:i.disabled,children:i.label})]})]})}),document.body)});Of.displayName="Drawer";const wM="_container_7u9if_3",CM="_toast_7u9if_17",SM="_toastEnter_7u9if_52",NM="_toastExit_7u9if_56",AM="_content_7u9if_62",TM="_contentVertical_7u9if_69",EM="_contentHorizontal_7u9if_74",MM="_icon_7u9if_82",jM="_text_7u9if_91",IM="_textVertical_7u9if_96",DM="_textHorizontal_7u9if_102",OM="_title_7u9if_110",LM="_detail_7u9if_118",bt={container:wM,toast:CM,toastEnter:SM,toastExit:NM,content:AM,contentVertical:TM,contentHorizontal:EM,icon:MM,text:jM,textVertical:IM,textHorizontal:DM,title:OM,detail:LM},Cl=new Set;let Hn=[];function Sl(){Cl.forEach(t=>t([...Hn]))}function Lf(t){Hn=Hn.map(e=>e.id===t?{...e,exiting:!0}:e),Sl(),setTimeout(()=>{Hn=Hn.filter(e=>e.id!==t),Sl()},300)}function Hs(t,e,n,r={}){const s={id:crypto.randomUUID(),severity:t,title:e,detail:n,layout:r.layout??"horizontal",duration:r.duration??5e3};Hn=[...Hn,s],Sl(),s.duration>0&&setTimeout(()=>Lf(s.id),s.duration)}const RM={success:(t,e,n)=>Hs("success",t,e,n),info:(t,e,n)=>Hs("info",t,e,n),warn:(t,e,n)=>Hs("warn",t,e,n),error:(t,e,n)=>Hs("error",t,e,n)},BM={success:{icon:"pi-check",bgVar:"--green-50",borderVar:"--green-700",titleVar:"--green-700",iconVar:"--green-600"},info:{icon:"pi-info-circle",bgVar:"--blue-50",borderVar:"--blue-600",titleVar:"--blue-600",iconVar:"--blue-600"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",borderVar:"--yellow-800",titleVar:"--yellow-800",iconVar:"--yellow-600"},error:{icon:"pi-times-circle",bgVar:"--red-50",borderVar:"--red-600",titleVar:"--red-600",iconVar:"--red-500"}},$M={success:{bg:"#edf8ea",border:"#1a760b",title:"#1a760b",icon:"#16a34a"},info:{bg:"#f5f9ff",border:"#326fd1",title:"#326fd1",icon:"#2563eb"},warn:{bg:"#fffce7",border:"#695d05",title:"#695d05",icon:"#ca8a04"},error:{bg:"#fff5f5",border:"#d60f00",title:"#d60f00",icon:"#dc2626"}};function Rf({id:t,severity:e,title:n,detail:r,layout:s="horizontal",exiting:i,onClose:o}){const l=BM[e],a=$M[e],c=`toast-desc-${t}`,u=s==="vertical",h={"--t-bg":`var(${l.bgVar}, ${a.bg})`,"--t-border":`var(${l.borderVar}, ${a.border})`,"--t-title":`var(${l.titleVar}, ${a.title})`,"--t-icon":`var(${l.iconVar}, ${a.icon})`};return d.jsx("div",{role:"alert","aria-live":"assertive","aria-atomic":"true","aria-describedby":r?c:void 0,className:[bt.toast,i?bt.toastExit:bt.toastEnter].join(" "),style:h,children:d.jsxs("div",{className:[bt.content,u?bt.contentVertical:bt.contentHorizontal].join(" "),children:[d.jsx("i",{className:`pi ${l.icon} ${bt.icon}`,"aria-hidden":"true"}),d.jsxs("div",{className:[bt.text,u?bt.textVertical:bt.textHorizontal].join(" "),children:[d.jsx("span",{className:bt.title,children:n}),r&&d.jsx("span",{id:c,className:bt.detail,children:r})]}),d.jsx(Rt,{"aria-label":"Dismiss notification",onClick:o})]})})}function Bf(){const[t,e]=x.useState([]);return x.useEffect(()=>(Cl.add(e),()=>{Cl.delete(e)}),[]),t.length===0?null:qt.createPortal(d.jsx("div",{className:bt.container,"aria-label":"Notifications",children:t.map(n=>d.jsx(Rf,{...n,onClose:()=>Lf(n.id)},n.id))}),document.body)}Bf.displayName="Toaster";function $f({severity:t,title:e,detail:n,layout:r="horizontal",onClose:s}){const i=x.useId();return d.jsx(Rf,{id:i,severity:t,title:e,detail:n,layout:r,onClose:s??(()=>{})})}$f.displayName="Toast";const PM="_wrapper_ety4d_1",zM="_track_ety4d_10",FM="_trackError_ety4d_18",HM="_fill_ety4d_24",WM="_errorMessage_ety4d_37",Lr={wrapper:PM,track:zM,trackError:FM,fill:HM,errorMessage:WM};function Pf({value:t,max:e=100,error:n=!1,errorMessage:r,"aria-label":s}){const i=Math.min(Math.max(t,0),e),o=e>0?i/e*100:0;return d.jsxs("div",{className:Lr.wrapper,children:[d.jsx("div",{role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":e,"aria-label":s,className:[Lr.track,n?Lr.trackError:""].join(" ").trim(),children:!n&&d.jsx("div",{className:Lr.fill,style:{width:`${o}%`}})}),n&&r&&d.jsx("p",{className:Lr.errorMessage,children:r})]})}Pf.displayName="ProgressBar";const VM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAfCAYAAAD0ma06AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAABe9JREFUeAG9VwlslEUUfm/m/7e7LbCFlqsSEJRgFNREkGI5ypEgRBI5FkjEasEggiwtpTc123Jsa3VbLDXWGORspIUoRoJQg0AJh0GCSJBIEQNoLErva7v/zPj+LVQKLeVIfckmM2/mf9+75r23CPdJNlfWgEBdmySRvYioBisF/RBQgoJyyaAMpTrRpGlHGxOd1+4lBzsDsrs9UzjyeFBqlJTyImN4XgKrBpDAkfWQSj3LQA1XAAEkzEsaHKC7n1amxH3zQID27OzB6NM8DFUAyd5cceb4biguFu3d7Zu9NajZ99cEkNoyxtkkBcpKlpfWC1+0Ny3hUqeAdveHs7nCOcgx40Zi7C+3n4W5CgIboMESUGf4yj+Ir7/z254ZnhFcx3USYAZJr5UCUqtSY/M6BLSv88xlGj5RmRjrNvdWt2eIDXAeRWscMAwHUD1bLyusUAjnQMl9AmFXTfLKMj/f5WJ2S3ASR5UOiFxJuboyZeX6uwAD1+aNDODGsMrk2B2Baz20htWI7BWKCYdOCcmTsLNOqIzmtBavBK/PdVJIcmjJCDSlMjXOrbW6IjPTLpUvuDIptjBEoZs0TzRNILAWYwB+Y4BHBKrTCOwGAIVT4CBkaizJG003Qkj9+d24elW6czKFgV8wlG+RIqwlmeCPNhYG5+Q8jl5vJSprIX08/ZbWUsm9jCl3RVLcsY5se9rlslwP7BklhEwmgUNusqXfMlT/SGFMrU5NOP0foFIYlp5uawoI3kSbeTcDVC4VLqlKif0K7pNI6WBshFREWEFbnZ7IT02GmNmUFn+51fG3FqGZnvcUYLrpQWKW1aN3clNS0hV4CArJ2vCGFHJ0SDceW+Z0em8/8wP2yvA8wyx4hqzSKFhXmwEmtWbcw5MpW93J9CcN19X7fjAiyTCtJvGRwaA9ML8WYVlZw6hIXfDfQDhbnrDqOehC0iiV5tJb8W/o8bqhi0nTGExGFFQQ0NdQ2/gtdDFpHOVI9KeOulzlclVBFxNZKIOov9ErxXPwPxB1E0F9TYLGjFqTEelyadCFxHQC1OhnQRFqMmr7W4MishK6QxcRY0zWmKC6JoaajB/fTqqWdhYBj0BUrbDg1BR7u4AWLr43LdTAGPpCQUx/k8llkxH5mXM4PCTlHx6T1FhXfza/ZPTYuwBRMw5R/EBnEgMBF5jMo0tzv6P0XRSZv7QbPCDlHAyPoEfmogFroGFhh/MORax3FDla+ymzNTbu0Jhq0DmBampZZL7DD4JSZPfoLjIdRVGP3S9YbulYB2P8AC3rqZQso9S/Sh0jeWzva+dyD48a7wcsdeb9raMo1sxMRTHIZuu7xDwoWbTxT97U+BEztG0Ltr358r2AsvZEdM8+OC5ZGvA5tf3rmvJNiok89rFP2iagUpeoqjzFpLaRqmvLk59RGBfa7G26SDNIMGeqhsDnfPl6QYl5tnDPwjDp8+ZZwAi1WORWJnxnrL3lr82+Gh5iWJ9n0DxBA7GYcxnGmNjeaBWrUsNPlpvf5pWOcSgBReRe5WMqfOX44z+09sNpm5dGUbZuMS2lzC0P1NXMrXM3Hb91vmTPrAiLxFma5ptqYWKYTqbrKKWmiSs6UyXCJzYnTT3SOhVsLA130hTiUTRESYnpKyYec/lDdbtrZm9ftJaDSmX+t6l8nBsZPYIqs/Om72vTRB0O4OOipwWV1nWrL57bdlb1FA2wWfsNzKIBebm5JxdvWT7hRDTcbFd3jYnzd0av1pSxhkqeWX3oBxcog9Pqb3j3b1r0dS10QNn7X+pjsYoolPguTeeDTPlCyk/w54oYp7OsVeF2B+GoXa8ttCjhJkv76P6yRz8urlqYcYFzVaaBPB+gvHUqAHvR+31SBzWCprcR1Obs2JIZPgpLwjsRJzcgtm3EHY76iwtnhOq2gFSqswuoMIT6QbGlDGqc4gzSv+bEpzCYcSeeqmYodgdJXBM98cTv7cnt9M9M/F5HP5TeySR4OkcxmhQYzLlgJjgnp3GOV7gSpwwlS3UQO2OmtGRoR/Qv6vWE/P0RxtUAAAAASUVORK5CYII=",UM="_wrapper_19qsy_1",qM="_ring_19qsy_10",KM="_ringLg_19qsy_18",GM="_svg_19qsy_25",JM="_spin_19qsy_1",YM="_logo_19qsy_42",QM="_label_19qsy_52",Dn={wrapper:UM,ring:qM,ringLg:KM,svg:GM,spin:JM,logo:YM,label:QM,"label--light":"_label--light_19qsy_59","label--dark":"_label--dark_19qsy_63"},XM={sm:{px:20,r:8.5,sw:3},md:{px:32,r:14.5,sw:3},lg:{px:36,r:16.5,sw:3}};function zf({size:t="md",label:e,theme:n="light","aria-label":r}){const i=`ps-grad-${x.useId().replace(/:/g,"")}`,{px:o,r:l,sw:a}=XM[t],c=2*Math.PI*l,u=c*.75,h=c*.25,f=t==="lg";return d.jsxs("div",{className:Dn.wrapper,role:"status","aria-label":r??"Loading",children:[d.jsxs("div",{className:[Dn.ring,f?Dn.ringLg:""].join(" ").trim(),children:[d.jsxs("svg",{width:o,height:o,viewBox:`0 0 ${o} ${o}`,className:Dn.svg,"aria-hidden":"true",children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[d.jsx("stop",{offset:"0%",stopColor:"var(--teal-600, #138890)"}),d.jsx("stop",{offset:"100%",stopColor:"var(--green-300, #6FB864)"})]})}),d.jsx("circle",{cx:o/2,cy:o/2,r:l,fill:"none",stroke:"var(--surface-300, #F4F4F5)",strokeWidth:a}),d.jsx("circle",{cx:o/2,cy:o/2,r:l,fill:"none",stroke:`url(#${i})`,strokeWidth:a,strokeDasharray:`${u} ${h}`,strokeLinecap:"round"})]}),f&&d.jsx("img",{src:VM,alt:"","aria-hidden":"true",className:Dn.logo})]}),e&&d.jsx("span",{className:[Dn.label,Dn[`label--${n}`]].join(" "),children:e})]})}zf.displayName="ProgressSpinner";const ZM="_chip_2a8wk_1",ej="_label_2a8wk_27",tj="_dismiss_2a8wk_33",Wo={chip:ZM,label:ej,dismiss:tj},nj={plain:{bgVar:"--navy-50",bg:"#EAEBEC",textVar:"--teal-900",text:"#18474A"},contrast:{bgVar:"--teal-900",bg:"#18474A",text:"#ffffff"},error:{bgVar:"--red-500",bg:"#EB1000",text:"#ffffff"},warning:{bgVar:"--yellow-400",bg:"#FCE53C",textVar:"--yellow-900",text:"#514908"},informative:{bgVar:"--blue-400",bg:"#609AF8",text:"#ffffff"},success:{bgVar:"--green-500",bg:"#1E830E",text:"#ffffff"}};function Ff({label:t,severity:e,dismissible:n=!0,onDismiss:r}){const s=nj[e],i={"--c-bg":`var(${s.bgVar}, ${s.bg})`,"--c-text":s.textVar?`var(${s.textVar}, ${s.text})`:s.text};return d.jsxs("span",{className:Wo.chip,style:i,children:[d.jsx("span",{className:Wo.label,children:t}),n&&d.jsx("button",{type:"button",className:Wo.dismiss,onClick:r,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Ff.displayName="SeverityChip";const rj="_chip_1b2ko_1",sj="_avatar_1b2ko_38",ij="_label_1b2ko_53",oj="_dismiss_1b2ko_59",Rr={chip:rj,avatar:sj,label:ij,dismiss:oj};function Hf({label:t,leading:e,trailing:n,dismissible:r=!0,onDismiss:s}){return d.jsxs("span",{className:Rr.chip,"data-leading":e?"true":void 0,"data-trailing":n?"true":void 0,children:[e&&d.jsx("span",{className:Rr.avatar,children:e}),d.jsx("span",{className:Rr.label,children:t}),n&&d.jsx("span",{className:Rr.avatar,children:n}),r&&d.jsx("button",{type:"button",className:Rr.dismiss,onClick:s,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Hf.displayName="ProfileChip";const lj="_chip_4qp0t_1",aj="_dot_4qp0t_28",cj="_label_4qp0t_35",Vo={chip:lj,dot:aj,label:cj},dj={green:{dotVar:"--green-500",dot:"#1E830E"},red:{dotVar:"--red-500",dot:"#EB1000"},yellow:{dotVar:"--yellow-400",dot:"#FCE53C"},grey:{dotVar:"--navy-300",dot:"#70777D"}};function Wf({label:t,color:e}){const n=dj[e];return d.jsxs("span",{className:Vo.chip,children:[d.jsx("span",{className:Vo.dot,style:{background:`var(${n.dotVar}, ${n.dot})`},"aria-hidden":"true"}),d.jsx("span",{className:Vo.label,children:t})]})}Wf.displayName="AUSChip";const uj="_banner_lfuvj_1",hj="_icon_lfuvj_16",fj="_text_lfuvj_25",pj="_title_lfuvj_34",mj="_detail_lfuvj_42",Br={banner:uj,icon:hj,text:fj,title:pj,detail:mj},gj={success:{icon:"pi-check",bgVar:"--green-50",borderVar:"--green-700",colorVar:"--green-700",bg:"#edf8ea",border:"#1a760b",color:"#1a760b"},info:{icon:"pi-info-circle",bgVar:"--blue-50",borderVar:"--blue-600",colorVar:"--blue-600",bg:"#f5f9ff",border:"#326fd1",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",borderVar:"--yellow-800",colorVar:"--yellow-800",bg:"#fefaed",border:"#695d05",color:"#695d05"},error:{icon:"pi-exclamation-circle",bgVar:"--red-50",borderVar:"--red-600",colorVar:"--red-600",bg:"#fff5f5",border:"#d60f00",color:"#d60f00"},neutral:{icon:"pi-info-circle",bgVar:"--teal-50",borderVar:"--teal-700",colorVar:"--teal-700",bg:"#eaf6f7",border:"#186368",color:"#186368"}};function ma({severity:t,title:e,detail:n,closable:r=!0,onClose:s}){const i=gj[t],o={"--a-bg":`var(${i.bgVar}, ${i.bg})`,"--a-border":`var(${i.borderVar}, ${i.border})`,"--a-color":`var(${i.colorVar}, ${i.color})`};return d.jsxs("div",{role:"alert",className:Br.banner,style:o,children:[d.jsx("i",{className:`pi ${i.icon} ${Br.icon}`,"aria-hidden":"true"}),d.jsxs("div",{className:Br.text,children:[d.jsx("span",{className:Br.title,children:e}),n&&d.jsx("span",{className:Br.detail,children:n})]}),r&&d.jsx(Rt,{"aria-label":"Dismiss",onClick:s})]})}ma.displayName="BannerAlert";const bj="_alert_1cttt_1",yj="_icon_1cttt_12",xj="_message_1cttt_21",Uo={alert:bj,icon:yj,message:xj},vj={success:{icon:"pi-check",bgVar:"--green-50",colorVar:"--green-700",bg:"#edf8ea",color:"#1a760b"},info:{icon:"pi-info-circle",bgVar:"--blue-50",colorVar:"--blue-600",bg:"#f5f9ff",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",colorVar:"--yellow-800",bg:"#fffce7",color:"#695d05"},error:{icon:"pi-exclamation-circle",bgVar:"--red-50",colorVar:"--red-600",bg:"#fff5f5",color:"#d60f00"}};function Vf({severity:t,message:e,closable:n=!0,onClose:r}){const s=vj[t],i={"--a-bg":`var(${s.bgVar}, ${s.bg})`,"--a-color":`var(${s.colorVar}, ${s.color})`};return d.jsxs("div",{role:"alert",className:Uo.alert,style:i,children:[d.jsx("i",{className:`pi ${s.icon} ${Uo.icon}`,"aria-hidden":"true"}),d.jsx("span",{className:Uo.message,children:e}),n&&d.jsx(Rt,{"aria-label":"Dismiss",onClick:r})]})}Vf.displayName="InlineContainedAlert";const _j="_alert_p3w47_1",kj="_icon_p3w47_9",wj="_message_p3w47_18",qo={alert:_j,icon:kj,message:wj},Cj={success:{icon:"pi-check",colorVar:"--green-700",color:"#1a760b"},info:{icon:"pi-info-circle",colorVar:"--blue-600",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",colorVar:"--yellow-800",color:"#695d05"},error:{icon:"pi-exclamation-circle",colorVar:"--red-600",color:"#d60f00"}};function Uf({severity:t,message:e}){const n=Cj[t],r={"--a-color":`var(${n.colorVar}, ${n.color})`};return d.jsxs("div",{role:"status",className:qo.alert,style:r,children:[d.jsx("i",{className:`pi ${n.icon} ${qo.icon}`,"aria-hidden":"true"}),d.jsx("span",{className:qo.message,children:e})]})}Uf.displayName="InlineAlert";const Sj="_container_88she_3",Nj="_dropzone_88she_15",Aj="_dragOver_88she_40",Tj="_dropText_88she_45",Ej="_browseLink_88she_51",Mj="_hiddenInput_88she_57",jj="_errorMessage_88she_63",Ij="_fileList_88she_79",Dj="_tableHeader_88she_83",Oj="_colName_88she_92",Lj="_colType_88she_101",Rj="_fileRow_88she_111",Bj="_fileName_88she_119",$j="_docTypeWrap_88she_130",Pj="_removeBtn_88she_137",zj="_footer_88she_157",Xe={container:Sj,dropzone:Nj,dragOver:Aj,dropText:Tj,browseLink:Ej,hiddenInput:Mj,errorMessage:jj,fileList:Ij,tableHeader:Dj,colName:Oj,colType:Lj,fileRow:Rj,fileName:Bj,docTypeWrap:$j,removeBtn:Pj,footer:zj},qf=["Miscellaneous","Agreements","Bank Statement","Hazard Insurance Binder","Pay Stub","Personal Identification","Purchase Agreement","Tax Return Transcript"],Fj=".html,.heic,.jpeg,.jpg,.png,.gif,.bmp,.tiff,.tif,.pdf,.doc,.docx,.xls,.xlsx";function Hj(t,e){return e.split(",").map(r=>r.trim().toLowerCase()).some(r=>t.name.toLowerCase().endsWith(r))}function Kf({onFilesAdded:t,onUpload:e,docTypes:n=qf,accept:r=Fj,initialFiles:s,className:i,style:o}){const[l,a]=x.useState([]),[c,u]=x.useState(!1),[h,f]=x.useState(null),p=x.useRef(null),m=x.useId();x.useEffect(()=>{s&&s.length>0&&a(s.map(N=>({id:crypto.randomUUID(),file:N,docType:""})))},[]);const g=l.length>0&&l.every(N=>N.docType!==""),b=n.map(N=>({label:N,value:N})),y=x.useCallback(N=>{f(null);const T=[],$=[];if(N.forEach(R=>{Hj(R,r)?T.push(R):$.push(R)}),$.length>0&&f("File format not supported. Please try again."),T.length>0){const R=T.map(L=>({id:crypto.randomUUID(),file:L,docType:""}));a(L=>[...L,...R]),t==null||t(T)}},[r,t]),v=N=>{N.preventDefault(),u(!0)},_=N=>{N.currentTarget.contains(N.relatedTarget)||u(!1)},w=N=>{N.preventDefault(),u(!1),y(Array.from(N.dataTransfer.files))},k=N=>{N.target.files&&N.target.files.length>0&&(y(Array.from(N.target.files)),N.target.value="")},S=()=>{var N;(N=p.current)==null||N.click()},C=(N,T)=>{a($=>$.map(R=>R.id===N?{...R,docType:T??""}:R))},D=N=>{a(T=>T.filter($=>$.id!==N))},B=()=>{g&&(e(l.map(({file:N,docType:T})=>({file:N,docType:T}))),a([]),f(null))};return d.jsxs("div",{className:[Xe.container,i??""].filter(Boolean).join(" "),style:o,children:[d.jsxs("div",{className:[Xe.dropzone,c?Xe.dragOver:""].filter(Boolean).join(" "),onDragOver:v,onDragLeave:_,onDrop:w,onClick:S,role:"button",tabIndex:0,"aria-label":"File upload area. Click or drop files here.",onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&S()},children:[d.jsxs("span",{className:Xe.dropText,children:["Drop file(s) here or"," ",d.jsx("span",{className:Xe.browseLink,children:"browse"})]}),d.jsx("input",{ref:p,id:m,type:"file",multiple:!0,accept:r,className:Xe.hiddenInput,onChange:k,tabIndex:-1})]}),h&&d.jsxs("div",{className:Xe.errorMessage,role:"alert",children:[d.jsx("i",{className:"pi pi-exclamation-triangle","aria-hidden":"true"}),h]}),l.length>0&&d.jsxs("div",{className:Xe.fileList,children:[d.jsxs("div",{className:Xe.tableHeader,children:[d.jsx("span",{className:Xe.colName,children:"Document Name"}),d.jsx("span",{className:Xe.colType,children:"Document Type"})]}),l.map(N=>d.jsxs("div",{className:Xe.fileRow,children:[d.jsx("span",{className:Xe.fileName,title:N.file.name,children:N.file.name}),d.jsx("div",{className:Xe.docTypeWrap,children:d.jsx(pr,{options:b,value:N.docType||null,onChange:T=>C(N.id,T),placeholder:"Select Doc Type",filter:!0,size:"sm",style:{width:"100%"}})}),d.jsx("button",{type:"button",className:Xe.removeBtn,onClick:()=>D(N.id),"aria-label":`Remove ${N.file.name}`,children:d.jsx("i",{className:"pi pi-times-circle","aria-hidden":"true"})})]},N.id))]}),d.jsx("div",{className:Xe.footer,children:d.jsx(Ve,{variant:"primary",size:"md",onClick:B,disabled:!g,children:"Upload"})})]})}Kf.displayName="FileUpload";const Wj="_overlay_keczm_3",Vj="_modal_keczm_19",Uj="_header_keczm_36",qj="_headerTitle_keczm_45",Kj="_title_keczm_50",Gj="_body_keczm_60",Jj="_footer_keczm_72",On={overlay:Wj,modal:Vj,header:Uj,headerTitle:qj,title:Kj,body:Gj,footer:Jj},Gf=x.forwardRef(({isOpen:t,onClose:e,title:n,children:r,footer:s,scrim:i=!0,width:o=510,className:l,style:a},c)=>(x.useEffect(()=>{if(!t)return;const u=h=>{h.key==="Escape"&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t,e]),t?qt.createPortal(d.jsx("div",{className:On.overlay,"data-scrim":i,onClick:i?e:void 0,children:d.jsxs("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":n??"Modal",className:[On.modal,l??""].filter(Boolean).join(" "),style:{width:o,...a},onClick:u=>u.stopPropagation(),children:[d.jsxs("div",{className:On.header,children:[d.jsx("div",{className:On.headerTitle,children:n&&d.jsx("span",{className:On.title,children:n})}),d.jsx(Rt,{"aria-label":"Close",onClick:e})]}),d.jsx("div",{className:On.body,children:r}),s&&d.jsx("div",{className:On.footer,children:s})]})}),document.body):null));Gf.displayName="Modal";const Yj="_triggerWrap_5kkmc_3",Qj="_scrim_5kkmc_15",Xj="_popup_5kkmc_24",Zj="_header_5kkmc_82",eI="_title_5kkmc_89",tI="_body_5kkmc_101",nI="_footer_5kkmc_107",Ln={triggerWrap:Yj,scrim:Qj,popup:Xj,header:Zj,title:eI,body:tI,footer:nI},md=10,Jf=x.forwardRef(({isOpen:t,onClose:e,trigger:n,title:r,children:s,footer:i,placement:o="bottom",align:l="right",width:a=360,className:c,style:u},h)=>{const f=x.useRef(null),[p,m]=x.useState(null),g=x.useCallback(()=>{if(!f.current)return null;const b=f.current.getBoundingClientRect(),y=b.left+b.width/2;let v=l==="right"?b.left:b.right-a;v=Math.max(8,Math.min(v,window.innerWidth-a-8));const _=y-v;return o==="bottom"?{top:b.bottom+md,left:v,arrowLeft:_}:{bottom:window.innerHeight-b.top+md,left:v,arrowLeft:_}},[o,l,a]);return x.useLayoutEffect(()=>{if(!t){m(null);return}m(g())},[t,g]),d.jsxs(d.Fragment,{children:[d.jsx("span",{ref:f,className:Ln.triggerWrap,children:n}),t&&p&&qt.createPortal(d.jsxs(d.Fragment,{children:[d.jsx("div",{className:Ln.scrim,onClick:e,"aria-hidden":"true"}),d.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":r??"Popup",className:[Ln.popup,c??""].filter(Boolean).join(" "),"data-placement":o,style:{width:a,top:p.top,bottom:p.bottom,left:p.left,"--popup-arrow-left":`${p.arrowLeft}px`,...u},children:[r&&d.jsxs("div",{className:Ln.header,children:[d.jsx("span",{className:Ln.title,children:r}),d.jsx(Rt,{"aria-label":"Close popup",onClick:e})]}),d.jsx("div",{className:Ln.body,children:s}),i&&d.jsx("div",{className:Ln.footer,children:i})]})]}),document.body)]})});Jf.displayName="Popup";const rI="_panel_qk0fv_1",sI="_open_qk0fv_19",iI="_compact_qk0fv_23",oI="_header_qk0fv_29",lI="_titleBar_qk0fv_36",aI="_titleBarNoTitle_qk0fv_43",cI="_titleGroup_qk0fv_48",dI="_title_qk0fv_36",uI="_subtitle_qk0fv_63",hI="_actions_qk0fv_72",fI="_headerContent_qk0fv_79",pI="_body_qk0fv_85",St={panel:rI,open:sI,compact:iI,header:oI,titleBar:lI,titleBarNoTitle:aI,titleGroup:cI,title:dI,subtitle:uI,actions:hI,headerContent:fI,body:pI},Yf=x.forwardRef(({isOpen:t,onClose:e,title:n,subtitle:r,onSave:s,headerContent:i,width:o=470,children:l,className:a,style:c},u)=>{const h=o<400,f=[St.panel,t?St.open:"",h?St.compact:"",a??""].filter(Boolean).join(" "),p=d.jsxs("div",{className:St.actions,children:[s&&d.jsx(Ve,{variant:"primary",size:"sm",onClick:s,children:"Save"}),d.jsx(Rt,{"aria-label":"Close panel",onClick:e})]});return d.jsxs("div",{ref:u,role:"dialog","aria-modal":"false","aria-label":n??"Side panel",className:f,style:{width:o,...c},children:[d.jsxs("div",{className:St.header,children:[n?d.jsxs("div",{className:St.titleBar,children:[d.jsxs("div",{className:St.titleGroup,children:[d.jsx("span",{className:St.title,children:n}),r&&d.jsx("div",{className:St.subtitle,children:r})]}),p]}):d.jsx("div",{className:St.titleBarNoTitle,children:p}),i&&d.jsx("div",{className:St.headerContent,children:i})]}),d.jsx("div",{className:St.body,children:l})]})});Yf.displayName="SidePanel";const mI="_layout_1qi6d_1",gI={layout:mI},Qf=x.forwardRef(({open:t,panelWidth:e=470,children:n,className:r,style:s},i)=>{const o=[gI.layout,r??""].filter(Boolean).join(" ");return d.jsx("div",{ref:i,className:o,style:{paddingRight:t?e:0,...s},children:n})});Qf.displayName="SidePanelLayout";const bI="_nav_1w7cn_6",yI="_leftSection_1w7cn_21",xI="_applicantWrap_1w7cn_30",vI="_applicantTrigger_1w7cn_35",_I="_applicantIcon_1w7cn_64",kI="_applicantLabel_1w7cn_72",wI="_applicantChevron_1w7cn_80",CI="_applicantMenu_1w7cn_88",SI="_applicantOption_1w7cn_101",NI="_applicantOptionSelected_1w7cn_115",AI="_applicantDivider_1w7cn_129",TI="_applicantAddBtn_1w7cn_135",EI="_sortWrap_1w7cn_163",MI="_sortBtn_1w7cn_168",jI="_sortBtnIcon_1w7cn_191",II="_sortBtnChevron_1w7cn_198",DI="_sortMenu_1w7cn_204",OI="_sortMenuItem_1w7cn_217",LI="_divider_1w7cn_250",RI="_tabsSection_1w7cn_259",BI="_ausButtons_1w7cn_275",$I="_spacer_1w7cn_284",PI="_tab_1w7cn_259",zI="_tabDisabled_1w7cn_309",FI="_tabActive_1w7cn_309",we={nav:bI,leftSection:yI,applicantWrap:xI,applicantTrigger:vI,applicantIcon:_I,applicantLabel:kI,applicantChevron:wI,applicantMenu:CI,applicantOption:SI,applicantOptionSelected:NI,applicantDivider:AI,applicantAddBtn:TI,sortWrap:EI,sortBtn:MI,sortBtnIcon:jI,sortBtnChevron:II,sortMenu:DI,sortMenuItem:OI,divider:LI,tabsSection:RI,ausButtons:BI,spacer:$I,tab:PI,tabDisabled:zI,tabActive:FI},ga=()=>d.jsx("i",{className:"pi pi-arrow-right","aria-hidden":"true"}),ba=()=>d.jsx("i",{className:"pi pi-replay","aria-hidden":"true"}),HI=()=>d.jsx("i",{className:"pi pi-user","aria-hidden":"true"}),WI=()=>d.jsx("i",{className:"pi pi-plus-circle","aria-hidden":"true"}),VI=()=>d.jsx("i",{className:"pi pi-user-plus","aria-hidden":"true"}),kr=()=>d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function ya({applicants:t,selectedApplicantId:e,onApplicantChange:n,onAddApplicant:r,height:s=35}){const[i,o]=x.useState(!1),l=x.useRef(null);x.useEffect(()=>{if(!i)return;function c(u){var h;(h=l.current)!=null&&h.contains(u.target)||o(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[i]),x.useEffect(()=>{if(!i)return;function c(u){u.key==="Escape"&&o(!1)}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[i]);const a=t.find(c=>c.id===e);return d.jsxs("div",{ref:l,className:we.applicantWrap,children:[d.jsxs("button",{type:"button",className:we.applicantTrigger,style:s!==35?{height:s}:void 0,onClick:()=>o(c=>!c),"aria-haspopup":"listbox","aria-expanded":i,children:[d.jsx("span",{className:we.applicantIcon,children:d.jsx(HI,{})}),d.jsx("span",{className:we.applicantLabel,children:(a==null?void 0:a.label)??""}),d.jsx("span",{className:we.applicantChevron,children:d.jsx(kr,{})})]}),i&&d.jsxs("div",{role:"listbox",className:we.applicantMenu,children:[t.map(c=>d.jsx("div",{role:"option","aria-selected":c.id===e,className:[we.applicantOption,c.id===e?we.applicantOptionSelected:""].filter(Boolean).join(" "),tabIndex:0,onClick:()=>{n(c.id),o(!1)},onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(c.id),o(!1))},children:c.label},c.id)),r&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:we.applicantDivider}),d.jsxs("button",{type:"button",className:we.applicantAddBtn,onClick:()=>{r(),o(!1)},children:[d.jsx(WI,{}),"New Applicant"]})]})]})]})}function xa({sortItems:t,onSortSelect:e,height:n=35,width:r=47}){const[s,i]=x.useState(!1),o=x.useRef(null);x.useEffect(()=>{if(!s)return;function a(c){var u;(u=o.current)!=null&&u.contains(c.target)||i(!1)}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[s]),x.useEffect(()=>{if(!s)return;function a(c){c.key==="Escape"&&i(!1)}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[s]);const l=n!==35||r!==47?{height:n,width:r}:void 0;return d.jsxs("div",{ref:o,className:we.sortWrap,children:[d.jsxs("button",{type:"button",className:we.sortBtn,style:l,onClick:()=>i(a=>!a),"aria-haspopup":"menu","aria-expanded":s,"aria-label":"Sort applicants",children:[d.jsx("span",{className:we.sortBtnIcon,children:d.jsx(VI,{})}),d.jsx("span",{className:we.sortBtnChevron,children:d.jsx(kr,{})})]}),s&&d.jsx("div",{role:"menu",className:we.sortMenu,children:t.map(a=>d.jsx("button",{type:"button",role:"menuitem",disabled:a.disabled,className:we.sortMenuItem,onClick:()=>{e==null||e(a.value),i(!1)},children:a.label},a.value))})]})}const va=x.forwardRef(function(e,n){const{applicants:r,selectedApplicantId:s,onApplicantChange:i,onAddApplicant:o,sortItems:l,onSortSelect:a,tabs:c,activeTabId:u,onTabChange:h,onNextValidation:f,nextValidationBadge:p,onBackToAUS:m,className:g,style:b}=e;return d.jsxs("div",{ref:n,className:[we.nav,g??""].filter(Boolean).join(" "),style:b,children:[d.jsxs("div",{className:we.leftSection,children:[d.jsx(ya,{applicants:r,selectedApplicantId:s,onApplicantChange:i,onAddApplicant:o}),l&&l.length>0&&d.jsx(xa,{sortItems:l,onSortSelect:a})]}),d.jsx("div",{className:we.divider,"aria-hidden":"true"}),d.jsxs("div",{className:we.tabsSection,role:"tablist",children:[(f||m)&&d.jsxs("div",{className:we.ausButtons,children:[f&&d.jsx(Ve,{variant:"danger",size:"sm",leadingIcon:d.jsx(ga,{}),badge:p,onClick:f,children:"Next Validation"}),m&&d.jsx(Ve,{variant:"secondary",size:"sm",leadingIcon:d.jsx(ba,{}),onClick:m,children:"Back to AUS"})]}),c.map(y=>d.jsx("button",{type:"button",role:"tab",className:[we.tab,y.id===u?we.tabActive:"",y.disabled?we.tabDisabled:""].filter(Boolean).join(" "),"aria-selected":y.id===u,"aria-disabled":y.disabled,disabled:y.disabled,onClick:()=>{y.disabled||h(y.id)},children:y.label},y.id)),d.jsx("div",{className:we.spacer,"aria-hidden":"true"})]})]})});va.displayName="URLATabsNav";const UI="_nav_9yblg_5",qI="_row1_9yblg_19",KI="_borrowerBlock_9yblg_27",GI="_borrowerName_9yblg_34",JI="_loanDetailsBtn_9yblg_41",YI="_divider_9yblg_68",QI="_ausButtons_9yblg_76",XI="_tabsSection_9yblg_85",ZI="_tab_9yblg_85",eD="_tabDisabled_9yblg_116",tD="_tabActive_9yblg_116",nD="_spacer_9yblg_136",rD="_stripBadge_9yblg_142",at={nav:UI,row1:qI,borrowerBlock:KI,borrowerName:GI,loanDetailsBtn:JI,divider:YI,ausButtons:QI,tabsSection:XI,tab:ZI,tabDisabled:eD,tabActive:tD,spacer:nD,stripBadge:rD},Xf=x.forwardRef(function(e,n){const{borrowerName:r,onLoanDetailsClick:s,applicants:i,selectedApplicantId:o,onApplicantChange:l,onAddApplicant:a,sortItems:c,onSortSelect:u,onNextValidation:h,nextValidationBadge:f,onBackToAUS:p,tabs:m,activeTabId:g,onTabChange:b,tabStripBadge:y,className:v,style:_}=e;return d.jsxs("div",{ref:n,className:[at.nav,v].filter(Boolean).join(" "),style:_,children:[d.jsxs("div",{className:at.row1,children:[d.jsxs("div",{className:at.borrowerBlock,children:[d.jsx("span",{className:at.borrowerName,children:r}),d.jsxs("button",{type:"button",className:at.loanDetailsBtn,onClick:s,children:["Loan Details",d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})]})]}),d.jsx("div",{className:at.divider,"aria-hidden":"true"}),d.jsx(ya,{applicants:i,selectedApplicantId:o,onApplicantChange:l,onAddApplicant:a,height:35}),c&&c.length>0&&d.jsx(xa,{sortItems:c,onSortSelect:u,height:35}),d.jsx("div",{className:at.divider,"aria-hidden":"true"}),(h||p)&&d.jsxs("div",{className:at.ausButtons,children:[h&&d.jsx(Ve,{variant:"danger",size:"sm",leadingIcon:d.jsx(ga,{}),badge:f,onClick:h,children:"Next Validation"}),p&&d.jsx(Ve,{variant:"secondary",size:"sm",leadingIcon:d.jsx(ba,{}),onClick:p,children:"Back to AUS"})]})]}),d.jsxs("div",{className:at.tabsSection,role:"tablist",children:[m.map(w=>d.jsx("button",{type:"button",role:"tab",className:[at.tab,w.id===g?at.tabActive:"",w.disabled?at.tabDisabled:""].filter(Boolean).join(" "),"aria-selected":w.id===g,"aria-disabled":w.disabled,disabled:w.disabled,onClick:()=>{w.disabled||b(w.id)},children:w.label},w.id)),d.jsx("div",{className:at.spacer,"aria-hidden":"true"}),y!=null&&y>0&&d.jsx("span",{className:at.stripBadge,"aria-label":`${y} items`,children:y})]})]})});Xf.displayName="URLATabsNavTablet";const sD="_container_14o10_5",iD="_row1_14o10_17",oD="_borrowerBlock_14o10_27",lD="_borrowerName_14o10_35",aD="_loanDetailsBtn_14o10_44",cD="_rightControls_14o10_72",dD="_sectionWrap_14o10_82",uD="_sectionTrigger_14o10_87",hD="_sectionLabel_14o10_110",fD="_sectionChevron_14o10_118",pD="_sortPill_14o10_128",mD="_actionsWrap_14o10_155",gD="_actionsBtn_14o10_160",bD="_saveBtn_14o10_190",yD="_row2_14o10_217",xD="_ausButtons_14o10_226",vD="_tabDropdownWrap_14o10_236",_D="_tabDropdownTrigger_14o10_242",kD="_tabDropdownLabel_14o10_265",wD="_tabDropdownChevron_14o10_273",CD="_tabDropdownMenu_14o10_280",SD="_dropdownMenu_14o10_295",ND="_dropdownOption_14o10_308",AD="_dropdownOptionSelected_14o10_327",TD="_dropdownOptionDisabled_14o10_327",ge={container:sD,row1:iD,borrowerBlock:oD,borrowerName:lD,loanDetailsBtn:aD,rightControls:cD,sectionWrap:dD,sectionTrigger:uD,sectionLabel:hD,sectionChevron:fD,sortPill:pD,actionsWrap:mD,actionsBtn:gD,saveBtn:bD,row2:yD,ausButtons:xD,tabDropdownWrap:vD,tabDropdownTrigger:_D,tabDropdownLabel:kD,tabDropdownChevron:wD,tabDropdownMenu:CD,dropdownMenu:SD,dropdownOption:ND,dropdownOptionSelected:AD,dropdownOptionDisabled:TD};function ED({label:t,items:e,onSelect:n}){const[r,s]=x.useState(!1),i=x.useRef(null);return x.useEffect(()=>{if(!r)return;function o(l){var a;(a=i.current)!=null&&a.contains(l.target)||s(!1)}return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[r]),x.useEffect(()=>{if(!r)return;function o(l){l.key==="Escape"&&s(!1)}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[r]),d.jsxs("div",{ref:i,className:ge.sectionWrap,children:[d.jsxs("button",{type:"button",className:ge.sectionTrigger,onClick:()=>s(o=>!o),"aria-haspopup":"listbox","aria-expanded":r,children:[d.jsx("span",{className:ge.sectionLabel,children:t}),d.jsx("span",{className:ge.sectionChevron,children:d.jsx(kr,{})})]}),r&&e&&e.length>0&&d.jsx("div",{role:"listbox",className:ge.dropdownMenu,children:e.map(o=>d.jsx("div",{role:"option","aria-selected":o.label===t,className:[ge.dropdownOption,o.label===t?ge.dropdownOptionSelected:""].filter(Boolean).join(" "),tabIndex:0,onClick:()=>{n==null||n(o.value),s(!1)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),n==null||n(o.value),s(!1))},children:o.label},o.value))})]})}function MD({items:t,onSelect:e}){const[n,r]=x.useState(!1),s=x.useRef(null);return x.useEffect(()=>{if(!n)return;function i(o){var l;(l=s.current)!=null&&l.contains(o.target)||r(!1)}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),x.useEffect(()=>{if(!n)return;function i(o){o.key==="Escape"&&r(!1)}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n]),d.jsxs("div",{ref:s,className:ge.actionsWrap,children:[d.jsxs("button",{type:"button",className:ge.actionsBtn,onClick:()=>r(i=>!i),"aria-haspopup":"menu","aria-expanded":n,children:["Actions",d.jsx(kr,{})]}),n&&d.jsx("div",{role:"menu",className:ge.dropdownMenu,children:t.map(i=>d.jsx("button",{type:"button",role:"menuitem",disabled:i.disabled,className:ge.dropdownOption,onClick:()=>{e==null||e(i.value),r(!1)},children:i.label},i.value))})]})}function jD({tabs:t,activeTabId:e,onTabChange:n}){const[r,s]=x.useState(!1),i=x.useRef(null);x.useEffect(()=>{if(!r)return;function l(a){var c;(c=i.current)!=null&&c.contains(a.target)||s(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),x.useEffect(()=>{if(!r)return;function l(a){a.key==="Escape"&&s(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[r]);const o=t.find(l=>l.id===e);return d.jsxs("div",{ref:i,className:ge.tabDropdownWrap,children:[d.jsxs("button",{type:"button",className:ge.tabDropdownTrigger,onClick:()=>s(l=>!l),"aria-haspopup":"listbox","aria-expanded":r,"aria-label":"Select tab",children:[d.jsx("span",{className:ge.tabDropdownLabel,children:(o==null?void 0:o.label)??""}),d.jsx("span",{className:ge.tabDropdownChevron,children:d.jsx(kr,{})})]}),r&&d.jsx("div",{role:"listbox",className:ge.tabDropdownMenu,children:t.map(l=>d.jsx("div",{role:"option","aria-selected":l.id===e,"aria-disabled":l.disabled,className:[ge.dropdownOption,l.id===e?ge.dropdownOptionSelected:"",l.disabled?ge.dropdownOptionDisabled:""].filter(Boolean).join(" "),tabIndex:l.disabled?-1:0,onClick:()=>{l.disabled||(n(l.id),s(!1))},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&!l.disabled&&(a.preventDefault(),n(l.id),s(!1))},children:l.label},l.id))})]})}const _a=x.forwardRef(function(e,n){const{borrowerName:r,onLoanDetailsClick:s,sectionLabel:i,sectionItems:o,onSectionSelect:l,onSectionSort:a,actionItems:c,onActionSelect:u,onSave:h,applicants:f,selectedApplicantId:p,onApplicantChange:m,onAddApplicant:g,sortItems:b,onSortSelect:y,onNextValidation:v,nextValidationBadge:_,onBackToAUS:w,tabs:k,activeTabId:S,onTabChange:C,className:D,style:B}=e;return d.jsxs("div",{ref:n,className:[ge.container,D].filter(Boolean).join(" "),style:B,children:[d.jsxs("div",{className:ge.row1,children:[d.jsxs("div",{className:ge.borrowerBlock,children:[d.jsx("span",{className:ge.borrowerName,children:r}),d.jsxs("button",{type:"button",className:ge.loanDetailsBtn,onClick:s,children:["Loan Details",d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})]})]}),d.jsxs("div",{className:ge.rightControls,children:[d.jsx(ED,{label:i,items:o,onSelect:l}),a&&d.jsx("button",{type:"button",className:ge.sortPill,onClick:a,"aria-label":"Sort sections",children:d.jsx(kr,{})}),c&&c.length>0&&d.jsx(MD,{items:c,onSelect:u}),h&&d.jsx("button",{type:"button",className:ge.saveBtn,onClick:h,"aria-label":"Save",children:d.jsx("i",{className:"pi pi-save","aria-hidden":"true"})})]})]}),d.jsxs("div",{className:ge.row2,children:[(v||w)&&d.jsxs("div",{className:ge.ausButtons,children:[v&&d.jsx(Ve,{variant:"danger",size:"sm",leadingIcon:d.jsx(ga,{}),badge:_,onClick:v,children:"Next Validation"}),w&&d.jsx(Ve,{variant:"secondary",size:"sm",leadingIcon:d.jsx(ba,{}),onClick:w,children:"Back to AUS"})]}),d.jsx(ya,{applicants:f,selectedApplicantId:p,onApplicantChange:m,onAddApplicant:g,height:44}),b&&b.length>0&&d.jsx(xa,{sortItems:b,onSortSelect:y,height:44,width:62}),d.jsx(jD,{tabs:k,activeTabId:S,onTabChange:C})]})]})});_a.displayName="URLATabsNavMobile";const ID="_bar_n62yy_1",DD="_leftGroup_n62yy_15",OD="_brand_n62yy_22",LD="_navGroup_n62yy_28",RD="_logo_n62yy_34",BD="_version_n62yy_40",$D="_navWrap_n62yy_48",PD="_navItem_n62yy_53",zD="_navItemOpen_n62yy_76",FD="_navItemPrimary_n62yy_80",HD="_navChevron_n62yy_91",WD="_navChevronOpen_n62yy_97",VD="_dropdownPanel_n62yy_102",UD="_dropdownItem_n62yy_116",qD="_dropdownDivider_n62yy_149",KD="_searchWrap_n62yy_156",GD="_search_n62yy_156",JD="_rightGroup_n62yy_172",YD="_profileArea_n62yy_180",QD="_profilePill_n62yy_186",XD="_roleLabel_n62yy_193",ZD="_avatarWrap_n62yy_200",eO="_avatarBtn_n62yy_205",tO="_profilePanel_n62yy_232",Ce={bar:ID,leftGroup:DD,brand:OD,navGroup:LD,logo:RD,version:BD,navWrap:$D,navItem:PD,navItemOpen:zD,navItemPrimary:FD,navChevron:HD,navChevronOpen:WD,dropdownPanel:VD,dropdownItem:UD,dropdownDivider:qD,searchWrap:KD,search:GD,rightGroup:JD,profileArea:YD,profilePill:QD,roleLabel:XD,avatarWrap:ZD,avatarBtn:eO,profilePanel:tO},Zf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAcCAYAAAD2izi6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAADIZJREFUeAHtWglwFFUafn1MT889k8yRTCZ3SEgIpxA3gJEzIKAU7KIuCmupoFW6sOyK7oIonmgpW4KWeC2lILfLoYRgQIlIjLDkgpBwBEIg12Qymfvoe19PJjAJJAFX2Sr0r+qZ6Xf8773v/XeCgN4Jgw8Hxo3DSan0LiI1fT5uThoFWEbH84JPcDvq2Obmb9nL53dTpaV1cCwanseDXxEhvbQh5jvuIIOzHy4ksgfn0TUnjzAnTu7mvLY6wGIIHqVKwuKSJ2GZWXdhKrWaczvcbEXFCue7b68FXcD/SgkXPzTPv7LUuPeQQzZ3fk5/E5T507P1az6qMvxri2D8dLtPPeW+NNB5CWjEMKLHNAm4TShSAkOSo/9wwwG6tXWv+8Vn14iN2nHjtLRcNRZPSB7J80CPSXAv29h8grt0piRYUdHQNVnz1KKJ0pyxBwXIkq4q+4Prn2/8G3SCGFLpIbkT2gQA1FKpDD9eXCACKIDbgJCIbyH6vfWbqMKvVnkLdlVrH3liNj4yZx2iUBoFrxsIwSCUTyigHMSDkABUoQSCIDjp4z++6P7g3bUhLvn5iqiZ91/EZAo9daJ8rvudt7aCMFDZOXlWaDuNhFRGV5YUScFtQl0AourHn5jKt7RdgsrWJp85t5Z3OaIEv49D9QZMQICba2mp4i7V1yNSmQS1JA7EDYYhsB8TaAqgplgmuHljtrzxfBM7b8EZiKwZT0pptt4/w9K10O0KYMjmgbQ0iRBkzqNxZi05bqqVqaul8Lh4wDk6ivx7ti4I7N3bdL3Jqj/Oz5VOmLKNt7bGS6fPOMMhKIfQNCZwwm4I3izQaesYcBtTp6E3GFDa3sHK8ib+GAIvMZmgC3akOlb+fRoErxX04q09WzYcbV/wUALnsC9C5EqA4DjGuhyL7H97UgRPvJzbGjyRxENioLQ0oN2yp449f5aSJKVgbReqcbBzpwiuCFxvIYkQflDnqyveVT+6oA4otYh77Vv7QOfFsODmCY3gC8LrCz36+4szkfDD99EPQN9OrD8eV/YhAsjpX3h1O3/pAiNJTJL6318dDQEVJ98oACIjxL3+48KIxW82mO4Ke7j41MwHlVr9UoIkM6AtJVAU5RiaavZ5nJvra/GXASgT+lgjZDL0ZnO6NtryhlypzUMQXhkajwJXwOs95rN1LGtqOlsVPvv1zhi6RKPRaIiypL4PbfZ4BMEUnV2CM+BxFbVdPvdnp9PpEvkiIDdXZnl6iZ9paeZ5u+N126qXVoBfgPpwIqHbtqRkpsYkplZRAb+MYxkebg29IioCDI5QlCdlCtTpcS48X/7Dx+DagD0EyODc8f/BcWIk5BMCGtJVHkDgCVKBshx9/GTpoVHgWhBDEp81fMyTMrVmXcDnuYYHJF6h0qL21sszLtRW7kN1CQmPCHarII0xoGHwMHBrCU0dOGK4KSH5rN/jxDmWFUi5AgU8X8Uw1G6Wpo9ISVkQSiLq93mCKlL+UcaI3LdAJ3hdGIeAGJ431cOz3HAIHiuVkQghldoYOrifoYL7JQTRKCHlKBX0sTzLDhuRN90DOsHDI/aCmBMyxpBK5Tq/101jGI5IpAoHQ9H7GJreL5XJ3AiKoT6Pg44yxe01m1PicfngrLkI5UPYJvfhMJNbmYaJlyXoYmKO+z1uGpdICCilBYjPNqumrKybA0rLGvGwWm/cGPR5aIVC84w5LXNLc11tJei0ZVDyJnxHB3ykABlIVWqu5XT9gNbW0xcjeZiTkzNi4geeDPo9SNDvlg/KyTt46tjhSRFDeIMleWcg4OVwiHjA73297sSh5ZE8MkfkbsAkxDyf182pTabPUImCTCWUUsBWVmwGt5649GGj1vu9HqiyAGdZ9GD1seIZZWVlPQ08WldTvqm9pWmyRCongn4vazTFfQ3C9ldjHJAiwfE8UcNkCiVeUVwog+BdBt2jB6S5vv58+eFCmVSmEC+Ol5KKiTExMYaucSaTyYjhwIgABMNQtKHuxDERvEiNxGrLS+djEtIFJ2AQ5BwUJhcqCQGn0Ewl+D+QQh31oPhNylVozfFvJoebexp3ESjh0rmTBzmGKoEGEUdRHPoKs15s18dqn6MCQR7DUdzabHsYhB0S6O5phTBfwd5mm49B/aSDfoHUGpd0jWMRTRLHMQBaC+DosH0RnhepkaHffpfjAIpiok0kcRxhoUSSAPM7aCCiPWcOADt28OAW5KohAAQk5FCgWtHZOXfDS0QUvY1HEAGaL04tGnWWZWBhSDYWNu8mJbIJAhBQXCIHjZ7Tu/vZu0A5m3bhRiOgAj5EodLkw7ZlYodESimEsG9HUaGjNwau9tY9Co0W8AJC4RKMZwielglywgj7OBPmutMKwDFwc9QVr/WM2/okn49VR7CA9o8f2t+cLo/IcyxQKJTx4m+oRjrouQEiCAywWv397EGwwjHmAbxoYyXQZhquMpcIV6NEpDdnira1XPociA8kHOOC7UiAVmtS4+9uAeBrg0Y7gBuTUdNeciYAbjwWRB/4a3J2bLxG+c6SyhLQe4zVjWC4QXWdFaqDF6rVaUQAJLgRQlASEZCwlHTKDd+5bn8ZkAgRJqIVfr9ZTesWf+J8u+17LEaXbBqe+NhpKMrVH27fdM+O5fsLS16bAm4s8g8Fr7MXpR5FMV4am37n2uemH10MbqCwarc32hKR7NAhpHI5W/l90SjwE4hnaVhWQ/VQLJHoxMQ0e0PD2T7WRmISEjIE4ecpnKOu2rq1ymg5IpOjxow5ecmwDW/9rmL573ctEet54ip4bxsJ9zFbLkw6F/RzUmsDXRyTJFu0tT7fnj/PFA26F1WvR3Qw4K+BIsALDKONGzh0Rh9zQvvQ6/Uqi8Ui02qTtCDsIR1226cYtOYUFeTjYgdsA53gXU8FQ97XaE7bSFOBnwVBtGHbt+WkAnMyVhudvnD0IdjGVLy3r9J1rmnz4oplYsrTpYrdQgL4CFMey1JvOJ9vV2vxtPIi29Cnxx4Zf+oH9xOOVn/UyvW/s86ZMwjvb31nW/M8kpRhDPQKJkPMV7GJAzJ6WY8dNnpyTULWKLcxZbDfkpkq1hpFoNDm+rMfwgxDtI+8ALjBWSPHrAPdA+0uHlzWiDEfwAsbLtoA8DOQeEDUWnRshmVi1hGkPZgwbdOfXtn30GcrDj67fU/bfUOqV7U8L9R/V/tV2faalTTlq6d8LBZvUWZOe8y8LGt01NSWs866NStPJRRttIbsTsYQch4gMFC4vXHpjh2n+qvGCM0NdeW6GPNOGHfNgvEdHZOQWqPR6Qtcdvubfre1CSWjYeYkn2Awxb9O+b1SnhJY6DnZ6tJvpoIIM+G0Ns5SRRt2QZFmUIx4csjoyTM6Wpr+EaRdxyhoaTVaZU60MX41vCejwHN10HlchOnhJPA/UlfVQZj9xeICQAWnaPQKrKOpefGeR7eKVWbxbxn09GW5U4blW1aZEqSDjFE47m51uBtO2I6cLGpZ/uUn9Se6xq0vzyulKO536mji9EPphzJBhA3tIxcO2dDsO8cXwExkGgSAhZIENVIifsACOA84hoGZHcfC+AyTKlWesm/36kD3SlFonew7xi4iFKo1MIflkU4mMCKWhEaKXhqmiawCqgvvaiZoiaYatqVD/9NQU1aSJDKJSUobZzQnHoKxEoDFixfqa6teATcA4JVDLCx97oz3UluSSiclOJ+3+JNZn08MA9BbeBLa+L0LUxIWvpxU1XAmoI1PV3hnxh5UgR7F1BF33eOGQ+UEKcd+PLAL7cEv5LUtSQPvjjbHfQ5DfIsIWsjQQ00TgYRDAh5Hy5t11eUvgesXakN7MVhSBsTGJ30Js4SBEDAReCAGvfAdyoe/1nrBlmOznfKOnHBvK88wethvrSw5ECcyiE/Lzo9NSPlanOd1298+U3l0KbhBAEUKSdHjBY8fISVgDOXy0OY0DdF07vK2i/vqX3OcVJwui8hPB40bpBw0lBozYX78mzotMtTVzoDYeOTCvebDqeDaMIa4+r5SfK5XL7xSg1OpVNGkLjaTgA5TwHhXkPbXdjQ1NYKIshfo/TwhHjqdTiNTRWVDMTRzAmcLwmTVefGiE3SqfU8eWMT+kM49gr7KZt0WBD1BnL36ngeG5Cdu9bc5AecLCDqTFFHC/IDAWD/t9rNqHUoQuEAGnEHAMywwp8jA0ULrM6/Or1oNfrky/k0F6T9h/E+i65Xqr/yHwaSnhs0cMNLwlygTMRhHeR2GsKgE5QCOcrwEE9wuO3XqXJn7o8YfTJuLi4s50Ld0/Ea/0bX0XxB9nrPY0cBvAAAAAElFTkSuQmCC";function ms(...t){return t.filter(Boolean).join(" ")}function nO(){return d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ep({items:t,onSelect:e,className:n}){return d.jsx("div",{role:"menu",className:ms(Ce.dropdownPanel,n),children:t.map(r=>r.divider?d.jsx("div",{className:Ce.dropdownDivider},r.value):d.jsxs("button",{role:"menuitem",className:Ce.dropdownItem,disabled:r.disabled,onClick:()=>e(r.value),children:[r.icon,r.label]},r.value))})}function rO({id:t,label:e,items:n,onSelect:r,isPrimary:s}){const[i,o]=x.useState(!1),l=x.useRef(null);return x.useEffect(()=>{if(!i)return;function a(u){l.current&&!l.current.contains(u.target)&&o(!1)}function c(u){u.key==="Escape"&&o(!1)}return document.addEventListener("mousedown",a),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",c)}},[i]),d.jsxs("div",{ref:l,className:Ce.navWrap,children:[d.jsxs("button",{className:ms(Ce.navItem,i&&Ce.navItemOpen,s&&Ce.navItemPrimary),onClick:()=>o(a=>!a),"aria-haspopup":"menu","aria-expanded":i,children:[s&&d.jsx("i",{className:"pi pi-plus-circle","aria-hidden":"true"}),e,n&&n.length>0&&d.jsx("span",{className:ms(Ce.navChevron,i&&Ce.navChevronOpen),children:d.jsx(nO,{})})]}),i&&n&&n.length>0&&d.jsx(ep,{items:n,onSelect:a=>{r==null||r(a),o(!1)}})]})}function sO(t){const e=t.trim().split(/\s+/);return e.length===1?e[0].slice(0,2).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function iO({profile:t}){const[e,n]=x.useState(!1),r=x.useRef(null),s=t.initials??sO(t.name);return x.useEffect(()=>{if(!e)return;function i(l){r.current&&!r.current.contains(l.target)&&n(!1)}function o(l){l.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",i),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",o)}},[e]),d.jsxs("div",{className:ms(Ce.profileArea,t.role&&Ce.profilePill),children:[t.role&&d.jsx("span",{className:Ce.roleLabel,children:t.role}),d.jsxs("div",{ref:r,className:Ce.avatarWrap,children:[d.jsx("button",{className:Ce.avatarBtn,onClick:()=>n(i=>!i),"aria-haspopup":"menu","aria-expanded":e,"aria-label":`${t.name} — open profile menu`,children:s}),e&&t.menuItems&&t.menuItems.length>0&&d.jsx(ep,{items:t.menuItems,className:Ce.profilePanel,onSelect:i=>{var o;(o=t.onMenuSelect)==null||o.call(t,i),n(!1)}})]})]})}const tp=x.forwardRef(function(e,n){const{version:r,navItems:s,onSearch:i,searchPlaceholder:o,profile:l,className:a,style:c}=e;return d.jsxs("div",{ref:n,className:ms(Ce.bar,a),style:c,children:[d.jsxs("div",{className:Ce.leftGroup,children:[d.jsxs("span",{className:Ce.brand,children:[d.jsx("img",{src:Zf,alt:"Clear",className:Ce.logo}),r&&d.jsx("span",{className:Ce.version,children:r})]}),d.jsx("div",{className:Ce.navGroup,children:s.map(u=>d.jsx(rO,{...u},u.id))})]}),d.jsx("div",{className:Ce.searchWrap,children:d.jsx(gs,{className:Ce.search,prefixIcon:d.jsx("i",{className:"pi pi-search","aria-hidden":"true"}),placeholder:o??"Search Leads and Loans",onChange:u=>i==null?void 0:i(u.target.value),"aria-label":"Search"})}),d.jsx("div",{className:Ce.rightGroup,children:d.jsx(iO,{profile:l})})]})}),oO="_bar_avirz_1",lO="_left_avirz_14",aO="_center_avirz_21",cO="_right_avirz_29",dO="_logo_avirz_37",uO="_logoClip_avirz_44",hO="_borrowerName_avirz_51",fO="_infoIcon_avirz_58",pO="_iconBtn_avirz_76",mO="_searchBtn_avirz_101",gO="_avatarWrap_avirz_106",bO="_avatarBtn_avirz_111",yO="_dropdownPanel_avirz_139",xO="_dropdownItem_avirz_154",vO="_dropdownDivider_avirz_187",Ze={bar:oO,left:lO,center:aO,right:cO,logo:dO,logoClip:uO,borrowerName:hO,infoIcon:fO,iconBtn:pO,searchBtn:mO,avatarWrap:gO,avatarBtn:bO,dropdownPanel:yO,dropdownItem:xO,dropdownDivider:vO},_O="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAcCAYAAACUJBTQAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAlmVYSWZNTQAqAAAACAAGARIAAwAAAAEAAQAAARoABQAAAAEAAABWARsABQAAAAEAAABeASgAAwAAAAEAAgAAATEAAgAAAAYAAABmh2kABAAAAAEAAABsAAAAAAAAAEgAAAABAAAASAAAAAFGaWdtYQAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGaADAAQAAAABAAAAHAAAAAD0nSgiAAAACXBIWXMAAAsTAAALEwEAmpwYAAABwGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIj4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5GaWdtYTwveG1wOkNyZWF0b3JUb29sPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4Kc6r2JgAABhdJREFUSA2tVQlMVEcYnnfse8vusiywy8q1nEIVERrQiqClakBjLZWKpliJUUETLdJW28ajmmpjW6tVNLVaNY2tiEbrUZDEkyoVTYSVw4NyCcoNwr7Csvv2HZ15+Fogtajpn8ybmf//vv//5583Mxh4thDQxIP4eFJJ01OooJA00st/AuAcroIg9olMdw3X3HyFe1R7xl5cXAOx+FNXwnCX2HAFnCMd5hUVpbQlv1dAjQufyt6rKHKUV5zheztqAEdgpJuzP+EdMIMYM3YK4azV8kw3w5nNG3v2fJMNuQPJ/YtjWUWigcuGLWs98q52O6WmTZQNz+o1CbPH6XcfKDMcOiZ6/HiiT5v4VjDEokTllUkTmS9loN9/5CLb2prHbPp4NzLo4uN1rMo5jjQFRAsC0BMKspd73FzON1b9bjObG2Syy8rM6fTEuEsidMmWlcyz7PzyFLShQIJcLtSL7nsPH7UX/LqtN/90pW7x8mQyeuI+TK3xEHsZINpsAJBwoTwsOaUAuFoDRFHsYW/f3MR8vweVCYCEBLVb0vyHhJNaby8vTWV2bc9FfuUguHbZ8plCS3sjoEC7Kin1vmDpdhOtfTyuNxAQxfAtLWV8Y309RjspcB+/V0iDYTy0EyJrB7jR02HL+Wmc6nFtE7covQpG9yL9A5vb5r/pg2IPBAkOpp0nTfXHVE46ZfzMm46a+3bS25fmHjUU2G4Xpffn5TUh8HBxfjcthp6WeFxkLL6YkobecB6wLCHy4pmuj1bMhXgFbI6BIDExTrTO6KVbmFbD1tXYSb8Aij2XG2w5daoOgtBeod9ShG2wIC5qgm7DlvcVQSHZwMECR0tTZs+mT/dAPfqJONgkkLThxmNnRa72DzthCiDa6yppsHkz2jQetuHOEW+wSJurXZI+C2h0GJO9/Tw0SjoZJK1E/9nWE5ha/Tbh5aOwfrfTnSkutkAACvC8gvzIyQweS3wcwFIpQ0NScAIj+HuVW2GAJ9DyIgGQIznA8DGaA9LVZFosdrWJ9CgD3rgmayPUjXhiJeYLfEhV+NhUzN6HcU3Mtae8F13FiOFwhVoZRGlowN0x54yIfkkACQ+xM0FhAGMdd17Sx4g0nMQ4goJBCGs3C9EESElBeyL9dSOynxOAKwjBQQksEFWUB+TwRsIS/ZzcwTA5KbkfbAM4wds6sX4GuAT5vo4sBhfdaH1sqAYOpWt/CPrZE3zBhwERWd9GTn4KGcLFhc6O6wRgReOrfksRoHL/iaMTsuadhEN0JaCTO5Kg+4lPzgy6FTvPreir/NfQE4G4qOyS4Jb7NdkadxXmpMI9QlOmBkAt2fqbef07pz9A7wG6s4ZkJbEGPqg0yOY4Vjej2mbl6bYGtnCUv1Nmbn1CV8Iiozu0SUniDcevlCrVRI+jrYMNyZh8FZHMe8/fsVQ35aw2ryuDc+mSg/3geqOxmLg0THukNqFLqyODSy90RKyKK3rj7g1meXer1W3z4UltKSlhUoJoSbiLQXPdMN47neixuQQmh5LVv5Rdrrt4t7q/xXI5qzC9M2iCIQquqUofqLLpvNWayDjPqFW7w/fPWeH7A9NqbTq0sdyU83V9O/TFL9kQsIugSdPtws61+7aUFUGdlJ2UVfLJ1fnAbkt00auJJ03Nq88uyUWvHQUbO3tdTGJkgs82o4kO83AjSaa1m2ko7yiquNCy/tzB+nIZd7h0arHdzk/SulMPFoZcHQP10m0sl0B6XDKKP6nqbWz3d3alKb6vt/Dg3J+nQyDaFykR2A8XycmcjEBTxuf+ZQ1V/TrfEHVvkuclZwiUfCKCHASNpayX5S8rUipArN3yJ+sV7EI1VT86/vB8/RfdFeoHJSUlDgREEhYfpgmLsMdOS/P9ylWHRVg6HcDTF6ub43UtCJrRXsh7OSQI4kqBknfMWjA+wS/X2t4D+L5+0dVIYxo1NBKclWWsnNYVpyhSVPb32IDg4IBXoBO4VdC2Zmta2Q7o4+8VIIdIBq9kQPPP2RBmrIxMGh1tyHIzUuEkLrgSGIcr4DNO4rygIODL3mW/W13CHHh8w5hTWFiIbm9Uvv/9FpcT+8/+L2NoT1d8TFvQAAAAAElFTkSuQmCC";function kO(t){const e=t.trim().split(/\s+/);return e.length===1?e[0].slice(0,2).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function wO({items:t,onSelect:e}){return d.jsx("div",{role:"menu",className:Ze.dropdownPanel,children:t.map(n=>n.divider?d.jsx("div",{className:Ze.dropdownDivider},n.value):d.jsxs("button",{role:"menuitem",className:Ze.dropdownItem,disabled:n.disabled,onClick:()=>e(n.value),children:[n.icon,n.label]},n.value))})}function CO({profile:t}){const[e,n]=x.useState(!1),r=x.useRef(null),s=t.initials??kO(t.name);return x.useEffect(()=>{if(!e)return;function i(l){r.current&&!r.current.contains(l.target)&&n(!1)}function o(l){l.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",i),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",o)}},[e]),d.jsxs("div",{ref:r,className:Ze.avatarWrap,children:[d.jsx("button",{className:Ze.avatarBtn,onClick:()=>n(i=>!i),"aria-haspopup":"menu","aria-expanded":e,"aria-label":`${t.name} — open profile menu`,children:s}),e&&t.menuItems&&t.menuItems.length>0&&d.jsx(wO,{items:t.menuItems,onSelect:i=>{var o;(o=t.onMenuSelect)==null||o.call(t,i),n(!1)}})]})}function np({borrower:t,onMenuOpen:e,onSearchOpen:n,profile:r,className:s,style:i}){const o=!!t;return d.jsxs("div",{className:[Ze.bar,s].filter(Boolean).join(" "),style:i,children:[d.jsxs("div",{className:Ze.left,children:[d.jsx("button",{className:Ze.iconBtn,onClick:e,"aria-label":"Open menu",children:d.jsx("i",{className:"pi pi-bars","aria-hidden":"true"})}),o&&d.jsx("img",{src:_O,alt:"Clear",className:Ze.logoClip})]}),d.jsx("div",{className:Ze.center,children:o?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Ze.borrowerName,children:t.name}),d.jsx("button",{className:Ze.infoIcon,onClick:t.onInfoClick,"aria-label":"Borrower info",children:d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})})]}):d.jsx("img",{src:Zf,alt:"Clear",className:Ze.logo})}),d.jsxs("div",{className:Ze.right,children:[d.jsx("button",{className:[Ze.iconBtn,Ze.searchBtn].join(" "),onClick:n,"aria-label":"Open search",children:d.jsx("i",{className:"pi pi-search","aria-hidden":"true"})}),d.jsx(CO,{profile:r})]})]})}const SO="_wrap_ojyp7_6",NO="_btn_ojyp7_13",AO="_btnMd_ojyp7_28",TO="_btnSm_ojyp7_33",EO="_btnLg_ojyp7_39",MO="_boltIcon_ojyp7_46",jO="_chevronIcon_ojyp7_47",IO="_btnBasic_ojyp7_66",DO="_btnFilled_ojyp7_82",OO="_menu_ojyp7_111",LO="_menuItem_ojyp7_124",RO="_menuItemDisabled_ojyp7_139",BO="_menuItemIcon_ojyp7_152",$O="_menuDivider_ojyp7_159",ct={wrap:SO,btn:NO,btnMd:AO,btnSm:TO,btnLg:EO,boltIcon:MO,chevronIcon:jO,btnBasic:IO,btnFilled:DO,menu:OO,menuItem:LO,menuItemDisabled:RO,menuItemIcon:BO,menuDivider:$O},eo=x.forwardRef(function({variant:e="basic",size:n="md",items:r,onSelect:s,disabled:i,"aria-label":o="Quick actions",className:l,style:a},c){const[u,h]=x.useState(!1),f=x.useRef(null);x.useEffect(()=>{if(!u)return;function g(b){var y;(y=f.current)!=null&&y.contains(b.target)||h(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[u]),x.useEffect(()=>{if(!u)return;function g(b){b.key==="Escape"&&h(!1)}return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[u]);const p=g=>{h(!1),s(g)},m=[ct.btn,n==="sm"?ct.btnSm:n==="lg"?ct.btnLg:ct.btnMd,e==="filled"?ct.btnFilled:ct.btnBasic].filter(Boolean).join(" ");return d.jsxs("div",{ref:f,className:[ct.wrap,l??""].filter(Boolean).join(" "),style:a,children:[d.jsx(er,{content:o,placement:"top",children:d.jsxs("button",{ref:c,type:"button",className:m,disabled:i,"aria-label":o,"aria-haspopup":"menu","aria-expanded":u,onClick:()=>h(g=>!g),children:[d.jsx("span",{className:ct.boltIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-bolt"})}),d.jsx("span",{className:ct.chevronIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})]})}),u&&d.jsx("div",{role:"menu",className:ct.menu,children:r.map(g=>g.divider?d.jsx("div",{className:ct.menuDivider,role:"separator"},g.value):d.jsxs("div",{role:"menuitem",className:[ct.menuItem,g.disabled?ct.menuItemDisabled:""].filter(Boolean).join(" "),tabIndex:g.disabled?-1:0,"aria-disabled":g.disabled,onClick:()=>{g.disabled||p(g.value)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&!g.disabled&&(b.preventDefault(),p(g.value))},children:[g.icon&&d.jsx("span",{className:ct.menuItemIcon,"aria-hidden":"true",children:g.icon}),g.label]},g.value))})]})});eo.displayName="LightningButton";const PO="_nav_8y8kv_6",zO="_mainRow_8y8kv_18",FO="_menuToggle_8y8kv_29",HO="_tabsArea_8y8kv_56",WO="_actions_8y8kv_66",VO="_actionItem_8y8kv_75",UO="_divider_8y8kv_83",qO="_navBadgeDrop_8y8kv_94",KO="_navBadgeDropBtn_8y8kv_99",GO="_navBadgeDropLabel_8y8kv_128",JO="_navBadgeDropChevron_8y8kv_132",YO="_navBadgeDropBadge_8y8kv_139",QO="_navBadgeDropMenu_8y8kv_156",XO="_navBadgeDropItem_8y8kv_169",ZO="_navBadgeDropItemDisabled_8y8kv_184",eL="_conditionBadge_8y8kv_199",tL="_conditionDismiss_8y8kv_213",nL="_backBtn_8y8kv_234",rL="_breadcrumbs_8y8kv_259",sL="_breadcrumbItem_8y8kv_268",iL="_breadcrumbDot_8y8kv_281",oL="_status_green_8y8kv_288",lL="_status_yellow_8y8kv_289",aL="_status_red_8y8kv_290",cL="_status_gray_8y8kv_291",dL="_breadcrumbText_8y8kv_293",uL="_breadcrumbLabel_8y8kv_299",hL="_breadcrumbSublabel_8y8kv_309",fL="_expandBtn_8y8kv_319",pL="_toolbarRow_8y8kv_346",mL="_toolbarLeft_8y8kv_356",gL="_toolbarCenter_8y8kv_362",bL="_toolbarRight_8y8kv_369",de={nav:PO,mainRow:zO,menuToggle:FO,tabsArea:HO,actions:WO,actionItem:VO,divider:UO,navBadgeDrop:qO,navBadgeDropBtn:KO,navBadgeDropLabel:GO,navBadgeDropChevron:JO,navBadgeDropBadge:YO,navBadgeDropMenu:QO,navBadgeDropItem:XO,navBadgeDropItemDisabled:ZO,conditionBadge:eL,conditionDismiss:tL,backBtn:nL,breadcrumbs:rL,breadcrumbItem:sL,breadcrumbDot:iL,status_green:oL,status_yellow:lL,status_red:aL,status_gray:cL,breadcrumbText:dL,breadcrumbLabel:uL,breadcrumbSublabel:hL,expandBtn:fL,toolbarRow:pL,toolbarLeft:mL,toolbarCenter:gL,toolbarRight:bL},yL=()=>d.jsx("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M0 1h18M0 7h18M0 13h18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),gd=()=>d.jsx("i",{className:"pi pi-refresh","aria-hidden":"true"}),xL=()=>d.jsx("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),vL=()=>d.jsx("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M6 1L1 6l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),_L=()=>d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function kL({label:t,badge:e,items:n,onSelect:r}){const[s,i]=x.useState(!1),o=x.useRef(null);return x.useEffect(()=>{if(!s)return;function l(a){var c;(c=o.current)!=null&&c.contains(a.target)||i(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[s]),x.useEffect(()=>{if(!s)return;function l(a){a.key==="Escape"&&i(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[s]),d.jsxs("div",{ref:o,className:de.navBadgeDrop,children:[d.jsxs("button",{type:"button",className:de.navBadgeDropBtn,onClick:()=>i(l=>!l),"aria-haspopup":"menu","aria-expanded":s,children:[d.jsx("span",{className:de.navBadgeDropLabel,children:t}),d.jsx("span",{className:de.navBadgeDropChevron,children:d.jsx(_L,{})}),d.jsx("span",{className:de.navBadgeDropBadge,children:e})]}),s&&d.jsx("div",{role:"menu",className:de.navBadgeDropMenu,children:n.map(l=>d.jsxs("div",{role:"menuitem",className:[de.navBadgeDropItem,l.disabled?de.navBadgeDropItemDisabled:""].filter(Boolean).join(" "),tabIndex:l.disabled?-1:0,"aria-disabled":l.disabled,onClick:()=>{l.disabled||(r==null||r(l.value),i(!1))},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&!l.disabled&&(a.preventDefault(),r==null||r(l.value),i(!1))},children:[l.icon&&d.jsx("span",{"aria-hidden":"true",children:l.icon}),l.label]},l.value))})]})}function wL(t){const e=!t.label;return t.lightning&&t.items?d.jsx(eo,{variant:t.lightningVariant??"filled",size:"sm",items:t.items,onSelect:t.onSelect??(()=>{}),"aria-label":t.ariaLabel??"Quick actions"},t.value):e&&t.items?d.jsx($i,{label:"",leadingIcon:t.icon,variant:"secondary",size:"sm",items:t.items,onSelect:t.onSelect,"aria-label":t.ariaLabel??t.value},t.value):e?d.jsx(ut,{icon:t.icon,variant:"secondary",size:"sm","aria-label":t.ariaLabel??t.value,onClick:t.onClick},t.value):t.items&&t.badge!=null?d.jsx(kL,{label:t.label??"",badge:t.badge,items:t.items,onSelect:t.onSelect},t.value):t.items?d.jsx($i,{label:t.label??"",leadingIcon:t.icon,variant:t.variant??"secondary",size:"sm",items:t.items,onSelect:t.onSelect},t.value):d.jsx(Ve,{variant:t.variant??"secondary",size:"sm",leadingIcon:t.icon,onClick:t.onClick,children:t.label},t.value)}const rp=x.forwardRef(function(e,n){const{tabs:r,activeTabId:s,onTabChange:i,onMenuToggle:o,secondaryActions:l=[],onRefresh:a,primaryLabel:c="Save Loan",onPrimary:u,primaryItems:h,onPrimarySelect:f,condition:p,toolbar:m,banner:g,collapsed:b=!1,collapsedSection:y,onCollapsedBack:v,onExpandTabs:_,collapsedQuickItems:w=[],onCollapsedQuickAction:k}=e,S=r.find(T=>T.id===s),C=T=>[de.breadcrumbDot,T?de[`status_${T}`]:""].filter(Boolean).join(" "),D=u&&(h!=null&&h.length?d.jsx(fa,{label:c,onAction:u,items:h,onSelect:f,variant:"primary",size:"sm"}):d.jsx(Ve,{variant:"primary",size:"sm",onClick:u,children:c})),B=d.jsxs("div",{className:de.actions,children:[p&&d.jsxs("div",{className:de.conditionBadge,children:[d.jsx("span",{className:de.conditionLabel,children:p.label}),p.onDismiss&&d.jsx("button",{className:de.conditionDismiss,onClick:p.onDismiss,"aria-label":"Dismiss condition",children:d.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l7 7M8 1L1 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),l.map(T=>d.jsxs("div",{className:de.actionItem,children:[T.dividerBefore&&d.jsx("span",{className:de.divider,"aria-hidden":"true"}),wL(T)]},T.value)),a&&d.jsx(ut,{variant:"secondary",size:"sm","aria-label":"Refresh",icon:d.jsx(gd,{}),onClick:a}),D]}),N=d.jsxs("div",{className:de.actions,children:[w.length>0&&d.jsx(eo,{variant:"filled",size:"sm",items:w,onSelect:k??(()=>{}),"aria-label":"Quick actions"}),a&&d.jsx(ut,{variant:"secondary",size:"sm","aria-label":"Refresh",icon:d.jsx(gd,{}),onClick:a}),D]});return d.jsxs("nav",{ref:n,className:[de.nav,b?de.collapsed:""].filter(Boolean).join(" "),children:[d.jsxs("div",{className:de.mainRow,children:[d.jsx("button",{className:de.menuToggle,onClick:o,"aria-label":"Toggle menu",children:d.jsx(yL,{})}),b?d.jsxs(d.Fragment,{children:[v&&d.jsx("button",{className:de.backBtn,onClick:v,"aria-label":"Back",children:d.jsx(vL,{})}),d.jsxs("div",{className:de.breadcrumbs,children:[y&&d.jsxs("div",{className:de.breadcrumbItem,children:[y.status&&d.jsx("span",{className:C(y.status)}),d.jsxs("div",{className:de.breadcrumbText,children:[d.jsx("span",{className:de.breadcrumbLabel,children:y.label}),y.subLabel&&d.jsx("span",{className:de.breadcrumbSublabel,children:y.subLabel})]})]}),S&&d.jsxs("div",{className:de.breadcrumbItem,children:[S.status.shape!=="none"&&d.jsx("span",{className:C(S.status.color)}),d.jsxs("div",{className:de.breadcrumbText,children:[d.jsxs("span",{className:de.breadcrumbLabel,children:[S.label,S.subLabel?` / ${S.subLabel}`:""]}),S.subtitle&&d.jsx("span",{className:de.breadcrumbSublabel,children:S.subtitle})]})]})]}),_&&d.jsx("button",{className:de.expandBtn,onClick:_,"aria-label":"Show all tabs",children:d.jsx(xL,{})}),N]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:de.tabsArea,children:d.jsx(pa,{items:r,activeId:s,onChange:i})}),B]})]}),m&&!b&&d.jsxs("div",{className:de.toolbarRow,children:[m.left&&d.jsx("div",{className:de.toolbarLeft,children:m.left}),m.center&&d.jsx("div",{className:de.toolbarCenter,children:m.center}),m.right&&d.jsx("div",{className:de.toolbarRight,children:m.right})]}),g&&!b&&d.jsx(ma,{severity:g.severity??"warn",title:g.title,detail:g.detail,closable:g.closable??!0,onClose:g.onClose})]})}),CL="_wrapper_14b3i_8",SL="_wrapperScrollable_14b3i_18",NL="_scrollContainer_14b3i_22",AL="_table_14b3i_29",TL="_headerRow_14b3i_41",EL="_headerCell_14b3i_45",ML="_md_14b3i_58",jL="_sm_14b3i_59",IL="_headerCellSortable_14b3i_61",DL="_headerCellContent_14b3i_69",OL="_headerText_14b3i_76",LL="_sortIcon_14b3i_83",RL="_sortIconActive_14b3i_91",BL="_sortPriority_14b3i_95",$L="_filterBtnWrap_14b3i_104",PL="_filterBtn_14b3i_104",zL="_filterBtnActive_14b3i_130",FL="_expandCol_14b3i_138",HL="_selectCol_14b3i_139",WL="_editCol_14b3i_140",VL="_bodyRow_14b3i_149",UL="_bodyCell_14b3i_154",qL="_rowSelected_14b3i_158",KL="_rowStriped_14b3i_163",GL="_rowClickable_14b3i_167",JL="_expandCell_14b3i_189",YL="_selectCell_14b3i_190",QL="_editCell_14b3i_191",XL="_expandBtn_14b3i_197",ZL="_groupRow_14b3i_219",eR="_groupCell_14b3i_223",tR="_groupToggle_14b3i_236",nR="_groupLabel_14b3i_244",rR="_groupCount_14b3i_248",sR="_expansionRow_14b3i_256",iR="_expansionCell_14b3i_260",oR="_cellEditWrap_14b3i_272",lR="_cellInput_14b3i_284",aR="_rowEditBtns_14b3i_298",cR="_footerRow_14b3i_309",dR="_footerCell_14b3i_313",uR="_emptyCell_14b3i_325",hR="_loadingOverlay_14b3i_333",fR="_skeleton_14b3i_341",pR="_shimmer_14b3i_1",mR="_filterPopover_14b3i_360",gR="_filterBody_14b3i_382",bR="_filterRule_14b3i_391",yR="_filterOperatorRow_14b3i_397",xR="_filterOperatorBtn_14b3i_403",vR="_filterOperatorActive_14b3i_416",_R="_filterRuleRow_14b3i_422",kR="_filterInputRow_14b3i_428",wR="_filterSelect_14b3i_434",CR="_filterInput_14b3i_428",SR="_filterFieldFull_14b3i_461",NR="_filterRemoveBtn_14b3i_474",AR="_filterAddRule_14b3i_494",TR="_filterChecklist_14b3i_506",ER="_filterCheckItem_14b3i_514",MR="_filterGroup_14b3i_532",jR="_filterGroupHeader_14b3i_538",IR="_filterGroupLabel_14b3i_545",DR="_filterGroupClear_14b3i_553",OR="_filterFooter_14b3i_564",LR="_filterResetBtn_14b3i_574",RR="_filterApplyBtn_14b3i_591",z={wrapper:CL,wrapperScrollable:SL,scrollContainer:NL,table:AL,headerRow:TL,headerCell:EL,md:ML,sm:jL,headerCellSortable:IL,headerCellContent:DL,headerText:OL,sortIcon:LL,sortIconActive:RL,sortPriority:BL,filterBtnWrap:$L,filterBtn:PL,filterBtnActive:zL,expandCol:FL,selectCol:HL,editCol:WL,bodyRow:VL,bodyCell:UL,rowSelected:qL,rowStriped:KL,rowClickable:GL,expandCell:JL,selectCell:YL,editCell:QL,expandBtn:XL,groupRow:ZL,groupCell:eR,groupToggle:tR,groupLabel:nR,groupCount:rR,expansionRow:sR,expansionCell:iR,cellEditWrap:oR,cellInput:lR,rowEditBtns:aR,footerRow:cR,footerCell:dR,emptyCell:uR,loadingOverlay:hR,skeleton:fR,shimmer:pR,filterPopover:mR,filterBody:gR,filterRule:bR,filterOperatorRow:yR,filterOperatorBtn:xR,filterOperatorActive:vR,filterRuleRow:_R,filterInputRow:kR,filterSelect:wR,filterInput:CR,filterFieldFull:SR,filterRemoveBtn:NR,filterAddRule:AR,filterChecklist:TR,filterCheckItem:ER,filterGroup:MR,filterGroupHeader:jR,filterGroupLabel:IR,filterGroupClear:DR,filterFooter:OR,filterResetBtn:LR,filterApplyBtn:RR},bd=d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function BR(t){const e=t.match(/^(\d{4})-(\d{2})-(\d{2})$/);return e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10)):null}function $R(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`}const PR=[{label:"Contains",value:"contains"},{label:"Starts with",value:"startsWith"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Greater than",value:"gt"},{label:"Less than",value:"lt"},{label:"Blank",value:"blank"},{label:"Not blank",value:"notBlank"}],zR=[{label:"Date equal to",value:"dateEquals"},{label:"Date not equal to",value:"dateNotEquals"},{label:"Date before",value:"dateBefore"},{label:"Date after",value:"dateAfter"},{label:"Date on or before",value:"dateOnOrBefore"},{label:"Date on or after",value:"dateOnOrAfter"},{label:"Blank",value:"blank"},{label:"Not blank",value:"notBlank"}],yd=new Set(["blank","notBlank"]);function FR({value:t,dataType:e,onApply:n,onReset:r,onClose:s}){var m;const i=e==="date"?zR:PR,o=i[0].value,[l,a]=x.useState((m=t==null?void 0:t.rules)!=null&&m.length?t.rules:[{matchMode:o,value:""}]),[c,u]=x.useState((t==null?void 0:t.operator)??"and");function h(g,b){a(y=>y.map((v,_)=>_===g?{...v,...b}:v))}function f(){a(g=>[...g,{matchMode:o,value:""}])}function p(g){a(b=>b.filter((y,v)=>v!==g))}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:z.filterBody,children:[l.map((g,b)=>d.jsxs("div",{className:z.filterRule,children:[b>0&&d.jsx("div",{className:z.filterOperatorRow,children:d.jsx(Al,{options:[{label:"AND",value:"and"},{label:"OR",value:"or"}],value:c,onChange:y=>u(y)})}),d.jsxs("div",{className:z.filterRuleRow,children:[d.jsx("div",{className:z.filterFieldFull,children:d.jsx(pr,{options:i,value:g.matchMode,onChange:y=>y&&h(b,{matchMode:y}),style:{width:"100%"}})}),!yd.has(g.matchMode)&&d.jsxs("div",{className:z.filterInputRow,children:[d.jsx("div",{className:z.filterFieldFull,children:e==="date"?d.jsx(Nl,{value:g.value?BR(g.value):null,onChange:y=>h(b,{value:y?$R(y):""}),style:{width:"100%"}}):d.jsx(gs,{placeholder:"Value",value:g.value,onChange:y=>h(b,{value:y.target.value})})}),l.length>1&&d.jsx(ut,{variant:"ghost",size:"sm",icon:bd,"aria-label":"Remove rule",onClick:()=>p(b)})]}),yd.has(g.matchMode)&&l.length>1&&d.jsx("div",{className:z.filterInputRow,children:d.jsx(ut,{variant:"ghost",size:"sm",icon:bd,"aria-label":"Remove rule",onClick:()=>p(b)})})]})]},b)),d.jsx(Ve,{variant:"ghost",size:"sm",onClick:f,style:{alignSelf:"flex-start"},children:"+ Add rule"})]}),d.jsx(ka,{onReset:r,onApply:()=>n({operator:c,rules:l}),onClose:s})]})}function HR({options:t=[],value:e,onApply:n,onReset:r,onClose:s}){const[i,o]=x.useState(new Set(e??[])),[l,a]=x.useState(""),c=t.filter(g=>g.label.toLowerCase().includes(l.toLowerCase())),u=c.length>0&&c.every(g=>i.has(g.value)),f=c.some(g=>i.has(g.value))&&!u;function p(g){o(b=>{const y=new Set(b);return y.has(g)?y.delete(g):y.add(g),y})}function m(){o(u?g=>{const b=new Set(g);return c.forEach(y=>b.delete(y.value)),b}:g=>{const b=new Set(g);return c.forEach(y=>b.add(y.value)),b})}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:z.filterBody,children:[d.jsx(gs,{placeholder:"Search…",value:l,onChange:g=>a(g.target.value),prefixIcon:d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsxs("div",{className:z.filterChecklist,children:[d.jsx(Gn,{label:"Select All",checked:u,indeterminate:f,onChange:m}),c.map(g=>d.jsx(Gn,{label:g.label,checked:i.has(g.value),onChange:()=>p(g.value)},String(g.value)))]})]}),d.jsx(ka,{onReset:r,onApply:()=>n(Array.from(i)),onClose:s})]})}function WR({groups:t=[],value:e,onApply:n,onReset:r,onClose:s}){const[i,o]=x.useState(new Set(e??[]));function l(c){o(u=>{const h=new Set(u);return h.has(c)?h.delete(c):h.add(c),h})}function a(c){o(u=>{const h=new Set(u);return c.options.forEach(f=>h.delete(f.value)),h})}return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:z.filterBody,children:t.map(c=>d.jsxs("div",{className:z.filterGroup,children:[d.jsxs("div",{className:z.filterGroupHeader,children:[d.jsx("span",{className:z.filterGroupLabel,children:c.label}),d.jsx(Ve,{variant:"link",size:"sm",onClick:()=>a(c),children:"Clear All"})]}),c.options.map(u=>d.jsx(Gn,{label:u.label,checked:i.has(u.value),onChange:()=>l(u.value)},String(u.value)))]},c.label))}),d.jsx(ka,{onReset:r,onApply:()=>n(Array.from(i)),onClose:s})]})}function ka({onReset:t,onApply:e,onClose:n}){return d.jsxs("div",{className:z.filterFooter,children:[d.jsx(Ve,{variant:"secondary",size:"sm",onClick:()=>{t(),n()},children:"Reset"}),d.jsx(Ve,{variant:"primary",size:"sm",onClick:()=>{e(),n()},children:"Apply"})]})}function VR({config:t,onClose:e,anchorRef:n}){const r=x.useRef(null),[s,i]=x.useState(null);x.useEffect(()=>{function l(){var p;const a=(p=n.current)==null?void 0:p.getBoundingClientRect();if(!a)return;const c=280,u=360;let h=a.bottom+4,f=a.left;f+c>window.innerWidth-8&&(f=Math.max(8,a.right-c)),h+u>window.innerHeight-8&&(h=Math.max(8,a.top-u-4)),i({top:h,left:f})}return l(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[n]),x.useEffect(()=>{function l(a){const c=a.target;c.closest("[data-popover-root]")||r.current&&!r.current.contains(c)&&n.current&&!n.current.contains(c)&&e()}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[e,n]),x.useEffect(()=>{function l(a){a.key==="Escape"&&e()}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]);function o(){var l;(l=t.onChange)==null||l.call(t,null)}return s?qt.createPortal(d.jsxs("div",{ref:r,"data-popover-root":"",className:z.filterPopover,style:{top:s.top,left:s.left},children:[t.type==="rule"&&d.jsx(FR,{value:t.value,dataType:t.dataType??"text",onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e}),t.type==="checklist"&&d.jsx(HR,{options:t.options,value:t.value,onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e}),t.type==="grouped-checklist"&&d.jsx(WR,{groups:t.groups,value:t.value,onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e})]}),document.body):null}function xd(t){return t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"label"in t[0]&&"data"in t[0]}function Nt(t,e){return t[e]}function $r(t,e){return t[e]}function UR(){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M5 2L2 6h6L5 2z",fill:"currentColor"})})}function qR(){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M5 8L2 4h6L5 8z",fill:"currentColor"})})}function KR(){return d.jsxs("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",children:[d.jsx("path",{d:"M5 2L2 6h6L5 2z",fill:"currentColor",opacity:"0.3"}),d.jsx("path",{d:"M5 12L2 8h6l-3 4z",fill:"currentColor",opacity:"0.3"})]})}function GR({active:t}){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M1 2h8M2.5 5h5M4 8h2",stroke:t?"var(--teal-700,#047880)":"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function vd(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M4 2l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function _d(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 4l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const kd=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),JR=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M8 2l2 2-6 6H2V8l6-6z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function wa({data:t,columns:e,dataKey:n="id",selectionMode:r="none",selection:s,onSelectionChange:i,sortMode:o="single",sortField:l,sortOrder:a,multiSortMeta:c,onSort:u,expansion:h,editMode:f,onRowEditSave:p,onRowEditCancel:m,onCellEdit:g,stripedRows:b=!1,size:y="md",showFooter:v=!1,loading:_=!1,emptyMessage:w="No data found.",scrollable:k=!1,scrollHeight:S,className:C,style:D}){const[B,N]=x.useState(new Set),[T,$]=x.useState(()=>xd(t)?new Set(t.filter(E=>E.defaultExpanded!==!1).map(E=>E.label)):new Set),[R,L]=x.useState(null),[U,V]=x.useState(null),[M,P]=x.useState({}),[H,oe]=x.useState(null),ae=x.useRef(new Map),Ae=xd(t),Ie=Ae?t.flatMap(E=>E.data):t,Be=!!h,A=r==="multiple",q=f==="row",re=e.length+(Be?1:0)+(A?1:0)+(q?1:0);function xe(E){var W;return o==="multiple"&&c?((W=c.find(ce=>ce.field===E))==null?void 0:W.order)??0:l===E?a??0:0}function $e(E){if(o!=="multiple"||!c)return null;const W=c.findIndex(ce=>ce.field===E);return W>=0?W+1:null}function Bt(E){if(!u)return;const ce=xe(E)===1?-1:1;if(o==="multiple"){const ee=c?[...c]:[],De=ee.findIndex(kt=>kt.field===E);De>=0?ee[De]={field:E,order:ce}:ee.push({field:E,order:ce}),u({field:E,order:ce,multiSortMeta:ee})}else u({field:E,order:ce})}function Dt(E){if(!s)return!1;const W=Nt(E,n);return Array.isArray(s)?s.some(ce=>Nt(ce,n)===W):Nt(s,n)===W}function rr(E){if(!(r==="none"&&f!=="cell")){if(r==="single")i==null||i(Dt(E)?null:E);else if(r==="multiple"){const W=Array.isArray(s)?[...s]:[],ce=Nt(E,n),ee=W.findIndex(De=>Nt(De,n)===ce);ee>=0?W.splice(ee,1):W.push(E),i==null||i(W)}}}function cn(E){i==null||i(E?[...Ie]:[])}const $t=Ie.length>0&&Ie.every(E=>Dt(E)),Pt=!$t&&Ie.some(E=>Dt(E));function Gt(E){const W=h?Nt(E,h.dataKey):Nt(E,n);N(ce=>{const ee=new Set(ce);return ee.has(W)?ee.delete(W):ee.add(W),ee})}function wr(E){const W=h?Nt(E,h.dataKey):Nt(E,n);return B.has(W)}function sr(E){const W=Nt(E,n),ce={};e.forEach(ee=>{ce[ee.field]=$r(E,ee.field)}),L(W),P(ce)}function Cr(E){const W={...E,...M};p==null||p(W,E),L(null),P({})}function G(){L(null),P({}),m==null||m()}function O(E,W){const ce=Nt(E,n);V({rowKey:ce,field:W}),P({[W]:$r(E,W)})}function X(E,W){const ce={...E,[W]:M[W]};g==null||g(ce,W,M[W]),V(null),P({})}function pe(E){return ae.current.has(E)||ae.current.set(E,{current:null}),ae.current.get(E)}function _e(E){var ce;if(!((ce=E.filter)!=null&&ce.value))return!1;const W=E.filter.value;return Array.isArray(W)?W.length>0:typeof W=="object"&&W!==null?(W.rules??[]).some(De=>De.value!==""):!1}const _t=()=>d.jsx("thead",{children:d.jsxs("tr",{className:z.headerRow,children:[Be&&d.jsx("th",{className:`${z.headerCell} ${z.expandCol}`}),A&&d.jsx("th",{className:`${z.headerCell} ${z.selectCol}`,children:d.jsx(Gn,{checked:$t,indeterminate:Pt,onChange:E=>cn(E.target.checked),"aria-label":"Select all rows",size:"sm"})}),e.map(E=>{const W=xe(E.field),ce=$e(E.field),ee=E.filter?pe(E.field):null;return d.jsx("th",{className:`${z.headerCell} ${E.sortable?z.headerCellSortable:""}`,style:{width:E.width,textAlign:E.align??"left"},onClick:()=>E.sortable&&Bt(E.field),"aria-sort":W===1?"ascending":W===-1?"descending":"none",children:d.jsxs("span",{className:z.headerCellContent,children:[d.jsx("span",{className:z.headerText,children:E.header}),E.sortable&&d.jsxs("span",{className:`${z.sortIcon} ${W!==0?z.sortIconActive:""}`,children:[W===1?d.jsx(UR,{}):W===-1?d.jsx(qR,{}):d.jsx(KR,{}),ce!==null&&d.jsx("span",{className:z.sortPriority,children:ce})]}),E.filter&&d.jsxs("div",{className:z.filterBtnWrap,onClick:De=>De.stopPropagation(),children:[d.jsx("button",{ref:ee,type:"button",className:`${z.filterBtn} ${_e(E)?z.filterBtnActive:""}`,"aria-label":`Filter ${E.header}`,onClick:()=>oe(De=>De===E.field?null:E.field),children:d.jsx(GR,{active:_e(E)})}),H===E.field&&ee&&d.jsx(VR,{config:E.filter,onClose:()=>oe(null),anchorRef:ee})]})]})},E.field)}),q&&d.jsx("th",{className:`${z.headerCell} ${z.editCol}`})]})}),ft=x.useCallback((E,W,ce)=>{const ee=Nt(E,n),De=Dt(E),kt=Be&&wr(E),_s=f==="row"&&R===ee,to=[z.bodyRow,De?z.rowSelected:"",b&&ce?z.rowStriped:"",r!=="none"?z.rowClickable:""].filter(Boolean).join(" "),te=e.map(Te=>{const no=f==="cell"&&U!=null&&U.rowKey===ee&&U.field===Te.field,Ca=_s||no;let ir;return Ca&&Te.editor?ir=Te.editor({...E,...M},Te.field,Mn=>P(ro=>({...ro,[Te.field]:Mn}))):Ca?ir=d.jsx("input",{className:z.cellInput,value:String(M[Te.field]??$r(E,Te.field)??""),onChange:Mn=>P(ro=>({...ro,[Te.field]:Mn.target.value}))}):Te.body?ir=Te.body(E,W):ir=String($r(E,Te.field)??""),d.jsx("td",{className:z.bodyCell,style:{textAlign:Te.align??"left"},onClick:()=>{f==="cell"&&Te.editor&&!no&&(U&&X(E,U.field),O(E,Te.field))},children:no?d.jsxs("div",{className:z.cellEditWrap,children:[ir,d.jsx(ut,{variant:"ghost",size:"sm",icon:d.jsx(kd,{}),"aria-label":"Confirm edit",onClick:Mn=>{Mn.stopPropagation(),X(E,Te.field)}}),d.jsx(Rt,{size:"sm","aria-label":"Cancel edit",onClick:Mn=>{Mn.stopPropagation(),V(null),P({})}})]}):ir},Te.field)});return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:to,onClick:()=>{r!=="none"&&rr(E)},"aria-selected":r!=="none"?De:void 0,children:[Be&&d.jsx("td",{className:`${z.bodyCell} ${z.expandCell}`,children:d.jsx("button",{type:"button",className:z.expandBtn,onClick:Te=>{Te.stopPropagation(),Gt(E)},"aria-label":kt?"Collapse row":"Expand row","aria-expanded":kt,children:kt?d.jsx(_d,{}):d.jsx(vd,{})})}),A&&d.jsx("td",{className:`${z.bodyCell} ${z.selectCell}`,onClick:Te=>Te.stopPropagation(),children:d.jsx(Gn,{checked:De,onChange:()=>rr(E),"aria-label":"Select row",size:"sm"})}),te,q&&d.jsx("td",{className:`${z.bodyCell} ${z.editCell}`,onClick:Te=>Te.stopPropagation(),children:_s?d.jsxs("div",{className:z.rowEditBtns,children:[d.jsx(ut,{variant:"ghost",size:"sm",icon:d.jsx(kd,{}),"aria-label":"Save row",onClick:()=>Cr(E)}),d.jsx(Rt,{size:"sm","aria-label":"Cancel edit",onClick:G})]}):d.jsx(ut,{variant:"ghost",size:"sm",icon:d.jsx(JR,{}),"aria-label":"Edit row",onClick:()=>sr(E)})})]},String(ee)),Be&&kt&&h&&d.jsx("tr",{className:z.expansionRow,children:d.jsx("td",{colSpan:re,className:z.expansionCell,children:h.template?h.template(E):h.childKey?d.jsx(wa,{data:$r(E,String(h.childKey))??[],columns:h.columns??e,dataKey:n,selectionMode:r,stripedRows:b,size:y,showFooter:v,editMode:f}):null})},`${String(ee)}-expansion`)]})},[e,R,U,M,B,s,b,Be,A,q,r,f]),Jt=()=>_?d.jsx("tbody",{children:Array.from({length:5}).map((E,W)=>d.jsx("tr",{className:z.bodyRow,children:Array.from({length:re}).map((ce,ee)=>d.jsx("td",{className:z.bodyCell,children:d.jsx("span",{className:z.skeleton})},ee))},W))}):Ie.length===0?d.jsx("tbody",{children:d.jsx("tr",{children:d.jsx("td",{colSpan:re,className:z.emptyCell,children:w})})}):Ae?d.jsx("tbody",{children:t.map(E=>{const W=T.has(E.label);return d.jsxs(d.Fragment,{children:[d.jsx("tr",{className:z.groupRow,onClick:()=>$(ce=>{const ee=new Set(ce);return ee.has(E.label)?ee.delete(E.label):ee.add(E.label),ee}),children:d.jsxs("td",{colSpan:re,className:z.groupCell,children:[d.jsx("span",{className:z.groupToggle,children:W?d.jsx(_d,{}):d.jsx(vd,{})}),d.jsx("span",{className:z.groupLabel,children:E.label}),d.jsxs("span",{className:z.groupCount,children:["(",E.data.length,")"]})]})},`group-${E.label}`),W&&E.data.map((ce,ee)=>ft(ce,ee,ee%2!==0))]})})}):d.jsx("tbody",{children:t.map((E,W)=>ft(E,W,W%2!==0))}),Sr=()=>!v||!e.some(W=>W.footer!==void 0)?null:d.jsx("tfoot",{children:d.jsxs("tr",{className:z.footerRow,children:[Be&&d.jsx("td",{className:z.footerCell}),A&&d.jsx("td",{className:z.footerCell}),e.map(W=>d.jsx("td",{className:z.footerCell,style:{textAlign:W.align??"left"},children:typeof W.footer=="function"?W.footer(Ie):W.footer},W.field)),q&&d.jsx("td",{className:z.footerCell})]})}),Nr=[z.table,z[y],b?z.striped:""].filter(Boolean).join(" "),dn=[z.wrapper,k?z.wrapperScrollable:"",C??""].filter(Boolean).join(" ");return d.jsxs("div",{className:dn,style:D,children:[d.jsx("div",{className:z.scrollContainer,style:k&&S?{maxHeight:S,overflowY:"auto"}:void 0,children:d.jsxs("table",{className:Nr,role:"grid",children:[_t(),Jt(),Sr()]})}),_&&d.jsx("div",{className:z.loadingOverlay,"aria-busy":"true","aria-label":"Loading"})]})}wa.displayName="DataTable";const YR="_shell_1l18z_1",sp={shell:YR};function QR({topBar:t,loanBannerNav:e,urlATabsNav:n,className:r,style:s}){return d.jsxs("div",{className:[sp.shell,r].filter(Boolean).join(" "),style:s,children:[d.jsx(tp,{...t}),e&&d.jsx(rp,{...e}),n&&d.jsx(va,{...n})]})}function XR({topBar:t,urlATabsNavMobile:e,className:n,style:r}){const s=!!t.borrower&&!!e;return d.jsxs("div",{className:[sp.shell,n].filter(Boolean).join(" "),style:r,children:[d.jsx(np,{...t}),s&&d.jsx(_a,{...e})]})}exports.AUSChip=Wf;exports.Accordion=If;exports.BannerAlert=ma;exports.BannerTabs=pa;exports.Button=Ve;exports.Calendar=Nd;exports.Card=jf;exports.Checkbox=Gn;exports.CloseButton=Rt;exports.DEFAULT_DOC_TYPES=qf;exports.DataTable=wa;exports.DatePicker=Nl;exports.Drawer=Of;exports.DropdownButton=$i;exports.FileUpload=Kf;exports.FullNav=QR;exports.FullNavMobile=XR;exports.IconButton=ut;exports.InlineAlert=Uf;exports.InlineContainedAlert=Vf;exports.InputText=gs;exports.LightningButton=eo;exports.ListBox=wd;exports.LoanBannerNav=rp;exports.MiscChip=Gs;exports.Modal=Gf;exports.MultiSelect=Sd;exports.Paginator=Ef;exports.Picklist=Mf;exports.Popup=Jf;exports.ProfileChip=Hf;exports.ProgressBar=Pf;exports.ProgressSpinner=zf;exports.RadioButton=Cd;exports.RichTextEditor=wf;exports.Select=pr;exports.SelectButton=Al;exports.SeverityChip=Ff;exports.SidePanel=Yf;exports.SidePanelLayout=Qf;exports.SplitButton=fa;exports.Tabs=Df;exports.TextArea=Ad;exports.Toast=$f;exports.Toaster=Bf;exports.ToggleSwitch=Cf;exports.Tooltip=er;exports.TopBar=tp;exports.TopBarMobile=np;exports.URLATabsNav=va;exports.URLATabsNavMobile=_a;exports.URLATabsNavTablet=Xf;exports.toast=RM;
171
+ `),[i,o]=cS(s);if(i.length===0)return;const l=hf(i,0,n);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:l,raw:s.slice(0,o).join(`
172
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(uS,this.editor.getAttributes(od)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=_r({find:ld,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=_r({find:ld,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(od)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),hS=/^\s*(\[([( |x])?\])\s$/,pf=lt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",ye(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const s=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return na(t,e,s)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=h=>{var f,p;l.ariaLabel=((p=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:p.call(f,h,l.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};c(t),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const m=n();if(typeof m!="number")return!1;const g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g==null?void 0:g.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,f])=>{s.setAttribute(h,f)}),s.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,i.append(l,o),s.append(i,a),Object.entries(e).forEach(([h,f])=>{s.setAttribute(h,f)});let u=new Set(Object.keys(e));return{dom:s,contentDOM:a,update:h=>{if(h.type!==this.type)return!1;s.dataset.checked=h.attrs.checked,l.checked=h.attrs.checked,c(h);const f=r.extensionManager.attributes,p=us(h,f),m=new Set(Object.keys(p)),g=this.options.HTMLAttributes;return u.forEach(b=>{m.has(b)||(b in g?s.setAttribute(b,g[b]):s.removeAttribute(b))}),Object.entries(p).forEach(([b,y])=>{y==null?b in g?s.setAttribute(b,g[b]):s.removeAttribute(b):s.setAttribute(b,y)}),u=m,!0}}}},addInputRules(){return[_r({find:hS,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),mf=lt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",ye(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
173
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=i=>{const o=pl(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(i)},s=pl(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});je.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(rf.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(sf.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(uf.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(ff.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(pf.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(mf.configure(this.options.taskList)),t}});var Fs="&nbsp;",Fo=" ",fS=lt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ye(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===Fs||n[0].text===Fs||n[0].raw===Fo||n[0].text===Fo)&&r.length===1&&r[0].type==="text"&&(r[0].text===Fs||r[0].text===Fo)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,s;if(!t)return"";const i=Array.isArray(t.content)?t.content:[];if(i.length===0){const o=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((s=n==null?void 0:n.previousNode)==null?void 0:s.type)==="paragraph"&&o.length===0?Fs:""}return e.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),pS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,mS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,gS=Kt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Zn({find:pS,type:this.type})]},addPasteRules(){return[Nn({find:mS,type:this.type})]}}),bS=lt.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),gf=Kt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ye(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),yS=gf;function xS(t={}){return new Ne({view(e){return new _S(e,t)}})}class _S{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):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),n=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,l=i.height/s.offsetHeight;if(n){let h=e.nodeBefore,f=e.nodeAfter;if(h||f){let p=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=h?m.bottom:m.top;h&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*l;r={left:m.left,right:m.right,top:g-b,bottom:g+b}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:h.left-f,right:h.left+f,top:h.top,bottom:h.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let h=a.getBoundingClientRect(),f=h.width/a.offsetWidth,p=h.height/a.offsetHeight;c=h.left-a.scrollLeft*f,u=h.top-a.scrollTop*p}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,e):s;if(n&&!i){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=nu(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Me extends se{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Me.valid(r)?new Me(r):se.near(r)}content(){return F.empty}eq(e){return e instanceof Me&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Me(e.resolve(n.pos))}getBookmark(){return new pa(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!vS(e)||!kS(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Me.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(n>0?e.indexAfter(o)<l.childCount:e.index(o)>0){i=l.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=n;let a=e.doc.resolve(s);if(Me.valid(a))return a}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!J.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let l=e.doc.resolve(s);if(Me.valid(l))return l}return null}}}Me.prototype.visible=!1;Me.findFrom=Me.findGapCursorFrom;se.jsonID("gapcursor",Me);class pa{constructor(e){this.pos=e}map(e){return new pa(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Me.valid(n)?new Me(n):se.near(n)}}function bf(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function vS(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||bf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function kS(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||bf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function wS(){return new Ne({props:{decorations:AS,createSelectionBetween(t,e,n){return e.pos==n.pos&&Me.valid(n)?new Me(n):null},handleClick:SS,handleKeyDown:CS,handleDOMEvents:{beforeinput:NS}}})}const CS=sh({ArrowLeft:Hs("horiz",-1),ArrowRight:Hs("horiz",1),ArrowUp:Hs("vert",-1),ArrowDown:Hs("vert",1)});function Hs(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof Q){if(!i.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Me.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new Me(c))),!0):!1}}function SS(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Me.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&J.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Me(r))),!0)}function NS(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Me))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let s=j.empty;for(let o=r.length-1;o>=0;o--)s=j.from(r[o].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new F(s,0,0));return i.setSelection(Q.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function AS(t){if(!(t.selection instanceof Me))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Se.create(t.doc,[tt.widget(t.selection.head,e,{key:"gapcursor"})])}var Pi=200,qe=function(){};qe.prototype.append=function(e){return e.length?(e=qe.from(e),!this.length&&e||e.length<Pi&&this.leafAppend(e)||this.length<Pi&&e.leafPrepend(this)||this.appendInner(e)):this};qe.prototype.prepend=function(e){return e.length?qe.from(e).append(this):this};qe.prototype.appendInner=function(e){return new TS(this,e)};qe.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?qe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};qe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};qe.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};qe.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},n,r),s};qe.from=function(e){return e instanceof qe?e:e&&e.length?new yf(e):qe.empty};var yf=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,l){for(var a=i;a<o;a++)if(s(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,o,l){for(var a=i-1;a>=o;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=Pi)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=Pi)return new e(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qe);qe.empty=new yf([]);var TS=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,s,i,o){var l=this.left.length;if(s<l&&this.left.forEachInner(r,s,Math.min(i,l),o)===!1||i>l&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(i,l)-l,o+l)===!1||i<l&&this.left.forEachInvertedInner(r,Math.min(s,l),i,o)===!1)return!1},e.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(qe);const ES=500;class Ot{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,l,a,c=[],u=[];return this.items.forEach((h,f)=>{if(!h.step){s||(s=this.remapping(r,f+1),i=s.maps.length),i--,u.push(h);return}if(s){u.push(new Wt(h.map));let p=h.step.map(s.slice(i)),m;p&&o.maybeStep(p).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],c.push(new Wt(m,void 0,void 0,c.length+u.length))),i--,m&&s.appendMap(m,i)}else o.maybeStep(h.step);if(h.selection)return l=s?h.selection.map(s.slice(i)):h.selection,a=new Ot(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,n,r,s){let i=[],o=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let h=e.steps[u].invert(e.docs[u]),f=new Wt(e.mapping.maps[u],h,n),p;(p=a&&a.merge(f))&&(f=p,u?i.pop():l=l.slice(0,l.length-1)),i.push(f),n&&(o++,n=void 0),s||(a=f)}let c=o-r.depth;return c>jS&&(l=MS(l,c),o-=c),new Ot(l.append(i),o)}remapping(e,n){let r=new ss;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ot(this.items.append(e.map(n=>new Wt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},s);let a=n;this.items.forEach(f=>{let p=i.getMirror(--a);if(p==null)return;o=Math.min(o,p);let m=i.maps[p];if(f.step){let g=e.steps[p].invert(e.docs[p]),b=f.selection&&f.selection.map(i.slice(a+1,p));b&&l++,r.push(new Wt(m,g,b))}else r.push(new Wt(m))},s);let c=[];for(let f=n;f<o;f++)c.push(new Wt(i.maps[f]));let u=this.items.slice(0,s).append(c).append(r),h=new Ot(u,l);return h.emptyItemCount()>ES&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,s=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)s.push(o),o.selection&&i++;else if(o.step){let a=o.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let u=o.selection&&o.selection.map(n.slice(r));u&&i++;let h=new Wt(c.invert(),a,u),f,p=s.length-1;(f=s.length&&s[p].merge(h))?s[p]=f:s.push(h)}}else o.map&&r--},this.items.length,0),new Ot(qe.from(s.reverse()),i)}}Ot.empty=new Ot(qe.empty,0);function MS(t,e){let n;return t.forEach((r,s)=>{if(r.selection&&e--==0)return n=s,!1}),t.slice(n)}class Wt{constructor(e,n,r,s){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Wt(n.getMap().invert(),n,this.selection)}}}class mn{constructor(e,n,r,s,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const jS=20;function IS(t,e,n,r){let s=n.getMeta(Kn),i;if(s)return s.historyState;n.getMeta(LS)&&(t=new mn(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Kn))return o.getMeta(Kn).redo?new mn(t.done.addTransform(n,void 0,r,Js(e)),t.undone,ad(n.mapping.maps),t.prevTime,t.prevComposition):new mn(t.done,t.undone.addTransform(n,void 0,r,Js(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!o&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!DS(n,t.prevRanges)),c=o?Ho(t.prevRanges,n.mapping):ad(n.mapping.maps);return new mn(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,Js(e)),Ot.empty,c,n.time,l??t.prevComposition)}else return(i=n.getMeta("rebased"))?new mn(t.done.rebased(n,i),t.undone.rebased(n,i),Ho(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new mn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Ho(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function DS(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&s>=e[i]&&(n=!0)}),n}function ad(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,s,i,o)=>e.push(i,o));return e}function Ho(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let s=e.map(t[r],1),i=e.map(t[r+1],-1);s<=i&&n.push(s,i)}return n}function OS(t,e,n){let r=Js(e),s=Kn.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let o=i.selection.resolve(i.transform.doc),l=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),s,r),a=new mn(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(o).setMeta(Kn,{redo:n,historyState:a})}let Wo=!1,cd=null;function Js(t){let e=t.plugins;if(cd!=e){Wo=!1,cd=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Wo=!0;break}}return Wo}const Kn=new Re("history"),LS=new Re("closeHistory");function RS(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ne({key:Kn,state:{init(){return new mn(Ot.empty,Ot.empty,null,0,-1)},apply(e,n,r){return IS(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,s=r=="historyUndo"?_f:r=="historyRedo"?vf:null;return!s||!e.editable?!1:(n.preventDefault(),s(e.state,e.dispatch))}}}})}function xf(t,e){return(n,r)=>{let s=Kn.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(r){let i=OS(s,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const _f=xf(!1,!0),vf=xf(!0,!0);je.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ne({key:new Re("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){t=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const l=o-s,a=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,a=i-r,c=l-a,u=l;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var BS=je.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[xS(this.options)]}});je.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ne({key:new Re("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!n||!r)return Se.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((a,c)=>{if(a.isText)return;if(!(s>=c&&s<=c+a.nodeSize-1))return!1;o+=1});let l=0;return t.descendants((a,c)=>{if(a.isText||!(s>=c&&s<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(tt.node(c,c+a.nodeSize,{class:this.options.className}))}),Se.create(t,i)}}})]}});var $S=je.create({name:"gapCursor",addProseMirrorPlugins(){return[wS()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=me(K(t,"allowGapCursor",n)))!=null?e:null}}}),kf="placeholder",ms=new Re("tiptap__placeholder"),dd=200;function ud(t){const{editor:e,placeholder:n,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=t,u=[a];return o&&u.push(c),tt.node(s,s+i.nodeSize,{class:u.join(" "),[r]:typeof n=="function"?n({editor:e,node:i,pos:s,hasAnchor:l}):n})}function PS({editor:t,options:e,dataAttribute:n,doc:r,selection:s}){var i,o;if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:a}=s,c=[],u=t.isEmpty,h={emptyEditor:e.emptyEditorClass,emptyNode:e.emptyNodeClass};if(e.showOnlyCurrent&&!e.includeChildren){const p=r.resolve(a),m=p.depth>0?p.node(1):p.nodeAfter,g=p.depth>0?p.before(1):a;if(m&&m.type.isTextblock&&hs(m)){const b=a>=g&&a<=g+m.nodeSize;c.push(ud({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:b,placeholder:e.placeholder,classes:h,node:m,pos:g}))}}else{const p=ms.getState(t.state),m=(i=p==null?void 0:p.topPos)!=null?i:0,g=(o=p==null?void 0:p.bottomPos)!=null?o:r.content.size;r.nodesBetween(m,g,(b,y)=>{const _=a>=y&&a<=y+b.nodeSize,v=!b.isLeaf&&hs(b);return b.type.isTextblock&&(_||!e.showOnlyCurrent)&&v&&c.push(ud({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:_,placeholder:e.placeholder,classes:h,node:b,pos:y})),e.includeChildren})}return Se.create(r,c)}function zS(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function FS(t){const e=getComputedStyle(t),n=`${e.overflow} ${e.overflowY} ${e.overflowX}`;return/auto|scroll|overlay/.test(n)}function HS(t){let e=t;for(;e;){if(FS(e))return e;const n=e.parentElement;if(!n){const r=e.getRootNode();if(r instanceof ShadowRoot){e=r.host;continue}return window}e=n}return window}function WS(t){return t===window?{top:0,bottom:window.innerHeight}:t.getBoundingClientRect()}function VS({doc:t,view:e,scrollContainer:n}){const r=e.dom.getBoundingClientRect(),s=n?WS(n):{top:0,bottom:window.innerHeight},i=Math.max(r.top,s.top)-dd,o=Math.min(r.bottom,s.bottom)+dd;if(i>=o)return{top:0,bottom:t.content.size};const a=getComputedStyle(e.dom).direction==="rtl"?Math.max(r.right-2,r.left+2):r.left+2,c=e.posAtCoords({left:a,top:i+2}),u=e.posAtCoords({left:a,top:o-2});return{top:c?c.pos:0,bottom:u?u.pos:t.content.size}}var US={init(){return{topPos:null,bottomPos:null}},apply(t,e){const n=t.getMeta(ms);return n!=null&&n.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:t.docChanged?{topPos:e.topPos!==null?t.mapping.map(e.topPos):null,bottomPos:e.bottomPos!==null?t.mapping.map(e.bottomPos):null}:e}};function qS(t){const e=HS(t.dom),n=()=>{const l=VS({view:t,doc:t.state.doc,scrollContainer:e}),a=ms.getState(t.state);if((a==null?void 0:a.topPos)===l.top&&(a==null?void 0:a.bottomPos)===l.bottom)return;const c=t.state.tr.setMeta(ms,{positions:l});t.dispatch(c)};let r=null,s=0;const i=150,o=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;const l=performance.now();l-s>=i?(s=l,n()):o()}))};return e.addEventListener("scroll",o,{passive:!0}),n(),{update(l,a){t.state.doc.content.size!==a.doc.content.size&&o()},destroy:()=>{r!==null&&cancelAnimationFrame(r),e.removeEventListener("scroll",o)}}}function KS({editor:t,options:e}){const n=e.dataAttribute?`data-${zS(e.dataAttribute)}`:`data-${kf}`;return new Ne({key:ms,state:US,view:qS,props:{decorations:({doc:r,selection:s})=>PS({editor:t,options:e,dataAttribute:n,doc:r,selection:s})}})}var GS=je.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:kf,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[KS({editor:this.editor,options:this.options})]}});je.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ne({key:new Re("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||_h(n.selection)||t.view.dragging?null:Se.create(n.doc,[tt.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});var JS="skipTrailingNode";function hd({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var YS=je.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Re(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new Ne({key:e,appendTransaction:(s,i,o)=>{const{doc:l,tr:a,schema:c}=o,u=e.getState(o),h=l.content.size,f=c.nodes[n];if(!s.some(p=>p.getMeta(JS))&&u)return a.insert(h,f.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!hd({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!hd({node:o,types:r})}}})]}}),QS=je.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>_f(t,e),redo:()=>({state:t,dispatch:e})=>vf(t,e)}},addProseMirrorPlugins(){return[RS(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()}}}),XS=je.create({name:"starterKit",addExtensions(){var t,e,n,r;const s=[];return this.options.bold!==!1&&s.push(uC.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(oC.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(rf.configure(this.options.bulletList)),this.options.code!==!1&&s.push(pC.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(bC.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(yC.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(BS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push($S.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(xC.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(_C.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(QS.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(vC.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(NC.configure(this.options.italic)),this.options.listItem!==!1&&s.push(sf.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(uf.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&s.push(nf.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(ff.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(fS.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(gS.configure(this.options.strike)),this.options.text!==!1&&s.push(bS.configure(this.options.text)),this.options.underline!==!1&&s.push(gf.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push(YS.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),ZS=XS,eN=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,tN=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,nN=Kt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||qk(t,"background-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ye(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){const s=/^(==)([^=]+)(==)/.exec(t);if(s){const i=s[2].trim(),o=n.inlineTokens(i);return{type:"highlight",raw:s[0],text:i,tokens:o}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Zn({find:eN,type:this.type})]},addPasteRules(){return[Nn({find:tN,type:this.type})]}}),rN=nN,sN=Kt.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),iN=sN,oN=Kt.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),lN=oN,aN=je.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),cN=aN,dN=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,uN=lt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ye(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,o;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",a=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",c=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return c?`![${a}](${l} "${c}")`:`![${a}](${l})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:l})=>{const a=document.createElement("img");Object.entries(o).forEach(([h,f])=>{if(f!=null)switch(h){case"width":case"height":break;default:a.setAttribute(h,f);break}}),a.src=o.src;const c=new Wk({element:a,editor:l,node:s,getPos:i,onResize:(h,f)=>{a.style.width=`${h}px`,a.style.height=`${f}px`},onCommit:(h,f)=>{const p=i();p!==void 0&&this.editor.chain().setNodeSelection(p).updateAttributes(this.name,{width:h,height:f}).run()},onUpdate:(h,f,p)=>h.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),u=c.dom;return u.style.visibility="hidden",u.style.pointerEvents="none",a.onload=()=>{u.style.visibility="",u.style.pointerEvents=""},c}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Bh({find:dN,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),hN=uN;function fN(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=t,a=r&&!s,c=Uk(n),u=new RegExp(`\\s${c}$`),h=o?"^":"",f=s?"":c,p=a?new RegExp(`${h}${c}.*?(?=\\s${f}|$)`,"gm"):new RegExp(`${h}(?:^)?${c}[^\\s${f}]*`,"gm"),m=((e=l.nodeBefore)==null?void 0:e.isText)&&l.nodeBefore.text;if(!m)return null;const g=l.pos-m.length,b=Array.from(m.matchAll(p)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const y=b.input.slice(Math.max(0,b.index-1),b.index),_=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!_)return null;const v=g+b.index;let w=v+b[0].length;return a&&u.test(m.slice(w-1,w+1))&&(b[0]+=" ",w+=1),v<l.pos&&w>=l.pos?{range:{from:v,to:w},query:b[0].slice(n.length),text:b[0]}:null}function pN(t){return t.docChanged?t.steps.some(e=>{const n=e.slice;if(!(n!=null&&n.content))return!1;const r=n.content.textBetween(0,n.content.size,`
174
+ `);return/\s/.test(r)}):!1}var mN=new Re("suggestion");function gN({pluginKey:t=mN,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:a="suggestion",decorationContent:c="",decorationEmptyClass:u="is-empty",command:h=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=fN,shouldShow:b,shouldResetDismissed:y}){let _;const v=p==null?void 0:p(),w=r&&!s,k=()=>{const N=e.state.selection.$anchor.pos,T=e.view.coordsAtPos(N),{top:$,right:R,bottom:L,left:U}=T;try{return new DOMRect(U,$,R-U,L-$)}catch{return null}},S=(N,T)=>T?()=>{const $=t.getState(e.state),R=$==null?void 0:$.decorationId,L=N.dom.querySelector(`[data-decoration-id="${R}"]`);return(L==null?void 0:L.getBoundingClientRect())||null}:k,C=({match:N,dismissedRange:T,state:$,transaction:R})=>y!=null&&y({editor:e,state:$,range:T,match:N,transaction:R,allowSpaces:w})?!1:w?N.range.from===T.from:N.range.from===T.from&&!pN(R);function D(N,T){var $;try{const L=t.getState(N.state),U=L!=null&&L.decorationId?N.dom.querySelector(`[data-decoration-id="${L.decorationId}"]`):null,V={editor:e,range:(L==null?void 0:L.range)||{from:0,to:0},query:(L==null?void 0:L.query)||null,text:(L==null?void 0:L.text)||null,items:[],command:M=>h({editor:e,range:(L==null?void 0:L.range)||{from:0,to:0},props:M}),decorationNode:U,clientRect:S(N,U)};($=v==null?void 0:v.onExit)==null||$.call(v,V)}catch{}const R=N.state.tr.setMeta(T,{exit:!0});N.dispatch(R)}const B=new Ne({key:t,view(){return{update:async(N,T)=>{var $,R,L,U,V,M,P;const H=($=this.key)==null?void 0:$.getState(T),ie=(R=this.key)==null?void 0:R.getState(N.state),le=H.active&&ie.active&&H.range.from!==ie.range.from,Ae=!H.active&&ie.active,Ie=H.active&&!ie.active,Be=!Ae&&!Ie&&H.query!==ie.query,A=Ae||le&&Be,q=Be||le,ne=Ie||le&&Be;if(!A&&!q&&!ne)return;const xe=ne&&!A?H:ie,$e=N.dom.querySelector(`[data-decoration-id="${xe.decorationId}"]`);_={editor:e,range:xe.range,query:xe.query,text:xe.text,items:[],command:Bt=>h({editor:e,range:xe.range,props:Bt}),decorationNode:$e,clientRect:S(N,$e)},A&&((L=v==null?void 0:v.onBeforeStart)==null||L.call(v,_)),q&&((U=v==null?void 0:v.onBeforeUpdate)==null||U.call(v,_)),(q||A)&&(_.items=await f({editor:e,query:xe.query})),ne&&((V=v==null?void 0:v.onExit)==null||V.call(v,_)),q&&((M=v==null?void 0:v.onUpdate)==null||M.call(v,_)),A&&((P=v==null?void 0:v.onStart)==null||P.call(v,_))},destroy:()=>{var N;_&&((N=v==null?void 0:v.onExit)==null||N.call(v,_))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(N,T,$,R){const{isEditable:L}=e,{composing:U}=e.view,{selection:V}=N,{empty:M,from:P}=V,H={...T},ie=N.getMeta(t);if(ie&&ie.exit)return H.active=!1,H.decorationId=null,H.range={from:0,to:0},H.query=null,H.text=null,H.dismissedRange=T.active?{...T.range}:T.dismissedRange,H;if(H.composing=U,N.docChanged&&H.dismissedRange!==null&&(H.dismissedRange={from:N.mapping.map(H.dismissedRange.from),to:N.mapping.map(H.dismissedRange.to)}),L&&(M||e.view.composing)){(P<T.range.from||P>T.range.to)&&!U&&!T.composing&&(H.active=!1);const le=g({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:V.$from}),Ae=`id_${Math.floor(Math.random()*4294967295)}`;le&&m({editor:e,state:R,range:le.range,isActive:T.active})&&(!b||b({editor:e,range:le.range,query:le.query,text:le.text,transaction:N}))?(H.dismissedRange!==null&&!C({match:le,dismissedRange:H.dismissedRange,state:R,transaction:N})&&(H.dismissedRange=null),H.dismissedRange===null?(H.active=!0,H.decorationId=T.decorationId?T.decorationId:Ae,H.range=le.range,H.query=le.query,H.text=le.text):H.active=!1):(le||(H.dismissedRange=null),H.active=!1)}else H.active=!1;return H.active||(H.decorationId=null,H.range={from:0,to:0},H.query=null,H.text=null),H}},props:{handleKeyDown(N,T){var $,R;const{active:L,range:U}=B.getState(N.state);if(!L)return!1;if(T.key==="Escape"||T.key==="Esc"){const M=B.getState(N.state);return($=v==null?void 0:v.onKeyDown)==null||$.call(v,{view:N,event:T,range:M.range}),D(N,t),!0}return((R=v==null?void 0:v.onKeyDown)==null?void 0:R.call(v,{view:N,event:T,range:U}))||!1},decorations(N){const{active:T,range:$,decorationId:R,query:L}=B.getState(N);if(!T)return null;const U=!(L!=null&&L.length),V=[a];return U&&V.push(u),Se.create(N.doc,[tt.inline($.from,$.to,{nodeName:l,class:V.join(" "),"data-decoration-id":R,"data-decoration-content":c})])}}});return B}function bN({editor:t,overrideSuggestionOptions:e,extensionName:n,char:r="@"}){const s=new Re;return{editor:t,char:r,pluginKey:s,command:({editor:i,range:o,props:l})=>{var a,c,u;const h=i.view.state.selection.$to.nodeAfter;((a=h==null?void 0:h.text)==null?void 0:a.startsWith(" "))&&(o.to+=1),i.chain().focus().insertContentAt(o,[{type:n,attrs:{...l,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(u=(c=i.view.dom.ownerDocument.defaultView)==null?void 0:c.getSelection())==null||u.collapseToEnd()},allow:({state:i,range:o})=>{const l=i.doc.resolve(o.from),a=i.schema.nodes[n];return!!l.parent.type.contentMatch.matchType(a)},...e}}function wf(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>bN({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function fd(t,e){const n=wf(t),r=n.find(s=>s.char===e);return r||(n.length?n[0]:null)}var yN=lt.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,r;return`${(n=e==null?void 0:e.char)!=null?n:"@"}${(r=t.attrs.label)!=null?r:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var r,s;return["span",ye(this.HTMLAttributes,t.HTMLAttributes),`${(r=n==null?void 0:n.char)!=null?r:"@"}${(s=e.attrs.label)!=null?s:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=fd(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ye({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const r={...this.options};r.HTMLAttributes=ye({"data-type":this.name},this.options.HTMLAttributes,e);const s=this.options.renderHTML({options:r,node:t,suggestion:n});return typeof s=="string"?["span",ye({"data-type":this.name},this.options.HTMLAttributes,e),s]:s},...$h({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,s,i,o]=r,l=i??o;e[s==="char"?"mentionSuggestionChar":s]=l,r=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:fd(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:s,anchor:i}=r;if(!s)return!1;let o=new Mt,l=0;return e.doc.nodesBetween(i-1,i,(a,c)=>{if(a.type.name===this.name)return n=!0,o=a,l=c,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,l,l+o.nodeSize),n})}},addProseMirrorPlugins(){return wf(this).map(gN)}}),xN=yN;const _N="_dropdown_rtanl_1",vN="_item_rtanl_14",kN="_itemSelected_rtanl_32",wN="_empty_rtanl_37",Lr={dropdown:_N,item:vN,itemSelected:kN,empty:wN},Cf=x.forwardRef(({items:t,command:e},n)=>{const[r,s]=x.useState(0);return x.useEffect(()=>s(0),[t]),x.useImperativeHandle(n,()=>({onKeyDown(i){if(i.key==="ArrowUp")return t.length&&s(o=>(o+t.length-1)%t.length),!0;if(i.key==="ArrowDown")return t.length&&s(o=>(o+1)%t.length),!0;if(i.key==="Enter"){const o=t[r];return o&&e(o),!0}return!1}})),t.length?d.jsx("div",{className:Lr.dropdown,children:t.map((i,o)=>d.jsx("button",{type:"button",className:[Lr.item,o===r?Lr.itemSelected:""].filter(Boolean).join(" "),onMouseEnter:()=>s(o),onClick:()=>e(i),children:i.label},i.id))}):d.jsx("div",{className:Lr.dropdown,children:d.jsx("div",{className:Lr.empty,children:"No results"})})});Cf.displayName="MentionList";const CN="_root_8iz1d_7",SN="_labelRow_8iz1d_15",NN="_label_8iz1d_15",AN="_required_8iz1d_25",TN="_outer_8iz1d_32",EN="_inner_8iz1d_40",MN="_innerDisabled_8iz1d_50",jN="_innerInvalid_8iz1d_50",IN="_innerWithCounter_8iz1d_84",DN="_innerWithToolbar_8iz1d_89",ON="_toolbar_8iz1d_95",LN="_innerOnFocusMode_8iz1d_107",RN="_toolbarAbsolute_8iz1d_112",BN="_toolbarHidden_8iz1d_121",$N="_editorOnFocusTransition_8iz1d_127",PN="_toolbarBtn_8iz1d_132",zN="_toolbarBtnActive_8iz1d_157",FN="_labelBold_8iz1d_166",HN="_labelItalic_8iz1d_167",WN="_labelUnderline_8iz1d_168",VN="_labelStrike_8iz1d_169",UN="_labelHeading_8iz1d_170",qN="_labelSubscript_8iz1d_171",KN="_labelSuperscript_8iz1d_172",GN="_divider_8iz1d_175",JN="_urlBar_8iz1d_185",YN="_urlInput_8iz1d_193",QN="_urlConfirm_8iz1d_212",XN="_urlCancel_8iz1d_213",ZN="_editor_8iz1d_127",eA="_editorWithInnerCounter_8iz1d_340",tA="_counter_8iz1d_351",nA="_counterInside_8iz1d_359",rA="_bottomRow_8iz1d_372",sA="_helperText_8iz1d_378",iA="_errorText_8iz1d_384 _helperText_8iz1d_378",re={root:CN,labelRow:SN,label:NN,required:AN,outer:TN,inner:EN,innerDisabled:MN,innerInvalid:jN,innerWithCounter:IN,innerWithToolbar:DN,toolbar:ON,innerOnFocusMode:LN,toolbarAbsolute:RN,toolbarHidden:BN,editorOnFocusTransition:$N,toolbarBtn:PN,toolbarBtnActive:zN,labelBold:FN,labelItalic:HN,labelUnderline:WN,labelStrike:VN,labelHeading:UN,labelSubscript:qN,labelSuperscript:KN,divider:GN,urlBar:JN,urlInput:YN,urlConfirm:QN,urlCancel:XN,editor:ZN,editorWithInnerCounter:eA,counter:tA,counterInside:nA,bottomRow:rA,helperText:sA,errorText:iA};function Oe({label:t,active:e,onAction:n,disabled:r,children:s}){return d.jsx(er,{content:t,placement:"top",delay:300,children:d.jsx("button",{type:"button",className:[re.toolbarBtn,e?re.toolbarBtnActive:""].filter(Boolean).join(" "),onMouseDown:i=>{i.preventDefault(),n()},"aria-label":t,"aria-pressed":e,disabled:r,children:s})})}const oA=[{id:"1",label:"John Smith (Borrower)"},{id:"2",label:"Jane Doe (Co-Borrower)"},{id:"3",label:"Mike Johnson (Loan Officer)"},{id:"4",label:"Sarah Lee (Processor)"},{id:"5",label:"TitleCo Inc. (Title Company)"},{id:"6",label:"First National Bank (Lender)"},{id:"7",label:"Apex Appraisals (Appraiser)"}];function lA(t){return{items:async({query:e})=>{const n=t??oA,r=typeof n=="function"?await n(e):n,s=e.toLowerCase();return r.filter(i=>i.label.toLowerCase().includes(s)).slice(0,8)},render:()=>{let e=null,n=null;const r=s=>{const i=s.clientRect,o=i==null?void 0:i();o&&n&&(n.style.top=`${o.bottom+window.scrollY+4}px`,n.style.left=`${o.left+window.scrollX}px`)};return{onStart(s){n=document.createElement("div"),n.style.cssText="position:absolute;z-index:9999;",document.body.appendChild(n),e=new rC(Cf,{props:s,editor:s.editor}),n.appendChild(e.element),r(s)},onUpdate(s){e==null||e.updateProps(s),r(s)},onKeyDown({event:s}){var i;return((i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(s))??!1},onExit(){n==null||n.remove(),e==null||e.destroy(),n=null,e=null}}}}}const Sf=x.forwardRef((t,e)=>{const{label:n,showLabel:r=!0,required:s,helperText:i,helperTextContent:o="Helper text",invalid:l,disabled:a,placeholder:c,defaultValue:u,onChange:h,maxLength:f,counterPlacement:p="outside",toolbarMode:m="always",showBold:g,showItalic:b,showUnderline:y,showStrike:_,showCode:v,showHighlight:w,showSubscript:k,showSuperscript:S,showHeading:C,headingLevels:D=[1,2,3],showBlockquote:B,showCodeBlock:N,showBulletList:T,showOrderedList:$,showTaskList:R,showHorizontalRule:L,showTextAlign:U,showLink:V,showImage:M,showMention:P,showUndo:H,showRedo:ie,mentionSuggestions:le,className:Ae,style:Ie,...Be}=t,A=x.useId(),q=`${A}-helper`,ne=!!i,[xe,$e]=x.useState(!1),[Bt,Dt]=x.useState(!1),[rr,an]=x.useState(!1),[$t,Pt]=x.useState(""),Gt=x.useRef(null),Cr=Bt||rr,[sr,Sr]=x.useState(0),G=Qw({extensions:[ZS.configure({link:!1,underline:!1}),yS,rN,iN,lN,mf,pf.configure({nested:!0}),cN.configure({types:["heading","paragraph"]}),XC.configure({openOnClick:!1}),hN,xN.configure({suggestion:lA(le)}),GS.configure({placeholder:c??""})],content:u,editable:!a,onUpdate({editor:te}){h==null||h(te.getHTML()),Sr(te.getText().length)}});function O(){!G||!$t.trim()||(G.chain().focus().setLink({href:$t.trim()}).run(),Dt(!1),Pt(""))}function X(){!G||!$t.trim()||(G.chain().focus().setImage({src:$t.trim()}).run(),an(!1),Pt(""))}function pe(){Dt(!1),an(!1),Pt(""),G==null||G.commands.focus()}const ve=g||b||y||_||v||w||k||S,_t=C||B||N,ft=T||$||R||L,Jt=U,Nr=V||M||P,Ar=H||ie,cn=ve||_t||ft||Jt||Nr||Ar,E=m==="on-focus",W=cn&&E&&!xe,ce=[ve,_t,ft,Jt,Nr,Ar];function ee(te){return!!ce[te]&&ce.slice(te+1).some(Boolean)}const De=typeof f=="number",vt=p==="inside",ks=[re.inner,l?re.innerInvalid:"",a?re.innerDisabled:"",vt&&De?re.innerWithCounter:"",cn&&!E?re.innerWithToolbar:"",cn&&E?re.innerOnFocusMode:""].filter(Boolean).join(" "),ro=[re.editor,vt&&De?re.editorWithInnerCounter:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:e,className:[re.root,Ae??""].filter(Boolean).join(" "),style:Ie,...Be,children:[n&&r&&d.jsxs("div",{className:re.labelRow,children:[d.jsx("label",{className:re.label,htmlFor:`${A}-editor`,children:n}),s&&d.jsx("span",{className:re.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:re.outer,children:[d.jsxs("div",{className:ks,onFocus:()=>$e(!0),onBlur:te=>{te.currentTarget.contains(te.relatedTarget)||$e(!1)},children:[cn&&G&&d.jsxs("div",{className:[re.toolbar,E?re.toolbarAbsolute:"",W?re.toolbarHidden:""].filter(Boolean).join(" "),role:"toolbar","aria-label":"Text formatting","aria-hidden":W||void 0,children:[ve&&d.jsxs(d.Fragment,{children:[g&&d.jsx(Oe,{label:"Bold",active:G.isActive("bold"),onAction:()=>G.chain().focus().toggleBold().run(),disabled:a,children:d.jsx("span",{className:re.labelBold,children:"B"})}),b&&d.jsx(Oe,{label:"Italic",active:G.isActive("italic"),onAction:()=>G.chain().focus().toggleItalic().run(),disabled:a,children:d.jsx("span",{className:re.labelItalic,children:"I"})}),y&&d.jsx(Oe,{label:"Underline",active:G.isActive("underline"),onAction:()=>G.chain().focus().toggleUnderline().run(),disabled:a,children:d.jsx("span",{className:re.labelUnderline,children:"U"})}),_&&d.jsx(Oe,{label:"Strikethrough",active:G.isActive("strike"),onAction:()=>G.chain().focus().toggleStrike().run(),disabled:a,children:d.jsx("span",{className:re.labelStrike,children:"S"})}),v&&d.jsx(Oe,{label:"Inline code",active:G.isActive("code"),onAction:()=>G.chain().focus().toggleCode().run(),disabled:a,children:d.jsx("i",{className:"pi pi-code","aria-hidden":"true"})}),w&&d.jsx(Oe,{label:"Highlight",active:G.isActive("highlight"),onAction:()=>G.chain().focus().toggleHighlight().run(),disabled:a,children:d.jsx("i",{className:"pi pi-pencil","aria-hidden":"true"})}),k&&d.jsx(Oe,{label:"Subscript",active:G.isActive("subscript"),onAction:()=>G.chain().focus().toggleSubscript().run(),disabled:a,children:d.jsx("span",{className:re.labelSubscript,children:"x₂"})}),S&&d.jsx(Oe,{label:"Superscript",active:G.isActive("superscript"),onAction:()=>G.chain().focus().toggleSuperscript().run(),disabled:a,children:d.jsx("span",{className:re.labelSuperscript,children:"x²"})})]}),ee(0)&&d.jsx("span",{className:re.divider}),_t&&d.jsxs(d.Fragment,{children:[C&&D.map(te=>d.jsx(Oe,{label:`Heading ${te}`,active:G.isActive("heading",{level:te}),onAction:()=>G.chain().focus().toggleHeading({level:te}).run(),disabled:a,children:d.jsxs("span",{className:re.labelHeading,children:["H",te]})},te)),B&&d.jsx(Oe,{label:"Blockquote",active:G.isActive("blockquote"),onAction:()=>G.chain().focus().toggleBlockquote().run(),disabled:a,children:d.jsx("i",{className:"pi pi-comment","aria-hidden":"true"})}),N&&d.jsx(Oe,{label:"Code block",active:G.isActive("codeBlock"),onAction:()=>G.chain().focus().toggleCodeBlock().run(),disabled:a,children:d.jsx("i",{className:"pi pi-code","aria-hidden":"true"})})]}),ee(1)&&d.jsx("span",{className:re.divider}),ft&&d.jsxs(d.Fragment,{children:[T&&d.jsx(Oe,{label:"Bullet list",active:G.isActive("bulletList"),onAction:()=>G.chain().focus().toggleBulletList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-list","aria-hidden":"true"})}),$&&d.jsx(Oe,{label:"Ordered list",active:G.isActive("orderedList"),onAction:()=>G.chain().focus().toggleOrderedList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-sort-amount-down-alt","aria-hidden":"true"})}),R&&d.jsx(Oe,{label:"Task list",active:G.isActive("taskList"),onAction:()=>G.chain().focus().toggleTaskList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-check-square","aria-hidden":"true"})}),L&&d.jsx(Oe,{label:"Horizontal rule",onAction:()=>G.chain().focus().setHorizontalRule().run(),disabled:a,children:d.jsx("i",{className:"pi pi-minus","aria-hidden":"true"})})]}),ee(2)&&d.jsx("span",{className:re.divider}),Jt&&U&&d.jsx(d.Fragment,{children:["left","center","right","justify"].map(te=>d.jsx(Oe,{label:`Align ${te}`,active:G.isActive({textAlign:te}),onAction:()=>G.chain().focus().setTextAlign(te).run(),disabled:a,children:d.jsx("i",{className:`pi pi-align-${te}`,"aria-hidden":"true"})},te))}),ee(3)&&d.jsx("span",{className:re.divider}),Nr&&d.jsxs(d.Fragment,{children:[V&&d.jsx(Oe,{label:"Link",active:G.isActive("link"),onAction:()=>{G.isActive("link")?G.chain().focus().unsetLink().run():(an(!1),Dt(!0),Pt(""),requestAnimationFrame(()=>{var te;return(te=Gt.current)==null?void 0:te.focus()}))},disabled:a,children:d.jsx("i",{className:"pi pi-link","aria-hidden":"true"})}),M&&d.jsx(Oe,{label:"Image",onAction:()=>{Dt(!1),an(!0),Pt(""),requestAnimationFrame(()=>{var te;return(te=Gt.current)==null?void 0:te.focus()})},disabled:a,children:d.jsx("i",{className:"pi pi-image","aria-hidden":"true"})}),P&&d.jsx(Oe,{label:"Mention",onAction:()=>G.chain().focus().insertContent("@").run(),disabled:a,children:d.jsx("i",{className:"pi pi-at","aria-hidden":"true"})})]}),ee(4)&&d.jsx("span",{className:re.divider}),Ar&&d.jsxs(d.Fragment,{children:[H&&d.jsx(Oe,{label:"Undo",onAction:()=>G.chain().focus().undo().run(),disabled:a||!G.can().undo(),children:d.jsx("i",{className:"pi pi-undo","aria-hidden":"true"})}),ie&&d.jsx(Oe,{label:"Redo",onAction:()=>G.chain().focus().redo().run(),disabled:a||!G.can().redo(),children:d.jsx("i",{className:"pi pi-refresh","aria-hidden":"true"})})]})]}),Cr&&d.jsxs("div",{className:re.urlBar,children:[d.jsx("input",{ref:Gt,type:"url",className:re.urlInput,value:$t,onChange:te=>Pt(te.target.value),placeholder:Bt?"https://example.com":"Image URL…",onKeyDown:te=>{te.key==="Enter"&&(te.preventDefault(),Bt?O():X()),te.key==="Escape"&&pe()}}),d.jsx("button",{type:"button",className:re.urlConfirm,onMouseDown:te=>{te.preventDefault(),Bt?O():X()},children:d.jsx("i",{className:"pi pi-check","aria-hidden":"true"})}),d.jsx("button",{type:"button",className:re.urlCancel,onMouseDown:te=>{te.preventDefault(),pe()},children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]}),d.jsx("div",{id:`${A}-editor`,className:[ro,E&&cn?re.editorOnFocusTransition:""].filter(Boolean).join(" "),style:E&&cn?{paddingTop:xe?48:9}:void 0,"aria-label":!r&&n?n:void 0,"aria-required":s||void 0,"aria-invalid":l||void 0,"aria-describedby":[ne?q:"",De?`${A}-counter`:""].filter(Boolean).join(" ")||void 0,onClick:te=>{te.target===te.currentTarget&&(G==null||G.chain().focus("end").run())},children:d.jsx(Fh,{editor:G})}),vt&&De&&d.jsxs("span",{id:`${A}-counter`,className:re.counterInside,"aria-live":"polite",children:[sr,"/",f]})]}),(ne||!vt&&De)&&d.jsxs("div",{className:re.bottomRow,children:[ne?d.jsx("span",{id:q,className:l?re.errorText:re.helperText,children:o}):d.jsx("span",{}),!vt&&De&&d.jsxs("span",{id:`${A}-counter`,className:re.counter,"aria-live":"polite",children:[sr,"/",f]})]})]})]})});Sf.displayName="RichTextEditor";const aA="_wrapper_17bsd_10",cA="_disabled_17bsd_18",dA="_input_17bsd_24",uA="_track_17bsd_38",hA="_thumb_17bsd_53",fA="_labelText_17bsd_125",pA="_helperText_17bsd_139",In={wrapper:aA,disabled:cA,input:dA,track:uA,thumb:hA,labelText:fA,helperText:pA},Nf=x.forwardRef(({label:t,helperText:e,disabled:n=!1,id:r,className:s,...i},o)=>{const l=x.useRef(null),a=o??l,c=[In.wrapper,n?In.disabled:"",s??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:c,htmlFor:r,children:[d.jsx("input",{ref:a,type:"checkbox",id:r,disabled:n,className:In.input,role:"switch",...i}),d.jsx("span",{className:In.track,"aria-hidden":"true",children:d.jsx("span",{className:In.thumb})}),t&&d.jsx("span",{className:In.labelText,children:t})]}),e&&d.jsx("span",{className:In.helperText,children:e})]})});Nf.displayName="ToggleSwitch";const mA="_btn_13e6z_10",gA="_disabled_13e6z_28",bA="_sm_13e6z_34",yA="_md_13e6z_40",xA="_lg_13e6z_46",_A="_primary_13e6z_56",vA="_secondary_13e6z_82",kA="_ghost_13e6z_110",wA="_danger_13e6z_133",CA="_link_13e6z_156",SA="_linkLabel_13e6z_181",NA="_icon_13e6z_189",un={btn:mA,disabled:gA,sm:bA,md:yA,lg:xA,primary:_A,secondary:vA,ghost:kA,danger:wA,link:CA,linkLabel:SA,icon:NA},Ve=x.forwardRef(({variant:t="primary",size:e="md",leadingIcon:n,trailingIcon:r,badge:s,children:i,className:o,disabled:l,...a},c)=>{const u=[un.btn,un[t],un[e],l?un.disabled:"",o??""].filter(Boolean).join(" ");return d.jsxs("button",{ref:c,className:u,disabled:l,...a,children:[n&&d.jsx("span",{className:un.icon,"aria-hidden":"true",children:n}),t==="link"?d.jsx("span",{className:un.linkLabel,children:i}):d.jsx("span",{className:un.label,children:i}),s!==void 0&&d.jsx(vr,{value:s,severity:"danger",size:"normal","aria-label":`${s} notifications`}),r&&d.jsx("span",{className:un.icon,"aria-hidden":"true",children:r})]})});Ve.displayName="Button";const AA="_root_1jl5o_6",TA="_btn_1jl5o_13",EA="_disabled_1jl5o_30",MA="_sm_1jl5o_35",jA="_md_1jl5o_36",IA="_lg_1jl5o_37",DA="_primary_1jl5o_40",OA="_btnOpen_1jl5o_44",LA="_secondary_1jl5o_46",RA="_ghost_1jl5o_52",BA="_danger_1jl5o_58",$A="_icon_1jl5o_65",PA="_chevron_1jl5o_73",zA="_dropdown_1jl5o_98",FA="_item_1jl5o_115",HA="_itemDisabled_1jl5o_130",WA="_itemIcon_1jl5o_143",VA="_divider_1jl5o_153",st={root:AA,btn:TA,disabled:EA,sm:MA,md:jA,lg:IA,primary:DA,btnOpen:OA,secondary:LA,ghost:RA,danger:BA,icon:$A,chevron:PA,dropdown:zA,item:FA,itemDisabled:HA,itemIcon:WA,divider:VA},zi=x.forwardRef(({label:t,items:e,onSelect:n,variant:r="primary",size:s="md",leadingIcon:i,disabled:o,className:l,style:a,...c},u)=>{const[h,f]=x.useState(!1),p=x.useRef(null),m=y=>{p.current=y,typeof u=="function"?u(y):u&&(u.current=y)};x.useEffect(()=>{if(!h)return;function y(_){var v;(v=p.current)!=null&&v.contains(_.target)||f(!1)}return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[h]),x.useEffect(()=>{if(!h)return;function y(_){_.key==="Escape"&&f(!1)}return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[h]);function g(y){y.disabled||(n==null||n(y.value),f(!1))}const b=[st.btn,st[r],st[s],h?st.btnOpen:"",o?st.disabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:m,className:[st.root,l??""].filter(Boolean).join(" "),style:a,children:[d.jsxs("button",{type:"button",className:b,disabled:o,onClick:()=>!o&&f(y=>!y),"aria-haspopup":"menu","aria-expanded":h,...c,children:[i&&d.jsx("span",{className:st.icon,"aria-hidden":"true",children:i}),d.jsx("span",{className:st.label,children:t}),d.jsx("span",{className:st.chevron,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})]}),h&&d.jsx("div",{role:"menu",className:st.dropdown,children:e.map((y,_)=>d.jsxs("div",{children:[y.divider&&d.jsx("div",{className:st.divider,role:"separator"}),d.jsxs("div",{role:"menuitem","aria-disabled":y.disabled||void 0,className:[st.item,y.disabled?st.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>g(y),tabIndex:y.disabled?-1:0,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!y.disabled&&(v.preventDefault(),g(y))},children:[y.icon&&d.jsx("span",{className:st.itemIcon,"aria-hidden":"true",children:y.icon}),d.jsx("span",{className:st.itemLabel,children:y.label})]})]},y.value??_))})]})});zi.displayName="DropdownButton";const UA="_btn_12vzq_7",qA="_sm_12vzq_24",KA="_md_12vzq_30",GA="_lg_12vzq_36",JA="_disabled_12vzq_44",Vo={btn:UA,sm:qA,md:KA,lg:GA,disabled:JA},Rt=x.forwardRef(({"aria-label":t="Close",size:e="sm",className:n,disabled:r,...s},i)=>{const o=[Vo.btn,Vo[e],r?Vo.disabled:"",n??""].filter(Boolean).join(" ");return d.jsx(er,{content:t,placement:"top",children:d.jsx("button",{ref:i,type:"button","aria-label":t,className:o,disabled:r,...s,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})})});Rt.displayName="CloseButton";const YA="_root_1f5g5_9",QA="_main_1f5g5_17",XA="_disabled_1f5g5_38",ZA="_primaryMain_1f5g5_47",eT="_secondaryMain_1f5g5_59",tT="_trigger_1f5g5_72",nT="_primaryTrigger_1f5g5_94",rT="_secondaryTrigger_1f5g5_105",sT="_chevron_1f5g5_117",iT="_triggerOpen_1f5g5_125",oT="_icon_1f5g5_131",lT="_mainSm_1f5g5_140",aT="_triggerSm_1f5g5_147",cT="_mainLg_1f5g5_152",dT="_triggerLg_1f5g5_159",uT="_dropdown_1f5g5_187",hT="_item_1f5g5_202",fT="_itemDisabled_1f5g5_217",pT="_itemIcon_1f5g5_230",We={root:YA,main:QA,disabled:XA,primaryMain:ZA,secondaryMain:eT,trigger:tT,primaryTrigger:nT,secondaryTrigger:rT,chevron:sT,triggerOpen:iT,icon:oT,mainSm:lT,triggerSm:aT,mainLg:cT,triggerLg:dT,dropdown:uT,item:hT,itemDisabled:fT,itemIcon:pT},ma=x.forwardRef(({label:t,onAction:e,items:n,onSelect:r,variant:s="primary",size:i="md",leadingIcon:o,disabled:l=!1,triggerAriaLabel:a="More options",className:c,style:u},h)=>{const[f,p]=x.useState(!1),m=x.useRef(null),g=v=>{m.current=v,typeof h=="function"?h(v):h&&(h.current=v)};x.useEffect(()=>{if(!f)return;function v(w){var k;(k=m.current)!=null&&k.contains(w.target)||p(!1)}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[f]),x.useEffect(()=>{if(!f)return;function v(w){w.key==="Escape"&&p(!1)}return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[f]);function b(v){v.disabled||(r==null||r(v.value),p(!1))}const y=[We.main,We[`${s}Main`],i==="sm"?We.mainSm:i==="lg"?We.mainLg:"",l?We.disabled:""].filter(Boolean).join(" "),_=[We.trigger,We[`${s}Trigger`],i==="sm"?We.triggerSm:i==="lg"?We.triggerLg:"",f?We.triggerOpen:"",l?We.disabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:g,className:[We.root,c??""].filter(Boolean).join(" "),style:u,children:[d.jsxs("button",{type:"button",className:y,onClick:()=>!l&&(e==null?void 0:e()),disabled:l,children:[o&&d.jsx("span",{className:We.icon,"aria-hidden":"true",children:o}),d.jsx("span",{className:We.label,children:t})]}),d.jsx(er,{content:a,placement:"top",children:d.jsx("button",{type:"button",className:_,onClick:()=>!l&&p(v=>!v),disabled:l,"aria-haspopup":"menu","aria-expanded":f,"aria-label":a,children:d.jsx("span",{className:We.chevron,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})})}),f&&d.jsx("div",{role:"menu",className:We.dropdown,children:n.map((v,w)=>d.jsxs("div",{role:"menuitem","aria-disabled":v.disabled||void 0,className:[We.item,v.disabled?We.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>b(v),tabIndex:v.disabled?-1:0,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&!v.disabled&&(k.preventDefault(),b(v))},children:[v.icon&&d.jsx("span",{className:We.itemIcon,"aria-hidden":"true",children:v.icon}),d.jsx("span",{children:v.label})]},v.value??w))})]})});ma.displayName="SplitButton";const mT="_container_1ieud_9",gT="_containerFull_1ieud_20",bT="_navBtn_1ieud_29",yT="_navBtnDisabled_1ieud_46",xT="_navBtnSelected_1ieud_56",_T="_navBtnContent_1ieud_79",vT="_pageNumber_1ieud_90",kT="_ellipsis_1ieud_100",wT="_reportText_1ieud_116",CT="_fullLeft_1ieud_129",ST="_fullRight_1ieud_135",NT="_rowsLabel_1ieud_141",AT="_entriesCount_1ieud_149",bt={container:mT,containerFull:gT,navBtn:bT,navBtnDisabled:yT,navBtnSelected:xT,navBtnContent:_T,pageNumber:vT,ellipsis:kT,reportText:wT,fullLeft:CT,fullRight:ST,rowsLabel:NT,entriesCount:AT};function TT(t,e,n){if(e<=n+2)return Array.from({length:e},(l,a)=>a+1);const r=Math.floor(n/2);let s=Math.max(1,t-r),i=Math.min(e,s+n-1);i-s<n-1&&(s=Math.max(1,i-n+1));const o=[];s>1&&(o.push(1),s>2&&o.push("..."));for(let l=s;l<=i;l++)o.push(l);return i<e&&(i<e-1&&o.push("..."),o.push(e)),o}const Af=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M10 3L6 7l4 4M5 3v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Tf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 3L5 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ef=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Mf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M4 3l4 4-4 4M9 3v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function nn({onClick:t,disabled:e,selected:n,"aria-label":r,children:s}){const i=[bt.navBtn,n?bt.navBtnSelected:"",e?bt.navBtnDisabled:""].filter(Boolean).join(" ");return d.jsx("button",{type:"button",className:i,onClick:t,disabled:e,"aria-label":r,"aria-current":n?"page":void 0,children:d.jsx("span",{className:bt.navBtnContent,children:s})})}function pd({currentPage:t,totalPages:e,pageLinkSize:n,onPage:r}){const s=TT(t,e,n);return d.jsxs(d.Fragment,{children:[d.jsx(nn,{onClick:()=>r(0),disabled:t===0,"aria-label":"First page",children:d.jsx(Af,{})}),d.jsx(nn,{onClick:()=>r(t-1),disabled:t===0,"aria-label":"Previous page",children:d.jsx(Tf,{})}),s.map((i,o)=>i==="..."?d.jsx("span",{className:bt.ellipsis,children:"…"},`ellipsis-${o}`):d.jsx(nn,{onClick:()=>r(i-1),selected:i-1===t,"aria-label":`Page ${i}`,children:d.jsx("span",{className:bt.pageNumber,children:i})},i)),d.jsx(nn,{onClick:()=>r(t+1),disabled:t>=e-1,"aria-label":"Next page",children:d.jsx(Ef,{})}),d.jsx(nn,{onClick:()=>r(e-1),disabled:t>=e-1,"aria-label":"Last page",children:d.jsx(Mf,{})})]})}const jf=x.forwardRef(({totalRecords:t,first:e,rows:n,onPageChange:r,template:s="pages",rowsPerPageOptions:i=[10,25,50,100],pageLinkSize:o=5,className:l,style:a},c)=>{const u=Math.max(1,Math.ceil(t/n)),h=Math.floor(e/n);function f(_){const v=Math.max(0,Math.min(_,u-1));r({first:v*n,rows:n,page:v})}function p(_){r({first:0,rows:_,page:0})}const m=i.map(_=>({label:String(_),value:String(_)})),g=t===0?0:e+1,b=Math.min(e+n,t),y=[bt.container,s==="full"?bt.containerFull:"",l??""].filter(Boolean).join(" ");return s==="report"?d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsx(nn,{onClick:()=>f(0),disabled:h===0,"aria-label":"First page",children:d.jsx(Af,{})}),d.jsx(nn,{onClick:()=>f(h-1),disabled:h===0,"aria-label":"Previous page",children:d.jsx(Tf,{})}),d.jsxs("span",{className:bt.reportText,children:["Showing ",g," to ",b," of ",t," entries"]}),d.jsx(nn,{onClick:()=>f(h+1),disabled:h>=u-1,"aria-label":"Next page",children:d.jsx(Ef,{})}),d.jsx(nn,{onClick:()=>f(u-1),disabled:h>=u-1,"aria-label":"Last page",children:d.jsx(Mf,{})})]}):s==="full"?d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsxs("div",{className:bt.fullLeft,children:[d.jsx("span",{className:bt.rowsLabel,children:"Results per page:"}),d.jsx(pr,{options:m,value:String(n),onChange:_=>_&&p(Number(_)),size:"sm",style:{width:80}}),d.jsxs("span",{className:bt.entriesCount,children:[b-g+(t>0?1:0)," entries"]})]}),d.jsx("div",{className:bt.fullRight,children:d.jsx(pd,{currentPage:h,totalPages:u,pageLinkSize:o,onPage:f})})]}):d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsx(pd,{currentPage:h,totalPages:u,pageLinkSize:o,onPage:f}),d.jsx(pr,{options:m,value:String(n),onChange:_=>_&&p(Number(_)),size:"sm",style:{width:80}})]})});jf.displayName="Paginator";const ET="_root_6qfeg_8",MT="_panel_6qfeg_17",jT="_panelHeader_6qfeg_31",IT="_filterWrap_6qfeg_47",DT="_filterIcon_6qfeg_55",OT="_filterInput_6qfeg_63",LT="_filterClear_6qfeg_79",RT="_list_6qfeg_98",BT="_item_6qfeg_110",$T="_itemDisabled_6qfeg_124",PT="_itemSelected_6qfeg_133",zT="_itemContent_6qfeg_148",FT="_itemIcon_6qfeg_156",HT="_itemLabel_6qfeg_162",WT="_checkbox_6qfeg_174",VT="_checkboxChecked_6qfeg_188",UT="_checkboxDisabled_6qfeg_193",qT="_checkmark_6qfeg_198",KT="_controls_6qfeg_211",GT="_ctrlBtn_6qfeg_223",JT="_ctrlBtnDisabled_6qfeg_248",Le={root:ET,panel:MT,panelHeader:jT,filterWrap:IT,filterIcon:DT,filterInput:OT,filterClear:LT,list:RT,item:BT,itemDisabled:$T,itemSelected:PT,itemContent:zT,itemIcon:FT,itemLabel:HT,checkbox:WT,checkboxChecked:VT,checkboxDisabled:UT,checkmark:qT,controls:KT,ctrlBtn:GT,ctrlBtnDisabled:JT},YT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),QT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M2 3l4 4-4 4M7 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),XT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 3L5 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ZT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M12 3L8 7l4 4M7 3L3 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),eE=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"5.5",cy:"5.5",r:"3.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M8.5 8.5L11 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),tE=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function nE({checked:t,disabled:e}){return d.jsx("span",{className:[Le.checkbox,t?Le.checkboxChecked:"",e?Le.checkboxDisabled:""].filter(Boolean).join(" "),"aria-hidden":"true",children:t&&d.jsx("svg",{className:Le.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})})}function Ws({onClick:t,disabled:e,"aria-label":n,children:r}){return d.jsx("button",{type:"button",className:[Le.ctrlBtn,e?Le.ctrlBtnDisabled:""].filter(Boolean).join(" "),onClick:t,disabled:e,"aria-label":n,children:r})}function md({header:t,items:e,selectedIds:n,onToggle:r,itemTemplate:s,filter:i,filterValue:o,onFilterChange:l,filterPlaceholder:a="Filter...",showCheckbox:c=!0,ariaLabel:u}){const h=x.useMemo(()=>{if(!i||!o.trim())return e;const f=o.toLowerCase();return e.filter(p=>String(p.label??"").toLowerCase().includes(f))},[e,i,o]);return d.jsxs("div",{className:Le.panel,children:[t!=null&&d.jsx("div",{className:Le.panelHeader,children:t}),i&&d.jsxs("div",{className:Le.filterWrap,children:[d.jsx("span",{className:Le.filterIcon,children:d.jsx(eE,{})}),d.jsx("input",{type:"text",className:Le.filterInput,value:o,onChange:f=>l(f.target.value),placeholder:a,"aria-label":`Filter ${u}`}),o&&d.jsx("button",{type:"button",className:Le.filterClear,onClick:()=>l(""),"aria-label":"Clear filter",children:d.jsx(tE,{})})]}),d.jsx("ul",{className:Le.list,role:"listbox","aria-label":u,"aria-multiselectable":"true",children:h.map(f=>{const p=n.has(f.id);return d.jsxs("li",{role:"option","aria-selected":p,"aria-disabled":f.disabled||void 0,className:[Le.item,p?Le.itemSelected:"",f.disabled?Le.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>!f.disabled&&r(f.id),tabIndex:f.disabled?-1:0,onKeyDown:m=>{(m.key===" "||m.key==="Enter")&&!f.disabled&&(m.preventDefault(),r(f.id))},children:[c&&d.jsx(nE,{checked:p,disabled:f.disabled}),s?s(f):d.jsxs("span",{className:Le.itemContent,children:[f.icon&&d.jsx("i",{className:`${f.icon} ${Le.itemIcon}`,"aria-hidden":"true"}),d.jsx("span",{className:Le.itemLabel,children:f.label})]})]},f.id)})})]})}const If=x.forwardRef(({sourceItems:t,targetItems:e,onChange:n,sourceHeader:r,targetHeader:s,itemTemplate:i,filter:o=!1,sourceFilterPlaceholder:l,targetFilterPlaceholder:a,showMoveAll:c=!0,showCheckbox:u=!0,className:h,style:f},p)=>{const[m,g]=x.useState(new Set),[b,y]=x.useState(new Set),[_,v]=x.useState(""),[w,k]=x.useState("");function S(V){g(M=>{const P=new Set(M);return P.has(V)?P.delete(V):P.add(V),P})}function C(V){y(M=>{const P=new Set(M);return P.has(V)?P.delete(V):P.add(V),P})}function D(){const V=t.filter(P=>m.has(P.id)),M=t.filter(P=>!m.has(P.id));n({source:M,target:[...e,...V]}),g(new Set)}function B(){const V=t.filter(P=>!P.disabled),M=t.filter(P=>P.disabled);n({source:M,target:[...e,...V]}),g(new Set)}function N(){const V=e.filter(P=>b.has(P.id)),M=e.filter(P=>!b.has(P.id));n({source:[...t,...V],target:M}),y(new Set)}function T(){const V=e.filter(P=>!P.disabled),M=e.filter(P=>P.disabled);n({source:[...t,...V],target:M}),y(new Set)}const $=m.size>0,R=b.size>0,L=t.some(V=>!V.disabled),U=e.some(V=>!V.disabled);return d.jsxs("div",{ref:p,className:[Le.root,h??""].filter(Boolean).join(" "),style:f,children:[d.jsx(md,{header:r,items:t,selectedIds:m,onToggle:S,itemTemplate:i,filter:o,filterValue:_,onFilterChange:v,filterPlaceholder:l,showCheckbox:u,ariaLabel:"Source list"}),d.jsxs("div",{className:Le.controls,role:"group","aria-label":"Move controls",children:[c&&d.jsx(Ws,{onClick:B,disabled:!L,"aria-label":"Move all to target",children:d.jsx(QT,{})}),d.jsx(Ws,{onClick:D,disabled:!$,"aria-label":"Move selected to target",children:d.jsx(YT,{})}),d.jsx(Ws,{onClick:N,disabled:!R,"aria-label":"Move selected to source",children:d.jsx(XT,{})}),c&&d.jsx(Ws,{onClick:T,disabled:!U,"aria-label":"Move all to source",children:d.jsx(ZT,{})})]}),d.jsx(md,{header:s,items:e,selectedIds:b,onToggle:C,itemTemplate:i,filter:o,filterValue:w,onFilterChange:k,filterPlaceholder:a,showCheckbox:u,ariaLabel:"Target list"})]})});If.displayName="Picklist";const rE="_card_jldrw_6",sE="_cardClickable_jldrw_17",iE="_cardDark_jldrw_37",oE="_body_jldrw_70",lE="_title_jldrw_74",aE="_subTitle_jldrw_78",cE="_content_jldrw_82",dE="_caption_jldrw_99",uE="_footer_jldrw_133",Zt={card:rE,cardClickable:sE,cardDark:iE,body:oE,title:lE,subTitle:aE,content:cE,caption:dE,footer:uE},Df=x.forwardRef(({title:t,subTitle:e,footer:n,children:r,tone:s="light",onClick:i,className:o,style:l},a)=>{const c=i!=null,u=t!=null||e!=null||r!=null;return d.jsx("div",{ref:a,className:[Zt.card,s==="dark"?Zt.cardDark:"",c?Zt.cardClickable:"",o??""].filter(Boolean).join(" "),style:l,onClick:i,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i==null||i(h))}:void 0,children:d.jsxs("div",{className:Zt.body,children:[u&&d.jsxs("div",{className:Zt.caption,children:[t!=null&&d.jsx("div",{className:Zt.title,children:t}),e!=null&&d.jsx("div",{className:Zt.subTitle,children:e}),r!=null&&d.jsx("div",{className:Zt.content,children:r})]}),n!=null&&d.jsx("div",{className:Zt.footer,children:n})]})})});Df.displayName="Card";const hE="_accordion_7a03y_6",fE="_item_7a03y_16",pE="_itemDisabled_7a03y_21",mE="_header_7a03y_28",gE="_titleGroup_7a03y_52",bE="_title_7a03y_52",yE="_badge_7a03y_71",xE="_headerRight_7a03y_90",_E="_headerAction_7a03y_97",vE="_chevron_7a03y_105",kE="_chevronOpen_7a03y_114",wE="_contentOuter_7a03y_120",CE="_contentOpen_7a03y_126",SE="_contentInner_7a03y_130",NE="_variant_simple_7a03y_139",AE="_contentBody_7a03y_164",TE="_variant_page_7a03y_173",EE="_variant_panel_7a03y_211",ME="_variant_flyout_7a03y_246",Ke={accordion:hE,item:fE,itemDisabled:pE,header:mE,titleGroup:gE,title:bE,badge:yE,headerRight:xE,headerAction:_E,chevron:vE,chevronOpen:kE,contentOuter:wE,contentOpen:CE,contentInner:SE,variant_simple:NE,contentBody:AE,variant_page:TE,variant_panel:EE,variant_flyout:ME},Of=x.forwardRef(({items:t,variant:e="page",openIds:n,onChange:r,multiple:s=!1,className:i,style:o},l)=>{const a=c=>{const u=n.includes(c);r(s?u?n.filter(h=>h!==c):[...n,c]:u?[]:[c])};return d.jsx("div",{ref:l,className:[Ke.accordion,Ke[`variant_${e}`],i??""].filter(Boolean).join(" "),style:o,children:t.map(c=>{const u=n.includes(c.id),h=`accordion-header-${c.id}`,f=`accordion-panel-${c.id}`,p=(e==="panel"||e==="flyout")&&c.badge!=null,m=e==="panel"||e==="flyout";return d.jsxs("div",{className:[Ke.item,u?Ke.itemOpen:"",c.disabled?Ke.itemDisabled:""].filter(Boolean).join(" "),children:[d.jsxs("button",{id:h,className:Ke.header,"aria-expanded":u,"aria-controls":f,disabled:c.disabled,onClick:()=>a(c.id),children:[d.jsxs("span",{className:Ke.titleGroup,children:[d.jsx("span",{className:Ke.title,children:c.title}),p&&d.jsx("span",{className:Ke.badge,children:c.badge})]}),d.jsxs("span",{className:Ke.headerRight,children:[c.headerAction!=null&&d.jsx("span",{className:Ke.headerAction,onClick:g=>g.stopPropagation(),children:c.headerAction}),d.jsx("span",{className:[Ke.chevron,u?Ke.chevronOpen:""].join(" "),children:d.jsx("i",{className:m?"pi pi-angle-down":"pi pi-chevron-down"})})]})]}),d.jsx("div",{id:f,role:"region","aria-labelledby":h,className:[Ke.contentOuter,u?Ke.contentOpen:""].join(" "),children:d.jsx("div",{className:Ke.contentInner,children:d.jsx("div",{className:Ke.contentBody,children:c.content})})})]},c.id)})})});Of.displayName="Accordion";const jE="_tabs_1h6up_6",IE="_tablist_1h6up_14",DE="_tab_1h6up_6",OE="_tabIcon_1h6up_51",LE="_tabLabel_1h6up_61",RE="_tabPipe_1h6up_67",BE="_tabDisabled_1h6up_86",$E="_tabActive_1h6up_86",PE="_panel_1h6up_117",zE="_nav_1h6up_128",FE="_pills_1h6up_138",Ct={tabs:jE,tablist:IE,tab:DE,tabIcon:OE,tabLabel:LE,tabPipe:RE,tabDisabled:BE,tabActive:$E,panel:PE,nav:zE,pills:FE},Lf=x.forwardRef(({tabs:t,activeTab:e,onChange:n,variant:r="panel",className:s,style:i},o)=>{const l=t.find(f=>f.id===e),a=r==="nav",c=r==="pills",u=r==="panel",h=a?"nav":"div";return d.jsxs(h,{ref:o,className:[Ct.tabs,a?Ct.nav:"",c?Ct.pills:"",s??""].filter(Boolean).join(" "),style:i,children:[d.jsx("div",{className:Ct.tablist,role:a?void 0:"tablist",children:t.map(f=>{const p=f.id===e,m=`tabpanel-${f.id}`,g=`tab-${f.id}`;return d.jsxs("button",{id:g,role:a?void 0:"tab","aria-selected":a?void 0:p,"aria-current":a&&p?"page":void 0,"aria-disabled":f.disabled,"aria-controls":u?m:void 0,disabled:f.disabled,className:[Ct.tab,p?Ct.tabActive:"",f.disabled?Ct.tabDisabled:""].filter(Boolean).join(" "),onClick:()=>{f.disabled||n(f.id)},children:[f.icon!=null&&d.jsx("span",{className:Ct.tabIcon,children:f.icon}),d.jsx("span",{className:Ct.tabLabel,children:f.label}),f.icon2!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Ct.tabPipe,children:"|"}),d.jsx("span",{className:Ct.tabIcon,children:f.icon2})]}),f.count!=null&&d.jsx(vr,{value:f.count,severity:"danger",size:"normal"})]},f.id)})}),u&&l!=null&&l.content!=null&&d.jsx("div",{id:`tabpanel-${l.id}`,role:"tabpanel","aria-labelledby":`tab-${l.id}`,className:Ct.panel,children:l.content})]})});Lf.displayName="Tabs";const HE="_bannerTabs_1emwd_6",WE="_track_1emwd_15",VE="_card_1emwd_31",UE="_cardDisabled_1emwd_55",qE="_cardActive_1emwd_55",KE="_labelRow_1emwd_88",GE="_label_1emwd_88",JE="_labelSep_1emwd_103",YE="_lockIcon_1emwd_110",QE="_statusIndicator_1emwd_117",XE="_subtitle_1emwd_123",ZE="_docs_1emwd_133",eM="_badgeGroups_1emwd_139",tM="_badgeGroupWrap_1emwd_146",nM="_badgeGroup_1emwd_139",rM="_badgeGroupPipe_1emwd_160",sM="_badge_1emwd_139",iM="_badgeShape_1emwd_182",oM="_badgeShapeCircle_1emwd_189",lM="_badgeShapeDiamond_1emwd_194",aM="_badgeNum_1emwd_202",cM="_arrow_1emwd_239",dM="_arrowLeft_1emwd_270",uM="_arrowRight_1emwd_274",hM="_fadeMask_1emwd_280",fe={bannerTabs:HE,track:WE,card:VE,cardDisabled:UE,cardActive:qE,labelRow:KE,label:GE,labelSep:JE,lockIcon:YE,statusIndicator:QE,subtitle:XE,docs:ZE,badgeGroups:eM,badgeGroupWrap:tM,badgeGroup:nM,badgeGroupPipe:rM,badge:sM,badgeShape:iM,badgeShapeCircle:oM,badgeShapeDiamond:lM,badgeNum:aM,arrow:cM,arrowLeft:dM,arrowRight:uM,fadeMask:hM},fM={green:"#66BB5F",yellow:"#F5C664",red:"#E53935",gray:"transparent"},pM={green:"#66BB5F",yellow:"#F5C664",red:"#E53935",gray:"#94A3B8"};function gd({shape:t,color:e}){const n=fM[e],r=pM[e],s=9;return t==="dot"?d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,borderRadius:"50%",background:n,border:`1px solid ${r}`,flexShrink:0}}):t==="diamond"?d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,background:n,border:`1px solid ${r}`,transform:"rotate(45deg)",flexShrink:0}}):t==="square"?d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,background:n,border:`1px solid ${r}`,flexShrink:0}}):d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,borderRadius:"50%",background:"transparent",border:"1.5px solid #94A3B8",flexShrink:0}})}const mM=[{shape:"square",color:"var(--red-500, #EB1000)"},{shape:"diamond",color:"var(--yellow-500, #FBDE0B)"},{shape:"circle",color:"var(--green-300, #6FB864)"}],gM=[{shape:"square",color:"var(--teal-600, #138890)"},{shape:"square",color:"var(--green-600, #22A34A)"},{shape:"square",color:"var(--teal-500, #32A4AC)"}],bM="var(--surface-500, #ADB5BD)";function yM({shape:t,color:e,count:n,tooltip:r,diamondGroup0:s}){const i=n===0,o=i?bM:e,l=i?"var(--navy-900, #0D1117)":s?"var(--navy-800, #171D22)":"#ffffff";return d.jsxs("span",{className:fe.badge,"data-tooltip":r,children:[d.jsx("span",{className:[fe.badgeShape,t==="circle"?fe.badgeShapeCircle:"",t==="diamond"?fe.badgeShapeDiamond:""].filter(Boolean).join(" "),style:{background:o}}),d.jsx("span",{className:fe.badgeNum,style:{color:l},children:n})]})}const ga=x.forwardRef(({items:t,activeId:e,onChange:n,className:r,style:s},i)=>{const o=x.useRef(null),[l,a]=x.useState(!1),[c,u]=x.useState(!1),h=x.useCallback(()=>{const p=o.current;p!=null&&(a(p.scrollLeft>0),u(p.scrollLeft+p.clientWidth<p.scrollWidth-1))},[]);x.useEffect(()=>{const p=o.current;if(p==null)return;h(),p.addEventListener("scroll",h,{passive:!0});const m=new ResizeObserver(h);return m.observe(p),()=>{p.removeEventListener("scroll",h),m.disconnect()}},[h]);const f=p=>{var m;(m=o.current)==null||m.scrollBy({left:p==="left"?-200:200,behavior:"smooth"})};return d.jsxs("div",{ref:i,className:[fe.bannerTabs,r??""].filter(Boolean).join(" "),style:s,children:[l&&d.jsx("button",{className:[fe.arrow,fe.arrowLeft].join(" "),onClick:()=>f("left"),"aria-label":"Scroll left",tabIndex:-1,children:d.jsx("i",{className:"pi pi-chevron-left"})}),d.jsx("div",{className:fe.track,ref:o,children:t.map(p=>{const m=p.id===e;return d.jsxs("button",{className:[fe.card,m?fe.cardActive:"",p.disabled?fe.cardDisabled:""].filter(Boolean).join(" "),onClick:()=>{p.disabled||n(p.id)},disabled:p.disabled,"aria-pressed":m,"aria-disabled":p.disabled,children:[d.jsxs("div",{className:fe.labelRow,children:[d.jsx(gd,{shape:p.status.shape,color:p.status.color}),d.jsx("span",{className:fe.label,children:p.label}),p.subLabel!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:fe.labelSep,children:"/"}),p.subStatus!=null&&d.jsx(gd,{shape:p.subStatus.shape,color:p.subStatus.color}),d.jsx("span",{className:fe.label,children:p.subLabel})]}),p.locked&&d.jsx("i",{className:`pi pi-lock ${fe.lockIcon}`})]}),d.jsx("div",{className:fe.subtitle,children:p.subtitle}),p.badgeGroups!=null&&p.badgeGroups.length>0&&d.jsx("div",{className:fe.badgeGroups,children:p.badgeGroups.map((g,b)=>d.jsxs("div",{className:fe.badgeGroupWrap,children:[b>0&&d.jsx("span",{className:fe.badgeGroupPipe,children:"|"}),d.jsx("div",{className:fe.badgeGroup,children:g.badges.map((y,_)=>{const w=(b===0?mM:gM)[_]??{shape:"square",color:"var(--teal-600, #138890)"},k=y.shape??w.shape;return d.jsx(yM,{shape:k,color:y.color??w.color,count:y.count,tooltip:y.tooltip,diamondGroup0:b===0&&k==="diamond"},_)})})]},b))}),p.docs!=null&&d.jsx("div",{className:fe.docs,children:p.docs})]},p.id)})}),c&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:fe.fadeMask}),d.jsx("button",{className:[fe.arrow,fe.arrowRight].join(" "),onClick:()=>f("right"),"aria-label":"Scroll right",tabIndex:-1,children:d.jsx("i",{className:"pi pi-chevron-right"})})]})]})});ga.displayName="BannerTabs";const xM="_overlay_54tc7_3",_M="_overlayOpen_54tc7_17",vM="_drawer_54tc7_34",kM="_side_right_54tc7_44",wM="_side_left_54tc7_49",CM="_open_54tc7_54",SM="_header_54tc7_60",NM="_headerTitle_54tc7_69",AM="_title_54tc7_77",TM="_subtitle_54tc7_85",EM="_body_54tc7_95",MM="_footer_54tc7_105",jM="_footerShadow_54tc7_117",IM="_tertiaryGroup_54tc7_128",mt={overlay:xM,overlayOpen:_M,drawer:vM,side_right:kM,side_left:wM,open:CM,header:SM,headerTitle:NM,title:AM,subtitle:TM,body:EM,footer:MM,footerShadow:jM,tertiaryGroup:IM},Rf=x.forwardRef(({isOpen:t,onClose:e,title:n,subtitle:r,children:s,primaryAction:i,secondaryAction:o,tertiaryActions:l,side:a="right",width:c=800,className:u,style:h},f)=>{const p=x.useRef(null),[m,g]=x.useState(!1);x.useEffect(()=>{if(!t)return;const v=w=>{w.key==="Escape"&&e()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[t,e]);const b=x.useCallback(()=>{const v=p.current;if(!v){g(!1);return}const w=v.scrollHeight-v.scrollTop-v.clientHeight>2;g(w)},[]);x.useEffect(()=>{if(!t)return;const v=requestAnimationFrame(b),w=p.current;if(!w)return;w.addEventListener("scroll",b);const k=new ResizeObserver(b);return k.observe(w),()=>{cancelAnimationFrame(v),w.removeEventListener("scroll",b),k.disconnect()}},[t,b]);const y=[mt.drawer,mt[`side_${a}`],t?mt.open:"",u??""].filter(Boolean).join(" "),_=[mt.overlay,t?mt.overlayOpen:""].filter(Boolean).join(" ");return qt.createPortal(d.jsx("div",{className:_,"data-side":a,onClick:t?e:void 0,"aria-hidden":!t,children:d.jsxs("div",{ref:f,role:"dialog","aria-modal":"true","aria-label":n??"Drawer",className:y,style:{width:c,...h},onClick:v=>v.stopPropagation(),children:[d.jsxs("div",{className:mt.header,children:[d.jsxs("div",{className:mt.headerTitle,children:[n&&d.jsx("span",{className:mt.title,children:n}),r&&d.jsx("div",{className:mt.subtitle,children:r})]}),d.jsx(Rt,{"aria-label":"Close drawer",onClick:e})]}),d.jsx("div",{ref:p,className:mt.body,children:s}),d.jsxs("div",{className:mt.footer,children:[m&&d.jsx("div",{className:mt.footerShadow,"aria-hidden":"true"}),l&&l.length>0&&d.jsx("div",{className:mt.tertiaryGroup,children:l.map((v,w)=>d.jsx(Ve,{variant:"ghost",size:"md",onClick:v.onClick,disabled:v.disabled,children:v.label},w))}),o&&d.jsx(Ve,{variant:"secondary",size:"md",onClick:o.onClick,disabled:o.disabled,children:o.label}),d.jsx(Ve,{variant:"primary",size:"md",onClick:i.onClick,disabled:i.disabled,children:i.label})]})]})}),document.body)});Rf.displayName="Drawer";const DM="_container_7u9if_3",OM="_toast_7u9if_17",LM="_toastEnter_7u9if_52",RM="_toastExit_7u9if_56",BM="_content_7u9if_62",$M="_contentVertical_7u9if_69",PM="_contentHorizontal_7u9if_74",zM="_icon_7u9if_82",FM="_text_7u9if_91",HM="_textVertical_7u9if_96",WM="_textHorizontal_7u9if_102",VM="_title_7u9if_110",UM="_detail_7u9if_118",gt={container:DM,toast:OM,toastEnter:LM,toastExit:RM,content:BM,contentVertical:$M,contentHorizontal:PM,icon:zM,text:FM,textVertical:HM,textHorizontal:WM,title:VM,detail:UM},Nl=new Set;let Hn=[];function Al(){Nl.forEach(t=>t([...Hn]))}function Bf(t){Hn=Hn.map(e=>e.id===t?{...e,exiting:!0}:e),Al(),setTimeout(()=>{Hn=Hn.filter(e=>e.id!==t),Al()},300)}function Vs(t,e,n,r={}){const s={id:crypto.randomUUID(),severity:t,title:e,detail:n,layout:r.layout??"horizontal",duration:r.duration??5e3};Hn=[...Hn,s],Al(),s.duration>0&&setTimeout(()=>Bf(s.id),s.duration)}const qM={success:(t,e,n)=>Vs("success",t,e,n),info:(t,e,n)=>Vs("info",t,e,n),warn:(t,e,n)=>Vs("warn",t,e,n),error:(t,e,n)=>Vs("error",t,e,n)},KM={success:{icon:"pi-check",bgVar:"--green-50",borderVar:"--green-700",titleVar:"--green-700",iconVar:"--green-600"},info:{icon:"pi-info-circle",bgVar:"--blue-50",borderVar:"--blue-600",titleVar:"--blue-600",iconVar:"--blue-600"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",borderVar:"--yellow-800",titleVar:"--yellow-800",iconVar:"--yellow-600"},error:{icon:"pi-times-circle",bgVar:"--red-50",borderVar:"--red-600",titleVar:"--red-600",iconVar:"--red-500"}},GM={success:{bg:"#edf8ea",border:"#1a760b",title:"#1a760b",icon:"#16a34a"},info:{bg:"#f5f9ff",border:"#326fd1",title:"#326fd1",icon:"#2563eb"},warn:{bg:"#fffce7",border:"#695d05",title:"#695d05",icon:"#ca8a04"},error:{bg:"#fff5f5",border:"#d60f00",title:"#d60f00",icon:"#dc2626"}};function $f({id:t,severity:e,title:n,detail:r,layout:s="horizontal",exiting:i,onClose:o}){const l=KM[e],a=GM[e],c=`toast-desc-${t}`,u=s==="vertical",h={"--t-bg":`var(${l.bgVar}, ${a.bg})`,"--t-border":`var(${l.borderVar}, ${a.border})`,"--t-title":`var(${l.titleVar}, ${a.title})`,"--t-icon":`var(${l.iconVar}, ${a.icon})`};return d.jsx("div",{role:"alert","aria-live":"assertive","aria-atomic":"true","aria-describedby":r?c:void 0,className:[gt.toast,i?gt.toastExit:gt.toastEnter].join(" "),style:h,children:d.jsxs("div",{className:[gt.content,u?gt.contentVertical:gt.contentHorizontal].join(" "),children:[d.jsx("i",{className:`pi ${l.icon} ${gt.icon}`,"aria-hidden":"true"}),d.jsxs("div",{className:[gt.text,u?gt.textVertical:gt.textHorizontal].join(" "),children:[d.jsx("span",{className:gt.title,children:n}),r&&d.jsx("span",{id:c,className:gt.detail,children:r})]}),d.jsx(Rt,{"aria-label":"Dismiss notification",onClick:o})]})})}function Pf(){const[t,e]=x.useState([]);return x.useEffect(()=>(Nl.add(e),()=>{Nl.delete(e)}),[]),t.length===0?null:qt.createPortal(d.jsx("div",{className:gt.container,"aria-label":"Notifications",children:t.map(n=>d.jsx($f,{...n,onClose:()=>Bf(n.id)},n.id))}),document.body)}Pf.displayName="Toaster";function zf({severity:t,title:e,detail:n,layout:r="horizontal",onClose:s}){const i=x.useId();return d.jsx($f,{id:i,severity:t,title:e,detail:n,layout:r,onClose:s??(()=>{})})}zf.displayName="Toast";const JM="_wrapper_ety4d_1",YM="_track_ety4d_10",QM="_trackError_ety4d_18",XM="_fill_ety4d_24",ZM="_errorMessage_ety4d_37",Rr={wrapper:JM,track:YM,trackError:QM,fill:XM,errorMessage:ZM};function Ff({value:t,max:e=100,error:n=!1,errorMessage:r,"aria-label":s}){const i=Math.min(Math.max(t,0),e),o=e>0?i/e*100:0;return d.jsxs("div",{className:Rr.wrapper,children:[d.jsx("div",{role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":e,"aria-label":s,className:[Rr.track,n?Rr.trackError:""].join(" ").trim(),children:!n&&d.jsx("div",{className:Rr.fill,style:{width:`${o}%`}})}),n&&r&&d.jsx("p",{className:Rr.errorMessage,children:r})]})}Ff.displayName="ProgressBar";const ej="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAfCAYAAAD0ma06AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAABe9JREFUeAG9VwlslEUUfm/m/7e7LbCFlqsSEJRgFNREkGI5ypEgRBI5FkjEasEggiwtpTc123Jsa3VbLDXWGORspIUoRoJQg0AJh0GCSJBIEQNoLErva7v/zPj+LVQKLeVIfckmM2/mf9+75r23CPdJNlfWgEBdmySRvYioBisF/RBQgoJyyaAMpTrRpGlHGxOd1+4lBzsDsrs9UzjyeFBqlJTyImN4XgKrBpDAkfWQSj3LQA1XAAEkzEsaHKC7n1amxH3zQID27OzB6NM8DFUAyd5cceb4biguFu3d7Zu9NajZ99cEkNoyxtkkBcpKlpfWC1+0Ny3hUqeAdveHs7nCOcgx40Zi7C+3n4W5CgIboMESUGf4yj+Ir7/z254ZnhFcx3USYAZJr5UCUqtSY/M6BLSv88xlGj5RmRjrNvdWt2eIDXAeRWscMAwHUD1bLyusUAjnQMl9AmFXTfLKMj/f5WJ2S3ASR5UOiFxJuboyZeX6uwAD1+aNDODGsMrk2B2Baz20htWI7BWKCYdOCcmTsLNOqIzmtBavBK/PdVJIcmjJCDSlMjXOrbW6IjPTLpUvuDIptjBEoZs0TzRNILAWYwB+Y4BHBKrTCOwGAIVT4CBkaizJG003Qkj9+d24elW6czKFgV8wlG+RIqwlmeCPNhYG5+Q8jl5vJSprIX08/ZbWUsm9jCl3RVLcsY5se9rlslwP7BklhEwmgUNusqXfMlT/SGFMrU5NOP0foFIYlp5uawoI3kSbeTcDVC4VLqlKif0K7pNI6WBshFREWEFbnZ7IT02GmNmUFn+51fG3FqGZnvcUYLrpQWKW1aN3clNS0hV4CArJ2vCGFHJ0SDceW+Z0em8/8wP2yvA8wyx4hqzSKFhXmwEmtWbcw5MpW93J9CcN19X7fjAiyTCtJvGRwaA9ML8WYVlZw6hIXfDfQDhbnrDqOehC0iiV5tJb8W/o8bqhi0nTGExGFFQQ0NdQ2/gtdDFpHOVI9KeOulzlclVBFxNZKIOov9ErxXPwPxB1E0F9TYLGjFqTEelyadCFxHQC1OhnQRFqMmr7W4MishK6QxcRY0zWmKC6JoaajB/fTqqWdhYBj0BUrbDg1BR7u4AWLr43LdTAGPpCQUx/k8llkxH5mXM4PCTlHx6T1FhXfza/ZPTYuwBRMw5R/EBnEgMBF5jMo0tzv6P0XRSZv7QbPCDlHAyPoEfmogFroGFhh/MORax3FDla+ymzNTbu0Jhq0DmBampZZL7DD4JSZPfoLjIdRVGP3S9YbulYB2P8AC3rqZQso9S/Sh0jeWzva+dyD48a7wcsdeb9raMo1sxMRTHIZuu7xDwoWbTxT97U+BEztG0Ltr358r2AsvZEdM8+OC5ZGvA5tf3rmvJNiok89rFP2iagUpeoqjzFpLaRqmvLk59RGBfa7G26SDNIMGeqhsDnfPl6QYl5tnDPwjDp8+ZZwAi1WORWJnxnrL3lr82+Gh5iWJ9n0DxBA7GYcxnGmNjeaBWrUsNPlpvf5pWOcSgBReRe5WMqfOX44z+09sNpm5dGUbZuMS2lzC0P1NXMrXM3Hb91vmTPrAiLxFma5ptqYWKYTqbrKKWmiSs6UyXCJzYnTT3SOhVsLA130hTiUTRESYnpKyYec/lDdbtrZm9ftJaDSmX+t6l8nBsZPYIqs/Om72vTRB0O4OOipwWV1nWrL57bdlb1FA2wWfsNzKIBebm5JxdvWT7hRDTcbFd3jYnzd0av1pSxhkqeWX3oBxcog9Pqb3j3b1r0dS10QNn7X+pjsYoolPguTeeDTPlCyk/w54oYp7OsVeF2B+GoXa8ttCjhJkv76P6yRz8urlqYcYFzVaaBPB+gvHUqAHvR+31SBzWCprcR1Obs2JIZPgpLwjsRJzcgtm3EHY76iwtnhOq2gFSqswuoMIT6QbGlDGqc4gzSv+bEpzCYcSeeqmYodgdJXBM98cTv7cnt9M9M/F5HP5TeySR4OkcxmhQYzLlgJjgnp3GOV7gSpwwlS3UQO2OmtGRoR/Qv6vWE/P0RxtUAAAAASUVORK5CYII=",tj="_wrapper_19qsy_1",nj="_ring_19qsy_10",rj="_ringLg_19qsy_18",sj="_svg_19qsy_25",ij="_spin_19qsy_1",oj="_logo_19qsy_42",lj="_label_19qsy_52",Dn={wrapper:tj,ring:nj,ringLg:rj,svg:sj,spin:ij,logo:oj,label:lj,"label--light":"_label--light_19qsy_59","label--dark":"_label--dark_19qsy_63"},aj={sm:{px:20,r:8.5,sw:3},md:{px:32,r:14.5,sw:3},lg:{px:36,r:16.5,sw:3}};function Hf({size:t="md",label:e,theme:n="light","aria-label":r}){const i=`ps-grad-${x.useId().replace(/:/g,"")}`,{px:o,r:l,sw:a}=aj[t],c=2*Math.PI*l,u=c*.75,h=c*.25,f=t==="lg";return d.jsxs("div",{className:Dn.wrapper,role:"status","aria-label":r??"Loading",children:[d.jsxs("div",{className:[Dn.ring,f?Dn.ringLg:""].join(" ").trim(),children:[d.jsxs("svg",{width:o,height:o,viewBox:`0 0 ${o} ${o}`,className:Dn.svg,"aria-hidden":"true",children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[d.jsx("stop",{offset:"0%",stopColor:"var(--teal-600, #138890)"}),d.jsx("stop",{offset:"100%",stopColor:"var(--green-300, #6FB864)"})]})}),d.jsx("circle",{cx:o/2,cy:o/2,r:l,fill:"none",stroke:"var(--surface-300, #F4F4F5)",strokeWidth:a}),d.jsx("circle",{cx:o/2,cy:o/2,r:l,fill:"none",stroke:`url(#${i})`,strokeWidth:a,strokeDasharray:`${u} ${h}`,strokeLinecap:"round"})]}),f&&d.jsx("img",{src:ej,alt:"","aria-hidden":"true",className:Dn.logo})]}),e&&d.jsx("span",{className:[Dn.label,Dn[`label--${n}`]].join(" "),children:e})]})}Hf.displayName="ProgressSpinner";const cj="_chip_2a8wk_1",dj="_label_2a8wk_27",uj="_dismiss_2a8wk_33",Uo={chip:cj,label:dj,dismiss:uj},hj={plain:{bgVar:"--navy-50",bg:"#EAEBEC",textVar:"--teal-900",text:"#18474A"},contrast:{bgVar:"--teal-900",bg:"#18474A",text:"#ffffff"},error:{bgVar:"--red-500",bg:"#EB1000",text:"#ffffff"},warning:{bgVar:"--yellow-400",bg:"#FCE53C",textVar:"--yellow-900",text:"#514908"},informative:{bgVar:"--blue-400",bg:"#609AF8",text:"#ffffff"},success:{bgVar:"--green-500",bg:"#1E830E",text:"#ffffff"}};function Wf({label:t,severity:e,dismissible:n=!0,onDismiss:r}){const s=hj[e],i={"--c-bg":`var(${s.bgVar}, ${s.bg})`,"--c-text":s.textVar?`var(${s.textVar}, ${s.text})`:s.text};return d.jsxs("span",{className:Uo.chip,style:i,children:[d.jsx("span",{className:Uo.label,children:t}),n&&d.jsx("button",{type:"button",className:Uo.dismiss,onClick:r,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Wf.displayName="SeverityChip";const fj="_chip_1b2ko_1",pj="_avatar_1b2ko_38",mj="_label_1b2ko_53",gj="_dismiss_1b2ko_59",Br={chip:fj,avatar:pj,label:mj,dismiss:gj};function Vf({label:t,leading:e,trailing:n,dismissible:r=!0,onDismiss:s}){return d.jsxs("span",{className:Br.chip,"data-leading":e?"true":void 0,"data-trailing":n?"true":void 0,children:[e&&d.jsx("span",{className:Br.avatar,children:e}),d.jsx("span",{className:Br.label,children:t}),n&&d.jsx("span",{className:Br.avatar,children:n}),r&&d.jsx("button",{type:"button",className:Br.dismiss,onClick:s,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Vf.displayName="ProfileChip";const bj="_chip_4qp0t_1",yj="_dot_4qp0t_28",xj="_label_4qp0t_35",qo={chip:bj,dot:yj,label:xj},_j={green:{dotVar:"--green-500",dot:"#1E830E"},red:{dotVar:"--red-500",dot:"#EB1000"},yellow:{dotVar:"--yellow-400",dot:"#FCE53C"},grey:{dotVar:"--navy-300",dot:"#70777D"}};function Uf({label:t,color:e}){const n=_j[e];return d.jsxs("span",{className:qo.chip,children:[d.jsx("span",{className:qo.dot,style:{background:`var(${n.dotVar}, ${n.dot})`},"aria-hidden":"true"}),d.jsx("span",{className:qo.label,children:t})]})}Uf.displayName="AUSChip";const vj="_banner_lfuvj_1",kj="_icon_lfuvj_16",wj="_text_lfuvj_25",Cj="_title_lfuvj_34",Sj="_detail_lfuvj_42",$r={banner:vj,icon:kj,text:wj,title:Cj,detail:Sj},Nj={success:{icon:"pi-check",bgVar:"--green-50",borderVar:"--green-700",colorVar:"--green-700",bg:"#edf8ea",border:"#1a760b",color:"#1a760b"},info:{icon:"pi-info-circle",bgVar:"--blue-50",borderVar:"--blue-600",colorVar:"--blue-600",bg:"#f5f9ff",border:"#326fd1",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",borderVar:"--yellow-800",colorVar:"--yellow-800",bg:"#fefaed",border:"#695d05",color:"#695d05"},error:{icon:"pi-exclamation-circle",bgVar:"--red-50",borderVar:"--red-600",colorVar:"--red-600",bg:"#fff5f5",border:"#d60f00",color:"#d60f00"},neutral:{icon:"pi-info-circle",bgVar:"--teal-50",borderVar:"--teal-700",colorVar:"--teal-700",bg:"#eaf6f7",border:"#186368",color:"#186368"}};function ba({severity:t,title:e,detail:n,closable:r=!0,onClose:s}){const i=Nj[t],o={"--a-bg":`var(${i.bgVar}, ${i.bg})`,"--a-border":`var(${i.borderVar}, ${i.border})`,"--a-color":`var(${i.colorVar}, ${i.color})`};return d.jsxs("div",{role:"alert",className:$r.banner,style:o,children:[d.jsx("i",{className:`pi ${i.icon} ${$r.icon}`,"aria-hidden":"true"}),d.jsxs("div",{className:$r.text,children:[d.jsx("span",{className:$r.title,children:e}),n&&d.jsx("span",{className:$r.detail,children:n})]}),r&&d.jsx(Rt,{"aria-label":"Dismiss",onClick:s})]})}ba.displayName="BannerAlert";const Aj="_alert_1cttt_1",Tj="_icon_1cttt_12",Ej="_message_1cttt_21",Ko={alert:Aj,icon:Tj,message:Ej},Mj={success:{icon:"pi-check",bgVar:"--green-50",colorVar:"--green-700",bg:"#edf8ea",color:"#1a760b"},info:{icon:"pi-info-circle",bgVar:"--blue-50",colorVar:"--blue-600",bg:"#f5f9ff",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",colorVar:"--yellow-800",bg:"#fffce7",color:"#695d05"},error:{icon:"pi-exclamation-circle",bgVar:"--red-50",colorVar:"--red-600",bg:"#fff5f5",color:"#d60f00"}};function qf({severity:t,message:e,closable:n=!0,onClose:r}){const s=Mj[t],i={"--a-bg":`var(${s.bgVar}, ${s.bg})`,"--a-color":`var(${s.colorVar}, ${s.color})`};return d.jsxs("div",{role:"alert",className:Ko.alert,style:i,children:[d.jsx("i",{className:`pi ${s.icon} ${Ko.icon}`,"aria-hidden":"true"}),d.jsx("span",{className:Ko.message,children:e}),n&&d.jsx(Rt,{"aria-label":"Dismiss",onClick:r})]})}qf.displayName="InlineContainedAlert";const jj="_alert_p3w47_1",Ij="_icon_p3w47_9",Dj="_message_p3w47_18",Go={alert:jj,icon:Ij,message:Dj},Oj={success:{icon:"pi-check",colorVar:"--green-700",color:"#1a760b"},info:{icon:"pi-info-circle",colorVar:"--blue-600",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",colorVar:"--yellow-800",color:"#695d05"},error:{icon:"pi-exclamation-circle",colorVar:"--red-600",color:"#d60f00"}};function Kf({severity:t,message:e}){const n=Oj[t],r={"--a-color":`var(${n.colorVar}, ${n.color})`};return d.jsxs("div",{role:"status",className:Go.alert,style:r,children:[d.jsx("i",{className:`pi ${n.icon} ${Go.icon}`,"aria-hidden":"true"}),d.jsx("span",{className:Go.message,children:e})]})}Kf.displayName="InlineAlert";const Lj="_container_88she_3",Rj="_dropzone_88she_15",Bj="_dragOver_88she_40",$j="_dropText_88she_45",Pj="_browseLink_88she_51",zj="_hiddenInput_88she_57",Fj="_errorMessage_88she_63",Hj="_fileList_88she_79",Wj="_tableHeader_88she_83",Vj="_colName_88she_92",Uj="_colType_88she_101",qj="_fileRow_88she_111",Kj="_fileName_88she_119",Gj="_docTypeWrap_88she_130",Jj="_removeBtn_88she_137",Yj="_footer_88she_157",Xe={container:Lj,dropzone:Rj,dragOver:Bj,dropText:$j,browseLink:Pj,hiddenInput:zj,errorMessage:Fj,fileList:Hj,tableHeader:Wj,colName:Vj,colType:Uj,fileRow:qj,fileName:Kj,docTypeWrap:Gj,removeBtn:Jj,footer:Yj},Gf=["Miscellaneous","Agreements","Bank Statement","Hazard Insurance Binder","Pay Stub","Personal Identification","Purchase Agreement","Tax Return Transcript"],Qj=".html,.heic,.jpeg,.jpg,.png,.gif,.bmp,.tiff,.tif,.pdf,.doc,.docx,.xls,.xlsx";function Xj(t,e){return e.split(",").map(r=>r.trim().toLowerCase()).some(r=>t.name.toLowerCase().endsWith(r))}function Jf({onFilesAdded:t,onUpload:e,docTypes:n=Gf,accept:r=Qj,initialFiles:s,className:i,style:o}){const[l,a]=x.useState([]),[c,u]=x.useState(!1),[h,f]=x.useState(null),p=x.useRef(null),m=x.useId();x.useEffect(()=>{s&&s.length>0&&a(s.map(N=>({id:crypto.randomUUID(),file:N,docType:""})))},[]);const g=l.length>0&&l.every(N=>N.docType!==""),b=n.map(N=>({label:N,value:N})),y=x.useCallback(N=>{f(null);const T=[],$=[];if(N.forEach(R=>{Xj(R,r)?T.push(R):$.push(R)}),$.length>0&&f("File format not supported. Please try again."),T.length>0){const R=T.map(L=>({id:crypto.randomUUID(),file:L,docType:""}));a(L=>[...L,...R]),t==null||t(T)}},[r,t]),_=N=>{N.preventDefault(),u(!0)},v=N=>{N.currentTarget.contains(N.relatedTarget)||u(!1)},w=N=>{N.preventDefault(),u(!1),y(Array.from(N.dataTransfer.files))},k=N=>{N.target.files&&N.target.files.length>0&&(y(Array.from(N.target.files)),N.target.value="")},S=()=>{var N;(N=p.current)==null||N.click()},C=(N,T)=>{a($=>$.map(R=>R.id===N?{...R,docType:T??""}:R))},D=N=>{a(T=>T.filter($=>$.id!==N))},B=()=>{g&&(e(l.map(({file:N,docType:T})=>({file:N,docType:T}))),a([]),f(null))};return d.jsxs("div",{className:[Xe.container,i??""].filter(Boolean).join(" "),style:o,children:[d.jsxs("div",{className:[Xe.dropzone,c?Xe.dragOver:""].filter(Boolean).join(" "),onDragOver:_,onDragLeave:v,onDrop:w,onClick:S,role:"button",tabIndex:0,"aria-label":"File upload area. Click or drop files here.",onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&S()},children:[d.jsxs("span",{className:Xe.dropText,children:["Drop file(s) here or"," ",d.jsx("span",{className:Xe.browseLink,children:"browse"})]}),d.jsx("input",{ref:p,id:m,type:"file",multiple:!0,accept:r,className:Xe.hiddenInput,onChange:k,tabIndex:-1})]}),h&&d.jsxs("div",{className:Xe.errorMessage,role:"alert",children:[d.jsx("i",{className:"pi pi-exclamation-triangle","aria-hidden":"true"}),h]}),l.length>0&&d.jsxs("div",{className:Xe.fileList,children:[d.jsxs("div",{className:Xe.tableHeader,children:[d.jsx("span",{className:Xe.colName,children:"Document Name"}),d.jsx("span",{className:Xe.colType,children:"Document Type"})]}),l.map(N=>d.jsxs("div",{className:Xe.fileRow,children:[d.jsx("span",{className:Xe.fileName,title:N.file.name,children:N.file.name}),d.jsx("div",{className:Xe.docTypeWrap,children:d.jsx(pr,{options:b,value:N.docType||null,onChange:T=>C(N.id,T),placeholder:"Select Doc Type",filter:!0,size:"sm",style:{width:"100%"}})}),d.jsx("button",{type:"button",className:Xe.removeBtn,onClick:()=>D(N.id),"aria-label":`Remove ${N.file.name}`,children:d.jsx("i",{className:"pi pi-times-circle","aria-hidden":"true"})})]},N.id))]}),d.jsx("div",{className:Xe.footer,children:d.jsx(Ve,{variant:"primary",size:"md",onClick:B,disabled:!g,children:"Upload"})})]})}Jf.displayName="FileUpload";const Zj="_overlay_keczm_3",eI="_modal_keczm_19",tI="_header_keczm_36",nI="_headerTitle_keczm_45",rI="_title_keczm_50",sI="_body_keczm_60",iI="_footer_keczm_72",On={overlay:Zj,modal:eI,header:tI,headerTitle:nI,title:rI,body:sI,footer:iI},Yf=x.forwardRef(({isOpen:t,onClose:e,title:n,children:r,footer:s,scrim:i=!0,width:o=510,className:l,style:a},c)=>(x.useEffect(()=>{if(!t)return;const u=h=>{h.key==="Escape"&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t,e]),t?qt.createPortal(d.jsx("div",{className:On.overlay,"data-scrim":i,onClick:i?e:void 0,children:d.jsxs("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":n??"Modal",className:[On.modal,l??""].filter(Boolean).join(" "),style:{width:o,...a},onClick:u=>u.stopPropagation(),children:[d.jsxs("div",{className:On.header,children:[d.jsx("div",{className:On.headerTitle,children:n&&d.jsx("span",{className:On.title,children:n})}),d.jsx(Rt,{"aria-label":"Close",onClick:e})]}),d.jsx("div",{className:On.body,children:r}),s&&d.jsx("div",{className:On.footer,children:s})]})}),document.body):null));Yf.displayName="Modal";const oI="_triggerWrap_5kkmc_3",lI="_scrim_5kkmc_15",aI="_popup_5kkmc_24",cI="_header_5kkmc_82",dI="_title_5kkmc_89",uI="_body_5kkmc_101",hI="_footer_5kkmc_107",Ln={triggerWrap:oI,scrim:lI,popup:aI,header:cI,title:dI,body:uI,footer:hI},bd=10,Qf=x.forwardRef(({isOpen:t,onClose:e,trigger:n,title:r,children:s,footer:i,placement:o="bottom",align:l="right",width:a=360,className:c,style:u},h)=>{const f=x.useRef(null),[p,m]=x.useState(null),g=x.useCallback(()=>{if(!f.current)return null;const b=f.current.getBoundingClientRect(),y=b.left+b.width/2;let _=l==="right"?b.left:b.right-a;_=Math.max(8,Math.min(_,window.innerWidth-a-8));const v=y-_;return o==="bottom"?{top:b.bottom+bd,left:_,arrowLeft:v}:{bottom:window.innerHeight-b.top+bd,left:_,arrowLeft:v}},[o,l,a]);return x.useLayoutEffect(()=>{if(!t){m(null);return}m(g())},[t,g]),d.jsxs(d.Fragment,{children:[d.jsx("span",{ref:f,className:Ln.triggerWrap,children:n}),t&&p&&qt.createPortal(d.jsxs(d.Fragment,{children:[d.jsx("div",{className:Ln.scrim,onClick:e,"aria-hidden":"true"}),d.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":r??"Popup",className:[Ln.popup,c??""].filter(Boolean).join(" "),"data-placement":o,style:{width:a,top:p.top,bottom:p.bottom,left:p.left,"--popup-arrow-left":`${p.arrowLeft}px`,...u},children:[r&&d.jsxs("div",{className:Ln.header,children:[d.jsx("span",{className:Ln.title,children:r}),d.jsx(Rt,{"aria-label":"Close popup",onClick:e})]}),d.jsx("div",{className:Ln.body,children:s}),i&&d.jsx("div",{className:Ln.footer,children:i})]})]}),document.body)]})});Qf.displayName="Popup";const fI="_panel_qk0fv_1",pI="_open_qk0fv_19",mI="_compact_qk0fv_23",gI="_header_qk0fv_29",bI="_titleBar_qk0fv_36",yI="_titleBarNoTitle_qk0fv_43",xI="_titleGroup_qk0fv_48",_I="_title_qk0fv_36",vI="_subtitle_qk0fv_63",kI="_actions_qk0fv_72",wI="_headerContent_qk0fv_79",CI="_body_qk0fv_85",St={panel:fI,open:pI,compact:mI,header:gI,titleBar:bI,titleBarNoTitle:yI,titleGroup:xI,title:_I,subtitle:vI,actions:kI,headerContent:wI,body:CI},Xf=x.forwardRef(({isOpen:t,onClose:e,title:n,subtitle:r,onSave:s,headerContent:i,width:o=470,children:l,className:a,style:c},u)=>{const h=o<400,f=[St.panel,t?St.open:"",h?St.compact:"",a??""].filter(Boolean).join(" "),p=d.jsxs("div",{className:St.actions,children:[s&&d.jsx(Ve,{variant:"primary",size:"sm",onClick:s,children:"Save"}),d.jsx(Rt,{"aria-label":"Close panel",onClick:e})]});return d.jsxs("div",{ref:u,role:"dialog","aria-modal":"false","aria-label":n??"Side panel",className:f,style:{width:o,...c},children:[d.jsxs("div",{className:St.header,children:[n?d.jsxs("div",{className:St.titleBar,children:[d.jsxs("div",{className:St.titleGroup,children:[d.jsx("span",{className:St.title,children:n}),r&&d.jsx("div",{className:St.subtitle,children:r})]}),p]}):d.jsx("div",{className:St.titleBarNoTitle,children:p}),i&&d.jsx("div",{className:St.headerContent,children:i})]}),d.jsx("div",{className:St.body,children:l})]})});Xf.displayName="SidePanel";const SI="_layout_1qi6d_1",NI={layout:SI},Zf=x.forwardRef(({open:t,panelWidth:e=470,children:n,className:r,style:s},i)=>{const o=[NI.layout,r??""].filter(Boolean).join(" ");return d.jsx("div",{ref:i,className:o,style:{paddingRight:t?e:0,...s},children:n})});Zf.displayName="SidePanelLayout";const AI="_nav_1w7cn_6",TI="_leftSection_1w7cn_21",EI="_applicantWrap_1w7cn_30",MI="_applicantTrigger_1w7cn_35",jI="_applicantIcon_1w7cn_64",II="_applicantLabel_1w7cn_72",DI="_applicantChevron_1w7cn_80",OI="_applicantMenu_1w7cn_88",LI="_applicantOption_1w7cn_101",RI="_applicantOptionSelected_1w7cn_115",BI="_applicantDivider_1w7cn_129",$I="_applicantAddBtn_1w7cn_135",PI="_sortWrap_1w7cn_163",zI="_sortBtn_1w7cn_168",FI="_sortBtnIcon_1w7cn_191",HI="_sortBtnChevron_1w7cn_198",WI="_sortMenu_1w7cn_204",VI="_sortMenuItem_1w7cn_217",UI="_divider_1w7cn_250",qI="_tabsSection_1w7cn_259",KI="_ausButtons_1w7cn_275",GI="_spacer_1w7cn_284",JI="_tab_1w7cn_259",YI="_tabDisabled_1w7cn_309",QI="_tabActive_1w7cn_309",we={nav:AI,leftSection:TI,applicantWrap:EI,applicantTrigger:MI,applicantIcon:jI,applicantLabel:II,applicantChevron:DI,applicantMenu:OI,applicantOption:LI,applicantOptionSelected:RI,applicantDivider:BI,applicantAddBtn:$I,sortWrap:PI,sortBtn:zI,sortBtnIcon:FI,sortBtnChevron:HI,sortMenu:WI,sortMenuItem:VI,divider:UI,tabsSection:qI,ausButtons:KI,spacer:GI,tab:JI,tabDisabled:YI,tabActive:QI},ya=()=>d.jsx("i",{className:"pi pi-arrow-right","aria-hidden":"true"}),xa=()=>d.jsx("i",{className:"pi pi-replay","aria-hidden":"true"}),XI=()=>d.jsx("i",{className:"pi pi-user","aria-hidden":"true"}),ZI=()=>d.jsx("i",{className:"pi pi-plus-circle","aria-hidden":"true"}),eD=()=>d.jsx("i",{className:"pi pi-user-plus","aria-hidden":"true"}),wr=()=>d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function _a({applicants:t,selectedApplicantId:e,onApplicantChange:n,onAddApplicant:r,height:s=35}){const[i,o]=x.useState(!1),l=x.useRef(null);x.useEffect(()=>{if(!i)return;function c(u){var h;(h=l.current)!=null&&h.contains(u.target)||o(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[i]),x.useEffect(()=>{if(!i)return;function c(u){u.key==="Escape"&&o(!1)}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[i]);const a=t.find(c=>c.id===e);return d.jsxs("div",{ref:l,className:we.applicantWrap,children:[d.jsxs("button",{type:"button",className:we.applicantTrigger,style:s!==35?{height:s}:void 0,onClick:()=>o(c=>!c),"aria-haspopup":"listbox","aria-expanded":i,children:[d.jsx("span",{className:we.applicantIcon,children:d.jsx(XI,{})}),d.jsx("span",{className:we.applicantLabel,children:(a==null?void 0:a.label)??""}),d.jsx("span",{className:we.applicantChevron,children:d.jsx(wr,{})})]}),i&&d.jsxs("div",{role:"listbox",className:we.applicantMenu,children:[t.map(c=>d.jsx("div",{role:"option","aria-selected":c.id===e,className:[we.applicantOption,c.id===e?we.applicantOptionSelected:""].filter(Boolean).join(" "),tabIndex:0,onClick:()=>{n(c.id),o(!1)},onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(c.id),o(!1))},children:c.label},c.id)),r&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:we.applicantDivider}),d.jsxs("button",{type:"button",className:we.applicantAddBtn,onClick:()=>{r(),o(!1)},children:[d.jsx(ZI,{}),"New Applicant"]})]})]})]})}function va({sortItems:t,onSortSelect:e,height:n=35,width:r=47}){const[s,i]=x.useState(!1),o=x.useRef(null);x.useEffect(()=>{if(!s)return;function a(c){var u;(u=o.current)!=null&&u.contains(c.target)||i(!1)}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[s]),x.useEffect(()=>{if(!s)return;function a(c){c.key==="Escape"&&i(!1)}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[s]);const l=n!==35||r!==47?{height:n,width:r}:void 0;return d.jsxs("div",{ref:o,className:we.sortWrap,children:[d.jsxs("button",{type:"button",className:we.sortBtn,style:l,onClick:()=>i(a=>!a),"aria-haspopup":"menu","aria-expanded":s,"aria-label":"Sort applicants",children:[d.jsx("span",{className:we.sortBtnIcon,children:d.jsx(eD,{})}),d.jsx("span",{className:we.sortBtnChevron,children:d.jsx(wr,{})})]}),s&&d.jsx("div",{role:"menu",className:we.sortMenu,children:t.map(a=>d.jsx("button",{type:"button",role:"menuitem",disabled:a.disabled,className:we.sortMenuItem,onClick:()=>{e==null||e(a.value),i(!1)},children:a.label},a.value))})]})}const ka=x.forwardRef(function(e,n){const{applicants:r,selectedApplicantId:s,onApplicantChange:i,onAddApplicant:o,sortItems:l,onSortSelect:a,tabs:c,activeTabId:u,onTabChange:h,onNextValidation:f,nextValidationBadge:p,onBackToAUS:m,className:g,style:b}=e;return d.jsxs("div",{ref:n,className:[we.nav,g??""].filter(Boolean).join(" "),style:b,children:[d.jsxs("div",{className:we.leftSection,children:[d.jsx(_a,{applicants:r,selectedApplicantId:s,onApplicantChange:i,onAddApplicant:o}),l&&l.length>0&&d.jsx(va,{sortItems:l,onSortSelect:a})]}),d.jsx("div",{className:we.divider,"aria-hidden":"true"}),d.jsxs("div",{className:we.tabsSection,role:"tablist",children:[(f||m)&&d.jsxs("div",{className:we.ausButtons,children:[f&&d.jsx(Ve,{variant:"danger",size:"sm",leadingIcon:d.jsx(ya,{}),badge:p,onClick:f,children:"Next Validation"}),m&&d.jsx(Ve,{variant:"secondary",size:"sm",leadingIcon:d.jsx(xa,{}),onClick:m,children:"Back to AUS"})]}),c.map(y=>d.jsx("button",{type:"button",role:"tab",className:[we.tab,y.id===u?we.tabActive:"",y.disabled?we.tabDisabled:""].filter(Boolean).join(" "),"aria-selected":y.id===u,"aria-disabled":y.disabled,disabled:y.disabled,onClick:()=>{y.disabled||h(y.id)},children:y.label},y.id)),d.jsx("div",{className:we.spacer,"aria-hidden":"true"})]})]})});ka.displayName="URLATabsNav";const tD="_nav_9yblg_5",nD="_row1_9yblg_19",rD="_borrowerBlock_9yblg_27",sD="_borrowerName_9yblg_34",iD="_loanDetailsBtn_9yblg_41",oD="_divider_9yblg_68",lD="_ausButtons_9yblg_76",aD="_tabsSection_9yblg_85",cD="_tab_9yblg_85",dD="_tabDisabled_9yblg_116",uD="_tabActive_9yblg_116",hD="_spacer_9yblg_136",fD="_stripBadge_9yblg_142",at={nav:tD,row1:nD,borrowerBlock:rD,borrowerName:sD,loanDetailsBtn:iD,divider:oD,ausButtons:lD,tabsSection:aD,tab:cD,tabDisabled:dD,tabActive:uD,spacer:hD,stripBadge:fD},ep=x.forwardRef(function(e,n){const{borrowerName:r,onLoanDetailsClick:s,applicants:i,selectedApplicantId:o,onApplicantChange:l,onAddApplicant:a,sortItems:c,onSortSelect:u,onNextValidation:h,nextValidationBadge:f,onBackToAUS:p,tabs:m,activeTabId:g,onTabChange:b,tabStripBadge:y,className:_,style:v}=e;return d.jsxs("div",{ref:n,className:[at.nav,_].filter(Boolean).join(" "),style:v,children:[d.jsxs("div",{className:at.row1,children:[d.jsxs("div",{className:at.borrowerBlock,children:[d.jsx("span",{className:at.borrowerName,children:r}),d.jsxs("button",{type:"button",className:at.loanDetailsBtn,onClick:s,children:["Loan Details",d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})]})]}),d.jsx("div",{className:at.divider,"aria-hidden":"true"}),d.jsx(_a,{applicants:i,selectedApplicantId:o,onApplicantChange:l,onAddApplicant:a,height:35}),c&&c.length>0&&d.jsx(va,{sortItems:c,onSortSelect:u,height:35}),d.jsx("div",{className:at.divider,"aria-hidden":"true"}),(h||p)&&d.jsxs("div",{className:at.ausButtons,children:[h&&d.jsx(Ve,{variant:"danger",size:"sm",leadingIcon:d.jsx(ya,{}),badge:f,onClick:h,children:"Next Validation"}),p&&d.jsx(Ve,{variant:"secondary",size:"sm",leadingIcon:d.jsx(xa,{}),onClick:p,children:"Back to AUS"})]})]}),d.jsxs("div",{className:at.tabsSection,role:"tablist",children:[m.map(w=>d.jsx("button",{type:"button",role:"tab",className:[at.tab,w.id===g?at.tabActive:"",w.disabled?at.tabDisabled:""].filter(Boolean).join(" "),"aria-selected":w.id===g,"aria-disabled":w.disabled,disabled:w.disabled,onClick:()=>{w.disabled||b(w.id)},children:w.label},w.id)),d.jsx("div",{className:at.spacer,"aria-hidden":"true"}),y!=null&&y>0&&d.jsx("span",{className:at.stripBadge,"aria-label":`${y} items`,children:y})]})]})});ep.displayName="URLATabsNavTablet";const pD="_container_14o10_5",mD="_row1_14o10_17",gD="_borrowerBlock_14o10_27",bD="_borrowerName_14o10_35",yD="_loanDetailsBtn_14o10_44",xD="_rightControls_14o10_72",_D="_sectionWrap_14o10_82",vD="_sectionTrigger_14o10_87",kD="_sectionLabel_14o10_110",wD="_sectionChevron_14o10_118",CD="_sortPill_14o10_128",SD="_actionsWrap_14o10_155",ND="_actionsBtn_14o10_160",AD="_saveBtn_14o10_190",TD="_row2_14o10_217",ED="_ausButtons_14o10_226",MD="_tabDropdownWrap_14o10_236",jD="_tabDropdownTrigger_14o10_242",ID="_tabDropdownLabel_14o10_265",DD="_tabDropdownChevron_14o10_273",OD="_tabDropdownMenu_14o10_280",LD="_dropdownMenu_14o10_295",RD="_dropdownOption_14o10_308",BD="_dropdownOptionSelected_14o10_327",$D="_dropdownOptionDisabled_14o10_327",ge={container:pD,row1:mD,borrowerBlock:gD,borrowerName:bD,loanDetailsBtn:yD,rightControls:xD,sectionWrap:_D,sectionTrigger:vD,sectionLabel:kD,sectionChevron:wD,sortPill:CD,actionsWrap:SD,actionsBtn:ND,saveBtn:AD,row2:TD,ausButtons:ED,tabDropdownWrap:MD,tabDropdownTrigger:jD,tabDropdownLabel:ID,tabDropdownChevron:DD,tabDropdownMenu:OD,dropdownMenu:LD,dropdownOption:RD,dropdownOptionSelected:BD,dropdownOptionDisabled:$D};function PD({label:t,items:e,onSelect:n}){const[r,s]=x.useState(!1),i=x.useRef(null);return x.useEffect(()=>{if(!r)return;function o(l){var a;(a=i.current)!=null&&a.contains(l.target)||s(!1)}return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[r]),x.useEffect(()=>{if(!r)return;function o(l){l.key==="Escape"&&s(!1)}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[r]),d.jsxs("div",{ref:i,className:ge.sectionWrap,children:[d.jsxs("button",{type:"button",className:ge.sectionTrigger,onClick:()=>s(o=>!o),"aria-haspopup":"listbox","aria-expanded":r,children:[d.jsx("span",{className:ge.sectionLabel,children:t}),d.jsx("span",{className:ge.sectionChevron,children:d.jsx(wr,{})})]}),r&&e&&e.length>0&&d.jsx("div",{role:"listbox",className:ge.dropdownMenu,children:e.map(o=>d.jsx("div",{role:"option","aria-selected":o.label===t,className:[ge.dropdownOption,o.label===t?ge.dropdownOptionSelected:""].filter(Boolean).join(" "),tabIndex:0,onClick:()=>{n==null||n(o.value),s(!1)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),n==null||n(o.value),s(!1))},children:o.label},o.value))})]})}function zD({items:t,onSelect:e}){const[n,r]=x.useState(!1),s=x.useRef(null);return x.useEffect(()=>{if(!n)return;function i(o){var l;(l=s.current)!=null&&l.contains(o.target)||r(!1)}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),x.useEffect(()=>{if(!n)return;function i(o){o.key==="Escape"&&r(!1)}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n]),d.jsxs("div",{ref:s,className:ge.actionsWrap,children:[d.jsxs("button",{type:"button",className:ge.actionsBtn,onClick:()=>r(i=>!i),"aria-haspopup":"menu","aria-expanded":n,children:["Actions",d.jsx(wr,{})]}),n&&d.jsx("div",{role:"menu",className:ge.dropdownMenu,children:t.map(i=>d.jsx("button",{type:"button",role:"menuitem",disabled:i.disabled,className:ge.dropdownOption,onClick:()=>{e==null||e(i.value),r(!1)},children:i.label},i.value))})]})}function FD({tabs:t,activeTabId:e,onTabChange:n}){const[r,s]=x.useState(!1),i=x.useRef(null);x.useEffect(()=>{if(!r)return;function l(a){var c;(c=i.current)!=null&&c.contains(a.target)||s(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),x.useEffect(()=>{if(!r)return;function l(a){a.key==="Escape"&&s(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[r]);const o=t.find(l=>l.id===e);return d.jsxs("div",{ref:i,className:ge.tabDropdownWrap,children:[d.jsxs("button",{type:"button",className:ge.tabDropdownTrigger,onClick:()=>s(l=>!l),"aria-haspopup":"listbox","aria-expanded":r,"aria-label":"Select tab",children:[d.jsx("span",{className:ge.tabDropdownLabel,children:(o==null?void 0:o.label)??""}),d.jsx("span",{className:ge.tabDropdownChevron,children:d.jsx(wr,{})})]}),r&&d.jsx("div",{role:"listbox",className:ge.tabDropdownMenu,children:t.map(l=>d.jsx("div",{role:"option","aria-selected":l.id===e,"aria-disabled":l.disabled,className:[ge.dropdownOption,l.id===e?ge.dropdownOptionSelected:"",l.disabled?ge.dropdownOptionDisabled:""].filter(Boolean).join(" "),tabIndex:l.disabled?-1:0,onClick:()=>{l.disabled||(n(l.id),s(!1))},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&!l.disabled&&(a.preventDefault(),n(l.id),s(!1))},children:l.label},l.id))})]})}const wa=x.forwardRef(function(e,n){const{borrowerName:r,onLoanDetailsClick:s,sectionLabel:i,sectionItems:o,onSectionSelect:l,onSectionSort:a,actionItems:c,onActionSelect:u,onSave:h,applicants:f,selectedApplicantId:p,onApplicantChange:m,onAddApplicant:g,sortItems:b,onSortSelect:y,onNextValidation:_,nextValidationBadge:v,onBackToAUS:w,tabs:k,activeTabId:S,onTabChange:C,className:D,style:B}=e;return d.jsxs("div",{ref:n,className:[ge.container,D].filter(Boolean).join(" "),style:B,children:[d.jsxs("div",{className:ge.row1,children:[d.jsxs("div",{className:ge.borrowerBlock,children:[d.jsx("span",{className:ge.borrowerName,children:r}),d.jsxs("button",{type:"button",className:ge.loanDetailsBtn,onClick:s,children:["Loan Details",d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})]})]}),d.jsxs("div",{className:ge.rightControls,children:[d.jsx(PD,{label:i,items:o,onSelect:l}),a&&d.jsx("button",{type:"button",className:ge.sortPill,onClick:a,"aria-label":"Sort sections",children:d.jsx(wr,{})}),c&&c.length>0&&d.jsx(zD,{items:c,onSelect:u}),h&&d.jsx("button",{type:"button",className:ge.saveBtn,onClick:h,"aria-label":"Save",children:d.jsx("i",{className:"pi pi-save","aria-hidden":"true"})})]})]}),d.jsxs("div",{className:ge.row2,children:[(_||w)&&d.jsxs("div",{className:ge.ausButtons,children:[_&&d.jsx(Ve,{variant:"danger",size:"sm",leadingIcon:d.jsx(ya,{}),badge:v,onClick:_,children:"Next Validation"}),w&&d.jsx(Ve,{variant:"secondary",size:"sm",leadingIcon:d.jsx(xa,{}),onClick:w,children:"Back to AUS"})]}),d.jsx(_a,{applicants:f,selectedApplicantId:p,onApplicantChange:m,onAddApplicant:g,height:44}),b&&b.length>0&&d.jsx(va,{sortItems:b,onSortSelect:y,height:44,width:62}),d.jsx(FD,{tabs:k,activeTabId:S,onTabChange:C})]})]})});wa.displayName="URLATabsNavMobile";const HD="_bar_n62yy_1",WD="_leftGroup_n62yy_15",VD="_brand_n62yy_22",UD="_navGroup_n62yy_28",qD="_logo_n62yy_34",KD="_version_n62yy_40",GD="_navWrap_n62yy_48",JD="_navItem_n62yy_53",YD="_navItemOpen_n62yy_76",QD="_navItemPrimary_n62yy_80",XD="_navChevron_n62yy_91",ZD="_navChevronOpen_n62yy_97",eO="_dropdownPanel_n62yy_102",tO="_dropdownItem_n62yy_116",nO="_dropdownDivider_n62yy_149",rO="_searchWrap_n62yy_156",sO="_search_n62yy_156",iO="_rightGroup_n62yy_172",oO="_profileArea_n62yy_180",lO="_profilePill_n62yy_186",aO="_roleLabel_n62yy_193",cO="_avatarWrap_n62yy_200",dO="_avatarBtn_n62yy_205",uO="_profilePanel_n62yy_232",Ce={bar:HD,leftGroup:WD,brand:VD,navGroup:UD,logo:qD,version:KD,navWrap:GD,navItem:JD,navItemOpen:YD,navItemPrimary:QD,navChevron:XD,navChevronOpen:ZD,dropdownPanel:eO,dropdownItem:tO,dropdownDivider:nO,searchWrap:rO,search:sO,rightGroup:iO,profileArea:oO,profilePill:lO,roleLabel:aO,avatarWrap:cO,avatarBtn:dO,profilePanel:uO},tp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAcCAYAAAD2izi6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAADIZJREFUeAHtWglwFFUafn1MT889k8yRTCZ3SEgIpxA3gJEzIKAU7KIuCmupoFW6sOyK7oIonmgpW4KWeC2lILfLoYRgQIlIjLDkgpBwBEIg12Qymfvoe19PJjAJJAFX2Sr0r+qZ6Xf8773v/XeCgN4Jgw8Hxo3DSan0LiI1fT5uThoFWEbH84JPcDvq2Obmb9nL53dTpaV1cCwanseDXxEhvbQh5jvuIIOzHy4ksgfn0TUnjzAnTu7mvLY6wGIIHqVKwuKSJ2GZWXdhKrWaczvcbEXFCue7b68FXcD/SgkXPzTPv7LUuPeQQzZ3fk5/E5T507P1az6qMvxri2D8dLtPPeW+NNB5CWjEMKLHNAm4TShSAkOSo/9wwwG6tXWv+8Vn14iN2nHjtLRcNRZPSB7J80CPSXAv29h8grt0piRYUdHQNVnz1KKJ0pyxBwXIkq4q+4Prn2/8G3SCGFLpIbkT2gQA1FKpDD9eXCACKIDbgJCIbyH6vfWbqMKvVnkLdlVrH3liNj4yZx2iUBoFrxsIwSCUTyigHMSDkABUoQSCIDjp4z++6P7g3bUhLvn5iqiZ91/EZAo9daJ8rvudt7aCMFDZOXlWaDuNhFRGV5YUScFtQl0AourHn5jKt7RdgsrWJp85t5Z3OaIEv49D9QZMQICba2mp4i7V1yNSmQS1JA7EDYYhsB8TaAqgplgmuHljtrzxfBM7b8EZiKwZT0pptt4/w9K10O0KYMjmgbQ0iRBkzqNxZi05bqqVqaul8Lh4wDk6ivx7ti4I7N3bdL3Jqj/Oz5VOmLKNt7bGS6fPOMMhKIfQNCZwwm4I3izQaesYcBtTp6E3GFDa3sHK8ib+GAIvMZmgC3akOlb+fRoErxX04q09WzYcbV/wUALnsC9C5EqA4DjGuhyL7H97UgRPvJzbGjyRxENioLQ0oN2yp449f5aSJKVgbReqcbBzpwiuCFxvIYkQflDnqyveVT+6oA4otYh77Vv7QOfFsODmCY3gC8LrCz36+4szkfDD99EPQN9OrD8eV/YhAsjpX3h1O3/pAiNJTJL6318dDQEVJ98oACIjxL3+48KIxW82mO4Ke7j41MwHlVr9UoIkM6AtJVAU5RiaavZ5nJvra/GXASgT+lgjZDL0ZnO6NtryhlypzUMQXhkajwJXwOs95rN1LGtqOlsVPvv1zhi6RKPRaIiypL4PbfZ4BMEUnV2CM+BxFbVdPvdnp9PpEvkiIDdXZnl6iZ9paeZ5u+N126qXVoBfgPpwIqHbtqRkpsYkplZRAb+MYxkebg29IioCDI5QlCdlCtTpcS48X/7Dx+DagD0EyODc8f/BcWIk5BMCGtJVHkDgCVKBshx9/GTpoVHgWhBDEp81fMyTMrVmXcDnuYYHJF6h0qL21sszLtRW7kN1CQmPCHarII0xoGHwMHBrCU0dOGK4KSH5rN/jxDmWFUi5AgU8X8Uw1G6Wpo9ISVkQSiLq93mCKlL+UcaI3LdAJ3hdGIeAGJ431cOz3HAIHiuVkQghldoYOrifoYL7JQTRKCHlKBX0sTzLDhuRN90DOsHDI/aCmBMyxpBK5Tq/101jGI5IpAoHQ9H7GJreL5XJ3AiKoT6Pg44yxe01m1PicfngrLkI5UPYJvfhMJNbmYaJlyXoYmKO+z1uGpdICCilBYjPNqumrKybA0rLGvGwWm/cGPR5aIVC84w5LXNLc11tJei0ZVDyJnxHB3ykABlIVWqu5XT9gNbW0xcjeZiTkzNi4geeDPo9SNDvlg/KyTt46tjhSRFDeIMleWcg4OVwiHjA73297sSh5ZE8MkfkbsAkxDyf182pTabPUImCTCWUUsBWVmwGt5649GGj1vu9HqiyAGdZ9GD1seIZZWVlPQ08WldTvqm9pWmyRCongn4vazTFfQ3C9ldjHJAiwfE8UcNkCiVeUVwog+BdBt2jB6S5vv58+eFCmVSmEC+Ol5KKiTExMYaucSaTyYjhwIgABMNQtKHuxDERvEiNxGrLS+djEtIFJ2AQ5BwUJhcqCQGn0Ewl+D+QQh31oPhNylVozfFvJoebexp3ESjh0rmTBzmGKoEGEUdRHPoKs15s18dqn6MCQR7DUdzabHsYhB0S6O5phTBfwd5mm49B/aSDfoHUGpd0jWMRTRLHMQBaC+DosH0RnhepkaHffpfjAIpiok0kcRxhoUSSAPM7aCCiPWcOADt28OAW5KohAAQk5FCgWtHZOXfDS0QUvY1HEAGaL04tGnWWZWBhSDYWNu8mJbIJAhBQXCIHjZ7Tu/vZu0A5m3bhRiOgAj5EodLkw7ZlYodESimEsG9HUaGjNwau9tY9Co0W8AJC4RKMZwielglywgj7OBPmutMKwDFwc9QVr/WM2/okn49VR7CA9o8f2t+cLo/IcyxQKJTx4m+oRjrouQEiCAywWv397EGwwjHmAbxoYyXQZhquMpcIV6NEpDdnira1XPociA8kHOOC7UiAVmtS4+9uAeBrg0Y7gBuTUdNeciYAbjwWRB/4a3J2bLxG+c6SyhLQe4zVjWC4QXWdFaqDF6rVaUQAJLgRQlASEZCwlHTKDd+5bn8ZkAgRJqIVfr9ZTesWf+J8u+17LEaXbBqe+NhpKMrVH27fdM+O5fsLS16bAm4s8g8Fr7MXpR5FMV4am37n2uemH10MbqCwarc32hKR7NAhpHI5W/l90SjwE4hnaVhWQ/VQLJHoxMQ0e0PD2T7WRmISEjIE4ecpnKOu2rq1ymg5IpOjxow5ecmwDW/9rmL573ctEet54ip4bxsJ9zFbLkw6F/RzUmsDXRyTJFu0tT7fnj/PFA26F1WvR3Qw4K+BIsALDKONGzh0Rh9zQvvQ6/Uqi8Ui02qTtCDsIR1226cYtOYUFeTjYgdsA53gXU8FQ97XaE7bSFOBnwVBtGHbt+WkAnMyVhudvnD0IdjGVLy3r9J1rmnz4oplYsrTpYrdQgL4CFMey1JvOJ9vV2vxtPIi29Cnxx4Zf+oH9xOOVn/UyvW/s86ZMwjvb31nW/M8kpRhDPQKJkPMV7GJAzJ6WY8dNnpyTULWKLcxZbDfkpkq1hpFoNDm+rMfwgxDtI+8ALjBWSPHrAPdA+0uHlzWiDEfwAsbLtoA8DOQeEDUWnRshmVi1hGkPZgwbdOfXtn30GcrDj67fU/bfUOqV7U8L9R/V/tV2faalTTlq6d8LBZvUWZOe8y8LGt01NSWs866NStPJRRttIbsTsYQch4gMFC4vXHpjh2n+qvGCM0NdeW6GPNOGHfNgvEdHZOQWqPR6Qtcdvubfre1CSWjYeYkn2Awxb9O+b1SnhJY6DnZ6tJvpoIIM+G0Ns5SRRt2QZFmUIx4csjoyTM6Wpr+EaRdxyhoaTVaZU60MX41vCejwHN10HlchOnhJPA/UlfVQZj9xeICQAWnaPQKrKOpefGeR7eKVWbxbxn09GW5U4blW1aZEqSDjFE47m51uBtO2I6cLGpZ/uUn9Se6xq0vzyulKO536mji9EPphzJBhA3tIxcO2dDsO8cXwExkGgSAhZIENVIifsACOA84hoGZHcfC+AyTKlWesm/36kD3SlFonew7xi4iFKo1MIflkU4mMCKWhEaKXhqmiawCqgvvaiZoiaYatqVD/9NQU1aSJDKJSUobZzQnHoKxEoDFixfqa6teATcA4JVDLCx97oz3UluSSiclOJ+3+JNZn08MA9BbeBLa+L0LUxIWvpxU1XAmoI1PV3hnxh5UgR7F1BF33eOGQ+UEKcd+PLAL7cEv5LUtSQPvjjbHfQ5DfIsIWsjQQ00TgYRDAh5Hy5t11eUvgesXakN7MVhSBsTGJ30Js4SBEDAReCAGvfAdyoe/1nrBlmOznfKOnHBvK88wethvrSw5ECcyiE/Lzo9NSPlanOd1298+U3l0KbhBAEUKSdHjBY8fISVgDOXy0OY0DdF07vK2i/vqX3OcVJwui8hPB40bpBw0lBozYX78mzotMtTVzoDYeOTCvebDqeDaMIa4+r5SfK5XL7xSg1OpVNGkLjaTgA5TwHhXkPbXdjQ1NYKIshfo/TwhHjqdTiNTRWVDMTRzAmcLwmTVefGiE3SqfU8eWMT+kM49gr7KZt0WBD1BnL36ngeG5Cdu9bc5AecLCDqTFFHC/IDAWD/t9rNqHUoQuEAGnEHAMywwp8jA0ULrM6/Or1oNfrky/k0F6T9h/E+i65Xqr/yHwaSnhs0cMNLwlygTMRhHeR2GsKgE5QCOcrwEE9wuO3XqXJn7o8YfTJuLi4s50Ld0/Ea/0bX0XxB9nrPY0cBvAAAAAElFTkSuQmCC";function gs(...t){return t.filter(Boolean).join(" ")}function hO(){return d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function np({items:t,onSelect:e,className:n}){return d.jsx("div",{role:"menu",className:gs(Ce.dropdownPanel,n),children:t.map(r=>r.divider?d.jsx("div",{className:Ce.dropdownDivider},r.value):d.jsxs("button",{role:"menuitem",className:Ce.dropdownItem,disabled:r.disabled,onClick:()=>e(r.value),children:[r.icon,r.label]},r.value))})}function fO({id:t,label:e,items:n,onSelect:r,isPrimary:s}){const[i,o]=x.useState(!1),l=x.useRef(null);return x.useEffect(()=>{if(!i)return;function a(u){l.current&&!l.current.contains(u.target)&&o(!1)}function c(u){u.key==="Escape"&&o(!1)}return document.addEventListener("mousedown",a),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",c)}},[i]),d.jsxs("div",{ref:l,className:Ce.navWrap,children:[d.jsxs("button",{className:gs(Ce.navItem,i&&Ce.navItemOpen,s&&Ce.navItemPrimary),onClick:()=>o(a=>!a),"aria-haspopup":"menu","aria-expanded":i,children:[s&&d.jsx("i",{className:"pi pi-plus-circle","aria-hidden":"true"}),e,n&&n.length>0&&d.jsx("span",{className:gs(Ce.navChevron,i&&Ce.navChevronOpen),children:d.jsx(hO,{})})]}),i&&n&&n.length>0&&d.jsx(np,{items:n,onSelect:a=>{r==null||r(a),o(!1)}})]})}function pO(t){const e=t.trim().split(/\s+/);return e.length===1?e[0].slice(0,2).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function mO({profile:t}){const[e,n]=x.useState(!1),r=x.useRef(null),s=t.initials??pO(t.name);return x.useEffect(()=>{if(!e)return;function i(l){r.current&&!r.current.contains(l.target)&&n(!1)}function o(l){l.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",i),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",o)}},[e]),d.jsxs("div",{className:gs(Ce.profileArea,t.role&&Ce.profilePill),children:[t.role&&d.jsx("span",{className:Ce.roleLabel,children:t.role}),d.jsxs("div",{ref:r,className:Ce.avatarWrap,children:[d.jsx("button",{className:Ce.avatarBtn,onClick:()=>n(i=>!i),"aria-haspopup":"menu","aria-expanded":e,"aria-label":`${t.name} — open profile menu`,children:s}),e&&t.menuItems&&t.menuItems.length>0&&d.jsx(np,{items:t.menuItems,className:Ce.profilePanel,onSelect:i=>{var o;(o=t.onMenuSelect)==null||o.call(t,i),n(!1)}})]})]})}const rp=x.forwardRef(function(e,n){const{version:r,navItems:s,onSearch:i,searchPlaceholder:o,profile:l,className:a,style:c}=e;return d.jsxs("div",{ref:n,className:gs(Ce.bar,a),style:c,children:[d.jsxs("div",{className:Ce.leftGroup,children:[d.jsxs("span",{className:Ce.brand,children:[d.jsx("img",{src:tp,alt:"Clear",className:Ce.logo}),r&&d.jsx("span",{className:Ce.version,children:r})]}),d.jsx("div",{className:Ce.navGroup,children:s.map(u=>d.jsx(fO,{...u},u.id))})]}),d.jsx("div",{className:Ce.searchWrap,children:d.jsx(bs,{className:Ce.search,prefixIcon:d.jsx("i",{className:"pi pi-search","aria-hidden":"true"}),placeholder:o??"Search Leads and Loans",onChange:u=>i==null?void 0:i(u.target.value),"aria-label":"Search"})}),d.jsx("div",{className:Ce.rightGroup,children:d.jsx(mO,{profile:l})})]})}),gO="_bar_avirz_1",bO="_left_avirz_14",yO="_center_avirz_21",xO="_right_avirz_29",_O="_logo_avirz_37",vO="_logoClip_avirz_44",kO="_borrowerName_avirz_51",wO="_infoIcon_avirz_58",CO="_iconBtn_avirz_76",SO="_searchBtn_avirz_101",NO="_avatarWrap_avirz_106",AO="_avatarBtn_avirz_111",TO="_dropdownPanel_avirz_139",EO="_dropdownItem_avirz_154",MO="_dropdownDivider_avirz_187",Ze={bar:gO,left:bO,center:yO,right:xO,logo:_O,logoClip:vO,borrowerName:kO,infoIcon:wO,iconBtn:CO,searchBtn:SO,avatarWrap:NO,avatarBtn:AO,dropdownPanel:TO,dropdownItem:EO,dropdownDivider:MO},jO="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAcCAYAAACUJBTQAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAlmVYSWZNTQAqAAAACAAGARIAAwAAAAEAAQAAARoABQAAAAEAAABWARsABQAAAAEAAABeASgAAwAAAAEAAgAAATEAAgAAAAYAAABmh2kABAAAAAEAAABsAAAAAAAAAEgAAAABAAAASAAAAAFGaWdtYQAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGaADAAQAAAABAAAAHAAAAAD0nSgiAAAACXBIWXMAAAsTAAALEwEAmpwYAAABwGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIj4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5GaWdtYTwveG1wOkNyZWF0b3JUb29sPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4Kc6r2JgAABhdJREFUSA2tVQlMVEcYnnfse8vusiywy8q1nEIVERrQiqClakBjLZWKpliJUUETLdJW28ajmmpjW6tVNLVaNY2tiEbrUZDEkyoVTYSVw4NyCcoNwr7Csvv2HZ15+Fogtajpn8ybmf//vv//5583Mxh4thDQxIP4eFJJ01OooJA00st/AuAcroIg9olMdw3X3HyFe1R7xl5cXAOx+FNXwnCX2HAFnCMd5hUVpbQlv1dAjQufyt6rKHKUV5zheztqAEdgpJuzP+EdMIMYM3YK4azV8kw3w5nNG3v2fJMNuQPJ/YtjWUWigcuGLWs98q52O6WmTZQNz+o1CbPH6XcfKDMcOiZ6/HiiT5v4VjDEokTllUkTmS9loN9/5CLb2prHbPp4NzLo4uN1rMo5jjQFRAsC0BMKspd73FzON1b9bjObG2Syy8rM6fTEuEsidMmWlcyz7PzyFLShQIJcLtSL7nsPH7UX/LqtN/90pW7x8mQyeuI+TK3xEHsZINpsAJBwoTwsOaUAuFoDRFHsYW/f3MR8vweVCYCEBLVb0vyHhJNaby8vTWV2bc9FfuUguHbZ8plCS3sjoEC7Kin1vmDpdhOtfTyuNxAQxfAtLWV8Y309RjspcB+/V0iDYTy0EyJrB7jR02HL+Wmc6nFtE7covQpG9yL9A5vb5r/pg2IPBAkOpp0nTfXHVE46ZfzMm46a+3bS25fmHjUU2G4Xpffn5TUh8HBxfjcthp6WeFxkLL6YkobecB6wLCHy4pmuj1bMhXgFbI6BIDExTrTO6KVbmFbD1tXYSb8Aij2XG2w5daoOgtBeod9ShG2wIC5qgm7DlvcVQSHZwMECR0tTZs+mT/dAPfqJONgkkLThxmNnRa72DzthCiDa6yppsHkz2jQetuHOEW+wSJurXZI+C2h0GJO9/Tw0SjoZJK1E/9nWE5ha/Tbh5aOwfrfTnSkutkAACvC8gvzIyQweS3wcwFIpQ0NScAIj+HuVW2GAJ9DyIgGQIznA8DGaA9LVZFosdrWJ9CgD3rgmayPUjXhiJeYLfEhV+NhUzN6HcU3Mtae8F13FiOFwhVoZRGlowN0x54yIfkkACQ+xM0FhAGMdd17Sx4g0nMQ4goJBCGs3C9EESElBeyL9dSOynxOAKwjBQQksEFWUB+TwRsIS/ZzcwTA5KbkfbAM4wds6sX4GuAT5vo4sBhfdaH1sqAYOpWt/CPrZE3zBhwERWd9GTn4KGcLFhc6O6wRgReOrfksRoHL/iaMTsuadhEN0JaCTO5Kg+4lPzgy6FTvPreir/NfQE4G4qOyS4Jb7NdkadxXmpMI9QlOmBkAt2fqbef07pz9A7wG6s4ZkJbEGPqg0yOY4Vjej2mbl6bYGtnCUv1Nmbn1CV8Iiozu0SUniDcevlCrVRI+jrYMNyZh8FZHMe8/fsVQ35aw2ryuDc+mSg/3geqOxmLg0THukNqFLqyODSy90RKyKK3rj7g1meXer1W3z4UltKSlhUoJoSbiLQXPdMN47neixuQQmh5LVv5Rdrrt4t7q/xXI5qzC9M2iCIQquqUofqLLpvNWayDjPqFW7w/fPWeH7A9NqbTq0sdyU83V9O/TFL9kQsIugSdPtws61+7aUFUGdlJ2UVfLJ1fnAbkt00auJJ03Nq88uyUWvHQUbO3tdTGJkgs82o4kO83AjSaa1m2ko7yiquNCy/tzB+nIZd7h0arHdzk/SulMPFoZcHQP10m0sl0B6XDKKP6nqbWz3d3alKb6vt/Dg3J+nQyDaFykR2A8XycmcjEBTxuf+ZQ1V/TrfEHVvkuclZwiUfCKCHASNpayX5S8rUipArN3yJ+sV7EI1VT86/vB8/RfdFeoHJSUlDgREEhYfpgmLsMdOS/P9ylWHRVg6HcDTF6ub43UtCJrRXsh7OSQI4kqBknfMWjA+wS/X2t4D+L5+0dVIYxo1NBKclWWsnNYVpyhSVPb32IDg4IBXoBO4VdC2Zmta2Q7o4+8VIIdIBq9kQPPP2RBmrIxMGh1tyHIzUuEkLrgSGIcr4DNO4rygIODL3mW/W13CHHh8w5hTWFiIbm9Uvv/9FpcT+8/+L2NoT1d8TFvQAAAAAElFTkSuQmCC";function IO(t){const e=t.trim().split(/\s+/);return e.length===1?e[0].slice(0,2).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function DO({items:t,onSelect:e}){return d.jsx("div",{role:"menu",className:Ze.dropdownPanel,children:t.map(n=>n.divider?d.jsx("div",{className:Ze.dropdownDivider},n.value):d.jsxs("button",{role:"menuitem",className:Ze.dropdownItem,disabled:n.disabled,onClick:()=>e(n.value),children:[n.icon,n.label]},n.value))})}function OO({profile:t}){const[e,n]=x.useState(!1),r=x.useRef(null),s=t.initials??IO(t.name);return x.useEffect(()=>{if(!e)return;function i(l){r.current&&!r.current.contains(l.target)&&n(!1)}function o(l){l.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",i),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",o)}},[e]),d.jsxs("div",{ref:r,className:Ze.avatarWrap,children:[d.jsx("button",{className:Ze.avatarBtn,onClick:()=>n(i=>!i),"aria-haspopup":"menu","aria-expanded":e,"aria-label":`${t.name} — open profile menu`,children:s}),e&&t.menuItems&&t.menuItems.length>0&&d.jsx(DO,{items:t.menuItems,onSelect:i=>{var o;(o=t.onMenuSelect)==null||o.call(t,i),n(!1)}})]})}function sp({borrower:t,onMenuOpen:e,onSearchOpen:n,profile:r,className:s,style:i}){const o=!!t;return d.jsxs("div",{className:[Ze.bar,s].filter(Boolean).join(" "),style:i,children:[d.jsxs("div",{className:Ze.left,children:[d.jsx("button",{className:Ze.iconBtn,onClick:e,"aria-label":"Open menu",children:d.jsx("i",{className:"pi pi-bars","aria-hidden":"true"})}),o&&d.jsx("img",{src:jO,alt:"Clear",className:Ze.logoClip})]}),d.jsx("div",{className:Ze.center,children:o?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Ze.borrowerName,children:t.name}),d.jsx("button",{className:Ze.infoIcon,onClick:t.onInfoClick,"aria-label":"Borrower info",children:d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})})]}):d.jsx("img",{src:tp,alt:"Clear",className:Ze.logo})}),d.jsxs("div",{className:Ze.right,children:[d.jsx("button",{className:[Ze.iconBtn,Ze.searchBtn].join(" "),onClick:n,"aria-label":"Open search",children:d.jsx("i",{className:"pi pi-search","aria-hidden":"true"})}),d.jsx(OO,{profile:r})]})]})}const LO="_wrap_ojyp7_6",RO="_btn_ojyp7_13",BO="_btnMd_ojyp7_28",$O="_btnSm_ojyp7_33",PO="_btnLg_ojyp7_39",zO="_boltIcon_ojyp7_46",FO="_chevronIcon_ojyp7_47",HO="_btnBasic_ojyp7_66",WO="_btnFilled_ojyp7_82",VO="_menu_ojyp7_111",UO="_menuItem_ojyp7_124",qO="_menuItemDisabled_ojyp7_139",KO="_menuItemIcon_ojyp7_152",GO="_menuDivider_ojyp7_159",ct={wrap:LO,btn:RO,btnMd:BO,btnSm:$O,btnLg:PO,boltIcon:zO,chevronIcon:FO,btnBasic:HO,btnFilled:WO,menu:VO,menuItem:UO,menuItemDisabled:qO,menuItemIcon:KO,menuDivider:GO},no=x.forwardRef(function({variant:e="basic",size:n="md",items:r,onSelect:s,disabled:i,"aria-label":o="Quick actions",className:l,style:a},c){const[u,h]=x.useState(!1),f=x.useRef(null);x.useEffect(()=>{if(!u)return;function g(b){var y;(y=f.current)!=null&&y.contains(b.target)||h(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[u]),x.useEffect(()=>{if(!u)return;function g(b){b.key==="Escape"&&h(!1)}return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[u]);const p=g=>{h(!1),s(g)},m=[ct.btn,n==="sm"?ct.btnSm:n==="lg"?ct.btnLg:ct.btnMd,e==="filled"?ct.btnFilled:ct.btnBasic].filter(Boolean).join(" ");return d.jsxs("div",{ref:f,className:[ct.wrap,l??""].filter(Boolean).join(" "),style:a,children:[d.jsx(er,{content:o,placement:"top",children:d.jsxs("button",{ref:c,type:"button",className:m,disabled:i,"aria-label":o,"aria-haspopup":"menu","aria-expanded":u,onClick:()=>h(g=>!g),children:[d.jsx("span",{className:ct.boltIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-bolt"})}),d.jsx("span",{className:ct.chevronIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})]})}),u&&d.jsx("div",{role:"menu",className:ct.menu,children:r.map(g=>g.divider?d.jsx("div",{className:ct.menuDivider,role:"separator"},g.value):d.jsxs("div",{role:"menuitem",className:[ct.menuItem,g.disabled?ct.menuItemDisabled:""].filter(Boolean).join(" "),tabIndex:g.disabled?-1:0,"aria-disabled":g.disabled,onClick:()=>{g.disabled||p(g.value)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&!g.disabled&&(b.preventDefault(),p(g.value))},children:[g.icon&&d.jsx("span",{className:ct.menuItemIcon,"aria-hidden":"true",children:g.icon}),g.label]},g.value))})]})});no.displayName="LightningButton";const JO="_nav_bhwkc_6",YO="_mainRow_bhwkc_18",QO="_menuToggle_bhwkc_29",XO="_tabsArea_bhwkc_56",ZO="_actions_bhwkc_66",eL="_actionItem_bhwkc_75",tL="_divider_bhwkc_83",nL="_navBadgeDrop_bhwkc_94",rL="_navBadgeDropBtn_bhwkc_99",sL="_navBadgeDropLabel_bhwkc_128",iL="_navBadgeDropChevron_bhwkc_132",oL="_navBadgeDropMenu_bhwkc_140",lL="_navBadgeDropItem_bhwkc_153",aL="_navBadgeDropItemDisabled_bhwkc_168",cL="_conditionBadge_bhwkc_183",dL="_conditionDismiss_bhwkc_197",uL="_backBtn_bhwkc_218",hL="_breadcrumbs_bhwkc_243",fL="_breadcrumbItem_bhwkc_252",pL="_breadcrumbDot_bhwkc_265",mL="_status_green_bhwkc_272",gL="_status_yellow_bhwkc_273",bL="_status_red_bhwkc_274",yL="_status_gray_bhwkc_275",xL="_breadcrumbText_bhwkc_277",_L="_breadcrumbLabel_bhwkc_283",vL="_breadcrumbSublabel_bhwkc_293",kL="_expandBtn_bhwkc_303",wL="_toolbarRow_bhwkc_330",CL="_toolbarLeft_bhwkc_340",SL="_toolbarCenter_bhwkc_346",NL="_toolbarRight_bhwkc_353",de={nav:JO,mainRow:YO,menuToggle:QO,tabsArea:XO,actions:ZO,actionItem:eL,divider:tL,navBadgeDrop:nL,navBadgeDropBtn:rL,navBadgeDropLabel:sL,navBadgeDropChevron:iL,navBadgeDropMenu:oL,navBadgeDropItem:lL,navBadgeDropItemDisabled:aL,conditionBadge:cL,conditionDismiss:dL,backBtn:uL,breadcrumbs:hL,breadcrumbItem:fL,breadcrumbDot:pL,status_green:mL,status_yellow:gL,status_red:bL,status_gray:yL,breadcrumbText:xL,breadcrumbLabel:_L,breadcrumbSublabel:vL,expandBtn:kL,toolbarRow:wL,toolbarLeft:CL,toolbarCenter:SL,toolbarRight:NL},AL=()=>d.jsx("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M0 1h18M0 7h18M0 13h18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),yd=()=>d.jsx("i",{className:"pi pi-refresh","aria-hidden":"true"}),TL=()=>d.jsx("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),EL=()=>d.jsx("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M6 1L1 6l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ML=()=>d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function jL({label:t,badge:e,items:n,onSelect:r}){const[s,i]=x.useState(!1),o=x.useRef(null);return x.useEffect(()=>{if(!s)return;function l(a){var c;(c=o.current)!=null&&c.contains(a.target)||i(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[s]),x.useEffect(()=>{if(!s)return;function l(a){a.key==="Escape"&&i(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[s]),d.jsxs("div",{ref:o,className:de.navBadgeDrop,children:[d.jsxs("button",{type:"button",className:de.navBadgeDropBtn,onClick:()=>i(l=>!l),"aria-haspopup":"menu","aria-expanded":s,children:[d.jsx("span",{className:de.navBadgeDropLabel,children:t}),d.jsx("span",{className:de.navBadgeDropChevron,children:d.jsx(ML,{})}),d.jsx(vr,{value:e,severity:"danger",size:"normal"})]}),s&&d.jsx("div",{role:"menu",className:de.navBadgeDropMenu,children:n.map(l=>d.jsxs("div",{role:"menuitem",className:[de.navBadgeDropItem,l.disabled?de.navBadgeDropItemDisabled:""].filter(Boolean).join(" "),tabIndex:l.disabled?-1:0,"aria-disabled":l.disabled,onClick:()=>{l.disabled||(r==null||r(l.value),i(!1))},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&!l.disabled&&(a.preventDefault(),r==null||r(l.value),i(!1))},children:[l.icon&&d.jsx("span",{"aria-hidden":"true",children:l.icon}),l.label]},l.value))})]})}function IL(t){const e=!t.label;return t.lightning&&t.items?d.jsx(no,{variant:t.lightningVariant??"filled",size:"sm",items:t.items,onSelect:t.onSelect??(()=>{}),"aria-label":t.ariaLabel??"Quick actions"},t.value):e&&t.items?d.jsx(zi,{label:"",leadingIcon:t.icon,variant:"secondary",size:"sm",items:t.items,onSelect:t.onSelect,"aria-label":t.ariaLabel??t.value},t.value):e?d.jsx(ut,{icon:t.icon,variant:"secondary",size:"sm","aria-label":t.ariaLabel??t.value,onClick:t.onClick},t.value):t.items&&t.badge!=null?d.jsx(jL,{label:t.label??"",badge:t.badge,items:t.items,onSelect:t.onSelect},t.value):t.items?d.jsx(zi,{label:t.label??"",leadingIcon:t.icon,variant:t.variant??"secondary",size:"sm",items:t.items,onSelect:t.onSelect},t.value):d.jsx(Ve,{variant:t.variant??"secondary",size:"sm",leadingIcon:t.icon,onClick:t.onClick,children:t.label},t.value)}const ip=x.forwardRef(function(e,n){const{tabs:r,activeTabId:s,onTabChange:i,onMenuToggle:o,secondaryActions:l=[],onRefresh:a,primaryLabel:c="Save Loan",onPrimary:u,primaryItems:h,onPrimarySelect:f,condition:p,toolbar:m,banner:g,collapsed:b=!1,collapsedSection:y,onCollapsedBack:_,onExpandTabs:v,collapsedQuickItems:w=[],onCollapsedQuickAction:k}=e,S=r.find(T=>T.id===s),C=T=>[de.breadcrumbDot,T?de[`status_${T}`]:""].filter(Boolean).join(" "),D=u&&(h!=null&&h.length?d.jsx(ma,{label:c,onAction:u,items:h,onSelect:f,variant:"primary",size:"sm"}):d.jsx(Ve,{variant:"primary",size:"sm",onClick:u,children:c})),B=d.jsxs("div",{className:de.actions,children:[p&&d.jsxs("div",{className:de.conditionBadge,children:[d.jsx("span",{className:de.conditionLabel,children:p.label}),p.onDismiss&&d.jsx("button",{className:de.conditionDismiss,onClick:p.onDismiss,"aria-label":"Dismiss condition",children:d.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l7 7M8 1L1 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),l.map(T=>d.jsxs("div",{className:de.actionItem,children:[T.dividerBefore&&d.jsx("span",{className:de.divider,"aria-hidden":"true"}),IL(T)]},T.value)),a&&d.jsx(ut,{variant:"secondary",size:"sm","aria-label":"Refresh",icon:d.jsx(yd,{}),onClick:a}),D]}),N=d.jsxs("div",{className:de.actions,children:[w.length>0&&d.jsx(no,{variant:"filled",size:"sm",items:w,onSelect:k??(()=>{}),"aria-label":"Quick actions"}),a&&d.jsx(ut,{variant:"secondary",size:"sm","aria-label":"Refresh",icon:d.jsx(yd,{}),onClick:a}),D]});return d.jsxs("nav",{ref:n,className:[de.nav,b?de.collapsed:""].filter(Boolean).join(" "),children:[d.jsxs("div",{className:de.mainRow,children:[d.jsx("button",{className:de.menuToggle,onClick:o,"aria-label":"Toggle menu",children:d.jsx(AL,{})}),b?d.jsxs(d.Fragment,{children:[_&&d.jsx("button",{className:de.backBtn,onClick:_,"aria-label":"Back",children:d.jsx(EL,{})}),d.jsxs("div",{className:de.breadcrumbs,children:[y&&d.jsxs("div",{className:de.breadcrumbItem,children:[y.status&&d.jsx("span",{className:C(y.status)}),d.jsxs("div",{className:de.breadcrumbText,children:[d.jsx("span",{className:de.breadcrumbLabel,children:y.label}),y.subLabel&&d.jsx("span",{className:de.breadcrumbSublabel,children:y.subLabel})]})]}),S&&d.jsxs("div",{className:de.breadcrumbItem,children:[S.status.shape!=="none"&&d.jsx("span",{className:C(S.status.color)}),d.jsxs("div",{className:de.breadcrumbText,children:[d.jsxs("span",{className:de.breadcrumbLabel,children:[S.label,S.subLabel?` / ${S.subLabel}`:""]}),S.subtitle&&d.jsx("span",{className:de.breadcrumbSublabel,children:S.subtitle})]})]})]}),v&&d.jsx("button",{className:de.expandBtn,onClick:v,"aria-label":"Show all tabs",children:d.jsx(TL,{})}),N]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:de.tabsArea,children:d.jsx(ga,{items:r,activeId:s,onChange:i})}),B]})]}),m&&!b&&d.jsxs("div",{className:de.toolbarRow,children:[m.left&&d.jsx("div",{className:de.toolbarLeft,children:m.left}),m.center&&d.jsx("div",{className:de.toolbarCenter,children:m.center}),m.right&&d.jsx("div",{className:de.toolbarRight,children:m.right})]}),g&&!b&&d.jsx(ba,{severity:g.severity??"warn",title:g.title,detail:g.detail,closable:g.closable??!0,onClose:g.onClose})]})}),DL="_wrapper_14b3i_8",OL="_wrapperScrollable_14b3i_18",LL="_scrollContainer_14b3i_22",RL="_table_14b3i_29",BL="_headerRow_14b3i_41",$L="_headerCell_14b3i_45",PL="_md_14b3i_58",zL="_sm_14b3i_59",FL="_headerCellSortable_14b3i_61",HL="_headerCellContent_14b3i_69",WL="_headerText_14b3i_76",VL="_sortIcon_14b3i_83",UL="_sortIconActive_14b3i_91",qL="_sortPriority_14b3i_95",KL="_filterBtnWrap_14b3i_104",GL="_filterBtn_14b3i_104",JL="_filterBtnActive_14b3i_130",YL="_expandCol_14b3i_138",QL="_selectCol_14b3i_139",XL="_editCol_14b3i_140",ZL="_bodyRow_14b3i_149",eR="_bodyCell_14b3i_154",tR="_rowSelected_14b3i_158",nR="_rowStriped_14b3i_163",rR="_rowClickable_14b3i_167",sR="_expandCell_14b3i_189",iR="_selectCell_14b3i_190",oR="_editCell_14b3i_191",lR="_expandBtn_14b3i_197",aR="_groupRow_14b3i_219",cR="_groupCell_14b3i_223",dR="_groupToggle_14b3i_236",uR="_groupLabel_14b3i_244",hR="_groupCount_14b3i_248",fR="_expansionRow_14b3i_256",pR="_expansionCell_14b3i_260",mR="_cellEditWrap_14b3i_272",gR="_cellInput_14b3i_284",bR="_rowEditBtns_14b3i_298",yR="_footerRow_14b3i_309",xR="_footerCell_14b3i_313",_R="_emptyCell_14b3i_325",vR="_loadingOverlay_14b3i_333",kR="_skeleton_14b3i_341",wR="_shimmer_14b3i_1",CR="_filterPopover_14b3i_360",SR="_filterBody_14b3i_382",NR="_filterRule_14b3i_391",AR="_filterOperatorRow_14b3i_397",TR="_filterOperatorBtn_14b3i_403",ER="_filterOperatorActive_14b3i_416",MR="_filterRuleRow_14b3i_422",jR="_filterInputRow_14b3i_428",IR="_filterSelect_14b3i_434",DR="_filterInput_14b3i_428",OR="_filterFieldFull_14b3i_461",LR="_filterRemoveBtn_14b3i_474",RR="_filterAddRule_14b3i_494",BR="_filterChecklist_14b3i_506",$R="_filterCheckItem_14b3i_514",PR="_filterGroup_14b3i_532",zR="_filterGroupHeader_14b3i_538",FR="_filterGroupLabel_14b3i_545",HR="_filterGroupClear_14b3i_553",WR="_filterFooter_14b3i_564",VR="_filterResetBtn_14b3i_574",UR="_filterApplyBtn_14b3i_591",z={wrapper:DL,wrapperScrollable:OL,scrollContainer:LL,table:RL,headerRow:BL,headerCell:$L,md:PL,sm:zL,headerCellSortable:FL,headerCellContent:HL,headerText:WL,sortIcon:VL,sortIconActive:UL,sortPriority:qL,filterBtnWrap:KL,filterBtn:GL,filterBtnActive:JL,expandCol:YL,selectCol:QL,editCol:XL,bodyRow:ZL,bodyCell:eR,rowSelected:tR,rowStriped:nR,rowClickable:rR,expandCell:sR,selectCell:iR,editCell:oR,expandBtn:lR,groupRow:aR,groupCell:cR,groupToggle:dR,groupLabel:uR,groupCount:hR,expansionRow:fR,expansionCell:pR,cellEditWrap:mR,cellInput:gR,rowEditBtns:bR,footerRow:yR,footerCell:xR,emptyCell:_R,loadingOverlay:vR,skeleton:kR,shimmer:wR,filterPopover:CR,filterBody:SR,filterRule:NR,filterOperatorRow:AR,filterOperatorBtn:TR,filterOperatorActive:ER,filterRuleRow:MR,filterInputRow:jR,filterSelect:IR,filterInput:DR,filterFieldFull:OR,filterRemoveBtn:LR,filterAddRule:RR,filterChecklist:BR,filterCheckItem:$R,filterGroup:PR,filterGroupHeader:zR,filterGroupLabel:FR,filterGroupClear:HR,filterFooter:WR,filterResetBtn:VR,filterApplyBtn:UR},xd=d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function qR(t){const e=t.match(/^(\d{4})-(\d{2})-(\d{2})$/);return e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10)):null}function KR(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`}const GR=[{label:"Contains",value:"contains"},{label:"Starts with",value:"startsWith"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Greater than",value:"gt"},{label:"Less than",value:"lt"},{label:"Blank",value:"blank"},{label:"Not blank",value:"notBlank"}],JR=[{label:"Date equal to",value:"dateEquals"},{label:"Date not equal to",value:"dateNotEquals"},{label:"Date before",value:"dateBefore"},{label:"Date after",value:"dateAfter"},{label:"Date on or before",value:"dateOnOrBefore"},{label:"Date on or after",value:"dateOnOrAfter"},{label:"Blank",value:"blank"},{label:"Not blank",value:"notBlank"}],_d=new Set(["blank","notBlank"]);function YR({value:t,dataType:e,onApply:n,onReset:r,onClose:s}){var m;const i=e==="date"?JR:GR,o=i[0].value,[l,a]=x.useState((m=t==null?void 0:t.rules)!=null&&m.length?t.rules:[{matchMode:o,value:""}]),[c,u]=x.useState((t==null?void 0:t.operator)??"and");function h(g,b){a(y=>y.map((_,v)=>v===g?{..._,...b}:_))}function f(){a(g=>[...g,{matchMode:o,value:""}])}function p(g){a(b=>b.filter((y,_)=>_!==g))}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:z.filterBody,children:[l.map((g,b)=>d.jsxs("div",{className:z.filterRule,children:[b>0&&d.jsx("div",{className:z.filterOperatorRow,children:d.jsx(El,{options:[{label:"AND",value:"and"},{label:"OR",value:"or"}],value:c,onChange:y=>u(y)})}),d.jsxs("div",{className:z.filterRuleRow,children:[d.jsx("div",{className:z.filterFieldFull,children:d.jsx(pr,{options:i,value:g.matchMode,onChange:y=>y&&h(b,{matchMode:y}),style:{width:"100%"}})}),!_d.has(g.matchMode)&&d.jsxs("div",{className:z.filterInputRow,children:[d.jsx("div",{className:z.filterFieldFull,children:e==="date"?d.jsx(Tl,{value:g.value?qR(g.value):null,onChange:y=>h(b,{value:y?KR(y):""}),style:{width:"100%"}}):d.jsx(bs,{placeholder:"Value",value:g.value,onChange:y=>h(b,{value:y.target.value})})}),l.length>1&&d.jsx(ut,{variant:"ghost",size:"sm",icon:xd,"aria-label":"Remove rule",onClick:()=>p(b)})]}),_d.has(g.matchMode)&&l.length>1&&d.jsx("div",{className:z.filterInputRow,children:d.jsx(ut,{variant:"ghost",size:"sm",icon:xd,"aria-label":"Remove rule",onClick:()=>p(b)})})]})]},b)),d.jsx(Ve,{variant:"ghost",size:"sm",onClick:f,style:{alignSelf:"flex-start"},children:"+ Add rule"})]}),d.jsx(Ca,{onReset:r,onApply:()=>n({operator:c,rules:l}),onClose:s})]})}function QR({options:t=[],value:e,onApply:n,onReset:r,onClose:s}){const[i,o]=x.useState(new Set(e??[])),[l,a]=x.useState(""),c=t.filter(g=>g.label.toLowerCase().includes(l.toLowerCase())),u=c.length>0&&c.every(g=>i.has(g.value)),f=c.some(g=>i.has(g.value))&&!u;function p(g){o(b=>{const y=new Set(b);return y.has(g)?y.delete(g):y.add(g),y})}function m(){o(u?g=>{const b=new Set(g);return c.forEach(y=>b.delete(y.value)),b}:g=>{const b=new Set(g);return c.forEach(y=>b.add(y.value)),b})}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:z.filterBody,children:[d.jsx(bs,{placeholder:"Search…",value:l,onChange:g=>a(g.target.value),prefixIcon:d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsxs("div",{className:z.filterChecklist,children:[d.jsx(Gn,{label:"Select All",checked:u,indeterminate:f,onChange:m}),c.map(g=>d.jsx(Gn,{label:g.label,checked:i.has(g.value),onChange:()=>p(g.value)},String(g.value)))]})]}),d.jsx(Ca,{onReset:r,onApply:()=>n(Array.from(i)),onClose:s})]})}function XR({groups:t=[],value:e,onApply:n,onReset:r,onClose:s}){const[i,o]=x.useState(new Set(e??[]));function l(c){o(u=>{const h=new Set(u);return h.has(c)?h.delete(c):h.add(c),h})}function a(c){o(u=>{const h=new Set(u);return c.options.forEach(f=>h.delete(f.value)),h})}return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:z.filterBody,children:t.map(c=>d.jsxs("div",{className:z.filterGroup,children:[d.jsxs("div",{className:z.filterGroupHeader,children:[d.jsx("span",{className:z.filterGroupLabel,children:c.label}),d.jsx(Ve,{variant:"link",size:"sm",onClick:()=>a(c),children:"Clear All"})]}),c.options.map(u=>d.jsx(Gn,{label:u.label,checked:i.has(u.value),onChange:()=>l(u.value)},String(u.value)))]},c.label))}),d.jsx(Ca,{onReset:r,onApply:()=>n(Array.from(i)),onClose:s})]})}function Ca({onReset:t,onApply:e,onClose:n}){return d.jsxs("div",{className:z.filterFooter,children:[d.jsx(Ve,{variant:"secondary",size:"sm",onClick:()=>{t(),n()},children:"Reset"}),d.jsx(Ve,{variant:"primary",size:"sm",onClick:()=>{e(),n()},children:"Apply"})]})}function ZR({config:t,onClose:e,anchorRef:n}){const r=x.useRef(null),[s,i]=x.useState(null);x.useEffect(()=>{function l(){var p;const a=(p=n.current)==null?void 0:p.getBoundingClientRect();if(!a)return;const c=280,u=360;let h=a.bottom+4,f=a.left;f+c>window.innerWidth-8&&(f=Math.max(8,a.right-c)),h+u>window.innerHeight-8&&(h=Math.max(8,a.top-u-4)),i({top:h,left:f})}return l(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[n]),x.useEffect(()=>{function l(a){const c=a.target;c.closest("[data-popover-root]")||r.current&&!r.current.contains(c)&&n.current&&!n.current.contains(c)&&e()}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[e,n]),x.useEffect(()=>{function l(a){a.key==="Escape"&&e()}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]);function o(){var l;(l=t.onChange)==null||l.call(t,null)}return s?qt.createPortal(d.jsxs("div",{ref:r,"data-popover-root":"",className:z.filterPopover,style:{top:s.top,left:s.left},children:[t.type==="rule"&&d.jsx(YR,{value:t.value,dataType:t.dataType??"text",onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e}),t.type==="checklist"&&d.jsx(QR,{options:t.options,value:t.value,onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e}),t.type==="grouped-checklist"&&d.jsx(XR,{groups:t.groups,value:t.value,onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e})]}),document.body):null}function vd(t){return t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"label"in t[0]&&"data"in t[0]}function Nt(t,e){return t[e]}function Pr(t,e){return t[e]}function eB(){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M5 2L2 6h6L5 2z",fill:"currentColor"})})}function tB(){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M5 8L2 4h6L5 8z",fill:"currentColor"})})}function nB(){return d.jsxs("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",children:[d.jsx("path",{d:"M5 2L2 6h6L5 2z",fill:"currentColor",opacity:"0.3"}),d.jsx("path",{d:"M5 12L2 8h6l-3 4z",fill:"currentColor",opacity:"0.3"})]})}function rB({active:t}){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M1 2h8M2.5 5h5M4 8h2",stroke:t?"var(--teal-700,#047880)":"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function kd(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M4 2l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function wd(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 4l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Cd=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),sB=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M8 2l2 2-6 6H2V8l6-6z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Sa({data:t,columns:e,dataKey:n="id",selectionMode:r="none",selection:s,onSelectionChange:i,sortMode:o="single",sortField:l,sortOrder:a,multiSortMeta:c,onSort:u,expansion:h,editMode:f,onRowEditSave:p,onRowEditCancel:m,onCellEdit:g,stripedRows:b=!1,size:y="md",showFooter:_=!1,loading:v=!1,emptyMessage:w="No data found.",scrollable:k=!1,scrollHeight:S,className:C,style:D}){const[B,N]=x.useState(new Set),[T,$]=x.useState(()=>vd(t)?new Set(t.filter(E=>E.defaultExpanded!==!1).map(E=>E.label)):new Set),[R,L]=x.useState(null),[U,V]=x.useState(null),[M,P]=x.useState({}),[H,ie]=x.useState(null),le=x.useRef(new Map),Ae=vd(t),Ie=Ae?t.flatMap(E=>E.data):t,Be=!!h,A=r==="multiple",q=f==="row",ne=e.length+(Be?1:0)+(A?1:0)+(q?1:0);function xe(E){var W;return o==="multiple"&&c?((W=c.find(ce=>ce.field===E))==null?void 0:W.order)??0:l===E?a??0:0}function $e(E){if(o!=="multiple"||!c)return null;const W=c.findIndex(ce=>ce.field===E);return W>=0?W+1:null}function Bt(E){if(!u)return;const ce=xe(E)===1?-1:1;if(o==="multiple"){const ee=c?[...c]:[],De=ee.findIndex(vt=>vt.field===E);De>=0?ee[De]={field:E,order:ce}:ee.push({field:E,order:ce}),u({field:E,order:ce,multiSortMeta:ee})}else u({field:E,order:ce})}function Dt(E){if(!s)return!1;const W=Nt(E,n);return Array.isArray(s)?s.some(ce=>Nt(ce,n)===W):Nt(s,n)===W}function rr(E){if(!(r==="none"&&f!=="cell")){if(r==="single")i==null||i(Dt(E)?null:E);else if(r==="multiple"){const W=Array.isArray(s)?[...s]:[],ce=Nt(E,n),ee=W.findIndex(De=>Nt(De,n)===ce);ee>=0?W.splice(ee,1):W.push(E),i==null||i(W)}}}function an(E){i==null||i(E?[...Ie]:[])}const $t=Ie.length>0&&Ie.every(E=>Dt(E)),Pt=!$t&&Ie.some(E=>Dt(E));function Gt(E){const W=h?Nt(E,h.dataKey):Nt(E,n);N(ce=>{const ee=new Set(ce);return ee.has(W)?ee.delete(W):ee.add(W),ee})}function Cr(E){const W=h?Nt(E,h.dataKey):Nt(E,n);return B.has(W)}function sr(E){const W=Nt(E,n),ce={};e.forEach(ee=>{ce[ee.field]=Pr(E,ee.field)}),L(W),P(ce)}function Sr(E){const W={...E,...M};p==null||p(W,E),L(null),P({})}function G(){L(null),P({}),m==null||m()}function O(E,W){const ce=Nt(E,n);V({rowKey:ce,field:W}),P({[W]:Pr(E,W)})}function X(E,W){const ce={...E,[W]:M[W]};g==null||g(ce,W,M[W]),V(null),P({})}function pe(E){return le.current.has(E)||le.current.set(E,{current:null}),le.current.get(E)}function ve(E){var ce;if(!((ce=E.filter)!=null&&ce.value))return!1;const W=E.filter.value;return Array.isArray(W)?W.length>0:typeof W=="object"&&W!==null?(W.rules??[]).some(De=>De.value!==""):!1}const _t=()=>d.jsx("thead",{children:d.jsxs("tr",{className:z.headerRow,children:[Be&&d.jsx("th",{className:`${z.headerCell} ${z.expandCol}`}),A&&d.jsx("th",{className:`${z.headerCell} ${z.selectCol}`,children:d.jsx(Gn,{checked:$t,indeterminate:Pt,onChange:E=>an(E.target.checked),"aria-label":"Select all rows",size:"sm"})}),e.map(E=>{const W=xe(E.field),ce=$e(E.field),ee=E.filter?pe(E.field):null;return d.jsx("th",{className:`${z.headerCell} ${E.sortable?z.headerCellSortable:""}`,style:{width:E.width,textAlign:E.align??"left"},onClick:()=>E.sortable&&Bt(E.field),"aria-sort":W===1?"ascending":W===-1?"descending":"none",children:d.jsxs("span",{className:z.headerCellContent,children:[d.jsx("span",{className:z.headerText,children:E.header}),E.sortable&&d.jsxs("span",{className:`${z.sortIcon} ${W!==0?z.sortIconActive:""}`,children:[W===1?d.jsx(eB,{}):W===-1?d.jsx(tB,{}):d.jsx(nB,{}),ce!==null&&d.jsx("span",{className:z.sortPriority,children:ce})]}),E.filter&&d.jsxs("div",{className:z.filterBtnWrap,onClick:De=>De.stopPropagation(),children:[d.jsx("button",{ref:ee,type:"button",className:`${z.filterBtn} ${ve(E)?z.filterBtnActive:""}`,"aria-label":`Filter ${E.header}`,onClick:()=>ie(De=>De===E.field?null:E.field),children:d.jsx(rB,{active:ve(E)})}),H===E.field&&ee&&d.jsx(ZR,{config:E.filter,onClose:()=>ie(null),anchorRef:ee})]})]})},E.field)}),q&&d.jsx("th",{className:`${z.headerCell} ${z.editCol}`})]})}),ft=x.useCallback((E,W,ce)=>{const ee=Nt(E,n),De=Dt(E),vt=Be&&Cr(E),ks=f==="row"&&R===ee,ro=[z.bodyRow,De?z.rowSelected:"",b&&ce?z.rowStriped:"",r!=="none"?z.rowClickable:""].filter(Boolean).join(" "),te=e.map(Te=>{const so=f==="cell"&&U!=null&&U.rowKey===ee&&U.field===Te.field,Na=ks||so;let ir;return Na&&Te.editor?ir=Te.editor({...E,...M},Te.field,Mn=>P(io=>({...io,[Te.field]:Mn}))):Na?ir=d.jsx("input",{className:z.cellInput,value:String(M[Te.field]??Pr(E,Te.field)??""),onChange:Mn=>P(io=>({...io,[Te.field]:Mn.target.value}))}):Te.body?ir=Te.body(E,W):ir=String(Pr(E,Te.field)??""),d.jsx("td",{className:z.bodyCell,style:{textAlign:Te.align??"left"},onClick:()=>{f==="cell"&&Te.editor&&!so&&(U&&X(E,U.field),O(E,Te.field))},children:so?d.jsxs("div",{className:z.cellEditWrap,children:[ir,d.jsx(ut,{variant:"ghost",size:"sm",icon:d.jsx(Cd,{}),"aria-label":"Confirm edit",onClick:Mn=>{Mn.stopPropagation(),X(E,Te.field)}}),d.jsx(Rt,{size:"sm","aria-label":"Cancel edit",onClick:Mn=>{Mn.stopPropagation(),V(null),P({})}})]}):ir},Te.field)});return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:ro,onClick:()=>{r!=="none"&&rr(E)},"aria-selected":r!=="none"?De:void 0,children:[Be&&d.jsx("td",{className:`${z.bodyCell} ${z.expandCell}`,children:d.jsx("button",{type:"button",className:z.expandBtn,onClick:Te=>{Te.stopPropagation(),Gt(E)},"aria-label":vt?"Collapse row":"Expand row","aria-expanded":vt,children:vt?d.jsx(wd,{}):d.jsx(kd,{})})}),A&&d.jsx("td",{className:`${z.bodyCell} ${z.selectCell}`,onClick:Te=>Te.stopPropagation(),children:d.jsx(Gn,{checked:De,onChange:()=>rr(E),"aria-label":"Select row",size:"sm"})}),te,q&&d.jsx("td",{className:`${z.bodyCell} ${z.editCell}`,onClick:Te=>Te.stopPropagation(),children:ks?d.jsxs("div",{className:z.rowEditBtns,children:[d.jsx(ut,{variant:"ghost",size:"sm",icon:d.jsx(Cd,{}),"aria-label":"Save row",onClick:()=>Sr(E)}),d.jsx(Rt,{size:"sm","aria-label":"Cancel edit",onClick:G})]}):d.jsx(ut,{variant:"ghost",size:"sm",icon:d.jsx(sB,{}),"aria-label":"Edit row",onClick:()=>sr(E)})})]},String(ee)),Be&&vt&&h&&d.jsx("tr",{className:z.expansionRow,children:d.jsx("td",{colSpan:ne,className:z.expansionCell,children:h.template?h.template(E):h.childKey?d.jsx(Sa,{data:Pr(E,String(h.childKey))??[],columns:h.columns??e,dataKey:n,selectionMode:r,stripedRows:b,size:y,showFooter:_,editMode:f}):null})},`${String(ee)}-expansion`)]})},[e,R,U,M,B,s,b,Be,A,q,r,f]),Jt=()=>v?d.jsx("tbody",{children:Array.from({length:5}).map((E,W)=>d.jsx("tr",{className:z.bodyRow,children:Array.from({length:ne}).map((ce,ee)=>d.jsx("td",{className:z.bodyCell,children:d.jsx("span",{className:z.skeleton})},ee))},W))}):Ie.length===0?d.jsx("tbody",{children:d.jsx("tr",{children:d.jsx("td",{colSpan:ne,className:z.emptyCell,children:w})})}):Ae?d.jsx("tbody",{children:t.map(E=>{const W=T.has(E.label);return d.jsxs(d.Fragment,{children:[d.jsx("tr",{className:z.groupRow,onClick:()=>$(ce=>{const ee=new Set(ce);return ee.has(E.label)?ee.delete(E.label):ee.add(E.label),ee}),children:d.jsxs("td",{colSpan:ne,className:z.groupCell,children:[d.jsx("span",{className:z.groupToggle,children:W?d.jsx(wd,{}):d.jsx(kd,{})}),d.jsx("span",{className:z.groupLabel,children:E.label}),d.jsxs("span",{className:z.groupCount,children:["(",E.data.length,")"]})]})},`group-${E.label}`),W&&E.data.map((ce,ee)=>ft(ce,ee,ee%2!==0))]})})}):d.jsx("tbody",{children:t.map((E,W)=>ft(E,W,W%2!==0))}),Nr=()=>!_||!e.some(W=>W.footer!==void 0)?null:d.jsx("tfoot",{children:d.jsxs("tr",{className:z.footerRow,children:[Be&&d.jsx("td",{className:z.footerCell}),A&&d.jsx("td",{className:z.footerCell}),e.map(W=>d.jsx("td",{className:z.footerCell,style:{textAlign:W.align??"left"},children:typeof W.footer=="function"?W.footer(Ie):W.footer},W.field)),q&&d.jsx("td",{className:z.footerCell})]})}),Ar=[z.table,z[y],b?z.striped:""].filter(Boolean).join(" "),cn=[z.wrapper,k?z.wrapperScrollable:"",C??""].filter(Boolean).join(" ");return d.jsxs("div",{className:cn,style:D,children:[d.jsx("div",{className:z.scrollContainer,style:k&&S?{maxHeight:S,overflowY:"auto"}:void 0,children:d.jsxs("table",{className:Ar,role:"grid",children:[_t(),Jt(),Nr()]})}),v&&d.jsx("div",{className:z.loadingOverlay,"aria-busy":"true","aria-label":"Loading"})]})}Sa.displayName="DataTable";const iB="_shell_1l18z_1",op={shell:iB};function oB({topBar:t,loanBannerNav:e,urlATabsNav:n,className:r,style:s}){return d.jsxs("div",{className:[op.shell,r].filter(Boolean).join(" "),style:s,children:[d.jsx(rp,{...t}),e&&d.jsx(ip,{...e}),n&&d.jsx(ka,{...n})]})}function lB({topBar:t,urlATabsNavMobile:e,className:n,style:r}){const s=!!t.borrower&&!!e;return d.jsxs("div",{className:[op.shell,n].filter(Boolean).join(" "),style:r,children:[d.jsx(sp,{...t}),s&&d.jsx(wa,{...e})]})}exports.AUSChip=Uf;exports.Accordion=Of;exports.Badge=vr;exports.BannerAlert=ba;exports.BannerTabs=ga;exports.Button=Ve;exports.Calendar=Td;exports.Card=Df;exports.Checkbox=Gn;exports.CloseButton=Rt;exports.DEFAULT_DOC_TYPES=Gf;exports.DataTable=Sa;exports.DatePicker=Tl;exports.Drawer=Rf;exports.DropdownButton=zi;exports.FileUpload=Jf;exports.FullNav=oB;exports.FullNavMobile=lB;exports.IconButton=ut;exports.InlineAlert=Kf;exports.InlineContainedAlert=qf;exports.InputText=bs;exports.LightningButton=no;exports.ListBox=Sd;exports.LoanBannerNav=ip;exports.MiscChip=Ys;exports.Modal=Yf;exports.MultiSelect=Ad;exports.Paginator=jf;exports.Picklist=If;exports.Popup=Qf;exports.ProfileChip=Vf;exports.ProgressBar=Ff;exports.ProgressSpinner=Hf;exports.RadioButton=Nd;exports.RichTextEditor=Sf;exports.Select=pr;exports.SelectButton=El;exports.SeverityChip=Wf;exports.SidePanel=Xf;exports.SidePanelLayout=Zf;exports.SplitButton=ma;exports.Tabs=Lf;exports.TextArea=Ed;exports.Toast=zf;exports.Toaster=Pf;exports.ToggleSwitch=Nf;exports.Tooltip=er;exports.TopBar=rp;exports.TopBarMobile=sp;exports.URLATabsNav=ka;exports.URLATabsNavMobile=wa;exports.URLATabsNavTablet=ep;exports.toast=qM;
175
175
  //# sourceMappingURL=index.cjs.map