(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9695],{33:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},253:e=>{e.exports=function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},919:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},1262:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(12115),o=r.useLayoutEffect,i=r.useEffect;function s(e){let{headManager:t,reduceComponentsToState:n}=e;function s(){if(t&&t.mountedInstances){let o=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(o,e))}}return o(()=>{var n;return null==t||null==(n=t.mountedInstances)||n.add(e.children),()=>{var n;null==t||null==(n=t.mountedInstances)||n.delete(e.children)}}),o(()=>(t&&(t._pendingUpdate=s),()=>{t&&(t._pendingUpdate=s)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},1524:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]])},5917:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},6191:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},7398:(e,t,n)=>{var r=n(80797);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},7861:e=>{e.exports=function(e){try{return -1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},8127:(e,t,n)=>{"use strict";n.d(t,{K:()=>s});var r=n(12115);let o=null,i=0;function s(){let[e,t]=(0,r.useState)(null),[n,s]=(0,r.useState)(!0),[l,a]=(0,r.useState)(null);return(0,r.useEffect)(()=>{(async()=>{if(o&&Date.now()-i<6e5){t(o),s(!1);return}try{let e=await fetch("/api/content/seo-settings");if(e.ok){let n=await e.json();o=n,i=Date.now(),t(n)}else throw Error("Failed to fetch SEO settings")}catch(e){a(e instanceof Error?e.message:"An error occurred"),o&&t(o)}finally{s(!1)}})()},[]),{settings:e,loading:n,error:l,refreshSeoSettings:async()=>{o=null,i=0,s(!0),a(null);try{let e=await fetch("/api/content/seo-settings");if(e.ok){let n=await e.json();o=n,i=Date.now(),t(n)}else throw Error("Failed to fetch SEO settings")}catch(e){a(e instanceof Error?e.message:"An error occurred")}finally{s(!1)}}}}},8828:(e,t,n)=>{"use strict";e.exports=n(83654)},9961:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},10208:(e,t,n)=>{var r=n(80797);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},14105:(e,t)=>{"use strict";function n(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:o,blurDataURL:i,objectFit:s}=e,l=r?40*r:t,a=o?40*o:n,c=l&&a?"viewBox='0 0 "+l+" "+a+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+c+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(c?"none":"contain"===s?"xMidYMid":"cover"===s?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+i+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},14806:(e,t,n)=>{"use strict";e.exports=n(30125)},15870:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},16411:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(95155),o=n(34826);function i(e){let{className:t="",width:n=200,height:i=60}=e,{theme:s,resolvedTheme:l}=(0,o.D)();return(0,r.jsx)("img",{src:"dark"===l||void 0===l?"/logo-light.svg":"/logo-dark.svg",alt:"ORGPYUR Logo",className:t,style:n&&!i?{width:n,height:"auto"}:i&&!n?{height:i,width:"auto"}:{height:i,width:n}})}},16485:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]])},17045:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},17910:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]])},18085:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]])},19393:()=>{},20063:(e,t,n)=>{"use strict";var r=n(47260);n.o(r,"notFound")&&n.d(t,{notFound:function(){return r.notFound}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},20508:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},20821:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{VALID_LOADERS:function(){return n},imageConfigDefault:function(){return r}});let n=["default","imgix","cloudinary","akamai","custom"],r={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumResponseBody:5e7,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:void 0,unoptimized:!1}},21786:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},21873:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},22455:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},23410:(e,t,n)=>{var r=n(9961),o=n(62575);e.exports=function e(t,n){var i;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,o,s){function l(){return new n(function(o,i){!function e(o,i,s,l){try{var a=t[o](i),c=a.value;return c instanceof r?n.resolve(c.v).then(function(t){e("next",t,s,l)},function(t){e("throw",t,s,l)}):n.resolve(c).then(function(e){a.value=e,s(a)},function(t){return e("throw",t,s,l)})}catch(e){l(e)}}(e,s,o,i)})}return i=i?i.then(l,l):l()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},23664:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},24326:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]])},25016:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var r=n(40373);function o(e){return r.So.getApiUrl(e)}},26894:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},26983:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},27573:e=>{function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},27816:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},28264:e=>{e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},30125:(e,t,n)=>{"use strict";var r=n(12115),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,l=r.useLayoutEffect,a=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,d=r[1];return l(function(){o.value=n,o.getSnapshot=t,c(o)&&d({inst:o})},[e,n,t]),s(function(){return c(o)&&d({inst:o}),e(function(){c(o)&&d({inst:o})})},[e]),a(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:d},30814:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},31520:e=>{function t(e,t,n,r,o,i,s){try{var l=e[i](s),a=l.value}catch(e){return void n(e)}l.done?t(a):Promise.resolve(a).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var s=e.apply(n,r);function l(e){t(s,o,i,l,a,"next",e)}function a(e){t(s,o,i,l,a,"throw",e)}l(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},32505:(e,t,n)=>{var r=n(74572)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},32943:(e,t,n)=>{"use strict";var r=n(22455);Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastChannel=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nextauth.message";return{receive:function(t){var n=function(n){if(n.key===e){var r,o=JSON.parse(null!=(r=n.newValue)?r:"{}");(null==o?void 0:o.event)==="session"&&null!=o&&o.data&&t(o)}};return window.addEventListener("storage",n),function(){return window.removeEventListener("storage",n)}},post:function(t){if("undefined"!=typeof window)try{localStorage.setItem(e,JSON.stringify(a(a({},t),{},{timestamp:u()})))}catch(e){}}}},t.apiBaseUrl=d,t.fetchData=function(e,t,n){return c.apply(this,arguments)},t.now=u;var o=r(n(32505)),i=r(n(10208)),s=r(n(31520));function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){(0,i.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(){return(c=(0,s.default)(o.default.mark(function e(t,n,r){var i,s,l,c,u,h,p,f,m,g=arguments;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=(i=g.length>3&&void 0!==g[3]?g[3]:{}).ctx,c=void 0===(l=i.req)?null==s?void 0:s.req:l,u="".concat(d(n),"/").concat(t),e.prev=2,p={headers:a({"Content-Type":"application/json"},null!=c&&null!=(h=c.headers)&&h.cookie?{cookie:c.headers.cookie}:{})},null!=c&&c.body&&(p.body=JSON.stringify(c.body),p.method="POST"),e.next=7,fetch(u,p);case 7:return f=e.sent,e.next=10,f.json();case 10:if(m=e.sent,f.ok){e.next=13;break}throw m;case 13:return e.abrupt("return",Object.keys(m).length>0?m:null);case 16:return e.prev=16,e.t0=e.catch(2),r.error("CLIENT_FETCH_ERROR",{error:e.t0,url:u}),e.abrupt("return",null);case 20:case"end":return e.stop()}},e,null,[[2,16]])}))).apply(this,arguments)}function d(e){return"undefined"==typeof window?"".concat(e.baseUrlServer).concat(e.basePathServer):e.basePath}function u(){return Math.floor(Date.now()/1e3)}},33078:(e,t)=>{"use strict";function n(e){let t={};for(let[n,r]of e.entries()){let e=t[n];void 0===e?t[n]=r:Array.isArray(e)?e.push(r):t[n]=[e,r]}return t}function r(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[n,o]of Object.entries(e))if(Array.isArray(o))for(let e of o)t.append(n,r(e));else t.set(n,r(o));return t}function i(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(let t of n){for(let n of t.keys())e.delete(n);for(let[n,r]of t.entries())e.append(n,r)}return e}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{assign:function(){return i},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return o}})},33455:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let r=n(28140)._(n(12115)),o=n(20821),i=r.default.createContext(o.imageConfigDefault)},33584:(e,t,n)=>{var r=n(88634);e.exports=function(e,t,n,o,i){var s=r(e,t,n,o,i);return s.next().then(function(e){return e.done?e.value:s.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},34826:(e,t,n)=>{"use strict";n.d(t,{D:()=>c,N:()=>d});var r=n(12115);let o=["light","dark"],i="(prefers-color-scheme: dark)",s="undefined"==typeof window,l=(0,r.createContext)(void 0),a={setTheme:e=>{},themes:[]},c=()=>{var e;return null!=(e=(0,r.useContext)(l))?e:a},d=e=>(0,r.useContext)(l)?r.createElement(r.Fragment,null,e.children):r.createElement(h,e),u=["light","dark"],h=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:s=!0,storageKey:a="theme",themes:c=u,defaultTheme:d=n?"system":"light",attribute:h="data-theme",value:y,children:v,nonce:b})=>{let[w,k]=(0,r.useState)(()=>f(a,d)),[x,S]=(0,r.useState)(()=>f(a)),M=y?Object.values(y):c,C=(0,r.useCallback)(e=>{let r=e;if(!r)return;"system"===e&&n&&(r=g());let i=y?y[r]:r,l=t?m():null,a=document.documentElement;if("class"===h?(a.classList.remove(...M),i&&a.classList.add(i)):i?a.setAttribute(h,i):a.removeAttribute(h),s){let e=o.includes(d)?d:null,t=o.includes(r)?r:e;a.style.colorScheme=t}null==l||l()},[]),O=(0,r.useCallback)(e=>{k(e);try{localStorage.setItem(a,e)}catch(e){}},[e]),A=(0,r.useCallback)(t=>{S(g(t)),"system"===w&&n&&!e&&C("system")},[w,e]);(0,r.useEffect)(()=>{let e=window.matchMedia(i);return e.addListener(A),A(e),()=>e.removeListener(A)},[A]),(0,r.useEffect)(()=>{let e=e=>{e.key===a&&O(e.newValue||d)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[O]),(0,r.useEffect)(()=>{C(null!=e?e:w)},[e,w]);let E=(0,r.useMemo)(()=>({theme:w,setTheme:O,forcedTheme:e,resolvedTheme:"system"===w?x:w,themes:n?[...c,"system"]:c,systemTheme:n?x:void 0}),[w,O,e,x,n,c]);return r.createElement(l.Provider,{value:E},r.createElement(p,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:s,storageKey:a,themes:c,defaultTheme:d,attribute:h,value:y,children:v,attrs:M,nonce:b}),v)},p=(0,r.memo)(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:s,enableColorScheme:l,defaultTheme:a,value:c,attrs:d,nonce:u})=>{let h="system"===a,p="class"===n?`var d=document.documentElement,c=d.classList;c.remove(${d.map(e=>`'${e}'`).join(",")});`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=l?o.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(e,t=!1,r=!0)=>{let i=c?c[e]:e,s=t?e+"|| ''":`'${i}'`,a="";return l&&r&&!t&&o.includes(e)&&(a+=`d.style.colorScheme = '${e}';`),"class"===n?a+=t||i?`c.add(${s})`:"null":i&&(a+=`d[s](n,${s})`),a},g=e?`!function(){${p}${m(e)}}()`:s?`!function(){try{${p}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${h})){var t='${i}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${c?`var x=${JSON.stringify(c)};`:""}${m(c?"x[e]":"e",!0)}}${h?"":"else{"+m(a,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${p}var e=localStorage.getItem('${t}');if(e){${c?`var x=${JSON.stringify(c)};`:""}${m(c?"x[e]":"e",!0)}}else{${m(a,!1,!1)};}${f}}catch(t){}}();`;return r.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:g}})},()=>!0),f=(e,t)=>{let n;if(!s){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},m=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},g=e=>(e||(e=window.matchMedia(i)),e.matches?"dark":"light")},35626:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},36489:(e,t,n)=>{"use strict";var r,o,i,s,l,a=n(95704),c=n(22455),d=n(92639);Object.defineProperty(t,"__esModule",{value:!0});var u={SessionContext:!0,useSession:!0,getSession:!0,getCsrfToken:!0,getProviders:!0,signIn:!0,signOut:!0,SessionProvider:!0};t.SessionContext=void 0,t.SessionProvider=function(e){if(!T)throw Error("React Context is unavailable in Server Components");var t,n,r,o,i,s,l=e.children,a=e.basePath,c=e.refetchInterval,d=e.refetchWhenOffline;a&&(O.basePath=a);var u=void 0!==e.session;O._lastSync=u?(0,b.now)():0;var p=g.useState(function(){return u&&(O._session=e.session),e.session}),y=(0,m.default)(p,2),v=y[0],k=y[1],x=g.useState(!u),S=(0,m.default)(x,2),M=S[0],C=S[1];g.useEffect(function(){return O._getSession=(0,f.default)(h.default.mark(function e(){var t,n,r=arguments;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(r.length>0&&void 0!==r[0]?r[0]:{}).event,e.prev=1,!((n="storage"===t)||void 0===O._session)){e.next=10;break}return O._lastSync=(0,b.now)(),e.next=7,N({broadcast:!n});case 7:return O._session=e.sent,k(O._session),e.abrupt("return");case 10:if(!(!t||null===O._session||(0,b.now)()<O._lastSync)){e.next=12;break}return e.abrupt("return");case 12:return O._lastSync=(0,b.now)(),e.next=15,N();case 15:O._session=e.sent,k(O._session),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(1),E.error("CLIENT_SESSION_ERROR",e.t0);case 22:return e.prev=22,C(!1),e.finish(22);case 25:case"end":return e.stop()}},e,null,[[1,19,22,25]])})),O._getSession(),function(){O._lastSync=0,O._session=void 0,O._getSession=function(){}}},[]),g.useEffect(function(){var e=A.receive(function(){return O._getSession({event:"storage"})});return function(){return e()}},[]),g.useEffect(function(){var t=e.refetchOnWindowFocus,n=void 0===t||t,r=function(){n&&"visible"===document.visibilityState&&O._getSession({event:"visibilitychange"})};return document.addEventListener("visibilitychange",r,!1),function(){return document.removeEventListener("visibilitychange",r,!1)}},[e.refetchOnWindowFocus]);var R=(t=g.useState("undefined"!=typeof navigator&&navigator.onLine),r=(n=(0,m.default)(t,2))[0],o=n[1],i=function(){return o(!0)},s=function(){return o(!1)},g.useEffect(function(){return window.addEventListener("online",i),window.addEventListener("offline",s),function(){window.removeEventListener("online",i),window.removeEventListener("offline",s)}},[]),r),P=!1!==d||R;g.useEffect(function(){if(c&&P){var e=setInterval(function(){O._session&&O._getSession({event:"poll"})},1e3*c);return function(){return clearInterval(e)}}},[c,P]);var I=g.useMemo(function(){return{data:v,status:M?"loading":v?"authenticated":"unauthenticated",update:function(e){return(0,f.default)(h.default.mark(function t(){var n;return h.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(M||!v)){t.next=2;break}return t.abrupt("return");case 2:return C(!0),t.t0=b.fetchData,t.t1=O,t.t2=E,t.next=8,D();case 8:return t.t3=t.sent,t.t4=e,t.t5={csrfToken:t.t3,data:t.t4},t.t6={body:t.t5},t.t7={req:t.t6},t.next=15,(0,t.t0)("session",t.t1,t.t2,t.t7);case 15:return n=t.sent,C(!1),n&&(k(n),A.post({event:"session",data:{trigger:"getSession"}})),t.abrupt("return",n);case 19:case"end":return t.stop()}},t)}))()}}},[v,M]);return(0,w.jsx)(T.Provider,{value:I,children:l})},t.getCsrfToken=D,t.getProviders=I,t.getSession=N,t.signIn=function(e,t,n){return _.apply(this,arguments)},t.signOut=function(e){return j.apply(this,arguments)},t.useSession=function(e){if(!T)throw Error("React Context is unavailable in Server Components");var t=g.useContext(T),n=null!=e?e:{},r=n.required,o=n.onUnauthenticated,i=r&&"unauthenticated"===t.status;return(g.useEffect(function(){if(i){var e="/api/auth/signin?".concat(new URLSearchParams({error:"SessionRequired",callbackUrl:window.location.href}));o?o():window.location.href=e}},[i,o]),i)?{data:t.data,update:t.update,status:"loading"}:t};var h=c(n(32505)),p=c(n(10208)),f=c(n(31520)),m=c(n(48358)),g=S(n(12115)),y=S(n(56445)),v=c(n(36880)),b=n(32943),w=n(95155),k=n(98404);function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(x=function(e){return e?n:t})(e)}function S(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=d(e)&&"function"!=typeof e)return{default:e};var n=x(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&({}).hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach(function(t){(0,p.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Object.keys(k).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(u,e))&&(e in t&&t[e]===k[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return k[e]}}))});var O={baseUrl:(0,v.default)(null!=(r=a.env.NEXTAUTH_URL)?r:a.env.VERCEL_URL).origin,basePath:(0,v.default)(a.env.NEXTAUTH_URL).path,baseUrlServer:(0,v.default)(null!=(o=null!=(i=a.env.NEXTAUTH_URL_INTERNAL)?i:a.env.NEXTAUTH_URL)?o:a.env.VERCEL_URL).origin,basePathServer:(0,v.default)(null!=(s=a.env.NEXTAUTH_URL_INTERNAL)?s:a.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:function(){}},A=(0,b.BroadcastChannel)(),E=(0,y.proxyLogger)(y.default,O.basePath),T=t.SessionContext=null==(l=g.createContext)?void 0:l.call(g,void 0);function N(e){return R.apply(this,arguments)}function R(){return(R=(0,f.default)(h.default.mark(function e(t){var n,r;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,b.fetchData)("session",O,E,t);case 2:return r=e.sent,(null==(n=null==t?void 0:t.broadcast)||n)&&A.post({event:"session",data:{trigger:"getSession"}}),e.abrupt("return",r);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function D(e){return P.apply(this,arguments)}function P(){return(P=(0,f.default)(h.default.mark(function e(t){var n;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,b.fetchData)("csrf",O,E,t);case 2:return n=e.sent,e.abrupt("return",null==n?void 0:n.csrfToken);case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function I(){return L.apply(this,arguments)}function L(){return(L=(0,f.default)(h.default.mark(function e(){return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,b.fetchData)("providers",O,E);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _(){return(_=(0,f.default)(h.default.mark(function e(t,n,r){var o,i,s,l,a,c,d,u,p,f,m,g,y,v,w,k,x;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=void 0===(i=(o=null!=n?n:{}).callbackUrl)?window.location.href:i,a=void 0===(l=o.redirect)||l,c=(0,b.apiBaseUrl)(O),e.next=4,I();case 4:if(d=e.sent){e.next=8;break}return window.location.href="".concat(c,"/error"),e.abrupt("return");case 8:if(!(!t||!(t in d))){e.next=11;break}return window.location.href="".concat(c,"/signin?").concat(new URLSearchParams({callbackUrl:s})),e.abrupt("return");case 11:return u="credentials"===d[t].type,p="email"===d[t].type,f=u||p,m="".concat(c,"/").concat(u?"callback":"signin","/").concat(t),g="".concat(m).concat(r?"?".concat(new URLSearchParams(r)):""),e.t0=fetch,e.t1=g,e.t2={"Content-Type":"application/x-www-form-urlencoded"},e.t3=URLSearchParams,e.t4=C,e.t5=C({},n),e.t6={},e.next=25,D();case 25:return e.t7=e.sent,e.t8=s,e.t9={csrfToken:e.t7,callbackUrl:e.t8,json:!0},e.t10=(0,e.t4)(e.t5,e.t6,e.t9),e.t11=new e.t3(e.t10),e.t12={method:"post",headers:e.t2,body:e.t11},e.next=33,(0,e.t0)(e.t1,e.t12);case 33:return y=e.sent,e.next=36,y.json();case 36:if(v=e.sent,!(a||!f)){e.next=42;break}return k=null!=(w=v.url)?w:s,window.location.href=k,k.includes("#")&&window.location.reload(),e.abrupt("return");case 42:if(x=new URL(v.url).searchParams.get("error"),!y.ok){e.next=46;break}return e.next=46,O._getSession({event:"storage"});case 46:return e.abrupt("return",{error:x,status:y.status,ok:y.ok,url:x?null:v.url});case 47:case"end":return e.stop()}},e)}))).apply(this,arguments)}function j(){return(j=(0,f.default)(h.default.mark(function e(t){var n,r,o,i,s,l,a,c,d;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=void 0===(r=(null!=t?t:{}).callbackUrl)?window.location.href:r,i=(0,b.apiBaseUrl)(O),e.t0={"Content-Type":"application/x-www-form-urlencoded"},e.t1=URLSearchParams,e.next=6,D();case 6:return e.t2=e.sent,e.t3=o,e.t4={csrfToken:e.t2,callbackUrl:e.t3,json:!0},e.t5=new e.t1(e.t4),s={method:"post",headers:e.t0,body:e.t5},e.next=13,fetch("".concat(i,"/signout"),s);case 13:return l=e.sent,e.next=16,l.json();case 16:if(a=e.sent,A.post({event:"session",data:{trigger:"signout"}}),!(null==(n=null==t?void 0:t.redirect)||n)){e.next=23;break}return d=null!=(c=a.url)?c:o,window.location.href=d,d.includes("#")&&window.location.reload(),e.abrupt("return");case 23:return e.next=25,O._getSession({event:"storage"});case 25:return e.abrupt("return",a);case 26:case"end":return e.stop()}},e)}))).apply(this,arguments)}},36880:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;let n=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e=`https://${e}`);let r=new URL(null!=(t=e)?t:n),o=("/"===r.pathname?n.pathname:r.pathname).replace(/\/$/,""),i=`${r.origin}${o}`;return{origin:r.origin,host:r.host,path:o,base:i,toString:()=>i}}},37081:e=>{e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,l=[],a=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}},e.exports.__esModule=!0,e.exports.default=e.exports},37271:(e,t,n)=>{var r=n(93826);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},37586:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},39068:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},39347:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]])},40373:(e,t,n)=>{"use strict";n.d(t,{$W:()=>o,So:()=>i});var r=n(95704);let o={server:{port:r.env.PORT||5001,host:r.env.HOST||"localhost",nodeEnv:"production"},database:{url:r.env.DATABASE_URL},auth:{url:r.env.NEXTAUTH_URL,secret:r.env.NEXTAUTH_SECRET},app:{customKey:"orgpyurbytimeglobalkey",baseUrl:"https://orgpyur.com"},routes:{home:"/",about:"/about",solutions:"/solutions",products:"/products",contact:"/contact",blog:"/blog",awards:"/awards",resources:"/resources",partners:"/partners",customers:"/customers",pricing:"/pricing",guardServices:"/guard-services",admin:"/admin",adminLogin:"/admin/login"},company:{description:r.env.NEXT_PUBLIC_COMPANY_DESCRIPTION||"",address:r.env.NEXT_PUBLIC_COMPANY_ADDRESS||"",googleMapsUrl:r.env.NEXT_PUBLIC_COMPANY_GOOGLE_MAPS_URL||""},contact:{email:{contact:r.env.NEXT_PUBLIC_CONTACT_EMAIL||"",support:r.env.NEXT_PUBLIC_SUPPORT_EMAIL||"",general:r.env.NEXT_PUBLIC_GENERAL_EMAIL||""},phone:{general:r.env.NEXT_PUBLIC_CONTACT_PHONE||"",support:r.env.NEXT_PUBLIC_SUPPORT_PHONE||""}},APP_VERSION:"1.0.0",BASE_URL:"https://orgpyur.com"},i={getCurrentDomain:()=>window.location.hostname,getBaseUrl:()=>{let e=i.getCurrentDomain();return"".concat("https","://").concat(e).concat("")},getApiUrl:e=>{if("production"===o.server.nodeEnv)return e;let t=o.app.baseUrl||i.getBaseUrl();return t?"".concat(t).concat(e):e},isDevelopment:()=>"development"===o.server.nodeEnv,isProduction:()=>"production"===o.server.nodeEnv,getContactEmail:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"general";return o.contact.email[e]},getCurrentYear:()=>new Date().getFullYear().toString(),validateRequiredEnvVars:()=>{let e=["DATABASE_URL","NEXTAUTH_SECRET","NEXTAUTH_URL"].filter(e=>!r.env[e]);return e.length>0?(console.error("❌ Missing required environment variables: ".concat(e.join(", "))),console.error("Please check your .env file and ensure all required variables are set."),!1):(console.log("✅ All required environment variables are set"),!0)}}},41216:(e,t,n)=>{var r=n(27573),o=n(94089),i=n(7861),s=n(70355);function l(t){var n="function"==typeof Map?new Map:void 0;return e.exports=l=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return s(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,l(t)}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},42196:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},45105:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(12115),o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(e,t)=>{let n=(0,r.forwardRef)((n,i)=>{let{color:s="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:d="",children:u,...h}=n;return(0,r.createElement)("svg",{ref:i,...o,width:l,height:l,stroke:s,strokeWidth:c?24*Number(a)/Number(l):a,className:["lucide","lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()),d].join(" "),...h},[...t.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(u)?u:[u]])});return n.displayName="".concat(e),n}},45345:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]])},45688:(e,t,n)=>{"use strict";var r=n(95704);n(86340);var o=n(12115),i=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(o),s=void 0!==r&&r.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},a=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,o=t.optimizeForSpeed,i=void 0===o?s:o;c(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var a="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=a?a.getAttribute("content"):null}var t,n=e.prototype;return n.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},n.isOptimizeForSpeed=function(){return this._optimizeForSpeed},n.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(s||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},n.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},n.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},n.insertRule=function(e,t){if(c(l(e),"`insertRule` accepts only strings"),"undefined"==typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return s||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},n.replaceRule=function(e,t){if(this._optimizeForSpeed||"undefined"==typeof window){var n="undefined"!=typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){s||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},n.deleteRule=function(e){if("undefined"==typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},n.flush=function(){this._injected=!1,this._rulesCount=0,"undefined"!=typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},n.cssRules=function(){var e=this;return"undefined"==typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},n.makeStyleTag=function(e,t,n){t&&c(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var o=document.head||document.getElementsByTagName("head")[0];return n?o.insertBefore(r,n):o.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},u={};function h(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return u[r]||(u[r]="jsx-"+d(e+"-"+n)),u[r]}function p(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var n=e+t;return u[n]||(u[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[n]}var f=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,o=t.optimizeForSpeed,i=void 0!==o&&o;this._sheet=r||new a({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),r&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,o=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var i=o.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=i,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return i.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var o=h(r,n);return{styleId:o,rules:Array.isArray(t)?t.map(function(e){return p(o,e)}):[p(o,t)]}}return{styleId:h(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=o.createContext(null);m.displayName="StyleSheetContext";var g=i.default.useInsertionEffect||i.default.useLayoutEffect,y="undefined"!=typeof window?new f:void 0;function v(e){var t=y||o.useContext(m);return t&&("undefined"==typeof window?t.add(e):g(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},t.style=v},46046:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]])},47670:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{formatUrl:function(){return i},formatWithValidation:function(){return l},urlObjectKeys:function(){return s}});let r=n(49417)._(n(33078)),o=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:n}=e,i=e.protocol||"",s=e.pathname||"",l=e.hash||"",a=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?"["+n+"]":n),e.port&&(c+=":"+e.port)),a&&"object"==typeof a&&(a=String(r.urlQueryToSearchParams(a)));let d=e.search||a&&"?"+a||"";return i&&!i.endsWith(":")&&(i+=":"),e.slashes||(!i||o.test(i))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),d&&"?"!==d[0]&&(d="?"+d),""+i+c+(s=s.replace(/[?#]/g,encodeURIComponent))+(d=d.replace("#","%23"))+l}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return i(e)}},47937:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]])},48358:(e,t,n)=>{var r=n(26894),o=n(37081),i=n(37271),s=n(253);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},48618:(e,t,n)=>{var r=n(94089);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},50954:e=>{e.exports=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},52472:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Award",[["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}],["path",{d:"M15.477 12.89 17 22l-5-3-5 3 1.523-9.11",key:"em7aur"}]])},52619:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return g},useLinkStatus:function(){return v}});let r=n(49417),o=n(95155),i=r._(n(12115)),s=n(47670),l=n(46752),a=n(83011),c=n(62296),d=n(96058);n(94781);let u=n(63499),h=n(58607),p=n(11807);n(17045);let f=n(66048);function m(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function g(e){var t;let n,r,s,[g,v]=(0,i.useOptimistic)(u.IDLE_LINK_STATUS),b=(0,i.useRef)(null),{href:w,as:k,children:x,prefetch:S=null,passHref:M,replace:C,shallow:O,scroll:A,onClick:E,onMouseEnter:T,onTouchStart:N,legacyBehavior:R=!1,onNavigate:D,ref:P,unstable_dynamicOnHover:I,...L}=e;n=x,R&&("string"==typeof n||"number"==typeof n)&&(n=(0,o.jsx)("a",{children:n}));let _=i.default.useContext(l.AppRouterContext),j=!1!==S,z=!1!==S?null===(t=S)||"auto"===t?f.FetchStrategy.PPR:f.FetchStrategy.Full:f.FetchStrategy.PPR,{href:B,as:$}=i.default.useMemo(()=>{let e=m(w);return{href:e,as:k?m(k):e}},[w,k]);R&&(r=i.default.Children.only(n));let F=R?r&&"object"==typeof r&&r.ref:P,V=i.default.useCallback(e=>(null!==_&&(b.current=(0,u.mountLinkInstance)(e,B,_,z,j,v)),()=>{b.current&&((0,u.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,u.unmountPrefetchableInstance)(e)}),[j,B,_,z,v]),H={ref:(0,a.useMergedRef)(V,F),onClick(e){R||"function"!=typeof E||E(e),R&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(e),_&&(e.defaultPrevented||function(e,t,n,r,o,s,l){let{nodeName:a}=e.currentTarget;if(!("A"===a.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||e.currentTarget.hasAttribute("download"))){if(!(0,h.isLocalURL)(t)){o&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}i.default.startTransition(()=>{(0,p.dispatchNavigateAction)(n||t,o?"replace":"push",null==s||s,r.current)})}}(e,B,$,b,C,A,D))},onMouseEnter(e){R||"function"!=typeof T||T(e),R&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),_&&j&&(0,u.onNavigationIntent)(e.currentTarget,!0===I)},onTouchStart:function(e){R||"function"!=typeof N||N(e),R&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),_&&j&&(0,u.onNavigationIntent)(e.currentTarget,!0===I)}};return(0,c.isAbsoluteUrl)($)?H.href=$:R&&!M&&("a"!==r.type||"href"in r.props)||(H.href=(0,d.addBasePath)($)),s=R?i.default.cloneElement(r,H):(0,o.jsx)("a",{...L,...H,children:n}),(0,o.jsx)(y.Provider,{value:g,children:s})}let y=(0,i.createContext)(u.IDLE_LINK_STATUS),v=()=>(0,i.useContext)(y);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},52987:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},54652:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return a},getImageProps:function(){return l}});let r=n(28140),o=n(75040),i=n(81356),s=r._(n(71124));function l(e){let{props:t}=(0,o.getImgProps)(e,{defaultLoader:s.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!0,unoptimized:!1}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let a=i.Image},56046:e=>{e.exports=function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},56154:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]])},56445:(e,t,n)=>{"use strict";var r=n(22455);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.proxyLogger=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;try{if("undefined"==typeof window)return e;var n={},r=function(e){var r;n[e]=(r=(0,s.default)(o.default.mark(function n(r,s){var l,u;return o.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(d[e](r,s),"error"===e&&(s=c(s)),s.client=!0,l="".concat(t,"/_log"),u=new URLSearchParams(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){(0,i.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({level:e,code:r},s)),!navigator.sendBeacon){n.next=8;break}return n.abrupt("return",navigator.sendBeacon(l,u));case 8:return n.next=10,fetch(l,{method:"POST",body:u,keepalive:!0});case 10:return n.abrupt("return",n.sent);case 11:case"end":return n.stop()}},n)})),function(e,t){return r.apply(this,arguments)})};for(var l in e)r(l);return n}catch(e){return d}},t.setLogger=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t||(d.debug=function(){}),e.error&&(d.error=e.error),e.warn&&(d.warn=e.warn),e.debug&&(d.debug=e.debug)};var o=r(n(32505)),i=r(n(10208)),s=r(n(31520)),l=n(74090);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){var t,n;if(e instanceof Error&&!(e instanceof l.UnknownError))return{message:e.message,stack:e.stack,name:e.name};if(null!=(t=e)&&t.error){e.error=c(e.error),e.message=null!=(n=e.message)?n:e.error.message}return e}var d={error:function(e,t){t=c(t),console.error("[next-auth][error][".concat(e,"]"),"\nhttps://next-auth.js.org/errors#".concat(e.toLowerCase()),t.message,t)},warn:function(e){console.warn("[next-auth][warn][".concat(e,"]"),"\nhttps://next-auth.js.org/warnings#".concat(e.toLowerCase()))},debug:function(e,t){console.log("[next-auth][debug][".concat(e,"]"),t)}};t.default=d},57828:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},58119:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],n.get(o[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var r,o,i,s=i[o];if(("_owner"!==s||!t.$$typeof)&&!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},58607:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return i}});let r=n(62296),o=n(92929);function i(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,o.hasBasePath)(n.pathname)}catch(e){return!1}}},59283:e=>{function t(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(e.exports=t=function(){return!!n},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},60558:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(95155),o=n(27816),i=n(91078),s=n(65229),l=n(12115);function a(e){let{message:t,onClear:n,autoHide:a=!0,autoHideDelay:c=5e3}=e,[d,u]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{if(t.type){if(u(!0),a){let e=setTimeout(()=>{u(!1),n&&setTimeout(n,300)},c);return()=>clearTimeout(e)}}else u(!1)},[t,a,c,n]),t.type&&d)?(0,r.jsxs)("div",{className:"mb-6 p-4 rounded-md flex items-center justify-between transition-all duration-300 ".concat("success"===t.type?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-300 border border-green-200 dark:border-green-800":"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-300 border border-red-200 dark:border-red-800"),children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:["success"===t.type?(0,r.jsx)(o.A,{className:"h-5 w-5"}):(0,r.jsx)(i.A,{className:"h-5 w-5"}),(0,r.jsx)("span",{children:t.text})]}),n&&(0,r.jsx)("button",{onClick:()=>{u(!1),setTimeout(n,300)},className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors",children:(0,r.jsx)(s.A,{className:"h-4 w-4"})})]}):null}},60614:(e,t,n)=>{var r=n(92639).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},60861:(e,t)=>{"use strict";function n(e){let{ampFirst:t=!1,hybrid:n=!1,hasQuery:r=!1}=void 0===e?{}:e;return t||n&&r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return n}})},61667:(e,t,n)=>{"use strict";n.d(t,{M:()=>s});var r=n(12115);let o=null,i=0;function s(e){var t,n,s;let[l,a]=(0,r.useState)([]),[c,d]=(0,r.useState)(!0),[u,h]=(0,r.useState)(null),p=null!=(t=null==e?void 0:e.showInactive)&&t,f=null!=(n=null==e?void 0:e.showOnHomepage)&&n,m=null!=(s=null==e?void 0:e.refresh)&&s;return(0,r.useEffect)(()=>{(async()=>{if(!m&&o&&Date.now()-i<6e5){let e=o;p||(e=e.filter(e=>e.isActive)),f&&(e=e.filter(e=>e.showOnHomepage)),a(e),d(!1);return}try{let e=await fetch(p?"/api/content/awards?showInactive=true":"/api/content/awards?showInactive=false");if(e.ok){let t=await e.json();o=t,i=Date.now();let n=t;p||(n=n.filter(e=>e.isActive)),f&&(n=n.filter(e=>e.showOnHomepage)),a(n)}else throw Error("Failed to fetch awards")}catch(e){if(h(e instanceof Error?e.message:"An error occurred"),o){let e=o;p||(e=e.filter(e=>e.isActive)),f&&(e=e.filter(e=>e.showOnHomepage)),a(e)}}finally{d(!1)}})()},[p,f,m]),{awards:l,loading:c,error:u,refreshAwards:async()=>{o=null,i=0,d(!0),h(null);try{let e=await fetch(p?"/api/content/awards?showInactive=true":"/api/content/awards?showInactive=false");if(e.ok){let t=await e.json();o=t,i=Date.now();let n=t;p||(n=n.filter(e=>e.isActive)),f&&(n=n.filter(e=>e.showOnHomepage)),a(n)}else throw Error("Failed to fetch awards")}catch(e){h(e instanceof Error?e.message:"An error occurred")}finally{d(!1)}}}}},61712:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]])},62022:(e,t,n)=>{"use strict";n.d(t,{HZ:()=>i});var r=n(12115);let o=new Map;function i(e,t){var n,i;let[s,l]=(0,r.useState)([]),[a,c]=(0,r.useState)(!0),[d,u]=(0,r.useState)(null),h=null!=(n=null==t?void 0:t.showInactive)&&n,p=null==t?void 0:t.limit,f=(null==t?void 0:t.cacheTime)||6e5,m=null!=(i=null==t?void 0:t.refresh)&&i,g=null==t?void 0:t.transform;return(0,r.useEffect)(()=>{(async()=>{let t=new URLSearchParams;h&&t.append("showInactive","true"),p&&t.append("limit",p.toString());let n="".concat(e).concat(t.toString()?"?".concat(t.toString()):"");if(!m&&o.has(n)){let e=o.get(n);if(Date.now()-e.timestamp<e.ttl){l(g?g(e.data):e.data),c(!1);return}o.delete(n)}try{let r="".concat(e).concat(t.toString()?"?".concat(t.toString()):""),i=await fetch(r);if(i.ok){let e=await i.json();o.set(n,{data:e,timestamp:Date.now(),ttl:f});let t=g?g(e):e;l(t)}else throw Error("Failed to fetch content from ".concat(e))}catch(e){if(u(e instanceof Error?e.message:"An error occurred"),o.has(n)){let e=o.get(n);l(g?g(e.data):e.data)}}finally{c(!1)}})()},[e,h,p,f,m,g]),{data:s,loading:a,error:d,refreshContent:async()=>{let t=[];o.forEach((n,r)=>{r.startsWith(e)&&t.push(r)}),t.forEach(e=>o.delete(e)),c(!0),u(null);try{let t=new URLSearchParams;h&&t.append("showInactive","true"),p&&t.append("limit",p.toString());let n="".concat(e).concat(t.toString()?"?".concat(t.toString()):""),r=await fetch(n);if(r.ok){let n=await r.json(),i="".concat(e).concat(t.toString()?"?".concat(t.toString()):"");o.set(i,{data:n,timestamp:Date.now(),ttl:f});let s=g?g(n):n;l(s)}else throw Error("Failed to fetch content from ".concat(e))}catch(e){u(e instanceof Error?e.message:"An error occurred")}finally{c(!1)}}}}},62296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DecodeError:function(){return f},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return y},NormalizeError:function(){return m},PageNotFoundError:function(){return g},SP:function(){return h},ST:function(){return p},WEB_VITALS:function(){return n},execOnce:function(){return r},getDisplayName:function(){return a},getLocationOrigin:function(){return s},getURL:function(){return l},isAbsoluteUrl:function(){return i},isResSent:function(){return c},loadGetInitialProps:function(){return u},normalizeRepeatedSlashes:function(){return d},stringifyError:function(){return b}});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function r(e){let t,n=!1;return function(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return n||(n=!0,t=e(...o)),t}}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=e=>o.test(e);function s(){let{protocol:e,hostname:t,port:n}=window.location;return e+"//"+t+(n?":"+n:"")}function l(){let{href:e}=window.location,t=s();return e.substring(t.length)}function a(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function c(e){return e.finished||e.headersSent}function d(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function u(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await u(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&c(n))return r;if(!r)throw Object.defineProperty(Error('"'+a(e)+'.getInitialProps()" should resolve to an object. But found "'+r+'" instead.'),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r}let h="undefined"!=typeof performance,p=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class f extends Error{}class m extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class y extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class v extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function b(e){return JSON.stringify({message:e.message,stack:e.stack})}},62575:e=>{function t(n,r,o,i){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}e.exports=t=function(e,n,r,o){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?s?s(e,n,{value:r,enumerable:!o,configurable:!o,writable:!o}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},63581:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]])},65229:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},67333:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]])},69141:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]])},70355:(e,t,n)=>{var r=n(59283),o=n(94089);e.exports=function(e,t,n){if(r())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var s=new(e.bind.apply(e,i));return n&&o(s,n.prototype),s},e.exports.__esModule=!0,e.exports.default=e.exports},71124:(e,t)=>{"use strict";function n(e){var t;let{config:n,src:r,width:o,quality:i}=e,s=i||(null==(t=n.qualities)?void 0:t.reduce((e,t)=>Math.abs(t-75)<Math.abs(e-75)?t:e))||75;return n.path+"?url="+encodeURIComponent(r)+"&w="+o+"&q="+s+(r.startsWith("/_next/static/media/"),"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}}),n.__next_img_default=!0;let r=n},71360:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},71871:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]])},72057:(e,t,n)=>{var r=n(92639).default,o=n(56046);e.exports=function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},74090:(e,t,n)=>{"use strict";var r=n(22455);Object.defineProperty(t,"__esModule",{value:!0}),t.UnsupportedStrategy=t.UnknownError=t.OAuthCallbackError=t.MissingSecret=t.MissingAuthorize=t.MissingAdapterMethods=t.MissingAdapter=t.MissingAPIRoute=t.InvalidCallbackUrl=t.AccountNotLinkedError=void 0,t.adapterErrorHandler=function(e,t){if(e)return Object.keys(e).reduce(function(n,r){return n[r]=(0,i.default)(o.default.mark(function n(){var i,s,l,a,c,d=arguments;return o.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:for(n.prev=0,s=Array(i=d.length),l=0;l<i;l++)s[l]=d[l];return t.debug("adapter_".concat(r),{args:s}),a=e[r],n.next=6,a.apply(void 0,s);case 6:return n.abrupt("return",n.sent);case 9:throw n.prev=9,n.t0=n.catch(0),t.error("adapter_error_".concat(r),n.t0),(c=new f(n.t0)).name="".concat(g(r),"Error"),c;case 15:case"end":return n.stop()}},n,null,[[0,9]])})),n},{})},t.capitalize=g,t.eventsErrorHandler=function(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=(0,i.default)(o.default.mark(function n(){var i,s=arguments;return o.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,i=e[r],n.next=4,i.apply(void 0,s);case 4:return n.abrupt("return",n.sent);case 7:n.prev=7,n.t0=n.catch(0),t.error("".concat(m(r),"_EVENT_ERROR"),n.t0);case 10:case"end":return n.stop()}},n,null,[[0,7]])})),n},{})},t.upperSnake=m;var o=r(n(32505)),i=r(n(31520)),s=r(n(10208)),l=r(n(50954)),a=r(n(7398)),c=r(n(72057)),d=r(n(27573)),u=r(n(48618));function h(e,t,n){return t=(0,d.default)(t),(0,c.default)(e,p()?Reflect.construct(t,n||[],(0,d.default)(e).constructor):t.apply(e,n))}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var f=t.UnknownError=function(e){function t(e){var n,r;return(0,l.default)(this,t),(r=h(this,t,[null!=(n=null==e?void 0:e.message)?n:e])).name="UnknownError",r.code=e.code,e instanceof Error&&(r.stack=e.stack),r}return(0,u.default)(t,e),(0,a.default)(t,[{key:"toJSON",value:function(){return{name:this.name,message:this.message,stack:this.stack}}}])}((0,r(n(41216)).default)(Error));function m(e){return e.replace(/([A-Z])/g,"_$1").toUpperCase()}function g(e){return"".concat(e[0].toUpperCase()).concat(e.slice(1))}t.OAuthCallbackError=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","OAuthCallbackError"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.AccountNotLinkedError=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","AccountNotLinkedError"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.MissingAPIRoute=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","MissingAPIRouteError"),(0,s.default)(e,"code","MISSING_NEXTAUTH_API_ROUTE_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.MissingSecret=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","MissingSecretError"),(0,s.default)(e,"code","NO_SECRET"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.MissingAuthorize=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","MissingAuthorizeError"),(0,s.default)(e,"code","CALLBACK_CREDENTIALS_HANDLER_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.MissingAdapter=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","MissingAdapterError"),(0,s.default)(e,"code","EMAIL_REQUIRES_ADAPTER_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.MissingAdapterMethods=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","MissingAdapterMethodsError"),(0,s.default)(e,"code","MISSING_ADAPTER_METHODS_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.UnsupportedStrategy=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","UnsupportedStrategyError"),(0,s.default)(e,"code","CALLBACK_CREDENTIALS_JWT_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.InvalidCallbackUrl=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","InvalidCallbackUrl"),(0,s.default)(e,"code","INVALID_CALLBACK_URL_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f)},74572:(e,t,n)=>{var r=n(9961),o=n(75476),i=n(33584),s=n(88634),l=n(23410),a=n(28264),c=n(60614);function d(){"use strict";var t=o(),n=t.m(d),u=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function h(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===u||"GeneratorFunction"===(t.displayName||t.name))}var p={throw:1,return:2,break:3,continue:3};function f(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,p[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,c(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=d=function(){return{wrap:function(e,n,r,o){return t.w(f(e),n,r,o&&o.reverse())},isGeneratorFunction:h,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:l,async:function(e,t,n,r,o){return(h(t)?s:i)(f(e),t,n,r,o)},keys:a,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=d,e.exports.__esModule=!0,e.exports.default=e.exports},74841:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return m},defaultHead:function(){return u}});let r=n(28140),o=n(49417),i=n(95155),s=o._(n(12115)),l=r._(n(1262)),a=n(90737),c=n(82073),d=n(60861);function u(e){void 0===e&&(e=!1);let t=[(0,i.jsx)("meta",{charSet:"utf-8"},"charset")];return e||t.push((0,i.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")),t}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===s.default.Fragment?e.concat(s.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}n(94781);let p=["name","httpEquiv","charSet","itemProp"];function f(e,t){let{inAmpMode:n}=t;return e.reduce(h,[]).reverse().concat(u(n).reverse()).filter(function(){let e=new Set,t=new Set,n=new Set,r={};return o=>{let i=!0,s=!1;if(o.key&&"number"!=typeof o.key&&o.key.indexOf("$")>0){s=!0;let t=o.key.slice(o.key.indexOf("$")+1);e.has(t)?i=!1:e.add(t)}switch(o.type){case"title":case"base":t.has(o.type)?i=!1:t.add(o.type);break;case"meta":for(let e=0,t=p.length;e<t;e++){let t=p[e];if(o.props.hasOwnProperty(t))if("charSet"===t)n.has(t)?i=!1:n.add(t);else{let e=o.props[t],n=r[t]||new Set;("name"!==t||!s)&&n.has(e)?i=!1:(n.add(e),r[t]=n)}}}return i}}()).reverse().map((e,t)=>{let n=e.key||t;return s.default.cloneElement(e,{key:n})})}let m=function(e){let{children:t}=e,n=(0,s.useContext)(a.AmpStateContext),r=(0,s.useContext)(c.HeadManagerContext);return(0,i.jsx)(l.default,{reduceComponentsToState:f,headManager:r,inAmpMode:(0,d.isInAmpMode)(n),children:t})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75040:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return a}}),n(94781);let r=n(14105),o=n(20821),i=["-moz-initial","fill","none","scale-down",void 0];function s(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function a(e,t){var n,a;let c,d,u,{src:h,sizes:p,unoptimized:f=!1,priority:m=!1,loading:g,className:y,quality:v,width:b,height:w,fill:k=!1,style:x,overrideSrc:S,onLoad:M,onLoadingComplete:C,placeholder:O="empty",blurDataURL:A,fetchPriority:E,decoding:T="async",layout:N,objectFit:R,objectPosition:D,lazyBoundary:P,lazyRoot:I,...L}=e,{imgConf:_,showAltText:j,blurComplete:z,defaultLoader:B}=t,$=_||o.imageConfigDefault;if("allSizes"in $)c=$;else{let e=[...$.deviceSizes,...$.imageSizes].sort((e,t)=>e-t),t=$.deviceSizes.sort((e,t)=>e-t),r=null==(n=$.qualities)?void 0:n.sort((e,t)=>e-t);c={...$,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===B)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let F=L.loader||B;delete L.loader,delete L.srcSet;let V="__next_img_default"in F;if(V){if("custom"===c.loader)throw Object.defineProperty(Error('Image with src "'+h+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader'),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=F;F=t=>{let{config:n,...r}=t;return e(r)}}if(N){"fill"===N&&(k=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[N];e&&(x={...x,...e});let t={responsive:"100vw",fill:"100vw"}[N];t&&!p&&(p=t)}let H="",U=l(b),q=l(w),W=!1;if((a=h)&&"object"==typeof a&&(s(a)||void 0!==a.src)){let e=s(h)?h.default:h;if(!e.src)throw Object.defineProperty(Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e)),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!e.height||!e.width)throw Object.defineProperty(Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e)),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(d=e.blurWidth,u=e.blurHeight,A=A||e.blurDataURL,H=e.src,W=/\.avif(?:\?|$)/i.test(H),!k)if(U||q){if(U&&!q){let t=U/e.width;q=Math.round(e.height*t)}else if(!U&&q){let t=q/e.height;U=Math.round(e.width*t)}}else U=e.width,q=e.height}W&&"blur"===O&&!A&&(O="empty");let K=!m&&("lazy"===g||void 0===g);(!(h="string"==typeof h?h:H)||h.startsWith("data:")||h.startsWith("blob:"))&&(f=!0,K=!1),c.unoptimized&&(f=!0),V&&!c.dangerouslyAllowSVG&&h.split("?",1)[0].endsWith(".svg")&&(f=!0);let J=l(v),G=Object.assign(k?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:R,objectPosition:D}:{},j?{}:{color:"transparent"},x),X=z||"empty"===O?null:"blur"===O?'url("data:image/svg+xml;charset=utf-8,'+(0,r.getImageBlurSvg)({widthInt:U,heightInt:q,blurWidth:d,blurHeight:u,blurDataURL:A||"",objectFit:G.objectFit})+'")':'url("'+O+'")',Y=i.includes(G.objectFit)?"fill"===G.objectFit?"100% 100%":"cover":G.objectFit,Q=X?{backgroundSize:Y,backgroundPosition:G.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:X}:{},Z=function(e){let{config:t,src:n,unoptimized:r,width:o,quality:i,sizes:s,loader:l}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:a,kind:c}=function(e,t,n){let{deviceSizes:r,allSizes:o}=e;if(n){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(n);)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:o,kind:"w"}}return"number"!=typeof t?{widths:r,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))],kind:"x"}}(t,o,s),d=a.length-1;return{sizes:s||"w"!==c?s:"100vw",srcSet:a.map((e,r)=>l({config:t,src:n,quality:i,width:e})+" "+("w"===c?e:r+1)+c).join(", "),src:l({config:t,src:n,quality:i,width:a[d]})}}({config:c,src:h,unoptimized:f,width:U,quality:J,sizes:p,loader:F});return{props:{...L,loading:K?"lazy":g,fetchPriority:E,width:U,height:q,decoding:T,className:y,style:{...G,...Q},sizes:Z.sizes,srcSet:Z.srcSet,src:S||Z.src},meta:{unoptimized:f,priority:m,placeholder:O,fill:k}}}},75476:(e,t,n)=>{var r=n(62575);function o(){var t,n,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",l=i.toStringTag||"@@toStringTag";function a(e,o,i,s){var l=Object.create((o&&o.prototype instanceof d?o:d).prototype);return r(l,"_invoke",function(e,r,o){var i,s,l,a=0,d=o||[],u=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,s=0,l=t,h.n=n,c}};function p(e,r){for(s=e,l=r,n=0;!u&&a&&!o&&n<d.length;n++){var o,i=d[n],p=h.p,f=i[2];e>3?(o=f===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=e<2&&p<i[1])?(s=0,h.v=r,h.n=i[1]):p<f&&(o=e<3||i[0]>r||r>f)&&(i[4]=e,i[5]=r,h.n=f,s=0))}if(o||e>1)return c;throw u=!0,r}return function(o,d,f){if(a>1)throw TypeError("Generator is already running");for(u&&1===d&&p(d,f),s=d,l=f;(n=s<2?t:l)||!u;){i||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(a=2,i){if(s||(o="next"),n=i[o]){if(!(n=n.call(i,l)))throw TypeError("iterator result is not an object");if(!n.done)return n;l=n.value,s<2&&(s=0)}else 1===s&&(n=i.return)&&n.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((n=(u=h.n<0)?l:e.call(r,h))!==c)break}catch(e){i=t,s=1,l=e}finally{a=1}}return{value:n,done:u}}}(e,i,s),!0),l}var c={};function d(){}function u(){}function h(){}n=Object.getPrototypeOf;var p=h.prototype=d.prototype=Object.create([][s]?n(n([][s]())):(r(n={},s,function(){return this}),n));function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,r(e,l,"GeneratorFunction")),e.prototype=Object.create(p),e}return u.prototype=h,r(p,"constructor",h),r(h,"constructor",u),u.displayName="GeneratorFunction",r(h,l,"GeneratorFunction"),r(p),r(p,l,"Generator"),r(p,s,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:a,m:f}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},76168:(e,t,n)=>{var r=n(92639).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},77439:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(95155),o=n(12115),i=n(54652),s=n.n(i);function l(e){let{src:t,alt:n,width:i,height:l,className:a}=e,[c,d]=(0,o.useState)(!1),[u,h]=(0,o.useState)(!0),p=t.includes("/blog-media/")||t.includes("/api/media/blog-media/");return c?(0,r.jsx)("div",{className:"bg-gray-200 dark:bg-gray-700 flex items-center justify-center ".concat(a),style:{width:i,height:l},children:(0,r.jsx)("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"Image not available"})}):p?(0,r.jsx)("img",{src:t,alt:n,width:i,height:l,className:a,style:{maxWidth:"100%",height:"auto"},onLoad:()=>h(!1),onError:()=>{d(!0),h(!1)}}):(0,r.jsx)(s(),{src:t,alt:n,width:i,height:l,className:a,onLoad:()=>h(!1),onError:()=>{d(!0),h(!1)}})}},78138:(e,t,n)=>{"use strict";n.d(t,{A:()=>dU});var r=n(95155),o=n(88661),i=n.n(o),s=n(12115),l=n(47650),a=n(14806),c=Object.defineProperty;function d(e){this.content=e}function u(e){return e>=56320&&e<57344}function h(e){return e>=55296&&e<56320}d.prototype={constructor:d,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return -1},get:function(e){var t=this.find(e);return -1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return -1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new d(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new d(n)},addToStart:function(e,t){return new d([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new d(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new d(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=d.from(e)).size?new d(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=d.from(e)).size?new d(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=d.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},d.from=function(e){if(e instanceof d)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new d(t)};class p{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let l=this.content[i],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,o||null,i)&&l.content.size){let o=s+1;l.nodesBetween(Math.max(0,e-o),Math.min(l.content.size,t-o),n,r+o)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,(s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=a},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new p(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let s=this.content[o],l=i+s.nodeSize;l>e&&((i<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=l}return new p(n,r)}cutByIndex(e,t){return e==t?p.empty:0==e&&t==this.content.length?this:new p(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new p(r,o)}addToStart(e){return new p([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new p(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let o=0;;o++){if(o==t.childCount||o==n.childCount)return t.childCount==n.childCount?null:r;let i=t.child(o),s=n.child(o);if(i==s){r+=i.nodeSize;continue}if(!i.sameMarkup(s))return r;if(i.isText&&i.text!=s.text){let e=i.text,t=s.text,n=0;for(;e[n]==t[n];n++)r++;return n&&n<e.length&&n<t.length&&h(e.charCodeAt(n-1))&&u(e.charCodeAt(n))&&r--,r}if(i.content.size||s.content.size){let t=e(i.content,s.content,r+1);if(null!=t)return t}r+=i.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,o){for(let i=t.childCount,s=n.childCount;;){if(0==i||0==s)return i==s?null:{a:r,b:o};let l=t.child(--i),a=n.child(--s),c=l.nodeSize;if(l==a){r-=c,o-=c;continue}if(!l.sameMarkup(a))return{a:r,b:o};if(l.isText&&l.text!=a.text){let e=l.text,t=a.text,n=e.length,i=t.length;for(;n>0&&i>0&&e[n-1]==t[i-1];)n--,i--,r--,o--;return n&&i&&n<e.length&&h(e.charCodeAt(n-1))&&u(e.charCodeAt(n))&&(r++,o++),{a:r,b:o}}if(l.content.size||a.content.size){let t=e(l.content,a.content,r-1,o-1);if(t)return t}r-=c,o-=c}}(this,e,t,n)}findIndex(e){if(0==e)return m(0,e);if(e==this.size)return m(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return m(t+1,r);return m(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return p.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return p.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return p.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new p(t||e,n)}static from(e){if(!e)return p.empty;if(e instanceof p)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new p([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}p.empty=new p([],0);let f={index:0,offset:0};function m(e,t){return f.index=e,f.offset=t,f}function g(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!g(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!g(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class y{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&g(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return y.none;if(e instanceof y)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}y.none=[];class v extends Error{}class b{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,o,i,s){let{index:l,offset:a}=t.findIndex(n),c=t.maybeChild(l);if(a==n||c.isText)return s&&o<=0&&i<=0&&!s.canReplace(l,l,r)?null:t.cut(0,n).append(r).append(t.cut(n));let d=e(c.content,n-a-1,r,0==l?o-1:0,l==t.childCount-1?i-1:0,c);return d&&t.replaceChild(l,c.copy(d))}(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new b(n,this.openStart,this.openEnd)}removeBetween(e,t){return new b(function e(t,n,r){let{index:o,offset:i}=t.findIndex(n),s=t.maybeChild(o),{index:l,offset:a}=t.findIndex(r);if(i==n||s.isText){if(a!=r&&!t.child(l).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(o!=l)throw RangeError("Removing non-flat range");return t.replaceChild(o,s.copy(e(s.content,n-i-1,r-i-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return b.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new b(p.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new b(e,n,r)}}function w(e,t){if(!t.type.compatibleContent(e.type))throw new v("Cannot join "+t.type.name+" onto "+e.type.name)}function k(e,t,n){let r=e.node(n);return w(r,t.node(n)),r}function x(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function S(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(x(e.nodeAfter,r),i++));for(let e=i;e<s;e++)x(o.child(e),r);t&&t.depth==n&&t.textOffset&&x(t.nodeBefore,r)}function M(e,t){if(!e.type.validContent(t))throw new v("Invalid content for node "+e.type.name);return e.copy(t)}function C(e,t,n){let r=[];return S(null,e,n,r),e.depth>n&&x(M(k(e,t,n+1),C(e,t,n+1)),r),S(t,null,n,r),new p(r)}b.empty=new b(p.empty,0,0);class O{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?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[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return y.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new N(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s||(t=t.child(e)).isText)break;o=s-1,r+=i+1}return new O(t,n,o)}static resolveCached(e,t){let n=T.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else T.set(e,n=new A);let r=n.elts[n.i]=O.resolve(e,t);return n.i=(n.i+1)%E,r}}class A{constructor(){this.elts=[],this.i=0}}let E=12,T=new WeakMap;class N{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let R=Object.create(null);class D{constructor(e,t,n,r=y.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||p.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&g(this.attrs,t||e.defaultAttrs||R)&&y.sameSet(this.marks,n||y.none)}copy(e=null){return e==this.content?this:new D(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new D(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return b.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i);return new b(r.node(i).content.cut(r.pos-s,o.pos-s),r.depth-i,o.depth-i)}replace(e,t,n){var r=this.resolve(e),o=this.resolve(t);if(n.openStart>r.depth)throw new v("Inserted content deeper than insertion position");if(r.depth-n.openStart!=o.depth-n.openEnd)throw new v("Inconsistent open depths");return function e(t,n,r,o){let i=t.index(o),s=t.node(o);if(i==n.index(o)&&o<t.depth-r.openStart){let l=e(t,n,r,o+1);return s.copy(s.content.replaceChild(i,l))}if(!r.content.size)return M(s,C(t,n,o));if(r.openStart||r.openEnd||t.depth!=o||n.depth!=o){let{start:e,end:i}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(p.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return M(s,function e(t,n,r,o,i){let s=t.depth>i&&k(t,n,i+1),l=o.depth>i&&k(r,o,i+1),a=[];return S(null,t,i,a),s&&l&&n.index(i)==r.index(i)?(w(s,l),x(M(s,e(t,n,r,o,i+1)),a)):(s&&x(M(s,C(t,n,i+1)),a),S(n,r,i,a),l&&x(M(l,C(r,o,i+1)),a)),S(o,null,i,a),new p(a)}(t,e,i,n,o))}{let e=t.parent,o=e.content;return M(e,o.cut(0,t.parentOffset).append(r.content).append(o.cut(n.parentOffset)))}}(r,o,n,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return O.resolveCached(this,e)}resolveNoCache(e){return O.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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()+")"),I(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=p.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}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),L(this.type.attrs,this.attrs,"node",this.type.name);let e=y.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];L(n.type.attrs,n.attrs,"mark",n.type.name),e=n.addToSet(e)}if(!y.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=p.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}D.prototype.text=void 0;class P extends D{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):I(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new P(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new P(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function I(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}function L(e,t,n,r){for(let o in t)if(!(o in e))throw RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}class _{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,o=new j(e,t);if(null==o.next)return _.empty;let i=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.isInGroup(t)&&o.push(r)}return 0==o.length&&e.err("No node type or group '"+t+"' found"),o})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=z(e),r=n;return e.eat(",")&&(r="}"!=e.next?z(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(o);o.next&&o.err("Unexpected trailing text");let s=(n=function(e){let t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,i)),[]);if("seq"==t.type)for(let r=0;;r++){let s=e(t.exprs[r],i);if(r==t.exprs.length-1)return s;o(s,i=n())}else if("star"==t.type){let s=n();return r(i,s),o(e(t.expr,s),s),[r(s)]}else if("plus"==t.type){let s=n();return o(e(t.expr,i),s),o(e(t.expr,s),s),[r(s)]}else if("opt"==t.type)return[r(i)].concat(e(t.expr,i));else if("range"==t.type){let s=i;for(let r=0;r<t.min;r++){let r=n();o(e(t.expr,s),r),s=r}if(-1==t.max)o(e(t.expr,s),s);else for(let i=t.min;i<t.max;i++){let i=n();r(s,i),o(e(t.expr,s),i),s=i}return[r(s)]}else if("name"==t.type)return[r(i,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach(e=>e.to=t)}}(i),r=Object.create(null),function e(t){let o=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);$(n,t).forEach(t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let i=r[t.join(",")]=new _(t.indexOf(n.length-1)>-1);for(let t=0;t<o.length;t++){let n=o[t][1].sort(B);i.next.push({type:o[t][0],next:r[n.join(",")]||e(n)})}return i}($(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),o&&!(n.isText||n.hasRequiredAttrs())&&(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,o),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let l=i.matchFragment(e,n);if(l&&(!t||l.validEnd))return p.from(s.map(e=>e.createAndFill()));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}_.empty=new _(!0);class j{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function z(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function B(e,t){return t-e}function $(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(B)}function F(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function V(e,t){let n=Object.create(null);for(let r in e){let o=e[r],i=t&&t[r];if(void 0===i)if(o.hasDefault)i=o.default;else throw RangeError("No value supplied for attribute "+r);else o.validate&&o.validate(i);n[r]=i}return n}function H(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new q(e,r,t[r]);return n}class U{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=H(e,n.attrs),this.defaultAttrs=F(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==_.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:V(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new D(this,this.computeAttrs(e),p.from(t),y.setFrom(n))}createChecked(e=null,t,n){return t=p.from(t),this.checkContent(t),new D(this,this.computeAttrs(e),t,y.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=p.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(p.empty,!0);return o?new D(this,e,t.append(o),y.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:y.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new U(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class q{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(0>r.indexOf(o))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class W{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=H(e,r.attrs),this.excluded=null;let o=F(this.attrs);this.instance=o?new y(this,o):null}create(e=null){return!e&&this.instance?this.instance:new y(this,V(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,o)=>n[e]=new W(e,r++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class K{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=d.from(e.nodes),t.marks=d.from(e.marks||{}),this.nodes=U.compile(this.spec.nodes,this),this.marks=W.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",o=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=_.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==o?null:o?J(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:J(this,n.split(" "))}this.nodeFromJSON=e=>D.fromJSON(this,e),this.markFromJSON=e=>y.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof U){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new P(n,n.defaultAttrs,e,y.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function J(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class G{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new et(this,t,!1);return n.addAll(e,y.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new et(this,t,!0);return n.addAll(e,y.none,t.from,t.to),b.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){var r,o;let n=this.tags[i];if(r=e,o=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,o)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(0==i.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(i.length>e.length)||61==i.charCodeAt(e.length)&&i.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=en(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=en(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new G(e,G.schemaRules(e)))}}let X={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Y={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Q={ol:!0,ul:!0};function Z(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class ee{constructor(e,t,n,r,o,i){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=y.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(p.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=p.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(p.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!X.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class et{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,o,i=Z(null,t.preserveWhitespace,0)|4*!!n;o=r?new ee(r.type,r.attrs,y.none,!0,t.topMatch||r.type.contentMatch,i):n?new ee(null,null,y.none,!0,null,i):new ee(e.schema.topNodeType,null,y.none,!0,null,i),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:i}=this.parser;if("full"===o||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(i.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(i.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),s;Q.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Q.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:Y.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let n,r=this.needsBlock;if(X.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=l&&l.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],o=n.getPropertyValue(r);if(o)for(let e;;){let n=this.parser.matchStyle(r,o,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let o,i;if(t.node)if((i=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(i.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}o&&this.sync(s)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,n){let r,o;for(let t=this.open,i=0;t>=0;t--){let s=this.nodes[t],l=s.findWrapping(e);if(l&&(!r||r.length>l.length+i)&&(r=l,o=s,!l.length))break;if(s.solid){if(n)break;i+=2}}if(!r)return null;this.sync(o);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=y.none;for(let o of r.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):er(o.type,e.type))&&(n=o.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let o=this.findPlace(e.create(t),n,!1);return o&&(o=this.enterInner(e,t,n,!0,r)),o}enterInner(e,t,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let s=Z(e,o,i.options);4&i.options&&0==i.content.length&&(s|=4);let l=y.none;return n=n.filter(t=>(i.type?!i.type.allowsMarkType(t.type):!er(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new ee(e,t,l,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),o=-(n?n.depth+1:0)+ +!r,i=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;s--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function en(e){let t={};for(let n in e)t[n]=e[n];return t}function er(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t||0>i.indexOf(o)&&s(o))return!0}};if(s(o.contentMatch))return!0}}class eo{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=es(t).createDocumentFragment());let r=n,o=[];return e.forEach(e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(!this.marks[t.type.name]){i++;continue}if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return es(t).createTextNode(e.text);let{dom:n,contentDOM:r}=ea(es(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ea(es(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:ea(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new eo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ei(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return ei(e.marks)}}function ei(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function es(e){return e.document||window.document}let el=new WeakMap;function ea(e,t,n,r){let o,i,s;if(1==t.nodeType)return{dom:t};if(t.dom&&1==t.dom.nodeType)return t;let l=t[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(i=el.get(r))&&el.set(r,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let n=0;n<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),i=s)),a=i)&&a.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let c=l.indexOf(" ");c>0&&(n=l.slice(0,c),l=l.slice(c+1));let d=n?e.createElementNS(n,l):e.createElement(l),u=t[1],h=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u)){for(let e in h=2,u)if(null!=u[e]){let t=e.indexOf(" ");t>0?d.setAttributeNS(e.slice(0,t),e.slice(t+1),u[e]):"style"==e&&d.style?d.style.cssText=u[e]:d.setAttribute(e,u[e])}}for(let i=h;i<t.length;i++){let s=t[i];if(0===s){if(i<t.length-1||i>h)throw RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}if("string"==typeof s)d.appendChild(e.createTextNode(s));else{let{dom:t,contentDOM:i}=ea(e,s,n,r);if(d.appendChild(t),i){if(o)throw RangeError("Multiple content holes");o=i}}}return{dom:d,contentDOM:o}}class ec{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class ed{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ed.empty)return ed.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[s+o],c=this.ranges[s+i],d=l+a;if(e<=d){let o=a?e==l?-1:e==d?1:t:t,i=l+r+(o<0?0:c);if(n)return i;let u=e==(t<0?l:d)?null:s/3+(e-l)*65536,h=0;return a&&(h|=e==l?2:e==d?1:4,(t<0?e!=l:e!=d)&&(h|=8)),new ec(i,h,u)}r+=c-a}return n?e+r:new ec(e+r,0,null)}touches(e,t){let n=0,r=65535&t,o=this.inverted?2:1,i=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let l=this.ranges[t+o];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+i]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),l=i+(this.inverted?0:o),a=this.ranges[r+t],c=this.ranges[r+n];e(s,s+a,l,l+c),o+=c-a}}invert(){return new ed(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?ed.empty:new ed(e<0?[0,-e,0]:[0,0,e])}}ed.empty=new ed([]);class eu{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new eu(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new eu;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this._maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new ec(e,r,null)}}let eh=Object.create(null);class ep{getMap(){return ed.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=eh[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in eh)throw RangeError("Duplicate use of step JSON ID "+e);return eh[e]=t,t.prototype.jsonID=e,t}}class ef{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new ef(e,null)}static fail(e){return new ef(null,e)}static fromReplace(e,t,n,r){try{return ef.ok(e.replace(t,n,r))}catch(e){if(e instanceof v)return ef.fail(e.message);throw e}}}function em(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(em(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return p.fromArray(r)}class eg extends ep{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new b(em(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return ef.fromReplace(e,this.from,this.to,o)}invert(e){let t=[];return e.nodesBetween(this.from,this.to,(e,n)=>{if(e.isInline&&e.isAtom){let r=this.mark.addToSet(e.marks);if(!y.sameSet(r,e.marks)){let o=Math.max(this.from,n),i=Math.min(this.to,n+e.nodeSize);for(let n of(ev(ey,o,i,this.mark,t),e.marks))n.isInSet(r)||ev(eg,o,i,n,t)}}}),1==t.length?t[0]:new eb(t)}map(e){let t=e.map(this.from,1),n=e.map(this.to,-1);return t>=n?null:new eg(t,n,this.mark)}merge(e){return e instanceof eg&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new eg(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new eg(t.from,t.to,e.markFromJSON(t.mark))}}ep.jsonID("addMark",eg);class ey extends ep{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new b(em(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return ef.fromReplace(e,this.from,this.to,n)}invert(e){let t=[];return e.nodesBetween(this.from,this.to,(e,n)=>{e.isInline&&e.isAtom&&this.mark.isInSet(e.marks)&&ev(eg,Math.max(this.from,n),Math.min(this.to,n+e.nodeSize),this.mark,t)}),1==t.length?t[0]:new eb(t)}map(e){let t=e.map(this.from,1),n=e.map(this.to,-1);return t>=n?null:new ey(t,n,this.mark)}merge(e){return e instanceof ey&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ey(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ey(t.from,t.to,e.markFromJSON(t.mark))}}function ev(e,t,n,r,o){let i=o.length?o[o.length-1]:null;i&&i instanceof e&&i.to==t&&i.mark.eq(r)?o[o.length-1]=new e(i.from,n,r):o.push(new e(t,n,r))}ep.jsonID("removeMark",ey);class eb extends ep{constructor(e){super(),this.steps=e}apply(e){for(let t of this.steps){let n=t.apply(e);if(!n.doc)return n;e=n.doc}return new ef(e,null)}invert(e){return new eb(this.steps.map(t=>t.invert(e)))}map(e){let t=[];for(let n of this.steps){let r=n.map(e);r&&t.push(r)}return t.length?new eb(t):null}toJSON(){return{stepType:"markSet",steps:this.steps.map(e=>e.toJSON())}}static fromJSON(e,t){if(!Array.isArray(t.steps)||!t.steps.every(e=>"addMark"==e.stepType||"removeMark"==e.stepType))throw RangeError("Invalid JSON for MarkSetStep");return new eb(t.steps.map(t=>ep.fromJSON(e,t)))}}ep.jsonID("markSet",eb);class ew extends ep{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ef.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ef.fromReplace(e,this.pos,this.pos+1,new b(p.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new ew(this.pos,t.marks[n]);return new ew(this.pos,this.mark)}}return new ek(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ew(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ew(t.pos,e.markFromJSON(t.mark))}}ep.jsonID("addNodeMark",ew);class ek extends ep{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ef.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ef.fromReplace(e,this.pos,this.pos+1,new b(p.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new ew(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ek(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ek(t.pos,e.markFromJSON(t.mark))}}ep.jsonID("removeNodeMark",ek);class ex extends ep{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&eM(e,this.from,this.to)?ef.fail("Structure replace would overwrite content"):ef.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ed([this.from,this.to-this.from,this.slice.size])}invert(e){return new ex(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&ex.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new ex(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ex)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?b.empty:new b(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ex(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?b.empty:new b(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ex(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new ex(t.from,t.to,b.fromJSON(e,t.slice),!!t.structure)}}ex.MAP_BIAS=1,ep.jsonID("replace",ex);class eS extends ep{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(eM(e,this.from,this.gapFrom)||eM(e,this.gapTo,this.to)))return ef.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ef.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?ef.fromReplace(e,this.from,this.to,n):ef.fail("Content does not fit in gap")}getMap(){return new ed([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new eS(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos||r>o?null:new eS(t.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new eS(t.from,t.to,t.gapFrom,t.gapTo,b.fromJSON(e,t.slice),t.insert,!!t.structure)}}function eM(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function eC(e,t,n,r=n.contentMatch,o=!0){let i=e.doc.nodeAt(t),s=[],l=t+1;for(let t=0;t<i.childCount;t++){let a=i.child(t),c=l+a.nodeSize,d=r.matchType(a.type);if(d){r=d;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new ey(l,c,a.marks[t]));if(o&&a.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(a.text);)r||(r=new b(p.from(n.schema.text(" ",n.allowedMarks(a.marks))),0,0)),s.push(new ex(l+e.index,l+e.index+e[0].length,r))}}else s.push(new ex(l,c,b.empty));l=c}if(!r.validEnd){let t=r.fillBefore(p.empty,!0);e.replace(l,l,new b(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function eO(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,o=0;;--n){let i=e.$from.node(n),s=e.$from.index(n)+r,l=e.$to.indexAfter(n)-o;if(n<e.depth&&i.canReplace(s,l,t))return n;if(0==n||i.type.spec.isolating||!((0==s||i.canReplace(s,i.childCount))&&(l==i.childCount||i.canReplace(0,l))))break;s&&(r=1),l<i.childCount&&(o=1)}return null}function eA(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;l&&e<o;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return i?o.map(eE).concat({type:t,attrs:n}).concat(i.map(eE)):null}function eE(e){return{type:e,attrs:null}}function eT(e,t,n,r){t.forEach((o,i)=>{if(o.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(o.text);){let o=e.mapping.slice(r).map(n+1+i+s.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function eN(e,t,n,r){t.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+i);e.replaceWith(o,o+1,t.type.schema.text("\n"))}})}function eR(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function eD(e,t){let n=e.resolve(t),r=n.index();return eP(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function eP(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let o=0;o<t.childCount;o++){let i=t.child(o),s=i.type==r?e.type.schema.nodes.text:i.type;if(!(n=n.matchType(s))||!e.type.allowsMarks(i.marks))return!1}return n.validEnd}(e,t))}function eI(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let o,i,s=r.index(e);if(e==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(e+1),s++,i=r.node(e).maybeChild(s)):(o=r.node(e).maybeChild(s-1),i=r.node(e+1)),o&&!o.isTextblock&&eP(o,i)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function eL(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,i=r.index(t)+ +(n>0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);l=e&&s.canReplaceWith(i,i,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function e_(e,t,n=t,r=b.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return ej(o,i,r)?new ex(t,n,r):new ez(o,i,r).fit()}function ej(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}ep.jsonID("replaceAround",eS);class ez{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=p.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=p.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let l=new b(o,i,s);return e>-1?new eS(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new ex(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,r=(n?(e=eF(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:i,match:s}=this.frontier[o],l,a=null;if(1==t&&(r?s.matchType(r.type)||(a=s.fillBefore(p.from(r),!1)):e&&i.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:o,parent:e,inject:a};if(2==t&&r&&(l=s.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:o,parent:e,wrap:l};if(e&&s.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return!(eH(e,-1)<=t)&&(this.unplaced.size>1&&eH(e,1)>n&&n++,this.unplaced=new b(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=eF(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new b(eB(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new b(eB(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let i=this.unplaced,s=n?n.content:i.content,l=i.openStart-e,a=0,c=[],{match:d,type:u}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));d=d.matchFragment(r)}let h=s.size+e-(i.content.size-i.openEnd);for(;a<s.childCount;){let e=s.child(a),t=d.matchType(e.type);if(!t)break;(++a>1||0==l||e.content.size)&&(d=t,c.push(function e(t,n,r){if(n<=0)return t;let o=t.content;return n>1&&(o=o.replaceChild(0,e(o.firstChild,n-1,1==o.childCount?r-1:0))),n>0&&(o=t.type.contentMatch.fillBefore(o).append(o),r<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(p.empty,!0)))),t.copy(o)}(e.mark(u.allowedMarks(e.marks)),1==a?l:0,a==s.childCount?h:-1)))}let f=a==s.childCount;f||(h=-1),this.placed=e$(this.placed,t,p.from(c)),this.frontier[t].match=d,f&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=c[c.length-1];t&&e<h;e++)this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),t=t.lastChild;this.unplaced=f?0==e?b.empty:new b(eB(i.content,e-1,1),e-1,h<0?i.openEnd:e-1):new b(eB(i.content,e,a),e,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!eV(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=eV(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=eV(e,n,r,t,!0);if(!o||o.childCount)continue t}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=e$(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=e$(this.placed,this.depth,p.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(p.empty,!0);e.childCount&&(this.placed=e$(this.placed,this.frontier.length,e))}}function eB(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(eB(e.firstChild.content,t-1,n)))}function e$(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(e$(e.lastChild.content,t-1,n)))}function eF(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function eV(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?l:null}function eH(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function eU(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let r=e.start(o);if(r<e.pos-(e.depth-o)||t.end(o)>t.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(r==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==r-1)&&n.push(o)}return n}class eq extends ep{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return ef.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return ef.fromReplace(e,this.pos,this.pos+1,new b(p.from(r),0,+!t.isLeaf))}getMap(){return ed.empty}invert(e){return new eq(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new eq(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new eq(t.pos,t.attr,t.value)}}ep.jsonID("attr",eq);class eW extends ep{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return ef.ok(n)}getMap(){return ed.empty}invert(e){return new eW(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new eW(t.attr,t.value)}}ep.jsonID("docAttr",eW);let eK=class extends Error{};(eK=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),eK.prototype.constructor=eK,eK.prototype.name="TransformError";class eJ{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new eu}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new eK(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,o,i)=>{e=Math.min(e,o),t=Math.max(t,i)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=b.empty){let r=e_(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new b(p.from(n),0,0))}delete(e,t){return this.replace(e,t,b.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(ej(o,i,r))return e.step(new ex(t,n,r));let s=eU(o,i);0==s[s.length-1]&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?l=e:o.before(e)==t&&s.splice(1,0,-e)}let a=s.indexOf(l),c=[],d=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=d-1;e>=0;e--){var u;let t=c[e],n=(u=t.type).spec.defining||u.spec.definingForContent;if(n&&!t.sameMarkup(o.node(Math.abs(l)-1)))d=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let l=(t+d+1)%(r.openStart+1),u=c[l];if(u)for(let t=0;t<s.length;t++){let c=s[(t+a)%s.length],d=!0;c<0&&(d=!1,c=-c);let h=o.node(c-1),f=o.index(c-1);if(h.canReplaceWith(f,f,u.type,u.marks))return e.replace(o.before(c),d?i.after(c):n,new b(function e(t,n,r,o,i){if(n<r){let i=t.firstChild;t=t.replaceChild(0,i.copy(e(i.content,n+1,r,o,i)))}if(n>o){let e=i.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(p.empty,!0))}return t}(r.content,0,r.openStart,l),l,r.openEnd))}}let h=e.steps.length;for(let l=s.length-1;l>=0&&(e.replace(t,n,r),!(e.steps.length>h));l--){let e=s[l];e<0||(t=o.before(e),n=i.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){var r=e,o=t;if(!n.isInline&&r==o&&this.doc.resolve(r).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)break}return null}(this.doc,r,n.type);null!=e&&(r=o=e)}return this.replaceRange(r,o,new b(p.from(n),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&0==r.parentOffset&&0==o.parentOffset){let i=r.sharedDepth(n),s=!1;for(let e=r.depth;e>i;e--)r.node(e).type.spec.isolating&&(s=!0);for(let e=o.depth;e>i;e--)o.node(e).type.spec.isolating&&(s=!0);if(!s){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=o.depth;e>0&&n==o.start(e);e--)n=o.before(e);r=e.doc.resolve(t),o=e.doc.resolve(n)}}let i=eU(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),l=o.after(i+1),a=s,c=l,d=p.empty,u=0;for(let e=i,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,d=p.from(r.node(e).copy(d)),u++):a--;let h=p.empty,f=0;for(let e=i,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,h=p.from(o.node(e).copy(h)),f++):c++;e.step(new eS(a,c,s,l,new b(d.append(h),u,f),d.size-u,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let r=null,{linebreakReplacement:o}=e.doc.type.schema,i=e.doc.resolve(t-n),s=i.node().type;if(o&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(o);e&&!t?r=!1:!e&&t&&(r=!0)}let l=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);eN(e,r.node(),r.before(),l)}s.inlineContent&&eC(e,t+n-1,s,i.node().contentMatchAt(i.index()),null==r);let a=e.mapping.slice(l),c=a.map(t-n);if(e.step(new ex(c,a.map(t+n,-1),b.empty,!0)),!0===r){let t=e.doc.resolve(c);eT(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,n){let r=p.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=p.from(n[e].type.create(n[e].attrs,r))}let o=t.start,i=t.end;e.step(new eS(o,i,o,i,new b(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){var o=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let i=o.steps.length;return o.doc.nodesBetween(e,t,(e,t)=>{var s,l,a;let c,d,u="function"==typeof r?r(e):r;if(e.isTextblock&&!e.hasMarkup(n,u)&&(s=o.doc,l=o.mapping.slice(i).map(t),a=n,d=(c=s.resolve(l)).index(),c.parent.canReplaceWith(d,d+1,a))){let r=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0)}!1===r&&eN(o,e,t,i),eC(o,o.mapping.slice(i).map(t,1),n,void 0,null===r);let s=o.mapping.slice(i),l=s.map(t,1),a=s.map(t+e.nodeSize,1);return o.step(new eS(l,a,l+1,a-1,new b(p.from(n.create(u,null,e.marks)),0,0),1,!0)),!0===r&&eT(o,e,t,i),!1}}),this}setNodeMarkup(e,t,n=null,r){return!function(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw RangeError("Invalid content for node type "+n.name);e.step(new eS(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new b(p.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new eq(e,t,n)),this}setDocAttribute(e,t){return this.step(new eW(e,t)),this}addNodeMark(e,t){return this.step(new ew(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof y)t.isInSet(n.marks)&&this.step(new ek(e,t));else{let r=n.marks,o,i=[];for(;o=t.isInSet(r);)i.push(new ek(e,o)),r=o.removeFromSet(r);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,t=1,n){return!function(e,t,n=1,r){let o=e.doc.resolve(t),i=p.empty,s=p.empty;for(let e=o.depth,t=o.depth-n,l=n-1;e>t;e--,l--){i=p.from(o.node(e).copy(i));let t=r&&r[l];s=p.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new ex(t,t,new b(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){var r;let o;return r=this,o=[],r.doc.nodesBetween(e,t,(r,i,s)=>{if(!r.isInline)return;let l=r.marks;!n.isInSet(l)&&s.type.allowsMarkType(n.type)&&ev(eg,Math.max(i,e),Math.min(i+r.nodeSize,t),n,o)}),o.forEach(e=>r.step(e)),this}removeMark(e,t,n){var r;let o,i;return r=this,o=[],i=0,r.doc.nodesBetween(e,t,(r,s)=>{if(!r.isInline||!r.isAtom)return;i++;let l=null;if(n instanceof W){let e=r.marks,t;for(;t=n.isInSet(e);)(l||(l=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(r.marks)&&(l=[n]):l=r.marks;if(l&&l.length){let n=Math.min(s+r.nodeSize,t);for(let t=0;t<l.length;t++){let r=l[t],a;for(let e=0;e<o.length;e++){let t=o[e];t.step==i-1&&r.eq(o[e].style)&&(a=t)}a?(a.to=n,a.step=i):o.push({style:r,from:Math.max(s,e),to:n,step:i})}}}),o.forEach(e=>r.step(new ey(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return eC(this,e,t,n),this}}let eG=Object.create(null);class eX{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new eY(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=b.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:l,$to:a}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(a.pos),s?b.empty:t),0==s&&e7(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],l=e.mapping.slice(n),a=l.map(i.pos),c=l.map(s.pos);o?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),e7(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new e0(e):e6(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?e6(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):e6(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new e4(e.node(0))}static atStart(e){return e6(e,e,0,0,1)||new e4(e)}static atEnd(e){return e6(e,e,e.content.size,e.childCount,-1)||new e4(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=eG[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in eG)throw RangeError("Duplicate use of selection JSON ID "+e);return eG[e]=t,t.prototype.jsonID=e,t}getBookmark(){return e0.between(this.$anchor,this.$head).getBookmark()}}eX.prototype.visible=!0;class eY{constructor(e,t){this.$from=e,this.$to=t}}let eQ=!1;function eZ(e){eQ||e.parent.inlineContent||(eQ=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class e0 extends eX{constructor(e,t=e){eZ(e),eZ(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return eX.near(n);let r=e.resolve(t.map(this.anchor));return new e0(r.parent.inlineContent?r:n,n)}replace(e,t=b.empty){if(super.replace(e,t),t==b.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof e0&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new e1(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new e0(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=eX.findFrom(t,n,!0)||eX.findFrom(t,-n,!0);if(!e)return eX.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(eX.findFrom(e,-n,!0)||eX.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new e0(e,t)}}eX.jsonID("text",e0);class e1{constructor(e,t){this.anchor=e,this.head=t}map(e){return new e1(e.map(this.anchor),e.map(this.head))}resolve(e){return e0.between(e.resolve(this.anchor),e.resolve(this.head))}}class e2 extends eX{constructor(e){let t=e.nodeAfter;super(e,e.node(0).resolve(e.pos+t.nodeSize)),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?eX.near(o):new e2(o)}content(){return new b(p.from(this.node),0,0)}eq(e){return e instanceof e2&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new e5(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new e2(e.resolve(t.anchor))}static create(e,t){return new e2(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}e2.prototype.visible=!1,eX.jsonID("node",e2);class e5{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new e1(n,n):new e5(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&e2.isSelectable(n)?new e2(t):eX.near(t)}}class e4 extends eX{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=b.empty){if(t==b.empty){e.delete(0,e.doc.content.size);let t=eX.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new e4(e)}map(e){return new e4(e)}eq(e){return e instanceof e4}getBookmark(){return e3}}eX.jsonID("all",e4);let e3={map(){return this},resolve:e=>new e4(e)};function e6(e,t,n,r,o,i=!1){if(t.inlineContent)return e0.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&e2.isSelectable(r))return e2.create(e,n-(o<0?r.nodeSize:0))}else{let t=e6(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function e7(e,t,n){let r,o=e.steps.length-1;if(o<t)return;let i=e.steps[o];(i instanceof ex||i instanceof eS)&&(e.mapping.maps[o].forEach((e,t,n,o)=>{null==r&&(r=o)}),e.setSelection(eX.near(e.doc.resolve(r),n)))}class e8 extends eJ{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 RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return y.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(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||y.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(eX.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function e9(e,t){return t&&e?e.bind(t):e}class te{constructor(e,t,n){this.name=e,this.init=e9(t.init,n),this.apply=e9(t.apply,n)}}let tt=[new te("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new te("selection",{init:(e,t)=>e.selection||eX.atStart(t.doc),apply:e=>e.selection}),new te("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new te("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class tn{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=tt.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new te(e.key,e.spec.state,e))})}}class tr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let l=r?r[i].n:0,a=r?r[i].state:this,c=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new tr(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new e8(this)}static create(e){let t=new tn(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new tr(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new tn(this.schema,e.plugins),n=t.fields,r=new tr(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let r=new tn(e.schema,e.plugins),o=new tr(r);return r.fields.forEach(r=>{if("doc"==r.name)o.doc=D.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=eX.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,i)){o[r.name]=l.fromJSON.call(s,e,t[i],o);return}}o[r.name]=r.init(e,o)}}),o}}class to{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=e(i,n,{})),r[o]=i}return r}(e.props,this,this.props),this.key=e.key?e.key.key:ts("plugin")}getState(e){return e[this.key]}}let ti=Object.create(null);function ts(e){return e in ti?e+"$"+ ++ti[e]:(ti[e]=0,e+"$")}class tl{constructor(e="key"){this.key=ts(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}let ta=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function tc(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let td=(e,t,n)=>{let r=tc(e,n);if(!r)return!1;let o=tf(r);if(!o){let n=r.blockRange(),o=n&&eO(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(tM(e,o,t,-1))return!0;if(0==r.parent.content.size&&(th(i,"end")||e2.isSelectable(i)))for(let n=r.depth;;n--){let s=e_(e.doc,r.before(n),r.after(n),b.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(th(i,"end")?eX.findFrom(n.doc.resolve(n.mapping.map(o.pos,-1)),-1):e2.create(n.doc,o.pos-i.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!!i.isAtom&&o.depth==r.depth-1&&(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0)};function tu(e,t,n){let r=t.nodeBefore,o=t.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let i=t.nodeAfter,s=t.pos+1;for(;!i.isTextblock;s++){if(i.type.spec.isolating)return!1;let e=i.firstChild;if(!e)return!1;i=e}let l=e_(e.doc,o,s,b.empty);if(!l||l.from!=o||l instanceof ex&&l.slice.size>=s-o)return!1;if(n){let t=e.tr.step(l);t.setSelection(e0.create(t.doc,o)),n(t.scrollIntoView())}return!0}function th(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let tp=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=tf(r)}let s=i&&i.nodeBefore;return!!s&&!!e2.isSelectable(s)&&(t&&t(e.tr.setSelection(e2.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function tf(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function tm(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let tg=(e,t,n)=>{let r=tm(e,n);if(!r)return!1;let o=tv(r);if(!o)return!1;let i=o.nodeAfter;if(tM(e,o,t,1))return!0;if(0==r.parent.content.size&&(th(i,"start")||e2.isSelectable(i))){let n=e_(e.doc,r.before(),r.after(),b.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(th(i,"start")?eX.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):e2.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!!i.isAtom&&o.depth==r.depth-1&&(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)},ty=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=tv(r)}let s=i&&i.nodeAfter;return!!s&&!!e2.isSelectable(s)&&(t&&t(e.tr.setSelection(e2.create(e.doc,i.pos)).scrollIntoView()),!0)};function tv(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}let tb=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function tw(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let tk=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=tw(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(eX.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},tx=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof e4||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=tw(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection(e0.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},tS=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(eR(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&eO(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};function tM(e,t,n,r){let o,i,s,l=t.nodeBefore,a=t.nodeAfter,c,d,u=l.type.spec.isolating||a.type.spec.isolating;if(!u&&(o=t.nodeBefore,i=t.nodeAfter,s=t.index(),o&&i&&o.type.compatibleContent(i.type)&&(!o.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(s,s+1)&&!!(i.isTextblock||eD(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let h=!u&&t.parent.canReplace(t.index(),t.index()+1);if(h&&(c=(d=l.contentMatchAt(l.childCount)).findWrapping(a.type))&&d.matchType(c[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,o=p.empty;for(let e=c.length-1;e>=0;e--)o=p.from(c[e].create(null,o));o=p.from(l.copy(o));let i=e.tr.step(new eS(t.pos-1,r,t.pos,r,new b(o,1,0),c.length,!0)),s=i.doc.resolve(r+2*c.length);s.nodeAfter&&s.nodeAfter.type==l.type&&eD(i.doc,s.pos)&&i.join(s.pos),n(i.scrollIntoView())}return!0}let f=a.type.spec.isolating||r>0&&u?null:eX.findFrom(t,1),m=f&&f.$from.blockRange(f.$to),g=m&&eO(m);if(null!=g&&g>=t.depth)return n&&n(e.tr.lift(m,g).scrollIntoView()),!0;if(h&&th(a,"start",!0)&&th(l,"end")){let r=l,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let i=a,s=1;for(;!i.isTextblock;i=i.firstChild)s++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=p.empty;for(let e=o.length-1;e>=0;e--)r=p.from(o[e].copy(r));n(e.tr.step(new eS(t.pos-o.length,t.pos+a.nodeSize,t.pos+s,t.pos+a.nodeSize-s,new b(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function tC(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(e0.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}let tO=tC(-1),tA=tC(1);function tE(e,t=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,(r,i)=>{if(o)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}})}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,e,t)}r(o.scrollIntoView())}return!0}}function tT(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let tN=tT(ta,td,tp),tR=tT(ta,tg,ty),tD={Enter:tT(tb,tx,tS,(e,t)=>{if(e.selection instanceof e2&&e.selection.node.isBlock){let{$from:n}=e.selection;return!!n.parentOffset&&!!eR(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let n=e.tr;!e.selection.empty&&(e.selection instanceof e0||e.selection instanceof e4)&&n.deleteSelection();let{$from:r}=n.selection,o=n.steps.length,i=[],s,l,a=!1,c=!1;for(let e=r.depth;;e--){if(r.node(e).isBlock){let t;a=r.end(e)==r.pos+(r.depth-e),c=r.start(e)==r.pos-(r.depth-e),l=tw(r.node(e-1).contentMatchAt(r.indexAfter(e-1)));i.unshift(t||(a&&l?{type:l}:null)),s=e;break}if(1==e)return!1;i.unshift(null)}let d=r.pos,u=eR(n.doc,d,i.length,i);if(u||(i[0]=l?{type:l}:null,u=eR(n.doc,d,i.length,i)),!u)return!1;if(n.split(d,i.length,i),!a&&c&&r.node(s).type!=l){let e=n.mapping.slice(o),t=e.map(r.before(s)),i=n.doc.resolve(t);l&&r.node(s-1).canReplaceWith(i.index(),i.index()+1,l)&&n.setNodeMarkup(e.map(r.before(s)),l)}return t&&t(n.scrollIntoView()),!0}),"Mod-Enter":tk,Backspace:tN,"Mod-Backspace":tN,"Shift-Backspace":tN,Delete:tR,"Mod-Delete":tR,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new e4(e.doc))),!0)},tP={"Ctrl-h":tD.Backspace,"Alt-Backspace":tD["Mod-Backspace"],"Ctrl-d":tD.Delete,"Ctrl-Alt-Backspace":tD["Mod-Delete"],"Alt-Delete":tD["Mod-Delete"],"Alt-d":tD["Mod-Delete"],"Ctrl-a":tO,"Ctrl-e":tA};for(let e in tD)tP[e]=tD[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();let tI=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},tL=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},t_=null,tj=function(e,t,n){let r=t_||(t_=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},tz=function(){t_=null},tB=function(e,t,n,r){return n&&(tF(e,t,n,r,-1)||tF(e,t,n,r,1))},t$=/^(img|br|input|textarea|hr)$/i;function tF(e,t,n,r,o){for(var i;;){if(e==n&&t==r)return!0;if(t==(o<0?0:tV(e))){let n=e.parentNode;if(!n||!tH(n)||tW(e)||t$.test(e.nodeName)||"false"==e.contentEditable)return!1;t=tI(e)+(o<0?0:1),e=n}else{if(!tH(e))return!1;let n=e.childNodes[t+(o<0?-1:0)];if(tH(n)&&"false"==n.contentEditable)if(null==(i=n.pmViewDesc)||!i.ignoreForSelection)return!1;else t+=o;else e=n,t=o<0?tV(e):0}}}function tV(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function tH(e){return 1==e.nodeType}function tU(e){return 3==e.nodeType}function tq(e,t){return!!t&&e.contains(tH(t)?t:t.parentNode)}function tW(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}let tK=function(e){return e.focusNode&&tB(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)},tJ="undefined"!=typeof navigator?navigator:null,tG="undefined"!=typeof document?document:null,tX=tJ&&tJ.userAgent||"",tY=/Edge\/(\d+)/.exec(tX),tQ=/MSIE \d/.exec(tX),tZ=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tX),t0=!!(tQ||tZ||tY),t1=tQ?document.documentMode:tZ?+tZ[1]:tY?+tY[1]:0,t2=!t0&&/gecko\/(\d+)/i.test(tX);t2&&(/Firefox\/(\d+)/.exec(tX)||[0,0])[1];let t5=!t0&&/Chrome\/(\d+)/.exec(tX),t4=!!t5,t3=t5?+t5[1]:0,t6=!t0&&!!tJ&&/Apple Computer/.test(tJ.vendor),t7=t6&&(/Mobile\/\w+/.test(tX)||!!tJ&&tJ.maxTouchPoints>2),t8=t7||!!tJ&&/Mac/.test(tJ.platform),t9=!!tJ&&/Win/.test(tJ.platform),ne=/Android \d/.test(tX),nt=!!tG&&"webkitFontSmoothing"in tG.documentElement.style,nn=nt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function nr(e,t){return"number"==typeof e?e:e[t]}function no(e,t,n){if(!nc(t)&&0==t.left)return;let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(!tH(s)){s=tL(s);continue}let e=s==i.body,n=e?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(i):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}(s),l=0,a=0;if(t.top<n.top+nr(r,"top")?a=-(n.top-t.top+nr(o,"top")):t.bottom>n.bottom-nr(r,"bottom")&&(a=t.bottom-t.top>n.bottom-n.top?t.top+nr(o,"top")-n.top:t.bottom-n.bottom+nr(o,"bottom")),t.left<n.left+nr(r,"left")?l=-(n.left-t.left+nr(o,"left")):t.right>n.right-nr(r,"right")&&(l=t.right-n.right+nr(o,"right")),l||a)if(e)i.defaultView.scrollBy(l,a);else{let e=s.scrollLeft,n=s.scrollTop;a&&(s.scrollTop+=a),l&&(s.scrollLeft+=l);let r=s.scrollLeft-e,o=s.scrollTop-n;t={left:t.left-r,top:t.top-o,right:t.right-r,bottom:t.bottom-o}}let c=e?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(c))break;s="absolute"==c?s.offsetParent:tL(s)}}function ni(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=tL(r));return t}function ns(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let nl=null;function na(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function nc(e){return e.top<e.bottom||e.left<e.right}function nd(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(nc(e))return e}return Array.prototype.find.call(n,nc)||e.getBoundingClientRect()}let nu=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function nh(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=nt||t2;if(tU(r))if(s&&(nu.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let e=nd(tj(r,o,o),n);if(t2&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=nd(tj(r,o-1,o-1),-1);if(t.top==e.top){let n=nd(tj(r,o,o+1),-1);if(n.top!=e.top)return np(n,n.left<t.left)}}return e}else{let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,np(nd(tj(r,e,t),i),i<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==tV(r))){let e=r.childNodes[o-1];if(tH(e))return nf(e.getBoundingClientRect(),!1)}if(null==i&&o<tV(r)){let e=r.childNodes[o];if(tH(e))return nf(e.getBoundingClientRect(),!0)}return nf(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==tV(r))){let e=r.childNodes[o-1],t=tU(e)?tj(e,tV(e)-!s):tH(e)&&("BR"!=e.nodeName||!e.nextSibling)?e:null;if(t)return np(nd(t,1),!1)}if(null==i&&o<tV(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?tU(e)?tj(e,0,+!s):tH(e)?e:null:null;if(t)return np(nd(t,-1),!0)}return np(nd(tU(r)?tj(r):r,-n),n>=0)}function np(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function nf(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function nm(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}let ng=/[\u0590-\u08ac]/,ny=null,nv=null,nb=!1;class nw{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){let r;if(this.contentDOM&&tq(this.contentDOM,e))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}if(e==this.dom&&this.contentDOM)r=t>tI(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM)){let n=e.compareDocumentPosition(this.contentDOM);r=16&n?t>Array.from(e.childNodes).findIndex(e=>e.contains(this.contentDOM)):!(4&n)}else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o=this.getDesc(r),i;if(o&&(!t||o.node))if(!n||!(i=o.nodeDOM)||(tH(i)?tq(i,e):i==e))return o;else n=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let o=t+this.children[n].size;if(o>e){r=e-t;break}t=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof nA||e instanceof nk&&e.side>=0))break}if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?tI(e.dom)+1:0}}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?tI(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],l=i+n.size;if(-1==r&&e<=l){let o=i+n.border;if(e>=o&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=tI(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=tI(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(!tH(t)||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let s=0,l=0;s<this.children.length;s++){let a=this.children[s],c=l+a.size;if(o>l&&i<c)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=c}let s=this.domFromPos(e,e?-1:1),l=t==e?s:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((t2||t6)&&e==t){let{node:e,offset:t}=s;if(tU(e)){if((d=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(s=l={node:n.parentNode,offset:tI(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];d=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(t2&&c.focusNode&&c.focusNode!=l.node&&tH(c.focusNode)){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||d&&t6)&&tB(s.node,s.offset,c.anchorNode,c.anchorOffset)&&tB(l.node,l.offset,c.focusNode,c.focusOffset))return;let u=!1;if((a.extend||e==t)&&!(d&&t2)){a.collapse(s.node,s.offset);try{e!=t&&a.extend(l.node,l.offset),u=!0}catch(e){}}if(!u){if(e>t){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s){this.dirty=e==n||t==i?2:1,e==r&&t==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(e-r,t-r);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class nk extends nw{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r)),!t.type.spec.raw){let e=tH(i)?i:document.createElement("span");e!=i&&(e.appendChild(i),i=e),e.hasAttribute("contenteditable")||(e.contentEditable="false"),e.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||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 nx extends nw{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class nS extends nw{constructor(e,t,n,r,o){super(e,[],n,r),this.mark=t,this.spec=o}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=eo.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new nS(e,t,i.dom,i.contentDOM||i.dom,i)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=nS.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=nz(o,t,i,n)),e>0&&(o=nz(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=r;return r.children=o,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class nM extends nw{constructor(e,t,n,r,o,i,s){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,o,i){let s=o.nodeViews[t.type.name],l,a=s&&s(t,o,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:i,n,r),c=a&&a.dom,d=a&&a.contentDOM;if(t.isText)if(c){if(!tU(c))throw RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=eo.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:d}=e)}d||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return(c=nP(c,n,t),a)?l=new nE(e,t,n,r,c,d||null,u,a):t.isText?new nO(e,t,n,r,c,u):new nM(e,t,n,r,c,d||null,u)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>tH(t)&&0>e.indexOf(t.parentNode)&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>p.empty}}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&nI(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,l=new n_(this,i&&i.node,e),a=this.node.inlineContent,c=a&&this.node.isBlock;(function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let d,u,h,p;for(;s<o.length&&o[s].to==i;){let e=o[s++];e.widget&&(d?(u||(u=[d])).push(e):d=e)}if(d)if(u){u.sort(nj);for(let e=0;e<u.length;e++)n(u[e],c,!!a)}else n(d,c,!!a);if(a)p=-1,h=a,a=null;else if(c<e.childCount)p=c,h=e.child(c++);else break;for(let e=0;e<l.length;e++)l[e].to<=i&&l.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)l.push(o[s++]);let f=i+h.nodeSize;if(h.isText){let e=f;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<f&&(a=h.cut(e-i),h=h.cut(0,e-i),f=e,p=-1)}else for(;s<o.length&&o[s].to<f;)s++;let m=h.isInline&&!h.isLeaf?l.filter(e=>!e.inline):l.slice();r(h,m,t.forChild(i,h),p),i=f}})(this.node,this.innerDeco,(t,o,i)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e,o):t.type.side>=0&&!i&&l.syncToMarks(o==this.node.childCount?y.none:this.node.child(o).marks,n,e,o),l.placeWidget(t,e,r)},(t,i,d,u)=>{let h;l.syncToMarks(t.marks,n,e,u),c&&t.isAtom&&!t.isText&&l.addHackNode("IMG",l.top),l.findNodeMatch(t,i,d,u)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(h=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(t,i,d,h,e)||l.updateNextNode(t,i,d,e,u,r)||l.addNode(t,i,d,e,r),r+=t.nodeSize,a&&(c=t.isAtom&&!t.isText)}),l.syncToMarks([],n,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),function e(t,n,r){let o=t.firstChild,i=!1;for(let s=0;s<n.length;s++){let l=n[s],a=l.dom;if(a.parentNode==t){for(;a!=o;)o=nL(o),i=!0;o=o.nextSibling}else i=!0,t.insertBefore(a,o);if(l instanceof nS){let n=o?o.previousSibling:t.lastChild;e(l.contentDOM,l.children,r),o=n?n.nextSibling:t.firstChild}}for(;o;)o=nL(o),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),t7&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof e0)||n<t||r>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(!this.node.inlineContent)return{node:o,pos:-1,text:""};{let e=o.nodeValue,i=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),l=i;if(i+=s.nodeSize,!s.isText)continue;let a=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;a+=t.text}if(i>=n){if(i>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return -1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new nx(this,o,t,r);e.input.compositionNodes.push(i),this.children=nz(this.children,n,n+r.length,e,i)}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(nI(e,this.outerDeco))return;let t=!tH(this.nodeDOM),n=this.dom;this.dom=nD(this.dom,this.nodeDOM,nR(this.outerDeco,this.node,t),nR(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){tH(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){tH(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function nC(e,t,n,r,o){nP(r,t,e);let i=new nM(void 0,e,t,n,r,r,r);return i.contentDOM&&i.updateChildren(o,0),i}class nO extends nM{constructor(e,t,n,r,o,i){super(e,t,n,r,o,null,i)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),o=document.createTextNode(r.text);return new nO(this.parent,r,this.outerDeco,this.innerDeco,o,o)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class nA extends nw{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class nE extends nM{constructor(e,t,n,r,o,i,s,l){super(e,t,n,r,o,i,s),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let nT=function(e){e&&(this.nodeName=e)};nT.prototype=Object.create(null);let nN=[new nT];function nR(e,t,n){if(0==e.length)return nN;let r=n?nN[0]:new nT,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s)for(let e in s.nodeName&&o.push(r=new nT(s.nodeName)),s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new nT(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}return o}function nD(e,t,n,r){if(n==nN&&r==nN)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||((t=document.createElement(i.nodeName)).pmIsDeco=!0,t.appendChild(o),s=nN[0]),o=t}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}(o,s||nN[0],i)}return o}function nP(e,t,n){return nD(e,e,nN,nR(t,n,!tH(e)))}function nI(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function nL(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class n_{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];n:for(;o>0;){let l;for(;;)if(r){let e=n.children[r-1];if(e instanceof nS)n=e,r=e.children.length;else{l=e,r--;break}}else if(n==t)break n;else r=n.parent.children.indexOf(n),n=n.parent;let a=l.node;if(a){if(a!=e.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let o=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){o=t;break}}if(o<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof nS&&3!=t.dirty&&t.mark.type==e[i].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[i])&&(t.mark=e[i],o=this.index,this.changed=!0)}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let r=nS.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let o=-1,i;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return -1}e=t}}updateNextNode(e,t,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof nM){let a=this.preMatch.matched.get(l);if(null!=a&&a!=o)return!1;let c=l.dom,d,u=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&nI(t,l.outerDeco));if(!u&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!u&&(d=this.recreateWrapper(l,e,t,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=2,d.updateChildren(r,i+1),d.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!nI(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=nM.create(this.top,t,n,r,o,i);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,n,r,o){let i=nM.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new nk(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof nS;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof nO)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((t6||t4)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new nA(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||tH(e)&&e.contains(this.lock.parentNode))}}function nj(e,t){return e.type.side-t.type.side}function nz(e,t,n,r,o){let i=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],c=l,d=l+=a.size;c>=n||d<=t?i.push(a):(c<t&&i.push(a.slice(0,t-c,r)),o&&(i.push(o),o=void 0),d>n&&i.push(a.slice(n-c,a.size,r)))}return i}function nB(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(tK(n)){for(a=s;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&e2.isSelectable(o.node)&&o.parent&&!(o.node.isInline&&function(e,t,n){for(let r=0==t,o=t==tV(e);r||o;){if(e==n)return!0;let t=tI(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==tV(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;c=new e2(s==e?l:r.resolve(e))}else if(t2&&"key"==t&&s>e.state.selection.to&&tH(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&o&&o.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if("visible"!=getComputedStyle(e).overflow){c=eX.findFrom(r.resolve(o.posAtStart),1);break}if(e==o.dom||e.nextSibling||!e.parentNode||!tH(e.parentNode))break}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,o=s;for(let r=0;r<n.rangeCount;r++){let i=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(i.startContainer,i.startOffset,1)),o=Math.max(o,e.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(t<0)return null;[a,s]=o==e.state.selection.anchor?[o,t]:[t,o],l=r.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let d=r.resolve(a);if(!c){let n="pointer"==t||e.state.selection.head<l.pos&&!i?1:-1;c=nJ(e,d,l,n)}return c}function n$(e){return e.editable?e.hasFocus():nX(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function nF(e,t=!1){let n=e.state.selection;if(nW(e,n),!n$(e))return;let r=e.input.mouseDown;if(!t&&t4&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&tB(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate())return void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,tI(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&t0&&t1<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{var o;let r,i,s,l,{anchor:a,head:c}=n,d,u;nV&&!(n instanceof e0)&&(n.$from.parent.inlineContent||(d=nH(e,n.from)),n.empty||n.$from.parent.inlineContent||(u=nH(e,n.to))),e.docView.setSelection(a,c,e,t),nV&&(d&&nq(d),u&&nq(u)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((r=(o=e).dom.ownerDocument).removeEventListener("selectionchange",o.input.hideSelectionGuard),s=(i=o.domSelectionRange()).anchorNode,l=i.anchorOffset,r.addEventListener("selectionchange",o.input.hideSelectionGuard=()=>{(i.anchorNode!=s||i.anchorOffset!=l)&&(r.removeEventListener("selectionchange",o.input.hideSelectionGuard),setTimeout(()=>{(!n$(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}let nV=t6||t4&&t3<63;function nH(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(t6&&o&&"false"==o.contentEditable)return nU(o);if((!o||"false"==o.contentEditable)&&(!i||"false"==i.contentEditable)){if(o)return nU(o);else if(i)return nU(i)}}function nU(e){return e.contentEditable="true",t6&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function nq(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function nW(e,t){if(t instanceof e2){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(nK(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else nK(e)}function nK(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function nJ(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||e0.between(t,n,r)}function nG(e){return(!e.editable||!!e.hasFocus())&&nX(e)}function nX(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return tq(e.dom,t.anchorNode)&&(e.editable||tq(e.dom,t.focusNode))}catch(e){return!1}}function nY(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&eX.findFrom(i,t)}function nQ(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function nZ(e,t,n){let r=e.state.selection;if(r instanceof e0){if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return nQ(e,new e0(r.$anchor,i))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=nY(e.state,t);return!!n&&n instanceof e2&&nQ(e,n)}else if(!t8||0>n.indexOf("m")){let n=r.$head,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,i;if(!o||o.isText)return!1;let s=t<0?n.pos-o.nodeSize:n.pos;return!!(o.isAtom||(i=e.docView.descAt(s))&&!i.contentDOM)&&(e2.isSelectable(o)?nQ(e,new e2(t<0?e.state.doc.resolve(n.pos-o.nodeSize):n)):nQ(e,new e0(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}else{if(r instanceof e2&&r.node.isInline)return nQ(e,new e0(t>0?r.$to:r.$from));let n=nY(e.state,t);return!!n&&nQ(e,n)}}function n0(e,t){let n=e.pmViewDesc;return n?0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName):tH(e)&&"false"==e.contentEditable}function n1(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(t2&&tH(n)&&r<tV(n)&&n0(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(!tH(n))break;let e=n.childNodes[r-1];if(n0(e,-1))o=n,i=--r;else if(tU(e))r=(n=e).nodeValue.length;else break}else if(n2(n))break;else{let t=n.previousSibling;for(;t&&n0(t,-1);)o=n.parentNode,i=tI(t),t=t.previousSibling;if(t)r=tV(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}s?n5(e,n,r):o&&n5(e,o,i)}(e):function(e){let t,n,r=e.domSelectionRange(),o=r.focusNode,i=r.focusOffset;if(!o)return;let s=tV(o);for(;;)if(i<s){if(!tH(o))break;if(n0(o.childNodes[i],1))t=o,n=++i;else break}else if(n2(o))break;else{let r=o.nextSibling;for(;r&&n0(r,1);)t=r.parentNode,n=tI(r)+1,r=r.nextSibling;if(r)i=0,s=tV(o=r);else{if((o=o.parentNode)==e.dom)break;i=s=0}}t&&n5(e,t,n)}(e)}function n2(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function n5(e,t,n){if(!tU(t)){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!tW(e);)t=tI(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(tU(n))return n;if(tH(n)&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!tW(e);)t=tI(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(tU(n))return n;if(tH(n)&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection(),o=e.domSelectionRange();if(!r)return;tK(o)?r.collapse(t,n):r.extend&&(r.collapse(o.anchorNode,o.anchorOffset),r.extend(t,n)),e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&nF(e)},50)}function n4(e,t){let n=e.state.doc.resolve(t);if(!(t4||t9)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}let r=e.dom;for(let t=n.depth;t>0;t--)if(n.node(t).isBlock){r=e.nodeDOM(n.before(t))||r;break}return"rtl"==getComputedStyle(r).direction?"rtl":"ltr"}function n3(e,t,n){let r=e.state.selection;if(r instanceof e0&&!r.empty||n.indexOf("s")>-1||t8&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=nY(e.state,t);if(n&&n instanceof e2)return nQ(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof e4?eX.near(n,t):eX.findFrom(n,t);return!!s&&nQ(e,s)}return!1}function n6(e,t){if(!(e.state.selection instanceof e0))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function n7(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function n8(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||eo.fromSchema(e.state.schema),l=ri(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,d,u=0;for(;c&&tH(c)&&(d=ro[c.nodeName.toLowerCase()]);){for(let e=d.length-1;e>=0;e--){let t=l.createElement(d[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),u++}c=a.firstChild}return c&&tH(c)&&c.setAttribute("data-pm-slice",`${o} ${i}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function n9(e,t,n,r,o){let i,s,l=o.parent.type.spec.code;if(!n&&!t)return null;let a=!!t&&(r||l||!n);if(a){if(e.someProp("transformPastedText",n=>{t=n(t,l||r,e)}),l)return s=new b(p.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0)}),s;let n=e.someProp("clipboardTextParser",n=>n(t,o,r,e));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=eo.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=ri(),r=n.body,o=/<([a-z][^>\s]+)/i.exec(e),i;if((i=o&&ro[o[1].toLowerCase()])&&(e=i.map(e=>"<"+e+">").join("")+e+i.map(e=>"</"+e+">").reverse().join("")),r.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;if(!rs){if(rs=t.defaultPolicy)try{return rs.createHTML(e)}catch(e){}rs=t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})}return rs.createHTML(e)}(e),i)for(let e=0;e<i.length;e++)r=r.querySelector(i[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r}(n),nt&&function(e){let t=e.querySelectorAll(t4?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&"\xa0"==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=i.firstChild;for(;e&&!tH(e);)e=e.nextSibling;if(!e)break;i=e}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||G.fromSchema(e.state.schema)).parseSlice(i,{preserveWhitespace:!!(a||d),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||re.test(e.parentNode.nodeName)?null:{ignore:!0}})),d)s=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch(t){return e}let{content:o,openStart:i,openEnd:s}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{o=p.from(t.create(r[e+1],o))}catch(e){break}i++,s++}return new b(o,i,s)}(rr(s,+d[1],+d[2]),d[4]);else if((s=b.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),o,i=[];if(e.forEach(e=>{if(!i)return;let t=r.findWrapping(e.type),n;if(!t)return i=null;if(n=i.length&&o.length&&function e(t,n,r,o,i){if(i<t.length&&i<n.length&&t[i]==n[i]){let s=e(t,n,r,o.lastChild,i+1);if(s)return o.copy(o.content.replaceChild(o.childCount-1,s));if(o.contentMatchAt(o.childCount).matchType(i==t.length-1?r.type:t[i+1]))return o.copy(o.content.append(p.from(rt(r,t,i+1))))}}(t,o,e,i[i.length-1],0))i[i.length-1]=n;else{i.length&&(i[i.length-1]=function e(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),o=t.contentMatchAt(t.childCount).fillBefore(p.empty,!0);return t.copy(r.append(o))}(i[i.length-1],o.length));let n=rt(e,t);i.push(n),r=r.matchType(n.type),o=t}}),i)return p.from(i)}return e}(s.content,o),!0)).openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=rr(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,a)}),s}let re=/^(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 rt(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,p.from(e));return e}function rn(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,l=s.content;return e.childCount>1&&(i=0),o<r-1&&(l=rn(l,t,n,r,o+1,i)),o>=n&&(l=t<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(p.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}function rr(e,t,n){return t<e.openStart&&(e=new b(rn(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new b(rn(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let ro={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function ri(){return document.implementation.createHTMLDocument("title")}let rs=null,rl={},ra={},rc={touchstart:!0,touchmove:!0};class rd{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastKeyDispatched=!1,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 ru(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function rh(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>rp(e,t))})}function rp(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function rf(e,t){var n,r;let o,{input:i}=e;return!i.lastKeyDispatched&&!e.composing&&(i.lastKeyDispatched=!0,"string"==typeof t&&(n="Backspace"==t?8:13,r=t,(o=document.createEvent("Event")).initEvent("keydown",!0,!0),o.keyCode=n,o.key=o.code=r,t=o),e.someProp("handleKeyDown",n=>n(e,t)))}function rm(e){return{left:e.clientX,top:e.clientY}}function rg(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)))return!0;return!1}function ry(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function rv(e,t,n){let r=e.state.doc;if(-1==t)return r.inlineContent?e0.create(r,0,r.content.size):null;let o=r.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e),i=o.before(e);if(t.inlineContent)return e0.create(r,i+1,i+1+t.content.size);if(n&&e2.isSelectable(t))return e2.create(r,i)}return null}ra.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!rS(e))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),e.input.lastKeyDispatched=!1,!ne||!t4||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!t7||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)rf(e,t)||function(e,t){let n,r=t.keyCode,o=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||t8&&72==r&&"c"==o)return n6(e,-1)||n1(e,-1);if(46==r&&!t.shiftKey||t8&&68==r&&"c"==o)return n6(e,1)||n1(e,1);if(13==r||27==r)return!0;if(37==r||t8&&66==r&&"c"==o){let t=37==r?"ltr"==n4(e,e.state.selection.from)?-1:1:-1;return nZ(e,t,o)||n1(e,t)}if(39==r||t8&&70==r&&"c"==o){let t=39==r?"ltr"==n4(e,e.state.selection.from)?1:-1:1;return nZ(e,t,o)||n1(e,t)}else if(38==r||t8&&80==r&&"c"==o)return n3(e,-1,o)||n1(e,-1);else if(40==r||t8&&78==r&&"c"==o)return function(e){if(!t6||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&tH(t)&&0==n&&t.firstChild&&tH(t.firstChild)&&"false"==t.firstChild.contentEditable){let n=t.firstChild;n7(e,n,"true"),setTimeout(()=>n7(e,n,"false"),20)}return!1}(e)||n3(e,1,o)||n1(e,1);else if(o==(t8?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1}(e,t)?t.preventDefault():ru(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(rf(e,"Enter"),e.input.lastIOSEnter=0)},200)}},ra.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},ra.keypress=(e,t)=>{if(rS(e)||!t.charCode||t.ctrlKey&&!t.altKey||t8&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof e0)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),o=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,o))||e.dispatch(o()),t.preventDefault()}};let rb=t8?"metaKey":"ctrlKey";rl.mousedown=(e,t)=>{e.input.shiftKey=t.shiftKey;let n=rA(e),r=Date.now(),o="singleClick";r-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,e.input.lastClick)&&!t[rb]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:r,x:t.clientX,y:t.clientY,type:o,button:t.button},e.input.mouseDown&&e.input.mouseDown.done();let i=e.posAtCoords(rm(t));i&&("singleClick"==o?e.input.mouseDown=new rk(e,i,t,!!n):("doubleClick"==o?function(e,t,n,r){return rg(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,r){return rg(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=rv(e,t,!0),o=e.state.doc;return!!r&&(ry(e,r),r instanceof e0&&o.eq(e.state.doc)&&(e.input.mouseDown=new rx(e,r)),!0)}(e,n,r)})(e,i.pos,i.inside,t)?t.preventDefault():ru(e,"pointer"))};class rw{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){0==e.buttons&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class rk extends rw{constructor(e,t,n,r){let o,i;if(super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[rb],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}let s=r?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&tH(l.nodeDOM)?l.nodeDOM:null;let{selection:a}=e.state;0==n.button&&(o.type.spec.draggable&&!1!==o.type.spec.selectable||a instanceof e2&&a.from<=i&&a.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&t2&&!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()),ru(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||nF(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(rm(e))),this.updateAllowDefault(e),this.allowDefault||!t)ru(this.view,"pointer");else{var n,r,o,i;(n=this.view,r=t.pos,o=t.inside,i=this.selectNode,rg(n,"handleClickOn",r,o,e)||n.someProp("handleClick",t=>t(n,r,e))||(i?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,o;n instanceof e2&&(r=n.node);let i=e.state.doc.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e);if(e2.isSelectable(t)){o=r&&n.$from.depth>0&&e>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?i.before(n.$from.depth):i.before(e);break}}return null!=o&&(ry(e,e2.create(e.state.doc,o)),!0)}(n,o):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&e2.isSelectable(r))&&(ry(e,new e2(n)),!0)}(n,o)))?e.preventDefault():0==e.button&&(this.flushed||t6&&this.mightDrag&&!this.mightDrag.node.isAtom||t4&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(ry(this.view,eX.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ru(this.view,"pointer")}}move(e){this.updateAllowDefault(e),ru(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}}class rx extends rw{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(0==e.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();e.preventDefault(),ru(this.view,"pointer");let t=this.view.posAtCoords(rm(e)),n=t&&rv(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,o=this.startSelection,[i,s]=n.from<o.from?[o.to,n.from]:[o.from,n.to];ry(this.view,e0.create(r,i,s))}}function rS(e,t){return!!e.composing||!!(t6&&500>Math.abs(Date.now()-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}rl.touchstart=e=>{e.input.lastTouch=Date.now(),rA(e),ru(e,"pointer")},rl.touchmove=e=>{e.input.lastTouch=Date.now(),ru(e,"pointer")},rl.contextmenu=e=>rA(e);let rM=ne?5e3:-1;function rC(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>rA(e),t))}function rO(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function rA(e,t=!1){if(!ne||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),rO(e),t||e.docView&&e.docView.dirty){let n=nB(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}ra.compositionstart=ra.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof e0&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||t4&&t9&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!tH(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return tH(r)&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),rA(e,!0),e.markCursor=null;else if(rA(e,!t.selection.empty),t2&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&tH(n)&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(tU(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}rC(e,rM)},ra.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,rC(e,20))};let rE=t0&&t1<15||t7&&nn<604;function rT(e,t,n,r,o){let i=n9(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,o,i||b.empty)))return!0;if(!i)return!1;let s=0==i.openStart&&0==i.openEnd&&1==i.content.childCount?i.content.firstChild:null,l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function rN(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}rl.copy=ra.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let o=rE?null:t.clipboardData,{dom:i,text:s}=n8(e,n.content());o?(t.preventDefault(),o.clearData(),o.setData("text/html",i.innerHTML),o.setData("text/plain",s)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,i),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},ra.paste=(e,t)=>{if(e.composing&&!ne)return;let n=rE?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&rT(e,rN(n),n.getData("text/html"),r,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?rT(e,r.value,null,o,t):rT(e,r.textContent,r.innerHTML,o,t)},50)}(e,t)};class rR{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let rD=t8?"altKey":"ctrlKey";function rP(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t)}),null!=n?!n:!t[rD]}for(let e in rl.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(rm(t));if(i&&i.pos>=o.from&&i.pos<=(o instanceof e2?o.to-1:o.to));else if(r&&r.mightDrag)n=e2.create(e.state.doc,r.mightDrag.pos);else if(t.target&&tH(t.target)){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=e2.create(e.state.doc,r.posBefore))}let s=(n||e.state.selection).content(),{dom:l,text:a,slice:c}=n8(e,s);t.dataTransfer.files.length&&t4&&!(t3>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(rE?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",rE||t.dataTransfer.setData("text/plain",a),e.dragging=new rR(c,rP(e,t),n)},rl.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},ra.dragover=ra.dragenter=(e,t)=>t.preventDefault(),ra.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(rm(t));if(!r)return;let o=e.state.doc.resolve(r.pos),i=n&&n.slice;i?e.someProp("transformPasted",t=>{i=t(i,e,!1)}):i=n9(e,rN(t.dataTransfer),rE?null:t.dataTransfer.getData("text/html"),!1,o);let s=!!(n&&rP(e,t));if(e.someProp("handleDrop",n=>n(e,t,i||b.empty,s)))return t.preventDefault();if(!i)return;t.preventDefault();let l=i?eL(e.state.doc,o.pos,i):o.pos;null==l&&(l=o.pos);let a=e.state.tr;if(s){let{node:e}=n;e?e.replace(a):a.deleteSelection()}let c=a.mapping.map(l),d=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=a.doc;if(d?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(u))return;let h=a.doc.resolve(c);if(d&&e2.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new e2(h));else{let t=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((e,n,r,o)=>t=o),a.setSelection(nJ(e,h,a.doc.resolve(t)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},rl.focus=e=>{if(e.input.lastFocus=Date.now(),!e.focused){e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0;let t=e.domSelectionRange();if(!e.domObserver.currentSelection.eq(t)){let{focusNode:n,focusOffset:r}=t;setTimeout(()=>{let t=e.domSelectionRange();t.focusNode==n&&t.focusOffset==r&&e.docView&&e.hasFocus()&&nF(e)},20)}}},rl.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},rl.beforeinput=(e,t)=>{if(ne&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||e.domObserver.pendingRecords().length||(e.dom.blur(),e.focus(),rf(e,"Backspace")))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},ra)rl[e]=ra[e];function rI(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class rL{constructor(e){this.frag=e,this.index=0,this.off=0}nodeAt(e){for(;this.off<=e&&this.index<this.frag.childCount;){let t=this.frag.child(this.index);if(this.off==e)return t;this.off+=t.nodeSize,this.index++}return null}}class r_{constructor(e,t){this.toDOM=e,this.spec=t||rF,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new rB(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof r_&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&rI(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class rj{constructor(e,t){this.attrs=e,this.spec=t||rF}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new rB(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof rj&&rI(this.attrs,e.attrs)&&rI(this.spec,e.spec)}static is(e){return e.type instanceof rj}destroy(){}}class rz{constructor(e,t){this.attrs=e,this.spec=t||rF}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new rB(o.pos-n,i.pos-n,this)}valid(e,t,n){let r=n.nodeAt(t.from);return!!r&&!r.isText&&t.from+r.nodeSize==t.to}eq(e){return this==e||e instanceof rz&&rI(this.attrs,e.attrs)&&rI(this.spec,e.spec)}destroy(){}}class rB{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new rB(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new rB(e,e,new r_(t,n))}static inline(e,t,n,r){return new rB(e,t,new rj(n,r))}static node(e,t,n,r){return new rB(e,t,new rz(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof rj}get widget(){return this.type instanceof r_}}let r$=[],rF={};class rV{constructor(e,t){this.local=e.length?e:r$,this.children=t.length?t:r$}static create(e,t){return t.length?rJ(t,e,0,rF):rH}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==rH||0==e.maps.length?this:this.mapInner(e,t,0,0,n||rF)}mapInner(e,t,n,r,o){let i;if(this.local.length){let s=new rL(t.content);for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,n,r);a&&a.type.valid(t,a,s)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[l].spec)}}return this.children.length?function(e,t,n,r,o,i,s){let l=e.slice();for(let e=0,t=i;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,o,i)=>{let s=i-o-(n-e);for(let o=0;o<l.length;o+=3){let i=l[o+1];if(i<0||e>i+t-r)continue;let a=l[o]+t-r;n>=a?l[o+1]=e<=a?-2:-1:e>=t&&s&&(l[o]+=s,l[o+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let c=n.map(e[t]+i),d=c-o;if(d<0||d>=r.content.size){a=!0;continue}let u=n.map(e[t+1]+i,-1)-o,{index:h,offset:p}=r.content.findIndex(d),f=r.maybeChild(h);if(f&&p==d&&p+f.nodeSize==u){let r=l[t+2].mapInner(n,f,c+1,e[t]+i+1,s);r!=rH?(l[t]=d,l[t+1]=u,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=rJ(function(e,t,n,r,o,i,s){for(let l=0;l<e.length;l+=3)-1==e[l+1]&&function e(t,i){for(let e=0;e<t.local.length;e++){let l=t.local[e].map(r,o,i);l?n.push(l):s.onRemove&&s.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+i+1)}(e[l+2],t[l]+i+1);return n}(l,e,t,n,o,i,s),r,0,s);t=a.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new rV(t.sort(rG),l)}(this.children,i||[],e,t,n,r,o):i?new rV(i.sort(rG),r$):rH}add(e,t){return t.length?this==rH?rV.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach((e,i)=>{let s=i+n,l;if(l=rW(t,e,s)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,l,s+1):r.splice(o,0,i,i+e.nodeSize,rJ(l,e,s+1,rF)),o+=3}});let i=rq(o?rK(t):t,-n);if(i.length){let t=new rL(e.content);for(let n=0;n<i.length;n++)i[n].type.valid(e,i[n],t)||i.splice(n--,1)}return new rV(i.length?this.local.concat(i).sort(rG):this.local,r||this.children)}remove(e){return 0==e.length||this==rH?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+t,s=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>i&&n.to<s&&(e[t]=null,(o||(o=[])).push(n));if(!o)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(o,i+1);l!=rH?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,o;n<e.length;n++)if(o=e[n])for(let e=0;e<r.length;e++)r[e].eq(o,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new rV(r,n):rH}forChild(e,t){let n,r;if(this==rH)return this;if(t.isLeaf)return rV.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof rj){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new rV(r.sort(rG),r$);return n?new rU([e,n]):e}return n||rH}eq(e){if(this==e)return!0;if(!(e instanceof rV)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return rX(this.localsInner(e))}localsInner(e){if(this==rH)return r$;if(e.inlineContent||!this.local.some(rj.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof rj||t.push(this.local[e]);return t}forEachSet(e){e(this)}}rV.empty=new rV([],[]),rV.removeOverlap=rX;let rH=rV.empty;class rU{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,rF));return rU.from(n)}forChild(e,t){if(t.isLeaf)return rV.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=rH&&(o instanceof rU?n=n.concat(o.members):n.push(o))}return rU.from(n)}eq(e){if(!(e instanceof rU)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?rX(n?t:t.sort(rG)):r$}static from(e){switch(e.length){case 0:return rH;case 1:return e[0];default:return new rU(e.every(e=>e instanceof rV)?e:e.reduce((e,t)=>e.concat(t instanceof rV?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function rq(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new rB(o.from+t,o.to+t,o.type))}return n}function rW(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t=0,i;t<e.length;t++)(i=e[t])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),e[t]=null);return o}function rK(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function rJ(e,t,n,r){let o=[],i=!1;t.forEach((t,s)=>{let l=rW(e,t,s+n);if(l){i=!0;let e=rJ(l,t,n+s+1,r);e!=rH&&o.push(s,s+t.nodeSize,e)}});let s=rq(i?rK(e):e,-n).sort(rG);if(s.length){let e=new rL(t.content);for(let n=0;n<s.length;n++)s[n].type.valid(t,s[n],e)||(r.onRemove&&r.onRemove(s[n].spec),s.splice(n--,1))}return s.length||o.length?new rV(s,o):rH}function rG(e,t){return e.from-t.from||e.to-t.to}function rX(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from==r.from){i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),rY(t,o+1,i.copy(r.to,i.to)));continue}i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),rY(t,o,r.copy(i.from,r.to)));break}}return t}function rY(e,t,n){for(;t<e.length&&rG(n,e[t])>0;)t++;e.splice(t,0,n)}function rQ(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=rH&&t.push(r)}),e.cursorWrapper&&t.push(rV.create(e.state.doc,[e.cursorWrapper.deco])),rU.from(t)}let rZ={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},r0=t0&&t1<=11;class r1{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 r2{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new r1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);t0&&t1<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():t6&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),r0&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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,rZ)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(nG(this.view)){if(this.suppressingSelectionUpdates)return nF(this.view);if(t0&&t1<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&tB(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=tL(n))t.add(n);for(let r=e.anchorNode;r;r=tL(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:tU(n)?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r,o=!1;!this.suppressingSelectionUpdates&&nG(t)&&(r=t.domSelectionRange(),o=!this.currentSelection.eq(r)&&!this.ignoreSelectionChange(r));let i=-1,s=-1,l=!1,a=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],a);t&&(i=i<0?t.from:Math.min(t.from,i),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(l=!0))}if(a.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode||t4&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(e=>"childList"==e.type&&e.removedNodes.length))){for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&tH(t);){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(t2&&a.length){let e=a.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.nodeName&&(!n||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}(t,n)!=e)&&r.remove()}}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&tK(r)&&(c=nB(t))&&c.eq(eX.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,nF(t),this.currentSelection.set(r),t.scrollToSelection()):(i>-1||o)&&(i>-1&&(t.docView.markDirty(i,s),e=t,!r5.has(e)&&(r5.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=t2,r4||(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."),r4=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:o}=e.domSelectionRange();for(let i of t)if((null==(n=i.parentNode)?void 0:n.nodeName)=="TR"){let t=i.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||!tH(e)||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(i,n.firstChild),r==i&&e.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}(t,a)),this.handleDOMChange(i,s,l,a),t.docView&&t.docView.dirty?t.updateState(t.state):r&&!this.currentSelection.eq(r)&&nF(t),r&&this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),tU(r)&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(t0&&t1<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!i||0>Array.prototype.indexOf.call(e.addedNodes,i))&&(o=i)}let i=r&&r.parentNode==e.target?tI(r)+1:0,s=n.localPosFromDOM(e.target,i,-1),l=o&&o.parentNode==e.target?tI(o):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let r5=new WeakMap,r4=!1;function r3(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return tB(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}let r6=/^(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 r7(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:nJ(e,t.resolve(n.anchor),t.resolve(n.head))}function r8(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}class r9{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new rd,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(oo),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=on(this),ot(this),this.nodeViews=or(this),this.docView=nC(this.state.doc,oe(this),rQ(this),this.dom,this),this.domObserver=new r2(this,(e,t,n,r)=>(function(e,t,n,r,o){var i,s,l;let a,c,d,u,h,f=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=nB(e,t);if(n&&!e.state.selection.eq(n)){if(t4&&ne&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&rf(e,"Enter"))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),f&&r.setMeta("composition",f),e.dispatch(r)}return}let m=e.state.doc.resolve(t),g=m.sharedDepth(n);t=m.before(g+1),n=e.state.doc.resolve(n).after(g+1);let y=e.state.selection,v=function(e,t,n,r){let o,i,{node:s,fromOffset:l,toOffset:a,from:c,to:d}=e.docView.parseRange(t,n),u=e.domSelectionRange(),h=u.anchorNode;if(h&&tq(e.dom,h)&&(i=[{node:h,offset:u.anchorOffset}],tK(u)||i.push({node:u.focusNode,offset:u.focusOffset})),t4&&8===e.input.lastKeyCode)for(let e=a;e>l;e--){let t=s.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){a=e;break}if(!n||n.size)break}let p=e.state.doc,f=e.someProp("domParser")||G.fromSchema(e.state.schema),m=p.resolve(c),g=null,y=f.parse(s,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:l,to:a,preserveWhitespace:"pre"!=m.parent.type.whitespace||"full",findPositions:i,ruleFromNode:(o=r,e=>{let t=e.pmViewDesc;if(t)return t.parseRule(o);if("BR"==e.nodeName&&e.parentNode){if(t6&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||t6&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}),context:m});if(i&&null!=i[0].pos){let e=i[0].pos,t=i[1]&&i[1].pos;null==t&&(t=e),g={anchor:e+c,head:t+c}}return{doc:y,sel:g,from:c,to:d}}(e,t,n,o),b=e.state.doc,w=b.slice(v.from,v.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(d=e.state.selection.to,u="end"):(d=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let k=function(e,t,n,r,o){let i=e.findDiffStart(t,n),s=n+e.size,l=n+t.size;if(null==i)return null;let{a:a,b:c}=e.findDiffEnd(t,s,l);if("end"==o){let e=Math.max(0,i-Math.min(a,c));r-=a+e-i}if(a<i&&s<l){let e=r<=i&&r>=a?i-r:0;i-=e,c=i+(c-a),a=i}else if(c<i){let e=r<=i&&r>=c?i-r:0;i-=e,a=i+(a-c),c=i}return{start:i,endA:a,endB:c}}(w.content,v.doc.content,v.from,d,u);if(k&&e.input.domChangeCount++,(t7&&e.input.lastIOSEnter>Date.now()-225||ne)&&o.some(e=>tH(e)&&!r6.test(e.nodeName))&&(!k||k.endA>=k.endB)&&rf(e,"Enter")){e.input.lastIOSEnter=0;return}if(!k)if(r&&y instanceof e0&&!y.empty&&y.$head.sameParent(y.$anchor)&&!e.composing&&!(v.sel&&v.sel.anchor!=v.sel.head))k={start:y.from,endA:y.to,endB:y.to};else{if(v.sel){let t=r7(e,e.state.doc,v.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);f&&n.setMeta("composition",f),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&k.start==k.endB&&e.state.selection instanceof e0&&(k.start>e.state.selection.from&&k.start<=e.state.selection.from+2&&e.state.selection.from>=v.from?k.start=e.state.selection.from:k.endA<e.state.selection.to&&k.endA>=e.state.selection.to-2&&e.state.selection.to<=v.to&&(k.endB+=e.state.selection.to-k.endA,k.endA=e.state.selection.to)),t0&&t1<=11&&k.endB==k.start+1&&k.endA==k.start&&k.start>v.from&&" \xa0"==v.doc.textBetween(k.start-v.from-1,k.start-v.from+1)&&(k.start--,k.endA--,k.endB--);let x=v.doc.resolveNoCache(k.start-v.from),S=v.doc.resolveNoCache(k.endB-v.from),M=b.resolve(k.start),C=x.sameParent(S)&&x.parent.inlineContent&&M.end()>=k.endA;if((t7&&e.input.lastIOSEnter>Date.now()-225&&(!C||o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!C&&(i=v.doc,s=x.pos,l=S.pos,a=0,c=0,i.nodesBetween(s,l,(e,t)=>{e.isTextblock&&t>=s&&t<l?a++:(e.isText?/\S/.test(e.text.slice(Math.max(0,s-t),Math.min(e.nodeSize,l-t))):e.isLeaf)&&c++}),0==c&&1==a))&&rf(e,"Enter")){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>k.start&&(C?k.endA>k.start&&k.endB==k.start:function(e,t,n,r,o){if(n-t<=o.pos-r.pos||r8(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.inlineContent){let e=i.nodeAfter;return null!=e&&n==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(r8(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||r8(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(b,k.start,k.endA,x,S))&&rf(e,"Backspace")){ne&&t4&&e.domObserver.suppressSelectionUpdates();return}t4&&k.endB==k.start&&(e.input.lastChromeDelete=Date.now()),ne&&!C&&x.start()!=S.start()&&0==S.parentOffset&&x.depth==S.depth&&v.sel&&v.sel.anchor==v.sel.head&&v.sel.head==k.endA&&(k.endB-=2,S=v.doc.resolveNoCache(k.endB-v.from),setTimeout(()=>rf(e,"Enter"),20));let O=k.start,A=k.endA,E=t=>{let n=t||e.state.tr.replace(O,A,v.doc.slice(k.start-v.from,k.endB-v.from));if(v.sel){let t=r7(e,n.doc,v.sel);t&&!(t4&&e.composing&&t.empty&&(k.start!=k.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==O||t.head==n.mapping.map(A)-1)||t0&&t.empty&&t.head==O)&&n.setSelection(t)}return f&&n.setMeta("composition",f),n.scrollIntoView()};if(C)if(x.pos==S.pos){t0&&t1<=11&&0==x.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>nF(e),20));let t=E(e.state.tr.delete(O,A)),n=b.resolve(k.start).marksAcross(b.resolve(k.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(k.endA==k.endB&&(h=function(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,i=r,s,l,a;for(let e=0;e<r.length;e++)o=r[e].removeFromSet(o);for(let e=0;e<n.length;e++)i=n[e].removeFromSet(i);if(1==o.length&&0==i.length)l=o[0],s="add",a=e=>e.mark(l.addToSet(e.marks));else{if(0!=o.length||1!=i.length)return null;l=i[0],s="remove",a=e=>e.mark(l.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(a(t.child(e)));if(p.from(c).eq(e))return{mark:l,type:s}}(x.parent.content.cut(x.parentOffset,S.parentOffset),M.parent.content.cut(M.parentOffset,k.endA-M.start())))){let t=E(e.state.tr);"add"==h.type?t.addMark(O,A,h.mark):t.removeMark(O,A,h.mark),e.dispatch(t)}else if(x.parent.child(x.index()).isText&&x.index()==S.index()-!S.textOffset){let t=x.parent.textBetween(x.parentOffset,S.parentOffset),n=()=>E(e.state.tr.insertText(t,O,A));e.someProp("handleTextInput",r=>r(e,O,A,t,n))||e.dispatch(n())}else e.dispatch(E());else e.dispatch(E())})(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in rl){let n=rl[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||rp(e,t)||!e.editable&&t.type in ra||n(e,t)},rc[t]?{passive:!0}:void 0)}t6&&e.dom.addEventListener("input",()=>null),rh(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&rh(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(oo),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n,r,o;let i=this.state,s=!1,l=!1;e.storedMarks&&this.composing&&(rO(this),l=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=or(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,s=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&rh(this),this.editable=on(this),ot(this);let c=rQ(this),d=oe(this),u=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",h=s||!this.docView.matchesNode(e.doc,d,c);(h||!e.selection.eq(i.selection))&&(l=!0);let p="preserve"==u&&l&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=o-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:ni(e.dom)}}(this);if(l){let t,n,l;this.domObserver.stop();let a=h&&(t0||t4)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&(r=i.selection,o=e.selection,l=Math.min(r.$anchor.sharedDepth(r.head),o.$anchor.sharedDepth(o.head)),r.$anchor.start(l)!=o.$anchor.start(l));if(h){let t=t4?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(tU(e)&&t)return e;if(tH(e)&&t>0){if("false"==e.contentEditable)return null;t=tV(e=e.childNodes[t-1])}else{if(!e.parentNode||tW(e))return null;t=tI(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(tU(e)&&t<e.nodeValue.length)return e;if(tH(e)&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||tW(e))return null;t=tI(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}(this)),(s||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=nC(e.doc,d,c,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(a=!0)}let u=this.input.mouseDown;a||!(u&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),tB(t.node,t.offset,n.anchorNode,n.anchorOffset))&&u.delaySelUpdate())?nF(this,a):(nW(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),(null==(n=this.dragging)?void 0:n.node)&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),"reset"==u?this.dom.scrollTop=0:"to selection"==u?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ns(n,0==r?0:r-t)}(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&tq(this.dom,e))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof e2){let t=this.docView.domAfterPos(this.state.selection.from);tH(t)&&no(this,t.getBoundingClientRect(),e)}else no(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)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new rR(e.slice,e.move,r<0?void 0:e2.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let o=this.directPlugins[n].props[e];if(null!=o&&(r=t?t(o):o))return r}let o=this.state.plugins;if(o)for(let n=0;n<o.length;n++){let i=o[n].props[e];if(null!=i&&(r=t?t(i):i))return r}}hasFocus(){if(t0){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("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(nl)return e.focus(nl);let t=ni(e);e.focus(null==nl?{get preventScroll(){return nl={preventScroll:!0},!0}}:void 0),nl||(nl=!1,ns(t,0))}(this.dom),nF(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var n;let r,o,i=e.dom.ownerDocument,s,l=0,a=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(tV(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(tV(r.startContainer),r.startOffset)}}}(i,t.left,t.top);a&&({node:s,offset:l}=a);let c=(e.root.elementFromPoint?e.root:i).elementFromPoint(t.left,t.top);if(!c||!e.dom.contains(c)){let n=e.dom.getBoundingClientRect();if(!na(t,n)||!(c=function e(t,n,r){let o=t.childNodes.length;if(o&&r.top<r.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(n.top-r.top)/(r.bottom-r.top))-2)),s=i;;){let r=t.childNodes[s];if(tH(r)){let t=r.getClientRects();for(let o=0;o<t.length;o++){let i=t[o];if(na(n,i))return e(r,n,i)}}if((s=(s+1)%o)==i)break}return t}(e.dom,t,n)))return null}if(t6)for(let e=c;s&&e;e=tL(e))e.draggable&&(s=void 0);if(c=(r=(n=c).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,s){let n;if(t2&&tH(s)&&(l=Math.min(l,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[l],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&l++}nt&&l&&tH(s)&&tH(n=s.childNodes[l-1])&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&l--,s==e.dom&&l==s.childNodes.length-1&&tH(s.lastChild)&&t.top>s.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=l&&tH(s)&&"BR"==s.childNodes[l-1].nodeName||(o=function(e,t,n,r){let o=-1;for(let n=t,i=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(tH(t.dom)&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!i&&s.left>r.left||s.top>r.top?o=t.posBefore:(!i&&s.right<r.left||s.bottom<r.top)&&(o=t.posAfter),i=!0),!t.contentDOM&&o<0&&!t.node.isText))return(t.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,s,l,t))}null==o&&(o=function(e,t,n){let{node:r,offset:o}=function e(t,n){let r,o,i,s=2e8,l,a=0,c=n.top,d=n.top;for(let e=t.firstChild,u=0;e;e=e.nextSibling,u++){let t;if(tH(e))t=e.getClientRects();else{if(!tU(e))continue;t=tj(e).getClientRects()}for(let h=0;h<t.length;h++){let p=t[h];if(p.top<=c&&p.bottom>=d){c=Math.max(p.bottom,c),d=Math.min(p.top,d);let t=p.left>n.left?p.left-n.left:p.right<n.left?n.left-p.right:0;if(t<s){r=e,s=t,l=t&&tU(r)?{left:p.right<n.left?p.right:p.left,top:n.top}:n,tH(e)&&t&&(a=u+ +(n.left>=(p.left+p.right)/2));continue}}else p.top>n.top&&!o&&p.left<=n.left&&p.right>=n.left&&(o=e,i={left:Math.max(p.left,Math.min(p.right,n.left)),top:p.top});!r&&(n.left>=p.right&&n.top>=p.top||n.left>=p.left&&n.top>=p.bottom)&&(a=u+1)}}return(!r&&o&&(r=o,l=i,s=0),r&&tU(r))?function(e,t){let n=e.nodeValue.length,r=document.createRange(),o;for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=nd(r,1);if(n.top!=n.bottom&&na(t,n)){o={node:e,offset:i+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),o||{node:e,offset:0}}(r,l):!r||s?{node:t,offset:a}:e(r,l)}(t,n),i=-1;if(tH(r)&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,c,t));let d=e.docView.nearestDesc(c,!0);return{pos:o,inside:d?d.posAtStart-d.border:-1}}(this,e)}coordsAtPos(e,t=1){return nh(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){let r,o;return ny==t&&nv==n?nb:(ny=t,nv=n,nb="up"==n||"down"==n?(r=t.selection,o="up"==n?r.$from:r.$to,nm(e,t,()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=nh(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(tH(e))t=e.getClientRects();else{if(!tU(e))continue;t=tj(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>(o.bottom-r.top)*2:o.bottom-r.bottom>(r.bottom-o.top)*2))return!1}}return!0})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=o==r.parent.content.size,s=e.domSelection();return s?ng.test(r.parent.textContent)&&s.modify?nm(e,t,()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:l}=e.domSelectionRange(),a=s.caretBidiLevel;s.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:u}=e.domSelectionRange(),h=d&&!tq(c,d)||t==d&&o==u;try{s.collapse(i,l),t&&(t!=i||o!=l)&&s.extend&&s.extend(t,o)}catch(e){}return null!=a&&(s.caretBidiLevel=a),h}):"left"==n||"backward"==n?!o:i:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return rT(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return rT(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return n8(this,e)}destroy(){if(this.docView){for(let e in this.input.mouseDown&&this.input.mouseDown.done(),this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rQ(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,tz()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!rp(this,e)&&rl[e.type]&&(this.editable||!(e.type in ra))&&rl[e.type](this,e)}domSelectionRange(){let e=!1!==this.dom.isConnected&&this.domSelection();return e?t6&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return r3(e,n)}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?r3(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function oe(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[rB.node(0,e.state.doc.content.size,t)]}function ot(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:rB.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function on(e){return!e.someProp("editable",t=>!1===t(e.state))}function or(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function oo(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}r9.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var oi={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:"'"},ol={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},oa="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),oc="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),od=0;od<10;od++)oi[48+od]=oi[96+od]=String(od);for(var od=1;od<=24;od++)oi[od+111]="F"+od;for(var od=65;od<=90;od++)oi[od]=String.fromCharCode(od+32),ol[od]=String.fromCharCode(od);for(var ou in oi)ol.hasOwnProperty(ou)||(ol[ou]=oi[ou]);let oh="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),op="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function of(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function om(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))oh?o=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=e[n];return t}(e);return function(e,n){var r;let o=("Esc"==(r=!(oa&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||oc&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?ol:oi)[n.keyCode]||n.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),i,s=t[of(o,n)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=t[of(o,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(op&&n.ctrlKey&&n.altKey)&&(i=oi[n.keyCode])&&i!=o){let r=t[of(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var og=function(){};og.prototype.append=function(e){return e.length?(e=og.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},og.prototype.prepend=function(e){return e.length?og.from(e).append(this):this},og.prototype.appendInner=function(e){return new ov(this,e)},og.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?og.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},og.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},og.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},og.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},og.from=function(e){return e instanceof og?e:e&&e.length?new oy(e):og.empty};var oy=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(og);og.empty=new oy([]);var ov=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;if(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r)||n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;if(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o)||n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(og);class ob{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,o,i;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(r=(n=this.remapping(s,this.items.length)).maps.length);let l=e.tr,a=[],c=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(s,t+1)).maps.length),r--,c.push(e);return}if(n){c.push(new ow(e.map));let t=e.step.map(n.slice(r)),o;t&&l.maybeStep(t).doc&&(o=l.mapping.maps[l.mapping.maps.length-1],a.push(new ow(o,void 0,void 0,a.length+c.length))),r--,o&&n.appendMap(o,r)}else l.maybeStep(e.step);if(e.selection)return o=n?e.selection.map(n.slice(r)):e.selection,i=new ob(this.items.slice(0,s).append(c.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:i,transform:l,selection:o}}addTransform(e,t,n,r){var o,i;let s,l=[],a=this.eventCount,c=this.items,d=!r&&c.length?c.get(c.length-1):null;for(let n=0;n<e.steps.length;n++){let o=e.steps[n].invert(e.docs[n]),i=new ow(e.mapping.maps[n],o,t),s;(s=d&&d.merge(i))&&(i=s,n?l.pop():c=c.slice(0,c.length-1)),l.push(i),t&&(a++,t=void 0),r||(d=i)}let u=a-n.depth;return u>ox&&(o=c,i=u,o.forEach((e,t)=>{if(e.selection&&0==i--)return s=t,!1}),c=o.slice(s),a-=u),new ob(c.append(l),a)}remapping(e,t){let n=new eu;return this.items.forEach((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)},e,t),n}addMaps(e){return 0==this.eventCount?this:new ob(this.items.append(e.map(e=>new ow(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;t=Math.min(this.items.length,t);let n=[],r=this.items.length-t,o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},r);let l=t;this.items.forEach(t=>{let r=o.getMirror(--l);if(null==r)return;i=Math.min(i,r);let a=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(l+1,r));c&&s++,n.push(new ow(a,i,c))}else n.push(new ow(a))},r);let a=[];for(let e=t;e<i;e++)a.push(new ow(o.maps[e]));let c=new ob(this.items.slice(0,r).append(a).append(n),s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let l=i.selection&&i.selection.map(t.slice(n));l&&o++;let a=new ow(s.invert(),e,l),c,d=r.length-1;(c=r.length&&r[d].merge(a))?r[d]=c:r.push(a)}}else i.map&&n--},this.items.length,0),new ob(og.from(r.reverse()),o)}}ob.empty=new ob(og.empty,0);class ow{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ow(t.getMap().invert(),t,this.selection)}}}class ok{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}let ox=20;function oS(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,o)=>t.push(r,o));return t}function oM(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let oC=!1,oO=null;function oA(e){let t=e.plugins;if(oO!=t){oC=!1,oO=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){oC=!0;break}}return oC}let oE=new tl("history"),oT=new tl("closeHistory");function oN(e,t){return(n,r)=>{let o=oE.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=oA(t),o=oE.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),l=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),a=new ok(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(s).setMeta(oE,{redo:n,historyState:a})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}let oR=oN(!1,!0),oD=oN(!0,!0);oN(!1,!1),oN(!0,!1);var oP=n(95704);function oI(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var oL=class e{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],l=!!e,a=e||o.tr,c=()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(a),s.every(e=>!0===e)),d={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(a,t),o=n(...e)(r);return s.push(o),d}])),run:c};return d}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if("then"!==n)return"run"===n?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,o=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if("then"!==t)return"chain"===t?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:e,editor:r,view:i,state:oI({state:o,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}};let o_=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),null==(n=window)||null==(n=n.getSelection())||n.removeAllRanges()}}),!0),oj=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),oz=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{ranges:r}=n;if(!t)return!0;let o=e.mapping.maps.length;return r.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos,s=e.mapping.slice(o),l=1;e.doc.nodesBetween(s.map(r),s.map(i),(t,n)=>{l=Math.max(l,e.doc.resolve(n).depth+1)});for(let t=0;t<l;t+=1){let t=e.doc,n=e.mapping.maps.length,s=e.mapping.slice(o),l=n,a=e.mapping.slice(n),c=s.map(r),d=s.map(i);if(t.nodesBetween(c,d,(t,r)=>{if(t.type.isText)return;e.mapping.maps.length!==l&&(l=e.mapping.maps.length,a=e.mapping.slice(n));let o=e.doc.resolve(a.map(r)),i=e.doc.resolve(a.map(r+t.nodeSize)),s=o.blockRange(i);if(!s)return;let c=eO(s);if(t.type.isTextblock){let{defaultType:t}=o.parent.contentMatchAt(o.index()),n=e.doc.nodeAt(s.start);t&&n&&!n.hasMarkup(t)&&t.validContent(n.content)&&e.setNodeMarkup(s.start,t)}(c||0===c)&&e.lift(s,c)}),e.doc.eq(t))break}}),!0},oB=e=>t=>e(t),o$=()=>({state:e,dispatch:t})=>tx(e,t),oF=(e,t)=>({editor:n,tr:r})=>{let{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,i.content),r.setSelection(new e0(r.doc.resolve(Math.max(s-1,0)))),!0},oV=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let o=e.selection.$anchor;for(let n=o.depth;n>0;n-=1)if(o.node(n).type===r.type){if(t){let t=o.before(n),r=o.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function oH(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}let oU=e=>({tr:t,state:n,dispatch:r})=>{let o=oH(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1)if(i.node(e).type===o){if(r){let n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},oq=e=>({tr:t,dispatch:n})=>{let{from:r,to:o}=e;return n&&t.delete(r,o),!0},oW=(e,t,n)=>!e.parent.isInline||"left"===n&&e.pos>e.start()||"right"===n&&e.pos<e.end()||!(e=>!!e.content&&/^text(\*|\+)/.test(e.content))(t.nodes[e.parent.type.name].spec)?e.pos:"left"===n?e.start()-1:e.end()+1,oK=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,o=e.selection instanceof e0?e.selection.$from.marksAcross(e.selection.$to):null,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:o,to:s}=((e,t,n)=>({from:oW(e,n,"left"),to:oW(t,n,"right")}))(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(o,s)}),n.selection.empty||n.setSelection(e0.near(n.doc.resolve(n.selection.from))),o&&n.ensureMarks(o),n.scrollIntoView(),t(n)}return!0},oJ=()=>({commands:e})=>e.keyboardShortcut("Enter"),oG=()=>({state:e,dispatch:t})=>tk(e,t);function oX(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function oY(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:oX(t[r])?t[r].test(e[r]):t[r]===e[r])}function oQ(e,t,n={}){return e.find(e=>e.type===t&&oY(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function oZ(e,t,n={}){return!!oQ(e,t,n)}function o0(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(e=>e.type===t)||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!oQ([...r.node.marks],t,n))return;let o=r.index,i=e.start()+r.offset,s=o+1,l=i+r.node.nodeSize;for(;o>0&&oZ([...e.parent.child(o-1).marks],t,n);)o-=1,i-=e.parent.child(o).nodeSize;for(;s<e.parent.childCount&&oZ([...e.parent.child(s).marks],t,n);)l+=e.parent.child(s).nodeSize,s+=1;return{from:i,to:l}}function o1(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}let o2=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=o1(e,r.schema),{doc:s,selection:l}=n,{$from:a,from:c,to:d}=l;if(o){let e=o0(a,i,t);if(e&&e.from<=c&&e.to>=d){let t=e0.create(s,e.from,e.to);n.setSelection(t)}}return!0},o5=e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function o4(e){return e instanceof e0}function o3(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function o6(e,t=null){if(!t)return null;let n=eX.atStart(e),r=eX.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let o=n.from,i=r.to;return"all"===t?e0.create(e,o3(0,o,i),o3(e.content.size,o,i)):e0.create(e,o3(t,o,i),o3(t,o,i))}function o7(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function o8(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let o9=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};let s=()=>{(o8()||o7())&&r.dom.focus(),"undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!o8()&&!o7()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(i&&null===e&&!o4(n.state.selection))return s(),!0;let l=o6(o.doc,e)||n.state.selection,a=n.state.selection.eq(l);return i&&(a||o.setSelection(l),a&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},ie=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),it=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),ir=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&ir(r)}return e};function io(e){if("undefined"==typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return ir(new window.DOMParser().parseFromString(t,"text/html").body)}function ii(e){return"function"==typeof(null==e?void 0:e.nodesBetween)}function is(e,t,n){if(ii(e))return e;let r="object"==typeof e&&null!==e;n={slice:!0,parseOptions:{},...n};let o="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return p.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),is("",t,n)}if(o){if(n.errorOnInvalidContent){let r=!1,o="",i=new K({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,o="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?G.fromSchema(i).parseSlice(io(e),n.parseOptions):G.fromSchema(i).parse(io(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${o}`)})}let r=G.fromSchema(t);return n.slice?r.parseSlice(io(e),n.parseOptions).content:r.parse(io(e),n.parseOptions)}return is("",t,n)}function il(e){return!("type"in e)}function ia(e,t,n){let r=e.steps.length-1;if(r<t)return;let o=e.steps[r];if(!(o instanceof ex||o instanceof eS))return;let i=e.mapping.maps[r],s=0;i.forEach((e,t,n,r)=>{0===s&&(s=r)}),e.setSelection(eX.near(e.doc.resolve(s),n))}let ic=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){let o,l;n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a=e=>{i.emit("contentError",{editor:i,error:e,disableCollaboration:()=>{"collaboration"in i.storage&&"object"==typeof i.storage.collaboration&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{is(t,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(e){a(e)}try{var s;o=is(t,i.schema,{parseOptions:c,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:i.options.enableContentCheck})}catch(e){return a(e),!1}let{from:d,to:u}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,f=!0,m=il(o)?o.content:[o];if(m.forEach(e=>{e.check(),h=!!h&&e.isText&&0===e.marks.length,f=!!f&&e.isBlock}),d===u&&f){let{parent:e}=r.doc.resolve(d);!e.isTextblock||e.type.spec.code||e.childCount||(d-=1,u+=1)}if(h)l=Array.isArray(t)?t.map(e=>e.text||"").join(""):ii(t)?m.map(e=>{var t;return null!=(t=e.text)?t:""}).join(""):"object"==typeof t&&t&&t.text?t.text:t,r.insertText(l,d,u);else{l=p.from(m);let e=r.doc.resolve(d),t=e.node(),n=0===e.parentOffset,o=t.isText||t.isTextblock,i=t.content.size>0;n&&o&&i&&f&&(d=Math.max(0,d-1)),r.replaceWith(d,u,m)}n.updateSelection&&ia(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:l}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:l})}return!0};function id(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let iu=(e={})=>({tr:t,dispatch:n,editor:r})=>{let o,i,{pos:s,attrs:l,content:a,updateSelection:c=!0}=e,d=id((o="number"==typeof s?t.doc.resolve(s):s||t.selection.$from).parent.contentMatchAt(o.index()));if(!d)return!1;let u=Object.keys(d.spec.attrs||{}),h=l?Object.fromEntries(Object.entries(l).filter(([e])=>u.includes(e))):{};if(a){let e=is(a,r.schema);i=d.createAndFill(h,e)}else i=d.createAndFill(h);return!!i&&(n&&(t.insert(o.pos,i),c&&ia(t,t.steps.length-1,-1)),!0)},ih=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r=n instanceof e2,o;if(r){if(n.node.isTextblock||!eD(e.doc,n.from))return!1;o=n.from}else if(null==(o=eI(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(o);r&&n.setSelection(e2.create(n.doc,o-e.doc.resolve(o).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0})(e,t),ip=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r;if(n instanceof e2){if(n.node.isTextblock||!eD(e.doc,n.to))return!1;r=n.to}else if(null==(r=eI(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0})(e,t),im=()=>({state:e,dispatch:t})=>td(e,t),ig=()=>({state:e,dispatch:t})=>tg(e,t),iy=(e,t)=>{let n=e.resolve(t),r=n.nodeBefore,o=n.nodeAfter;return!!r&&!!o&&!r.type.spec.isolating&&!o.type.spec.isolating},iv=()=>({state:e,dispatch:t,tr:n})=>{try{let r=eI(e.doc,e.selection.$from.pos,-1);if(null==r||!iy(e.doc,r))return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},ib=()=>({state:e,dispatch:t,tr:n})=>{try{let r=eI(e.doc,e.selection.$from.pos,1);if(null==r||!iy(e.doc,r))return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},iw=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=tc(e,n);if(!r)return!1;let o=tf(r);return!!o&&tu(e,o,t)})(e,t),ik=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=tm(e,n);if(!r)return!1;let o=tv(r);return!!o&&tu(e,o,t)})(e,t);function ix(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}let iS=e=>({editor:t,view:n,tr:r,dispatch:o})=>{let i=(function(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"===s&&(s=" ");for(let e=0;e<i.length-1;e+=1){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))o8()||ix()?o=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=i.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,l))});return null==a||a.steps.forEach(e=>{let t=e.map(r.mapping);t&&o&&r.maybeStep(t)}),!0};function iM(e,t,n={}){let{from:r,to:o,empty:i}=e.selection,s=t?oH(t,e.schema):null,l=[];e.doc.nodesBetween(r,o,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);l.push({node:e,from:n,to:i})});let a=o-r,c=l.filter(e=>!s||s.name===e.node.type.name).filter(e=>oY(e.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=a}let iC=(e,t={})=>({state:n,dispatch:r})=>!!iM(n,oH(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&eO(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)})(n,r),iO=()=>({state:e,dispatch:t})=>tS(e,t),iA=e=>({state:t,dispatch:n})=>(function(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,t=>t.childCount>0&&t.firstChild.type==e);return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new eS(i-1,s,i,s,new b(p.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new N(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));let l=eO(r);if(null==l)return!1;o.lift(r,l);let a=o.doc.resolve(o.mapping.map(i,-1)-1);return eD(o.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&o.join(a.pos),t(o.scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,a=n.endIndex==o.childCount,c=i.node(-1),d=i.index(-1);if(!c.canReplace(d+ +!l,d+1,s.content.append(a?p.empty:p.from(o))))return!1;let u=i.pos,h=u+s.nodeSize;return r.step(new eS(u-!!l,h+ +!!a,u+1,h-1,new b((l?p.empty:p.from(o.copy(p.empty))).append(a?p.empty:p.from(o.copy(p.empty))),+!l,+!a),+!l)),t(r.scrollIntoView()),!0}(t,n,i)))}})(oH(e,t.schema))(t,n),iE=()=>({state:e,dispatch:t})=>tb(e,t);function iT(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function iN(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}let iR=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null,l=iT("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(i=oH(e,r.schema)),"mark"===l&&(s=o1(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{i&&i===e.type&&(a=!0,o&&n.setNodeMarkup(r,void 0,iN(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(i=>{s===i.type&&(a=!0,o&&n.addMark(r,r+e.nodeSize,s.create(iN(i.attrs,t))))})})}),a},iD=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),iP=()=>({tr:e,dispatch:t})=>{if(t){let t=new e4(e.doc);e.setSelection(t)}return!0},iI=()=>({state:e,dispatch:t})=>tp(e,t),iL=()=>({state:e,dispatch:t})=>ty(e,t),i_=()=>({state:e,dispatch:t})=>((e,t)=>{let{$from:n,to:r}=e.selection,o,i=n.sharedDepth(r);return 0!=i&&(o=n.before(i),t&&t(e.tr.setSelection(e2.create(e.doc,o))),!0)})(e,t),ij=()=>({state:e,dispatch:t})=>tA(e,t),iz=()=>({state:e,dispatch:t})=>tO(e,t);function iB(e,t,n={},r={}){return is(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}let i$=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:s,commands:l})=>{let{doc:a}=i;if("full"!==r.preserveWhitespace){let l=iB(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});if(s){let e=il(l)?l.content:[l];i.replaceWith(0,a.content.size,e).setMeta("preventUpdate",!n)}return!0}return s&&i.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})};function iF(e,t){let n=o1(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,e=>{s.push(...e.marks)});let l=s.find(e=>e.type.name===n.name);return l?{...l.attrs}:{}}function iV(e,t){let n=new eJ(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function iH(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function iU(e,t,n){return void 0===e.config[t]&&e.parent?iU(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?iU(e.parent,t,n):null}):e.config[t]}function iq(e){return e.map(e=>{let t=iU(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...iq(t())]:e}).flat(10)}function iW(e,t){let n=eo.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function iK(e,t){let n=new Map;for(let t of e){var r;let e=null!=(r=n.get(t.type))?r:new Map;e.set(t.name,t),n.set(t.type,e)}return[...Object.values(t.nodes),...Object.values(t.marks)].flatMap(e=>{var t;return Object.entries(null!=(t=e.spec.attrs)?t:{}).map(([t,r])=>{var o;let i=null==(o=n.get(e.name))?void 0:o.get(t),s=Object.hasOwn(r,"default");return{type:e.name,name:t,attribute:{rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,...null==i?void 0:i.attribute,default:r.default,isRequired:!s,validate:r.validate}}})})}let iJ={content:"string",marks:"string",group:"string",inline:"boolean",atom:"boolean",selectable:"boolean",draggable:"boolean",code:"boolean",whitespace:["pre","normal"],definingAsContext:"boolean",definingForContent:"boolean",defining:"boolean",isolating:"boolean",linebreakReplacement:"boolean"},iG={inclusive:"boolean",excludes:"string",group:"string",spanning:"boolean",code:"boolean"};function iX(e,t,n,r){return{...Object.fromEntries(Object.entries(t).filter(([e])=>"attrs"!==e&&!Object.hasOwn(r,e))),...Object.fromEntries(Object.entries(r).flatMap(([t,r])=>{let o=n[t];if(void 0===o)return[];if(!("string"==typeof r?typeof o===r:"string"==typeof o&&r.includes(o)))throw RangeError(`Invalid schemaSpec field '${e}.${t}'`);return[[t,o]]})),attrs:n.attrs}}function iY(e,t,n){for(let r of Object.keys(t))if(!Object.hasOwn(e,r))throw RangeError(`schemaSpec requires a local ${n} extension named '${r}'`);for(let r of Object.keys(e))if(!Object.hasOwn(t,r))throw RangeError(`Local ${n} extension '${r}' is not in schemaSpec`)}function iQ(e){return Array.from(new Set(e.filter((t,n)=>e.indexOf(t)!==n)))}function iZ(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function i0(e){let t=[],{nodeExtensions:n,markExtensions:r}=iZ(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(e=>"text"!==e.name).map(e=>e.name),l=r.map(e=>e.name),a=[...s,...l];return e.forEach(e=>{let n=iU(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:o});n&&n().forEach(e=>{(Array.isArray(e.types)?e.types:"*"===e.types?a:"nodes"===e.types?s:"marks"===e.types?l:[]).forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})})})})}),o.forEach(e=>{let n=iU(e,"addAttributes",{name:e.name,options:e.options,storage:e.storage});n&&Object.entries(n()).forEach(([n,r])=>{let o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&(null==o?void 0:o.default)===void 0&&delete o.default,t.push({type:e.name,name:n,attribute:o})})}),t}function i1(e){return"function"==typeof e}function i2(e,t,...n){return i1(e)?t?e.bind(t)(...n):e(...n):e}function i5(e){let t=[],n=function(e){let t=[],n="",r=!1,o=!1,i=0,s=e.length;for(let l=0;l<s;l+=1){let s=e[l];if("'"===s&&!o){r=!r,n+=s;continue}if('"'===s&&!r){o=!o,n+=s;continue}if(!r&&!o){if("("===s){i+=1,n+=s;continue}if(")"===s&&i>0){i-=1,n+=s;continue}if(";"===s&&0===i){t.push(n),n="";continue}}n+=s}return n&&t.push(n),t}(e||""),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],o=r.indexOf(":");if(-1===o)continue;let i=r.slice(0,o).trim(),s=r.slice(o+1).trim();i&&s&&t.push([i,s])}return t}function i4(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if("__proto__"===e)return void Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter(e=>!o.includes(e));n[e]=[...o,...i].join(" ")}else if("style"===e){let r=new Map([...i5(n[e]),...i5(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function i3(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>i4(e,t),{})}function i6(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let o=t.reduce((e,t)=>{var r;let o=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==o?e:{...e,[t.name]:o}},{});return{...r,...o}}}}function i7(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function i8(e){var t,n;let r={};return!(null==e||null==(t=e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(null==e||null==(n=e.attribute)?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function i9(e,t,n=i0(e)){var r;let{nodeExtensions:o,markExtensions:i}=iZ(e);return{topNode:null==(r=o.find(e=>iU(e,"topNode")))?void 0:r.name,nodes:Object.fromEntries(o.map(r=>{let o=n.filter(e=>e.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:t},s=i7({...e.reduce((e,t)=>{let n=iU(t,"extendNodeSchema",i);return{...e,...n?n(r):{}}},{}),content:i2(iU(r,"content",i)),marks:i2(iU(r,"marks",i)),group:i2(iU(r,"group",i)),inline:i2(iU(r,"inline",i)),atom:i2(iU(r,"atom",i)),selectable:i2(iU(r,"selectable",i)),draggable:i2(iU(r,"draggable",i)),code:i2(iU(r,"code",i)),whitespace:i2(iU(r,"whitespace",i)),linebreakReplacement:i2(iU(r,"linebreakReplacement",i)),defining:i2(iU(r,"defining",i)),isolating:i2(iU(r,"isolating",i)),attrs:Object.fromEntries(o.map(i8))}),l=i2(iU(r,"parseHTML",i));l&&(s.parseDOM=l.map(e=>i6(e,o)));let a=iU(r,"renderHTML",i);a&&(s.toDOM=e=>a({node:e,HTMLAttributes:i3(e,o)}));let c=iU(r,"renderText",i);return c&&(s.toText=c),[r.name,s]})),marks:Object.fromEntries(i.map(r=>{let o=n.filter(e=>e.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:t},s=i7({...e.reduce((e,t)=>{let n=iU(t,"extendMarkSchema",i);return{...e,...n?n(r):{}}},{}),inclusive:i2(iU(r,"inclusive",i)),excludes:i2(iU(r,"excludes",i)),group:i2(iU(r,"group",i)),spanning:i2(iU(r,"spanning",i)),code:i2(iU(r,"code",i)),attrs:Object.fromEntries(o.map(i8))}),l=i2(iU(r,"parseHTML",i));l&&(s.parseDOM=l.map(e=>i6(e,o)));let a=iU(r,"renderHTML",i);return a&&(s.toDOM=e=>a({mark:e,HTMLAttributes:i3(e,o)})),[r.name,s]}))}}function se(e){return e.sort((e,t)=>{let n=iU(e,"priority")||100,r=iU(t,"priority")||100;return n>r?-1:+(n<r)})}function st(e){let t=se(iq(e)),n=iQ(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),t}function sn(e,t,n){let{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{},l="";return e.nodesBetween(r,o,(e,n,a,c)=>{e.isBlock&&n>r&&(l+=i);let d=null==s?void 0:s[e.type.name];if(d)return a&&(l+=d({node:e,pos:n,parent:a,index:c,range:t})),!1;if(e.isText){var u;l+=null==e||null==(u=e.text)?void 0:u.slice(Math.max(r,n)-n,o-n)}}),l}function sr(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function so(e,t){let n=iT("string"==typeof t?t:t.name,e.schema);if("node"===n){let n=oH(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,e=>{i.push(e)});let s=i.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}return"mark"===n?iF(e,t):{}}function si(e){let{mapping:t,steps:n}=e,r=[],o=t.invert();t.maps.forEach((e,i)=>{let s=[];if(e.ranges.length)e.forEach((e,t)=>{s.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;s.push({from:e,to:t})}let l=t.slice(i);s.forEach(({from:e,to:t})=>{let n=l.map(e,-1),i=l.map(t),s=o.map(n,-1),a=o.map(i);r.push({oldRange:{from:s,to:a},newRange:{from:n,to:i}})})});let i=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(r);return 1===i.length?i:i.filter((e,t)=>!i.filter((e,n)=>n!==t).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function ss(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let o=o0(n.resolve(e),t.type);o&&r.push({mark:t,...o})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function sl(e,t){return t.nodes[e]||t.marks[e]||null}function sa(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function sc(e,t,n={}){let{empty:r,ranges:o}=e.selection,i=t?o1(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!i||i.name===e.type.name).find(e=>oY(e.attrs,n,{strict:!1}));let s=0,l=[];if(o.forEach(({$from:t,$to:n})=>{let r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,(e,t)=>{if(i&&e.inlineContent&&!e.type.allowsMarkType(i))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),a=Math.min(o,t+e.nodeSize);s+=a-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:a})))})}),0===s)return!1;let a=l.filter(e=>!i||i.name===e.mark.type.name).filter(e=>oY(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=l.filter(e=>!i||e.mark.type!==i&&e.mark.type.excludes(i)).reduce((e,t)=>e+t.to-t.from,0);return(a>0?a+c:a)>=s}function sd(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function su(e,t){let{nodeExtensions:n}=iZ(t),r=n.find(t=>t.name===e);if(!r)return!1;let o=i2(iU(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function sh(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if("hardBreak"===e.type.name)return!0;if(e.isText){var r;return!/\S/.test(null!=(r=e.text)?r:"")}}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(sh(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function sp(e){return e instanceof e2}var sf=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function sm(e,t){let n=t.mapping.mapResult(e.position);return{position:new sf(n.pos),mapResult:n}}function sg(e){return new sf(e)}let sy=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let{selection:i}=n,{empty:s,ranges:l}=i,a=o1(e,r.schema);if(o)if(s){let e=iF(r,a);n.addStoredMark(a.create({...e,...t}))}else l.forEach(e=>{let o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,(e,r)=>{let s=Math.max(r,o),l=Math.min(r+e.nodeSize,i);e.marks.find(e=>e.type===a)?e.marks.forEach(e=>{a===e.type&&n.addMark(s,l,a.create({...e.attrs,...t}))}):n.addMark(s,l,a.create(t))})});return function(e,t,n){let{selection:r}=t,o=null;if(o4(r)&&(o=r.$cursor),o){var i;let t=null!=(i=e.storedMarks)?i:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:s}=r;return s.some(({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(o)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));o=t&&i}return!o}),o})}(r,n,a)},sv=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),sb=(e,t={})=>({state:n,dispatch:r,chain:o})=>{let i,s=oH(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock)?o().command(({commands:e})=>!!tE(s,{...i,...t})(n)||e.clearNodes()).command(({state:e})=>tE(s,{...i,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},sw=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=o3(e,0,n.content.size),o=e2.create(n,r);t.setSelection(o)}return!0},sk=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i,s,{selection:l}=r;return"number"==typeof t?(i=t,s=t):t&&"from"in t&&"to"in t?(i=t.from,s=t.to):(i=l.from,s=l.to),o&&n.doc.nodesBetween(i,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},sx=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=e0.atStart(n).from,s=e0.atEnd(n).to,l=o3(r,i,s),a=o3(o,i,s),c=e0.create(n,l,a);t.setSelection(c)}return!0},sS=e=>({state:t,dispatch:n})=>(function(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,t=>t.childCount>0&&t.firstChild.type==e);if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let l=i.parent,a=l.child(s-1);if(a.type!=e)return!1;if(n){let r=a.lastChild&&a.lastChild.type==l.type,o=p.from(r?e.create():null),s=new b(p.from(e.create(null,p.from(l.type.create(null,o)))),r?3:1,0),c=i.start,d=i.end;n(t.tr.step(new eS(c-(r?3:1),d,c,d,s,1,!0)).scrollIntoView())}return!0}})(oH(e,t.schema))(t,n);function sM(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}let sC=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{let{selection:i,doc:s}=t,{$from:l,$to:a}=i,c=sa(o.extensionManager.attributes,l.node().type.name,l.node().attrs);if(i instanceof e2&&i.node.isBlock)return!!l.parentOffset&&!!eR(s,l.pos)&&(r&&(e&&sM(n,o.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let d=a.parentOffset===a.parent.content.size,u=0===l.depth?void 0:id(l.node(-1).contentMatchAt(l.indexAfter(-1))),h=d&&u?[{type:u,attrs:c}]:void 0,p=i instanceof e0&&!i.empty?tr.create({doc:t.doc,selection:i}).tr.deleteSelection():null,f=p?p.doc:t.doc,m=p?p.mapping.map(l.pos):l.pos,g=eR(f,m,1,h);if(!h&&!g&&eR(f,m,1,u?[{type:u}]:void 0)&&(g=!0,h=u?[{type:u,attrs:c}]:void 0),r){if(g){let e=t.steps.length;if(i instanceof e0&&t.deleteSelection(),t.split(t.mapping.slice(e).map(l.pos),1,h),u&&!d&&!l.parentOffset&&l.parent.type!==u){let n=t.mapping.slice(e).map(l.before()),r=t.doc.resolve(n);l.node(-1).canReplaceWith(r.index(),r.index()+1,u)&&t.setNodeMarkup(t.mapping.slice(e).map(l.before()),u)}}e&&sM(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return g},sO=(e,t={})=>({tr:n,state:r,dispatch:o,editor:i})=>{let s=oH(e,r.schema),{$from:l,$to:a}=r.selection,c=r.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(a))return!1;let d=l.node(-1);if(d.type!==s)return!1;let u=i.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){var h;let e=p.empty,r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=p.from(l.node(t).copy(e));let o=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,i={...sa(u,l.node().type.name,l.node().attrs),...t},a=(null==(h=s.contentMatch.defaultType)?void 0:h.createAndFill(i))||void 0;e=e.append(p.from(s.createAndFill(null,a)||void 0));let c=l.before(l.depth-(r-1));n.replace(c,l.after(-o),new b(e,4-r,0));let d=-1;n.doc.nodesBetween(c,n.doc.content.size,(e,t)=>{if(d>-1)return!1;e.isTextblock&&0===e.content.size&&(d=t+1)}),d>-1&&n.setSelection(e0.near(n.doc.resolve(d))),n.scrollIntoView()}return!0}let f=a.pos===l.end()?d.contentMatchAt(0).defaultType:null,m={...sa(u,d.type.name,d.attrs),...t},g={...sa(u,l.node().type.name,l.node().attrs),...t},y=0===l.parentOffset&&0===l.index(-1),v=l.before(-1);n.delete(l.pos,a.pos);let w=y?d.attrs:m,k=f?[{type:s,attrs:w},{type:f,attrs:g}]:[{type:s,attrs:w}];if(!eR(n.doc,l.pos,2))return!1;if(o){let{selection:e,storedMarks:t}=r,{splittableMarks:s}=i.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,k).scrollIntoView(),y&&n.setNodeMarkup(v,void 0,m),!a||!o)return!0;let c=a.filter(e=>s.includes(e.type.name));n.ensureMarks(c)}return!0};function sA(e,t,n){if(!e.validContent(t))return null;try{return e.create(n,t)}catch{return null}}function sE(e,t){if(0===e.pendingContent.length)return!0;let n=sA(t,p.from(e.pendingContent));return!!n&&(e.items.push(n),e.pendingContent=[],!0)}function sT(e,t){let n=null;return e.descendants((e,r)=>e!==t||(n=r,!1)),n}function sN(e){return e&&"1"!==e?e:null}let sR=(e,t)=>{var n,r;let o=iH(e=>e.type===t)(e.selection);if(!o)return!0;let i=e.doc.resolve(Math.max(0,o.pos-1)).before(o.depth);if(void 0===i)return!0;let s=e.doc.nodeAt(i);return!(o.node.type===(null==s?void 0:s.type)&&eD(e.doc,o.pos))||(n=o.node.attrs.type,r=null==s?void 0:s.attrs.type,sN(n)!==sN(r)||(e.join(o.pos),!0))},sD=(e,t)=>{var n,r;let o=iH(e=>e.type===t)(e.selection);if(!o)return!0;let i=e.doc.resolve(o.start).after(o.depth);if(void 0===i)return!0;let s=e.doc.nodeAt(i);return!(o.node.type===(null==s?void 0:s.type)&&eD(e.doc,i))||(n=o.node.attrs.type,r=null==s?void 0:s.attrs.type,sN(n)!==sN(r)||(e.join(i),!0))},sP=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:l,chain:a,commands:c,can:d})=>{let{extensions:u,splittableMarks:h}=o.extensionManager,f=oH(e,s.schema),m=oH(t,s.schema),{selection:g,storedMarks:y}=s,{$from:v,$to:b}=g,w=v.blockRange(b),k=y||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;let x=iH(e=>su(e.type.name,u))(g),S=0===g.from&&g.to===s.doc.content.size,M=s.doc.content.content,C=1===M.length?M[0]:null,O=S&&C&&su(C.type.name,u)?{node:C,pos:0,depth:0}:null,A=null!=x?x:O,E=!!x&&w.depth>=1&&w.depth-x.depth<=1,T=!!O;if((E||T)&&A){if(A.node.type===f)return S&&T?a().command(({tr:e,dispatch:t})=>{let n=function(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),o=t.resolve(n.nodeSize-1);return e0.between(r,o)}(e);return!!n&&(e.setSelection(n),t&&t(e),!0)}).liftListItem(m).run():c.liftListItem(m);if(su(A.node.type.name,u)&&f.validContent(A.node.content))return a().command(()=>(i.setNodeMarkup(A.pos,f),!0)).command(()=>sR(i,f)).command(()=>sD(i,f)).run();if(su(A.node.type.name,u)){var N;let e=null==(N=A.node.firstChild)?void 0:N.type;if(e&&e!==m){let e=function e(t,n){let r=[];for(let o=0;o<t.childCount;o+=1){let i=function(e,t,n){let r={items:[],pendingContent:[]};for(let i=0;i<e.childCount;i+=1){var o;let s=e.child(i);if(!(t.isListNode(s)?function(e,t,n,r){let o=r(e,n);if(!o)return!1;let i=sA(n.listType,p.from(o),e.attrs);return!!i&&(n.itemType.validContent(p.from([...t.pendingContent,i]))?(t.pendingContent.push(i),!0):!!sE(t,n.itemType)&&(t.items.push(...o),!0))}(s,r,t,n):(o=t.itemType).validContent(p.from([...r.pendingContent,s]))?(r.pendingContent.push(s),!0):!!sE(r,o)&&!!o.validContent(p.from(s))&&(r.pendingContent.push(s),!0)))return null}return sE(r,t.itemType)?r.items:null}(t.child(o),n,e);if(!i)return null;r.push(...i)}return r}(A.node,{listType:f,itemType:m,isListNode:e=>su(e.type.name,u)}),t=e?p.from(e):null;return!!t&&!!f.validContent(t)&&a().command(()=>{let e,{$anchor:n,$head:o}=i.selection,s=n.parent,l=o.parent,a=n.parentOffset,c=o.parentOffset;try{e=f.create(r,t)}catch{return!1}if(i.replaceWith(A.pos,A.pos+A.node.nodeSize,e),s.inlineContent&&l.inlineContent){let t=sT(e,s),n=sT(e,l);if(null!==t&&null!==n){let e=A.pos+t+2+a,r=A.pos+n+2+c;i.setSelection(e0.create(i.doc,e,r))}}return!0}).command(()=>sR(i,f)).command(()=>sD(i,f)).run()}}}return n&&k&&l?a().command(()=>{let e=d().wrapInList(f,r),t=k.filter(e=>h.includes(e.type.name));return i.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(f,r).command(()=>sR(i,f)).command(()=>sD(i,f)).run():a().command(()=>!!d().wrapInList(f,r)||c.clearNodes()).wrapInList(f,r).command(()=>sR(i,f)).command(()=>sD(i,f)).run()},sI=(e,t={},n={})=>({state:r,commands:o})=>{let{extendEmptyMarkRange:i=!1}=n,s=o1(e,r.schema);return sc(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},sL=(e,t,n={})=>({state:r,commands:o})=>{let i,s=oH(e,r.schema),l=oH(t,r.schema),a=iM(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(i=r.selection.$anchor.parent.attrs),a)?o.setNode(l,i):o.setNode(s,{...i,...n})},s_=(e,t={})=>({state:n,commands:r})=>{let o=oH(e,n.schema);return iM(n,o,t)?r.lift(o):r.wrapIn(o,t)},sj=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let o,i=n[r];if(i.spec.isInputRules&&(o=i.getState(e))){if(t){let t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){let n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},sz=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:o=!1}=e,{selection:i}=t,{empty:s,ranges:l}=i;if(s)return!0;let{nonClearableMarks:a}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>o||!a.includes(e.name));l.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},sB=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let{extendEmptyMarkRange:i=!1}=t,{selection:s}=n,l=o1(e,r.schema),{$from:a,empty:c,ranges:d}=s;if(!o)return!0;if(c&&i){var u;let{from:e,to:t}=s,r=o0(a,l,null==(u=a.marks().find(e=>e.type===l))?void 0:u.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,l)}else d.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,l)});return n.removeStoredMark(l),!0},s$=e=>({tr:t,state:n,dispatch:r})=>{let o,i,{selection:s}=n;return"number"==typeof e?(o=e,i=e):e&&"from"in e&&"to"in e?(o=e.from,i=e.to):(o=s.from,i=s.to),r&&t.doc.nodesBetween(o,i,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},sF=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null,l=iT("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(i=oH(e,r.schema)),"mark"===l&&(s=o1(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{let l,c,d,u,h=e.$from.pos,p=e.$to.pos;n.selection.empty?r.doc.nodesBetween(h,p,(e,t)=>{i&&i===e.type&&(a=!0,d=Math.max(t,h),u=Math.min(t+e.nodeSize,p),l=t,c=e)}):r.doc.nodesBetween(h,p,(e,r)=>{r<h&&i&&i===e.type&&(a=!0,d=Math.max(r,h),u=Math.min(r+e.nodeSize,p),l=r,c=e),r>=h&&r<=p&&(i&&i===e.type&&(a=!0,o&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(i=>{if(s===i.type&&(a=!0,o)){let o=Math.max(r,h),l=Math.min(r+e.nodeSize,p);n.addMark(o,l,s.create({...i.attrs,...t}))}}))}),c&&(void 0!==l&&o&&n.setNodeMarkup(l,void 0,{...c.attrs,...t}),s&&c.marks.length&&c.marks.forEach(e=>{s===e.type&&o&&n.addMark(d,u,s.create({...e.attrs,...t}))}))}),a},sV=new tl("__tiptap_decorations__"),sH=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(sV,{type:"force",name:e}),!0),sU=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&eA(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}})(oH(e,n.schema),t)(n,r),sq=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let l=r?n.tr:null;return!!function(e,t,n,r=null){let o=!1,i=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=s.resolve(t.start-2);i=new N(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new N(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let l=eA(i,n,r,t);return!!l&&(e&&function(e,t,n,r,o){let i=p.empty;for(let e=n.length-1;e>=0;e--)i=p.from(n[e].type.create(n[e].attrs,i));e.step(new eS(t.start-2*!!r,t.end,t.start,t.end,new b(i,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let l=n.length-s,a=t.start+n.length-2*!!r,c=t.parent;for(let n=t.startIndex,r=t.endIndex,o=!0;n<r;n++,o=!1)!o&&eR(e.doc,a,l)&&(e.split(a,l),a+=2*l),a+=c.child(n).nodeSize}(e,t,l,o,n),!0)}(l,s,e,t)&&(r&&r(l.scrollIntoView()),!0)}})(oH(e,n.schema),t)(n,r);var sW=((e,t)=>{let n={};for(var r in e)c(n,r,{get:e[r],enumerable:!0});return t||c(n,Symbol.toStringTag,{value:"Module"}),n})({blur:()=>o_,clearContent:()=>oj,clearNodes:()=>oz,command:()=>oB,createParagraphNear:()=>o$,cut:()=>oF,deleteCurrentNode:()=>oV,deleteNode:()=>oU,deleteRange:()=>oq,deleteSelection:()=>oK,enter:()=>oJ,exitCode:()=>oG,extendMarkRange:()=>o2,first:()=>o5,focus:()=>o9,forEach:()=>ie,insertContent:()=>it,insertContentAt:()=>ic,insertDefaultBlock:()=>iu,joinBackward:()=>im,joinDown:()=>ip,joinForward:()=>ig,joinItemBackward:()=>iv,joinItemForward:()=>ib,joinTextblockBackward:()=>iw,joinTextblockForward:()=>ik,joinUp:()=>ih,keyboardShortcut:()=>iS,lift:()=>iC,liftEmptyBlock:()=>iO,liftListItem:()=>iA,newlineInCode:()=>iE,resetAttributes:()=>iR,scrollIntoView:()=>iD,selectAll:()=>iP,selectNodeBackward:()=>iI,selectNodeForward:()=>iL,selectParentNode:()=>i_,selectTextblockEnd:()=>ij,selectTextblockStart:()=>iz,setContent:()=>i$,setMark:()=>sy,setMeta:()=>sv,setNode:()=>sb,setNodeSelection:()=>sw,setTextDirection:()=>sk,setTextSelection:()=>sx,sinkListItem:()=>sS,splitBlock:()=>sC,splitListItem:()=>sO,toggleList:()=>sP,toggleMark:()=>sI,toggleNode:()=>sL,toggleWrap:()=>s_,undoInputRule:()=>sj,unsetAllMarks:()=>sz,unsetMark:()=>sB,unsetTextDirection:()=>s$,updateAttributes:()=>sF,updateDecorations:()=>sH,wrapIn:()=>sU,wrapInList:()=>sq});let sK=new WeakMap;var sJ=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};let sG=void 0!==oP&&!1;function sX(e,t){let n=[],r=new Set;for(let o of e)"widget"===o.kind&&"widget"===o.kind&&r.add(o.key),n.push(o.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function sY({position:e,from:t,to:n,docSize:r}){return!(e<t)&&(e<n||e===n&&n===r)}function sQ(e){var t;let n=null==(t=e.spec)?void 0:t.key;return"string"==typeof n?n:void 0}function sZ(e){return"attr"===e.jsonID}function s0(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=null==e?void 0:e.key;"string"==typeof t&&r.delete(t)}})}function s1(e,t){let n=Object.values(t).flatMap(e=>e.find());return rV.create(e,n)}function s2(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}let s5=new Set;var s4=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=sV.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>(function(e,t){var n;switch(null!=(n=t.update)?n:"document"){case"document":if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}})(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var e,t;return null!=(e=null==(t=sV.getState(this.editor.state))?void 0:t.widgetKeys)?e:s5}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new to({key:sV,state:{init:(e,n)=>{let r={},o={};for(let{name:e,spec:i}of t){let{set:t,widgetKeys:s}=this.buildFullSet(e,i,n);r[e]=t,o[e]=s}let i={decorationSetsByExtension:r,widgetKeysByExtension:o,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:s2(o)};return this.warnDuplicateWidgetKeys(i),i},apply:(n,r,o,i)=>{let s=n.getMeta(sV),l=(null==s?void 0:s.type)==="force"&&!s.name,a=(null==s?void 0:s.type)==="force"?s.name:void 0,c={},d={},u=new Set;return(!function(e,t){var n,r;sK.set(e,(null!=(n=sK.get(e))?n:0)+1);try{return t()}finally{let t=(null!=(r=sK.get(e))?r:1)-1;t>0?sK.set(e,t):sK.delete(e)}}(e,()=>{for(let{name:h,spec:p}of t){var s;let t=l||a===h;if(s={editor:e,tr:n,oldState:o,newState:i},t||"manual"!==p.update&&(p.shouldUpdate?p.shouldUpdate(s):s.tr.docChanged))if("changedRanges"===p.update&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(h,p,r,n,i);c[h]=e.set,d[h]=e.widgetKeys,u.add(h)}else{let{set:e,widgetKeys:t}=this.buildFullSet(h,p,i);c[h]=e,d[h]=t,u.add(h)}else{let e=function(e,t,n){var r,o;let i=null!=(r=t.decorationSetsByExtension[e])?r:rV.empty,s=new Set(null!=(o=t.widgetKeysByExtension[e])?o:[]);return{set:s0(i,n.mapping,n.doc,s),widgetKeys:s}}(h,r,n);c[h]=e.set,d[h]=e.widgetKeys}}}),0!==u.size||n.docChanged)?{decorationSetsByExtension:c,widgetKeysByExtension:d,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:c,recomputedNames:u}),widgetKeys:s2(d)}:r}},props:{decorations(e){var t,n;return null!=(t=null==(n=sV.getState(e))?void 0:n.mergedDecorationSet)?t:rV.empty}}})}applyChangedRangesRecompute(e,t,n,r,o){let i=function(e,t){if(e.steps.some(e=>{let t;return t=!1,e.getMap().forEach(()=>{t=!0}),!(t||sZ(e))&&("number"!=typeof e.from||"number"!=typeof e.to)}))return{type:"full"};let n=si(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!sZ(t))return;let o=e.mapping.slice(r);n.push({from:o.map(t.pos,-1),to:o.map(t.pos+1)})});let r=[];for(let e of n){let n=function(e,t){let n=null,r=0,o=0;for(let i=0;i<e.childCount&&!(o>t.to);i+=1){let s=o+e.child(i).nodeSize;s>=t.from&&(null===n&&(n=o),r=s),o=s}return null===n?null:{from:n,to:r}}(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let o=[];for(let e of r){let t=o[o.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):o.push({...e})}return{type:"ranges",ranges:o}}(r,o.doc);return"full"===i.type?this.buildFullSet(e,t,o):this.rebuildRanges(e,t,n,r,o,i.ranges)}rebuildRanges(e,t,n,r,o,i){var s,l;let a=null!=(s=n.decorationSetsByExtension[e])?s:rV.empty,c=new Set(null!=(l=n.widgetKeysByExtension[e])?l:[]),d=s0(a,r.mapping,r.doc,c),u=o.doc.content.size;for(let{from:n,to:r}of i){let i=d.find(n,r).filter(e=>sY({position:e.from,from:n,to:r,docSize:u}));for(let e of i){let t=sQ(e);t&&c.delete(t)}d=d.remove(i);let{decorations:s,widgetKeys:l}=sX(function({decorations:e,from:t,to:n,docSize:r,extensionName:o,warnedExtensions:i}){return e.filter(e=>!!sY({position:e.anchor,from:t,to:n,docSize:r})||e.anchor!==n&&(i.has(o)||(i.add(o),console.warn(`[tiptap warn]: Extension "${o}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}({decorations:this.runCreate(e,"createInRange",()=>t.createInRange({editor:this.editor,state:o,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:u,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);for(let e of(d=d.add(o.doc,s),l))c.add(e)}return{set:d,widgetKeys:c}}buildFullSet(e,t,n){let r=this.runCreate(e,"create",()=>t.create({editor:this.editor,state:n,view:this.mountedView}));var o=n.doc;let{decorations:i,widgetKeys:s}=sX(r,e);return{set:rV.create(o,i),widgetKeys:s}}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!sG)return;if(0===e.widgetKeys.size)return void this.warnedWidgetKeys.clear();let t=function(e){let t=new Map,n=new Map;for(let s of e.find()){var r,o,i;let e=sQ(s);if(!e)continue;let l=null!=(r=s.spec.extensionName)?r:"unknown",a=null!=(o=t.get(e))?o:new Set;a.add(l),t.set(e,a),n.set(e,(null!=(i=n.get(e))?i:0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>{var t;return(null!=(t=n.get(e))?t:0)>1})}(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(", ");console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${1===n.size?"":"s"} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return 1===n.length?t[n[0]]:s1(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:o}){return 1===e.length?r[e[0].name]:0===o.size?t.mergedDecorationSet.map(n.mapping,n.doc):s1(n.doc,r)}};function s3(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}var s6=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};let s7=(e,t)=>{if(oX(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,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 s8(e){var t;let{editor:n,from:r,to:o,text:i,rules:s,plugin:l,insertText:a}=e,{view:c}=n;if(c.composing)return!1;let d=c.state.doc.resolve(r);if(d.parent.type.spec.code||(null==(t=d.nodeBefore||d.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let u=((e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,o,i)=>{var s,l;let a=(null==(s=(l=e.type.spec).toText)?void 0:s.call(l,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?a:a.slice(0,Math.max(0,r-t))}),n})(d)+i;for(let e of s){let t=s7(u,e.find);if(t&&function(e,t,n){let r=t[0].length-n.length;if(r<=0)return!0;let o=e.parentOffset-r;return o>=0&&e.parent.textBetween(o,e.parentOffset)===t[0].slice(0,r)}(d,t,i)&&function(e){let{editor:t,from:n,to:r,text:o,rule:i,match:s,plugin:l,insertText:a}=e,{view:c}=t,{inputTransaction:d,tr:u}=function(e){let{editor:t,from:n,to:r,text:o,insertText:i}=e;if(!i)return{inputTransaction:null,tr:t.view.state.tr};let s=t.view.state.tr.insertText(o,n,r);return{inputTransaction:s,tr:tr.create({doc:s.doc,selection:s.selection,storedMarks:s.storedMarks}).tr}}({editor:t,from:n,to:r,text:o,insertText:a}),h=d?n+o.length:r,p=oI({state:c.state,transaction:u}),f={from:n-(s[0].length-o.length),to:h},{commands:m,chain:g,can:y}=new oL({editor:t,state:p});return null!==i.handler({state:p,range:f,match:s,commands:m,chain:g,can:y})&&!!u.steps.length&&(!(!d||(c.dispatch(d),c.state.doc.eq(d.doc)))||(u.setMeta(oT,!0),u.setMeta("inputRule",!0),i.undoable&&u.setMeta(l,{transform:u,from:n,to:h,text:o}),c.dispatch(u),!0))}({editor:n,from:r,to:o,text:i,rule:e,match:t,plugin:l,insertText:a}))return!0}return!1}var s9=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...i2(iU(this,"addOptions",{name:this.name}))}}get storage(){return{...i2(iU(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};return s3(t)&&s3(n)&&Object.keys(n).forEach(o=>{s3(n[o])&&s3(t[o])?r[o]=e(t[o],n[o]):r[o]=n[o]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},le=class e extends s9{constructor(...e){super(...e),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let o=r.marks();if(!o.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let i=o.find(e=>(null==e?void 0:e.type.name)===t.name);return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},lt=class{constructor(e){this.find=e.find,this.handler=e.handler}};let ln=null;var lr=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=st(e),this.hasSchemaSpec=void 0!==t.options.schemaSpec,this.schema=function(e,t,n){var r;let o,i;if(void 0===n)return new K(i9(e,t));let s=iQ(e.filter(e=>"extension"!==e.type).map(e=>e.name));if(s.length)throw RangeError(`Duplicate local schema types: ${s.join(", ")}`);let l=new K(n);return new K((r=i9(e,t,iK(i0(e),l)),iY(r.nodes,l.nodes,"node"),iY(r.marks,l.marks,"mark"),o=l.spec.nodes,i=l.spec.marks,l.spec.nodes.forEach((e,t)=>{o=o.update(e,iX(e,r.nodes[e],t,iJ))}),l.spec.marks.forEach((e,t)=>{i=i.update(e,iX(e,r.marks[e],t,iG))}),{topNode:l.topNodeType.name,nodes:o,marks:i}))}(this.extensions,t,t.options.schemaSpec),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=iU(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:sl(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=se([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:sl(t.name,this.schema)},r=[],o=iU(t,"addKeyboardShortcuts",n),i={};if("mark"===t.type&&iU(t,"exitable",n)&&(i.ArrowRight=()=>le.handleExit({editor:e,mark:t})),o){let t=Object.fromEntries(Object.entries(o()).map(([t,n])=>[t,()=>n({editor:e})]));i={...i,...t}}let s=new to({props:{handleKeyDown:om(i)}});r.push(s);let l=iU(t,"addInputRules",n);if(sd(t,e.options.enableInputRules)&&l){let t=l();if(t&&t.length){let n=function(e){let{editor:t,rules:n}=e,r=new to({state:{init:()=>null,apply(e,o,i){let s=e.getMeta(r);if(s)return s;let l=e.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=iW(p.from(e),i.schema));let{from:o}=l,s=o+e.length;s8({editor:t,from:o,to:s,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,i,s)=>s8({editor:t,from:o,to:i,text:s,rules:n,plugin:r,insertText:!0}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:o}=e.state.selection;o&&s8({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;let{$cursor:i}=e.state.selection;return!!i&&s8({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),o=Array.isArray(n)?n:[n];r.push(...o)}}let a=iU(t,"addPasteRules",n);if(sd(t,e.options.enablePasteRules)&&a){let t=a();if(t&&t.length){let n=function(e){let t,{editor:n,rules:r}=e,o=null,i=!1,s=!1,l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let a=({state:e,from:r,to:o,rule:i,pasteEvt:s})=>{let a=e.tr;if(function(e){let{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=e,{commands:a,chain:c,can:d}=new oL({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,o,(e,t)=>{var h,p,f,m;if((null==(h=e.type)||null==(h=h.spec)?void 0:h.code)||!(e.isText||e.isTextblock||e.isInline))return;let g=null!=(p=null!=(f=null==(m=e.content)?void 0:m.size)?f:e.nodeSize)?p:0,y=Math.max(r,t),v=Math.min(o,t+g);y>=v||((e,t,n)=>{if(oX(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(y-t,v-t,void 0,"￼"),i.find,s).forEach(e=>{if(void 0===e.index)return;let t=y+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},h=i.handler({state:n,range:o,match:e,commands:a,chain:c,can:d,pasteEvent:s,dropEvent:l});u.push(h)})}),u.every(e=>null!==e)}({editor:n,state:oI({state:e,transaction:a}),from:Math.max(r-1,0),to:o.b-1,rule:i,pasteEvent:s,dropEvent:t})&&a.steps.length){try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return n.on("destroy",()=>{ln===n&&(ln=null)}),r.map(e=>new to({view(e){let t=t=>{var r;(o=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(ln=n)},r=()=>{ln&&(ln=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(s=o===e.dom.parentElement,t=n,!s){let e=ln;(null==e?void 0:e.isEditable)&&setTimeout(()=>{if(e.isDestroyed)return;let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return l=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let o=t[0],c="paste"===o.getMeta("uiEvent")&&!i,d="drop"===o.getMeta("uiEvent")&&!s,u=o.getMeta("applyPasteRules"),h=!!u;if(!c&&!d&&!h)return;if(h){let{text:t}=u;"string"==typeof t||(t=iW(p.from(t),r.schema));let{from:n}=u,o=n+t.length;return a({rule:e,state:r,from:n,to:{b:o},pasteEvt:(e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t)})}let f=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof f&&m&&f!==m.b)return a({rule:e,state:r,from:f,to:m,pasteEvt:l})}}))}({editor:e,rules:t});r.push(...n)}}let c=iU(t,"addProseMirrorPlugins",n);if(c){let e=c();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;null==(e=this.decorationManager)||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=iU(e,"addDecorations",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:sl(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new s4({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){let e=i0(this.extensions);return this.hasSchemaSpec?iK(e,this.schema):e}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=iZ(this.extensions);return Object.fromEntries(t.filter(e=>!!iU(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=iU(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:oH(t.name,this.schema)});if(!r)return[];let o=r();return o?[t.name,(r,i,s,l,a)=>{let c=i3(r,n);return o({node:r,view:i,getPos:s,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:c})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return se([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:sl(n.name,this.schema)},o=iU(n,"dispatchTransaction",r);return o?t=>{o.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return se([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:sl(n.name,this.schema)},o=iU(n,"transformPastedHTML",r);return o?(t,n)=>{let i=e(t,n);return o.call(r,i)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=iZ(this.extensions);return Object.fromEntries(t.filter(e=>!!iU(e,"addMarkView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=iU(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:o1(t.name,this.schema)});return r?[t.name,(o,i,s)=>{let l=i3(o,n);return r()({mark:o,view:i,inline:s,editor:e,extension:t,HTMLAttributes:l,updateAttributes:t=>{!function(e,t,n={}){let{state:r}=t,{doc:o,tr:i}=r;o.descendants((t,r)=>{let o=i.mapping.map(r),s=i.mapping.map(r)+t.nodeSize,l=null;if(t.marks.forEach(t=>{if(t!==e)return!1;l=t}),!l)return;let a=!1;if(Object.keys(n).forEach(e=>{n[e]!==l.attrs[e]&&(a=!0)}),a){let t=e.type.create({...e.attrs,...n});i.removeMark(o,s,e.type),i.addMark(o,s,t)}}),i.docChanged&&t.view.dispatch(i)}(o,e,t)}})}]:[]}))}destroy(){var e;null==(e=this.decorationManager)||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:sl(e.name,this.schema)};if("mark"===e.type){var n,r;(null==(n=i2(iU(e,"keepOnSplit",t)))||n)&&this.splittableMarks.push(e.name),null==(r=i2(iU(e,"clearable",t)))||r||this.nonClearableMarks.push(e.name)}let o=iU(e,"onBeforeCreate",t),i=iU(e,"onCreate",t),s=iU(e,"onUpdate",t),l=iU(e,"onSelectionUpdate",t),a=iU(e,"onTransaction",t),c=iU(e,"onFocus",t),d=iU(e,"onBlur",t),u=iU(e,"onDestroy",t);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),u&&this.editor.on("destroy",u)})}};lr.resolve=st,lr.sort=se,lr.flatten=iq;var lo=class e extends s9{constructor(...e){super(...e),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}};let li=lo.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new to({key:new tl("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,i=sr(n),{blockSeparator:s}=this.options,l={...void 0!==s?{blockSeparator:s}:{},textSerializers:i};return[...o.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>sn(r,{from:e.pos,to:t.pos},l)).join(null!=s?s:"\n\n")}}})]}}),ls=lo.create({name:"commands",addCommands:()=>({...sW})}),ll=lo.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r;let o=()=>{var n,r,o;if(null!=(n=null==(r=this.editor.options.coreExtensionOptions)||null==(r=r.delete)||null==(o=r.filterTransaction)?void 0:o.call(r,e))?n:e.getMeta("y-sync$"))return;let i=iV(e.before,[e,...t]);si(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let o=r+n.nodeSize-2,s=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:i.mapping.map(r),newTo:i.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!s,editor:this.editor,transaction:e,combinedTransform:i})})});let s=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof ey){var r,o;let l=s.slice(n).map(t.from,-1),a=s.slice(n).map(t.to),c=s.invert().map(l,-1),d=s.invert().map(a),u=l>0&&(null==(r=i.doc.nodeAt(l-1))?void 0:r.marks.some(e=>e.eq(t.mark))),h=null==(o=i.doc.nodeAt(a))?void 0:o.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:l,to:a},partial:!!(h||u),editor:this.editor,transaction:e,combinedTransform:i})}})};null==(n=null==(r=this.editor.options.coreExtensionOptions)||null==(r=r.delete)?void 0:r.async)||n?setTimeout(o,0):o()}}),la=lo.create({name:"drop",addProseMirrorPlugins(){return[new to({key:new tl("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),lc=lo.create({name:"editable",addProseMirrorPlugins(){return[new to({key:new tl("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ld=new tl("focusEvents"),lu=lo.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new to({key:ld,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),lh=lo.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:o,$anchor:i}=n,{pos:s,parent:l}=i,a=i.parent.isTextblock&&s>0?t.doc.resolve(s-1):i,c=a.parent.type.spec.isolating,d=i.pos-i.parentOffset,u=c&&1===a.parent.childCount?d===i.pos:eX.atStart(r).from===s;return!!o&&!!l.type.isTextblock&&!l.textContent.length&&!!u&&(!u||"paragraph"!==i.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return o8()||ix()?o:r},addProseMirrorPlugins(){return[new to({key:new tl("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),o=e.some(e=>e.getMeta("preventClearDocument"));if(!r||o)return;let{empty:i,from:s,to:l}=t.selection,a=eX.atStart(t.doc).from,c=eX.atEnd(t.doc).to;if(i||s!==a||l!==c||!sh(n.doc))return;let d=n.tr,u=oI({state:n,transaction:d}),{commands:h}=new oL({editor:this.editor,state:u});if(h.clearNodes(),d.steps.length)return d}})]}}),lp=lo.create({name:"paste",addProseMirrorPlugins(){return[new to({key:new tl("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),lf=lo.create({name:"tabindex",addOptions:()=>({value:void 0}),addProseMirrorPlugins(){return[new to({key:new tl("tabindex"),props:{attributes:()=>{var e;return this.editor.isEditable||void 0!==this.options.value?{tabindex:null!=(e=this.options.value)?e:"0"}:{}}}})]}}),lm=lo.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=iZ(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute("dir");return t&&("ltr"===t||"rtl"===t||"auto"===t)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new to({key:new tl("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),lg=!1;var ly=class e{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(0===this.depth)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=n.isInline,l=this.pos+r+ +!i;if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;let a=this.resolvedPos.doc.resolve(l);if(!o&&!s&&a.depth<=this.depth)return;let c=new e(a,this.editor,o,o||s?n:null);o&&(c.actualDepth=this.depth+1),t.push(c)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let o=n[r];if(e[o]!==t[o])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;let o=Object.keys(t);return this.children.forEach(i=>{(!n||!(r.length>0))&&(i.node.type.name===e&&o.every(e=>t[e]===i.node.attrs[e])&&r.push(i),n&&r.length>0||(r=r.concat(i.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}};let lv=`.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}`;var lb=class extends sJ{constructor(e={}){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.hasWarnedStaleDecorationRead=!1,this.options={element:"undefined"!=typeof document?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:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:sm,createMappablePosition:sg},this.setOptions(e),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:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=o6(t,this.options.autofocus);this.editorState=tr.create({doc:t,schema:this.schema,selection:e||void 0})}!function(e){let t;if(!lg){lg=!0;try{let n=ex.fromJSON(e,{from:0,to:0});if(!function(e){if(null===e||"object"!=typeof e||null===e||"object"!=typeof e||"function"!=typeof e.apply||"function"!=typeof e.getMap||"function"!=typeof e.invert||"function"!=typeof e.map||"function"!=typeof e.merge||"function"!=typeof e.toJSON)return!1;let t=e.toJSON();return null!==t&&"object"==typeof t&&"replace"===t.stepType}(n))return;t=n.slice.content}catch{return}t instanceof p||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}}(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():oL.createFakeChain()}can(){return this.commandManager?this.commandManager.can():oL.createFallbackCan()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=function(e,t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style",""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}(lv,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&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:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return sG&&!this.hasWarnedStaleDecorationRead&&sK.has(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=i1(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[lc,li.configure({blockSeparator:null==(e=this.options.coreExtensionOptions)||null==(e=e.clipboardTextSerializer)?void 0:e.blockSeparator}),ls,lu,lh,lf.configure({value:null==(t=this.options.coreExtensionOptions)||null==(t=t.tabindex)?void 0:t.value}),la,lp,ll,lm.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new lr(n,this)}createCommandManager(){this.commandManager=new oL({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=iB(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;let e=iB(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=tr.create({doc:e,schema:this.schema,selection:o6(e,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){var e;let t=null==(e=this.options.editorProps)?void 0:e.attributes;return i1(t)?e=>({role:"textbox",...t(e)}):{role:"textbox",...t}}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,i=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(i);this.editorView=new r9(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:o,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS(),this.view.dom.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(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),l=null==s?void 0:s.getMeta("focus"),a=null==s?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),a&&this.emit("blur",{editor:this,event:a.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||i.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return so(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return iM(e,null,n)||sc(e,null,n);let r=iT(t,e.schema);return"node"===r?iM(e,t,n):"mark"===r&&sc(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return iW(this.state.doc.content,this.schema)}getText(e){var t,n;let{blockSeparator:r="\n\n",textSerializers:o={}}=e||{};return t=this.state.doc,n={blockSeparator:r,textSerializers:{...sr(this.schema),...o}},sn(t,{from:0,to:t.content.size},n)}get isEmpty(){return sh(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 e,t;return null==(e=null==(t=this.editorView)?void 0:t.isDestroyed)||e}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new ly(t,this,!1,n)}get $doc(){return this.$pos(0)}},lw=class{static Inline(e,t,n={},r){return new lk(e,t,n,r)}static Node(e,t,n={},r){return new lx(e,t,n,r)}static Widget(e,t,n){let{key:r,...o}=n;return new lS(e,t,r,o)}},lk=class extends lw{constructor(e,t,n={},r){super(),this.kind="inline",this.from=e,this.to=t,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(e){let t=e?{...this.spec,extensionName:e}:this.spec;return rB.inline(this.from,this.to,this.attrs,t)}},lx=class extends lw{constructor(e,t,n={},r){super(),this.kind="node",this.from=e,this.to=t,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(e){let t=e?{...this.spec,extensionName:e}:this.spec;return rB.node(this.from,this.to,this.attrs,t)}},lS=class extends lw{constructor(e,t,n,r){super(),this.kind="widget",this.pos=e,this.render=t,this.key=n,this.spec=r}get anchor(){return this.pos}toPMDecoration(e){let t=e?{...this.spec,key:this.key,extensionName:e}:{...this.spec,key:this.key};return rB.widget(this.pos,this.render,t)}};function lM(e){return new s6({find:e.find,handler:({state:t,range:n,match:r})=>{let o=i2(e.getAttributes,void 0,r);if(!1===o||null===o)return null;let{tr:i}=t,s=r[r.length-1],l=r[0];if(s){let r=l.search(/\S/),a=n.from+l.indexOf(s),c=a+s.length;if(ss(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>a).length)return null;c<n.to&&i.delete(c,n.to),a>n.from&&i.delete(n.from+r,a);let d=n.from+r+s.length;i.addMark(n.from+r,d,e.type.create(o||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function lC(e){return new s6({find:e.find,handler:({state:t,range:n,match:r})=>{let o=i2(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from,l=n.to,a=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>l?e=l:l=e+r[1].length;let t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,l,a)}else if(r[0]){let t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(l))}i.scrollIntoView()},undoable:e.undoable})}function lO(e){return new s6({find:e.find,handler:({state:t,range:n,match:r})=>{let o=t.doc.resolve(n.from),i=i2(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function lA(e){return new s6({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{let i=i2(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),a=l&&eA(l,e.type,i);if(!a)return null;if(s.wrap(l,a),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:o}=e.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){let e=i.filter(e=>o.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";o().updateAttributes(t,i).run()}let c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&eD(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&s.join(n.from-1)},undoable:e.undoable})}var lE=class e extends s9{constructor(...e){super(...e),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}};function lT(e){return new lt({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{let i=i2(e.getAttributes,void 0,r,o);if(!1===i||null===i)return null;let{tr:s}=t,l=r[r.length-1],a=r[0],c=n.to;if(l){let o=a.search(/\S/),d=n.from+a.indexOf(l),u=d+l.length;if(ss(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>d).length)return null;u<n.to&&s.delete(u,n.to),d>n.from&&s.delete(n.from+o,d),c=n.from+o+l.length,s.addMark(n.from+o,c,e.type.create(i||{})),void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||s.removeStoredMark(e.type)}}})}var lN=n(58119),lR=n(8828),lD=({contentComponent:e})=>{let t=(0,a.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,r.jsx)(r.Fragment,{children:Object.values(t)})},lP=class extends s.Component{constructor(e){var t;super(e),this.editorContentRef=s.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null==(t=e.editor)?void 0:t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=function(){let e=new Set,t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(n,r){t={...t,[n]:l.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;let t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!(null==(e=t.options.element)?void 0:e.firstChild)))return;let n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,r.jsx)(lD,{contentComponent:e.contentComponent})]})}},lI=(0,s.forwardRef)((e,t)=>{let n=s.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return s.createElement(lP,{key:n,innerRef:t,...e})}),lL=s.memo(lI),l_="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,lj=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,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.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}},lz="undefined"==typeof window,lB=lz||!!("undefined"!=typeof window&&window.next),l$=class e{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(e=>e())}getInitialEditor(){if(void 0===this.options.current.immediatelyRender)return lz||lB?null:this.createEditor();return this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null}createEditor(){return new lb({...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};(0,s.createContext)({editor:null}).Consumer;var lF=(0,s.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});s.forwardRef((e,t)=>{let{onDragStart:n}=(0,s.useContext)(lF),o=e.as||"div";return(0,r.jsx)(o,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}),s.createContext({markViewContentRef:()=>{}});let lV=new WeakSet,lH=new WeakSet;function lU(e){return lV.add(e),e}function lq(e){return Array.isArray(e)&&lV.has(e)}let lW=(e,t)=>(function(e,t){if("slot"===e)return 0;if(e instanceof Function){let n=e(t);return!Array.isArray(n)||lq(n)||lH.has(n)?n:lU(n)}let{children:n,...r}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(n)){if(lq(n))return lU([e,r,n]);if(0===n.length)return lU([e,r]);let t=function e(t){return t.flatMap(t=>null==t?[]:Array.isArray(t)&&lH.has(t)&&!lq(t)?e(t):[t])}(n);return 0===t.length?lU([e,r]):lU([e,r,...t])}return null!=n?lU([e,r,n]):lU([e,r])})(e,t);var lK=/^\s*>\s$/,lJ=lE.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return lW("blockquote",{...i4(this.options.HTMLAttributes,e),children:lW("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[lA({find:lK,type:this.type})]}}),lG=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,lX=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,lY=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,lQ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,lZ=le.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return lW("strong",{...i4(this.options.HTMLAttributes,e),children:lW("slot",{})})},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[lM({find:lG,type:this.type}),lM({find:lY,type:this.type})]},addPasteRules(){return[lT({find:lX,type:this.type}),lT({find:lQ,type:this.type})]}}),l0=/(^|[^`])`([^`]+)`(?!`)/,l1=/(^|[^`])`([^`]+)`(?!`)/g,l2=le.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",i4(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[lM({find:l0,type:this.type})]},addPasteRules(){return[lT({find:l1,type:this.type})]}}),l5=/^```([a-z]+)?[\s\n]$/,l4=/^~~~([a-z]+)?[\s\n]$/,l3=lE.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options,r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",i4(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;let i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!i&&!!s&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let s=o.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(eX.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[lO({find:l5,type:this.type,getAttributes:e=>({language:e[1]})}),lO({find:l4,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new to({key:new tl("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;let{tr:s,schema:l}=e.state,a=l.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(e0.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),l6=lE.create({name:"doc",topNode:!0,content:"block+"}),l7=lE.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",i4(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,l=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&l&&i){let t=l.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),l8=lE.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let n=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${n}`,i4(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,...{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}}),{})},addInputRules(){return this.options.levels.map(e=>lO({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),l9=lE.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",i4(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof e2){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){let e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,o=e();return sp(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:e,dispatch:t})=>{var n;if(t){let{$to:t}=e.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(e0.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(e2.create(e.doc,t.pos)):e.setSelection(e0.create(e.doc,t.pos));else{let o=null==(n=t.parent.type.contentMatch.defaultType)?void 0:n.create();o&&(e.insert(r,o),e.setSelection(e0.create(e.doc,r+1)))}e.scrollIntoView()}return!0}).run()}}},addInputRules(){return[lC({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),ae=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,at=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,an=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ar=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ao=le.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",i4(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[lM({find:ae,type:this.type}),lM({find:an,type:this.type})]},addPasteRules(){return[lT({find:at,type:this.type}),lT({find:ar,type:this.type})]}});let ai="numeric",as="ascii",al="alpha",aa="asciinumeric",ac="alphanumeric",ad="domain",au="emoji",ah="whitespace";function ap(e,t,n){for(let r in t[ai]&&(t[aa]=!0,t[ac]=!0),t[as]&&(t[aa]=!0,t[al]=!0),t[aa]&&(t[ac]=!0),t[al]&&(t[ac]=!0),t[ac]&&(t[ad]=!0),t[au]&&(t[ad]=!0),t){let t=(r in n||(n[r]=[]),n[r]);0>t.indexOf(e)&&t.push(e)}}function af(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}af.groups={},af.prototype={accepts(){return!!this.t},go(e){let t=this.j[e];if(t)return t;for(let t=0;t<this.jr.length;t++){let n=this.jr[t][0],r=this.jr[t][1];if(r&&n.test(e))return r}return this.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||af.groups,t&&t.j?o=t:(o=new af(t),n&&r&&ap(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this,i=e.length;if(!i)return o;for(let t=0;t<i-1;t++)o=o.tt(e[t]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){if(r=r||af.groups,t&&t.j)return this.j[e]=t,t;let o,i=this.go(e);return i?(Object.assign((o=new af).j,i.j),o.jr.push.apply(o.jr,i.jr),o.jd=i.jd,o.t=i.t):o=new af,t&&(r&&(o.t&&"string"==typeof o.t?ap(t,Object.assign(function(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(o.t,r),n),r):n&&ap(t,n,r)),o.t=t),this.j[e]=o,o}};let am=(e,t,n,r,o)=>e.ta(t,n,r,o),ag=(e,t,n,r,o)=>e.tr(t,n,r,o),ay=(e,t,n,r,o)=>e.ts(t,n,r,o),av=(e,t,n,r,o)=>e.tt(t,n,r,o),ab="WORD",aw="UWORD",ak="ASCIINUMERICAL",ax="ALPHANUMERICAL",aS="LOCALHOST",aM="UTLD",aC="SCHEME",aO="SLASH_SCHEME",aA="OPENBRACE",aE="CLOSEBRACE",aT="OPENBRACKET",aN="CLOSEBRACKET",aR="OPENPAREN",aD="CLOSEPAREN",aP="OPENANGLEBRACKET",aI="CLOSEANGLEBRACKET",aL="FULLWIDTHLEFTPAREN",a_="FULLWIDTHRIGHTPAREN",aj="LEFTCORNERBRACKET",az="RIGHTCORNERBRACKET",aB="LEFTWHITECORNERBRACKET",a$="RIGHTWHITECORNERBRACKET",aF="FULLWIDTHLESSTHAN",aV="FULLWIDTHGREATERTHAN",aH="AMPERSAND",aU="APOSTROPHE",aq="ASTERISK",aW="BACKSLASH",aK="BACKTICK",aJ="CARET",aG="COLON",aX="COMMA",aY="DOLLAR",aQ="EQUALS",aZ="EXCLAMATION",a0="HYPHEN",a1="PERCENT",a2="PIPE",a5="PLUS",a4="POUND",a3="QUERY",a6="QUOTE",a7="FULLWIDTHMIDDLEDOT",a8="SEMI",a9="SLASH",ce="TILDE",ct="UNDERSCORE",cn="EMOJI";var cr=Object.freeze({__proto__:null,ALPHANUMERICAL:ax,AMPERSAND:aH,APOSTROPHE:aU,ASCIINUMERICAL:ak,ASTERISK:aq,AT:"AT",BACKSLASH:aW,BACKTICK:aK,CARET:aJ,CLOSEANGLEBRACKET:aI,CLOSEBRACE:aE,CLOSEBRACKET:aN,CLOSEPAREN:aD,COLON:aG,COMMA:aX,DOLLAR:aY,DOT:"DOT",EMOJI:cn,EQUALS:aQ,EXCLAMATION:aZ,FULLWIDTHGREATERTHAN:aV,FULLWIDTHLEFTPAREN:aL,FULLWIDTHLESSTHAN:aF,FULLWIDTHMIDDLEDOT:a7,FULLWIDTHRIGHTPAREN:a_,HYPHEN:a0,LEFTCORNERBRACKET:aj,LEFTWHITECORNERBRACKET:aB,LOCALHOST:aS,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:aP,OPENBRACE:aA,OPENBRACKET:aT,OPENPAREN:aR,PERCENT:a1,PIPE:a2,PLUS:a5,POUND:a4,QUERY:a3,QUOTE:a6,RIGHTCORNERBRACKET:az,RIGHTWHITECORNERBRACKET:a$,SCHEME:aC,SEMI:a8,SLASH:a9,SLASH_SCHEME:aO,SYM:"SYM",TILDE:ce,TLD:"TLD",UNDERSCORE:ct,UTLD:aM,UWORD:aw,WORD:ab,WS:"WS"});let co=/[a-z]/,ci=/\p{L}/u,cs=/\p{Emoji}/u,cl=/\d/,ca=/\s/,cc=null,cd=null;function cu(e,t){let n=function(e){let t=[],n=e.length,r=0;for(;r<n;){let o,i=e.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,o=[],i=0,s=0;for(;s<r;){let l=e,a=null,c=0,d=null,u=-1,h=-1;for(;s<r&&(a=l.go(n[s]));)(l=a).accepts()?(u=0,h=0,d=l):u>=0&&(u+=n[s].length,h++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=h,c-=u,o.push({t:d.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function ch(e,t,n,r,o){let i,s=t.length;for(let n=0;n<s-1;n++){let s=t[n];e.j[s]?i=e.j[s]:((i=new af(r)).jr=o.slice(),e.j[s]=i),e=i}return(i=new af(n)).jr=o.slice(),e.j[t[s-1]]=i,i}function cp(e){let t=[],n=[],r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}let cf={defaultProtocol:"http",events:null,format:cg,formatHref:cg,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function cm(e,t=null){let n=Object.assign({},cf);e&&(n=Object.assign(n,e instanceof cm?e.o:e));let r=n.ignoreTags,o=[];for(let e=0;e<r.length;e++)o.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function cg(e){return e}function cy(e,t){this.t="token",this.v=e,this.tk=t}function cv(e,t){class n extends cy{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}cm.prototype={o:cf,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){let r=null!=t,o=this.o[e];return o&&("object"==typeof o?"function"==typeof(o=n.t in o?o[n.t]:cf[e])&&r&&(o=o(t,n)):"function"==typeof o&&r&&(o=o(t,n.t,n))),o},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},cy.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=cf.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let t=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",t,this),r=e.get("tagName",t,this),o=this.toFormattedString(e),i={},s=e.get("className",t,this),l=e.get("target",t,this),a=e.get("rel",t,this),c=e.getObj("attributes",t,this),d=e.getObj("events",t,this);return i.href=n,s&&(i.class=s),l&&(i.target=l),a&&(i.rel=a),c&&Object.assign(i,c),{tagName:r,attributes:i,content:o,eventListeners:d}}};let cb=cv("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),cw=cv("text"),ck=cv("nl"),cx=cv("url",{isLink:!0,toHref(e=cf.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==aS&&e[1].t===aG}}),cS=e=>new af(e);function cM(e,t,n){let r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}let cC="undefined"!=typeof console&&console&&console.warn||(()=>{}),cO={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function cA(e,t=!1){if(cO.initialized&&cC(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);cO.customSchemes.push([e,t])}function cE(e){return cO.initialized||function(){cO.scanner=function(e=[]){let t={};af.groups=t;let n=new af;null==cc&&(cc=cp("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xf6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==cd&&(cd=cp("ελ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")),av(n,"'",aU),av(n,"{",aA),av(n,"}",aE),av(n,"[",aT),av(n,"]",aN),av(n,"(",aR),av(n,")",aD),av(n,"<",aP),av(n,">",aI),av(n,"（",aL),av(n,"）",a_),av(n,"「",aj),av(n,"」",az),av(n,"『",aB),av(n,"』",a$),av(n,"＜",aF),av(n,"＞",aV),av(n,"&",aH),av(n,"*",aq),av(n,"@","AT"),av(n,"`",aK),av(n,"^",aJ),av(n,":",aG),av(n,",",aX),av(n,"$",aY),av(n,".","DOT"),av(n,"=",aQ),av(n,"!",aZ),av(n,"-",a0),av(n,"%",a1),av(n,"|",a2),av(n,"+",a5),av(n,"#",a4),av(n,"?",a3),av(n,'"',a6),av(n,"/",a9),av(n,";",a8),av(n,"~",ce),av(n,"_",ct),av(n,"\\",aW),av(n,"・",a7);let r=ag(n,cl,"NUM",{[ai]:!0});ag(r,cl,r);let o=ag(r,co,ak,{[aa]:!0}),i=ag(r,ci,ax,{[ac]:!0}),s=ag(n,co,ab,{[as]:!0});ag(s,cl,o),ag(s,co,s),ag(o,cl,o),ag(o,co,o);let l=ag(n,ci,aw,{[al]:!0});ag(l,co),ag(l,cl,i),ag(l,ci,l),ag(i,cl,i),ag(i,co),ag(i,ci,i);let a=av(n,"\n","NL",{[ah]:!0}),c=av(n,"\r","WS",{[ah]:!0}),d=ag(n,ca,"WS",{[ah]:!0});av(n,"￼",d),av(c,"\n",a),av(c,"￼",d),ag(c,ca,d),av(d,"\r"),av(d,"\n"),ag(d,ca,d),av(d,"￼",d);let u=ag(n,cs,cn,{[au]:!0});av(u,"#"),ag(u,cs,u),av(u,"️",u);let h=av(u,"‍");av(h,"#"),ag(h,cs,u);let p=[[co,s],[cl,o]],f=[[co,null],[ci,l],[cl,i]];for(let e=0;e<cc.length;e++)ch(n,cc[e],"TLD",ab,p);for(let e=0;e<cd.length;e++)ch(n,cd[e],aM,aw,f);ap("TLD",{tld:!0,ascii:!0},t),ap(aM,{utld:!0,alpha:!0},t),ch(n,"file",aC,ab,p),ch(n,"mailto",aC,ab,p),ch(n,"http",aO,ab,p),ch(n,"https",aO,ab,p),ch(n,"ftp",aO,ab,p),ch(n,"ftps",aO,ab,p),ap(aC,{scheme:!0,ascii:!0},t),ap(aO,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],o=e[t][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?o[ad]=!0:co.test(r)?cl.test(r)?o[aa]=!0:o[as]=!0:o[ai]=!0,ay(n,r,r,o)}return ay(n,"localhost",aS,{ascii:!0}),n.jd=new af("SYM"),{start:n,tokens:Object.assign({groups:t},cr)}}(cO.customSchemes);for(let e=0;e<cO.tokenQueue.length;e++)cO.tokenQueue[e][1]({scanner:cO.scanner});cO.parser=function({groups:e}){let t=e.domain.concat([aH,aq,"AT",aW,aK,aJ,aY,aQ,a0,"NUM",a1,a2,a5,a4,a9,"SYM",ce,ct]),n=[aU,aG,aX,"DOT",aZ,a1,a3,a6,a8,aP,aI,aA,aE,aN,aT,aR,aD,aL,a_,aj,az,aB,a$,aF,aV],r=[aH,aU,aq,aW,aK,aJ,aY,aQ,a0,aA,aE,a1,a2,a5,a4,a3,a9,"SYM",ce,ct],o=cS(),i=av(o,ce);am(i,r,i),am(i,e.domain,i);let s=cS(),l=cS(),a=cS();am(o,e.domain,s),am(o,e.scheme,l),am(o,e.slashscheme,a),am(s,r,i),am(s,e.domain,s);let c=av(s,"AT");av(i,"AT",c),av(l,"AT",c),av(a,"AT",c);let d=av(i,"DOT");am(d,r,i),am(d,e.domain,i);let u=cS();am(c,e.domain,u),am(u,e.domain,u);let h=av(u,"DOT");am(h,e.domain,u);let p=cS(cb);am(h,e.tld,p),am(h,e.utld,p),av(c,aS,p);let f=av(u,a0);av(f,a0,f),am(f,e.domain,u),am(p,e.domain,u),av(p,"DOT",h),av(p,a0,f),am(av(p,aG),e.numeric,cb);let m=av(s,a0),g=av(s,"DOT");av(m,a0,m),am(m,e.domain,s),am(g,r,i),am(g,e.domain,s);let y=cS(cx);am(g,e.tld,y),am(g,e.utld,y),am(y,e.domain,s),am(y,r,i),av(y,"DOT",g),av(y,a0,m),av(y,"AT",c);let v=av(y,aG),b=cS(cx);am(v,e.numeric,b);let w=cS(cx),k=cS();am(w,t,w),am(w,n,k),am(k,t,w),am(k,n,k),av(y,a9,w),av(b,a9,w);let x=av(l,aG),S=av(a,aG),M=av(S,a9),C=av(M,a9);am(l,e.domain,s),av(l,"DOT",g),av(l,a0,m),am(a,e.domain,s),av(a,"DOT",g),av(a,a0,m),am(x,e.domain,w),av(x,a9,w),av(x,a3,w),am(C,e.domain,w),am(C,t,w),av(C,a9,w);let O=[[aA,aE],[aT,aN],[aR,aD],[aP,aI],[aL,a_],[aj,az],[aB,a$],[aF,aV]];for(let e=0;e<O.length;e++){let[r,o]=O[e],i=av(w,r);av(k,r,i),av(i,o,w);let s=cS(cx);am(i,t,s);let l=cS();am(i,n),am(s,t,s),am(s,n,l),am(l,t,s),am(l,n,l),av(s,o,w),av(l,o,w)}return av(o,aS,y),av(o,"NL",ck),{start:o,tokens:cr}}(cO.scanner.tokens);for(let e=0;e<cO.pluginQueue.length;e++)cO.pluginQueue[e][1]({scanner:cO.scanner,parser:cO.parser});cO.initialized=!0}(),function(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let l=e,a=null,c=null,d=0,u=null,h=-1;for(;o<r&&!(a=l.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=a||l.go(n[o].t));)a=null,(l=c).accepts()?(h=0,u=l):h>=0&&h++,o++,d++;if(h<0)(o-=d)<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(cM(cw,t,s)),s=[]),o-=h,d-=h;let e=u.t,r=n.slice(o-d,o);i.push(cM(e,t,r))}}return s.length>0&&i.push(cM(cw,t,s)),i}(cO.parser.start,e,cu(cO.scanner.start,e))}function cT(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new cm(n),o=cE(e),i=[];for(let e=0;e<o.length;e++){let n=o[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&i.push(n.toFormattedObject(r))}return i}cE.scan=cu;var cN="[\0- \xa0 ᠎ -\u2029 　]",cR=new RegExp(cN),cD=RegExp(`${cN}$`),cP=RegExp(cN,"g");function cI(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(cP,"").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var cL=le.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(e=>{if("string"==typeof e)return void cA(e);cA(e.scheme,e.optionalSlashes)})},onDestroy(){af.groups={},cO.scanner=null,cO.parser=null,cO.tokenQueue=[],cO.pluginQueue=[],cO.customSchemes=[],cO.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!cI(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!cI(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!cI(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",i4(this.options.HTMLAttributes,e),0]:["a",i4(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!cI(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return(!n||!!this.options.isAllowedUri(n,{defaultValidate:e=>!!cI(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[lT({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,o=cT(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!cI(e,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(e=>t.push({text:e.value,data:{href:e.href},index:e.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let r=[],{protocols:o,defaultProtocol:i}=this.options;return this.options.autolink&&r.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!cI(e,o),protocols:o,defaultProtocol:i}),shouldAutoLink:this.options.shouldAutoLink},new to({key:new tl("autolink"),appendTransaction:(t,n,r)=>{let o=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),i=t.some(e=>e.getMeta("preventAutolink"));if(!o||i)return;let{tr:s}=r;if(si(iV(n.doc,[...t])).forEach(({newRange:t})=>{let n,o,i=function(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}(r.doc,t,e=>e.isTextblock);if(i.length>1)n=i[0],o=r.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(i.length){let e=r.doc.textBetween(t.from,t.to," "," ");if(!cD.test(e))return;n=i[0],o=r.doc.textBetween(n.pos,t.to,void 0," ")}if(n&&o){let t=o.split(cR).filter(Boolean);if(t.length<=0)return!1;let i=t[t.length-1],l=n.pos+o.lastIndexOf(i);if(!i)return!1;let a=cE(i).map(t=>t.toObject(e.defaultProtocol));if(!(1===a.length?a[0].isLink:3===a.length&&!!a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;a.filter(e=>e.isLink).map(e=>({...e,from:l+e.start+1,to:l+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{ss(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||s.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),s.steps.length)return s}}))),!0===this.options.openOnClick&&r.push((t={type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection},new to({key:new tl("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(0!==r.button||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let e=r.target,t=[];for(;"DIV"!==e.nodeName;)t.push(e),e=e.parentNode;s=t.find(e=>"A"===e.nodeName)}if(!s)return!1;let l=so(e.state,t.type.name),a=null!=(o=null==s?void 0:s.href)?o:l.href,c=null!=(i=null==s?void 0:s.target)?i:l.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),!!s&&!!a&&(window.open(a,c),!0)}}}))),this.options.linkOnPaste&&r.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type},new to({key:new tl("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let l="";r.content.forEach(e=>{l+=e.textContent});let a=cT(l,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!!l&&!!a&&n.editor.commands.setMark(n.type,{href:a.href})}}}))),r}}),c_=Object.defineProperty,cj="textStyle",cz=/^\s*([-+*])\s$/,cB=lE.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",i4(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(cj)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=lA({find:cz,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=lA({find:cz,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(cj),editor:this.editor})),[e]}}),c$=lE.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",i4(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((e,t)=>{for(var n in t)c_(e,n,{get:t[n],enumerable:!0})})({},{findListItemPos:()=>cF,getNextListDepth:()=>cV,handleBackspace:()=>cW,handleDelete:()=>cG,hasListBefore:()=>cH,hasListItemAfter:()=>cX,hasListItemBefore:()=>cU,listItemHasSubList:()=>cq,nextListIsDeeper:()=>cK,nextListIsHigher:()=>cJ});var cF=(e,t)=>{let{$from:n}=t.selection,r=oH(e,t.schema),o=n.depth,i=n.pos,s=null;for(;o>0&&null===s;)n.node(o).type===r?s=o:(o-=1,i-=1);return null===s?null:{$pos:t.doc.resolve(i),depth:s}},cV=(e,t)=>{let n=cF(e,t);if(!n)return!1;let[,r]=((e,t,n,r=20)=>{let o=e.doc.resolve(n),i=r,s=null;for(;i>0&&null===s;){let e=o.node(i);(null==e?void 0:e.type.name)===t?s=e:i-=1}return[s,i]})(t,e,n.$pos.pos+4);return r},cH=(e,t,n)=>{let{$anchor:r}=e.selection,o=Math.max(0,r.pos-2),i=e.doc.resolve(o).node();return!!i&&!!n.includes(i.type.name)},cU=(e,t)=>{var n;let{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===e},cq=(e,t,n)=>{if(!n)return!1;let r=oH(e,t.schema),o=!1;return n.descendants(e=>{e.type===r&&(o=!0)}),o},cW=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!iM(e.state,t)&&cH(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),o=[];r.node().descendants((e,n)=>{e.type.name===t&&o.push({node:e,pos:n})});let i=o.at(-1);if(!i)return!1;let s=e.state.doc.resolve(r.start()+i.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!iM(e.state,t)||!(e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos})(e.state))return!1;let r=cF(t,e.state);if(!r)return!1;let o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),i=cq(t,e.state,o);return cU(t,e.state)&&!i?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},cK=(e,t)=>{let n=cV(e,t),r=cF(e,t);return!!r&&!!n&&n>r.depth},cJ=(e,t)=>{let n=cV(e,t),r=cF(e,t);return!!r&&!!n&&n<r.depth},cG=(e,t)=>{if(!iM(e.state,t)||!((e,t)=>{let{$from:n,$to:r,$anchor:o}=e.selection;if(t){let n=iH(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return o.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos})(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:o}=n;return!(!n.empty&&r.sameParent(o))&&(cK(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():cJ(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},cX=(e,t)=>{var n;let{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===e},cY=lo.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&cG(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&cG(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&cW(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&cW(e,n,r)&&(t=!0)}),t}}}}),cQ="textStyle",cZ=/^(\d+)\.\s$/,c0=lE.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",i4(this.options.HTMLAttributes,n),0]:["ol",i4(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(cQ)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=lA({find:cZ,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=lA({find:cZ,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(cQ)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),c1=/^\s*(\[([( |x])?\])\s$/,c2=lE.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",i4(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=e=>{var t,n;l.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,l.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};return c(e),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",e=>e.preventDefault()),l.addEventListener("change",t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}let{checked:o}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if("number"!=typeof t)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:o}),!0}).run(),r.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,o)||(l.checked=!l.checked)}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{o.setAttribute(e,t)}),o.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,i.append(l,s),o.append(i,a),Object.entries(t).forEach(([e,t])=>{o.setAttribute(e,t)}),{dom:o,contentDOM:a,update:e=>e.type===this.type&&(o.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,c(e),!0)}}},addInputRules(){return[lA({find:c1,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),c5=lE.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",i4(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});lo.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(cB.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(c$.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(cY.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(c0.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(c2.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(c5.configure(this.options.taskList)),e}});var c4=lE.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",i4(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),c3=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,c6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,c7=le.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",i4(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[lM({find:c3,type:this.type})]},addPasteRules(){return[lT({find:c6,type:this.type})]}}),c8=lE.create({name:"text",group:"inline"}),c9=le.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",i4(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});class de{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=null!=(n=t.width)?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(null!=this.cursorPos&&t.doc!=e.state.doc)if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,o,i=this.editorView.dom,s=i.getBoundingClientRect(),l=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(r){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(n){let r=n.getBoundingClientRect(),i=e?r.bottom:r.top;e&&t&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*a;o={left:r.left,right:r.right,top:i-s,bottom:i+s}}}}if(!o){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*l;o={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let c=this.editorView.dom.offsetParent;if(!this.element&&(this.element=c.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",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),c&&(c!=document.body||"static"!=getComputedStyle(c).position)){let n=c.getBoundingClientRect(),r=n.width/c.offsetWidth,o=n.height/c.offsetHeight;e=n.left-c.scrollLeft*r,t=n.top-c.scrollTop*o}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(o.left-e)/l+"px",this.element.style.top=(o.top-t)/a+"px",this.element.style.width=(o.right-o.left)/l+"px",this.element.style.height=(o.bottom-o.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(!t||o)return null;let i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=eL(this.editorView.state.doc,i,this.editorView.dragging.slice);null!=e&&(i=e)}return i}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);null!=t&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class dt extends eX{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return dt.valid(n)?new dt(n):eX.near(n)}content(){return b.empty}eq(e){return e instanceof dt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new dt(e.resolve(t.pos))}getBookmark(){return new dn(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||dr(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||dr(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){r:for(;;){if(!n&&dt.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(dt.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!e2.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue r}break}o=i,r+=t;let s=e.doc.resolve(r);if(dt.valid(s))return s}return null}}}dt.prototype.visible=!1,dt.findFrom=dt.findGapCursorFrom,eX.jsonID("gapcursor",dt);class dn{constructor(e){this.pos=e}map(e){return new dn(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return dt.valid(t)?new dt(t):eX.near(t)}}function dr(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let di=om({ArrowLeft:ds("horiz",-1),ArrowRight:ds("horiz",1),ArrowUp:ds("vert",-1),ArrowDown:ds("vert",1)});function ds(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,l=i.empty;if(i instanceof e0){if(!o.endOfTextblock(n)||0==s.depth)return!1;l=!1,s=e.doc.resolve(t>0?s.after():s.before())}let a=dt.findGapCursorFrom(s,t,l);return!!a&&(r&&r(e.tr.setSelection(new dt(a))),!0)}}function dl(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!dt.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&e2.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new dt(r))),!0)}function da(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof dt))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=p.empty;for(let e=r.length-1;e>=0;e--)o=p.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new b(o,0,0));return i.setSelection(e0.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function dc(e){if(!(e.selection instanceof dt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",rV.create(e.doc,[rB.widget(e.selection.head,t,{key:"gapcursor"})])}lo.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new to({key:new tl("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let o=this.options.limit;if(null==o||0===o){e=!0;return}let i=this.storage.characters({node:r.doc});if(i>o){console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,i-o);return e=!0,t}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;let r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n||r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r||!e.getMeta("paste"))return!1;let i=e.selection.$head.pos;return e.deleteRange(i-(o-n),i),!(this.storage.characters({node:e.doc})>n)}})]}});var dd=lo.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new to({view:t=>new de(t,e)})}(this.options)]}});lo.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new to({key:new tl("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return rV.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(o>=t&&o<=t+e.nodeSize-1))return!1;s+=1}});let l=0;return e.descendants((e,t)=>!e.isText&&!!(o>=t&&o<=t+e.nodeSize-1)&&((l+=1,"deepest"===this.options.mode&&s-l>0||"shallowest"===this.options.mode&&l>1)?"deepest"===this.options.mode:void i.push(rB.node(t,t+e.nodeSize,{class:this.options.className})))),rV.create(e,i)}}})]}});var du=lo.create({name:"gapCursor",addProseMirrorPlugins:()=>[new to({props:{decorations:dc,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&dt.valid(n)?new dt(n):null,handleClick:dl,handleKeyDown:di,handleDOMEvents:{beforeinput:da}}})],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=i2(iU(e,"allowGapCursor",n)))?t:null}}});function dh({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}lo.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new to({key:new tl("placeholder"),props:{decorations:({doc:e,selection:t})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,o=[];if(!n)return null;let i=this.editor.isEmpty;return e.descendants((e,t)=>{let n=r>=t&&r<=t+e.nodeSize,s=!e.isLeaf&&sh(e);if((n||!this.options.showOnlyCurrent)&&s){let r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);let s=rB.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});o.push(s)}return this.options.includeChildren}),rV.create(e,o)}}})]}}),lo.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new to({key:new tl("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||sp(n.selection)||e.view.dragging?null:rV.create(n.doc,[rB.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var dp=lo.create({name:"trailingNode",addOptions:()=>({node:"paragraph",notAfter:[]}),addProseMirrorPlugins(){let e=new tl(this.name),t=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(this.options.node).includes(e.name));return[new to({key:e,appendTransaction:(t,n,r)=>{let{doc:o,tr:i,schema:s}=r,l=e.getState(r),a=o.content.size,c=s.nodes[this.options.node];if(l)return i.insert(a,c.create())},state:{init:(e,n)=>!dh({node:n.tr.doc.lastChild,types:t}),apply:(e,n)=>e.docChanged?!dh({node:e.doc.lastChild,types:t}):n}})]}}),df=lo.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>oR(e,t),redo:()=>({state:e,dispatch:t})=>oD(e,t)}),addProseMirrorPlugins(){return[function(e={}){return new to({key:oE,state:{init:()=>new ok(ob.empty,ob.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let o=n.getMeta(oE),i;if(o)return o.historyState;n.getMeta(oT)&&(e=new ok(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(oE))if(s.getMeta(oE).redo)return new ok(e.done.addTransform(n,void 0,r,oA(t)),e.undone,oS(n.mapping.maps),e.prevTime,e.prevComposition);else return new ok(e.done,e.undone.addTransform(n,void 0,r,oA(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(i=n.getMeta("rebased"))return new ok(e.done.rebased(n,i),e.undone.rebased(n,i),oM(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new ok(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),oM(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)}),n}(n,e.prevRanges)),l=s?oM(e.prevRanges,n.mapping):oS(n.mapping.maps);return new ok(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,oA(t)),ob.empty,l,n.time,null==o?e.prevComposition:o)}})(n,r,t,e)},config:e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?oR:"historyRedo"==n?oD:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(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()}}}),dm=lo.create({name:"starterKit",addExtensions(){var e,t,n,r;let o=[];return!1!==this.options.bold&&o.push(lZ.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(lJ.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(cB.configure(this.options.bulletList)),!1!==this.options.code&&o.push(l2.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(l3.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(l6.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(dd.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(du.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(l7.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(l8.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(df.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(l9.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(ao.configure(this.options.italic)),!1!==this.options.listItem&&o.push(c$.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(cY.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(cL.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(c0.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(c4.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(c7.configure(this.options.strike)),!1!==this.options.text&&o.push(c8.configure(this.options.text)),!1!==this.options.underline&&o.push(c9.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(dp.configure(null==(r=this.options)?void 0:r.trailingNode)),o}}),dg=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,dy=lE.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({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:e}){return["img",i4(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[lC({find:dg,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),dv=lo.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(e=>e),unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).every(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e))}},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")}}}),db=le.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!0}),parseHTML(){return[{tag:"span",consuming:!1,getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;let t=e.querySelectorAll("span");t&&t.forEach(e=>{var t,n;let r=e.getAttribute("style"),o=null==(n=null==(t=e.parentElement)?void 0:t.closest("span"))?void 0:n.getAttribute("style");e.setAttribute("style",`${o};${r}`)})})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",i4(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),dw=lo.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{var t;return null==(t=e.style.backgroundColor)?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:e=>({chain:t})=>t().setMark("textStyle",{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()})}),dk=lo.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return null==(t=e.style.color)?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),dx=lo.create({name:"fontFamily",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands:()=>({setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),dS=lo.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),dM=lo.create({name:"lineHeight",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands:()=>({setLineHeight:e=>({chain:t})=>t().setMark("textStyle",{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()})});lo.create({name:"textStyleKit",addExtensions(){let e=[];return!1!==this.options.backgroundColor&&e.push(dw.configure(this.options.backgroundColor)),!1!==this.options.color&&e.push(dk.configure(this.options.color)),!1!==this.options.fontFamily&&e.push(dx.configure(this.options.fontFamily)),!1!==this.options.fontSize&&e.push(dS.configure(this.options.fontSize)),!1!==this.options.lineHeight&&e.push(dM.configure(this.options.lineHeight)),!1!==this.options.textStyle&&e.push(db.configure(this.options.textStyle)),e}});var dC=n(919),dO=n(57828),dA=n(45105);let dE=(0,dA.A)("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),dT=(0,dA.A)("Bold",[["path",{d:"M14 12a4 4 0 0 0 0-8H6v8",key:"v2sylx"}],["path",{d:"M15 20a4 4 0 0 0 0-8H6v8Z",key:"1ef5ya"}]]),dN=(0,dA.A)("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),dR=(0,dA.A)("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]),dD=(0,dA.A)("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]),dP=(0,dA.A)("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);var dI=n(80003);let dL=(0,dA.A)("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]),d_=(0,dA.A)("AlignLeft",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}],["line",{x1:"17",x2:"3",y1:"18",y2:"18",key:"1awlsn"}]]),dj=(0,dA.A)("AlignCenter",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"17",x2:"7",y1:"12",y2:"12",key:"rsh8ii"}],["line",{x1:"19",x2:"5",y1:"18",y2:"18",key:"1t0tuv"}]]),dz=(0,dA.A)("AlignRight",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}],["line",{x1:"21",x2:"7",y1:"18",y2:"18",key:"1g9eri"}]]),dB=(0,dA.A)("AlignJustify",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]]),d$=(0,dA.A)("Quote",[["path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z",key:"4rm80e"}],["path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",key:"10za9r"}]]),dF=(0,dA.A)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);var dV=n(42196);let dH=(0,s.memo)(e=>{let{value:t,onChange:n,placeholder:o="Start writing your content...",height:l=400,minimal:c=!1,className:d=""}=e,[u,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)(t);(0,s.useEffect)(()=>{t!==p&&f(t)},[t]);let m=function(e={},t=[]){let n=(0,s.useRef)(e);n.current=e;let[r]=(0,s.useState)(()=>new l$(n)),o=(0,a.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,s.useDebugValue)(o),(0,s.useEffect)(r.onRender(t)),!function(e){var t;let[n]=(0,s.useState)(()=>new lj(e.editor)),r=(0,lR.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:lN);l_(()=>n.watch(e.editor),[e.editor,n]),(0,s.useDebugValue)(r)}({editor:o,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),o}({extensions:[dm,dy.configure({HTMLAttributes:{class:"max-w-full h-auto"}}),dv.configure({types:["heading","paragraph"]}),dk,db],content:t,onUpdate:e=>{let{editor:r}=e,o=r.getHTML();o!==t&&n(o)},editorProps:{attributes:{class:"prose prose-sm sm:prose lg:prose-lg xl:prose-2xl mx-auto focus:outline-none"}}});return m?(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"rich-text-editor ".concat(d),children:[(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" flex items-center space-x-2",children:[(0,r.jsxs)("button",{onClick:()=>h(!1),className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"px-3 py-1 text-sm rounded-md transition-colors ".concat(u?"bg-secondary-100 text-secondary-700 hover:bg-secondary-200":"bg-primary-600 text-white"),children:[(0,r.jsx)(dO.A,{className:"h-4 w-4 mr-1"}),"Rich Text"]}),(0,r.jsxs)("button",{onClick:()=>h(!0),className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"px-3 py-1 text-sm rounded-md transition-colors ".concat(u?"bg-primary-600 text-white":"bg-secondary-100 text-secondary-700 hover:bg-secondary-200"),children:[(0,r.jsx)(dE,{className:"h-4 w-4 mr-1"}),"View HTML"]})]}),(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" text-sm text-secondary-500",children:[t.replace(/<[^>]*>/g,"").length," characters • ",Math.ceil(t.replace(/<[^>]*>/g,"").split(/\s+/).length/200)," min read"]})]}),u?(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" space-y-2",children:[(0,r.jsx)("textarea",{value:p,onChange:e=>{let t=e.target.value;f(t),n(t)},placeholder:o,className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-full h-96 p-4 border border-secondary-300 dark:border-secondary-600 rounded-md bg-white dark:bg-secondary-800 text-secondary-900 dark:text-secondary-100 font-mono text-sm resize-none"}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" flex justify-end",children:(0,r.jsx)("button",{onClick:()=>{n(p),h(!1),m&&m.commands.setContent(p)},className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" px-4 py-2 bg-primary-600 text-white rounded-md hover:bg-primary-700 transition-colors",children:"Apply HTML Changes"})})]}):(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" border border-secondary-300 dark:border-secondary-600 rounded-md overflow-hidden",children:[(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" flex flex-wrap items-center gap-1 p-2 bg-secondary-50 dark:bg-secondary-800 border-b border-secondary-300 dark:border-secondary-600",children:[(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleBold().run(),title:"Bold",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("bold")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dT,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleItalic().run(),title:"Italic",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("italic")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dN,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleUnderline().run(),title:"Underline",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("underline")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dR,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleStrike().run(),title:"Strikethrough",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("strike")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dD,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleHeading({level:1}).run(),title:"Heading 1",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("heading",{level:1})?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dP,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleBulletList().run(),title:"Bullet List",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("bulletList")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dI.A,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleOrderedList().run(),title:"Numbered List",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("orderedList")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dL,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().setTextAlign("left").run(),title:"Align Left",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive({textAlign:"left"})?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(d_,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().setTextAlign("center").run(),title:"Align Center",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive({textAlign:"center"})?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dj,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().setTextAlign("right").run(),title:"Align Right",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive({textAlign:"right"})?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dz,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().setTextAlign("justify").run(),title:"Justify",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive({textAlign:"justify"})?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dB,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleBlockquote().run(),title:"Blockquote",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("blockquote")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(d$,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleCodeBlock().run(),title:"Code Block",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("codeBlock")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(dE,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("button",{onClick:()=>{let e=window.prompt("Enter URL");e&&m&&m.chain().focus().setLink({href:e}).run()},title:"Add Link",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700",children:(0,r.jsx)(dF,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>{let e=window.prompt("Enter image URL");e&&m&&m.chain().focus().setImage({src:e}).run()},title:"Add Image",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700",children:(0,r.jsx)(dV.A,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("input",{type:"color",onInput:e=>m.chain().focus().setColor(e.target.value).run(),title:"Text Color",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-8 h-8 rounded border border-secondary-300 dark:border-secondary-600 cursor-pointer"})]}),(0,r.jsx)("div",{style:{minHeight:"".concat(l-60,"px")},className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" p-4 bg-white dark:bg-secondary-900 text-secondary-900 dark:text-secondary-100",children:(0,r.jsx)(lL,{editor:m})})]}),(0,r.jsx)(i(),{id:"efb5d9fa040edc01",dynamic:[l-60],children:".ProseMirror{outline:none;min-height:".concat(l-60,'px;font-family:inherit;font-size:16px;line-height:1.7}.ProseMirror h1{font-size:2em;font-weight:bold;margin:1em 0 .5em 0}.ProseMirror h2{font-size:1.5em;font-weight:bold;margin:1em 0 .5em 0}.ProseMirror h3{font-size:1.17em;font-weight:bold;margin:1em 0 .5em 0}.ProseMirror blockquote{border-left:4px solid#e5e7eb;margin:1em 0;padding-left:1em;font-style:italic;color:#6b7280}.ProseMirror code{background-color:#f3f4f6;padding:.2em .4em;border-radius:3px;font-family:"Courier New",monospace}.ProseMirror pre{background-color:#f3f4f6;padding:1em;border-radius:6px;overflow-x:auto;margin:1em 0}.ProseMirror ul,.ProseMirror ol{margin:1em 0;padding-left:2em}.ProseMirror li{margin:.5em 0}.ProseMirror a{color:#3b82f6;text-decoration:underline}.ProseMirror a:hover{color:#2563eb}.ProseMirror img{max-width:100%;height:auto;margin:1em 0}.dark .ProseMirror{color:rgb(243 244 246)}.dark .ProseMirror blockquote{border-left-color:rgb(75 85 99);color:rgb(156 163 175)}.dark .ProseMirror code{background-color:rgb(55 65 81)}.dark .ProseMirror pre{background-color:rgb(55 65 81)}')})]}):(0,r.jsxs)("div",{className:"flex items-center justify-center h-40 border border-secondary-300 dark:border-secondary-600 rounded-md bg-white dark:bg-secondary-800",children:[(0,r.jsx)(dC.A,{className:"h-6 w-6 animate-spin text-secondary-500"}),(0,r.jsx)("span",{className:"ml-2 text-secondary-500",children:"Loading editor..."})]})});dH.displayName="RichTextEditor";let dU=dH},79862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return r}});let r=n(28140)._(n(12115)).default.createContext(null)},80003:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]])},80797:(e,t,n)=>{var r=n(92639).default,o=n(76168);e.exports=function(e){var t=o(e,"string");return"symbol"==r(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},81356:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return w}});let r=n(28140),o=n(49417),i=n(95155),s=o._(n(12115)),l=r._(n(47650)),a=r._(n(74841)),c=n(75040),d=n(20821),u=n(33455);n(94781);let h=n(79862),p=r._(n(71124)),f=n(83011),m={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!0,unoptimized:!1};function g(e,t,n,r,o,i,s){let l=null==e?void 0:e.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&o(!0),null==n?void 0:n.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,o=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}(null==r?void 0:r.current)&&r.current(e)}}))}function y(e){return s.use?{fetchPriority:e}:{fetchpriority:e}}let v=(0,s.forwardRef)((e,t)=>{let{src:n,srcSet:r,sizes:o,height:l,width:a,decoding:c,className:d,style:u,fetchPriority:h,placeholder:p,loading:m,unoptimized:v,fill:b,onLoadRef:w,onLoadingCompleteRef:k,setBlurComplete:x,setShowAltText:S,sizesInput:M,onLoad:C,onError:O,...A}=e,E=(0,s.useCallback)(e=>{e&&(O&&(e.src=e.src),e.complete&&g(e,p,w,k,x,v,M))},[n,p,w,k,x,O,v,M]),T=(0,f.useMergedRef)(t,E);return(0,i.jsx)("img",{...A,...y(h),loading:m,width:a,height:l,decoding:c,"data-nimg":b?"fill":"1",className:d,style:u,sizes:o,srcSet:r,src:n,ref:T,onLoad:e=>{g(e.currentTarget,p,w,k,x,v,M)},onError:e=>{S(!0),"empty"!==p&&x(!0),O&&O(e)}})});function b(e){let{isAppRouter:t,imgAttributes:n}=e,r={as:"image",imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:n.crossOrigin,referrerPolicy:n.referrerPolicy,...y(n.fetchPriority)};return t&&l.default.preload?(l.default.preload(n.src,r),null):(0,i.jsx)(a.default,{children:(0,i.jsx)("link",{rel:"preload",href:n.srcSet?void 0:n.src,...r},"__nimg-"+n.src+n.srcSet+n.sizes)})}let w=(0,s.forwardRef)((e,t)=>{let n=(0,s.useContext)(h.RouterContext),r=(0,s.useContext)(u.ImageConfigContext),o=(0,s.useMemo)(()=>{var e;let t=m||r||d.imageConfigDefault,n=[...t.deviceSizes,...t.imageSizes].sort((e,t)=>e-t),o=t.deviceSizes.sort((e,t)=>e-t),i=null==(e=t.qualities)?void 0:e.sort((e,t)=>e-t);return{...t,allSizes:n,deviceSizes:o,qualities:i}},[r]),{onLoad:l,onLoadingComplete:a}=e,f=(0,s.useRef)(l);(0,s.useEffect)(()=>{f.current=l},[l]);let g=(0,s.useRef)(a);(0,s.useEffect)(()=>{g.current=a},[a]);let[y,w]=(0,s.useState)(!1),[k,x]=(0,s.useState)(!1),{props:S,meta:M}=(0,c.getImgProps)(e,{defaultLoader:p.default,imgConf:o,blurComplete:y,showAltText:k});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v,{...S,unoptimized:M.unoptimized,placeholder:M.placeholder,fill:M.fill,onLoadRef:f,onLoadingCompleteRef:g,setBlurComplete:w,setShowAltText:x,sizesInput:e.sizes,ref:t}),M.priority?(0,i.jsx)(b,{isAppRouter:!n,imgAttributes:S}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},83011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return o}});let r=n(12115);function o(e,t){let n=(0,r.useRef)(null),o=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(n.current=i(e,r)),t&&(o.current=i(t,r))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},83457:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]])},83654:(e,t,n)=>{"use strict";var r=n(12115),o=n(14806),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.useSyncExternalStore,l=r.useRef,a=r.useEffect,c=r.useMemo,d=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var u=l(null);if(null===u.current){var h={hasValue:!1,value:null};u.current=h}else h=u.current;var p=s(e,(u=c(function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),void 0!==o&&h.hasValue){var t=h.value;if(o(t,e))return l=t}return l=e}if(t=l,i(s,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(s=e,t):(s=e,l=n)}var s,l,a=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]))[0],u[1]);return a(function(){h.hasValue=!0,h.value=p},[p]),d(p),p}},84441:()=>{},86340:()=>{},86651:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},88634:(e,t,n)=>{var r=n(75476),o=n(23410);e.exports=function(e,t,n,i,s){return new o(r().w(e,t,n,i),s||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},88661:(e,t,n)=>{"use strict";e.exports=n(45688).style},89559:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},89715:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]])},90737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return r}});let r=n(28140)._(n(12115)).default.createContext({})},91078:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},91169:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},91761:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},92639:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},93499:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]])},93826:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},94089:e=>{function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},98404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},99708:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(45105).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},99957:(e,t,n)=>{"use strict";function r(e){let{title:t,description:n,pageTitle:r,pageDescription:o,keywords:i="security, guard services, risk management, technology integration, professional security",ogImage:s="/og-image.jpg",canonicalUrl:l,type:a="website",publishedTime:c,modifiedTime:d,author:u,section:h,tags:p,price:f,currency:m,availability:g}=e;return null}n.d(t,{default:()=>r})}}]);